Skip to content

Commit

Permalink
Ignore 90% of project config traces
Browse files Browse the repository at this point in the history
  • Loading branch information
ejsmith committed Oct 31, 2024
1 parent 8ca4f2e commit 2eeea63
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Exceptionless.Web/ApmExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2eeea63

Please sign in to comment.