Skip to content

Commit

Permalink
add proxy configuration option
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael-theriault-swi committed Aug 24, 2023
1 parent 30a3a26 commit cff50ad
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .yarn/versions/871d8c64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
releases:
"@solarwinds-apm/bindings": patch
"@solarwinds-apm/sdk": minor
solarwinds-apm: minor
3 changes: 0 additions & 3 deletions packages/bindings/src/oboe/reporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
#include "metadata.hh"

Reporter* from_options(swo::Object const& options) {
auto defaults = oboe_init_options_t{.version = 15};
oboe_init_options_set_defaults(&defaults);

auto hostname_alias = options.get<std::string>("hostname_alias");
auto log_level = options.get<int>("log_level");
auto log_file_path = options.get<std::string>("log_file_path");
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface SwoConfiguration {
enabled: boolean
collector?: string
certificate?: string
proxy?: string
metricFormat?: number
oboeLogLevel: number
otelLogLevel: DiagLogLevel
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function createReporter(config: SwoConfiguration): oboe.Reporter {
file_single: 0,

ec2_metadata_timeout: -1,
grpc_proxy: "",
grpc_proxy: config.proxy ?? "",
stdout_clear_nonblocking: 0,
metric_format: config.metricFormat ?? 2,
})
Expand Down
20 changes: 11 additions & 9 deletions packages/solarwinds-apm/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ All configuration options are optional except for the service key which is alway

## Environment Variables

| Name | Default | Description |
| ------------------------------ | ----------------- | ----------------------------------------------- |
| **`SW_APM_SERVICE_KEY`** | | **Service key** |
| `SW_APM_ENABLED` | `true` | Whether instrumentation should be enabled |
| `SW_APM_COLLECTOR` | Default collector | Collector URL |
| `SW_APM_TRUSTED_PATH` | None | Path to the collector's SSL certificate |
| `SW_APM_LOG_LEVEL` | `info` | Logging level for the instrumentation libraries |
| `SW_APM_TRIGGER_TRACE_ENABLED` | `true` | Whether trigger tracing should be enabled |
| `SW_APM_RUNTIME_METRICS` | `true` | Whether runtime metrics should be enabled |
| Name | Default | Description |
| ------------------------------ | ----------------- | ------------------------------------------------- |
| **`SW_APM_SERVICE_KEY`** | | **Service key** |
| `SW_APM_ENABLED` | `true` | Whether instrumentation should be enabled |
| `SW_APM_COLLECTOR` | Default collector | Collector URL |
| `SW_APM_TRUSTED_PATH` | None | Path to the collector's SSL certificate |
| `SW_APM_PROXY` | None | URL of a proxy to use to connect to the collector |
| `SW_APM_LOG_LEVEL` | `info` | Logging level for the instrumentation libraries |
| `SW_APM_TRIGGER_TRACE_ENABLED` | `true` | Whether trigger tracing should be enabled |
| `SW_APM_RUNTIME_METRICS` | `true` | Whether runtime metrics should be enabled |

## Configuration File

Expand Down Expand Up @@ -54,6 +55,7 @@ module.exports = {
| `enabled` | `true` | Whether instrumentation should be enabled |
| `collector` | Default collector | Collector URL |
| `trustedPath` | None | Path to the collector's SSL certificate |
| `proxy` | None | URL of a proxy to use to connect to the collector |
| `logLevel` | `info` | Logging level for the instrumentation libraries |
| `triggerTraceEnabled` | `true` | Whether trigger tracing should be enabled |
| `runtimeMetrics` | `true` | Whether runtime metrics should be enabled |
Expand Down
1 change: 1 addition & 0 deletions packages/solarwinds-apm/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export function readConfig(): ExtendedSwoConfiguration {
},
collector: { env: true, file: true, parser: String },
trustedPath: { env: true, file: true, parser: String },
proxy: { env: true, file: true, parser: String },
logLevel: {
env: true,
file: true,
Expand Down

0 comments on commit cff50ad

Please sign in to comment.