From 5ec3b84be6955963cda92ab209510ad01d4dda90 Mon Sep 17 00:00:00 2001 From: Are Almaas Date: Thu, 24 Oct 2024 16:05:28 +0200 Subject: [PATCH] feat(utils): configure open telemetry tracing for masstransit in aspnet package (#1344) ## Description ## Related Issue(s) - #1262 ## Verification - [ ] **Your** code builds clean without any errors or warnings - [ ] Manual testing done (required) - [ ] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Documentation - [ ] Documentation is updated (either in `docs`-directory, Altinnpedia or a separate linked PR in [altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if applicable) --------- Co-authored-by: Magnus Sandgren <5285192+MagnusSandgren@users.noreply.github.com> --- src/Digdir.Library.Utils.AspNet/AspNetUtilitiesExtensions.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Digdir.Library.Utils.AspNet/AspNetUtilitiesExtensions.cs b/src/Digdir.Library.Utils.AspNet/AspNetUtilitiesExtensions.cs index dd108c44b..0728a0bee 100644 --- a/src/Digdir.Library.Utils.AspNet/AspNetUtilitiesExtensions.cs +++ b/src/Digdir.Library.Utils.AspNet/AspNetUtilitiesExtensions.cs @@ -15,6 +15,8 @@ namespace Digdir.Library.Utils.AspNet; public static class AspNetUtilitiesExtensions { + private const string MassTransitSource = "MassTransit"; + public static IServiceCollection AddAspNetHealthChecks(this IServiceCollection services, Action? configure = null) { var optionsBuilder = services.AddOptions(); @@ -67,6 +69,7 @@ public static WebApplicationBuilder ConfigureTelemetry(this WebApplicationBuilde tracing.AddHttpClientInstrumentation(); tracing.AddNpgsql(); + tracing.AddSource(MassTransitSource); // MassTransit ActivitySource }) .WithMetrics(metrics => {