Skip to content

Commit 60a4819

Browse files
committed
Fix group by params.
1 parent fe65219 commit 60a4819

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/datasource.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,20 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
2525
const to = range!.to.valueOf();
2626

2727
const promises = options.targets.map(
28-
({ spaceId, roomId, contextId, nodes, groupBy, method, refId, dimensions, filterBy, filterValue, hide }) => {
28+
({
29+
spaceId,
30+
roomId,
31+
contextId,
32+
nodes,
33+
groupBy,
34+
method,
35+
refId,
36+
dimensions,
37+
filterBy,
38+
filterValue,
39+
group,
40+
hide,
41+
}) => {
2942
if (hide) {
3043
return null;
3144
}
@@ -48,6 +61,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
4861
nodes,
4962
contextId,
5063
groupBy,
64+
group,
5165
filterBy,
5266
filterValue,
5367
method,

src/shared/hooks/useGetChartData.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ export const useGetChartData = async ({
3636

3737
switch (groupBy) {
3838
case 'node':
39-
metrics = [{ aggregation: method, groupBy: ['node'], group_by_label: [] }];
39+
metrics = [{ aggregation: method, group_by: ['node'], group_by_label: [] }];
4040
break;
4141
case 'dimension':
4242
metrics = [{ group_by: ['dimension'], group_by_label: [], aggregation: method }];
4343
break;
4444
case 'instance':
45-
metrics = [{ aggregation: method, groupBy: ['instance'], group_by_label: [] }];
45+
metrics = [{ aggregation: method, group_by: ['instance'], group_by_label: [] }];
4646
break;
4747
default:
48-
metrics = [{ aggregation: method, groupBy: ['label'], group_by_label: [groupBy] }];
48+
metrics = [{ aggregation: method, group_by: ['label'], group_by_label: [groupBy] }];
4949
break;
5050
}
5151

0 commit comments

Comments
 (0)