From 1219b5d7f40ca6ebc40a86c8eafcfb37c1374811 Mon Sep 17 00:00:00 2001 From: Thomas Pierce Date: Fri, 19 Apr 2024 17:59:09 -0700 Subject: [PATCH] Revert "Remove gRPC dependency for Docker - temporary (#168)" (#169) This reverts commit b1bad4eb34a0249d8e872639aea88f8e477fde0e. *Issue #, if available:* *Description of changes:* By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --- .github/workflows/main_build.yml | 4 ---- Dockerfile | 2 -- .../opentelemetry/distro/aws_opentelemetry_configurator.py | 7 +------ 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/main_build.yml b/.github/workflows/main_build.yml index 56f365786..e574f8bf6 100644 --- a/.github/workflows/main_build.yml +++ b/.github/workflows/main_build.yml @@ -5,10 +5,6 @@ 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/Dockerfile b/Dockerfile index 8d7fab445..a0192e5be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,8 +16,6 @@ WORKDIR /operator-build ADD aws-opentelemetry-distro/ ./aws-opentelemetry-distro/ RUN mkdir workspace && pip install --target workspace ./aws-opentelemetry-distro -RUN pip uninstall opentelemetry-exporter-otlp-proto-grpc -y -RUN pip uninstall grpcio -y FROM public.ecr.aws/amazonlinux/amazonlinux:minimal 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 6c234a0b5..2e9963e81 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,6 +17,7 @@ ) 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, @@ -301,12 +302,6 @@ def create_exporter(self): endpoint=application_signals_endpoint, preferred_temporality=temporality_dict ) if protocol == "grpc": - # pylint: disable=import-outside-toplevel - # Delay import to only occur if grpc required. - from opentelemetry.exporter.otlp.proto.grpc.metric_exporter import ( - OTLPMetricExporter as OTLPGrpcOTLPMetricExporter, - ) - return OTLPGrpcOTLPMetricExporter( endpoint=application_signals_endpoint, preferred_temporality=temporality_dict )