-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tsdb startup duration metric #7737
Conversation
Should'nt we leverage the timings used in the log messages we already have? |
Signed-off-by: Max Neverov <neverov.max@gmail.com>
45ac7f7
to
597f67f
Compare
Fixed |
tsdb/head.go
Outdated
@@ -169,6 +170,10 @@ func newHeadMetrics(h *Head, r prometheus.Registerer) *headMetrics { | |||
Name: "prometheus_tsdb_wal_corruptions_total", | |||
Help: "Total number of WAL corruptions.", | |||
}), | |||
walTotalReplayDuration: prometheus.NewGauge(prometheus.GaugeOpts{ | |||
Name: "prometheus_tsdb_wal_total_replay_duration_seconds", | |||
Help: "Duration of WAL to replay.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Help: "Duration of WAL to replay.", | |
Help: "Time taken to replay the data on disk.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fixes #7703
I created a new metric
prometheus_tsdb_startup_duration_seconds
.Other possible solution may be exposing the total_replay_duration as metric, since the time is spent mostly on WAL load.
Signed-off-by: Maxim Neverov neverov.max@gmail.com
@bwplotka please take a look