Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fuser-guides%2Fapm-v2%2Fgetting-started%2Faligning-coralogix-and-otel-naming-conventions.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fuser-guides%2Fapm-v2%2Fgetting-started%2Faligning-coralogix-and-otel-naming-conventions.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# Aligning Coralogix and OTel naming conventions

OpenTelemetry sometimes introduces breaking changes that, if left unaddressed, can disrupt the experience for customers upgrading to newer versions. To prevent this, enable a `transform` statement to ensure that span attributes and metric labels conform to Coralogix-supported label conventions.

## Usage guidelines[​](#usage-guidelines "Direct link to Usage guidelines")

Coralogix APM and the OpenTelemetry Collector currently support the label conventions outlined in the [APM label conventions supported by Coralogix](#apm-label-conventions-supported-by-coralogix) section below. If you use labels that do not adhere to Coralogix conventions, utilize a transform processor in the OpenTelemetry Collector to extract the values from your custom labels and map them to the conventions supported by Coralogix.

## Align span attributes with Coralogix-supported metric label conventions[​](#align-span-attributes-with-coralogix-supported-metric-label-conventions "Direct link to Align span attributes with Coralogix-supported metric label conventions")

Span Metrics are gathered directly from the collector. For more information, see the [Span Metrics](https://coralogix.com/docs/user-guides/apm-v2/getting-started/span-metrics.md) documentation.

Use the `transform/spanmetrics` processor to align span attributes with Coralogix-supported metric label conventions when collecting Span Metrics. The next section shows how to use the `transform` statement.

### Span Metrics[​](#span-metrics "Direct link to Span Metrics")

**Updating the `transform/spanmetrics` processor**

Add the required transformation as part of the `transform/spanmetrics` processor. The following example illustrates how to transform attributes into a supported convention.

```
transform/spanmetrics:

        error_mode: silent

        trace_statements:

        - context: span

          statements:

          - set(attributes["db.namespace"], attributes["db.name"]) where attributes["db.namespace"]

            == nil

          - set(attributes["db.namespace"], attributes["server.address"]) where attributes["db.namespace"]

            == nil

          - set(attributes["db.namespace"], attributes["network.peer.name"]) where attributes["db.namespace"]

            == nil

          - set(attributes["db.namespace"], attributes["net.peer.name"]) where attributes["db.namespace"]

            == nil

          - set(attributes["db.namespace"], attributes["db.system"]) where attributes["db.namespace"]

            == nil

          - set(attributes["db.operation.name"], attributes["db.operation"]) where attributes["db.operation.name"]

            == nil

          - set(attributes["db.collection.name"], attributes["db.sql.table"]) where attributes["db.collection.name"]

            == nil

          - set(attributes["db.collection.name"], attributes["db.cassandra.table"]) where

            attributes["db.collection.name"] == nil

          - set(attributes["db.collection.name"], attributes["db.mongodb.collection"])

            where attributes["db.collection.name"] == nil

          - set(attributes["db.collection.name"], attributes["db.redis.database_index"])

            where attributes["db.collection.name"] == nil

          - set(attributes["db.collection.name"], attributes["db.elasticsearch.path_parts.index"])

            where attributes["db.collection.name"] == nil

          - set(attributes["db.collection.name"], attributes["db.cosmosdb.container"])

            where attributes["db.collection.name"] == nil

          - set(attributes["db.collection.name"], attributes["aws_dynamodb.table_names"])

            where attributes["db.collection.name"] == nil
```

**Adding the `transform/spanmetrics` to the pipeline**

Place the `transform/spanmetrics` processor **above** the `batch` processor in the traces pipeline.

```
        traces:

          exporters:

          - debug

          - spanmetrics

          - forward/db

          processors:

          - memory_limiter

          - resource/metadata

          - k8sattributes

          - transform/k8s_attributes

          - transform/spanmetrics

          - batch
```

## APM label conventions supported by Coralogix[​](#apm-label-conventions-supported-by-coralogix "Direct link to APM label conventions supported by Coralogix")

Coralogix fully supports OpenTelemetry, including its semantic conventions. However, as the OpenTelemetry specification evolves, new attributes or updates may be introduced that are not yet fully supported. To ensure consistent processing and accurate visualization within Coralogix, we recommend transforming span attributes and metric labels to align with the supported conventions outlined below.

### Span Metrics[​](#span-metrics-1 "Direct link to Span Metrics")

**Services**

| **Metric**           | **Label**                                                          |
| -------------------- | ------------------------------------------------------------------ |
| `duration_ms_sum`    | `span_name, service_name, span_kind, status_code, http_method`     |
| `duration_ms_bucket` | `span_name, service_name, span_kind, status_code, http_method, le` |
| `calls_total`        | `span_name, service_name, span_kind, status_code, http_method`     |
| `duration_ms_count`  | `span_name, service_name, span_kind, status_code, http_method`     |

**Databases**

| **Metric**              | **Label**                                                                                                  |
| ----------------------- | ---------------------------------------------------------------------------------------------------------- |
| `db_calls_total`        | `status_code, db_system, db_namespace, span_name, db_operation_name, db_collection_name, service_name`     |
| `db_duration_ms_sum`    | `status_code, db_system, db_namespace, span_name, db_operation_name, db_collection_name, service_name`     |
| `db_duration_ms_count`  | `status_code, db_system, db_namespace, span_name, db_operation_name, db_collection_name, service_name`     |
| `db_duration_ms_bucket` | `status_code, db_system, db_namespace, span_name, db_operation_name, db_collection_name, service_name, le` |

## Next steps[​](#next-steps "Direct link to Next steps")

With your data flowing in, head to the [catalog](https://coralogix.com/docs/user-guides/apm-v2/services.md) to start exploring your services and databases.

## Additional resources[​](#additional-resources "Direct link to Additional resources")

* [More examples in Coralogix public GitHub repository](https://github.com/coralogix/telemetry-shippers/tree/master/otel-integration/k8s-helm#note-on-semantic-conventions-for-old-otel-sdks)
* [values.yaml template](https://github.com/coralogix/telemetry-shippers/blob/master/otel-integration/k8s-helm/values.yaml)
