Skip to content

Commit

Permalink
Revert "Revert "[autoscaler][observability] Autoscaler emit cluster/p…
Browse files Browse the repository at this point in the history
…ending logical resource metrics"" (ray-project#30552)

See ray-project#29820 for most of the details of the PR.

The only difference is improving the NullMetric stub to not fail when tagging labesl for metrics.

This reverts commit f9092dc.

Co-authored-by: Alex <[email protected]>
Signed-off-by: Capiru <[email protected]>
  • Loading branch information
2 people authored and Capiru committed Dec 22, 2022
1 parent 60254d0 commit 2092abe
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions python/ray/autoscaler/_private/prom_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,27 @@ def __init__(
namespace="autoscaler",
registry=self.registry,
)
# This represents the autoscaler's view of essentially
# `ray.cluster_resources()`, it may be slightly different from the
# core metric from an eventual consistency perspective.
self.cluster_resources: Gauge = Gauge(
"cluster_resources",
"Total logical resources in the cluster.",
unit="resources",
namespace="autoscaler",
registry=self.registry,
labelnames=["resource"],
)
# This represents the pending launches + nodes being set up for the
# autoscaler.
self.pending_resources: Gauge = Gauge(
"pending_resources",
"Pending logical resources in the cluster.",
unit="resources",
namespace="autoscaler",
registry=self.registry,
labelnames=["resource"],
)

@property
def session_name(self):
Expand Down

0 comments on commit 2092abe

Please sign in to comment.