8000 Merge pull request #970 from albertodonato/process-collector-param-type · JustinJohnsonK/client_python@377e386 · GitHub
[go: up one dir, main page]

Skip to content

Commit 377e386

Browse files
authored
Merge pull request prometheus#970 from albertodonato/process-collector-param-type
Mark collector parameter as optional in ProcessCollector and PlatformCollector
2 parents 249490e + 0600a3d commit 377e386

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

prometheus_client/platform_collector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class PlatformCollector(Collector):
99
"""Collector for python platform information"""
1010

1111
def __init__(self,
12-
registry: CollectorRegistry = REGISTRY,
12+
registry: Optional[CollectorRegistry] = REGISTRY,
1313
platform: Optional[Any] = None,
1414
):
1515
self._platform = pf if platform is None else platform

prometheus_client/process_collector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import os
2-
from typing import Callable, Iterable, Union
2+
from typing import Callable, Iterable, Optional, Union
33

44
from .metrics_core import CounterMetricFamily, GaugeMetricFamily, Metric
55
from .registry import Collector, CollectorRegistry, REGISTRY
@@ -20,7 +20,7 @@ def __init__(self,
2020
namespace: str = '',
2121
pid< 5B71 /span>: Callable[[], Union[int, str]] = lambda: 'self',
2222
proc: str = '/proc',
23-
registry: CollectorRegistry = REGISTRY):
23+
registry: Optional[CollectorRegistry] = REGISTRY):
2424
self._namespace = namespace
2525
self._pid = pid
2626
self._proc = proc

0 commit comments

Comments
 (0)
0