From 032c33fc300d2bbacd9716ae23fb62b1f13cb020 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Fri, 24 Jun 2022 16:50:14 +0200 Subject: [PATCH 1/7] Fix warning message for OTLP gRPC exporter mixin Fixes #2780 --- .../exporter/otlp/proto/grpc/exporter.py | 6 +- .../tests/test_otlp_exporter_mixin.py | 64 ++++++++++++++++++- 2 files changed, 67 insertions(+), 3 deletions(-) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py index b965061c5cb..7034806a1a9 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py @@ -321,15 +321,17 @@ def _export(self, data: TypingSequence[SDKDataT]) -> ExportResultT: ) logger.warning( - "Transient error %s encountered while exporting span batch, retrying in %ss.", + "Transient error %s encountered while exporting %s, retrying in %ss.", error.code(), + data.__class__.__name__, delay, ) sleep(delay) continue else: logger.error( - "Failed to export span batch, error code: %s", + "Failed to export %s, error code: %s", + data.__class__.__name__, error.code(), ) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py index a7627b237c9..5533bf2c110 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py @@ -12,13 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. +from logging import WARNING +from types import MethodType +from typing import Sequence from unittest import TestCase -from unittest.mock import patch +from unittest.mock import Mock, patch from grpc import Compression from opentelemetry.exporter.otlp.proto.grpc.exporter import ( + ExportServiceRequestT, InvalidCompressionValueException, + OTLPExporterMixin, + RpcError, + SDKDataT, + StatusCode, environ_to_compression, ) @@ -47,3 +55,57 @@ def test_environ_to_compression(self): ) with self.assertRaises(InvalidCompressionValueException): environ_to_compression("test_invalid") + + @patch("opentelemetry.exporter.otlp.proto.grpc.exporter.expo") + def test_export_warning(self, mock_expo): + + mock_expo.configure_mock(**{"return_value": [0]}) + + rpc_error = RpcError() + + def code(self): + return None + + rpc_error.code = MethodType(code, rpc_error) + + class OTLPMockExporter(OTLPExporterMixin): + + _result = Mock() + _stub = Mock( + **{"return_value": Mock(**{"Export.side_effect": rpc_error})} + ) + + def _translate_data( + self, data: Sequence[SDKDataT] + ) -> ExportServiceRequestT: + pass + + otlp_mock_exporter = OTLPMockExporter() + + with self.assertLogs(level=WARNING) as warning: + # pylint: disable=protected-access + otlp_mock_exporter._export(Mock()) + self.assertEqual( + warning.records[0].message, + "Failed to export Mock, error code: None", + ) + + def code(self): # pylint: disable=function-redefined + return StatusCode.CANCELLED + + def trailing_metadata(self): + return {} + + rpc_error.code = MethodType(code, rpc_error) + rpc_error.trailing_metadata = MethodType(trailing_metadata, rpc_error) + + with self.assertLogs(level=WARNING) as warning: + # pylint: disable=protected-access + otlp_mock_exporter._export(Mock()) + self.assertEqual( + warning.records[0].message, + ( + "Transient error StatusCode.CANCELLED encountered " + "while exporting Mock, retrying in 0s." + ), + ) From 1280a2c4993f44822301bf9954ebf4fa0e9afe07 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 27 Jun 2022 10:10:04 +0200 Subject: [PATCH 2/7] Refactor export parameter type --- .../opentelemetry/exporter/otlp/proto/grpc/exporter.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py index 7034806a1a9..1936046297b 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py @@ -14,7 +14,7 @@ """OTLP Exporter""" -import logging +from logging import getLogger from abc import ABC, abstractmethod from collections.abc import Sequence from os import environ @@ -23,6 +23,7 @@ from typing import Sequence as TypingSequence from typing import TypeVar from urllib.parse import urlparse +from opentelemetry.sdk.trace import ReadableSpan from backoff import expo from google.rpc.error_details_pb2 import RetryInfo @@ -52,8 +53,9 @@ ) from opentelemetry.sdk.resources import Resource as SDKResource from opentelemetry.util.re import parse_headers +from opentelemetry.sdk.metrics.export import MetricsData -logger = logging.getLogger(__name__) +logger = getLogger(__name__) SDKDataT = TypeVar("SDKDataT") ResourceDataT = TypeVar("ResourceDataT") TypingResourceT = TypeVar("TypingResourceT") @@ -277,7 +279,9 @@ def _translate_attributes(self, attributes) -> TypingSequence[KeyValue]: logger.exception(error) return output - def _export(self, data: TypingSequence[SDKDataT]) -> ExportResultT: + def _export( + self, data: Union[TypingSequence[ReadableSpan], MetricsData] + ) -> ExportResultT: max_value = 64 # expo returns a generator that yields delay values which grow From 776cbe19b3041e1032d1c5b8007ce8679cbff5e2 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 27 Jun 2022 10:16:05 +0200 Subject: [PATCH 3/7] Add changelog entry --- CHANGELOG.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d874d0b4f6..50261843496 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,15 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.12.0rc2-0.32b0...HEAD) - +- Fix OTLP gRPC exporter warning message + ([#2781](https://github.com/open-telemetry/opentelemetry-python/pull/2781)) - Fix tracing decorator with late configuration ([#2754](https://github.com/open-telemetry/opentelemetry-python/pull/2754)) - ## [1.12.0rc2-0.32b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.12.0rc2-0.32b0) - 2022-07-04 - - - Fix instrument name and unit regexes ([#2796](https://github.com/open-telemetry/opentelemetry-python/pull/2796)) - Add optional sessions parameter to all Exporters leveraging requests.Session From 060afd5048c5626bc1108b02516bd8ce10a3a148 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 30 Jun 2022 14:59:23 +0200 Subject: [PATCH 4/7] Use fixed warning messages for traces and metrics --- .../exporter/otlp/proto/grpc/exporter.py | 22 ++++++++++++--- .../tests/test_otlp_exporter_mixin.py | 27 ++++++++++++++++--- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py index 1936046297b..b97f7c57991 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py @@ -283,6 +283,19 @@ def _export( self, data: Union[TypingSequence[ReadableSpan], MetricsData] ) -> ExportResultT: + # FIXME remove this check if the export type for traces + # gets updated to a class that represents the proto + # TracesData and use the code below instead. + # logger.warning( + # "Transient error %s encountered while exporting %s, retrying in %ss.", + # error.code(), + # data.__class__.__name__, + # delay, + # ) + if isinstance(data, TypingSequence): + exporting = "traces" + else: + exporting = "metrics" max_value = 64 # expo returns a generator that yields delay values which grow # exponentially. Once delay is greater than max_value, the yielded @@ -325,9 +338,12 @@ def _export( ) logger.warning( - "Transient error %s encountered while exporting %s, retrying in %ss.", + ( + "Transient error %s encountered while exporting " + "%s, retrying in %ss." + ), error.code(), - data.__class__.__name__, + exporting, delay, ) sleep(delay) @@ -335,7 +351,7 @@ def _export( else: logger.error( "Failed to export %s, error code: %s", - data.__class__.__name__, + exporting, error.code(), ) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py index 5533bf2c110..d5dd8f1d467 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py @@ -84,10 +84,18 @@ def _translate_data( with self.assertLogs(level=WARNING) as warning: # pylint: disable=protected-access - otlp_mock_exporter._export(Mock()) + otlp_mock_exporter._export([]) self.assertEqual( warning.records[0].message, - "Failed to export Mock, error code: None", + "Failed to export traces, error code: None", + ) + + with self.assertLogs(level=WARNING) as warning: + # pylint: disable=protected-access + otlp_mock_exporter._export(None) + self.assertEqual( + warning.records[0].message, + "Failed to export metrics, error code: None", ) def code(self): # pylint: disable=function-redefined @@ -101,11 +109,22 @@ def trailing_metadata(self): with self.assertLogs(level=WARNING) as warning: # pylint: disable=protected-access - otlp_mock_exporter._export(Mock()) + otlp_mock_exporter._export([]) + self.assertEqual( + warning.records[0].message, + ( + "Transient error StatusCode.CANCELLED encountered " + "while exporting traces, retrying in 0s." + ), + ) + + with self.assertLogs(level=WARNING) as warning: + # pylint: disable=protected-access + otlp_mock_exporter._export(None) self.assertEqual( warning.records[0].message, ( "Transient error StatusCode.CANCELLED encountered " - "while exporting Mock, retrying in 0s." + "while exporting metrics, retrying in 0s." ), ) From d2b9829582e631522cff941dcce583b96a4f7d60 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 6 Jul 2022 18:07:00 +0200 Subject: [PATCH 5/7] Use subclass-specific error messages --- .../otlp/proto/grpc/_log_exporter/__init__.py | 4 +++ .../exporter/otlp/proto/grpc/exporter.py | 17 +++++++---- .../proto/grpc/metric_exporter/__init__.py | 4 +++ .../proto/grpc/trace_exporter/__init__.py | 4 +++ .../tests/logs/test_otlp_logs_exporter.py | 3 ++ .../metrics/test_otlp_metrics_exporter.py | 3 ++ .../tests/test_otlp_exporter_mixin.py | 29 +++++-------------- .../tests/test_otlp_trace_exporter.py | 3 ++ 8 files changed, 39 insertions(+), 28 deletions(-) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_log_exporter/__init__.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_log_exporter/__init__.py index 51433d57409..489cf35c372 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_log_exporter/__init__.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_log_exporter/__init__.py @@ -154,3 +154,7 @@ def export(self, batch: Sequence[LogData]) -> LogExportResult: def shutdown(self) -> None: pass + + @property + def _exporting(self) -> str: + return "logs" diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py index b97f7c57991..4405bcad68b 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py @@ -292,10 +292,6 @@ def _export( # data.__class__.__name__, # delay, # ) - if isinstance(data, TypingSequence): - exporting = "traces" - else: - exporting = "metrics" max_value = 64 # expo returns a generator that yields delay values which grow # exponentially. Once delay is greater than max_value, the yielded @@ -343,7 +339,7 @@ def _export( "%s, retrying in %ss." ), error.code(), - exporting, + self._exporting, delay, ) sleep(delay) @@ -351,7 +347,7 @@ def _export( else: logger.error( "Failed to export %s, error code: %s", - exporting, + self._exporting, error.code(), ) @@ -364,3 +360,12 @@ def _export( def shutdown(self) -> None: pass + + @property + @abstractmethod + def _exporting(self) -> str: + """ + Returns a string that describes the overall exporter, to be used in + warning messages. + """ + pass 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 c5f4acad06c..fb316ab2e8f 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 @@ -206,3 +206,7 @@ def export( def shutdown(self, timeout_millis: float = 30_000, **kwargs) -> None: pass + + @property + def _exporting(self) -> str: + return "metrics" diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/trace_exporter/__init__.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/trace_exporter/__init__.py index 084a5d93b14..5626012536f 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/trace_exporter/__init__.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/trace_exporter/__init__.py @@ -289,3 +289,7 @@ def _translate_data( def export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult: return self._export(spans) + + @property + def _exporting(self): + return "traces" diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/logs/test_otlp_logs_exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/logs/test_otlp_logs_exporter.py index 4ee8f6a0b37..6f1a90d2c1d 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/logs/test_otlp_logs_exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/logs/test_otlp_logs_exporter.py @@ -161,6 +161,9 @@ def setUp(self): def tearDown(self): self.server.stop(None) + def test_exporting(self): + self.assertEqual(self.exporter._exporting, "logs") + @patch( "opentelemetry.exporter.otlp.proto.grpc.exporter.ssl_channel_credentials" ) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py index 8936272bef0..2cbb5843cef 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py @@ -298,6 +298,9 @@ def setUp(self): def tearDown(self): self.server.stop(None) + def test_exporting(self): + self.assertEqual(self.exporter.exporting, "metrics") + @patch( "opentelemetry.exporter.otlp.proto.grpc.exporter.ssl_channel_credentials" ) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py index d5dd8f1d467..3f44ef228ee 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py @@ -80,22 +80,18 @@ def _translate_data( ) -> ExportServiceRequestT: pass - otlp_mock_exporter = OTLPMockExporter() + @property + def _exporting(self) -> str: + return "mock" - with self.assertLogs(level=WARNING) as warning: - # pylint: disable=protected-access - otlp_mock_exporter._export([]) - self.assertEqual( - warning.records[0].message, - "Failed to export traces, error code: None", - ) + otlp_mock_exporter = OTLPMockExporter() with self.assertLogs(level=WARNING) as warning: # pylint: disable=protected-access - otlp_mock_exporter._export(None) + otlp_mock_exporter._export(Mock()) self.assertEqual( warning.records[0].message, - "Failed to export metrics, error code: None", + "Failed to export mock, error code: None", ) def code(self): # pylint: disable=function-redefined @@ -114,17 +110,6 @@ def trailing_metadata(self): warning.records[0].message, ( "Transient error StatusCode.CANCELLED encountered " - "while exporting traces, retrying in 0s." - ), - ) - - with self.assertLogs(level=WARNING) as warning: - # pylint: disable=protected-access - otlp_mock_exporter._export(None) - self.assertEqual( - warning.records[0].message, - ( - "Transient error StatusCode.CANCELLED encountered " - "while exporting metrics, retrying in 0s." + "while exporting mock, retrying in 0s." ), ) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py index 3d836729011..5924ae41159 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py @@ -217,6 +217,9 @@ def setUp(self): def tearDown(self): self.server.stop(None) + def test_exporting(self): + self.assertEqual(self.exporter.exporting, "traces") + @patch.dict( "os.environ", { From d2f806bc949bdd76d454f270e55b01424b594577 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 6 Jul 2022 18:10:04 +0200 Subject: [PATCH 6/7] Fix test cases --- .../tests/metrics/test_otlp_metrics_exporter.py | 2 +- .../tests/test_otlp_trace_exporter.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py index 2cbb5843cef..109c4800d8c 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py @@ -299,7 +299,7 @@ def tearDown(self): self.server.stop(None) def test_exporting(self): - self.assertEqual(self.exporter.exporting, "metrics") + self.assertEqual(self.exporter._exporting, "metrics") @patch( "opentelemetry.exporter.otlp.proto.grpc.exporter.ssl_channel_credentials" diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py index 5924ae41159..281dde17f94 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py @@ -218,7 +218,7 @@ def tearDown(self): self.server.stop(None) def test_exporting(self): - self.assertEqual(self.exporter.exporting, "traces") + self.assertEqual(self.exporter._exporting, "traces") @patch.dict( "os.environ", From f888494ed80a03d8c1324b9518b0b7df7be10928 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 7 Jul 2022 12:04:22 +0200 Subject: [PATCH 7/7] Fix lint --- .../tests/logs/test_otlp_logs_exporter.py | 1 + .../tests/metrics/test_otlp_metrics_exporter.py | 1 + .../tests/test_otlp_trace_exporter.py | 1 + 3 files changed, 3 insertions(+) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/logs/test_otlp_logs_exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/logs/test_otlp_logs_exporter.py index 6f1a90d2c1d..a9c63eaa0a0 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/logs/test_otlp_logs_exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/logs/test_otlp_logs_exporter.py @@ -162,6 +162,7 @@ def tearDown(self): self.server.stop(None) def test_exporting(self): + # pylint: disable=protected-access self.assertEqual(self.exporter._exporting, "logs") @patch( diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py index 109c4800d8c..c25ab06263c 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py @@ -299,6 +299,7 @@ def tearDown(self): self.server.stop(None) def test_exporting(self): + # pylint: disable=protected-access self.assertEqual(self.exporter._exporting, "metrics") @patch( diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py index 281dde17f94..a5cb4e699a6 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_trace_exporter.py @@ -218,6 +218,7 @@ def tearDown(self): self.server.stop(None) def test_exporting(self): + # pylint: disable=protected-access self.assertEqual(self.exporter._exporting, "traces") @patch.dict(