You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
It can be useful to report Unix timestamps as gauge metrics. For Prometheus, the recommended unit is Unix timestamps (in seconds) https://prometheus.io/docs/practices/naming/. Vault uses the go-metrics library which stores metrics as float32s, later upcast for Prometheus. For Unix times, this isn't enough precision (https://go.dev/play/p/RvJ11Y8R7Cz) and truncates the value to about ~2 minute precision.
Vault has at least one instance of this, probably unnoticed:
Describe alternatives you've considered
Storing timestamps with a different epoch would work, but be difficult to integrate with tools like Grafana. It also just kicks the can down the road.
Recording the metric as a "time since event"/"age" would also work, but is brittle in cases where metrics have gaps.
Explain any additional use-cases
Specifically for Vault Agent, it is useful to record things like last authentication time and other timestamps for alerting.
Is your feature request related to a problem? Please describe.
It can be useful to report Unix timestamps as gauge metrics. For Prometheus, the recommended unit is Unix timestamps (in seconds) https://prometheus.io/docs/practices/naming/. Vault uses the go-metrics library which stores metrics as float32s, later upcast for Prometheus. For Unix times, this isn't enough precision (https://go.dev/play/p/RvJ11Y8R7Cz) and truncates the value to about ~2 minute precision.
Vault has at least one instance of this, probably unnoticed:
vault/builtin/logical/pki/path_tidy.go
Line 1209 in 2dd4528
Describe the solution you'd like
Either update go-metrics to use float64 values, or add a Gauge64 (something like this fork https://github.com/rcrowley/go-metrics/blob/cf1acfcdf4751e0554ffa765d03e479ec491cad6/gauge_float64.go)
Describe alternatives you've considered
Storing timestamps with a different epoch would work, but be difficult to integrate with tools like Grafana. It also just kicks the can down the road.
Recording the metric as a "time since event"/"age" would also work, but is brittle in cases where metrics have gaps.
Explain any additional use-cases
Specifically for Vault Agent, it is useful to record things like last authentication time and other timestamps for alerting.
go-metrics issue opened here: hashicorp/go-metrics#150
The text was updated successfully, but these errors were encountered: