Skip to content

Commit

Permalink
fix: add workaround for OTEL_TRACES_EXPORTER logging an error message (
Browse files Browse the repository at this point in the history
…#783)

* fix: add workaround for OTEL_TRACES_EXPORTER logging an error message

* fix: set OTEL_TRACES_EXPORTER to empty string

* fix: don't set the OTEL_TRACES_EXPORTER env var unless necessary

* doc: fix signalfx url
  • Loading branch information
seemk authored Aug 16, 2023
1 parent 060fbcb commit 62e4430
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ distribution of [OpenTelemetry JS](https://github.com/open-telemetry/opentelemet
It is licensed under the terms of the Apache Software License version 2.0. See [the
license file](./LICENSE) for more details.

>ℹ️  SignalFx was acquired by Splunk in October 2019. See [Splunk SignalFx](https://www.splunk.com/en_us/investor-relations/acquisitions/signalfx.html) for more information.
>ℹ️  SignalFx was acquired by Splunk in October 2019. See [Splunk SignalFx](https://www.splunk.com/en_us/about-splunk/acquisitions/signalfx.html) for more information.
9 changes: 8 additions & 1 deletion src/tracing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,15 @@ export function startTracing(opts: StartTracingOptions = {}): boolean {
tracingContextManagerEnabled = true;
}

// tracer provider
// Workaround for https://github.com/open-telemetry/opentelemetry-js/issues/3422
const envTracesExporter = process.env.OTEL_TRACES_EXPORTER;
if (envTracesExporter !== undefined) {
process.env.OTEL_TRACES_EXPORTER = '';
}
const provider = new NodeTracerProvider(options.tracerConfig);
if (envTracesExporter !== undefined) {
process.env.OTEL_TRACES_EXPORTER = envTracesExporter;
}

configureInstrumentations(options);

Expand Down

0 comments on commit 62e4430

Please sign in to comment.