Dashboard|

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/protobuf

The 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:

LibraryExamples
OpenTelemetry GenAI conventionsgen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.input.messages
OpenInference (Arize)llm.model_name, llm.token_count.prompt, input.value
OpenLLMetry (Traceloop)gen_ai.prompt.0.content, traceloop.span.kind
Vercel AI SDKai.model.id, ai.usage.inputTokens, ai.response.text

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.

StatusMeaningExporter retries
200Accepted. If some spans couldn't be stored, the response's partialSuccess says how many and why.No
400Not a valid OTLP exportNo
401 / 403Missing or invalid key, or a publishable keyNo
413Over 8 MB, or over 5,000 spans in one exportNo
415Not protobuf or JSON, or compressed with something other than gzipNo
429More than 600 exports a minute for this projectYes, after Retry-After
503Cencori couldn't store them right nowYes, after Retry-After

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.