From d119a56673a95b8af60bae1e7b323fe7a27f5209 Mon Sep 17 00:00:00 2001 From: rizkybiz Date: Wed, 28 Apr 2021 15:58:45 -0400 Subject: [PATCH 01/10] Added tslib to resolve some linting issues --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 63a8db1..346c116 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "author": "Circonus", "license": "BSD-3-clause", "dependencies": { - "memoizee": "^0.4.14" + "memoizee": "^0.4.14", + "tslib": "^2.2.0" }, "devDependencies": { "@grafana/data": "^7.2.0", From 3424439f490294811fe1e237f51ac5df0d88049f Mon Sep 17 00:00:00 2001 From: rizkybiz Date: Wed, 28 Apr 2021 15:59:40 -0400 Subject: [PATCH 02/10] Adding .prettierrc.js because the grafana toolkit implemented it --- .prettierrc.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .prettierrc.js diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..c14684b --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,3 @@ +module.exports = { + ...require('@grafana/toolkit/src/config/prettier.plugin.config.json'), +}; From 14de46b5baf28e898d19216c7415ca0ad56e0e97 Mon Sep 17 00:00:00 2001 From: rizkybiz Date: Wed, 28 Apr 2021 16:01:18 -0400 Subject: [PATCH 03/10] updated gitignore with some IDE linting and testing artifact ignores --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 6b97c6e..600a192 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ npm-debug.log .DS_Store *.swp package-lock.json +yarn.lock +coverage +jest* \ No newline at end of file From 41747f37ed64011e426b71903812fde68b3902fc Mon Sep 17 00:00:00 2001 From: rizkybiz Date: Wed, 28 Apr 2021 16:01:47 -0400 Subject: [PATCH 04/10] Adding .eslintrc.json, grafana toolkit now uses eslint instead of tslint --- .eslintrc.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..31cb22e --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,12 @@ +{ + "root": true, + "parser": "@typescript-eslint/parser", + "plugins": ["@typescript-eslint"], + "extends": ["@grafana/eslint-config"], + "parserOptions": { + "tsconfigRootDir": "./" + }, + "rules": { + "strict": "off" + } +} \ No newline at end of file From b67d364827ef7bcf999320e57aa287cd2571bb68 Mon Sep 17 00:00:00 2001 From: rizkybiz Date: Wed, 28 Apr 2021 16:14:27 -0400 Subject: [PATCH 05/10] resolving cherry-pick conflicts --- src/datasource.ts | 35 ++++++++++------------------------- src/irondb_query.ts | 20 ++++++++++++++++---- src/query_ctrl.ts | 13 ++++++++++--- 3 files changed, 36 insertions(+), 32 deletions(-) diff --git a/src/datasource.ts b/src/datasource.ts index 9b0b168..b64a7e1 100644 --- a/src/datasource.ts +++ b/src/datasource.ts @@ -7,26 +7,23 @@ import memoize from 'memoizee'; import { Memoized } from 'memoizee'; import { metaInterpolateLabel, - decodeNameAndTags, isStatsdCounter, taglessName, taglessNameAndTags, decodeTag, + encodeTag, splitTags, mergeTags, TagSet, decodeTagsInLabel, + SegmentType, } from './irondb_query'; import { ArrayVector, DataFrame, - Field, FieldType, - formatLabels, - Labels, MutableField, - ScopedVars, TIME_SERIES_TIME_FIELD_NAME, TIME_SERIES_VALUE_FIELD_NAME, DataSourceApi, @@ -39,15 +36,11 @@ import { AnnotationQueryRequest, AnnotationEvent, LoadingState, - TimeSeries, - isTableData, } from '@grafana/data'; import * as Mustache from 'mustache'; const log = Log('IrondbDatasource'); -import { map } from 'rxjs/operators'; - const DURATION_UNITS_DEFAULT = 's'; const DURATION_UNITS = { ms: 1, @@ -477,20 +470,6 @@ export default class IrondbDatasource extends DataSourceApi 0) { - q = q + ','; - } - q = q + value[i]; - i = i + 1; - } - return q; } // This is used by the Dashboard Admin Variable Setup function @@ -1328,7 +1307,7 @@ export default class IrondbDatasource extends DataSourceApi { @@ -1637,7 +1616,13 @@ export default class IrondbDatasource extends DataSourceApi Date: Wed, 28 Apr 2021 16:09:40 -0400 Subject: [PATCH 06/10] resolving more cherry-pick conflicts --- src/datasource.ts | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/datasource.ts b/src/datasource.ts index b64a7e1..9036285 100644 --- a/src/datasource.ts +++ b/src/datasource.ts @@ -304,7 +304,7 @@ export default class IrondbDatasource extends DataSourceApi { return _.map(results.data, (result) => { - return { value: result }; + return { value: decodeTag(result) }; }); }); } else { @@ -776,7 +785,8 @@ export default class IrondbDatasource extends DataSourceApi Date: Thu, 29 Apr 2021 12:44:58 -0400 Subject: [PATCH 07/10] Adding Riley's changes to both tag related lookup functions --- src/datasource.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datasource.ts b/src/datasource.ts index 9036285..7505eba 100644 --- a/src/datasource.ts +++ b/src/datasource.ts @@ -534,7 +534,7 @@ export default class IrondbDatasource extends DataSourceApi Date: Tue, 11 May 2021 14:50:51 -0400 Subject: [PATCH 08/10] removing some debug code --- src/datasource.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datasource.ts b/src/datasource.ts index 7505eba..8106d15 100644 --- a/src/datasource.ts +++ b/src/datasource.ts @@ -389,7 +389,7 @@ export default class IrondbDatasource extends DataSourceApi Date: Tue, 11 May 2021 14:58:15 -0400 Subject: [PATCH 09/10] updated changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb3d65b..08295ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ +## 0.9.5 + +* Fix base64 encoding and decoding of tag values in variables +* Made returned tag values respect activity windows + ## 0.9.4 * Fix labels for untagged metrics From dc7bbb7d0dd50a05f141544acf4ea5d87dd1559c Mon Sep 17 00:00:00 2001 From: rizkybiz Date: Tue, 11 May 2021 15:51:17 -0400 Subject: [PATCH 10/10] adding \n to end of .gitignore at githubs request --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 600a192..2733e78 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ npm-debug.log package-lock.json yarn.lock coverage -jest* \ No newline at end of file +jest*