Create a new metric for the main scheduler loop - #5134
Open
JamesMurkin wants to merge 2 commits into
Open
Conversation
New metric - 'armada_scheduler_main_loop_cycle_time' - Labels type (reconciliation/scheduling) and outcome (success/failure) This will supersede existing metrics: - armada_scheduler_schedule_loop_cycle_times - armada_scheduler_schedule_loop_outcome - armada_scheduler_reconciliation_loop_cycle_times The reasons to do this are: - Simpler in code - No risk of the metric being inconsistent with itself. I.e if we set cycle time but not outcome, they could get out sync - Allow more flexible querying - Can now see duration of failing cycles separately to successful ones - Can get an average of all cycles regardless of type, without needing to manaully merge 2 metrics - Less confusing naming. armada_scheduler_schedule_* and armada_scheduler_scheduling_* mean different things but are very similar. Now the main loop is explicitly named that in the metrics, avoiding confusion with the scheduling duration Signed-off-by: JamesMurkin <jamesmurkin@hotmail.com>
JamesMurkin
marked this pull request as ready for review
August 27, 2026 10:36
Contributor
Greptile SummaryThe PR adds a unified scheduler main-loop cycle-time histogram labeled by loop type and outcome.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| internal/scheduler/metrics/cycle_metrics.go | Adds and exports the labeled main-loop duration histogram and its reporting method. |
| internal/scheduler/metrics/cycle_metrics_test.go | Tests independent observations for each loop-type and outcome combination and updates collection expectations. |
| internal/scheduler/scheduler.go | Reports each completed scheduler cycle using its selected loop type and error-derived outcome. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Scheduler main-loop cycle] --> B{Scheduling attempted?}
B -->|Yes| C[type=scheduling]
B -->|No| D[type=reconciliation]
C --> E{Cycle error?}
D --> E
E -->|No| F[outcome=success]
E -->|Yes| G[outcome=failure]
F --> H[Observe main_loop_cycle_time]
G --> H
Reviews (2): Last reviewed commit: "Merge branch 'master' into scheduler_mai..." | Re-trigger Greptile
nikola-jokic
approved these changes
Aug 27, 2026
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New metric - 'armada_scheduler_main_loop_cycle_time'
This will supersede existing metrics:
The reasons to do this are:
If this pattern works, we'll likely decom the old metrics + move other metrics to the same pattern