Skip to content

Commit

Permalink
Add dockerfile and fixed some issues. (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
vastin authored Jun 27, 2024
1 parent 67cd5c7 commit 04e0f09
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Dockerfile.linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM busybox

COPY OpenTelemetryDistribution /autoinstrumentation
5 changes: 5 additions & 0 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022

COPY OpenTelemetryDistribution /autoinstrumentation

USER ContainerAdministrator
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Check warning on line 279 in src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsSpanProcessingUtil.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Possible unintended reference comparison; to get a value comparison, cast the left hand side to type 'string'

Check warning on line 279 in src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsSpanProcessingUtil.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Possible unintended reference comparison; to get a value comparison, cast the left hand side to type 'string'

Check warning on line 279 in src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsSpanProcessingUtil.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Possible unintended reference comparison; to get a value comparison, cast the left hand side to type 'string'
}
}

0 comments on commit 04e0f09

Please sign in to comment.