Skip to content

Improving away node metrics #4714

Merged
JamesMurkin merged 6 commits intomasterfrom
improved_away_metrics
Feb 27, 2026
Merged

Improving away node metrics #4714
JamesMurkin merged 6 commits intomasterfrom
improved_away_metrics

Conversation

@JamesMurkin
Copy link
Contributor

Capacity/allocation metrics now include:

  • physical_pool which tells you what pool the physical hardware the capacity/allocation belongs to
  • capacity_class which tells you if the capacity is coming from dedicated or shared hardware

Also fixed bug where the metrics were wrong for away nodes

Capacity/allocation metrics now include:
 - `physical_pool` which tells you what pool the physical hardware the capacity/allocation belongs to
 - `capacity_class` which tells you if the capacity is coming from dedicated or shared hardware

Also fixed bug where the metrics were wrong for away nodes

Signed-off-by: JamesMurkin <jamesmurkin@hotmail.com>
Signed-off-by: JamesMurkin <jamesmurkin@hotmail.com>
@JamesMurkin JamesMurkin marked this pull request as ready for review February 25, 2026 14:58
Signed-off-by: JamesMurkin <jamesmurkin@hotmail.com>

func NewClusterAvailableCapacity(value float64, cluster string, pool string, resource string, nodeType string, reservation string) prometheus.Metric {
return prometheus.MustNewConstMetric(ClusterAvailableCapacityDesc, prometheus.GaugeValue, value, cluster, pool, resource, nodeType, reservation)
func NewClusterAvailableCapacity(value float64, cluster string, pool string, resource string, nodeType string, reservation string, physicalPool string, capacityClass string) prometheus.Metric {
Copy link
Member

Choose a reason for hiding this comment

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

I am wondering at this point should we make the func accept a struct instead of 8 params

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably a good idea - but I think I'd rather do that in a separate PR

},
nil,
)
assert.Nil(t, err)
Copy link
Member

Choose a reason for hiding this comment

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

This could even be require.NoError as no point in proceeding the test if we get an error here, it will fail with nil pointer deref afterwards

schedulable = "schedulable"
overAllocated = "overAllocated"
physicalPool = "physical_pool"
capacityClass = "capacity_class"
Copy link
Member

Choose a reason for hiding this comment

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

Those are labels, right? Should we add a suffix Label like we have for the labels below

Signed-off-by: JamesMurkin <jamesmurkin@hotmail.com>
@JamesMurkin JamesMurkin enabled auto-merge (squash) February 27, 2026 12:34
@JamesMurkin JamesMurkin merged commit 05db955 into master Feb 27, 2026
15 checks passed
@JamesMurkin JamesMurkin deleted the improved_away_metrics branch February 27, 2026 12:48
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.

3 participants