Skip to content

Commit

Permalink
Update system monitor when polling Prometheus metrics (#8745)
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikmakait authored Jul 3, 2024
1 parent d36fc3c commit 9d36228
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions distributed/http/scheduler/prometheus/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def __init__(self, server: Scheduler):
self.subsystem = "scheduler"

def collect(self) -> Iterator[GaugeMetricFamily | CounterMetricFamily]:
self.server.monitor.update()

yield GaugeMetricFamily(
self.build_name("clients"),
"Number of clients connected",
Expand Down
1 change: 1 addition & 0 deletions distributed/http/worker/prometheus/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def __init__(self, server: Worker):
)

def collect(self) -> Iterator[Metric]:
self.server.monitor.update()
ws = self.server.state

tasks = GaugeMetricFamily(
Expand Down

0 comments on commit 9d36228

Please sign in to comment.