opentelemetry-collector-contrib
opentelemetry-collector-contrib copied to clipboard
[metricstransformprocessor] Support `count` aggregation type for `aggregate_labels` action
Component(s)
processor/metricstransform
Is your feature request related to a problem? Please describe.
I'd like to substitute aggregation by metricstransformprocessor for some of our recording rules. It's performing very well, however, it currently doesn't support counting aggregated metrics up by specified label_set, which is our blocker. It would be useful for users to support aggregation_type count in metricstransformprocessor.
Describe the solution you'd like
I haven't looked into the code base yet, but a simple implementation would be returning the number of data points (dps.Len()) at a specific time.
We could configure aggregation with the count type as:
"metricstransform":
"transforms":
- "action": "insert"
"include": "kube_pod_info"
"match_type": "strict"
"new_name": "cluster_namespace:pod:count"
"operations":
- "action": "aggregate_labels"
"aggregation_type": "count"
"label_set":
- "namespace"
Describe alternatives you've considered
I don't have any other alternatives for now.
Additional context
No response
Pinging code owners:
- metricstransformprocessor: @dmitryax
- processor/metricstransform: @dmitryax
See Adding Labels via Comments if you do not have permissions to add labels yourself.
/label processor/metricstransform
I'm ready to prepare a PR after the triage.
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:
- processor/metricstransform: @dmitryax
- needs: 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.
Hi @musaprg, feel free to submit a PR
@dmitryax OK, thanks! Let me try preparing a PR.
BTW I saw the needs-triage label was still there, but is this PR accepted or going to be considered after the PR submission?
I removed needs triage based on @dmitryax's comment. Thanks for your help @musaprg!
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:
- processor/metricstransform: @dmitryax
See Adding Labels via Comments if you do not have permissions to add labels yourself.
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:
- processor/metricstransform: @dmitryax
See Adding Labels via Comments if you do not have permissions to add labels yourself.
@musaprg Do you still plan on submitting a PR for this enhancement?
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:
- processor/metricstransform: @dmitryax
See Adding Labels via Comments if you do not have permissions to add labels yourself.
Implemented here: https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/32935
Hey @crobert-1 and @dmitryax, would you mind taking a look at that PR? :)
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:
- processor/metricstransform: @dmitryax
See Adding Labels via Comments if you do not have permissions to add labels yourself.
This feature seems to be now landed by https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/33442, so let me close this issue. Thanks @lopes-felipe!