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

Update the http.route attribute even for not sampled server spans #5844

Merged
merged 1 commit into from
Apr 15, 2022

Conversation

mateuszrzeszutek
Copy link
Member

Even if the span is not sampled, the HTTP server metrics still use that attribute.

Fixes #5840

@mateuszrzeszutek mateuszrzeszutek requested a review from a team April 15, 2022 14:53
Comment on lines -105 to +107
// checking isRecording() is a helpful optimization for more expensive suppliers
// (e.g. Spring MVC instrumentation's HandlerAdapterInstrumentation)
if (serverSpan == null || !serverSpan.isRecording()) {
// even if the server span is not sampled, we have to continue - we need to compute the
// http.route properly so that it can be captured by the server metrics
if (serverSpan == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭

@trask trask merged commit 1ad0342 into open-telemetry:main Apr 15, 2022
@mateuszrzeszutek mateuszrzeszutek deleted the not-sampled-http-route branch April 19, 2022 05:13
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing traces/spans for requests
3 participants