Skip to content
agentgateway has joined the Agentic AI FoundationLearn more

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

OpenTelemetry Collector (OTel)

Page as Markdown

Route agentgateway traces through an OpenTelemetry Collector to fan out to multiple backends or apply processing pipelines.

The OpenTelemetry Collector is a vendor-agnostic proxy that receives, processes, and exports telemetry data. For production deployments, routing agentgateway traces through a collector lets you fan out to multiple backends, apply processing pipelines such as batching or filtering, and swap backends without changing your agentgateway configuration.

The way you set up the OTel Collector depends on how you installed agentgateway.

Run the OTel Collector as a Docker container on the same host as agentgateway and point agentgateway at localhost:4317.

  1. Create an otel-collector-config.yaml file that defines the OTLP receiver, a batch processor, and your chosen exporter.

    receivers:
      otlp:
        protocols:
          grpc:
            endpoint: 0.0.0.0:4317
    
    processors:
      batch:
    
    exporters:
      debug:
        verbosity: detailed
    
    service:
      pipelines:
        traces:
          receivers: [otlp]
          processors: [batch]
          exporters: [debug]

    Replace the debug exporter with the exporter for your tracing backend. For a full example that exports to Jaeger, see the otel-collector-config.yaml file.

  2. Start the OTel Collector container and mount your config file.

    docker run -d --name otel-collector \
      -p 4317:4317 \
      -v $(pwd)/otel-collector-config.yaml:/etc/otelcol/config.yaml \
      otel/opentelemetry-collector:latest
  3. Configure agentgateway to send traces to the collector.

    # yaml-language-server: $schema=https://agentgateway.dev/schema/config
    frontendPolicies:
      tracing:
        host: localhost:4317
        randomSampling: true
  4. When you are done, remove the OTel Collector container.

    docker rm -f otel-collector
Was this page helpful?
Agentgateway assistant

Ask me anything about agentgateway configuration, features, or usage.

Note: AI-generated content might contain errors; please verify and test all returned information.

Tip: one topic per conversation gives the best results. Use the + button in the chat header to start a new conversation.

Switching topics? Starting a new conversation improves accuracy.
↑↓ navigate select esc dismiss

What could be improved?

Your feedback helps us improve assistant answers and identify docs gaps we should fix.

Need more help? Join us on Discord: https://discord.gg/y9efgEmppm

Want to use your own agent? Add the Solo MCP server to query our docs directly. Get started here: https://search.solo.io/.