From e3f183b88a1fcf6777de1dd4b176dfa7ab8d343a Mon Sep 17 00:00:00 2001 From: liustve Date: Wed, 2 Apr 2025 00:06:38 +0000 Subject: [PATCH 1/3] added README.md and moved otlp_aws_span_exporter into its own folder --- .../distro/aws-span-exporter/README.md | 28 +++++++++++++++++++ .../otlp_aws_span_exporter.py | 0 2 files changed, 28 insertions(+) create mode 100644 aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws-span-exporter/README.md rename aws-opentelemetry-distro/src/amazon/opentelemetry/distro/{ => aws-span-exporter}/otlp_aws_span_exporter.py (100%) diff --git a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws-span-exporter/README.md b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws-span-exporter/README.md new file mode 100644 index 000000000..b14213399 --- /dev/null +++ b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws-span-exporter/README.md @@ -0,0 +1,28 @@ +# ADOT X-Ray OTLP Trace Export Configuration + +This guide explains how to automatically configure ADOT environment variables for exporting traces to [AWS X-Ray OTLP endpoint](https://docs.aws.amazon.com/xray/latest/devguide/xray-opentelemetry.html) + +## Prerequisites + +1. Transaction Search must be enabled in order to send spans to the Xray OTLP endpoint. See [this doc](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Transaction-Search-getting-started.html) on how to enable Transaction Search. + +2. Ensure the AWS role in your application environment has [AWSXRayWriteOnlyAccess](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSXrayWriteOnlyAccess.html) managed policy attached. + +## Environment Variables + +Set the following environment variables to **PROPERLY** configure trace export with SigV4 authentication: + +```shell +# Set X-Ray endpoint (replace AWS_REGION with your region) +OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://xray..amazonaws.com/v1/traces + +# Configure OTLP export protocol +OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf + +OTEL_TRACES_EXPORTER=otlp +OTEL_METRICS_EXPORTER=none +OTEL_LOGS_EXPORTER=none +OTEL_RESOURCE_ATTRIBUTES="service.name=" + +# Disable application signals (they will be generated in CloudWatch backend) +OTEL_AWS_APPLICATION_SIGNALS_ENABLED=false \ No newline at end of file diff --git a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/otlp_aws_span_exporter.py b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws-span-exporter/otlp_aws_span_exporter.py similarity index 100% rename from aws-opentelemetry-distro/src/amazon/opentelemetry/distro/otlp_aws_span_exporter.py rename to aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws-span-exporter/otlp_aws_span_exporter.py From 523fe054484acb5f92814f924dca53aa70f70620 Mon Sep 17 00:00:00 2001 From: liustve Date: Wed, 2 Apr 2025 00:15:18 +0000 Subject: [PATCH 2/3] changed folder name --- .../opentelemetry/distro/aws_opentelemetry_configurator.py | 2 +- .../distro/{aws-span-exporter => aws_span_exporter}/README.md | 0 .../otlp_aws_span_exporter.py | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename aws-opentelemetry-distro/src/amazon/opentelemetry/distro/{aws-span-exporter => aws_span_exporter}/README.md (100%) rename aws-opentelemetry-distro/src/amazon/opentelemetry/distro/{aws-span-exporter => aws_span_exporter}/otlp_aws_span_exporter.py (100%) 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 000732c46..3f5f37336 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 @@ -21,8 +21,8 @@ AwsMetricAttributesSpanExporterBuilder, ) from amazon.opentelemetry.distro.aws_span_metrics_processor_builder import AwsSpanMetricsProcessorBuilder -from amazon.opentelemetry.distro.otlp_aws_span_exporter import OTLPAwsSpanExporter from amazon.opentelemetry.distro.otlp_udp_exporter import OTLPUdpSpanExporter +from amazon.opentelemetry.distro.aws_span_exporter.otlp_aws_span_exporter import OTLPAwsSpanExporter from amazon.opentelemetry.distro.sampler.aws_xray_remote_sampler import AwsXRayRemoteSampler from amazon.opentelemetry.distro.scope_based_exporter import ScopeBasedPeriodicExportingMetricReader from amazon.opentelemetry.distro.scope_based_filtering_view import ScopeBasedRetainingView diff --git a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws-span-exporter/README.md b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_span_exporter/README.md similarity index 100% rename from aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws-span-exporter/README.md rename to aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_span_exporter/README.md diff --git a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws-span-exporter/otlp_aws_span_exporter.py b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_span_exporter/otlp_aws_span_exporter.py similarity index 100% rename from aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws-span-exporter/otlp_aws_span_exporter.py rename to aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_span_exporter/otlp_aws_span_exporter.py From a7182779d9cc9fda2ad54e54fba72d824b25a9c8 Mon Sep 17 00:00:00 2001 From: liustve Date: Wed, 2 Apr 2025 00:23:04 +0000 Subject: [PATCH 3/3] fix linting --- .../opentelemetry/distro/aws_opentelemetry_configurator.py | 2 +- 1 file changed, 1 insertion(+), 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 3f5f37336..785209a73 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 @@ -20,9 +20,9 @@ from amazon.opentelemetry.distro.aws_metric_attributes_span_exporter_builder import ( AwsMetricAttributesSpanExporterBuilder, ) +from amazon.opentelemetry.distro.aws_span_exporter.otlp_aws_span_exporter import OTLPAwsSpanExporter from amazon.opentelemetry.distro.aws_span_metrics_processor_builder import AwsSpanMetricsProcessorBuilder from amazon.opentelemetry.distro.otlp_udp_exporter import OTLPUdpSpanExporter -from amazon.opentelemetry.distro.aws_span_exporter.otlp_aws_span_exporter import OTLPAwsSpanExporter from amazon.opentelemetry.distro.sampler.aws_xray_remote_sampler import AwsXRayRemoteSampler from amazon.opentelemetry.distro.scope_based_exporter import ScopeBasedPeriodicExportingMetricReader from amazon.opentelemetry.distro.scope_based_filtering_view import ScopeBasedRetainingView