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

# OpenTelemetry

> Export every run, step, tool call and model call to an OTLP backend such as Langfuse.

```toml OpenTelemetry theme={null}
[telemetry]
endpoint = "http://localhost:4318"
service_name = "graph"

[telemetry.resource]
"deployment.environment" = "dev"
```

```toml Langfuse theme={null}
[telemetry]
endpoint = "https://cloud.langfuse.com/api/public/otel"

[telemetry.headers]
Authorization = "Basic ${LANGFUSE_AUTH}"
"x-langfuse-ingestion-version" = "4"
```

## Related config.toml options

**telemetry** `object`

OpenTelemetry export over OTLP/HTTP.

**telemetry.endpoint** `string`

The OTLP/HTTP endpoint. Telemetry is off without one.

**telemetry.protocol** `enum\<string\>` (default: http/protobuf)

Wire format.

Available options: `http/protobuf`, `http/json`

**telemetry.timeout\_secs** `integer`

Export timeout in seconds.

**telemetry.service\_name** `string`

The `service.name` resource attribute.

**telemetry.headers** `map\<string, string\>`

Headers sent with every export, such as auth.

**telemetry.resource** `map\<string, string\>`

Extra resource attributes.

**telemetry.capture\_content** `boolean` (default: true)

Include prompts and responses in spans.

**telemetry.logs** `boolean` (default: false)

Export logs as well as traces.

[Go to full reference](/reference/configuration)

## Related environment variables

**OTEL\_EXPORTER\_OTLP\_ENDPOINT** `string`

The OTLP/HTTP endpoint to export to.

Overrides [`telemetry.endpoint`](/reference/configuration#param-telemetry-endpoint) in config.toml.

**OTEL\_EXPORTER\_OTLP\_PROTOCOL** `enum\<string\>` (default: http/protobuf)

The export wire format.

Overrides [`telemetry.protocol`](/reference/configuration#param-telemetry-protocol) in config.toml.

| Value | Effect |
| - | - |
| `http/protobuf` | Protobuf over HTTP. |
| `http/json` | JSON over HTTP. |

**OTEL\_EXPORTER\_OTLP\_TIMEOUT** `integer`

Export timeout, in milliseconds.

Overrides [`telemetry.timeout_secs`](/reference/configuration#param-telemetry-timeout-secs) in config.toml.

**OTEL\_EXPORTER\_OTLP\_HEADERS** `string`

Extra headers as comma-separated `key=value` pairs, added to the configured ones.

Overrides [`telemetry.headers`](/reference/configuration#param-telemetry-headers) in config.toml.

**OTEL\_SERVICE\_NAME** `string`

The `service.name` resource attribute.

Overrides [`telemetry.service_name`](/reference/configuration#param-telemetry-service-name) in config.toml.

[Go to full reference](/reference/environment-variables)

## Send traces to Langfuse

Point `endpoint` at your Langfuse region's OTLP URL and authenticate with your project's API keys in `headers`:

```toml theme={null}
[telemetry]
endpoint = "https://cloud.langfuse.com/api/public/otel"

[telemetry.headers]
Authorization = "Basic ${LANGFUSE_AUTH}"
"x-langfuse-ingestion-version" = "4"
```

* `endpoint` is the base URL. graph adds `/v1/traces` itself. For the US region, use `https://us.cloud.langfuse.com/api/public/otel`.
* Set `LANGFUSE_AUTH` in your environment to the base64 encoding of `<public key>:<secret key>`. Header values can reference environment variables, so the keys stay out of the file.
* `x-langfuse-ingestion-version = "4"` makes traces show up in Langfuse right away instead of after a delay.

Langfuse groups the traces of one thread, or one workbench session, into a session.

## What a trace contains

* One trace per run or turn; steps, tool calls and model calls as spans
* Model, token usage and cost on each model call
* `capture_content` controls whether prompts and responses are included; `logs` exports logs too

## Check it worked

* Run `graph plan run` or `graph ask` and find the trace in the backend


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