Когда приложение ASP.NET запускается, некоторые журналы отправляются, и они видны в NewRelic. Но когда приложение обрабатывает HTTP -запрос, журналы, отправляемые через ilogger , никогда не появляются в NewRelic. ConsoLeeExporter работает безупречно. Я могу видеть трассировки нормально. В Newrelic Ничто не появляется в коллекции nrintegrationError .
Что я делаю не так? Кажется, новична показывает только журналы, которые не коррелируют со следами и пролетами.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; // Using Http/Protobuf
}), 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;
}));
Подробнее здесь: https://stackoverflow.com/questions/790 ... try-dotnet