private void EndRequest(object sender, EventArgs e) { IManagedTracer tracer = TracerManager.GetCurrentTracer(); if (tracer == null) { return; } // End the span and annotate it with information from the current response. tracer.AnnotateSpan(Labels.FromHttpResponse(HttpContext.Current.Response)); tracer.EndSpan(); }
/// <summary> /// Gets the current <see cref="IManagedTracer"/> for the given request. /// </summary> public static IManagedTracer GetCurrentTracer() { return(TracerManager.GetCurrentTracer() ?? DoNothingTracer.Instance); }