> ## 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

> Send coding-agent and application telemetry to FailproofAI Cloud with OTLP.

OpenTelemetry lets you send agent traces, logs, and metrics to FailproofAI Cloud using the standard OTLP/HTTP protocol. It is optional. Your existing FailproofAI integrations continue working without enabling it.

## Turn on ingest for your organisation

An organisation admin opens **Settings → OpenTelemetry** and turns on ingest. Use a Cloud API key with `events:add` permission, the same permission used for agent reporting.

If ingest is off, Cloud refuses OTLP exports, so `failproofai otel enable` changes nothing and your agents keep sending sessions the usual way. Run `failproofai otel status` to check the organisation switch, and ask an admin to turn it on.

## Connect a coding agent

Connect your machine with `failproofai config`, then choose an agent:

```bash theme={null}
failproofai otel enable claude
failproofai otel enable codex
failproofai otel enable copilot
```

The setup command supports Claude Code, Codex, and Copilot and chooses Cloud or a local authenticated relay as appropriate. Copilot uses the local relay automatically. Start your configured FailproofAI daemon before using the relay.

If FailproofAI already sends an agent's session transcripts, setup asks whether to switch that agent to OTEL. The default is No. Accepting stops transcript uploads for that agent; it does not change policy enforcement or reporting from other agents.

## Connect an application

Use your application's OpenTelemetry instrumentation with these environment variables:

```bash theme={null}
export OTEL_EXPORTER_OTLP_ENDPOINT=https://app.befailproof.ai/otel
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_HEADERS='Authorization=Bearer%20<key>'
export OTEL_SERVICE_NAME=my-agent
```

The endpoint is Cloud's OTLP base, `https://app.befailproof.ai/otel`; your exporter appends `/v1/traces`, `/v1/logs`, or `/v1/metrics` itself. Per-signal variables such as `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` are used as-is, so they need the full path, for example `https://app.befailproof.ai/otel/v1/logs`.

Replace `<key>` with your API key. Keep the secret out of shell history, screen recordings, and committed configuration. For a configured machine, `failproofai otel env --service my-agent` prints the block with its existing key. Its output contains a credential.

Cloud accepts OTLP/HTTP exports for traces, logs, and metrics, as protobuf or JSON, including gzip-compressed requests. It does not accept OTLP/gRPC.

Metrics are acknowledged for exporter compatibility but are not stored or displayed. Supported agent traces and coding-agent logs become sessions; fields the agent does not export remain absent.

## Capture prompt text

<Warning>
  Text capture can include prompts, tool arguments, and other sensitive content. `failproofai otel enable` turns it on. Add `--no-content` to keep prompt and tool-detail capture off.
</Warning>

```bash theme={null}
failproofai otel enable claude --no-content
failproofai otel enable codex --no-content
```

For an agent you configure manually, use its own content-capture controls:

<Tabs>
  <Tab title="Claude Code">
    Add these variables to your agent's environment alongside the application block above:

    ```bash theme={null}
    export CLAUDE_CODE_ENABLE_TELEMETRY=1
    export OTEL_LOGS_EXPORTER=otlp
    export OTEL_METRICS_EXPORTER=otlp
    export OTEL_LOG_USER_PROMPTS=1
    export OTEL_LOG_TOOL_DETAILS=1
    ```

    Set both content variables to `0` to avoid capturing prompts and tool details.
  </Tab>

  <Tab title="Codex">
    In Codex's user configuration, use its OTEL settings:

    ```toml theme={null}
    [otel]
    log_user_prompt = true
    exporter = { otlp-http = { endpoint = "https://app.befailproof.ai/otel/v1/logs", protocol = "json", headers = { Authorization = "Bearer <key>" } } }
    ```

    Codex conversation content is in logs; leave internal runtime traces and metrics disabled. Codex uses the complete endpoint you provide. Set `log_user_prompt` to `false` to leave prompts out; the setup command preserves an explicit `false`.
  </Tab>

  <Tab title="Gemini CLI">
    Use Gemini's telemetry settings with the local relay:

    ```json theme={null}
    {
      "telemetry": {
        "enabled": true,
        "target": "local",
        "otlpEndpoint": "http://127.0.0.1:4318",
        "otlpProtocol": "http",
        "useCollector": true,
        "logPrompts": true
      }
    }
    ```

    Gemini CLI is not supported by `failproofai otel enable`. Configure it manually with an authenticated collector of your own. Set `logPrompts` to `false` for no prompt capture.
  </Tab>

  <Tab title="Copilot in VS Code">
    Use these VS Code user settings:

    ```json theme={null}
    {
      "github.copilot.chat.otel.enabled": true,
      "github.copilot.chat.otel.exporterType": "otlp-http",
      "github.copilot.chat.otel.otlpEndpoint": "http://127.0.0.1:4318",
      "github.copilot.chat.otel.captureContent": true
    }
    ```

    Run `failproofai otel enable copilot` to enable the authenticated relay. Set `captureContent` to `false` to omit content.
  </Tab>
</Tabs>

## Check or undo setup

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

Status distinguishes settings managed by FailproofAI from telemetry you configured elsewhere. Disable restores the previous managed settings and the agent's previous transcript-upload choice.

<Card title="OpenTelemetry CLI" href="/reference/otel" icon="terminal">
  Command options, local relay setup, and troubleshooting.
</Card>


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