dotnet / dotnet/aspnetcore

Add support for HTTP trace context transfer during a http redirect

Open
#27,422 4 comments 1 reaction 0 assignees View on GitHub
affected-very-few area-hosting area-networking enhancement feature-httpclientfactory severity-minor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

DotNet supports trace-context transfer through headers in the HTTP communication.
But when HTTP redirect occurs, the trace context information lost.
Currently, the W3C standard does not cover this case also, see: https://github.com/w3c/trace-context/issues/438
But there are not too big amount of possible options.

Until HttpClients will start to support trace context headers preserving during HTTP redirects (which might never happen), query string can be used as a transport.
1) W3C should standardize the query string parameter names, for example (they should not interfere with app-specific names and be short):
* _tc_tid
* _tc_pid
* etc

2) Asp.Net Core middleware that currently responsible for the Activity creation should also take into account the query string (not only headers)
3) ```Microsoft.Extensions.Http``` library should be improved to instrument ```HttpClient``` if this feature is turned on.
4) Microsoft.AspNet.TelemetryCorrelation library should be extended https://github.com/aspnet/Microsoft.AspNet.TelemetryCorrelation/issues/78
5) Until W3C introduces the names for the query string parameter names they should be configurable in all the above implementations.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.