Skip to content

ActiveJob Metrics (LG-4369)#4860

Merged
zachmargolis merged 6 commits intomainfrom
mitchellhenke/active-job-metrics-lg-4369
Apr 1, 2021
Merged

ActiveJob Metrics (LG-4369)#4860
zachmargolis merged 6 commits intomainfrom
mitchellhenke/active-job-metrics-lg-4369

Conversation

@mitchellhenke
Copy link
Contributor

The formatting and properties for the events are mostly taken from https://github.com/rails/rails/blob/v6.1.3.1/activejob/lib/active_job/log_subscriber.rb

I included all of the events, though I don't think we'll see some of them due to our limited use right now (like retries or discards)

@mitchellhenke mitchellhenke force-pushed the mitchellhenke/active-job-metrics-lg-4369 branch 2 times, most recently from b53b419 to bb9a4a1 Compare March 31, 2021 17:56
Comment on lines 13 to 14
Copy link
Contributor

Choose a reason for hiding this comment

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

we can probably drop these soon right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, we can and should, I think it's safe to pass nil by default until we remove it from the functions themselves. We could keep trace_id if we wanted since it probably does exist, but I don't know how useful it would be.

Copy link
Contributor

Choose a reason for hiding this comment

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

WDYT of adding job_id to default_attributes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call, moved it to default. It initially didn't seem like job_id existed in the enqueue event based on how Rails used it, but it is there.

@mitchellhenke mitchellhenke marked this pull request as ready for review March 31, 2021 18:06
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/active-job-metrics-lg-4369 branch from 4e613c3 to 3526374 Compare March 31, 2021 18:21
@mitchellhenke
Copy link
Contributor Author

I think this is good to go with the exception of codeclimate being unhappy with the untested parts of the subscriber we unfortunately don't/can't use in the test environment.

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM, lmk if you need admin merge override

@mitchellhenke
Copy link
Contributor Author

@zachmargolis yes, please! 🙁

@zachmargolis zachmargolis merged commit 99f8d99 into main Apr 1, 2021
@zachmargolis zachmargolis deleted the mitchellhenke/active-job-metrics-lg-4369 branch April 1, 2021 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants