Skip to content

Commit 3364927

Browse files
authored
fix(tracing): now when debug is enabled the otlp exporter still works (#126)
1 parent 26e0bbc commit 3364927

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/tracing/tracing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ export class Tracing implements TelemetryBase<void> {
6767
const { serviceVersion, serviceName, traceRatio, ...exporterConfig } = this.config;
6868

6969
const exporter = new OTLPTraceExporter(exporterConfig);
70-
let processors: SpanProcessor[] = [new BatchSpanProcessor(exporter)];
70+
const processors: SpanProcessor[] = [new BatchSpanProcessor(exporter)];
7171

7272
if (this.config.debug) {
7373
api.diag.setLogger(new api.DiagConsoleLogger(), api.DiagLogLevel.ALL);
74-
processors = [new SimpleSpanProcessor(new ConsoleSpanExporter())];
74+
processors.push(new SimpleSpanProcessor(new ConsoleSpanExporter()));
7575
}
7676

7777
this.provider = new NodeTracerProvider({

0 commit comments

Comments
 (0)