Skip to content

Commit

Permalink
Only run attribute processing in the shim.
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonWeber committed Aug 22, 2023
1 parent 11726ed commit 3d6f6ee
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/shim/telemetryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,12 @@ export class TelemetryClient {
this._idGenerator = new RandomIdGenerator();
this._console.enable(this._internalConfig.logInstrumentations);

this._attributeProcessor = new AttributeSpanProcessor(new AzureMonitorTraceExporter(this._options.azureMonitorExporterConfig), this.context.tags);
const tracerProvider = this._client.getTracerProvider() as NodeTracerProvider;
tracerProvider.addSpanProcessor(this._attributeProcessor);
// Only support attribute processing in the shim
if (_setupCalled) {
this._attributeProcessor = new AttributeSpanProcessor(new AzureMonitorTraceExporter(this._options.azureMonitorExporterConfig), this.context.tags);
const tracerProvider = this._client.getTracerProvider() as NodeTracerProvider;
tracerProvider.addSpanProcessor(this._attributeProcessor);
}
}

public getAzureMonitorOpenTelemetryClient(): AzureMonitorOpenTelemetryClient {
Expand Down

0 comments on commit 3d6f6ee

Please sign in to comment.