-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[service] Deprecate telemetry.disableHighCardinalityMetrics #13538
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
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13538 +/- ##
==========================================
+ Coverage 92.00% 92.04% +0.03%
==========================================
Files 529 529
Lines 31454 31419 -35
==========================================
- Hits 28939 28919 -20
+ Misses 1987 1969 -18
- Partials 528 531 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| # Use pipe (|) for multiline entries. | ||
| subtext: | | ||
| The feature gate is now deprecated since metric views can be configured. | ||
| The gate will be removed in v1.40.0. |
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 I'm having second thoughts about whether it's a good idea to deprecate this now. Yes, users can now configure metric views that do the same thing as the gate (and at the very least, we'll want to document how).
But because metric views are incompatible with level != detailed, users that were previously using the gate will also have to reproduce all the default level-based views set up in service.go. There was a proposal at one point for a Collector subcommand that lists the metric views for a given level to make this easier, but it hasn't been implemented. So that's a bit of a painful migration path, especially since I suspect users of the feature gate can't easily do without it (it would increase the cardinality of their metrics by a lot).
|
Looking into it, it might not actually have much of an impact to deprecate this feature flag without an easy migration path, because I think it might have broken a long time ago, and yet nobody complained... Specifically, it remove the following attributes for gRPC instrumentation metrics:
And the following from HTTP instrumentation metrics:
But:
The first two changes in the Collector have been since v0.128.0, and the third should be in the next go-contrib release. (Unrelated note: we may want to ask for an authoritative list of metrics and attributes emitted by these instrumentations, having to dig through the code and the Git history every time is exhausting) |
Now that the feature gate is deprecated it cannot be enabled, so we can remove all references. Moreover, the view that was excluding high cardinality attributes from otelhttp and otelgrpc was broken, as the attributes were renamed in the instrumentation.
|
@jade-guiton-dd thanks for looking into that. I've confirmed through testing with the OTLP receiver that these attributes are not present in any metrics. I went ahead and removed all references to the feature gate in the code, since deprecating means it cannot be enabled. The view for excluding those attributes is entirely removed, along with references to the attributes in tests. |
| # Use pipe (|) for multiline entries. | ||
| subtext: | | ||
| The feature gate is now deprecated since metric views can be configured. | ||
| The gate will be removed in v0.134.0. |
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 after discussing this in the maintainers call, I think the best way to handle this would be to say something to the effect of:
The metrics attributes removed by this feature gate are no longer emitted by the Collector by default, but if needed, you can achieve the same functionality by configuring the following metric views:
service: telemetry: metrics: views: - selector: meter_name: "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" stream: attribute_keys: excluded: ["net.sock.peer.addr", "net.sock.peer.port", "net.sock.peer.name"] - selector: meter_name: "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" stream: attribute_keys: excluded: ["net.host.name", "net.host.port"]Note that this requires setting
level: detailed. If you have a strong use case for using views in combination with a differentlevel, please show your interest in this Collector issue.
This gives users who may still be relying on the feature gate something to work with, while allowing us to keep kicking #10769 down the road.
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.
Sounds good, thanks - updated.
jade-guiton-dd
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.
LGTM
Co-authored-by: Jade Guiton <[email protected]>
Pull Request is not mergeable
Description
Deprecate the feature gate now that metric views can be configured.
Link to tracking issue
Fixes #13537
Testing
Verified that the flag is deprecated with
otelcorecol featuregateandotelcorecol --feature-gates telemetry.disableHighCardinalityMetrics(the latter leads to an error, as expected for deprecated feature gates.)Documentation
Added changelog