-
Notifications
You must be signed in to change notification settings - Fork 576
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
Fix cardinality issue for rpc.server.duration (#3536) #3730
base: main
Are you sure you want to change the base?
Fix cardinality issue for rpc.server.duration (#3536) #3730
Conversation
add tests update change log and split up test remove accidental dependabot change
|
Ran |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3730 +/- ##
=======================================
+ Coverage 70.1% 71.7% +1.6%
=======================================
Files 147 149 +2
Lines 6973 7033 +60
=======================================
+ Hits 4892 5048 +156
+ Misses 1958 1861 -97
- Partials 123 124 +1
|
// WithPeerAddrAsAttribute returns an Option to use peer details when | ||
// recording with the meter rpc.server.duration. | ||
func WithPeerAddrAsAttribute(peerAddrAsAttribute bool) Option { | ||
return includePeerAddrAsAttribute{use: peerAddrAsAttribute} |
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'm having doubts about this solution. The option seems extremely specific, and I wonder if we could find a more generic way of doing it.
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.
The meter here is specific to one type of interceptor. I could apply this to the spans as well if that's more preferable.
I have no time to review this PR, but at quick glance it looks that peer attributes should be added by default. |
Then perhaps the spec should change? The port and ip change constantly in a cloud container environment, which I think is the primary use case. Correct me if I'm wrong though. If the desired default is to include the host and ip then clients are going to run into the same issue I have and will undoubtedly have very little insight as to why their metric payloads keep growing. I'm open to ideas though |
The spec currently says:
Take a look if this what is defined in the specification meets your expectations. If yes, then it would be good to describe in the PR description which part of the specification this PR addressed. If not, then maybe it would be worth to discuss it on the specification level. |
@pellared so by default we need to have one of these two attributes set per the spec requirement:
It looks like the code, by default, tries to first set the higher cardinality attributes first opentelemetry-go-contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go Lines 475 to 480 in 6682591
Would you prefer to always set either |
Related issue #3071 |
Added an optional parameter for allowing peer information to be added as an attribute. By default the gRPC interceptor will ignore peer details for the sake of performance.
Related issue: #3536