mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-01 11:19:52 +03:00
Prometheus metrics #311
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?
Originally created by @Skeen on GitHub (May 31, 2019).
Hi,
If I was gonna implement metrics importing using https://github.com/sd2k/rocket_prometheus or https://github.com/pingcap/rust-prometheus would such an addition be welcome to the project;
@mprasil commented on GitHub (May 31, 2019):
Personally I'd love to see Prometheus metrics being available behind environment variable. (or generally as any other setting we have) Even better if there was some option to enable authorization.
@dani-garcia commented on GitHub (Jun 2, 2019):
Personally any addition is welcome as long as it's easy to enable/disable and doesn't complicate the code a ton or impact performance.
About how to activate the feature, the best way is hiding it behind an environment variable. The only exceptions I can think of are when:
Sadly both exceptions apply to adding new database support but I can't imagine they would for this case.
Out of curiosity, what kind of metrics are you interested in collecting?
@Skeen commented on GitHub (Jun 2, 2019):
Okay that sounds good, I'm thinking I'll add 4 environmental variables then, something like:
Where's enable will be the feature toggle with a default to false, username and password will be optional, and if provided will ask for http basic auth before providing metrics and finally metrics uri will be the suburl where metrics are served, defaulting to /metrics
The metrics I'm planning to expose are general http request cycle stuff, numbers of syncs potentially labeled by uuid and database metrics such as the total number of ciphers, ciphers by organization and user, etc.
I'm very open for input on specific metrics you'd like to see included too though.
@MarsWarrior commented on GitHub (Jun 3, 2019):
I would like to see failed logins, so I can set an alarm on that event in Grafana!
And maybe:
@Skeen commented on GitHub (Jun 3, 2019):
Hi @MarsWarrior, I already have the database metrics set up. Including number of users per organization, and such, some of which may have to go behind an environmental variable or be toggleable for people with larger userbases, if they want to avoid too many metrics.
Number of lookups will be hard, as you cannot see when a user makes a lookup after synchronizing. - You can however potentially track synchronizations.
@mprasil commented on GitHub (Jun 3, 2019):
I'd love to see that one as well!
@mprasil commented on GitHub (Jun 6, 2019):
I'm going to close this @Skeen now. If you have more questions, maybe hop onto the chat. We can also discuss under WIP PR once you get there as that's probably more appropriate place to discuss these things.
@Skeen commented on GitHub (Jun 6, 2019):
@mprasil that's fair, let's discuss the PR once it's ready and submitted.
@bclermont commented on GitHub (Mar 1, 2021):
There is no other task to keep track of this feature? been implemented?
@Skeen commented on GitHub (Mar 1, 2021):
I ended up going solely with metrics derived from the database.