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

Adding metrics for flush retries #1049

Merged
merged 3 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
* [ENHANCEMENT] Add `search_default_limit` and `search_max_result_limit` to querier config. [#1022](https://github.com/grafana/tempo/pull/1022) [#1044](https://github.com/grafana/tempo/pull/1044) (@kvrhdn)
* [ENHANCEMENT] Add new metric `tempo_distributor_push_duration_seconds` [#1027](https://github.com/grafana/tempo/pull/1027) (@zalegrala)
* [ENHANCEMENT] Add query parameter to show the default config values and the difference between the current values and the defaults. [#1045](https://github.com/grafana/tempo/pull/1045) (@MichelHollands)
* [ENHANCEMENT] Adding metrics around ingester flush retries [#1049](https://github.com/grafana/tempo/pull/944) (@dannykopping)
* [BUGFIX] Update port spec for GCS docker-compose example [#869](https://github.com/grafana/tempo/pull/869) (@zalegrala)
* [BUGFIX] Fix "magic number" errors and other block mishandling when an ingester forcefully shuts down [#937](https://github.com/grafana/tempo/issues/937) (@mdisibio)
* [BUGFIX] Fix compactor memory leak [#806](https://github.com/grafana/tempo/pull/806) (@mdisibio)
Expand Down
16 changes: 16 additions & 0 deletions modules/ingester/flush.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ var (
Name: "ingester_failed_flushes_total",
Help: "The total number of failed traces",
})
metricFlushRetries = promauto.NewCounter(prometheus.CounterOpts{
Namespace: "tempo",
Name: "ingester_flush_retries_total",
Help: "The total number of retries after a failed flush",
})
metricFlushFailedRetries = promauto.NewCounter(prometheus.CounterOpts{
Namespace: "tempo",
Name: "ingester_flush_failed_retries_total",
Help: "The total number of failed retries after a failed flush",
})
metricFlushDuration = promauto.NewHistogram(prometheus.HistogramOpts{
Namespace: "tempo",
Name: "ingester_flush_duration_seconds",
Expand Down Expand Up @@ -213,6 +223,10 @@ func handleFailedOp(op *flushOp, err error) {
level.Error(log.WithUserID(op.userID, log.Logger)).Log("msg", "error performing op in flushQueue",
"op", op.kind, "block", op.blockID.String(), "attempts", op.attempts, "err", err)
metricFailedFlushes.Inc()

if op.attempts > 1 {
metricFlushFailedRetries.Inc()
}
}

func handleAbandonedOp(op *flushOp) {
Expand Down Expand Up @@ -367,6 +381,8 @@ func (i *Ingester) requeue(op *flushOp) {
return
}

metricFlushRetries.Inc()

err := i.flushQueues.Requeue(op)
if err != nil {
handleFailedOp(op, err)
Expand Down