Check for coverage of all metric types
Closed this issue · 8 comments
Some functions and processors that operate on metrics may not correctly operate on all metric types. We have observed at least the resourcetotelemetry
helper not accounting for Summary and Exponential Histogram metrics. A survey should be undertaken to check for similar failures.
Is there any linter that we can enable to check this? I know is hard since there is no enum type, but maybe some structure tags can help. This needs to be investigated because I bet there are more places like this.
Originally posted by @bogdandrutu in #7523 (comment)
The exhaustive linter from golangci-lint seems to be able to do this: https://github.com/nishanths/exhaustive
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers
. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.
There are quite a lot of cases where MetricTypeEmpty is not handled by switch statements. eg: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/attributesprocessor/attributes_metric.go#L73
So we'd need to update all of that code to have a case for Empty / have a default clause but I don't know the code well enough to understand what should be done in those cases.
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers
. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers
. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers
. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers
. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.
Pinging code owners:
- issue: Github issue template generation code needs this to generate the corresponding labels.
See Adding Labels via Comments if you do not have permissions to add labels yourself.
close by #9109