diff --git a/solutions/observability/apm/data-stream-routing.md b/solutions/observability/apm/data-stream-routing.md new file mode 100644 index 0000000000..f5d3dff535 --- /dev/null +++ b/solutions/observability/apm/data-stream-routing.md @@ -0,0 +1,18 @@ +--- +mapped_pages: +applies_to: + stack: + serverless: +--- + +# Data stream routing [apm-open-telemetry-data-stream-routing] + +Elastic APM supports [routing APM data](/solutions/observability/apm/data-streams.md#apm-data-stream-rerouting) to user-defined data stream names using the [`reroute` processor](elasticsearch://reference/enrich-processor/reroute-processor.md). However, you can also ingest OTLP data without having to create new ingest pipelines. + +## Setting data stream attributes + +To automatically route OTLP data, set the `data_stream.dataset` and `data_stream.namespace` attributes. These attributes map to the respective [ECS fields](ecs://reference/ecs-data_stream.md). + +You can set the `data_stream` attributes at resource level, scope level, span level, or span event level. Elastic parses the attributes in increasing order of precedence. For example, span event `data_stream` attributes override the span `data_stream` attributes. This implies that `data_stream` attributes are inherited from previous levels. If a span doesn't specify `data_stream` attributes, it uses the scope attributes. + +For guidance on how to set resource attributes in OpenTelemetry, refer to [setting resource attributes](/solutions/observability/apm/attributes.md#setting-resource-attributes). diff --git a/solutions/toc.yml b/solutions/toc.yml index e202a9c385..4b0fe5750f 100644 --- a/solutions/toc.yml +++ b/solutions/toc.yml @@ -132,6 +132,7 @@ toc: - file: observability/apm/collect-metrics.md - file: observability/apm/limitations.md - file: observability/apm/attributes.md + - file: observability/apm/data-stream-routing.md - file: observability/apm/apm-k8s-attacher.md - file: observability/apm/monitor-aws-lambda-functions.md - file: observability/apm/jaeger.md