Skip to main content
Instrument at scale. These patterns are for production systems — routing through an OTEL Collector for centralized processing, propagating context across services and async boundaries, sampling to control volume and cost, and resilient deployment patterns.

OTEL Collector

The OpenTelemetry Collector acts as an intermediate processing layer between your applications and Arize. It collects, processes, and routes telemetry data — useful for centralized credential management, data masking, multi-backend routing, and compliance.
OpenTelemetry Collector architecture

Deployment Models

Example Configuration

Dynamic Trace Routing

Try in-app routing first. For most teams, Route Spans to Multiple Projects using register_with_routing from arize-otel is enough — no collector to operate, no extra infrastructure. Only reach for the collector pattern below if you need centralized policy or routing logic the SDK can’t express.
Route traces to different Arize AX projects based on span attributes:
Set routing attributes in your app:
OTEL Collector routing traces from one application to multiple Arize spaces based on span attributes

Alternative for Centralized Gateway Collectors

If you operate a centralized collector that serves many teams, you may not want to redeploy the collector every time a new Arize space is added. In that setup, have each application send the target arize-space-id as request metadata to the collector, then configure the collector to forward that metadata as an outbound header to Arize AX. This pattern works well when:
  • The collector is shared across many teams
  • Teams are responsible for selecting their own target Arize space
  • You want to avoid maintaining a separate headers_setter instance for every space
When using this approach, make sure the OTLP receiver is configured with include_metadata: true; otherwise, the inbound request headers will not be available to the headers_setter extension.
Applications should still set the project name as a resource attribute, for example openinference.project.name, so traces continue to land in the expected Arize AX project. This approach is best suited for trusted internal environments where the collector is allowed to honor caller-provided routing metadata. Beyond centralized routing, you may also need to handle tracing context across async boundaries and services:

Manual Context Propagation

OpenTelemetry handles context propagation automatically in most cases. For async workflows or custom concurrency, you may need to do it manually.

Async Functions

Multi-Service Propagation

Propagate tracing context across HTTP calls between microservices: Service A (sends request):
Service B (receives request):

ThreadPoolExecutor

Preserve tracing context when submitting tasks to a thread pool:
If you’re generating too many spans, you can selectively control which ones get recorded:

Custom Sampling

Control which spans get recorded to manage telemetry volume and cost:
One gotcha when mixing manual spans with context attributes:

Inheriting Context Attributes in Manual Spans

Context attributes from using_session, using_metadata, etc. are NOT automatically attached to manually created spans. Use this helper to pull them in:
Finally, for production resilience:

Health Check Pattern

Validate endpoint connectivity before initializing the tracer — graceful fallback when services are unavailable:

You’ve completed the Instrument workflow

Your application is fully instrumented — traces flow to Arize AX with the data, context, and configuration you need. Now start observing:

Next: View Your Traces