-
Notifications
You must be signed in to change notification settings - Fork 87
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
How to add B3-headers to an inbound request and response? #213
Comments
Hi @ilya-chumakov, Did you see https://github.com/openzipkin/zipkin4net/blob/master/Examples/aspnetcore/frontend/Startup.cs#L19 ? Basically, you need to pass a TracingHandler to HTTP clients in order for them to forward traces. |
also note that adding headers to the response is unusual as B3 headers were
not initially designed for the backtrace. some notes here
openzipkin/b3-propagation#4
|
@fedj yes, I did. TracingHandler is for outbound requests, isn't it? I want to modify an inbound one. Let's say that there is only a WebAPI app which doesn't make any external HTTP calls. This app is called by someone, but it is not possible to force every caller to fill these headers. @adriancole I would like to give the users (i.e. who calls our APIs) a kind of "request id". They could return it back to us in case of a problem happened. How else could I achieve that without response headers propagation? |
@adriancole <https://github.com/adriancole> I would like to give the
users (i.e. who calls our APIs) a kind of "request id". They could return
it back to us in case of a problem happened. How else could I achieve that
without response headers propagation?
request ids can be determined up front, which then mean you don't need the
response to know them. Just know B3 isn't meant for backwards propagation
so you can't rely on other frameworks to automatically do this. If your
shop has homogeneous deployments you can certainly make it work.
https://gitter.im/openzipkin/zipkin for more on this topic if you like as
response propagation is a kindof open ended discussion. cheers!
|
@adriancole thanks, I unsuccessfully have tried that gitter channel before posting here :) If I'm going to create a middleware filling the headers with a tracing context manually and put it before |
I don't know dotnet so would want maybe @fedj or someone else to help with
the example request
|
The middleware is located in https://github.com/openzipkin/zipkin4net/blob/8e73b3c93ef0e9b661ca3aae89d70c423abf9775/Src/zipkin4net.middleware.aspnetcore/Src/TracingMiddleware.cs You would need to Inject B3 headers using the Propagations.B3String.Injector |
Hello, I'm trying zipkin4net 1.2.1 in a .Net Core 2.1 WebAPI app.
I expected that
UseTracingMiddleware
would add tracing headers toHttpContext.Request
andHttpContext.Response
for an inbound request. However, it seems the middleware just make calls to a Zipkin instance.Should I add the tracing headers to the request/response manually? How to get a correct
TraceId
in that case?The text was updated successfully, but these errors were encountered: