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

Rename nomad.broker.total_blocked metric #15835

Merged
merged 5 commits into from
Jan 20, 2023
Merged

Rename nomad.broker.total_blocked metric #15835

merged 5 commits into from
Jan 20, 2023

Conversation

tgross
Copy link
Member

@tgross tgross commented Jan 20, 2023

Fixes #6480 and addresses comments from #14621 (comment)

This changeset fixes a long-standing point of confusion in metrics emitted by the eval broker. The eval broker has a queue of "blocked" evals that are waiting for an in-flight ("unacked") eval of the same job to be completed. But this "blocked" state is not the same as the blocked status that we write to raft and expose in the Nomad API to end users. There's a second metric nomad.blocked_eval.total_blocked that refers to evaluations in that state. This has caused ongoing confusion in major customer incidents and even in our own documentation! (Fixed in this PR.)

There's little functional change in this PR aside from the name of the metric emitted, but there's a bit refactoring to clean up the names in eval_broker.go so that there aren't name collisions and multiple names for the same state. Changes included are:

  • Everything that was previously called "pending" referred to entities that were associated witht he "ready" metric. These are all now called "ready" to match the metric.
  • Everything named "blocked" in eval_broker.go is now named "pending", except for a couple of comments that actually refer to blocked RPCs.
  • Added a note to the upgrade guide docs for 1.5.0.
  • Fixed the scheduling performance metrics docs because the description for nomad.broker.total_blocked was actually the description for nomad.blocked_eval.total_blocked.

Once this is reviewed I'll open a second PR backporting just the docs fixes.

Copy link
Member

@gulducat gulducat left a comment

Choose a reason for hiding this comment

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

Seems sensible to me, yay for disambiguation!

@tgross tgross merged commit 9bdb6a5 into main Jan 20, 2023
@tgross tgross deleted the broker-metric-rename branch January 20, 2023 19:23
tgross added a commit that referenced this pull request Jan 20, 2023
In #15835 we renamed the `nomad.broker.total_blocked` metric to
`nomad.broker.total_pending`, but in the process identified that the existing
scheduling performance monitoring guide mixed up the `broker.total_blocked`
metric with the `blocked_evals.total_blocked` metric. This changeset backports
the fix to the docs without renaming the metric (for backwards compatibility).
tgross added a commit that referenced this pull request Jan 20, 2023
In #15835 we renamed the `nomad.broker.total_blocked` metric to
`nomad.broker.total_pending`, but in the process identified that the existing
scheduling performance monitoring guide mixed up the `broker.total_blocked`
metric with the `blocked_evals.total_blocked` metric. This changeset backports
the fix to the docs without renaming the metric (for backwards compatibility).
@@ -896,7 +895,7 @@ func (b *EvalBroker) EmitStats(period time.Duration, stopCh <-chan struct{}) {
stats := b.Stats()
metrics.SetGauge([]string{"nomad", "broker", "total_ready"}, float32(stats.TotalReady))
metrics.SetGauge([]string{"nomad", "broker", "total_unacked"}, float32(stats.TotalUnacked))
metrics.SetGauge([]string{"nomad", "broker", "total_blocked"}, float32(stats.TotalBlocked))
metrics.SetGauge([]string{"nomad", "broker", "total_pending"}, float32(stats.TotalPending))
Copy link
Member

Choose a reason for hiding this comment

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

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better metric name for nomad.broker.total_blocked
3 participants