diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py index cebfe7b2347..c40ff1ddd21 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py @@ -169,9 +169,9 @@ def _translate_data( ) def export( - self, metrics: Sequence[Metric], **kwargs + self, metrics: Sequence[Metric], *args, **kwargs ) -> MetricExportResult: return self._export(metrics) - def shutdown(self, **kwargs): + def shutdown(self, *args, **kwargs): pass diff --git a/exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/__init__.py b/exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/__init__.py index 356c11136b2..1b81f062c02 100644 --- a/exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/__init__.py +++ b/exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/__init__.py @@ -110,12 +110,14 @@ def __init__(self, prefix: str = "") -> None: REGISTRY.register(self._collector) self._collector._callback = self.collect - def _receive_metrics(self, metrics: Iterable[Metric], **kwargs) -> None: + def _receive_metrics( + self, metrics: Iterable[Metric], *args, **kwargs + ) -> None: if metrics is None: return self._collector.add_metrics_data(metrics) - def shutdown(self, **kwargs) -> bool: + def shutdown(self, *args, **kwargs) -> bool: REGISTRY.unregister(self._collector) return True diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/_metrics/_internal/measurement_consumer.py b/opentelemetry-sdk/src/opentelemetry/sdk/_metrics/_internal/measurement_consumer.py index 1400b2922bc..ce9b1f0d5e3 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/_metrics/_internal/measurement_consumer.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/_metrics/_internal/measurement_consumer.py @@ -32,13 +32,11 @@ class MeasurementConsumer(ABC): @abstractmethod - def consume_measurement(self, measurement: Measurement, **kwargs) -> None: + def consume_measurement(self, measurement: Measurement) -> None: pass @abstractmethod - def register_asynchronous_instrument( - self, instrument: "_Asynchronous", **kwargs - ): + def register_asynchronous_instrument(self, instrument: "_Asynchronous"): pass @abstractmethod @@ -46,7 +44,6 @@ def collect( self, metric_reader: MetricReader, instrument_type_temporality: Dict[type, AggregationTemporality], - **kwargs ) -> Iterable[Metric]: pass @@ -64,12 +61,12 @@ def __init__(self, sdk_config: SdkConfiguration) -> None: } self._async_instruments: List["_Asynchronous"] = [] - def consume_measurement(self, measurement: Measurement, **kwargs) -> None: + def consume_measurement(self, measurement: Measurement) -> None: for reader_storage in self._reader_storages.values(): reader_storage.consume_measurement(measurement) def register_asynchronous_instrument( - self, instrument: "_Asynchronous", **kwargs + self, instrument: "_Asynchronous" ) -> None: with self._lock: self._async_instruments.append(instrument) @@ -78,7 +75,6 @@ def collect( self, metric_reader: MetricReader, instrument_type_temporality: Dict[type, AggregationTemporality], - **kwargs ) -> Iterable[Metric]: with self._lock: metric_reader_storage = self._reader_storages[metric_reader]