Observability¶
qaechi-parser reports how much it parses, how fast, and how well: throughput and latency per pipeline step, and the share of values that came back with verified evidence. It uses OpenTelemetry, so any OTLP backend works: Grafana (VictoriaMetrics, Prometheus, Tempo), Elastic, Datadog, Honeycomb, AWS CloudWatch.
Fastest way to see it
qaechi-stack starts qaechi-parser with VictoriaMetrics, Tempo and a provisioned Grafana dashboard in one command.
Turn it on¶
pip install "qaechi-parser[parse,server,otel]"
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 # your collector
qaechi-parser serve
Telemetry is off unless the otel extra is installed and an OTLP endpoint is set. It works the
same in the library (qp.parse(...)) and in the HTTP service.
| Variable | Purpose |
|---|---|
OTEL_EXPORTER_OTLP_ENDPOINT |
One collector for metrics and traces (OTLP over HTTP) |
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT |
Separate endpoints, e.g. VictoriaMetrics and Tempo directly |
OTEL_SERVICE_NAME |
Service name in your backend (default qaechi-parser) |
OTEL_METRIC_EXPORT_INTERVAL |
Milliseconds between metric exports (SDK default 60000) |
QAECHI_OTEL |
on to use SDK defaults without an endpoint variable, off to force it off |
All standard OTEL_* variables of the OpenTelemetry Python SDK apply.
Metrics¶
Names as they appear in Prometheus-compatible backends.
| Metric | Labels | Answers |
|---|---|---|
qaechi_jobs_total |
route, doc_type, status |
How many jobs, how many failed, split by route |
qaechi_job_duration_seconds (histogram) |
route, doc_type, status |
p50 and p95 job time |
qaechi_step_duration_seconds (histogram) |
step, route |
Which step is the bottleneck: fetch, load, chunk, index, retrieve, extract, grade, save |
qaechi_values_total |
route, doc_type, evidence |
Values with verified quotes, unverified ones, and missing (null) |
qaechi_quotes_not_in_source_total |
route, doc_type |
Quotes the model gave that are not in the document. Should stay at 0 |
qaechi_results_total |
route, doc_type, groundedness |
Results graded yes, no or unknown |
qaechi_queue_messages_total |
outcome |
Queue mode workers: processed, duplicate (redelivery skipped), dlq, gave_up |
qaechi_cache_lookups_total |
outcome |
Result cache: hit, miss, error |
qaechi_llm_throttled_total |
call, reason |
Model calls that waited for the rate limit (limit) or after a provider 429 (429) |
qaechi_llm_throttle_wait_seconds (histogram) |
call, reason |
How long those calls waited |
The quality metrics are what set this apart: change a model or a prompt and you see at once whether the share of verified values drops.
Traces¶
Every job is a trace named qaechi.job, with one child span per pipeline step
(qaechi.step.fetch, qaechi.step.load, ... qaechi.step.save). Attributes carry the document ID,
document type and route, so you can find the slow or failed document and see which step took the time.
gantt
dateFormat X
axisFormat %Ls
title One job as a trace
section qaechi.job
fetch :0, 40
load :40, 420
chunk :420, 470
extract :470, 3900
grade :3900, 5200
save :5200, 5240
Example queries¶
# Jobs per minute by route
sum by (route) (rate(qaechi_jobs_total[5m])) * 60
# p95 per pipeline step
histogram_quantile(0.95, sum by (le, step) (rate(qaechi_step_duration_seconds_bucket[5m])))
# Share of values with verified evidence, per document type
sum by (doc_type) (rate(qaechi_values_total{evidence="verified"}[1h]))
/ sum by (doc_type) (rate(qaechi_values_total[1h]))