Oh My Pi
This page shows how to send Oh My Pi’s traces to cetra with cetra agents setup oh-my-pi, and what you see in the UI.
Connect Oh My Pi
Section titled “Connect Oh My Pi”- Create a project key with the
ingestscope in the project’s API keys page. Copy thesk-cetra-…value. - Install the
cetrabinary and run this in a terminal, with<SK_CETRA_KEY>set to your key and<CETRA_URL>set to your server:
export CETRA_INGEST_KEY=<SK_CETRA_KEY>cetra agents setup oh-my-pi --url <CETRA_URL>- Run Oh My Pi as usual. Its traces then go to cetra. No shell profile change is needed: Oh My Pi reads its telemetry settings from its own
.envfile.
What setup writes
Section titled “What setup writes”cetra agents setup oh-my-pi writes the OTEL_* lines into ~/.omp/agent/.env, a file only Oh My Pi reads. It keeps every other line in the file, and the first change keeps a copy at ~/.omp/agent/.env.cetra-backup. The lines are:
OTEL_EXPORTER_OTLP_ENDPOINT=<CETRA_URL>OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer <SK_CETRA_KEY>OTEL_SERVICE_NAME=ompOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=trueOTEL_LOGS_EXPORTER=noneOTEL_METRICS_EXPORTER=noneThe header value carries a plain space after Bearer: this is a dotenv value, not a shell line. OTEL_SERVICE_NAME names the service omp in the UI. The content line is left out with --no-content. The last two lines turn off Oh My Pi’s logs and metrics, which cetra would otherwise accept and drop.
Setup also saves agents.toml, with mode 0600, next to the credentials file of cetra login (~/.config/cetra/ on Linux, ~/Library/Application Support/cetra/ on macOS). The .env lines have no marker, so remove reads this file to recognize its own lines.
To see the merged .env without writing it, add --print. It prints the file and writes nothing.
To undo setup, run this. It removes the lines setup wrote when they still point at the saved server, and deletes the .env when they were all it held. It keeps every other line:
cetra agents remove oh-my-piWhat you get
Section titled “What you get”Each run is one trace. Its root is an agent span, invoke_agent, and each model call and tool call is a child of it.
- each model call is an
llmspan named after the model, such aschat gpt-4o-mini, with the model and its input and output tokens; - each tool call is a
toolspan named after the tool, such asread. Oh My Pi’s own name for the span is kept incetra.span_name; - the prompts and the answers are on the spans, when content is on.
The agent span carries Oh My Pi’s own totals for the run, in omp.gen_ai.agent.* attributes: token counts and a cost estimate. cetra reads none of them, so the model calls are counted once.
Each trace has these fields:
- the session, from Oh My Pi’s session id in
gen_ai.conversation.id; metadata.coding_agentset tooh-my-pi.
Oh My Pi sends no repository, branch or person, because it has no hook. cetra gets none of them for Oh My Pi traces.
Use the Coding agents dashboard template to see API-equivalent cost per session and tool usage.
Content
Section titled “Content”Oh My Pi sends the prompts and the answers when OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT is set, the fourth line setup writes. With --no-content, setup leaves the line out.
API-equivalent cost
Section titled “API-equivalent cost”cetra prices each model call from its token counts, using its price table. Oh My Pi puts its own cost estimate on the run’s span; cetra does not read it.
API-equivalent cost is what the same tokens would cost at API prices. If you use a subscription plan, it is not what you pay.
Limits
Section titled “Limits”- Tested with Oh My Pi 18.22.0, in
omp -pmode. The interactive terminal interface was not captured. - A project
.envwithOTEL_*lines also routes Oh My Pi’s telemetry: Oh My Pi reads the one in the working directory too. Setup never writes a project.env. - When a tool call fails, Oh My Pi can make extra model calls beside the main flow, which arrive without a parent. The captured run has a successful tool call and shows none.
- Oh My Pi exports over HTTP/protobuf only; it has no gRPC or JSON route.
- Oh My Pi sends no repository, branch or person, so cetra cannot group its traces by repository or branch.
- Traces: read the trace as a tree and a timeline.
- Sessions: the calls of one Oh My Pi session.
- Custom dashboards: build your own cost views, or start from the Coding agents template.