Skip to content

Commit

Permalink
Update servlet attr names to match log attr names (open-telemetry#2593)
Browse files Browse the repository at this point in the history
  • Loading branch information
trask authored Mar 18, 2021
1 parent f26901d commit 8112593
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public Context startSpan(HttpServletRequest request, String spanName) {

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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down

0 comments on commit 8112593

Please sign in to comment.