Unable to use copy_values processor with otel_metrics_source

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Opensearch 2.7
Data Prepper 2.3.3

Describe the issue:
The opentelemetry collector exports metrics data to data-prepper which uses source as otel_metrics_source to receive the data.
Here I would like to copy a value from existing field and place it to a new field.
Hence I went with copy_values processor but the data-prepper pod errored out and failed.

Configuration:

otel-metrics-pipeline:
  workers: 1
  delay: 3000
  source:
    otel_metrics_source:
      health_check_service: true
      ssl: false
  buffer:
    bounded_blocking:
  processor:
    - copy_values:
        entries:
        - from_key: "Time"
          to_key: "@timestamp"
          overwrite_if_to_key_exists: true  
    - otel_metrics:
  sink:
    - opensearch:

Relevant Logs or Screenshots:
Error log : ExportMetricsServiceRequest cannot be cast to class event

Bug link: [BUG] Unable to use copy_values processor with otel_metrics_source · Issue #3240 · opensearch-project/data-prepper · GitHub

@dlv Can you please help me on this

@asif Thanks Asif for the suggestion.
Once after moving copy_values below otel_metrics in the processor section, it started to work fine.
Thanks again :slight_smile:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.