-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[mdatagen] Re-Aggregate Metric by Attributes #13900
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?
Conversation
927cb87
to
a327d99
Compare
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (58.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 #13900 +/- ##
==========================================
- Coverage 91.65% 90.99% -0.67%
==========================================
Files 652 652
Lines 42506 43217 +711
==========================================
+ Hits 38960 39324 +364
- Misses 2737 3054 +317
- Partials 809 839 +30 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This reverts commit 09f9aff.
ab16379
to
4f8e424
Compare
cmd/mdatagen/internal/samplescraper/internal/metadata/generated_config_test.go
Outdated
Show resolved
Hide resolved
cmd/mdatagen/internal/samplescraper/internal/metadata/generated_metrics.go
Outdated
Show resolved
Hide resolved
Co-authored-by: Dmitry Anoshin <[email protected]>
cmd/mdatagen/internal/sampleconnector/internal/metadata/generated_config_test.go
Outdated
Show resolved
Hide resolved
cmd/mdatagen/internal/sampleconnector/internal/metadata/generated_metrics_test.go
Outdated
Show resolved
Hide resolved
} | ||
|
||
// default enabled to true | ||
if !parser.IsSet("enabled") { |
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 like this is also applied to the resource attributes. The resource attributes with missing enabled
fields now get enabled=true. That's why tests are failing.
I think we should make the enabled
required and fill all missing spots in contrib to unblock this PR
While looking into the problem above, I found that telemetry attributes will be also affected. We expose all attributes in the user config including those that are applied to internal telemetry, but they don't have any aggregation capabilities at this moment... This is another blocker for merging the PR I see couple of options here:
|
Ok, I think we should rework it closer to #13431 (comment) with the following changes:
metrics:
system.cpu.time:
attributes: [state]
disabled_attributes: [cpu] @shalper2 @rogercoll WDYT? |
I do like @rogercoll 's proposed configuration scheme so I'm not opposed to moving attributes under metrics at all. Is the idea with |
Yes, that's the idea. That will map the values of
Yes, user will be able to pick any subset of the |
Ok I started with a bit different approach. Instead of every metric having the |
Reopens 13431
Description
Modified
cmd/mdatagen
to allow for two new fields in the configuration yaml of metrics. These new configuration options would allow for a user to enable or disable attributes (i.e. reduce dimensionality of metrics being generated) from their collector configuration. The modifiedMetricsBuilder
generated bymdatagen
automatically re-aggregates metrics based on the enabled set of attributes. Additionally, different aggregation strategies are supported and can be specified by the collector administrator.The changes to the config.yaml are:
A new optional field has been added to
metadata.yaml
which will allow users to define default "enabled" behavior for attributes. For backwards compatibility any attribute defined in themetadata.yaml
will have a default value ofenabled: true
.Link to tracking issue
Fixes 10726
Testing
Some testing has been done using the modified mdatagen with existing contrib receivers (i.e.
hostmetricsreceiver
). Generated tests have been updated to test new aggregation behavior.Documentation
Updated
metadata-schema.yaml
to include new optional field.ran
make gogenerate
ran
make generate