We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm configuring an Action in .NET 8 setting service name:
Action<ResourceBuilder> configureResource = r => r.AddService( serviceName: "xpto", serviceVersion: settings.ServiceVersion, serviceInstanceId: Environment.MachineName);
and I'm registering here
serviceCollection. .AddOpenTelemetry() .ConfigureResource(configureResource) .WithTracing(builder => { builder .AddNpgsql() .AddEntityFrameworkCoreInstrumentation(options => { options.EnrichWithIDbCommand = (activity, command) => { //var stateDisplayName = $"{command.CommandType} main"; var stateDisplayName = command.GetType().FullName; activity.DisplayName = stateDisplayName!; activity.SetTag("db.name", stateDisplayName); }; }) .AddAspNetCoreInstrumentation(opts => { opts.EnrichWithHttpRequest = (a, r) => a?.AddTag("env", environmentName); opts.RecordException = true; }) .AddOtlpExporter(config => { config.Endpoint = new Uri(settings.Exporter.Endpoint); }) .AddConsoleExporter(); }) .WithMetrics(builder => { builder .AddMeter(metrics.Name) .AddRuntimeInstrumentation() .AddAspNetCoreInstrumentation() .AddOtlpExporter(config => { config.Endpoint = new Uri(settings.Exporter.Endpoint ?? string.Empty); }) .AddConsoleExporter(); });
But, when I see the logs, the service.name is unknown_service
"resources": { "service.name": "unknown_service:dotnet", "telemetry.sdk.language": "dotnet", "telemetry.sdk.name": "serilog", "telemetry.sdk.version": "1.2.0" },
How Can I set the service name correctly ?
Thanks !
The text was updated successfully, but these errors were encountered:
@jmurrayrs I think in your code the Action was applied to metrics and traces, but not logs.
opentelemetry-dotnet/docs/logs/customizing-the-sdk/Program.cs
Line 13 in 36ceb2e
Sorry, something went wrong.
Feel free to reopen the issue if #5551 (comment) didn't help to solve the problem.
No branches or pull requests
I'm configuring an Action in .NET 8 setting service name:
and I'm registering here
But, when I see the logs, the service.name is unknown_service
How Can I set the service name correctly ?
Thanks !
The text was updated successfully, but these errors were encountered: