-
When the application is starting up (asp.net), some logs are sent and they are visible in NewRelic. But when the application handles an http request, the logs sent through ILogger never appear in NewRelic. I have the OTEL_DIAGNOSTICS.json file, but no errors are written. ConsoleExporter works flawlessly. I can see traces normally. In NewRelic nothing apeears in NrIntegrationError collection. What am I doing wrong? It seems NewRelic only shows logs that are not correlated with traces and spans. builder.Services.AddOpenTelemetry()
.ConfigureResource(builder => builder.AddService(Otel.ServiceName, serviceVersion: Otel.ServiceVersion))
.WithLogging(logging => logging
.AddConsoleExporter()
.AddOtlpExporter(otlp =>
{
otlp.Endpoint = new Uri($"{_otelEndpoint}/v1/logs");
otlp.Headers = $"api-key={_otelApiKey}";
otlp.Protocol = _otelProtocol;
}), options =>
{
options.IncludeFormattedMessage = true;
options.IncludeScopes = true;
options.ParseStateValues = true;
})
.WithTracing(tracing => tracing
.AddSource(Otel.ServiceName)
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddRedisInstrumentation()
.AddAWSInstrumentation()
.AddOtlpExporter(options =>
{
options.Endpoint = new Uri($"{_otelEndpoint}/v1/traces");
options.Headers = $"api-key={_otelApiKey}";
options.Protocol = _otelProtocol;
}))
.WithMetrics(metrics => metrics
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddOtlpExporter(options =>
{
options.Endpoint = new Uri($"{_otelEndpoint}/v1/metrics");
options.Headers = $"api-key={_otelApiKey}";
options.Protocol = _otelProtocol;
})); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @rasert, Is there a specific getting started guide you're following? I'm not familiar with NewRelic, but they have some getting started resources here: https://github.com/newrelic/newrelic-opentelemetry-examples/tree/main/getting-started-guides/dotnet You mentioned the ConsoleExporter is working flawlessly. That tells me that the OpenTelemetry SDK was configured correctly. Since your issue is specific to NewRelic you may need to reach out through their support channels to get some help. |
Beta Was this translation helpful? Give feedback.
-
@rasert I saw you had posted this question on stack overflow. I answered it there a couple days ago. https://stackoverflow.com/questions/79064116/unable-to-see-logs-in-newrelic-using-opentelemetry-dotnet/79071559#79071559 |
Beta Was this translation helpful? Give feedback.
@rasert I saw you had posted this question on stack overflow. I answered it there a couple days ago. https://stackoverflow.com/questions/79064116/unable-to-see-logs-in-newrelic-using-opentelemetry-dotnet/79071559#79071559