mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-07-16 17:02:14 -05:00
[PR #6202] [CLOSED] feat: Add comprehensive Prometheus metrics support #20572
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/6202
Author: @rossigee
Created: 8/20/2025
Status: ❌ Closed
Base:
main← Head:feature/prometheus-metrics📝 Commits (10+)
9ed01aefeat: add comprehensive Prometheus metrics support0502936Drop verbose metrics functionality description.a4106aeDrop examples (should be in docs).c9563d6Remove introduced development dependency.2b1e989Whitespace fixes.387c2e9Merge branch 'main' into feature/prometheus-metrics672a1e5Add Prometheus metrics support5226d2ffix email as 2fa with auth requests (#6736)b5adeb5Update crates, web-vault, js, workflows (#6749)10e4476refactor: improve tooltips in diagnostics page (#6765)📊 Changes
20 files changed (+1164 additions, -12 deletions)
View changed files
📝
Cargo.lock(+16 -0)📝
Cargo.toml(+8 -0)📝
README.md(+36 -0)📝
docker/Dockerfile.alpine(+1 -1)📝
docker/Dockerfile.debian(+1 -1)📝
docker/Dockerfile.j2(+2 -2)➕
examples/metrics-config.env(+100 -0)📝
src/api/identity.rs(+11 -2)➕
src/api/metrics.rs(+120 -0)➕
src/api/middleware.rs(+105 -0)📝
src/api/mod.rs(+4 -0)📝
src/api/web.rs(+4 -1)📝
src/config.rs(+34 -0)➕
src/db/metrics.rs(+80 -0)📝
src/db/models/cipher.rs(+68 -0)📝
src/db/models/organization.rs(+10 -0)📝
src/db/models/user.rs(+22 -0)📝
src/main.rs(+29 -5)➕
src/metrics.rs(+316 -0)➕
src/metrics_test.rs(+197 -0)📄 Description
Summary
This PR adds comprehensive Prometheus metrics support to Vaultwarden, providing observability into application performance, database health, authentication patterns, and business metrics.
Key Features
/metrics(disabled by default)--features enable_metricsMetrics Categories
Security Considerations
ENABLE_METRICS=trueDocumentation
METRICS.mdMONITORING.mdTest Plan
Breaking Changes
None - this is an optional feature that's disabled by default.
Files Added/Modified
src/api/metrics.rs- Metrics endpoint implementationMETRICS.md- Configuration and usage guideMONITORING.md- Complete monitoring setup guideexamples/metrics-config.env- Configuration examplesscripts/test-metrics.sh- Testing scriptCargo.toml- Added optional prometheus dependencyREADME.md- Added metrics feature documentationdocker/Dockerfile.debian- Support for extra features in build🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.