Skip to content

Commit

Permalink
Update src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentati…
Browse files Browse the repository at this point in the history
…on.cs

Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
  • Loading branch information
Kielek and CodeBlanch authored Nov 5, 2024
1 parent 42a5e58 commit a228bcb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public HttpClientInstrumentation(HttpClientTraceInstrumentationOptions options)
// the framework will fall back to creating activity anyways due to active diagnostic source listener
// To prevent this, isEnabled is implemented which will return false always
// so that the sampler's decision is respected.
this.diagnosticSourceSubscriber = HttpHandlerDiagnosticListener.IsNet7OrGreater ? new DiagnosticSourceSubscriber(new HttpHandlerDiagnosticListener(options), this.isEnabledNet7OrGreater, HttpInstrumentationEventSource.Log.UnknownErrorProcessingEvent) : new DiagnosticSourceSubscriber(new HttpHandlerDiagnosticListener(options), this.isEnabled, HttpInstrumentationEventSource.Log.UnknownErrorProcessingEvent);
this.diagnosticSourceSubscriber = HttpHandlerDiagnosticListener.IsNet7OrGreater
? new DiagnosticSourceSubscriber(new HttpHandlerDiagnosticListener(options), this.isEnabledNet7OrGreater, HttpInstrumentationEventSource.Log.UnknownErrorProcessingEvent)
: new DiagnosticSourceSubscriber(new HttpHandlerDiagnosticListener(options), this.isEnabled, HttpInstrumentationEventSource.Log.UnknownErrorProcessingEvent);

this.diagnosticSourceSubscriber.Subscribe();
}
Expand Down

0 comments on commit a228bcb

Please sign in to comment.