Skip to main content

OpenTelemetry / OTLP: measure any agent

Already emit OTLP? Point your exporter at Yardstick and every agent span gets a cost.

If your app already uses OpenTelemetry, you do not need a per-framework connector. Point your OTLP exporter at Yardstick and every LLM & agent span shows up with its cost. Yardstick understands the common GenAI conventions (OpenLLMetry, OpenInference, and the OpenTelemetry GenAI semantic conventions), so frameworks like LangChain, LlamaIndex, the OpenAI Agents SDK, CrewAI, and the Vercel AI SDK work out of the box.

Set these environment variables (copy the exact endpoint & generate a key from the OpenTelemetry card on your Connect page):

OTEL_EXPORTER_OTLP_ENDPOINT=<your Yardstick OTLP endpoint>
OTEL_EXPORTER_OTLP_HEADERS=x-yardstick-key=ysk_...

Spans are attributed to an agent using the agent name on the span (for example gen_ai.agent.name or service.name); anything without a name lands in a catch-all agent so nothing is lost. The endpoint accepts OTLP over HTTP in both JSON and protobuf, so a stock exporter works with no extra protocol flag.

Did this answer your question?