1 instantiation of HttpMetricsEnrichmentContext
System.Net.Http (1)
System\Net\Http\Metrics\HttpMetricsEnrichmentContext.cs (1)
108var context = new HttpMetricsEnrichmentContext
15 references to HttpMetricsEnrichmentContext
System.Net.Http (15)
System\Net\Http\Metrics\HttpMetricsEnrichmentContext.cs (12)
14/// Enrichment is done on per-request basis by callbacks registered with <see cref="AddCallback(HttpRequestMessage, Action{HttpMetricsEnrichmentContext})"/>. 16/// information exposed on the <see cref="HttpMetricsEnrichmentContext"/> instance. 19/// > The <see cref="HttpMetricsEnrichmentContext"/> instance must not be used from outside of the enrichment callbacks. 23private static readonly HttpRequestOptionsKey<List<Action<HttpMetricsEnrichmentContext>>> s_optionsKeyForCallbacks = new(nameof(HttpMetricsEnrichmentContext)); 71public static void AddCallback(HttpRequestMessage request, Action<HttpMetricsEnrichmentContext> callback) 78if (options.TryGetValue(s_optionsKeyForCallbacks, out List<Action<HttpMetricsEnrichmentContext>>? callbacks)) 88internal static List<Action<HttpMetricsEnrichmentContext>>? GetEnrichmentCallbacksForRequest(HttpRequestMessage request) 93return (List<Action<HttpMetricsEnrichmentContext>>)callbacks!; 100List<Action<HttpMetricsEnrichmentContext>> callbacks, 108var context = new HttpMetricsEnrichmentContext 116foreach (Action<HttpMetricsEnrichmentContext> callback in callbacks)
System\Net\Http\Metrics\MetricsHandler.cs (3)
129List<Action<HttpMetricsEnrichmentContext>>? callbacks = HttpMetricsEnrichmentContext.GetEnrichmentCallbacksForRequest(request); 136HttpMetricsEnrichmentContext.RecordDurationWithEnrichment(callbacks, request, response, exception, durationTime, tags, _requestsDuration);