-
Notifications
You must be signed in to change notification settings - Fork 725
otelgrpc: add MetricAttributesFn option to allow adding dynamic attributes on metrics #8191
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
Conversation
|
Can you add documentation or an example_test.go to demonstrate how someone could use this to add attributes to metrics? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8191 +/- ##
=====================================
Coverage 82.3% 82.3%
=====================================
Files 193 193
Lines 13769 13779 +10
=====================================
+ Hits 11334 11344 +10
Misses 2030 2030
Partials 405 405
🚀 New features to boost your workflow:
|
|
Hello @dashpole, |
instrumentation/google.golang.org/grpc/otelgrpc/example_test.go
Outdated
Show resolved
Hide resolved
|
There was a release, so you need to move the changelog entry up to the unreleased section. You may need to add the appropriate header if the section doesn't already exist. |
Co-authored-by: David Ashpole <[email protected]>
Co-authored-by: David Ashpole <[email protected]>
|
Hi! Thanks for reviewing this. Please let me know if there's anything else needed from my side before merging. |
|
Nothing needed on your end for now. We require a second approval though. |
flc1125
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.
Based on the current situation, I think there is no problem; however, I am not entirely sure if this is the best implementation plan.
This PR addresses the need of adding dynamic attributes on the auto-instrumented metrics from otelgrpc. It potentially addresses #6026 without giving access to the payload since it is not available during every phase which adds complexity when trying to add the labels to all available metrics. It might also generate more confusion to the end user by exposing internal implementation details.
Initial draft that implemented the Labeler pattern from otelhttp (it also explains why it was closed): #8135