Update servlet attr names to match log attr names (#2593)

This commit is contained in:
Trask Stalnaker 2021-03-18 05:03:06 -07:00 committed by GitHub
parent f26901df45
commit 811259376e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -32,8 +32,8 @@ public abstract class ServletHttpServerTracer<RESPONSE>
SpanContext spanContext = Span.fromContext(context).getSpanContext();
// we do this e.g. so that servlet containers can use these values in their access logs
request.setAttribute("traceId", spanContext.getTraceId());
request.setAttribute("spanId", spanContext.getSpanId());
request.setAttribute("trace_id", spanContext.getTraceId());
request.setAttribute("span_id", spanContext.getSpanId());
return context;
}

View File

@ -280,8 +280,8 @@ class TestAccessLogValve extends ValveBase implements AccessLog {
void log(Request request, Response response, long time) {
synchronized (loggedIds) {
loggedIds.add(new Tuple2(request.getAttribute("traceId"),
request.getAttribute("spanId")))
loggedIds.add(new Tuple2(request.getAttribute("trace_id"),
request.getAttribute("span_id")))
loggedIds.notifyAll()
}
}