Created
September 6, 2019 02:01
-
-
Save joeyAghion/c109ffb6234df6417c1332741e85a0d0 to your computer and use it in GitHub Desktop.
This patch is based on https://github.com/DataDog/dd-trace-rb/pull/798 and can be added (e.g., as a rails initializer) to provide more meaningful trace labels rather than `Sidekiq::Extensions::DelayedClass`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Datadog | |
module Contrib | |
module Sidekiq | |
module Tracing | |
def job_resource(job) | |
if job['wrapped'] | |
job['wrapped'] | |
elsif job['class'] == 'Sidekiq::Extensions::DelayedClass' | |
YAML.load(job['args'].first)[0..1].join('.') rescue job['class'] # rubocop:disable Security/YAMLLoad | |
else | |
job['class'] | |
end | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment