Enable telemetry

AI Gateway supports telemetry via OpenTelemetry.

  • Traces

  • Metrics (Note: the processors don’t support metrics at this point)

AI Gateway exports the collected traces and metrics to a gRPC endpoint.

To enable telemetry, configure the tracing and metrics parameters of the Helm chart. For example, the following values file enables telemetry and configures exporting both traces and metrics to a TLS gRPC endpoint at https://otel-collector-opentelemetry-collector:4317:

tracing:
  endpoint: "https://otel-collector-opentelemetry-collector:4317"
metrics:
  endpoint: "https://otel-collector-opentelemetry-collector:4317"

Supported metrics

AI Gateway core exposes the following metrics:

Additional configuration

See the additional telemetry configuration-related environmental variables

To configure how tracing data is sampled, see the Sampler configuration.

For example, the following values file configures a CA for connections to the tracing and metrics endpoints (the CA needs to be available in the ConfigMap collector-ca (same namespace as the AI Gateway namespace) in the key ca.crt). Additionally, we configure the metrics export interval to 10s.

aigw:
  env:
    - name: OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE
      value: "/etc/collector/ca.crt"
    - name: OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE
      value: "/etc/collector/ca.crt"
    - name: OTEL_METRIC_EXPORT_INTERVAL
      value: "10000" # 10s
  volumes:
    - name: collector-ca-volume
      configMap:
        name: collector-ca
  volumeMounts:
    - name: collector-ca-volume
      readOnly: true
      mountPath: "/etc/collector"
      
tracing:
  endpoint: "https://otel-collector-opentelemetry-collector:4317"
 
metrics:
  endpoint: "https://otel-collector-opentelemetry-collector:4317"
  
processors:
  f5:
    env:
      - name: OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE
        value: "/etc/collector/ca.crt"
    volumes:
      - name: collector-ca-volume
        configMap:
          name: collector-ca
    volumeMounts:
      - name: collector-ca-volume
        readOnly: true
        mountPath: "/etc/collector"