-
Notifications
You must be signed in to change notification settings - Fork 3.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
Can I add the Pinpoint-TraceID header to the response header through the pinpoint agent? #9223
Comments
Currently there is no such feature, It probably won't be difficult to develop. public class ServletResponseListener<RESP> {
public void destroyed(RESP response, final Throwable throwable, final int statusCode) {
//~~~
final Trace trace = this.traceContext.currentRawTraceObject();
if (trace == null) {
return;
}
if (trace.canSampled()) {
final SpanRecorder spanRecorder = trace.getSpanRecorder();
this.httpStatusCodeRecorder.record(spanRecorder, statusCode);
this.serverResponseHeaderRecorder.recordHeader(spanRecorder, response);
// Dump traceId to Response
if (enableDump) {
TraceId traceId = trace.getTraceId();
// Add setHeader API
serverResponseHeaderRecorder.setHeader(response, "Pinpoint-Response-TraceID", traceId.toString());
}
}
}
} How about developing this feature? |
@emeroad This is an exciting feature that extracts Trace-IDs directly from the browser's debug mode, allowing us to quickly locate problems,thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to see the TraceID of pinpoint through the client browser. Can I add this response header through the pinpoint agent configuration? If not, is there any API interface that can obtain the TraceID of this request?
The text was updated successfully, but these errors were encountered: