Skip to content
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

Merged
merged 2 commits into from
Sep 21, 2020

Conversation

mneverov
Copy link
Contributor

@mneverov mneverov commented Aug 4, 2020

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

@roidelapluie
Copy link
Member

Should'nt we leverage the timings used in the log messages we already have?

Signed-off-by: Max Neverov <neverov.max@gmail.com>
@mneverov
Copy link
Contributor Author

Should'nt we leverage the timings used in the log messages we already have?

Fixed

tsdb/head.go Outdated Show resolved Hide resolved
tsdb/head.go Show resolved Hide resolved
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.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Help: "Duration of WAL to replay.",
Help: "Time taken to replay the data on disk.",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks

Signed-off-by: Max Neverov <neverov.max@gmail.com>
Copy link
Member

@codesome codesome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@roidelapluie roidelapluie merged commit 7e1c27b into prometheus:master Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metric for Prometheus startup time
3 participants