-
Notifications
You must be signed in to change notification settings - Fork 66
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
API-26059 Log durations of some sidekiq jobs #12474
Conversation
e4df875
to
6892653
Compare
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.
Yo, this is slick, low friction, and efficient. NOICE.
modules/appeals_api/app/middleware/sidekiq_job_duration_middleware.rb
Outdated
Show resolved
Hide resolved
6892653
to
7e6bfbb
Compare
Rails.logger.info "Sidekiq job #{worker.class.name} in #{elapsed_time.round} seconds" | ||
|
||
module_name = worker.class.name.split('::').first.underscore | ||
@statsd.timing("#{module_name}.sidekiq_job.duration", elapsed_time.round) |
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.
How are we to tell which job has which durations within datadog, if we're only grabbing the module name? Shouldn't we also grab the actual class that runs the job?
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.
As I was refactoring this, I started second guessing whether we should be adding to datadog at all yet - we already have datadog's sidekiq middleware set up here, and it seems like it reports very extensive information. Since none of us is able to actually see datadog yet, I was thinking it might make sense to wait to send data there until we've reviewed what's already being collected - any opinions on that?
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.
Do we know anyone with read access who could peek for us?
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.
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.
With the fact that we're getting automatic perform duration logging w/ DataDog - do we actually need this separate logging into rails logs?
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'd much rather just look at datadog for this information - if we have a pathway to doing that and it's acceptable to wait to get this information until then, I'm happy to close this
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 think it was added as a stopgap since we don't have DataDog access yet.
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.
It also looks like not all of our jobs are being captured by DataDog, so let's keep this in for now until we know that all our jobs are registered.
modules/appeals_api/app/middleware/sidekiq_job_duration_middleware.rb
Outdated
Show resolved
Hide resolved
7e6bfbb
to
6679a85
Compare
6679a85
to
6a5f47a
Compare
6a5f47a
to
60b067a
Compare
60b067a
to
b16bf00
Compare
b16bf00
to
b650864
Compare
b650864
to
c577dc4
Compare
c577dc4
to
ab8547c
Compare
Summary
AppealsApi
,VAForms
, andVBADocuments
APIs.appeals_api_sidekiq_job_duration_logging
flipper flag is turned on.Related issue(s)
Testing done
perform_async
and then running the middleware manually.What areas of the site does it impact?
Loads middleware for sidekiq that only affects workers from the AppealsAPI module, the VAForms module, and the benefits intake (VBADocuments) module
Acceptance criteria