Open linux0x5c opened 1 year ago
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.
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?