Skip to content

Commit fb0547a

Browse files
authored
Merge branch 'master' into antonpirker/python-skd-1.35.0
2 parents 99b5d8e + 9793b23 commit fb0547a

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

static/app/actionCreators/events.spec.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,23 @@ describe('Events ActionCreator', function () {
119119
})
120120
);
121121
});
122+
123+
it('spreads query extras', async function () {
124+
await doEventsRequest(api, {
125+
...opts,
126+
queryExtras: {useOnDemandMetrics: 'true'},
127+
partial: true,
128+
});
129+
130+
expect(mock).toHaveBeenLastCalledWith(
131+
'/organizations/org-slug/events-stats/',
132+
expect.objectContaining({
133+
query: expect.objectContaining({
134+
project: [project.id],
135+
environment: [],
136+
useOnDemandMetrics: 'true',
137+
}),
138+
})
139+
);
140+
});
122141
});

static/app/actionCreators/events.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ type Options = {
5454
start?: DateString;
5555
team?: Readonly<string | string[]>;
5656
topEvents?: number;
57-
useOnDemandMetrics?: boolean;
5857
withoutZerofill?: boolean;
5958
yAxis?: string | string[];
6059
};

static/app/views/alerts/rules/metric/details/metricChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ class MetricChart extends PureComponent<Props, State> {
577577
location,
578578
dataset,
579579
newAlertOrQuery: false,
580+
useOnDemandMetrics: isOnDemandAlert,
580581
});
581582

582583
return isCrashFreeAlert(dataset) ? (
@@ -617,7 +618,6 @@ class MetricChart extends PureComponent<Props, State> {
617618
partial={false}
618619
queryExtras={queryExtras}
619620
referrer="api.alerts.alert-rule-chart"
620-
useOnDemandMetrics={isOnDemandAlert}
621621
>
622622
{({loading, timeseriesData, comparisonTimeseriesData}) => (
623623
<Fragment>

static/app/views/alerts/rules/metric/utils/getMetricDatasetQueryExtras.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ export function getMetricDatasetQueryExtras({
1212
location,
1313
dataset,
1414
newAlertOrQuery,
15+
useOnDemandMetrics,
1516
}: {
1617
dataset: MetricRule['dataset'];
1718
newAlertOrQuery: boolean;
1819
organization: Organization;
1920
location?: Location;
21+
useOnDemandMetrics?: boolean;
2022
}) {
2123
const hasMetricDataset =
2224
hasOnDemandMetricAlertFeature(organization) ||
@@ -29,5 +31,9 @@ export function getMetricDatasetQueryExtras({
2931
? {dataset: getMEPAlertsDataset(dataset, newAlertOrQuery)}
3032
: {};
3133

34+
if (useOnDemandMetrics) {
35+
queryExtras.useOnDemandMetrics = 'true';
36+
}
37+
3238
return queryExtras;
3339
}

0 commit comments

Comments
 (0)