From 503314b8deabd129e94599c5f3fb36b127d0da6a Mon Sep 17 00:00:00 2001 From: Kev Date: Thu, 1 Aug 2024 16:45:50 -0400 Subject: [PATCH] Exclude AM3 org, also include segment span in the count --- src/sentry/ingest/consumer/processors.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sentry/ingest/consumer/processors.py b/src/sentry/ingest/consumer/processors.py index 621826af990feb..a48ca6d9907d32 100644 --- a/src/sentry/ingest/consumer/processors.py +++ b/src/sentry/ingest/consumer/processors.py @@ -332,8 +332,12 @@ def collect_span_metrics( project: Project, data: MutableMapping[str, Any], ): - if not features.has("organizations:dynamic-sampling", project.organization): - amount = len(data.get("spans", [])) + if not features.has( + "organizations:dynamic-sampling", project.organization + ) and not features.has("organizations:am3_tier", project.organization): + amount = ( + len(data.get("spans", [])) + 1 + ) # Segment spans also get added to the total span count. metrics.incr( "event.save_event.unsampled.spans.count", amount=amount,