OpenTelemetry
Send traces to Cencori from any language or framework with a standard OpenTelemetry exporter.
Cencori accepts traces in OpenTelemetry's standard format (OTLP). Use this when you work in a language without a Cencori package yet, when your app already uses OpenTelemetry, or when you use an instrumentation cencori/observe doesn't include. In Node.js, cencori/observe does all of this for you.
Endpoint
POST https://api.cencori.com/v1/traces
Authorization: Bearer csk_...
- Use a project's secret key. Traces go to that key's project.
- Protobuf (
application/x-protobuf) and JSON (application/json) are both accepted, optionally compressed with gzip. - Any OTLP/HTTP exporter works. gRPC isn't supported.
Configure an exporter
Most OpenTelemetry SDKs can be pointed at Cencori in code, which keeps your key in the variable you already have:
import os
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
exporter = OTLPSpanExporter(
endpoint="https://api.cencori.com/v1/traces",
headers={"Authorization": f"Bearer {os.environ['CENCORI_API_KEY']}"},
)Or with OpenTelemetry's standard environment variables, without code:
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://api.cencori.com/v1/traces
OTEL_EXPORTER_OTLP_TRACES_HEADERS="Authorization=Bearer%20csk_..."
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobufThe space after Bearer is written %20 in that variable: it's how OpenTelemetry reads header values.
To send to Cencori and another tool at once, add a second exporter (or span processor) rather than replacing yours.
What Cencori reads
Cencori understands the AI attributes written by the common instrumentation libraries, so traces from any of them show models, tokens, prompts, replies and cost:
Each span is sorted as a model call, embedding, tool, agent, chain, retriever or other step. For the user and session, Cencori reads user.id and session.id (and gen_ai.conversation.id, and the equivalents each library above uses).
Spans with no AI attributes, such as your HTTP handlers and database queries, are stored too, so the steps around your model calls are part of the trace.
Responses
Cencori answers the way OTLP exporters expect, so they retry only when it helps.
A span is refused, and counted in partialSuccess, when its trace or span id is invalid, it has no start time, or your plan's monthly allowance is used up. See Plans and limits.

