Skip to content
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

Correct multiple traceparent header logging #2154

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ static W3CTraceParent parseHeaders(List<String> traceParentHeaders) {
return null;
}
if (traceParentHeaders.size() > 1) {
ServiceFactory.getStatsService().getMetricAggregator().incrementCounter(MetricNames.SUPPORTABILITY_TRACE_CONTEXT_INVALID_PARENT_HEADER_COUNT);
Agent.LOG.log(Level.WARNING, "Multiple traceparent headers found on inbound request.");
// Multiple values ok if all are equal
String first = traceParentHeaders.get(0);
for (String header : traceParentHeaders) {
if (!header.equals(first)) {
return null;
ServiceFactory.getStatsService().getMetricAggregator().incrementCounter(MetricNames.SUPPORTABILITY_TRACE_CONTEXT_INVALID_PARENT_HEADER_COUNT);
Agent.LOG.log(Level.WARNING, "Multiple, different, traceparent headers found on inbound request.");
return null;
}
}
}
Expand Down
Loading