Skip to main content
AgentHub has a standard OpenTelemetry trace receiver. If your agent is already instrumented, or you’re happy to use an off-the-shelf instrumentor, you can point the exporter at AgentHub and skip the JSON ingest format entirely. There’s still no CorePillar SDK: everything below uses public OpenTelemetry packages.

Endpoint and authentication

Create the key under Settings → Tracing keys, exactly as in the Tracing quickstart. Spans land in the key’s project.
The two endpoint shapes aren’t interchangeable. OTEL_EXPORTER_OTLP_ENDPOINT, the Collector’s otlphttp exporter, the Java agent and Traceloop.init(api_endpoint=...) append /v1/traces themselves, so give them the base. Exporter constructors such as Python’s OTLPSpanExporter(endpoint=...), Node’s new OTLPTraceExporter({ url }) and Go’s WithEndpointURL take the full URL. Mixing them up is the most common reason a first trace never arrives.
The word Bearer must be capitalized exactly like that. If the Authorization header doesn’t start with Bearer , AgentHub falls back to the x-tracing-key header and, if that’s missing too, rejects the export with 401.

Setup

OpenLLMetry auto-instruments the OpenAI, Anthropic, Bedrock, LangChain and LlamaIndex clients you already call.
main.py
The Overview page in AgentHub shows the same snippets with your deployment’s endpoint filled in.

Request requirements

Response

AgentHub answers with a standard OTLP ExportTraceServiceResponse and HTTP 200, encoded the same way as the request, not with the { data } envelope the rest of the API uses (exporters would log a transport error otherwise).
  • Full success: an empty message ({} for JSON).
  • Some spans dropped: partialSuccess with rejectedSpans and an errorMessage, for example:
Authentication and decoding failures return the normal API error envelope (401 UNAUTHORIZED, 400/415 VALIDATION_ERROR) instead. A span is dropped if it has no usable trace id, no span id, or no valid start and end time. If storing a whole trace fails, all of that trace’s spans are counted as rejected and the rest of the export is still processed.

How OpenTelemetry spans are mapped

AgentHub reads OpenLLMetry (Traceloop), the OpenTelemetry GenAI semantic conventions (gen_ai.*) and OpenInference (llm.*, openinference.*) attributes. It maps attributes, not client libraries, so any instrumentor that emits those conventions works.

Span kind

Checked in this order; the first match wins.

Fields

Spans that arrive in several exports

OpenTelemetry exports a span when it ends, on a batch timer, so a trace usually arrives across several requests with its root span last. That’s expected: each export is merged into the same trace, totals are recomputed from all stored spans, and the trace name is corrected once the root span arrives. Exports with more than 500 spans for one trace are split automatically.

Session stitching

Many instrumentors start a new trace for every top-level model or tool call unless you wrap the run in a span of your own. To keep one agent run together, AgentHub merges such fragments into one trace when they share a session key and arrive close together:
  • Session key: the first of session.id, session_id, gen_ai.conversation.id, conversation.id, thread.id, langfuse.session.id, traceloop.association.properties.session_id, openinference.session.id, agent.run.id or run.id found on any span or on the resource. If none is set, the pair service.name plus service.instance.id is used. With neither, no stitching happens.
  • Window: a fragment joins the session’s first trace if it starts no more than 2 minutes after that trace’s last span ended.
  • Cap: a stitched trace stops growing at 2,000 spans; later fragments start a new trace.
  • Stitched traces carry a session:<hash> tag, plus stitched once a merge has happened.
The most reliable way to get one trace per run is still to open your own root span (for example with tracer.start_as_current_span("agent_run"):) around the whole run.

Metrics and logs

Traceloop.init() and several OTel SDKs also export metrics and logs to the same base endpoint. AgentHub accepts them at POST /api/v1/metrics and POST /api/v1/logs so your console doesn’t fill with 404 errors, but it discards them: only traces are stored. Both endpoints still require a valid tracing key.