From 4f805cc4cd1535778afb09e9d6d0a3a97b0b5f79 Mon Sep 17 00:00:00 2001 From: Dudssource Date: Tue, 23 Jan 2024 13:06:01 -0300 Subject: [PATCH] chore: fix linter findings on metrics_encoder/__init__.py --- .../common/_internal/metrics_encoder/__init__.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/metrics_encoder/__init__.py b/exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/metrics_encoder/__init__.py index 8f4997c2f4e..8cf321be72e 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/metrics_encoder/__init__.py +++ b/exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/metrics_encoder/__init__.py @@ -66,6 +66,9 @@ def _common_configuration( self, preferred_temporality: Dict[type, AggregationTemporality] = None, preferred_aggregation: Dict[type, "opentelemetry.sdk.metrics.view.Aggregation"] = None, + preferred_aggregation: Dict[ + type, "opentelemetry.sdk.metrics.view.Aggregation" + ] = None, ) -> None: MetricExporter.__init__( @@ -74,7 +77,9 @@ def _common_configuration( preferred_aggregation=self.get_aggregation(preferred_aggregation), ) - def get_temporality(self, preferred_temporality: Dict[type, AggregationTemporality]) -> Dict[type, AggregationTemporality]: + def get_temporality( + self, preferred_temporality: Dict[type, AggregationTemporality] + ) -> Dict[type, AggregationTemporality]: otel_exporter_otlp_metrics_temporality_preference = ( environ.get( @@ -128,7 +133,12 @@ def get_temporality(self, preferred_temporality: Dict[type, AggregationTemporali return instrument_class_temporality - def get_aggregation(self, preferred_aggregation: Dict[type, "opentelemetry.sdk.metrics.view.Aggregation"]) -> Dict[type, "opentelemetry.sdk.metrics.view.Aggregation"]: + def get_aggregation( + self, + preferred_aggregation: Dict[ + type, "opentelemetry.sdk.metrics.view.Aggregation" + ], + ) -> Dict[type, "opentelemetry.sdk.metrics.view.Aggregation"]: otel_exporter_otlp_metrics_default_histogram_aggregation = environ.get( OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION,