Skip to content

Commit

Permalink
more comment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aabmass committed Mar 8, 2021
1 parent 4e6e120 commit d8957bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ class OTLPExporterMixin(
insecure: Connection type
credentials: ChannelCredentials object for server authentication
headers: Headers to send when exporting
compression: Compression algorithm to be used in channel
timeout: Backend request timeout in seconds
compression: gRPC compression method to use
"""

def __init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,17 @@ def test_otlp_headers_from_env(self, mock_ssl_channel, mock_secure):

# pylint: disable=no-self-use
def test_otlp_compression_from_env(self):
# Just OTEL_EXPORTER_OTLP_COMPRESSION should work
with patch(
"opentelemetry.exporter.otlp.exporter.insecure_channel"
) as mock_insecure_channel, patch.dict(
"os.environ", {OTEL_EXPORTER_OTLP_COMPRESSION: "deflate"}
):
OTLPSpanExporter(insecure=True)
mock_insecure_channel.assert_called_once_with(
"localhost:4317", compression=Compression.Deflate
)

# Specifying kwarg should take precedence over env
with patch(
"opentelemetry.exporter.otlp.exporter.insecure_channel"
Expand All @@ -248,17 +259,6 @@ def test_otlp_compression_from_env(self):
"localhost:4317", compression=Compression.NoCompression
)

# Just OTEL_EXPORTER_OTLP_COMPRESSION should work
with patch(
"opentelemetry.exporter.otlp.exporter.insecure_channel"
) as mock_insecure_channel, patch.dict(
"os.environ", {OTEL_EXPORTER_OTLP_COMPRESSION: "deflate"}
):
OTLPSpanExporter(insecure=True)
mock_insecure_channel.assert_called_once_with(
"localhost:4317", compression=Compression.Deflate
)

# OTEL_EXPORTER_OTLP_SPAN_COMPRESSION as higher priority than
# OTEL_EXPORTER_OTLP_COMPRESSION
with patch(
Expand Down

0 comments on commit d8957bc

Please sign in to comment.