OpenTelemetry Integration

Send LLM traces to Ingate using the standard OTLP/HTTP protocol. Compatible with any OpenTelemetry SDK.

Overview

Ingate includes a built-in OTLP/HTTP trace receiver at /v1/traces. If your application is already instrumented with OpenTelemetry, you can export GenAI spans directly to Ingate without modifying your code. Just point your OTel exporter at Ingate.

Endpoint

POST
/v1/traces

OTLP/HTTP trace export. Accepts protobuf and JSON.

Content Types

Content-TypeFormat
application/x-protobufStandard protobuf encoding (recommended)
application/jsonJSON encoding

Configuration

Point your OpenTelemetry exporter at Ingate:

bashEnvironment Variables
# Set the OTLP endpoint to Ingate
export OTEL_EXPORTER_OTLP_ENDPOINT=https://api.ingateai.com
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf

# Authenticate with your Ingate API key
export OTEL_EXPORTER_OTLP_HEADERS="X-Ingate-Key=sk-ingate-your-key"

Python Example

python
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter

exporter = OTLPSpanExporter(
    endpoint="https://api.ingateai.com/v1/traces",
    headers={"X-Ingate-Key": "sk-ingate-your-key"}
)

provider.add_span_processor(BatchSpanProcessor(exporter))

GenAI Span Filtering

Ingate processes only GenAI-related spans from the trace payload. Other spans (HTTP, database, etc.) are silently ignored. GenAI spans are identified by semantic conventions in the span attributes.

Mapped Fields

GenAI span attributes are mapped to Ingate's unified log format:

OTel AttributeIngate Field
gen_ai.systemprovider
gen_ai.request.modelmodel
gen_ai.promptprompt
gen_ai.completioncompletion
gen_ai.usage.prompt_tokenstoken_count (input)
gen_ai.usage.completion_tokenstoken_count (output)
Span durationlatency_ms

Request Limits

Maximum request body size: 4 MB. Payloads exceeding this limit receive413 Request Entity Too Large.

Complementary to the proxy

OTel ingestion and the proxy are complementary. Use the proxy for real-time LLM routing and the OTel receiver for applications that are already instrumented with OpenTelemetry tracing.