Skip to main content

Observability

AI-in-a-Box has three observability paths:

PathPurpose
First-party observability serviceGeneration events, tokens, TTFT, latency, cost, prices, budgets, and admin API views.
LangfuseLLM trace/generation logging for model-call debugging.
Audit serviceSecurity-relevant platform events, turn envelopes, receipts, and proof exports.

Access URLs

SurfaceDev URL
Gateway healthhttp://localhost:8080/healthz
Langfusehttp://localhost:13000 when using deploy/docker-compose.dev.yml
Observability APIhttp://localhost:8080/v1/admin/observability/*
Optional Grafana/Prometheus/JaegerStart with make up-observability or make up-all

Production compose closes most direct service ports. Use the gateway and your deployment's ingress instead.

Check Generation Usage

The inference router emits generation records to OBSERVABILITY_URL when configured:

curl "http://localhost:8080/v1/admin/observability/usage?tenant_id=default" \
-H "Authorization: Bearer $TOKEN"

Usage includes model, provider, token counts, latency, time-to-first-token, and cost estimates when pricing is known.

Inspect Traces

curl "http://localhost:8080/v1/admin/observability/traces?limit=20" \
-H "Authorization: Bearer $TOKEN"

For Langfuse, open http://localhost:13000 in dev mode and inspect model generations emitted by the inference router.

Refresh Model Prices

The observability service can refresh OpenRouter pricing metadata:

curl -X POST "http://localhost:8080/v1/admin/observability/prices/refresh" \
-H "Authorization: Bearer $TOKEN"

For air-gapped deployments, set OBS_LOCAL_PRICE_JSON with local model price overrides and point OPENROUTER_MODELS_URL at an internal mirror if needed.

Audit and Receipts

Audit queries require tenant and admin context:

curl "http://localhost:8080/v1/admin/audit?tenant_id=default&limit=10" \
-H "Authorization: Bearer $TOKEN"

curl "http://localhost:8080/v1/admin/audit/verify?tenant_id=default" \
-H "Authorization: Bearer $TOKEN"

Use /v1/receipts/{turn_id} and /v1/receipts/{turn_id}/proof for turn-level attestations. See Audit Trail.

Configuration

VariablePurpose
OBSERVABILITY_URLInference-router destination for first-party generation events.
OPENROUTER_MODELS_URLSource for OpenRouter pricing metadata.
OBS_LOCAL_PRICE_JSONLocal price overrides for self-hosted models.
LANGFUSE_HOSTLangfuse API endpoint used by model logging.
LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEYLangfuse project credentials.
AUDIT_SIGNING_KEY, AUDIT_KEY_VERSIONAudit and turn-envelope signing.

Troubleshooting

SymptomCheck
No generation usageOBSERVABILITY_URL must be set in the inference-router container.
Langfuse has no generationsCheck LANGFUSE_HOST, LANGFUSE_PUBLIC_KEY, and LANGFUSE_SECRET_KEY.
Cost is zero or missingRefresh prices or configure OBS_LOCAL_PRICE_JSON.
Audit verify failsInspect audit service logs and database restore history. Partial restores can invalidate the chain.