diff --git a/Dockerfile.linux b/Dockerfile.linux new file mode 100644 index 00000000..002fd511 --- /dev/null +++ b/Dockerfile.linux @@ -0,0 +1,3 @@ +FROM busybox + +COPY OpenTelemetryDistribution /autoinstrumentation diff --git a/Dockerfile.windows b/Dockerfile.windows new file mode 100644 index 00000000..98b18c7f --- /dev/null +++ b/Dockerfile.windows @@ -0,0 +1,5 @@ +FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 + +COPY OpenTelemetryDistribution /autoinstrumentation + +USER ContainerAdministrator \ No newline at end of file diff --git a/sample-applications/integration-test-app/docker-compose.yml b/sample-applications/integration-test-app/docker-compose.yml index 28675de8..8c56f577 100644 --- a/sample-applications/integration-test-app/docker-compose.yml +++ b/sample-applications/integration-test-app/docker-compose.yml @@ -20,6 +20,7 @@ services: - INSTANCE_ID - LISTEN_ADDRESS=0.0.0.0:8080 - OTEL_RESOURCE_ATTRIBUTES=service.name=aws-otel-integ-test + - OTEL_EXPORTER_OTLP_ENDPOINT=http://cwagent:4316 # TODO: workaround for trace exporter endpoint - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://cwagent:4316/v1/traces - OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://cwagent:4316/v1/metrics - ASPNETCORE_URLS=http://+:8080 diff --git a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsMetricAttributeGenerator.cs b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsMetricAttributeGenerator.cs index 16a4e9cb..2e4222d7 100644 --- a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsMetricAttributeGenerator.cs +++ b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsMetricAttributeGenerator.cs @@ -195,6 +195,12 @@ private static void SetRemoteServiceAndOperation(Activity span, ActivityTagsColl remoteService = NormalizeRemoteServiceName(span, GetRemoteService(span, AttributeRpcService)); remoteOperation = GetRemoteOperation(span, AttributeRpcMethod); } + // TODO workaround for AWS SDK span + else if (IsKeyPresent(span, AttributeAWSServiceName) || IsKeyPresent(span, AttributeAWSOperationName)) + { + remoteService = NormalizeRemoteServiceName(span, GetRemoteService(span, AttributeAWSServiceName)); + remoteOperation = GetRemoteOperation(span, AttributeAWSOperationName); + } else if (IsKeyPresent(span, AttributeDbSystem) || IsKeyPresent(span, AttributeDbOperation) || IsKeyPresent(span, AttributeDbStatement)) diff --git a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsSpanProcessingUtil.cs b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsSpanProcessingUtil.cs index 19dfc329..782e56de 100644 --- a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsSpanProcessingUtil.cs +++ b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsSpanProcessingUtil.cs @@ -92,7 +92,8 @@ internal static string GetIngressOperation(Activity span) { operation = InternalOperation; } - else if (!IsValidOperation(span, operation)) + // TODO workaround for span.DisplayName + else if (!IsValidOperation(span, operation) || IsKeyPresent(span, AttributeUrlPath)) { operation = GenerateIngressOperation(span); } @@ -141,7 +142,8 @@ internal static bool IsKeyPresent(Activity span, string key) internal static bool IsAwsSDKSpan(Activity span) { // https://opentelemetry.io/docs/specs/semconv/cloud-providers/aws-sdk/ - return "aws-api".Equals((string?)span.GetTagItem(AttributeRpcSystem)); + // TODO workaround for AWS SDK span + return "aws-api".Equals((string?)span.GetTagItem(AttributeRpcSystem)) || ((string?)span.GetTagItem(AttributeAWSServiceName)) != null; } internal static bool ShouldGenerateServiceMetricAttributes(Activity span) @@ -273,6 +275,7 @@ public static bool isDBSpan(Activity span) public static bool isAwsSDKSpan(Activity span) { // https://opentelemetry.io/docs/specs/otel/trace/semantic_conventions/instrumentation/aws-sdk/#common-attributes - return span.GetTagItem(AttributeRpcSystem) == "aws-api"; + // TODO workaround for AWS SDK span + return span.GetTagItem(AttributeRpcSystem) == "aws-api" || ((string?)span.GetTagItem(AttributeAWSServiceName)) != null; } }