-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Description
I'm adding a new exemplar feature to the Aspire dashboard. Basically, when a metric is recorded, in-progress spans are included as example data.
However, I never see the HttpClient span as an exemplar. Someone should investigate why and fix this.
I don't know exactly how this feature technically works. However, my theory is the HttpClient span is ended before http.client.request.duration
recorded, so the HttpClient activity isn't available for opentelemetry-sdk to associate with the metric. The order may need to be flipped: record http.client.request.duration
and then stop the activity. I think it is a matter of making the metrics handler a child of the diagnostics handler here.
Reproduction Steps
Capture OTEL data with metrics + exemplars enabled + make HTTP requests with HttpClient.
See dotnet/aspire#4629 for an example.
Expected behavior
HttpClient spans show update as exemplars.
Actual behavior
HttpClient spans are never exemplars.
Regression?
No
Known Workarounds
No response
Configuration
.NET 8
Other information
No response