-
Notifications
You must be signed in to change notification settings - Fork 357
[Instrumentation.Hangfire] Add metrics support #3258
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
base: main
Are you sure you want to change the base?
[Instrumentation.Hangfire] Add metrics support #3258
Conversation
|
|
289b75d to
5655113
Compare
thompson-tomo
left a comment
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.
Looks to be a good step forward and I have suggested a couple of changes here as well as to the sem conv based on the learnings.
src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireMetrics.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireTagBuilder.cs
Outdated
Show resolved
Hide resolved
|
@gorbach, please check this comment #2075 (comment) The second point is technical requirements to separate metrics/traces signal. It will be great to rename classes in the separate PR and then merge it/rebase here. |
Implements OpenTelemetry workflow semantic conventions for Hangfire metrics. Fixes open-telemetry#2075
…ve trigger.type to workflow-level metrics, add workflow.count
… DisplayNameFunc option
dd6e74a to
d43ee2c
Compare
thompson-tomo
left a comment
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.
Looking good. Only 1 design question #3258 (comment) which when resolved would mean I approve.
src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireTagBuilder.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireMetricsStateFilter.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireMetricsStateFilter.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireMetricsStateFilter.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireMetricsStateFilter.cs
Outdated
Show resolved
Hide resolved
thompson-tomo
left a comment
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.
Have left a bunch of nits for things which could be improved/simplified.
...OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireMetricsErrorFilterAttribute.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireMetricsInstrumentation.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireMetricsStateFilter.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireMetricsStateFilter.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireMetricsStateFilter.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireMetricsStateFilter.cs
Outdated
Show resolved
Hide resolved
...OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireMetricsErrorFilterAttribute.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireTagBuilder.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireTagBuilder.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireMetricsStateFilter.cs
Outdated
Show resolved
Hide resolved
…fireMetricsErrorFilterAttribute.cs Co-authored-by: James Thompson <[email protected]>
…fireMetricsInstrumentation.cs Co-authored-by: James Thompson <[email protected]>
…fireMetricsStateFilter.cs Co-authored-by: James Thompson <[email protected]>
…fireMetricsStateFilter.cs Co-authored-by: James Thompson <[email protected]>
…fireTagBuilder.cs Co-authored-by: James Thompson <[email protected]>
…fireMetricsStateFilter.cs Co-authored-by: James Thompson <[email protected]>
…fireMetricsErrorFilterAttribute.cs Co-authored-by: James Thompson <[email protected]>
…fireTagBuilder.cs Co-authored-by: James Thompson <[email protected]>
…fireMetricsStateFilter.cs Co-authored-by: James Thompson <[email protected]>
src/OpenTelemetry.Instrumentation.Hangfire/.publicApi/PublicAPI.Unshipped.txt
Outdated
Show resolved
Hide resolved
thompson-tomo
left a comment
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.
Looks good to me & thanks for adapting based on feedback.
|
Thanks for the contribution, don't forget to update the CHANGELOG.md |
Done, thanks! |
|
@Kielek Is there still something blocking this PR? |
|
@fred2u, I am not sure if there is any blocker. The metrics names suggests that all of them came from the opentelemetry-specification, but in fact, all of most of them are custom. Need to check with othet @open-telemetry/dotnet-contrib-approvers what to do with this PR. For sure, in the same time, you can clean up public contract for spans/traces in the separate PR. It will be great to align to standard conventions from this repository: #2075 (comment) |
|
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
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 that you need put clear information, that you are providing metrics, but all of them are hangfire specific, and it will be subject to change if there occurs any recommendations from the semantic convetion. When the statement will be clear, I think that we should be fine to merge.
Do you have any plan to work towards this definition?
|
|
||
| ## Unreleased | ||
|
|
||
| * Add metrics instrumentation following workflow semantic conventions. |
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 is not true. There is nothing like workflow semantic convention.
| This instrumentation library collects metrics following the OpenTelemetry | ||
| [workflow semantic conventions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/workflow/workflow-metrics.md). |
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.
Also here.
thompson-tomo
left a comment
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.
So the work to get these definitions into semconv is covered by open-telemetry/semantic-conventions#1688 with very recent interest from cicd sig to be involved, so hopefully this topic can now get traction.
I have added a comment on the readme with proposed text to make it clearer the signal definitions are subject to change.
| This instrumentation library collects metrics following the OpenTelemetry | ||
| [workflow semantic conventions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/workflow/workflow-metrics.md). |
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.
Howabout something like
| This instrumentation library collects metrics following the OpenTelemetry | |
| [workflow semantic conventions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/workflow/workflow-metrics.md). | |
| This instrumentation library collects metrics following a POC/draft definition of workflow metrics defined as part of [semantic-conventions/#1688](https://github.com/open-telemetry/semantic-conventions/issues/1688). | |
| As those definitions evolve, changes including breaking ones will flow back to this implementation. |
Fixes #2075
Changes
Adds OpenTelemetry metrics support to Hangfire instrumentation following workflow semantic conventions.
Implemented metrics:
workflow.execution.count- Counter for task executionsworkflow.execution.duration- Histogram for execution durationworkflow.execution.status- UpDownCounter for state transitionsworkflow.execution.errors- Counter for execution errorshangfire.queue.latency- Optional histogram for queue wait timeMerge requirement checklist