A Prometheus exporter for OpenWebUI that provides detailed metrics about users, chats, documents, models, and system status.
- Comprehensive metrics collection from OpenWebUI's PostgreSQL database
- Connection pooling for efficient database access
- Time-windowed queries to prevent database overload
- Flexible time window specification (seconds, minutes, hours, days)
- Modular collector design for easy maintenance and extensions
- Detailed monitoring of:
- User activity and authentication
- Chat conversations and folders
- Documents and knowledge bases
- AI models and tools
- System configuration and health
- Create a docker-compose.yml file:
services:
exporter:
image: nicholascecere/exporter-openwebui:latest
ports:
- "9091:9090"
environment:
- OPENWEBUI_DB_PASSWORD=your_password_here
- OPENWEBUI_DB_HOST=your_db_host
- Start the exporter:
docker-compose up -d
- Create or download the k8s/deployment.yaml file and configure your database connection:
# In ConfigMap section
data:
OPENWEBUI_DB_HOST: "your_db_host"
# In Secret section
stringData:
OPENWEBUI_DB_PASSWORD: "your_password_here"
- Apply the Kubernetes manifests:
kubectl apply -f k8s/deployment.yaml
The exporter will start on port 9090. Metrics will be available at:
http://localhost:9090/metrics # Docker Compose
http://openwebui-exporter:9090/metrics # Kubernetes
All configuration is done through environment variables. For a complete list of available environment variables, their descriptions, defaults, and examples, see ENV-VARS.md.
Key configuration features:
- Time windows for limiting SQL query ranges
- Database connection pooling
- Configurable metric update intervals
openwebui_users_total
: Total number of registered usersopenwebui_users_active
: Number of active users (within request window)openwebui_users_by_role
: Number of users by roleopenwebui_auth_active
: Number of active auth entriesopenwebui_oauth_users
: Number of users using OAuthopenwebui_user_last_active_seconds
: Timestamp of last user activity
openwebui_chats_total{model_name="..."}
: Total number of chats by modelopenwebui_chats_active{model_name="..."}
: Number of non-archived chats by modelopenwebui_chats_archived{model_name="..."}
: Number of archived chats by modelopenwebui_chats_pinned{model_name="..."}
: Number of pinned chats by modelopenwebui_chats_by_user{model_name="..."}
: Number of chats per user by modelopenwebui_chats_shared
: Number of shared chatsopenwebui_chat_messages_total{model_name="..."}
: Total number of chat messages by modelopenwebui_chat_age_seconds
: Age distribution of chatsopenwebui_folders_total
: Total number of chat foldersopenwebui_chats_in_folders
: Number of chats organized in folders
openwebui_documents_total
: Total number of documentsopenwebui_documents_by_collection
: Number of documents by collectionopenwebui_documents_by_user
: Number of documents per useropenwebui_files_total{knowledge_base_id="...",knowledge_base_name="..."}
: Total number of files by knowledge baseopenwebui_files_by_user
: Number of files per useropenwebui_knowledge_bases_total
: Total number of knowledge basesopenwebui_knowledge_bases_by_user
: Number of knowledge bases per useropenwebui_memories_total
: Total number of memoriesopenwebui_memories_by_user
: Number of memories per useropenwebui_document_age_seconds
: Age distribution of documents
openwebui_models_total
: Total number of modelsopenwebui_models_active
: Number of active modelsopenwebui_models_by_user
: Number of models per useropenwebui_models_by_base
: Number of models by base modelopenwebui_tools_total
: Total number of toolsopenwebui_tools_by_user
: Number of tools per useropenwebui_functions_total
: Total number of functionsopenwebui_functions_active
: Number of active functionsopenwebui_functions_global
: Number of global functionsopenwebui_functions_by_type
: Number of functions by typeopenwebui_functions_by_user
: Number of functions per user
openwebui_config_version
: Current configuration versionopenwebui_config_last_update
: Timestamp of last configuration updateopenwebui_groups_total
: Total number of groupsopenwebui_users_in_groups
: Number of users in groupsopenwebui_feedback_total
: Total number of feedback entriesopenwebui_feedback_by_type
: Number of feedback entries by type
Add the following to your prometheus.yml
:
scrape_configs:
- job_name: 'openwebui'
scrape_interval: 15s
static_configs:
- targets: ['localhost:9090'] # Docker Compose
# Or for Kubernetes:
# - targets: ['openwebui-exporter:9090']
The exporter is organized into modular collectors:
user_metrics.py
: User and authentication metricschat_metrics.py
: Chat and conversation metricsdocument_metrics.py
: Document and file metricsmodel_metrics.py
: AI model and tool metricssystem_metrics.py
: System configuration metrics
Each collector can be extended or modified independently to add new metrics or modify existing ones.
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License