-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add option to return the traceId to the API user #8124
Comments
I think this is in the scope of another plugin as it has nothing to do with either distributed tracing or zipkin. That said, this is a good feature request for kong. |
If the zipkin plugin had the chance to echo the header back to the API user, we could use the response transformer plugin to rename that header to whatever we want and no new plugin is needed. That could look exactly like the correlation id plugin:
If true Kong returns the |
This is a useful feature request, would like to see something like this added! |
I don't doubt it is useful but I am not sure it belongs here. Returning |
It means here that the client code is "evolved enough" to read the returned Maybe your requirement @r1ckr could be an addendum to the correlation id plugin which could use the trace-id as correlation-id from the zipkin-plugin if present, and generate it if not? |
It means here that the client code is "evolved enough" to read the
returned x-b3-traceid and print it in its logs without making the extra
effort to generate a traceid himself.
Totally fine use case. This can happen if the client is a UI and you want
to return a unique id so the user can contact customer service.
In case of tracing, you also have the sampling problem where you will be
able to correlate logs of all apps, but you have a lower chance of finding
that traceid in your tracing GUI.
True.
|
Folks, what we are trying to do here is to return the If we use the correlation-id plugin, it will indeed return the So, because of that we can go ahead and use the response-transformer plugin to rename that header, but it doesn't work, because the execution order of the correlation-id plugin is 1. So response-transformer happens before. If the zipkin plugin was able to echo this header back to the public, then we would be able to use response-transformer to rename that header to whatever we want. What you guys are proposing is to create a dependency in the correlation-id plugin, to configure it to read the trace-id as the correlation-id from the zipkin plugin if present? Do you thing that's better than having a config here to echo out the |
Just out of curiosity, what are the reasons?
I still think this could perfectly happen in this plugin. |
Well, convention headers for this type of information are
By this plugin you mean, zipkin or correlation-id? |
Dear contributor, |
Would be nice to be able to return the trace id back to the API user as an X-Request-Id or X-Correlation-Id header. The same way that the correlation id plugin does.
Something like:
config.external_http_header_name=X-Request-Id
If set, it would send back to the users the trace id in it.
The text was updated successfully, but these errors were encountered: