Skip to content

Commit

Permalink
Merge pull request #970 from albertodonato/process-collector-param-type
Browse files Browse the repository at this point in the history
Mark collector parameter as optional in ProcessCollector and PlatformCollector
  • Loading branch information
csmarchbanks committed Oct 24, 2023
2 parents 249490e + 0600a3d commit 377e386
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion prometheus_client/platform_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class PlatformCollector(Collector):
"""Collector for python platform information"""

def __init__(self,
registry: CollectorRegistry = REGISTRY,
registry: Optional[CollectorRegistry] = REGISTRY,
platform: Optional[Any] = None,
):
self._platform = pf if platform is None else platform
Expand Down
4 changes: 2 additions & 2 deletions prometheus_client/process_collector.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from typing import Callable, Iterable, Union
from typing import Callable, Iterable, Optional, Union

from .metrics_core import CounterMetricFamily, GaugeMetricFamily, Metric
from .registry import Collector, CollectorRegistry, REGISTRY
Expand All @@ -20,7 +20,7 @@ def __init__(self,
namespace: str = '',
pid: Callable[[], Union[int, str]] = lambda: 'self',
proc: str = '/proc',
registry: CollectorRegistry = REGISTRY):
registry: Optional[CollectorRegistry] = REGISTRY):
self._namespace = namespace
self._pid = pid
self._proc = proc
Expand Down

0 comments on commit 377e386

Please sign in to comment.