Skip to content

Commit

Permalink
yayyay
Browse files Browse the repository at this point in the history
  • Loading branch information
arealmaas committed Dec 10, 2024
1 parent d101149 commit ad6852e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Digdir.Library.Utils.AspNet/AspNetUtilitiesExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ public static WebApplicationBuilder ConfigureTelemetry(
configure?.Invoke(settings, builder.Configuration);

Console.WriteLine($"[OpenTelemetry] Configuring telemetry for service: {settings.ServiceName}");
foreach (var attr in settings.ResourceAttributes)
{
Console.WriteLine($"[OpenTelemetry] Resource attribute: {attr.Key}={attr.Value}");
}

var telemetryBuilder = builder.Services.AddOpenTelemetry()
.ConfigureResource(resource =>
Expand All @@ -84,6 +80,7 @@ public static WebApplicationBuilder ConfigureTelemetry(
{
if (!string.IsNullOrEmpty(key))
{
Console.WriteLine($"[OpenTelemetry] Resource attribute: {key}={attributes[key]}");
resourceBuilder.AddAttributes(new[] { new KeyValuePair<string, object>(key, attributes[key] ?? string.Empty) });
}
}
Expand Down

0 comments on commit ad6852e

Please sign in to comment.