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

Consolidate span suppression logic into the BaseTracer #2106

Merged

Conversation

jkwatson
Copy link
Contributor

Depends on #2105 (will rebase after that is merged)

@@ -83,6 +80,25 @@ public Span getCurrentSpan() {
return Span.current();
}

protected final boolean shouldNotSuppressSpan(Kind proposedKind, Context context) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we name this method shouldStartSpan? Current name is too close to double negation IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't like the double negative either. But,I also want something that references suppression. Unless we want everything to always call this method before starting a span. We could reverse the logic if we're ok with all the current callers negating it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, in theory as of now all instrumentations should/could make a check before starting a span. Either to prevent nested SERVER/CLIENT spans or to check CallDepth for INTERNAL spans. This may mean that "we want everything to always call this method before starting a span". But nested client spans may become allowed...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right. the main reason for this change was to make it so that we could have one place to handle the supression logic, especially if the logic was going to change. Happy to rename to shouldStartSpan if folks think that's not too generic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also just realized that this method is now unit-testable. I'll do the rename and add some unit tests.

@jkwatson jkwatson force-pushed the consolidate_suppression_logic branch from 31fde4e to 26c681b Compare January 25, 2021 16:48
Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

thx!

Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

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

Cool

@anuraaga anuraaga merged commit af5719b into open-telemetry:master Jan 26, 2021
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.

5 participants