-
Notifications
You must be signed in to change notification settings - Fork 27
[awsemfexporter] Fix grouping for container insights metrics for mixed metric types #320
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
Changes from 4 commits
6480c9b
3de4ed9
967cd9b
bae5d1d
43d26f6
f555eb3
3eac67b
99cc28c
775dd21
49b21e9
0f07e19
61eb7ab
af63694
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,6 +91,12 @@ func addToGroupedMetric( | |
// them together into one EMF log event, so don't set batchIndex when it's a summary metric | ||
metadata.groupedMetricMetadata.batchIndex = i | ||
} | ||
|
||
if metadata.receiver == containerInsightsReceiver { | ||
// For container insights, put all metrics in the same group regardless of type (ie gauge/counter) | ||
metadata.groupedMetricMetadata.metricDataType = pmetric.MetricTypeEmpty | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am concerned about mixing other metric types into the same log event, e.g. histograms/summary with gauge/counters. This will only group them into the same log event if they also have the same dimensions, right? If so, then I think it'd be ok. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't currently emit non-counter metrics for container insights today. But if one of the container insights prom scrapers (neuron/dcgm/nvme/etc) starts ingesting non-counter metrics, we want that all to be in the same log. Otherwise customers will be charged extra There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Histogram/summary metrics have extra dimensions like "quantile" which we wouldn't want applied to the counter/gauge metrics since that doesn't make any sense. So I think they will have to be in a separate log event. |
||
|
||
groupKey := aws.NewKey(metadata.groupedMetricMetadata, labels) | ||
if _, ok := groupedMetrics[groupKey]; ok { | ||
// if MetricName already exists in metrics map, print warning log | ||
|
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.
Need to test if this affects any other part of container insights. I see that the only other reference to the data type is in the
translateGroupedMetricToCWMetric
func:code:
opentelemetry-collector-contrib/exporter/awsemfexporter/metric_translator.go
Line 223 in 97a2f5e