Skip to content

Register SentryContextClientMiddleware on sidekiq workers#1774

Merged
st0012 merged 1 commit intogetsentry:masterfrom
jeromepl:master
Apr 9, 2022
Merged

Register SentryContextClientMiddleware on sidekiq workers#1774
st0012 merged 1 commit intogetsentry:masterfrom
jeromepl:master

Conversation

@jeromepl
Copy link
Copy Markdown
Contributor

This configuration was missing in order to support the scenario where a sidekiq job itself pushes new jobs.

This meant that although the Sentry user was propagated from the client to the sidekiq server when running a job, it was not propagated again to any new jobs launched from this worker.

This is what is recommend as per sidekiq's documentation

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 9, 2022

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.41%. Comparing base (e99578b) to head (38c55ab).
⚠️ Report is 577 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1774      +/-   ##
==========================================
+ Coverage   98.38%   98.41%   +0.03%     
==========================================
  Files         144      145       +1     
  Lines        8462     8562     +100     
==========================================
+ Hits         8325     8426     +101     
+ Misses        137      136       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@st0012 st0012 left a comment

Choose a reason for hiding this comment

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

Thank you!

@st0012 st0012 added this to the 5.3.0 milestone Apr 9, 2022
@st0012 st0012 merged commit 72396ce into getsentry:master Apr 9, 2022
sl0thentr0py added a commit that referenced this pull request Sep 28, 2023
…s and retries [#2118](#2118)

#1774 added
`SentryContextClientMiddleware` to the server middleware chain too.

Sidekiq's scheduler pushes to the client on the server again for
schedules and retries which causes our trace propagation to be broken
for this case.
https://github.com/sidekiq/sidekiq/blob/aadc77a172f1490fb141c7936d2801ca3af925ef/lib/sidekiq/scheduled.rb#L39

Prioritize taking the trace propagation headers from the job whenever
they exist.
sl0thentr0py added a commit that referenced this pull request Sep 28, 2023
…s and retries [#2118](#2118) (#2118)

#1774 added
`SentryContextClientMiddleware` to the server middleware chain too.

Sidekiq's scheduler pushes to the client on the server again for
schedules and retries which causes our trace propagation to be broken
for this case.
https://github.com/sidekiq/sidekiq/blob/aadc77a172f1490fb141c7936d2801ca3af925ef/lib/sidekiq/scheduled.rb#L39

Prioritize taking the trace propagation headers from the job whenever
they exist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants