General
You can use Prometheus or any other OpenMetrics compatible monitoring tool to get metrics about active usage of LibreChat. This includes technical information like the usage of tokens, but also information about end users like the number of total or active users.
The metrics exporter is available at virtUOS/librechat_exporter. It is a separate tool you deploy alongside LibreChat.
Setup
To deploy the exporter, just add the necessary container to your compose configuration like this:
metrics:
image: ghcr.io/virtuos/librechat_exporter:main
depends_on:
- mongodb
ports:
- "8000:8000"
restart: unless-stopped
You can optionally also configure the exporter. But usually, the defaults should be just fine.
environment:
- MONGODB_URI=mongodb://mongodb:27017/
- LOGGING_LEVEL=info
Usage
You can now add the exporter to your Prometheus scrape configuration:
- job_name: librechat
static_configs:
- targets:
- 'librechat.example.com:8000'
Once scraping the metrics has started, look for librechat_*
metrics (e.g., librechat_registered_users
).
The exporter provides several metrics.
Have fun building your Grafana dashboard!