Skip to content

Commit

Permalink
Update src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebR…
Browse files Browse the repository at this point in the history
…equestActivitySource.netfx.cs

Co-authored-by: Johannes Tax <[email protected]>
  • Loading branch information
matt-hensley and pyohannes authored Sep 19, 2023
1 parent 8bd64ef commit 6ca5c9d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,11 @@ private static bool IsRequestInstrumented(HttpWebRequest request)

private static void ProcessRequest(HttpWebRequest request)
{
// No subscribers to the ActivitySource or User provider Filter is
// There are subscribers to the ActivitySource and no user-provided filter is
// filtering this request.
var skipTracing = !WebRequestActivitySource.HasListeners() || !Options.EventFilterHttpWebRequest(request);
var enableTracing = WebRequestActivitySource.HasListeners() && Options.EventFilterHttpWebRequest(request);

if (skipTracing && !HttpClientDuration.Enabled)
if (!enableTracing && !HttpClientDuration.Enabled)
{
// Tracing and metrics are not enabled, so we can skip generating signals
// Propagation must still be done in such cases, to allow
Expand Down

0 comments on commit 6ca5c9d

Please sign in to comment.