# Otel metrics handling: field naming (@ in field names)

**URL:** <https://forum.opensearch.org/t/otel-metrics-handling-field-naming-in-field-names/14329>\
**Category:** Data Prepper\
**Tags:** discuss, troubleshoot\
**Created:** [May 12, 2023, 2:18pm UTC](https://forum.opensearch.org/t/otel-metrics-handling-field-naming-in-field-names/14329 "2023-05-12T14:18:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sulu](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@Sulu](https://forum.opensearch.org/u/Sulu)\
**Post date:** [May 12, 2023, 2:18pm UTC](https://forum.opensearch.org/t/otel-metrics-handling-field-naming-in-field-names/14329/1 "2023-05-12T14:18:40Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
OpenSearch and OpenSearch Dashboards 2.7.0,  
DataPrepper 2.2.1  
and OTEL Collector contrib 0.75.0.

**Describe the issue** :  
Data Prepper plugin _otel-metrics-raw-processor_ is modifying incoming field names.  
In file  
[\data-prepper-plugins\otel-metrics-raw-processor\src\main\java\org\opensearch\dataprepper\plugins\processor\otelmetrics\OTelMetricsProtoHelper.java](https://github.com/opensearch-project/data-prepper/blob/main/data-prepper-plugins/otel-metrics-raw-processor/src/main/java/org/opensearch/dataprepper/plugins/processor/otelmetrics/OTelMetricsProtoHelper.java)

one can see that dots are replaced by ‘@’ or that field names are prefixed with resource.attributes for example.

For example: in OpenSearch I will find

```auto
"resource.attributes.service@name": "cartservice"

```

If I compare this to Loki (where I have sent logs from OTEL Collector) it looks like this

```auto
  "resources": {
...
    "service.name": "cartservice",
...
}

```

(In Loki it seems also not OTEL compliant, OTEL calls the field resource.)

I am little bit confused and would like to understand the intention behind using ‘@’ and the specific prefix handling.

Ideally I have expected something like this

```auto
  "resource": {
...
    "service.name": "cartservice",
...
}

```

**Configuration** :

```auto
  processor:
    - otel_metrics_raw_processor:
        calculate_histogram_buckets: true
        calculate_exponential_histogram_buckets: true
        exponential_histogram_max_allowed_scale: 10
        flatten_attributes: true

```

**Relevant Logs or Screenshots** :

---

<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:** [July 11, 2023, 2:18pm UTC](https://forum.opensearch.org/t/otel-metrics-handling-field-naming-in-field-names/14329/2 "2023-07-11T14:18:53Z")

</div>

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