From f7f48cd5b55123a50342ad091497fbfb5d406fcf Mon Sep 17 00:00:00 2001 From: Mike Goldsmth Date: Tue, 15 Nov 2022 14:24:28 +0000 Subject: [PATCH] Update aspnetcore instrumentation to 1.0.0-rc9.9 --- ...enTelemetry.Instrumentation.AspNetCore.csproj | 2 +- .../TracerProviderBuilderExtensions.cs | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Honeycomb.OpenTelemetry.Instrumentation.AspNetCore/Honeycomb.OpenTelemetry.Instrumentation.AspNetCore.csproj b/src/Honeycomb.OpenTelemetry.Instrumentation.AspNetCore/Honeycomb.OpenTelemetry.Instrumentation.AspNetCore.csproj index 6f0cb69..d607653 100644 --- a/src/Honeycomb.OpenTelemetry.Instrumentation.AspNetCore/Honeycomb.OpenTelemetry.Instrumentation.AspNetCore.csproj +++ b/src/Honeycomb.OpenTelemetry.Instrumentation.AspNetCore/Honeycomb.OpenTelemetry.Instrumentation.AspNetCore.csproj @@ -27,7 +27,7 @@ - + diff --git a/src/Honeycomb.OpenTelemetry.Instrumentation.AspNetCore/TracerProviderBuilderExtensions.cs b/src/Honeycomb.OpenTelemetry.Instrumentation.AspNetCore/TracerProviderBuilderExtensions.cs index 5ea4af6..99d62fa 100644 --- a/src/Honeycomb.OpenTelemetry.Instrumentation.AspNetCore/TracerProviderBuilderExtensions.cs +++ b/src/Honeycomb.OpenTelemetry.Instrumentation.AspNetCore/TracerProviderBuilderExtensions.cs @@ -29,14 +29,18 @@ public static TracerProviderBuilder AddAspNetCoreInstrumentationWithBaggage(this /// being configured. public static void EnrichWithBaggage(this AspNetCoreInstrumentationOptions options) { - options.Enrich = (activity, eventName, _) => + options.EnrichWithHttpRequest = (activity, request) => { - if (eventName == "OnStartActivity") + foreach (var entry in Baggage.Current) { - foreach (var entry in Baggage.Current) - { - activity.SetTag(entry.Key, entry.Value); - } + activity.SetTag(entry.Key, entry.Value); + } + }; + options.EnrichWithHttpResponse = (activity, response) => + { + foreach (var entry in Baggage.Current) + { + activity.SetTag(entry.Key, entry.Value); } }; }