From 4b8a4ec43dc44f007c0e2a217518a550d0ba38f3 Mon Sep 17 00:00:00 2001 From: Zhonghao Zhao Date: Fri, 23 Feb 2024 11:53:45 -0800 Subject: [PATCH] Support OTEL_EXPORTER_OTLP_PROTOCOL. --- .../opentelemetry/distro/aws_opentelemetry_configurator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 8807c4f4f..1ee389935 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 @@ -31,6 +31,7 @@ from opentelemetry.sdk.environment_variables import ( _OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED, OTEL_EXPORTER_OTLP_METRICS_PROTOCOL, + OTEL_EXPORTER_OTLP_PROTOCOL, OTEL_TRACES_SAMPLER_ARG, ) from opentelemetry.sdk.extension.aws.resource.ec2 import AwsEc2ResourceDetector @@ -226,7 +227,9 @@ def __new__(cls, *args, **kwargs): # pylint: disable=no-self-use def create_exporter(self): - protocol = os.environ.get(OTEL_EXPORTER_OTLP_METRICS_PROTOCOL, "grpc") + protocol = os.environ.get( + OTEL_EXPORTER_OTLP_PROTOCOL, os.environ.get(OTEL_EXPORTER_OTLP_METRICS_PROTOCOL, "grpc") + ) _logger.debug("AppSignals export protocol: %s", protocol) app_signals_endpoint = os.environ.get(