Skip to content

Commit

Permalink
Add short-circuit if not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jmezach committed Oct 9, 2020
1 parent 4e381b8 commit cbc128d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ReverseProxy/Telemetry/DiagnosticsHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
throw new ArgumentNullException(nameof(request)); //, SR.net_http_handler_norequest); TODO: Is this really necessary?
}

// Short-circuit to inner handler if we're not enabled at all
if (!IsEnabled())
{
return await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
}

Activity activity = null;

// if there is no listener, but propagation is enabled (with previous IsEnabled() check)
Expand Down

0 comments on commit cbc128d

Please sign in to comment.