Skip to content

Commit 90be95d

Browse files
authored
Merge pull request #49 from netdata/fix/data-params
Fix group by params.
2 parents fe65219 + a44a9a3 commit 90be95d

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "netdatacloud-netdata-datasource",
3-
"version": "3.0.3",
3+
"version": "3.0.4",
44
"description": "netdata datasource plugin",
55
"scripts": {
66
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",

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)