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

# oh-my-pi

> Export the standard OTEL environment variables for oh-my-pi (omp) to ship coding-agent session spans — model, provider, token usage, and cost, with no prompt text — to Sazabi.

[All oh-my-pi integration capabilities](https://docs.sazabi.com/catalogs/integrations/oh-my-pi)

## About

Ship oh-my-pi session telemetry to Sazabi using omp's built-in OpenTelemetry exporter. Once configured, every session emits trace spans for model API requests — model, provider, token usage, and estimated cost — plus agent-invocation and tool-call spans, with no changes to your projects.

Spans carry attributes like `gen_ai.request.model`, `gen_ai.provider.name`, `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, `gen_ai.cost.estimated_usd`, and `gen_ai.conversation.id`. Prompt, response, and tool payloads are **not** exported unless you opt in.

> [!WARNING]
>
> Setting `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` to `summary` or `full` attaches prompt, response, and tool content to every span. Leave it unset unless you understand the privacy implications for your team.

## Prerequisites

* oh-my-pi (`omp`) CLI installed and running
* Your Sazabi intake URL, shown above — open the log source and copy the **Intake URL** from its setup screen (the public key is embedded in the URL)

## Set up in the dashboard

**Step 1**

### Export the OTEL environment variables

omp reads the standard OpenTelemetry variables and has no telemetry keys in its own config. Add the following to the shell profile (or launcher script) that starts `omp`:

```bash title="~/.zshrc" theme={"system"}
export OTEL_TRACES_EXPORTER=otlp
export OTEL_METRICS_EXPORTER=none
export OTEL_LOGS_EXPORTER=none
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_ENDPOINT="<your intake URL>"
```

Replace `<your intake URL>` with the intake URL shown above. Pass the bare URL — omp's exporter appends `/v1/traces` itself.

Keep `OTEL_LOGS_EXPORTER` and `OTEL_METRICS_EXPORTER` at `none`. omp's logs signal is free-form diagnostic output, and its metrics are not ingested; enabling either only ships traffic that Sazabi discards.

omp does not stamp your identity on spans. To attribute sessions to a person, also export `OTEL_RESOURCE_ATTRIBUTES="user.email=you@yourcompany.com"`.

**Step 2**

### Start a new omp session

Environment variables load at startup. Open a new shell (so the exports are present) and start omp; telemetry begins with that session, not one that is already running.

## Set up with the CLI

You can also register the oh-my-pi log source with the [Sazabi CLI](https://docs.sazabi.com/reference/cli.md) (installed and authenticated — see [CLI reference](https://docs.sazabi.com/reference/cli/log-sources.md)).

Registering the source mints the same intake URL the dashboard shows above (the public key is embedded in its hostname):

```bash theme={"system"}
sazabi log-sources create oh_my_pi --mode manual
```

The command prints the intake URL for the new source — copy the whole URL and point your sender at it using the configuration shown above. Run `sazabi log-sources get <log-source-id>` at any time to reprint the endpoint, or `sazabi log-sources list` to see every log source in the project.

## Verify

Start omp from a shell that has the exports and send one prompt. omp flushes spans about every 30 seconds and on exit. Open the [Intake page](https://docs.sazabi.com/guides/instrument/intake.md) in the Sazabi dashboard and confirm spans from the **oh-my-pi** source appear within a minute or two.

From the CLI, `sazabi logs ask "How many oh-my-pi log lines arrived in the last 15 minutes?"` confirms rows are arriving, and `sazabi logs ask "Output tokens per gen_ai.request.model for oh-my-pi in the last hour"` breaks down token counts by model. In a thread, ask about token usage for the `oh-my-pi` service, or search for a `gen_ai.conversation.id` value to view all spans from a single session.

## Troubleshooting

**No spans after restarting** — Confirm the exports are present in the shell that started omp (`env | grep OTEL_`) and that `OTEL_EXPORTER_OTLP_ENDPOINT` is the bare intake URL with no `/v1/traces` suffix.

**Spans arrive under a different service name** — `OTEL_SERVICE_NAME` is set in that shell. omp defaults to `oh-my-pi`; unset the override or filter on the name you chose.

**Prompt text is showing up** — `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` is set to `summary` or `full` in that shell. Unset it and start a new omp session.

**omp metrics and logs are not stored** — Only the OTLP traces exporter is supported. Metric and log signals from omp are not ingested by this source.

## Further reading

> [card] [Intake](https://docs.sazabi.com/guides/instrument/intake.md)
>
> See per-source ingestion volume and health.

> [card] [Log sources](https://docs.sazabi.com/catalogs/log-sources.md)
>
> Browse the full log source catalog.


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