Aidbox supports exporting metrics using the Protobuf protocol in line with the OTEL specification. This guide configures Aidbox to export metrics to the OpenTelemetry collector, but the setup can also be modified to export to other metrics consumers that adhere to this specification.

This way of enabling OTEL capabilities is available in Aidbox versions 2503 and later. On previous AIdbox versions it was possible to enable OTEL with Aidbox configuration project.

As an alternative, for testing purposes, you can add an OTEL collector as an additional service within your docker-compose:

services:
  aidbox:
    environment:
```
      BOX_OBSERVABILITY_OTEL_TRACES_URL: http://otel-collector:4318
      BOX_OBSERVABILITY_OTEL_LOGS_URL: http://otel-collector:4318
      BOX_OBSERVABILITY_OTEL_METRICS_URL: http://otel-collector:4318
```
  otel-collector:
    image: otel/opentelemetry-collector-contrib
    volumes:
    - ./otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
    ports:
    - 4318:4318
```

And in the same directory as your docker-compose, add a configuration file called otel-collector-config.yaml for OTEL:

receivers:
  otlp:
    protocols:
      http:
        endpoint: 0.0.0.0:4318 

exporters:
  debug:
    verbosity: detailed

service:
  pipelines:
    logs:
      receivers: [otlp]
      exporters: [debug] # OTEL prints logs to the stdout
    metrics:
      receivers: [otlp]
      exporters: [debug] # OTEL prints metrics to the stdout
    traces:
      receivers: [otlp]
      exporters: [debug] # OTEL prints traces to the stdout

And with that, the OTEL test environment is ready.

You can view the incoming logs, metrics, and traces directly from the container using the command:

docker logs -f otel-collector

Prerequisites

  1. 1.
    OTEL collector should be deployed and configured to receive metrics.

How to enable metrics export to the OTEL collector

To enable exporting metrics to the OTEL collector set the OTEL collector metrics receiver endpoint to the Aidbox setting observability.otel.metrics-url.

How to check the OTEL collector receives metrics

Set up debug exporter and metrics pipeline in the OTEL collector configuration:

receivers:
receivers:
  otlp:
    protocols:
      http:
        endpoint: <your-collector-resiever-endpoint>

exporters:
  debug:
    verbosity: detailed

service:
  pipelines:
    metrics:
      receivers: [otlp]
      exporters: [debug] # OTEL prints metrics to the stdout

See Aidbox metrics in the OTEL collector stdout

Open OTEL collector stdout and see the logs.

Check all available Aidbox OTEL metrics exporter configuration options are here:

Last updated 2025-08-22T11:53:37Z