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

Unrelated Sidekiq job runs being grouped in same trace #2531

Open
nateberkopec opened this issue Jan 29, 2025 · 4 comments
Open

Unrelated Sidekiq job runs being grouped in same trace #2531

nateberkopec opened this issue Jan 29, 2025 · 4 comments

Comments

@nateberkopec
Copy link
Contributor

nateberkopec commented Jan 29, 2025

Issue Description

I'm seeing across multiple unrelated apps/projects this behavior where Sidekiq jobs are being grouped into the same parent trace, even though the job runs are completely unrelated:

Project A:

Image

Project B:

Image

You end up getting traces that are days long:

Image

I think this really messes with sampling, as now I can end up with massive traces from Sidekiq using tons and tons of spans, which means I have to decrease my sample rate overall to compensate, meaning I get less spans from web requests.

Reproduction Steps

Unsure at this point. I don't know how this behavior works in Sentry so I don't know how to repro.

I think this only happens when a Sidekiq job is run and a web request was not the parent (i.e. a job triggered by a cron). This

Expected Behavior

Unrelated job runs should not be grouped into the same transaction.

Actual Behavior

They are.

Ruby Version

Multiple

SDK Version

Multiple, but includes 5.22.1.

Integration and Its Version

No response

Sentry Config

Multiple, no common thread in the config AFAICT

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jan 29, 2025
@nateberkopec
Copy link
Contributor Author

This feels related to #2446 but, since I'm seeing this in 5.22.1, clearly wasn't fixed by that PR.

@nateberkopec
Copy link
Contributor Author

In the case of one app, it's using Heroku Scheduler to kick off jobs. The other's not on Heroku, not sure what's running jobs outside of the web context there.

It kind of feels like a job created from e.g. a rake task lacks a proper root.

@nateberkopec
Copy link
Contributor Author

Would it help if I tried something like #2476 in the context of rake tasks? 🤔

@sl0thentr0py
Copy link
Member

the fix in #2446 was only if you use Sidekiq::Cron
I agree we need a general trace injection config boolean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants