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

> ## Agent Instructions
> These docs describe the Ancha CLI, npm package @ancha-labs/cli, and the hosted workspace at app.ancha.io. Coding agents should start at https://docs.ancha.io/coding-agents. Run the CLI as `ancha` after `npm install -g @ancha-labs/cli`, or as `npx -y @ancha-labs/cli` without installing. Pass --json for machine-readable output, or set ANCHA_JSON=1. Every command ends with a `next:` line naming the next command. Exit codes: 0 pass, 1 a check failed or a comparison regressed, 2 usage, config or authentication error, 3 infrastructure error, 4 unimplemented endpoint with --strict.

# OTLP

> The OpenTelemetry span attributes Ancha reads: HTTP calls with their bodies, webhooks, model calls in four GenAI conventions, tool calls, and the session that joins several traces.

Ancha accepts OTLP/HTTP trace exports, as JSON or protobuf, optionally gzipped. Each span becomes a record of [Trace IR](https://docs.ancha.io/reference/trace-ir.md). Spans Ancha cannot read are kept out.

## The agent

| Attribute | Where | Read as |
| - | - | - |
| `service.name` | Resource | The agent's name on the **Traces** page. |
| `session.id` or `gen_ai.conversation.id` | Any span | Joins traces into one: an agent that starts a trace for every webhook or turn sends one session. |

## API calls

An HTTP client span whose `url.full` is a tool Ancha replicates becomes a `call`.

| Attribute | Read as |
| - | - |
| `url.full` | The request URL. The host decides the tool. |
| `http.request.method` | The method. |
| `http.response.status_code` | The status. |
| `ancha.http.request.body` | The request body, as a string. |
| `ancha.http.response.body` | The response body, as a string. Ancha rebuilds starting data from these. |
| `ancha.service` | The tool, when the host does not say it, such as `slack`. |

OpenTelemetry's HTTP instrumentation does not record bodies. Add the two `ancha.http.*` attributes in your HTTP client's hook or in a span processor. Without bodies, the trace shows which calls happened but not what the tools answered.

Hosts Ancha recognizes. The trace page says which of them it rebuilds starting data for.

| Tool | Host |
| - | - |
| Slack | `slack.com` |
| GitHub | `api.github.com` |
| Datadog | `api.datadoghq.com` |
| PagerDuty | `api.pagerduty.com` |
| Stripe | `api.stripe.com` |
| Linear | `api.linear.app` |
| Notion | `api.notion.com` |
| Intercom | `api.intercom.io` |
| Sentry | `sentry.io` |
| Twilio | `api.twilio.com` |
| Resend | `api.resend.com` |
| Airtable | `api.airtable.com` |
| Attio | `api.attio.com` |
| HubSpot | `api.hubapi.com` |

## Webhooks

A server span with `ancha.inbound.service` becomes an `inbound` record. Put the received body in `ancha.http.request.body`.

## Model calls

Ancha reads model spans in four conventions, and with them the messages the call was sent. Set your instrumentation to capture message content to send them; without them, Ancha cannot tell what your agent was told and asks you.

| Convention | The span is a model call when | Messages |
| - | - | - |
| GenAI semantic conventions 1.37 and later | `gen_ai.operation.name` is set | `gen_ai.input.messages` |
| Earlier GenAI semantic conventions | `gen_ai.operation.name` is set | `gen_ai.prompt` as an attribute, or on a `gen_ai.content.prompt` event |
| OpenLLMetry | `llm.request.type` is set | `gen_ai.prompt.<n>.role` and `gen_ai.prompt.<n>.content` |
| OpenInference | `openinference.span.kind` is `LLM` | `llm.input_messages.<n>.message.role` and `.content` |

Ancha also reads the model (`gen_ai.request.model` or `llm.model_name`) and token counts. It keeps user and assistant messages only; system instructions are never stored.

## Tool calls

A span with `gen_ai.operation.name` set to `execute_tool` becomes a `tool` record: `gen_ai.tool.name`, `gen_ai.tool.call.arguments` and `gen_ai.tool.call.result`.

## Times

Records keep their span times. When the trace holds a Slack event, Ancha aligns the trace's clock to Slack's timestamps, so a machine whose clock drifts still lines up with the tools.


## Related topics

- [From a production trace to a failing test](https://docs.ancha.io/guides/rebuild-from-traces.md)
- [Trace IR](https://docs.ancha.io/reference/trace-ir.md)
- [ancha import](https://docs.ancha.io/cli/import.md)
- [Traces](https://docs.ancha.io/cloud/traces.md)
- [Trace privacy](https://docs.ancha.io/cloud/trace-privacy.md)


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