Skip to content

[processor/metricstransform] Aggregate Labels no longer supports aggregating all labels #35120

@SamerJ

Description

@SamerJ

Component(s)

internal/core, processor/metricstransform

What happened?

Description

In the past, we could use the metrics transformer to aggregate datapoints on any label.
The configuration listed below used to work as is.
Now this is no longer the case

Steps to Reproduce

Setup OTEL to consume a metric with multiple datapoints having different label values.
Use the configuration below.
On version v0.90.1 (up to v105), it should aggregate the datapoints.
On the latest version (starting v106), it will not aggregate the values.

Config

  metricstransform:
    transforms:
      - include: my.metric
        match_type: strict
        action: update
        operations:
          - action: aggregate_labels
            label_set: [ ] # In the past, we could have an empty array. 
            aggregation_type: sum

Expected Result

Aggregation of results

Actual Result

No aggregation happens.

Anaylsis

The behavior changed with the following code change:

Previously:
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.105.0/processor/metricstransformprocessor/operation_aggregate_labels.go#L139

Now:
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.108.0/internal/coreinternal/aggregateutil/aggregate.go#L36

Collector version

v0.107.0 (also v0.108)

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions