Provide HTTP client message handler to propagate dependency ID (option #1) #257
Labels
area:telemetry
All issues related to telemetry
service-to-service-correlation
Issues related to service to service correlation.
Milestone
Is your feature request related to a problem? Please describe.
When sending out a HTTP message, we need to track it as a HTTP dependency in Application Insights. To link the correlation between services, we need to propagate the dependency ID to the HTTP telemetry model and enrich the HTTP headers with the correlation information.
Describe the solution you'd like
Option 1 is to create an HTTP message handler that we can register in the Dependency Injection container, so the
IHttpClient
that is used throughout the application is enriched with this custom message handler.These message handlers are scoped dependencies, so we can inject our
ICorrelationInfoAccessor
easily to have access to the current correlation information.Describe alternatives you've considered
Option 2: where we provide and extension on the
HttpClient
#258.Additional context
https://thomaslevesque.com/2016/12/08/fun-with-the-httpclient-pipeline/
https://github.com/arcus-azure/arcus-service-to-service-correlation-poc
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-5.0
The text was updated successfully, but these errors were encountered: