Skip to content

Commit c0190b2

Browse files
committed
update compressed -> compact
1 parent 821ad50 commit c0190b2

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_opentelemetry_configurator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
AwsMetricAttributesSpanExporterBuilder,
2424
)
2525
from amazon.opentelemetry.distro.aws_span_metrics_processor_builder import AwsSpanMetricsProcessorBuilder
26-
from amazon.opentelemetry.distro.exporter.console.logs.compressed_console_log_exporter import (
27-
CompressedConsoleLogExporter,
26+
from amazon.opentelemetry.distro.exporter.console.logs.compact_console_log_exporter import (
27+
CompactConsoleLogExporter,
2828
)
2929
from amazon.opentelemetry.distro.otlp_udp_exporter import OTLPUdpSpanExporter
3030
from amazon.opentelemetry.distro.sampler.aws_xray_remote_sampler import AwsXRayRemoteSampler
@@ -220,9 +220,9 @@ def _init_logging(
220220

221221
for _, exporter_class in exporters.items():
222222
if exporter_class is ConsoleLogExporter and _is_lambda_environment():
223-
exporter_class = CompressedConsoleLogExporter
223+
exporter_class = CompactConsoleLogExporter
224224
_logger.debug(
225-
"Lambda environment detected, using CompressedConsoleLogExporter instead of ConsoleLogExporter"
225+
"Lambda environment detected, using CompactConsoleLogExporter instead of ConsoleLogExporter"
226226
)
227227
exporter_args = {}
228228
_customize_log_record_processor(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from opentelemetry.sdk._logs.export import ConsoleLogExporter, LogExportResult
88

99

10-
class CompressedConsoleLogExporter(ConsoleLogExporter):
10+
class CompactConsoleLogExporter(ConsoleLogExporter):
1111
def export(self, batch: Sequence[LogData]):
1212
for data in batch:
1313
formatted_json = self.formatter(data.log_record)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
import unittest
44
from unittest.mock import Mock, patch
55

6-
from amazon.opentelemetry.distro.exporter.console.logs.compressed_console_log_exporter import (
7-
CompressedConsoleLogExporter,
6+
from amazon.opentelemetry.distro.exporter.console.logs.compact_console_log_exporter import (
7+
CompactConsoleLogExporter,
88
)
99
from opentelemetry.sdk._logs.export import LogExportResult
1010

1111

12-
class TestCompressedConsoleLogExporter(unittest.TestCase):
12+
class TestCompactConsoleLogExporter(unittest.TestCase):
1313

1414
def setUp(self):
15-
self.exporter = CompressedConsoleLogExporter()
15+
self.exporter = CompactConsoleLogExporter()
1616

1717
@patch("builtins.print")
1818
def test_export_compresses_json(self, mock_print):
@@ -56,7 +56,7 @@ def test_export_multiple_records(self, mock_print):
5656

5757
# Verify print calls
5858
self.assertEqual(mock_print.call_count, 2) # 2 records
59-
# Each record should print compressed JSON
59+
# Each record should print compact JSON
6060
expected_calls = [unittest.mock.call('{"body":"test"}', flush=True)] * 2
6161
mock_print.assert_has_calls(expected_calls)
6262

aws-opentelemetry-distro/tests/amazon/opentelemetry/distro/test_aws_opentelementry_configurator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
)
4848
from amazon.opentelemetry.distro.aws_opentelemetry_distro import AwsOpenTelemetryDistro
4949
from amazon.opentelemetry.distro.aws_span_metrics_processor import AwsSpanMetricsProcessor
50-
from amazon.opentelemetry.distro.exporter.console.logs.compressed_console_log_exporter import (
51-
CompressedConsoleLogExporter,
50+
from amazon.opentelemetry.distro.exporter.console.logs.compact_console_log_exporter import (
51+
CompactConsoleLogExporter,
5252
)
5353
from amazon.opentelemetry.distro.exporter.otlp.aws.common.aws_auth_session import AwsAuthSession
5454

@@ -696,7 +696,7 @@ def test_init_logging_console_exporter_replacement(
696696
mock_get_logger,
697697
mock_logging_handler,
698698
):
699-
"""Test that ConsoleLogExporter is replaced with CompressedConsoleLogExporter when in Lambda"""
699+
"""Test that ConsoleLogExporter is replaced with CompactConsoleLogExporter when in Lambda"""
700700

701701
# Mock _is_lambda_environment to return True
702702
with patch(
@@ -713,8 +713,8 @@ def test_init_logging_console_exporter_replacement(
713713
call_args = mock_customize_logs_exporter.call_args
714714
exporter_instance = call_args[0][0]
715715

716-
# Verify it's a CompressedConsoleLogExporter instance
717-
self.assertIsInstance(exporter_instance, CompressedConsoleLogExporter)
716+
# Verify it's a CompactConsoleLogExporter instance
717+
self.assertIsInstance(exporter_instance, CompactConsoleLogExporter)
718718

719719
# Reset mocks
720720
mock_customize_processor.reset_mock()
@@ -733,7 +733,7 @@ def test_init_logging_console_exporter_replacement(
733733

734734
# Verify it's still a regular ConsoleLogExporter
735735
self.assertIsInstance(exporter_instance, ConsoleLogExporter)
736-
self.assertNotIsInstance(exporter_instance, CompressedConsoleLogExporter)
736+
self.assertNotIsInstance(exporter_instance, CompactConsoleLogExporter)
737737

738738
def test_customize_span_processors(self):
739739
mock_tracer_provider: TracerProvider = MagicMock()

0 commit comments

Comments
 (0)