Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark collector parameter as optional in ProcessCollector and PlatformCollector #970

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion prometheus_client/platform_collector.py
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
@@ -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