-
Notifications
You must be signed in to change notification settings - Fork 226
fix: Sidekiq spans crashing when enqueued by Exq #1796
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
a0314a8
38c1812
040c291
ed95854
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,27 @@ | |
| _(job_span.attributes['messaging.operation']).must_equal 'process' | ||
| end | ||
|
|
||
| it 'traces when enqueued through another system' do | ||
| payload = { 'queue' => 'default', 'args' => [], 'class' => SimpleJob, 'enqueued_at' => Time.current, 'jid' => '4' } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't enqueued_at be removed here too?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exq supplies this one, but not
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO, it's not about Exq. It's about what any custom library could do. If it's possible to enqueue a job and have it processed by sidekiq without an `enqueued_at, then we should handle it. |
||
| Sidekiq::Client.new.send(:raw_push, [payload]) | ||
| Sidekiq::Worker.drain_all | ||
|
|
||
| _(job_span.name).must_equal 'default process' | ||
| _(job_span.kind).must_equal :consumer | ||
| _(job_span.attributes['messaging.system']).must_equal 'sidekiq' | ||
| _(job_span.attributes['messaging.sidekiq.job_class']).must_equal 'SimpleJob' | ||
| _(job_span.attributes['messaging.message_id']).must_equal '4' | ||
| _(job_span.attributes['messaging.destination']).must_equal 'default' | ||
| _(job_span.attributes['messaging.destination_kind']).must_equal 'queue' | ||
| _(job_span.attributes['messaging.operation']).must_equal 'process' | ||
| _(job_span.attributes['peer.service']).must_be_nil | ||
| _(job_span.events.size).must_equal(1) | ||
|
|
||
| enqueued_event = job_span.events[0] | ||
| _(enqueued_event.name).must_equal('enqueued_at') | ||
| _(enqueued_event.timestamp.digits.count).must_equal(19) | ||
| end | ||
|
|
||
| it 'defaults to using links to the enqueing span but does not continue the trace' do | ||
| SimpleJob.perform_async | ||
| SimpleJob.drain | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would name this as "when enqueued with minimal data"