From 660f2535b50f2a031ccbe15c899b8fdb700a5862 Mon Sep 17 00:00:00 2001 From: Thomas Pierce Date: Fri, 19 Apr 2024 23:25:59 +0000 Subject: [PATCH] Remove gRPC dependency for Docker --- .github/workflows/main_build.yml | 4 ++++ .../opentelemetry/distro/aws_opentelemetry_configurator.py | 2 +- contract-tests/images/applications/botocore/Dockerfile | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main_build.yml b/.github/workflows/main_build.yml index e574f8bf6..56f365786 100644 --- a/.github/workflows/main_build.yml +++ b/.github/workflows/main_build.yml @@ -5,6 +5,10 @@ on: branches: - main - "release/v*" + pull_request: + branches: + - main + env: AWS_DEFAULT_REGION: us-east-1 STAGING_ECR_REGISTRY: 637423224110.dkr.ecr.us-east-1.amazonaws.com 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 2e9963e81..6489394b4 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 @@ -17,7 +17,6 @@ ) from amazon.opentelemetry.distro.aws_span_metrics_processor_builder import AwsSpanMetricsProcessorBuilder from amazon.opentelemetry.distro.sampler.aws_xray_remote_sampler import AwsXRayRemoteSampler -from opentelemetry.exporter.otlp.proto.grpc.metric_exporter import OTLPMetricExporter as OTLPGrpcOTLPMetricExporter from opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter as OTLPHttpOTLPMetricExporter from opentelemetry.sdk._configuration import ( _get_exporter_names, @@ -302,6 +301,7 @@ def create_exporter(self): endpoint=application_signals_endpoint, preferred_temporality=temporality_dict ) if protocol == "grpc": + from opentelemetry.exporter.otlp.proto.grpc.metric_exporter import OTLPMetricExporter as OTLPGrpcOTLPMetricExporter return OTLPGrpcOTLPMetricExporter( endpoint=application_signals_endpoint, preferred_temporality=temporality_dict ) diff --git a/contract-tests/images/applications/botocore/Dockerfile b/contract-tests/images/applications/botocore/Dockerfile index 65a7d328d..9e3d77dda 100644 --- a/contract-tests/images/applications/botocore/Dockerfile +++ b/contract-tests/images/applications/botocore/Dockerfile @@ -9,6 +9,8 @@ COPY ./contract-tests/images/applications/botocore /botocore ENV PIP_ROOT_USER_ACTION=ignore ARG DISTRO RUN pip install --upgrade pip && pip install -r requirements.txt && pip install ${DISTRO} --force-reinstall +RUN pip uninstall opentelemetry-exporter-otlp-proto-grpc +RUN pip uninstall grpcio RUN opentelemetry-bootstrap -a install # Without `-u`, logs will be buffered and `wait_for_logs` will never return.