From 3449a7469c0d6fda553a6bce56df6cf486858d7a Mon Sep 17 00:00:00 2001 From: John Kapantzakis Date: Fri, 31 Oct 2025 11:50:27 +0200 Subject: [PATCH 1/5] Add labels selector --- src/shared/hooks/useGetChartData.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shared/hooks/useGetChartData.ts b/src/shared/hooks/useGetChartData.ts index 775347a..7b918cc 100644 --- a/src/shared/hooks/useGetChartData.ts +++ b/src/shared/hooks/useGetChartData.ts @@ -83,6 +83,8 @@ export const useGetChartData = async ({ break; } + const labels = filterBy && filterValue ? [`${filterBy}:${filterValue}`] : ['*']; + return await Post({ path: `/v3/spaces/${spaceId}/rooms/${roomId}/data`, baseUrl, @@ -99,7 +101,7 @@ export const useGetChartData = async ({ nodes: ['*'], instances: ['*'], dimensions: ['*'], - labels: ['*'], + labels, }, aggregations: { metrics, From 5ce7b01ef13c86ec38411addc80acdd4d2ff90a2 Mon Sep 17 00:00:00 2001 From: John Kapantzakis Date: Fri, 31 Oct 2025 14:24:10 +0200 Subject: [PATCH 2/5] v3.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 45e0f59..71104ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "netdatacloud-netdata-datasource", - "version": "3.0.1", + "version": "3.0.2", "description": "netdata datasource plugin", "scripts": { "build": "webpack -c ./.config/webpack/webpack.config.ts --env production", From 984e55803bea988ba3a9797feaf67a7eaa79c832 Mon Sep 17 00:00:00 2001 From: John Kapantzakis Date: Fri, 31 Oct 2025 15:28:04 +0200 Subject: [PATCH 3/5] Include labels in scope --- src/shared/hooks/useGetChartData.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/shared/hooks/useGetChartData.ts b/src/shared/hooks/useGetChartData.ts index 7b918cc..01d2ac4 100644 --- a/src/shared/hooks/useGetChartData.ts +++ b/src/shared/hooks/useGetChartData.ts @@ -83,7 +83,9 @@ export const useGetChartData = async ({ break; } - const labels = filterBy && filterValue ? [`${filterBy}:${filterValue}`] : ['*']; + const defaultScopeValue = []; + const defaultSelectorValue = ['*']; + const labels = filterBy && filterValue ? [`${filterBy}:${filterValue}`] : null; return await Post({ path: `/v3/spaces/${spaceId}/rooms/${roomId}/data`, @@ -95,13 +97,14 @@ export const useGetChartData = async ({ contexts: [contextId], nodes, dimensions, + labels: labels : defaultScopeValue, }, selectors: { contexts: ['*'], nodes: ['*'], instances: ['*'], dimensions: ['*'], - labels, + labels: labels || defaultSelectorValue, }, aggregations: { metrics, From e44ab6f4fa3365517ddc897c064eb2104520fd42 Mon Sep 17 00:00:00 2001 From: John Kapantzakis Date: Fri, 31 Oct 2025 15:29:43 +0200 Subject: [PATCH 4/5] fixup! Include labels in scope --- src/shared/hooks/useGetChartData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/hooks/useGetChartData.ts b/src/shared/hooks/useGetChartData.ts index 01d2ac4..bf77abb 100644 --- a/src/shared/hooks/useGetChartData.ts +++ b/src/shared/hooks/useGetChartData.ts @@ -97,7 +97,7 @@ export const useGetChartData = async ({ contexts: [contextId], nodes, dimensions, - labels: labels : defaultScopeValue, + labels: labels || defaultScopeValue, }, selectors: { contexts: ['*'], From 4ce305e8604b0736d0a16e993e2fed28fe77d4be Mon Sep 17 00:00:00 2001 From: John Kapantzakis Date: Fri, 31 Oct 2025 15:35:19 +0200 Subject: [PATCH 5/5] Add dimensions to selector --- src/shared/hooks/useGetChartData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/hooks/useGetChartData.ts b/src/shared/hooks/useGetChartData.ts index bf77abb..d8409f2 100644 --- a/src/shared/hooks/useGetChartData.ts +++ b/src/shared/hooks/useGetChartData.ts @@ -103,7 +103,7 @@ export const useGetChartData = async ({ contexts: ['*'], nodes: ['*'], instances: ['*'], - dimensions: ['*'], + dimensions: dimensions.length ? dimensions : defaultSelectorValue, labels: labels || defaultSelectorValue, }, aggregations: {