[PR #3634] [CLOSED] Provide Prometheus metrics endpoint #2956

Open
opened 2025-10-09 18:14:31 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/3634
Author: @mtandersson
Created: 7/2/2023
Status: Closed

Base: mainHead: prometheus


📝 Commits (1)

  • 4193f4b Provide prometheus metrics endpoint

📊 Changes

8 files changed (+213 additions, -17 deletions)

View changed files

📝 Cargo.lock (+102 -8)
📝 Cargo.toml (+5 -0)
src/api/metrics.rs (+54 -0)
📝 src/api/mod.rs (+2 -0)
📝 src/config.rs (+3 -0)
📝 src/db/models/organization.rs (+6 -0)
📝 src/main.rs (+2 -1)
📝 src/util.rs (+39 -8)

📄 Description

This makes it possible to enable /metrics to provide Prometheus metrics (protected by PROMETHEUS_ENABLED flag).

I did not spend super much time on enable every possible metrics as I wanted to seek feedback before. It should be easy to add more metrics later.

This pull request also addresses issue #496


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/3634 **Author:** [@mtandersson](https://github.com/mtandersson) **Created:** 7/2/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `prometheus` --- ### 📝 Commits (1) - [`4193f4b`](https://github.com/dani-garcia/vaultwarden/commit/4193f4bc5bf1e01f2a37d8e056aa5a4ceeb6de63) Provide prometheus metrics endpoint ### 📊 Changes **8 files changed** (+213 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+102 -8) 📝 `Cargo.toml` (+5 -0) ➕ `src/api/metrics.rs` (+54 -0) 📝 `src/api/mod.rs` (+2 -0) 📝 `src/config.rs` (+3 -0) 📝 `src/db/models/organization.rs` (+6 -0) 📝 `src/main.rs` (+2 -1) 📝 `src/util.rs` (+39 -8) </details> ### 📄 Description This makes it possible to enable /metrics to provide Prometheus metrics (protected by PROMETHEUS_ENABLED flag). I did not spend super much time on enable every possible metrics as I wanted to seek feedback before. It should be easy to add more metrics later. This pull request also addresses issue #496 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2025-10-09 18:14:31 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#2956