> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cruq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenTelemetry

> Export any run as an OpenTelemetry trace and load it into Langfuse, Phoenix, Grafana Tempo or any OTLP backend.

Any run can be exported as OpenTelemetry trace data (OTLP/JSON), using the
[GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/).
Load it into Langfuse, Phoenix, Honeycomb, Grafana Tempo or anything else that
accepts OTLP.

## From the dashboard

Open a run in **AI Monitoring**. Next to the trace, **View OTel** shows the
trace data, ready to copy, and **Export OTel** downloads it as
`run-<id>.otel.json`.

## From the API and CLI

```bash theme={null}
GET /v1/runs/{id}/otel
cruqai trace <run-id> --otel
```

## What's in it

The run is one trace. Its trace id is the run id without dashes, so you can get
from a trace back to the run. Spans:

* `invoke_agent <agent>`: the whole run, with its input, output and total usage
* `chat <model>`: one per model call, with tokens, cached tokens and cost
* `execute_tool <tool>`: one per tool call, from the call to its result
* `guardrail <name>` and `decision <name>`: one per check or decision

Runs recorded before October 2026 have no step timing. Their spans all start
when the run started and have no duration.

## Send it to a collector

```bash theme={null}
cruqai trace <run-id> --otel | curl -X POST http://localhost:4318/v1/traces \
  -H 'Content-Type: application/json' --data-binary @-
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.