POST /v1/traces. Any SDK or collector that exports OTLP over HTTP can send to it. Instrumentations that follow the OpenTelemetry GenAI semantic conventions or OpenInference work without changes.
Create an ingest token
An ingest token has the formapg_ing_ followed by 32 characters. Apgar shows it once and stores only its hash. There are two ways to get one:
- Add agent with the OTLP source creates a token named
AGENT (auto)and bound to that agent. Every trace sent with it belongs to that agent, whatever its attributes say. - Settings, Ingest tokens creates a token that you can bind to an agent or leave unbound. With an unbound token, Apgar resolves the agent from the agent name attributes, and the first trace with a new name creates the agent. Turn off Create agents automatically on the token to drop traces of unknown agents instead. An agent created this way has no environment and no Release attribute, so it reads the release from
apgar.release,gen_ai.agent.version, orlangfuse.release; set both in Agent settings. One unbound token can serve several agents.
Configure the exporter
Set these variables in the environment of the agent service.ORIGIN is the address of the Apgar UI, the value of APGAR_PUBLIC_URL. The UI forwards /v1 to the API.
RELEASE is the identifier of the running build, a version, a tag, or a commit hash, and comes from your deploy pipeline. Put it in the attribute you chose as Release attribute on the agent; apgar.release is the usual choice. Without it every turn is stored as untagged and is never evaluated. See Release.
What a trace should look like
Apgar treats one trace as one turn of the agent. It works best when a trace has:- A root span for the turn, such as an
invoke_agentorinvoke_workflowspan, carrying the conversation id. See Sessions. - One chat span per LLM call, with the model, token counts, and ideally a cost.
- One tool span per tool call, with the tool name and its arguments.
gen_ai.operation.name, openinference.span.kind, or langfuse.observation.type. Set apgar.kind to override the kind of a span. See Span kinds.
Tool arguments are needed to detect retries and loops. Apgar never stores them: it keeps only a keyed hash. Content attributes are reduced to a length and a JSON validity flag and then dropped.
Example with the Python SDK
The OTLP exporter reads the variables above. The application opens one root span per turn and puts the conversation id on it; the chat and tool spans come from the instrumentation of your LLM client or agent framework.Endpoint
Apgar accepts OTLP over HTTP only. An SDK that exports OTLP/gRPC switches to HTTP with
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf.
Send through an OpenTelemetry Collector
When traces already pass through a collector, add an exporter for Apgar next to the existing one. The application keeps exporting to the collector, and the collector sends a copy to Apgar. Each exporter has its own queue and retries, so an unavailable Apgar does not hold back your existing backend.collector.yaml
otlp_http/apgar and its entry in the traces pipeline are new. Set endpoint to APGAR_PUBLIC_URL; the exporter appends /v1/traces. Set APGAR_INGEST_TOKEN in the environment of the collector. Collector releases before the component rename know the exporters as otlphttp and otlp; current releases accept both spellings.
Validate the configuration before you deploy it: