From 15f217e537dd6bef7a9d74fad6811e4b76fe9a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Petran=C3=ADk?= Date: Mon, 17 Jun 2024 18:03:41 +0200 Subject: [PATCH] Add Warning QueryResultMetaNotice to data frame produced by datasource.ts, when rowCount is higher/equal 200 --- bitmovin-analytics-datasource/src/datasource.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bitmovin-analytics-datasource/src/datasource.ts b/bitmovin-analytics-datasource/src/datasource.ts index 6a3caac..2544d83 100644 --- a/bitmovin-analytics-datasource/src/datasource.ts +++ b/bitmovin-analytics-datasource/src/datasource.ts @@ -6,6 +6,7 @@ import { DataSourceApi, DataSourceInstanceSettings, Field, + QueryResultMetaNotice, } from '@grafana/data'; import { getBackendSrv } from '@grafana/runtime'; import { filter } from 'lodash'; @@ -99,6 +100,7 @@ export class DataSource extends DataSourceApi = response.data.data.result.columnLabels; const fields: Array> = []; @@ -125,9 +127,20 @@ export class DataSource extends DataSourceApi= 200) { + metaNotices = [ + { + severity: 'warning', + text: 'Your request reached the max row limit of the API. You might see incomplete data. This problem might be caused by the use of high cardinality columns in group by, too small interval, or too big of a time range.', + }, + ]; + } + return createDataFrame({ name: target.aliasBy, fields: fields, + meta: { notices: metaNotices }, }); });