-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
enhancementNew feature or requestNew feature or requestneeds triageNew issue that requires triageNew issue that requires triage
Description
Is your feature request related to a problem? Please describe.
The scenario is to expect that the response header can be added quickly in the service close to the frontend without extending HttpServerResponseCustomizer
Does this requirement involve sepcs?
Describe the solution you'd like
The configuration is probably like this,default value is null
otel.instrumentation.common.http.server.tracei.header.name=X-Test-TraceId
Similar behavior to below
@AutoService(HttpServerResponseCustomizer.class)
public class TestAgentHttpResponseCustomizer implements HttpServerResponseCustomizer {
@Override
public <T> void customize(
Context serverContext, T response, HttpServerResponseMutator<T> responseMutator) {
SpanContext spanContext = Span.fromContext(serverContext).getSpanContext();
String traceId = spanContext.getTraceId();
responseMutator.appendHeader(response, "X-Test-TraceId", traceId);
}
}
Describe alternatives you've considered
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestneeds triageNew issue that requires triageNew issue that requires triage