---
title: Data stream routing
description: Elastic APM supports routing APM data to user-defined data stream names using the reroute processor. However, you can also ingest OTLP data without having...
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/4236/solutions/observability/apm/opentelemetry/data-stream-routing
---

# Data stream routing
Elastic APM supports [routing APM data](/elastic/docs-content/pull/4236/solutions/observability/apm/data-streams#apm-data-stream-rerouting) to user-defined data stream names using the [`reroute` processor](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/tree/main/reference/enrich-processor/reroute-processor). 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](https://docs-v3-preview.elastic.dev/elastic/ecs/tree/main/reference/ecs-data_stream).
You can set the `data_stream` attributes at resource level, scope level, and record level. Elastic parses the attributes in increasing order of precedence. For example, record `data_stream` attributes override the scope `data_stream` attributes. This implies that `data_stream` attributes are inherited from previous levels. If a scope does not specify `data_stream` attributes, it uses the resource attributes.
For guidance on how to set resource attributes in OpenTelemetry, refer to [setting resource attributes](/elastic/docs-content/pull/4236/solutions/observability/apm/opentelemetry/attributes#setting-resource-attributes).