mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 13:36:02 -04:00
Update type annotations for compatiblity with prometheus_client 0.14 (#12389)
Principally, `prometheus_client.REGISTRY.register` now requires its argument to extend `prometheus_client.Collector`. Additionally, `Gauge.set` is now annotated so that passing `Optional[int]` causes an error.
This commit is contained in:
parent
793d03e2c5
commit
ae01a7edd3
8 changed files with 67 additions and 18 deletions
|
@ -46,6 +46,7 @@ from synapse.logging.opentracing import (
|
|||
noop_context_manager,
|
||||
start_active_span,
|
||||
)
|
||||
from synapse.metrics._types import Collector
|
||||
|
||||
if TYPE_CHECKING:
|
||||
import resource
|
||||
|
@ -127,7 +128,7 @@ _background_processes_active_since_last_scrape: "Set[_BackgroundProcess]" = set(
|
|||
_bg_metrics_lock = threading.Lock()
|
||||
|
||||
|
||||
class _Collector:
|
||||
class _Collector(Collector):
|
||||
"""A custom metrics collector for the background process metrics.
|
||||
|
||||
Ensures that all of the metrics are up-to-date with any in-flight processes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue