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

Change Spring Scheduling to not capture span for one-time jobs (only repeated jobs) #7760

Merged
merged 14 commits into from
Feb 13, 2023

Conversation

heyams
Copy link
Contributor

@heyams heyams commented Feb 7, 2023

We are seeing examples where Spring Scheduling INTERNAL spans are created inside of an existing parent span, which creates unnecessary noise.

And these spans don't necessary make sense as these are not "background jobs" (since they occur inside of an existing span).

(see for example microsoft/ApplicationInsights-Java#2870)

This PR changes Spring Scheduling instrumentation to only instrumenting repeating jobs, not one-time scheduled jobs (which corresponds to ScheduledExecutorService behavior where context is not propagated to runnable)

@heyams heyams marked this pull request as ready for review February 8, 2023 18:24
@heyams heyams requested a review from a team as a code owner February 8, 2023 18:24
@trask trask changed the title Suppress InProc Dependencies from Spring Scheduling Suppress Spring Scheduling spans when they already have a parent Feb 8, 2023
…n/java/io/opentelemetry/javaagent/instrumentation/spring/scheduling/v3_1/SpringSchedulingRunnableWrapper.java
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.

can you add a test for this?

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 @heyams!

(and thanks @mateuszrzeszutek for the idea to only instrument repeating jobs!)

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
@trask trask enabled auto-merge (squash) February 13, 2023 18:49
@trask trask disabled auto-merge February 13, 2023 18:49
@heyams heyams changed the title Suppress Spring Scheduling spans when they already have a parent Change Spring Scheduling to not capture span for one-time jobs (only repeated jobs) Feb 13, 2023
@trask trask merged commit c61996f into open-telemetry:main Feb 13, 2023
heyams added a commit to microsoft/ApplicationInsights-Java that referenced this pull request Feb 22, 2023
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.

None yet

3 participants