Skip to content

Commit

Permalink
Expose comm_nbytes in get_metrics and prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikmakait committed Aug 31, 2022
1 parent 3e3cf21 commit 8ae02e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions distributed/http/worker/prometheus/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ def collect(self):
value=self.server.latency,
)

yield GaugeMetricFamily(
self.build_name("comm_reserved_bytes"),
"Number of bytes currently reserved for incoming/outgoing data transfers.",
value=self.server.state.comm_nbytes,
)

# all metrics using digests require crick to be installed
# the following metrics will export NaN, if the corresponding digests are None
if self.crick_available:
Expand Down
1 change: 1 addition & 0 deletions distributed/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,7 @@ async def get_metrics(self) -> dict:
"memory": spilled_memory,
"disk": spilled_disk,
},
comm_reserved_bytes=self.state.comm_nbytes,
event_loop_interval=self._tick_interval_observed,
)
out.update(self.monitor.recent())
Expand Down

0 comments on commit 8ae02e1

Please sign in to comment.