-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Solution: Add telemetry to track metrics #453
Conversation
Pull Request Test Coverage Report for Build 5a0b9f2c1917ba71c5967bfe6be674472d71c4cb-PR-453
💛 - Coveralls |
@maennchen when you get back from vacation I would love your feedback on this! |
@mrmarcsmith It would probably be worth adding some documentation around how a user would consume these telemetry events in the readme or the other markdown doc folder. |
@rraub good idea! I’ll work 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.
@mrmarcsmith Thanks a lot for the PR!
There's a few cases I think we should handle:
JobBroadcaster
/init
should call[ :quantum, :job, :add ]
for all jobsJobBroadcaster
/delete_all
should call[ :quantum, :job, :delete ]
for all jobs[:quantum, :job, *]
should contain the job itself in the metadata[:quantum, :job, *]
should contain the scheduler module name itself in the metadata (if someone has multiple schedulers)
@maennchen I have completed your requested changes. I am wondering if passing |
@mrmarcsmith This is not exactly what I meant with the module: There's a name for the main scheduler. This would for example be
|
@mrmarcsmith PS: Sorry for the merge conflict. Can you solve it our should I resolve it before merge? |
@maennchen Sounds good! I can take of those merge conflicts |
@maennchen This is ready to be re-reviewed. I ended up adding the scheduler option to the following opts modules so i could pass the scheduler around. Can you think of any end user rational for accessing these ops modules directly that might be a breaking change?
|
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.
lib/quantum/job_broadcaster.ex
Outdated
messages = | ||
for {name, %Job{state: :active} = job} <- jobs do | ||
# Send event to telemetry incase the end user wants to monitor events | ||
:telemetry.execute([:quantum, :job, :delete], %{}, %{ |
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.
This will only be executed for active jobs. I think we also want to call it on inactive ones.
@mrmarcsmith This is for sure not a breaking change. The modules are not documented and therefore considered internal. |
Co-authored-by: Jonatan Männchen <[email protected]>
@maennchen dialyzer is throwing |
@mrmarcsmith Oops, that's not the first time i make this error. Should just be atom(). |
testing now |
@mrmarcsmith After this change it's ready to merge 😊 |
local test and dialyzer passed! Thank you for the help |
Implements #415
I have added the sending of "add", "update", "delete", "start", "stop", and "exception" events via telemetry. I have also injected assertions into the existing job_broardcast_tests and executor_test files to verify functionality of the telemetry events.
Testing strategy: