-
Notifications
You must be signed in to change notification settings - Fork 381
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
Adds delay to Sidekiq metrics #418
Comments
@gottfrois Really like the idea here! Tags work a little differently than metrics however; what you added above should appear as tags on each of the Sidekiq traces your application is producing, if you highlight the |
@delner oh ok i got this wrong! |
@delner you were right, i see the new |
@gottfrois I think most of our metrics are handled through our metrics gem https://github.com/DataDog/dogstatsd-ruby or https://github.com/DataDog/dogapi-rb. As far as integrating that directly into the tracing portion of the code, off the top of my head, I might suggest using the Processing Pipeline to listen into these spans, then taking advantage of that to send off metrics using the metrics gem for each tag you'd like to measure. Might look something like this in your Datadog::Pipeline.before_flush(
Datadog::Pipeline::SpanProcessor.new do |span|
if span.name == 'sidekiq.job'
# Send your metric here:
# value = span.get_tag('sidekiq.job.delay').to_f
end
end
) Give that a shot and let me know if that works for you! |
@delner thanks a log for the code snippet. I do believe it works but i cannot confirm because i think i reached the limit of the number of custom metrics i can send on datadog :( What's your input on custom metrics usage here? For example, the sidekiq trace uses a lot of custom metrics quotas: Due to the number of tags and ressources i guess? |
Regarding custom metrics, admittedly, I'm not sure I can give you a good answer myself. I think the best I can offer right now is checking out our documentation on custom metrics, which hopefully has the details you need. As for adding those datapoints to the Sidekiq tracing code, a PR that adds those basic values as tags (as opposed to metrics) sounds good to me. |
This was released as a part of 0.13.0. Thanks for your contribution! |
Hey guys,
I've been trying to add a
delay
metric to Sidekiq which would represent the time spent for a job waiting in queue.I've forked the gem and added the following code:
But I actually don't see those metrics in the metric explorer on Datadog nor the existing one like
sidekiq.job.id
orsidekiq.job.retry
So i'm not sure how/where those metrics are available. Can you help?
Thanks
The text was updated successfully, but these errors were encountered: