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

# OpenTelemetry CLI

> Opt in to OTEL for coding agents, inspect delivery, and restore your previous settings.

`failproofai otel` configures optional OpenTelemetry reporting to FailproofAI Cloud. First connect your machine with `failproofai config` and ask an organisation admin to enable **Settings → OpenTelemetry**.

Interactive setup asks about OpenTelemetry after the Cloud key field and the agent picker. The optional step defaults to No. Choose Yes to pick OTEL agents; the same enable code runs after the connection is written. Esc before setup applies changes nothing. Unattended setup, a supplied key, open-source mode, and keeping a saved connection do not opt you in.

## Enable an agent

```bash theme={null}
failproofai otel enable claude
failproofai otel enable codex --local
failproofai otel enable codex --no-content
failproofai otel enable copilot
failproofai otel enable all --yes
```

The supported agents are `claude`, `codex`, and `copilot` (VS Code). Copilot setup requires a VS Code executable or an installed Copilot extension. A leftover settings directory alone is not enough; setup skips Copilot when neither is found.

`--local` sends to the local relay instead of directly to Cloud. Copilot uses the relay automatically because its settings cannot store the authentication header.

The relay listens only on your machine. Your configured FailproofAI daemon picks up the change within seconds; you do not need to restart it. If another application owns the relay port, status reports it as off and the daemon keeps running.

<Warning>
  Text capture is on by default. Add `--no-content` to omit prompts and tool details. Agent versions can expose different content controls; review what your agent exports before using it with sensitive data.
</Warning>

Codex exports conversation logs only, not internal runtime traces or metrics. An explicit `log_user_prompt = false` in your Codex configuration stays off; enable prints a note when it preserves that choice.

### Choose one reporting path

If transcript reporting is on for an agent, setup asks:

> failproofai already sends Claude Code sessions to Cloud. Send them with OTEL instead? Transcript upload for Claude Code stops.

The default is No. `--yes` accepts the switch without a prompt. Other agents and policy enforcement are unaffected.

Codex setup waits for the daemon to confirm the collector change before writing its exporter settings. If confirmation times out, setup warns you to wait before starting Codex.

Config v2 keeps the remembered tracing list at `agents.selected` (and detection history at `agents.seen`). The per-agent transcript preference remains at `collector.agents.<agent>.sessions`, OTEL ownership at `otel.agents`, and relay settings at `collector.otlp.enabled` / `collector.otlp.port`. These separate keys keep old OTEL configurations readable: setup can change the tracing list without losing the transport preference or the state needed to restore your agent settings.

## Inspect setup

```bash theme={null}
failproofai otel status
```

Status shows every agent, whether its settings are managed by FailproofAI, its destination, the organisation's ingest switch, relay state, and the last relay upload result.

`unknown` for the organisation switch means the server did not provide it or could not be reached. It is not an error and does not prevent configuration on an older Cloud version.

If Cloud does not support OTEL yet, the relay retains rejected exports instead of discarding them. If organisation ingest is off, `enable` writes nothing and exits with an error; ask an admin to turn it on first.

## Print configuration for an application

```bash theme={null}
failproofai otel env --service my-agent
failproofai otel env --service my-agent --local
```

The output is a shell environment block for an OTLP/HTTP exporter. Cloud output sets `OTEL_EXPORTER_OTLP_ENDPOINT` to Cloud's OTLP base, `https://<cloud>/otel`, and the exporter appends `/v1/<signal>`; a per-signal variable such as `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` needs the full `https://<cloud>/otel/v1/logs`. Local output points at the relay, `http://127.0.0.1:<port>`. Cloud output includes the configured API key; treat it as a secret. Local output omits the key. To use local output, first enable a local agent so the relay is running.

## Restore previous settings

```bash theme={null}
failproofai otel disable claude
failproofai otel disable all
```

Disable restores only the settings FailproofAI wrote, keeps unrelated changes, and restores each agent's prior transcript-reporting choice. When the last managed local agent is disabled, the relay stops accepting exports.

For Codex, disable also records `collector.agents.codex.sessions_resume_after` (epoch milliseconds). Existing rollout bytes are treated as delivered so sessions captured with OTEL are not uploaded again; later appends still flow through transcript reporting.

Every command supports `--help`. See [OpenTelemetry in Cloud](/agenteye/opentelemetry) for application and coding-agent examples.


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