Hello, I’m working with SigNoz to collect my project’s trace, metrics, and logs data. I’ve set it u...
p
Hello, I’m working with SigNoz to collect my project’s trace, metrics, and logs data. I’ve set it up as self-hosted, meaning it’s running on a Linux server. In my project, I’m collecting the data and sending it to port 4317 of that Linux server. However, the problem is that I can only see trace data. The logs and metrics are not visible. Could you please help me resolve this issue? Thank you! This is the code:
Copy code
var resourceBuilder = ResourceBuilder.CreateDefault().AddService(".Net Log Service");
builder.Logging.AddOpenTelemetry(logging=>
            {
             logging.IncludeScopes = true;
             logging.SetResourceBuilder(resourceBuilder)
                         .AddOtlpExporter(options => {
                                  options.Endpoint = otlpEntpoint;
                                  options.Protocols = OtlpExportProtocols.Grpc;
                         });
            });

       builder.Services.AddOpenTelemetry()
            .ConfigureResource(resource =>
            {
                resource
                    .AddService(serviceName)
                    .AddAttributes(new[]
                    {
                        new KeyValuePair<string, object>("service.version",
                            Assembly.GetExecutingAssembly().GetName().Version!.ToString())
                    });
            })
            .WithTracing(tracing =>
                tracing
                    .AddAspNetCoreInstrumentation()
                    .AddGrpcClientInstrumentation()
                    .AddHttpClientInstrumentation()
                    .AddNpgsql()
                    .AddRedisInstrumentation()
                        // .AddConsoleExporter()
                        .AddOtlpExporter(options => {
                            options.Endpoint = otlpEndpoint;
                            options.Protocol = OpenTelemetry.Exporter.OtlpExportProtocol.Grpc;
                        })
            )
            .WithMetrics(metrics =>
                metrics
                    .AddAspNetCoreInstrumentation()
                    .AddHttpClientInstrumentation()
                    // Metrics provides by <http://ASP.NET|ASP.NET>
                    .AddMeter("Microsoft.AspNetCore.Hosting")
                    .AddMeter("Microsoft.AspNetCore.Server.Kestrel")
                    .AddMeter(ApplicationDiagnostics.Meter.Name)
                    .AddConsoleExporter()
                        .AddOtlpExporter(options => {
                            options.Endpoint = otlpEndpoint;
                            options.Protocol = OpenTelemetry.Exporter.OtlpExportProtocol.Grpc;
                        })
            );