Skip to content
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

New Feature - Add the traceid in the response headers #280

Closed
zpf1989 opened this issue Mar 17, 2018 · 3 comments · Fixed by #286

Comments

@zpf1989
Copy link

@zpf1989 zpf1989 commented Mar 17, 2018

Hi,we are using Butterfly in Ocelot for tracing.
Generally,when client request fails,we want to find the exact trace quickly.
I think it is fastest to search a trace by traceId ,because it matches only one trace.
So could you add the traceid in the response headers when using tracing before return?
Just like this below:
responseMessage.Headers.TryAddWithoutValidation("TraceId", span.SpanContext.TraceId);


Thanks!

@TomPallister

This comment has been minimized.

Copy link
Member

@TomPallister TomPallister commented Mar 17, 2018

@zpf1989 That sounds fine to me but I would probably make it configurable. Some users might not want to expose the trace ID. Maybe extend this feature
http://ocelot.readthedocs.io/en/latest/features/headerstransformation.html#placeholders.

e.g..

"DownstreamHeaderTransform": {
    "Trace-Id": "Trace-Id, {TraceId}"
},

This would then add the TraceId as a header called Trace-Id but Trace-Id could be whatever you want. I will look into it asap!

@zpf1989

This comment has been minimized.

Copy link
Author

@zpf1989 zpf1989 commented Mar 17, 2018

Yeah,that's considerate!
Thanks!

@TomPallister TomPallister changed the title Advice-Add the traceid in the response headers Few Feature - Add the traceid in the response headers Mar 17, 2018
@TomPallister TomPallister changed the title Few Feature - Add the traceid in the response headers New Feature - Add the traceid in the response headers Mar 17, 2018
TomPallister pushed a commit that referenced this issue Mar 17, 2018
…te the header place holder stuff
TomPallister pushed a commit that referenced this issue Mar 18, 2018
Tom Gardham-Pallister
TomPallister pushed a commit that referenced this issue Mar 18, 2018
…ders into one class
TomPallister added a commit that referenced this issue Mar 18, 2018
* #280 can now add response headers inc trace id, now need to consolidate the header place holder stuff

* #280 changed port for linux tests

* #280 lots of hacking around to handle errors and consolidate placeholders into one class
@TomPallister TomPallister reopened this Mar 18, 2018
@TomPallister

This comment has been minimized.

Copy link
Member

@TomPallister TomPallister commented Mar 18, 2018

released in version 5.1.0

@FelixBoers FelixBoers referenced this issue Apr 13, 2018
2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.