-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[service] Add service::telemetry::metrics::views
config key
#12433
[service] Add service::telemetry::metrics::views
config key
#12433
Conversation
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (80.00%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #12433 +/- ##
==========================================
- Coverage 91.53% 91.52% -0.02%
==========================================
Files 483 479 -4
Lines 26433 26486 +53
==========================================
+ Hits 24196 24240 +44
+ Misses 1772 1770 -2
- Partials 465 476 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Can you increase the test coverage? Could you also add information about this (in a draft PR) to opentelemetry.io docs?
Regarding the lack of test coverage: it's almost entirely from the existing code for the feature gate that I just moved. I can try to add a new test for it; is there a way to set feature gates in tests? |
You can check the tests that are modified in #12377 |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Readers []config.MetricReader `mapstructure:"readers"` | ||
|
||
// Views allows advanced configuration of emitted metrics by setting | ||
// the list of views passed to the SDK. | ||
// This is incompatible with `level` values other than `detailed`. | ||
Views []config.View `mapstructure:"views"` |
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.
instead, use:
MeterProvider MeterProvider `mapstructure:",squash"`
This will show that we use everything from the config.
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.
Done. I modified the SDK instantiation code to pass the modified original struct to otelconf
instead of creating a new one, in case new fields get added later upstream.
8a79193
Description
This PR adds a
service::telemetry::metrics::views
config key, which explicitly sets the list of metric views used for internal telemetry, mirroringmeter_provider::views
in the SDK config. This can be used to disable specific internal metrics, among other uses.This key will cause an error if used alongside other features which would normally implicitly create views, such as:
service::telemetry::metrics::level
todetailed
;telemetry.disableHighCardinalityMetrics
feature gate.Further discussion needed
A comment notes that the
telemetry.disableHighCardinalityMetrics
alpha gate "will be removed when the collector allows for view configuration". I think setting the gate as deprecated first would be the correct thing to do, but it means that users relying on it will see their Collectors crash on update. Is that okay?In the context of being able to enable/disable specific metrics, this key is only useful to disable metrics from an "all enabled" baseline. It cannot easily be used to customize the set of metrics emitted at
level: normal
,level: basic
. Discussion is ongoing in Own-telemetry: Ability to enabled/disable individual metrics #10769 on how to handle that, but the solution will probably involve a new key, which should hopefully be backward-compatible with the user-visible changes in this PR.Link to tracking issue
Updates #10769
Testing
None yet
Documentation
None yet, except the changelog