We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bbf3eb1 + 562bcae commit 9cb7af8Copy full SHA for 9cb7af8
remote/metrics.py
@@ -3,6 +3,7 @@
3
# SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors
4
# SPDX-License-Identifier: Apache-2.0
5
6
+import contextlib
7
import datetime
8
import logging
9
import os
@@ -133,12 +134,10 @@ def collect(self) -> t.Iterable[prometheus_client.Metric]:
133
134
)
135
136
if hasattr(process, "num_fds"):
- try:
137
+ with contextlib.suppress(psutil.AccessDenied):
138
process_open_fds_metric.add_metric(
139
[process.name()], process.num_fds()
140
- except psutil.AccessDenied:
141
- pass
142
143
yield process_cpu_percent_metric
144
yield process_memory_usage_metric
0 commit comments