-
Notifications
You must be signed in to change notification settings - Fork 838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle distributed context headers in custom propagator #1533
Handle distributed context headers in custom propagator #1533
Conversation
58a7e18
to
2f67321
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should update the direct-forwarding docs to include changing this property on the SocketsHttpHandler
as well:
reverse-proxy/docs/docfx/articles/direct-forwarding.md
Lines 51 to 57 in 96ed54f
var httpClient = new HttpMessageInvoker(new SocketsHttpHandler() | |
{ | |
UseProxy = false, | |
AllowAutoRedirect = false, | |
AutomaticDecompression = DecompressionMethods.None, | |
UseCookies = false | |
}); |
As for the breaking-change
: anyone using direct forwarding will have to set the ActivityHeadersPropagator
property to match existing behavior.
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
I noticed that example there doesn't match with |
Yes please. We should also consider updating https://microsoft.github.io/reverse-proxy/articles/header-guidelines.html#traceparent-request-id-tracestate-baggage-correlation-context to mention you can turn header removal off by calling .ConfigureHttpHandler((_, handler) => handler.Propagator = null) (might not be the exact syntax) in Startup |
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverse-proxy/samples/ReverseProxy.Direct.Sample/Startup.cs
Lines 36 to 42 in 96ed54f
var httpClient = new HttpMessageInvoker(new SocketsHttpHandler() | |
{ | |
UseProxy = false, | |
AllowAutoRedirect = false, | |
AutomaticDecompression = DecompressionMethods.None, | |
UseCookies = false | |
}); |
should include the ActivityHeadersPropagator
.
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Oh, forgot this one, adding... |
eae5f30
to
2b905fd
Compare
Resolves #1497
Added
ReverseProxyPropagator
that handles headers removal. Default inner implementation removes distributed context headers. It can be changed by overridingPropagator
property inForwarderHttpClientFactory
which is used to set uphandler.ActivityHeadersPropagator
.