Skip to main content

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​

Coralogix APM and the OpenTelemetry Collector currently support the label conventions outlined in the 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​

Span Metrics are gathered directly from the collector. For more information, see the Span Metrics 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​

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​

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​

Services

MetricLabel
duration_ms_sumspan_name, service_name, span_kind, status_code, http_method
duration_ms_bucketspan_name, service_name, span_kind, status_code, http_method, le
calls_totalspan_name, service_name, span_kind, status_code, http_method
duration_ms_countspan_name, service_name, span_kind, status_code, http_method

Databases

MetricLabel
db_calls_totalstatus_code, db_system, db_namespace, span_name, db_operation_name, db_collection_name, service_name
db_duration_ms_sumstatus_code, db_system, db_namespace, span_name, db_operation_name, db_collection_name, service_name
db_duration_ms_countstatus_code, db_system, db_namespace, span_name, db_operation_name, db_collection_name, service_name
db_duration_ms_bucketstatus_code, db_system, db_namespace, span_name, db_operation_name, db_collection_name, service_name, le

Next steps​

With your data flowing in, head to the catalog to start exploring your services and databases.

Additional resources​

Last updated on