# Unable to use copy\_values processor with otel\_metrics\_source

**URL:** <https://forum.opensearch.org/t/unable-to-use-copy-values-processor-with-otel-metrics-source/15674>\
**Category:** Data Prepper\
**Created:** [August 28, 2023, 6:18am UTC](https://forum.opensearch.org/t/unable-to-use-copy-values-processor-with-otel-metrics-source/15674 "2023-08-28T06:18:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ananda\_krishnan](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@ananda\_krishnan](https://forum.opensearch.org/u/ananda_krishnan)\
**Post date:** [August 28, 2023, 6:18am UTC](https://forum.opensearch.org/t/unable-to-use-copy-values-processor-with-otel-metrics-source/15674/1 "2023-08-28T06:18:28Z")

</div>

**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** :

```auto
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](https://github.com/opensearch-project/data-prepper/issues/3240)

---

<div class="post-metadata">

**Author:** ![ananda\_krishnan](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@ananda\_krishnan](https://forum.opensearch.org/u/ananda_krishnan)\
**Post date:** [August 30, 2023, 10:38am UTC](https://forum.opensearch.org/t/unable-to-use-copy-values-processor-with-otel-metrics-source/15674/2 "2023-08-30T10:38:38Z")

</div>

@dlv Can you please help me on this

---

<div class="post-metadata">

**Author:** ![ananda\_krishnan](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@ananda\_krishnan](https://forum.opensearch.org/u/ananda_krishnan)\
**Post date:** [August 31, 2023, 7:58am UTC](https://forum.opensearch.org/t/unable-to-use-copy-values-processor-with-otel-metrics-source/15674/3 "2023-08-31T07:58:20Z")

</div>

@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 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [October 30, 2023, 7:58am UTC](https://forum.opensearch.org/t/unable-to-use-copy-values-processor-with-otel-metrics-source/15674/4 "2023-10-30T07:58:39Z")

</div>

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