open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
2.92k stars 2.29k forks source link

[processor/metrictransform] Aggregating labels drops metric description #14577

Closed BinaryFissionGames closed 1 year ago

BinaryFissionGames commented 1 year ago

What happened?

Description

When aggregating by labels, the metric description is made empty.

See this function: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/d5bb86ce9ec34a62a6959ed22cc5bd61a6611215/processor/metricstransformprocessor/metrics_transform_processor_otlp.go#L454-L470

The metric description is not copied over to the new metric, which causes the description of the metric to be dropped.

Steps to Reproduce

Run with attached config. Observe output metric descriptions are empty.

Expected Result

Metric description is retained on the metric with aggregated labels

Actual Result

Metric description is dropped on the metric with aggregated labels

Collector version

v0.60.0-47-g0bf2d8429d

Environment information

No response

OpenTelemetry Collector configuration

receivers:
  hostmetrics:
    collection_interval: 5s
    scrapers:
      filesystem:

processors:
    metricstransform:
      transforms:
        # Keep only direction/request metrics
        - include: ^system.filesystem
          match_type: regexp
          action: update
          operations:
            - action: aggregate_labels
              label_set: [ device, mode, mountpoint, type]
              aggregation_type: sum

exporters:
  logging:
    loglevel: debug

service:
  pipelines:
    metrics:
      receivers: [hostmetrics]
      processors: [metricstransform]
      exporters: [logging]

Log output

No response

Additional context

No response

github-actions[bot] commented 1 year ago

Pinging code owners: @dmitryax. See Adding Labels via Comments if you do not have permissions to add labels yourself.

github-actions[bot] commented 1 year ago

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:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

github-actions[bot] commented 1 year ago

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:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

abhide commented 1 year ago

@dmitryax I would like to work on this issue. Can you please assign it to me?

dmitryax commented 1 year ago

Thanks, @abhide. Assigned to you

BinaryFissionGames commented 1 year ago

Closing as resolved by #20442 (Thanks @abhide!)