All Projects

Open WebUI Exporter.

Prometheus metrics for Open WebUI — polls the REST API, no database access required.

Observability / InfraActiveMITPythonREST API onlyGrafanaGHCR · Docker Hub
592
Docker pulls
Docker Hub
9
Dashboard rows
3
Compose stacks
30s
Poll interval
None
DB access needed

Overview

Problem

No first-party metrics, and the community one needs your database

Open WebUI ships no /metrics endpoint. The existing community exporter works, but requires direct PostgreSQL access — a non-starter for SQLite-backed or access-restricted deployments.

This exporter reads everything through Open WebUI's own REST API, including its built-in /api/v1/analytics/* endpoints, so it works against any backend with just an admin API key.

Cost

Spend is reconstructed, not reported

Open WebUI reports token counts but never price. A per-model rate table (input/output, plus cache_read/cache_write where providers support prompt caching) ships with July 2026 list prices for OpenAI, Anthropic, Google, xAI, DeepSeek, Qwen, GLM, and Mistral. Local Ollama entries are intentionally mock prices, so a local-only instance still shows a non-zero cost signal instead of a flat zero.

Rates drift and negotiated pricing varies, so the table is overridable without touching code — a CSV price sheet (Excel-friendly) or a JSON file, both merged on top of the built-in defaults.

Dashboard

Nine rows, from KPIs to exporter self-health

The dashboard is provisioned automatically by the monitoring compose stack.

Overview & KPIs
users, chats, tokens, satisfaction, spend
Top users
by messages, tokens, and estimated cost
Token economics
input vs output, cumulative trends
Models & providers
breakdown, top models, unique users
Model catalog
size, context length, capabilities
Quality & feedback
satisfaction per model, Arena leaderboard
Engagement
msgs/chat, topic tags, content inventory
Usage trends
response times, messages/day
Exporter health
scrape errors, success state

How it works

The exporter polls Open WebUI's own REST API on an interval, reconstructs per-model cost from a rate table, and exposes everything as Prometheus series — no database credentials, works on SQLite or Postgres backends alike.

Open WebUI
REST + analytics API, admin key
Exporter
polls every 30s, applies pricing
Prometheus
:9090/metrics
Grafana
9-row dashboard

In the terminal

curl :9090/metrics
$ curl -s http://localhost:9090/metrics | head
# HELP openwebui_exporter_tokens_total Total tokens processed
# TYPE openwebui_exporter_tokens_total counter
openwebui_exporter_tokens_total{model="gpt-4o",direction="output"} 812400
# HELP openwebui_exporter_estimated_cost_usd Estimated spend from the model rate table
# TYPE openwebui_exporter_estimated_cost_usd counter
openwebui_exporter_estimated_cost_usd{model="gpt-4o"} 24.37
# HELP openwebui_exporter_scrape_success Whether the last scrape succeeded
# TYPE openwebui_exporter_scrape_success gauge
openwebui_exporter_scrape_success 1

Install & use

Docker (single container)
$ docker run -d --name openwebui-exporter -p 9090:9090 \
$ --add-host host.docker.internal:host-gateway \
$ -e OPENWEBUI_BASE_URL=http://host.docker.internal:3000 \
$ -e OPENWEBUI_API_KEY=<your key> \
$ ghcr.io/baselhusam/open-webui-exporter:latest
Docker Compose (batteries-included)
$ docker compose -f docker-compose.monitoring.yml up -d
$ open http://localhost:3001 # Grafana
quick start
# 1. Open WebUI: Settings → Account → API Keys → Create new key (admin key)
$ cp .env.example .env # fill OPENWEBUI_BASE_URL + OPENWEBUI_API_KEY
$ docker compose -f docker-compose.monitoring.yml up -d
$ curl http://localhost:9090/metrics

Built with

Python
exporter core
Prometheus client
metrics exposition
Open WebUI REST API
analytics, feedback, chats
Docker
GHCR + Docker Hub images
Grafana
auto-provisioned dashboard
CSV / JSON price sheets
cost-model overrides