AspNet HttpInListener OnStopActivity is called after Activity is stopped by TelemetryHttpModule #1138
Labels
bug
Something isn't working
comp:instrumentation.aspnet.telemetryhttpmodule
Things related to OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule
comp:instrumentation.aspnet
Things related to OpenTelemetry.Instrumentation.AspNet
Bug Report
List of all OpenTelemetry NuGet
packages and version that you are
using (e.g.
OpenTelemetry 1.0.2
):Runtime version:
Symptom
The "OpenTelemetry.Instrumentation.AspNet.Telemetry" span is processed and exported before it can be enriched by the the
HttpInListener
and any customEnrich
callbacks.What is the expected behavior?
For example, the DisplayName of the Activity should be set to the MVC Route instead of the raw URL.
What is the actual behavior?
The DisplayName of the Activity remains the raw URL
Additional Context
In https://github.com/open-telemetry/opentelemetry-dotnet/blob/1.0.0-rc9.3/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/ActivityHelper.cs#L141, we can see that
aspNetActivity.Stop();
is called before invoking theonRequestStoppedCallback
. That callback is responsible for calling intoOnStopActivity
onHttpInListener
which can update the name based on the route template can call theEnrich
callback method.I think that calling
Stop()
on the activity automatically triggers the ActivityListeners, including processors and exporters, to handle when the Activity is stopped.Is it as simple as moving
Stop()
to after the callbacks?The text was updated successfully, but these errors were encountered: