summaryrefslogtreecommitdiffstats
path: root/web/api/formatters/json/json.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-13 17:16:02 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-13 17:16:02 +0000
commit396c327fe40b1db11fc204d7ae7ace84503de681 (patch)
tree6718eb5d5dcf3c6e3c93e32ac6ac9a857f6ca56e /web/api/formatters/json/json.c
parentReleasing debian version 1.38.0-1. (diff)
downloadnetdata-396c327fe40b1db11fc204d7ae7ace84503de681.tar.xz
netdata-396c327fe40b1db11fc204d7ae7ace84503de681.zip
Merging upstream version 1.38.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/api/formatters/json/json.c')
-rw-r--r--web/api/formatters/json/json.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/web/api/formatters/json/json.c b/web/api/formatters/json/json.c
index 608150cba..3cad3e914 100644
--- a/web/api/formatters/json/json.c
+++ b/web/api/formatters/json/json.c
@@ -111,6 +111,7 @@ void rrdr2json(RRDR *r, BUFFER *wb, RRDR_OPTIONS options, int datatable) {
// print the header lines
for(c = 0, i = 0; c < used ; c++) {
if(unlikely(r->od[c] & RRDR_DIMENSION_HIDDEN)) continue;
+ if(unlikely(!(r->od[c] & RRDR_DIMENSION_QUERIED))) continue;
if(unlikely((options & RRDR_OPTION_NONZERO) && !(r->od[c] & RRDR_DIMENSION_NONZERO))) continue;
buffer_fast_strcat(wb, pre_label, pre_label_len);
@@ -180,7 +181,7 @@ void rrdr2json(RRDR *r, BUFFER *wb, RRDR_OPTIONS options, int datatable) {
// google supports one annotation per row
int annotation_found = 0;
for(c = 0; c < used ; c++) {
- if(unlikely(!(r->od[c] & RRDR_DIMENSION_SELECTED))) continue;
+ if(unlikely(!(r->od[c] & RRDR_DIMENSION_QUERIED))) continue;
if(unlikely(co[c] & RRDR_VALUE_RESET)) {
buffer_fast_strcat(wb, overflow_annotation, overflow_annotation_len);
@@ -215,6 +216,8 @@ void rrdr2json(RRDR *r, BUFFER *wb, RRDR_OPTIONS options, int datatable) {
if(unlikely(options & RRDR_OPTION_PERCENTAGE)) {
total = 0;
for(c = 0; c < used ;c++) {
+ if(unlikely(!(r->od[c] & RRDR_DIMENSION_QUERIED))) continue;
+
NETDATA_DOUBLE n;
if(unlikely(options & RRDR_OPTION_INTERNAL_AR))
n = ar[c];
@@ -234,6 +237,7 @@ void rrdr2json(RRDR *r, BUFFER *wb, RRDR_OPTIONS options, int datatable) {
// for each dimension
for(c = 0; c < used ;c++) {
if(unlikely(r->od[c] & RRDR_DIMENSION_HIDDEN)) continue;
+ if(unlikely(!(r->od[c] & RRDR_DIMENSION_QUERIED))) continue;
if(unlikely((options & RRDR_OPTION_NONZERO) && !(r->od[c] & RRDR_DIMENSION_NONZERO))) continue;
NETDATA_DOUBLE n;