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

Unable to export traces to Jaeger .NET 7 #5998

Open
officialgio opened this issue Nov 22, 2024 · 3 comments
Open

Unable to export traces to Jaeger .NET 7 #5998

officialgio opened this issue Nov 22, 2024 · 3 comments
Labels
bug Something isn't working needs-triage New issues which have not been classified or triaged by a community member pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package

Comments

@officialgio
Copy link

Package

OpenTelemetry

Package Version

Package Name Version
OpenTelemetry 1.6.0
OpenTelemetry.Exporter.Jaeger 1.5.1
OpenTelemetry.Extensions.Hosting 1.6.0
OpenTelemetry.Exporter.Console 1.6.0
OpenTelemetry.Exporter.OpenTelemetryProtocol 1.6.0
OpenTelemetry.Instrumentation.AspNetCore 1.6.0
OpenTelemetry.Instrumentation.Http 1.6.0

Runtime Version

net7.0

Description

Description

I'm trying to export my service traces to Jaeger locally. Currently, I'm running my Jaeger docker container and my service locally on port 5007.

Steps to Reproduce

What I've Done So Far

  • Doubled checked container ports via .yml and docker ps
  • Exported my traces to console successfully.
  • I've used older packages to see if it will work, not much luck.
  • I've used AddOtlpExporter but still unable to get them to show up, I'm not sure If I'm doing the AddOtlpExporter correctly.
  • I've been trying to look further into the docs but I'm still unable to solve this issue.

Expected Result

Expected

I'm trying to hit HTTP request locally to my service in the hopes to see traces show up via: localhost:16686

Actual Result

No traces were exported.

Additional Context

Here are code snippets:

Startup.cs:

// Telemetry Tracing
var serviceSettings = Configuration.GetSection(nameof(ServiceSettings)).Get<ServiceSettings>();

services.AddOpenTelemetry()
    .WithTracing(tracing => tracing
        .SetResourceBuilder(ResourceBuilder.CreateDefault()
            .AddService(serviceName: serviceSettings.ServiceName))
        .AddSource(serviceSettings.ServiceName)
        .AddSource("MassTransit") // Replace with your service name
        .AddAspNetCoreInstrumentation()
        .AddHttpClientInstrumentation()
        .AddJaegerExporter(options =>
        {
            options.AgentHost = "localhost"; // Jaeger Agent hostname
            options.AgentPort = 6831; // Default Jaeger Agent port
        }));

docker-compose:

version: "3.8"

services:
  # ...

  jaeger:
    image: jaegertracing/all-in-one
    container_name: jaeger
    ports:
      - 5778:5778
      - 6831:6831/udp
      - 6832:6832/udp
      - 14250:14250
      - 14268:14268
      - 16686:16686 # to access jaeger UI

volumes:
  # ...

image

@officialgio officialgio added bug Something isn't working needs-triage New issues which have not been classified or triaged by a community member labels Nov 22, 2024
@github-actions github-actions bot added the pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package label Nov 22, 2024
@TimothyMothra
Copy link
Contributor

Hi @officialgio,
.NET 7 is out of support since May 2024, and the OpenTelemetry.Exporter.Jaeger has also been deprecated. I don't think anyone here would be able to provide support for either of those.

Here's some information about using the OpenTelemetryProtocol exporter with Jaeger:

@officialgio
Copy link
Author

Thank you for the reply, I've taken a look into the docs and the available samples. I've added the new code without using OpenTelemetry.Exporter.Jaeger as it is no longer in support. The samples and docs state to use AddOtlpExporter, but I'm still facing the same issue.

Code Snippet:

// Telemetry Tracing
var serviceSettings = Configuration.GetSection(nameof(ServiceSettings)).Get<ServiceSettings>();

services
    .AddOpenTelemetry()
    .ConfigureResource(resource => resource.AddService(serviceName: serviceSettings.ServiceName))
    .WithTracing(tracing => tracing
        .AddSource(serviceSettings.ServiceName)
        .AddSource("MassTransit")
        .AddHttpClientInstrumentation()
        .AddAspNetCoreInstrumentation()
        .AddOtlpExporter()
    );

After running the system locally and hit a POST the traces are visible through console but aren't exported to Jaeger which by default it will do according to this doc.

This is the docker image I am using:

  jaeger:
    image: jaegertracing/all-in-one:latest
    container_name: jaeger
    ports:
      - 5778:5778
      - 6831:6831/udp
      - 6832:6832/udp
      - 14250:14250
      - 14268:14268
      - 4317:4317
      - 16686:16686 # to access jaeger UI

@rajkumar-rangaraj
Copy link
Contributor

You may need to start Jaeger with OTLP receivers. Please check https://www.jaegertracing.io/docs/2.0/getting-started/?form=MG0AV3

As recommended earlier I encourage you to follow the getting-started-jaeger doc from this repo and get an understanding of the jaeger setup process. Then you could try with your solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage New issues which have not been classified or triaged by a community member pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package
Projects
None yet
Development

No branches or pull requests

3 participants