Skip to content

Commit e618463

Browse files
author
Ganesh Vernekar
committed
Fix review comments
Signed-off-by: Ganesh Vernekar <[email protected]>
1 parent 3fc8e31 commit e618463

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/ingester/ingester.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ type ingesterMetrics struct {
4848
queriedSamples prometheus.Histogram
4949
queriedSeries prometheus.Histogram
5050
queriedChunks prometheus.Histogram
51+
walReplayDuration prometheus.Summary
5152
}
5253

5354
func newIngesterMetrics(r prometheus.Registerer) *ingesterMetrics {
@@ -86,6 +87,11 @@ func newIngesterMetrics(r prometheus.Registerer) *ingesterMetrics {
8687
// A small number of chunks per series - 10*(8^(7-1)) = 2.6m.
8788
Buckets: prometheus.ExponentialBuckets(10, 8, 7),
8889
}),
90+
walReplayDuration: prometheus.NewSummary(prometheus.SummaryOpts{
91+
Name: "cortex_ingester_wal_replay_duration_seconds",
92+
Help: "Time taken to replay the checkpoint and the WAL.",
93+
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
94+
}),
8995
}
9096

9197
if r != nil {
@@ -245,6 +251,7 @@ func New(cfg Config, clientConfig client.Config, limits *validation.Overrides, c
245251
}
246252
elapsed := time.Since(start)
247253
level.Info(util.Logger).Log("msg", "recovery from WAL completed", "time", elapsed.String())
254+
i.metrics.walReplayDuration.Observe(elapsed.Seconds())
248255
}
249256

250257
// If the WAL recover happened, then the userStates would already be set.
@@ -334,7 +341,6 @@ func (i *Ingester) StopIncomingRequests() {
334341

335342
// Push implements client.IngesterServer
336343
func (i *Ingester) Push(ctx old_ctx.Context, req *client.WriteRequest) (*client.WriteResponse, error) {
337-
338344
if i.cfg.TSDBEnabled {
339345
return i.v2Push(ctx, req)
340346
}

0 commit comments

Comments
 (0)