Observability
PrivateGPT emits OpenTelemetry traces for every API request, chat turn, LLM call, tool, sandbox operation, retrieval step and ingestion task (API and workers). Traces go to one or more exporters.
This feature requires the observability extra. If you are adding it to an existing application, run the sync command after enabling the module:
Exporters
Other fields: enabled, tags. Applications built on PrivateGPT can register more types with private_gpt.observability.exporters.register_exporter; their settings go in options.
Sending the file to a backend
The jsonl file is the format of the OpenTelemetry Collector’s file exporter, so the Collector otlpjsonfile receiver replays it into any OTLP backend (Jaeger, Grafana Tempo, Phoenix, Langfuse…):
It also reads well with jq, e.g. the span names of each batch:
From environment variables
Like models, exporters can be declared from the environment, one id per destination. They are appended to the ones in the settings files:
PGPT_OBSERVABILITY_EXPORTERS_<ID>_<FIELD>[__<NESTED>]: type defaults to the id; __ reaches nested fields (OPTIONS__ENDPOINT); TAGS is comma separated.
The default jsonl exporter from settings.yaml can be turned off with PGPT_OBSERVABILITY_JSONL_ENABLED=false, e.g. in containers that only send traces to a network backend.
Which traces each exporter gets
Traces are tagged by what they are (observability.trace_tags):
Exporters receive every trace by default (all, including health checks and status polling); set tags per exporter to keep only some, e.g. tags: [ai].
What a trace shows
- HTTP span (root): the JSON request and the final message as JSON (also for streaming and async responses), session and user.
chat.turn: the user input (text, images, documents) and the answer.chat.iteration N: the conversation state the iteration starts from and the one it leaves (messages with reasoning, tool calls and results, tools, LLM parameters, tokens), and the interceptors that changed it.- LLM spans: input and output messages (reasoning, tool calls), the sampling parameters actually sent, token counts, time until the stream is drained.
- Tool and sandbox spans: arguments, results, commands and file contents; retrieval steps with the nodes they return.
Sessions group by the request’s container (one conversation); users by metadata.user_id.
Other settings
Export runs in the background: a slow or unreachable backend never delays requests (spans are dropped when its queue is full).

