Код: Выделить всё
using OpenTelemetry;
using OpenTelemetry.Trace;
var Builder = WebApplication.CreateBuilder(args);
Builder.Logging.SetMinimumLevel(LogLevel.Warning);
// Add services to the container.
_ = Sdk
.CreateTracerProviderBuilder()
.AddAspNetCoreInstrumentation()
.AddConsoleExporter()
.Build();
Builder.Services.AddControllers();
var App = Builder.Build();
// Configure the HTTP request pipeline.
App.MapControllers();
App.Run();
Код: Выделить всё
Activity.TraceId: 1d2d6b56be7a8051011388a35cf5f993
Activity.SpanId: 6a3ada20893b840c
Activity.TraceFlags: Recorded
Activity.DisplayName: GET WeatherForecast
Activity.Kind: Server
Activity.StartTime: 2024-12-03T12:26:43.2111251Z
Activity.Duration: 00:00:00.0670580
Activity.Tags:
server.address: localhost
server.port: 5214
http.request.method: GET
url.scheme: http
url.path: /WeatherForecast
network.protocol.version: 1.1
user_agent.original: PostmanRuntime/7.43.0
http.route: WeatherForecast
http.response.status_code: 200
Instrumentation scope (ActivitySource):
Name: Microsoft.AspNetCore
Resource associated with Activity:
telemetry.sdk.name: opentelemetry
telemetry.sdk.language: dotnet
telemetry.sdk.version: 1.10.0
service.name: unknown_service:Test.Asp.Net
Подробнее здесь: https://stackoverflow.com/questions/792 ... as-no-logs