Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS X-Ray traces without span info #1930

Open
jphjsoares opened this issue Jun 27, 2024 · 0 comments
Open

AWS X-Ray traces without span info #1930

jphjsoares opened this issue Jun 27, 2024 · 0 comments
Labels
bug Something isn't working comp:extensions.aws Things related to OpenTelemetry.Extensions.AWS

Comments

@jphjsoares
Copy link

Component

OpenTelemetry.Extensions.AWS

Package Version

Package Name Version
OpenTelemetry 1.9.0
OpenTelemetry.Contrib.Extensions.AWSXRay 1.2.0
OpenTelemetry.Instrumentation.AspNetCore 1.8.1

Runtime Version

net8.0

Description

I currently have an application that is collecting metrics and traces using Open Telemetry. Locally, I have an Aspire board that shows me the correct traces with the correct span info. I'm trying to see the span info of my traces on AWS.

Steps to Reproduce

This is a snippet of the code I'm using for this example:

(...)
var builder = WebApplication.CreateBuilder(args);
ActivitySource activitySource = new("OTEL");
builder.Services.AddOpenTelemetry()
        .ConfigureResource(resource => resource
            .AddService(
                serviceName: builder.Environment.ApplicationName,
                serviceVersion: appVersion)
            .AddDetector(new ContainerResourceDetector()))
        .WithMetrics(metrics => metrics
            .AddAspNetCoreInstrumentation()
            .AddOtlpExporter()
        .WithTracing(tracing => tracing
            .AddXRayTraceId()
            .AddAWSInstrumentation()
            .AddAspNetCoreInstrumentation()
            .AddSource("OTEL")
            .AddOtlpExporter()
            .AddConsoleExporter());

Sdk.SetDefaultTextMapPropagator(new AWSXRayPropagator());

(...)

app.MapGet("/", (HttpContext context) =>
{
  using var slow = activitySource.StartActivity("Slow span", ActivityKind.Server);
  slow?.SetTag("type", "slow");
  Thread.Sleep(500);

  context.Response.WriteAsync($"Hello World!");

  using var fast = activitySource.StartActivity("Fast span", ActivityKind.Server);
  fast?.SetTag("type", "fast");
  Thread.Sleep(100);
});

Expected Result

I was expecting something similar to what my aspire board is showing, but on AWS side:

image
(Note that the delays here were different from the following evidence)

As seen above, the aspire board is showing me the GET /, Fastttt and the Slowwww info.

Actual Result

When testing it in AWS, even though the traces are received and so is the metadata, there is no span info displayed on the waterfall chart. Not even the response code is showing:

image

image

And a snippet of the corresponding metadata:

{
  "default": {
    (...)
    "url.scheme": "http",
    "otel.resource.service.name": "xxxx",
    "otel.resource.telemetry.sdk.version": "1.9.0",
    "url.path": "/",
    "http.request.method": "GET",
    "http.route": "/",
    "http.response.status_code": 200,
    "otel.resource.telemetry.sdk.language": "dotnet"
  }
}

Additional Context

No response

@jphjsoares jphjsoares added the bug Something isn't working label Jun 27, 2024
@github-actions github-actions bot added the comp:extensions.aws Things related to OpenTelemetry.Extensions.AWS label Jun 27, 2024
@jphjsoares jphjsoares changed the title AWSX-Ray traces without span info AWS X-Ray traces without span info Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working comp:extensions.aws Things related to OpenTelemetry.Extensions.AWS
Projects
None yet
Development

No branches or pull requests

1 participant