From c429213a5253f1e48a7f2a3301bd0411fef4e3ae Mon Sep 17 00:00:00 2001 From: Ogi <86684834+obostjancic@users.noreply.github.com> Date: Thu, 20 Jul 2023 14:40:28 +0200 Subject: [PATCH] use_on_demand_metrics --- src/sentry/api/endpoints/organization_events_stats.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sentry/api/endpoints/organization_events_stats.py b/src/sentry/api/endpoints/organization_events_stats.py index 027222d68b7e8b..d2938accc2f19d 100644 --- a/src/sentry/api/endpoints/organization_events_stats.py +++ b/src/sentry/api/endpoints/organization_events_stats.py @@ -183,6 +183,8 @@ def get(self, request: Request, organization: Organization) -> Response: allow_metric_aggregates = request.GET.get("preventMetricAggregates") != "1" sentry_sdk.set_tag("performance.metrics_enhanced", metrics_enhanced) + use_on_demand_metrics = request.GET.get("useOnDemandMetrics") + def get_event_stats( query_columns: Sequence[str], query: str, @@ -218,9 +220,8 @@ def get_event_stats( allow_metric_aggregates=allow_metric_aggregates, has_metrics=use_metrics, use_metrics_layer=batch_features.get("organizations:use-metrics-layer", False), - on_demand_metrics_enabled=batch_features.get( - "organizations:on-demand-metrics-extraction", False - ), + on_demand_metrics_enabled=use_on_demand_metrics + and batch_features.get("organizations:on-demand-metrics-extraction", False), ) try: