Skip to content

Observability (Prometheus, Grafana, Loki)

  • Metrics


    /metrics endpoint + Postgres exporter.

  • Dashboards


    Grafana embedded with default UID tribrid-overview.

  • Logs


    Loki + Promtail for container logs and app logs.

Get started Configuration API

Sampling

Adjust tracing.trace_sampling_rate to manage cost and overhead. Use 1.0 in dev and 0.1–0.2 in production.

Anonymous Grafana

The compose stack enables anonymous access for embeds. Harden in production.

Timestamps

DOCKER_LOGS_TIMESTAMPS=1 helps correlate events across services.

Components

Service Port Notes
Prometheus 9090 Scrapes /api/metrics and exporter
Grafana 3001 Embedded dashboard in UI
Loki 3100 Log aggregation
Promtail Ships container/host logs
flowchart LR
    App["TriBridRAG"] --> METRICS["/api/metrics"]
    METRICS --> PROM["Prometheus"]
    PROM --> GRAF["Grafana"]
    LOGS["Docker Logs"] --> PROMTAIL["Promtail"]
    PROMTAIL --> LOKI["Loki"]
    LOKI --> GRAF
import httpx
print(httpx.get("http://127.0.0.1:8012/api/metrics").text.splitlines()[:5])
curl -sS http://127.0.0.1:8012/api/metrics | head -n 20
const m = await (await fetch('/api/metrics')).text();
console.log(m.split('\n').slice(0,5));
Dashboards

Mount your own Grafana provisioning under infra/grafana/provisioning to add/override dashboards and datasources.