From 2eeea631c4ed1b9a9db3fdeebc2d2d4176d5823e Mon Sep 17 00:00:00 2001 From: "Eric J. Smith" Date: Thu, 31 Oct 2024 15:35:13 -0500 Subject: [PATCH] Ignore 90% of project config traces --- src/Exceptionless.Web/ApmExtensions.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Exceptionless.Web/ApmExtensions.cs b/src/Exceptionless.Web/ApmExtensions.cs index c17cd3da8..fd15c4fb0 100644 --- a/src/Exceptionless.Web/ApmExtensions.cs +++ b/src/Exceptionless.Web/ApmExtensions.cs @@ -94,6 +94,13 @@ public static IHostBuilder AddApm(this IHostBuilder builder, ApmConfig config) if (config.MinDurationMs > 0 && activity.Duration < TimeSpan.FromMilliseconds(config.MinDurationMs)) return false; + if (activity.GetTagItem("http.route") is string httpRoute) + { + // only capture 10% of config requests + if (httpRoute == "api/v2/projects/config") + return Random.Shared.Next(100) > 90; + } + if (activity is { DisplayName: "LLEN", Parent: null }) return false;