diff --git a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_opentelemetry_configurator.py b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_opentelemetry_configurator.py index addf4b377..674a12af1 100644 --- a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_opentelemetry_configurator.py +++ b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_opentelemetry_configurator.py @@ -48,9 +48,9 @@ from opentelemetry.semconv.resource import ResourceAttributes from opentelemetry.trace import set_tracer_provider -OTEL_SMP_ENABLED = "OTEL_SMP_ENABLED" +OTEL_AWS_APP_SIGNALS_ENABLED = "OTEL_AWS_APP_SIGNALS_ENABLED" OTEL_METRIC_EXPORT_INTERVAL = "OTEL_METRIC_EXPORT_INTERVAL" -OTEL_AWS_SMP_EXPORTER_ENDPOINT = "OTEL_AWS_SMP_EXPORTER_ENDPOINT" +OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT = "OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT" DEFAULT_METRIC_EXPORT_INTERVAL = 60000.0 _logger: Logger = getLogger(__name__) @@ -65,7 +65,7 @@ class AwsOpenTelemetryConfigurator(_OTelSDKConfigurator): - Add AttributePropagatingSpanProcessor to propagate span attributes from parent to child spans. - Add AwsMetricAttributesSpanExporter to add more attributes to all spans. - You can control when these customizations are applied using the environment variable OTEL_SMP_ENABLED. + You can control when these customizations are applied using the environment variable OTEL_AWS_APP_SIGNALS_ENABLED. This flag is disabled by default. """ @@ -169,7 +169,7 @@ def _customize_span_processors(provider: TracerProvider, resource: Resource) -> ]: temporality_dict[typ] = AggregationTemporality.DELTA _logger.info("Span Metrics Processor enabled") - smp_endpoint = os.environ.get(OTEL_AWS_SMP_EXPORTER_ENDPOINT, "http://cloudwatch-agent.amazon-cloudwatch:4317") + smp_endpoint = os.environ.get(OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT, "http://localhost:4315") otel_metric_exporter = OTLPMetricExporter(endpoint=smp_endpoint, preferred_temporality=temporality_dict) export_interval_millis = float(os.environ.get(OTEL_METRIC_EXPORT_INTERVAL, DEFAULT_METRIC_EXPORT_INTERVAL)) _logger.debug("Span Metrics endpoint: %s", smp_endpoint) @@ -189,4 +189,4 @@ def _customize_span_processors(provider: TracerProvider, resource: Resource) -> def is_smp_enabled(): - return os.environ.get(OTEL_SMP_ENABLED, False) + return os.environ.get(OTEL_AWS_APP_SIGNALS_ENABLED, False) diff --git a/contract-tests/tests/test/amazon/base/contract_test_base.py b/contract-tests/tests/test/amazon/base/contract_test_base.py index 413bee26c..aa73b97b5 100644 --- a/contract-tests/tests/test/amazon/base/contract_test_base.py +++ b/contract-tests/tests/test/amazon/base/contract_test_base.py @@ -83,10 +83,10 @@ def setUp(self) -> None: DockerContainer(self.get_application_image_name()) .with_exposed_ports(self.get_application_port()) .with_env("OTEL_METRIC_EXPORT_INTERVAL", "100") - .with_env("OTEL_SMP_ENABLED", "true") + .with_env("OTEL_AWS_APP_SIGNALS_ENABLED", "true") .with_env("OTEL_METRICS_EXPORTER", "none") .with_env("OTEL_BSP_SCHEDULE_DELAY", "1") - .with_env("OTEL_AWS_SMP_EXPORTER_ENDPOINT", f"http://collector:{_MOCK_COLLECTOR_PORT}") + .with_env("OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT", f"http://collector:{_MOCK_COLLECTOR_PORT}") .with_env("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT", f"http://collector:{_MOCK_COLLECTOR_PORT}") .with_env("OTEL_RESOURCE_ATTRIBUTES", self.get_application_otel_resource_attributes()) .with_env("OTEL_TRACES_SAMPLER", "always_on")