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

Enable span suppression by SpanKey by default #5779

Merged
merged 15 commits into from
Apr 19, 2022

Conversation

mateuszrzeszutek
Copy link
Member

Resolves #5735 -- now suppression by SpanKey is the default suppression strategy; there is a configuration option that allows to choose the strategy.
Resolves #3965 -- adds a new "none" mode that does not suppress spans at all.

This PR includes a significant refactoring of the span suppression code, and includes a couple of new SpanKeys.

CC @lmolkova

(I'll mark it ready for review once I fix all the tests 🤞 )

@mateuszrzeszutek mateuszrzeszutek force-pushed the suppression branch 5 times, most recently from ad3cf14 to 4e0df4d Compare April 14, 2022 09:51
@mateuszrzeszutek mateuszrzeszutek marked this pull request as ready for review April 14, 2022 12:54
@mateuszrzeszutek mateuszrzeszutek requested a review from a team as a code owner April 14, 2022 12:54
Copy link
Member Author

@mateuszrzeszutek mateuszrzeszutek left a comment

Choose a reason for hiding this comment

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

This PR got a bit bigger than I expected it would be, but frankly ~half of it is just fixing the tests. The first commit contains the actual implementation and logic changes, the rest are just test/errorprone/spotless fixes.

Comment on lines -113 to -120
if (hasHttpClientSpan()) {
offset = 1
span(1) {
name "HTTP POST"
kind CLIENT
childOf span(0)
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

The AWS SQS.SendMessage span implements both RPC and HTTP conventions, thus it suppresses this HTTP span -- they both had the exact same net/HTTP attributes anyway.

Copy link
Member

Choose a reason for hiding this comment

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

@anuraaga this sounds like a good thing, just wanted to get your 👀 on it

Comment on lines -113 to -120
if (hasHttpClientSpan()) {
offset = 1
span(1) {
name "HTTP POST"
kind CLIENT
childOf span(0)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

@anuraaga this sounds like a good thing, just wanted to get your 👀 on it

"$SemanticAttributes.HTTP_URL.key" "https://api.twilio.com/2010-04-01/Accounts/abc/Messages.json"
"$SemanticAttributes.HTTP_STATUS_CODE.key" 200
}
}
Copy link
Member

Choose a reason for hiding this comment

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

and we get the underlying http span 🎉

@trask trask merged commit 4e3f19d into open-telemetry:main Apr 19, 2022
@mateuszrzeszutek mateuszrzeszutek deleted the suppression branch April 20, 2022 06:20
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
* Enable span suppression by SpanKey by default

* fix HTTP tests (probably)

* add exception for camel

* remove suppression tests from @WithSpan instrumentations

* remove suppression tests from @WithSpan instrumentation; spring boot autoconfigure

* fix twilio tests

* fix netty-based HTTP clients, remove AWS SDK 1.11 unit test

* fix elasticsearch tests

* codenarc

* spotless

* fix AWS SDK 1.11 tests

* remove a TODO

* code review comments

* fix merge conflict

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
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.

Enable span suppression by type (SpanKey) by default Provide an option to disable nested span suppression
2 participants