@perses-dev/prometheus-plugin 0.55.0 → 0.57.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mf/js/Prometheus.2bb892ab.js +6 -0
- package/__mf/js/async/1233.0ab88b51.js +1 -0
- package/__mf/js/async/1324.ce01eced.js +1 -0
- package/__mf/js/async/1432.0c3e4ed0.js +1 -0
- package/__mf/js/async/1490.7e5068f1.js +22 -0
- package/__mf/js/async/1605.dc180cb8.js +110 -0
- package/__mf/js/async/1616.7587ce79.js +1 -0
- package/__mf/js/async/1728.af16c4ec.js +1 -0
- package/__mf/js/async/1969.372d36b8.js +1 -0
- package/__mf/js/async/2043.d0fbb886.js +2 -0
- package/__mf/js/async/2186.e58838a5.js +38 -0
- package/__mf/js/async/2506.1e336b3b.js +1 -0
- package/__mf/js/async/2984.7182c2f5.js +1 -0
- package/__mf/js/async/2999.1d8347df.js +1 -0
- package/__mf/js/async/3184.6b4ad42e.js +1 -0
- package/__mf/js/async/3664.ba8b26b6.js +2 -0
- package/__mf/js/async/392.7cda691a.js +2 -0
- package/__mf/js/async/3963.5fef6ffb.js +1 -0
- package/__mf/js/async/3996.69a9c1dc.js +1 -0
- package/__mf/js/async/{1964.1d168a86.js → 4121.828d661d.js} +2 -2
- package/__mf/js/async/4626.173e602a.js +1 -0
- package/__mf/js/async/4987.c12b89cb.js +1 -0
- package/__mf/js/async/{8930.700a5439.js → 5002.e4f54e8e.js} +1 -1
- package/__mf/js/async/5071.e1c33fa7.js +1 -0
- package/__mf/js/async/529.2303b01b.js +1 -0
- package/__mf/js/async/5440.c13c3533.js +2 -0
- package/__mf/js/async/5501.6166367c.js +2 -0
- package/__mf/js/async/{5214.0fca84ed.js → 5587.4d72fc35.js} +1 -1
- package/__mf/js/async/5763.4ba478ff.js +1 -0
- package/__mf/js/async/5922.d1619ac1.js +1 -0
- package/__mf/js/async/6149.19799c37.js +7 -0
- package/__mf/js/async/6274.478a68f8.js +2 -0
- package/__mf/js/async/6283.181cb622.js +2 -0
- package/__mf/js/async/6969.b959b6f8.js +1 -0
- package/__mf/js/async/{4062.06f48b93.js → 7177.205c9aaf.js} +1 -1
- package/__mf/js/async/7192.d835931b.js +1 -0
- package/__mf/js/async/7894.9c5245d7.js +1 -0
- package/__mf/js/async/7968.6ac0ce96.js +1 -0
- package/__mf/js/async/7978.9532d5b8.js +1 -0
- package/__mf/js/async/8356.789e1dfb.js +1 -0
- package/__mf/js/async/8470.9b14a625.js +2 -0
- package/__mf/js/async/873.448eab23.js +1 -0
- package/__mf/js/async/8888.59eb50a2.js +1 -0
- package/__mf/js/async/9020.c19782f1.js +1 -0
- package/__mf/js/async/9184.43a8d927.js +1 -0
- package/__mf/js/async/9235.36c3cd8c.js +1 -0
- package/__mf/js/async/9351.715f25c3.js +1 -0
- package/__mf/js/async/941.53b13124.js +2 -0
- package/__mf/js/async/9518.38e38a33.js +1 -0
- package/__mf/js/async/9588.9081c7de.js +1 -0
- package/__mf/js/async/9605.a92ec9c1.js +1 -0
- package/__mf/js/async/9836.00da6086.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusDatasource.6f63e147.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusExplorer.584a073d.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.40984a4d.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.bd3eb00c.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.5cca8417.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.f59141f4.js +1 -0
- package/__mf/js/main.9617b605.js +6 -0
- package/lib/bootstrap.js +1 -1
- package/lib/bootstrap.js.map +1 -1
- package/lib/cjs/components/PromQLEditor.js +4 -7
- package/lib/cjs/components/promql/ast.js +10 -10
- package/lib/cjs/components/promql/format.js +3 -3
- package/lib/cjs/components/promql/utils.js +5 -5
- package/lib/cjs/components/query.js +3 -3
- package/lib/cjs/explore/PrometheusExplorer.js +10 -6
- package/lib/cjs/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js +4 -4
- package/lib/cjs/explore/PrometheusMetricsFinder/display/list/MetricList.js +3 -3
- package/lib/cjs/explore/PrometheusMetricsFinder/filter/FilterInputs.js +4 -4
- package/lib/cjs/explore/PrometheusMetricsFinder/overview/MetricOverview.js +3 -3
- package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js +4 -4
- package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js +4 -4
- package/lib/cjs/explore/PrometheusMetricsFinder/utils.js +5 -5
- package/lib/cjs/index-federation.js +12 -12
- package/lib/cjs/model/parse-sample-values.js +3 -3
- package/lib/cjs/model/prometheus-client.js +29 -19
- package/lib/cjs/model/prometheus-selectors.js +5 -5
- package/lib/cjs/model/time.js +4 -4
- package/lib/cjs/plugins/PrometheusDatasourceEditor.js +175 -2
- package/lib/cjs/plugins/prometheus-datasource.js +17 -9
- package/lib/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +35 -36
- package/lib/cjs/plugins/prometheus-time-series-query/query-editor-model.js +4 -4
- package/lib/cjs/plugins/prometheus-variables.js +48 -83
- package/lib/cjs/utils/utils.js +4 -4
- package/lib/components/PromQLEditor.d.ts +5 -1
- package/lib/components/PromQLEditor.d.ts.map +1 -1
- package/lib/components/PromQLEditor.js +5 -8
- package/lib/components/PromQLEditor.js.map +1 -1
- package/lib/components/TreeNode.js +1 -1
- package/lib/components/TreeNode.js.map +1 -1
- package/lib/components/promql/format.js +1 -1
- package/lib/components/promql/format.js.map +1 -1
- package/lib/explore/PrometheusExplorer.d.ts.map +1 -1
- package/lib/explore/PrometheusExplorer.js +10 -6
- package/lib/explore/PrometheusExplorer.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js +1 -1
- package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/display/MetricChip.js +1 -1
- package/lib/explore/PrometheusMetricsFinder/display/MetricChip.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.js +1 -1
- package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js +1 -1
- package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js +1 -1
- package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.js +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.js.map +1 -1
- package/lib/model/prometheus-client.d.ts +1 -0
- package/lib/model/prometheus-client.d.ts.map +1 -1
- package/lib/model/prometheus-client.js +19 -9
- package/lib/model/prometheus-client.js.map +1 -1
- package/lib/plugins/MatcherEditor.js +1 -1
- package/lib/plugins/MatcherEditor.js.map +1 -1
- package/lib/plugins/PrometheusDatasourceEditor.d.ts.map +1 -1
- package/lib/plugins/PrometheusDatasourceEditor.js +135 -3
- package/lib/plugins/PrometheusDatasourceEditor.js.map +1 -1
- package/lib/plugins/prometheus-datasource.js +17 -9
- package/lib/plugins/prometheus-datasource.js.map +1 -1
- package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts.map +1 -1
- package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +39 -40
- package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js.map +1 -1
- package/lib/plugins/prometheus-time-series-query/get-time-series-data.d.ts.map +1 -1
- package/lib/plugins/prometheus-time-series-query/get-time-series-data.js.map +1 -1
- package/lib/plugins/prometheus-variables.d.ts.map +1 -1
- package/lib/plugins/prometheus-variables.js +44 -85
- package/lib/plugins/prometheus-variables.js.map +1 -1
- package/lib/plugins/types.d.ts +1 -0
- package/lib/plugins/types.d.ts.map +1 -1
- package/lib/plugins/types.js.map +1 -1
- package/mf-manifest.json +268 -253
- package/mf-stats.json +271 -254
- package/package.json +7 -7
- package/__mf/js/Prometheus.f0d65264.js +0 -5
- package/__mf/js/async/1339.194207db.js +0 -1
- package/__mf/js/async/1441.c735f7dd.js +0 -1
- package/__mf/js/async/1576.8eac7ce9.js +0 -1
- package/__mf/js/async/212.5fcca998.js +0 -1
- package/__mf/js/async/2178.0f075947.js +0 -2
- package/__mf/js/async/2292.57d8fd0d.js +0 -2
- package/__mf/js/async/2472.2134f9f7.js +0 -22
- package/__mf/js/async/3224.b63f87bf.js +0 -1
- package/__mf/js/async/3507.f1653337.js +0 -101
- package/__mf/js/async/3749.3ecd9372.js +0 -1
- package/__mf/js/async/3863.7192dfdf.js +0 -2
- package/__mf/js/async/3960.3eedafbd.js +0 -2
- package/__mf/js/async/3980.0b0d272c.js +0 -2
- package/__mf/js/async/4075.dab1b7b8.js +0 -1
- package/__mf/js/async/4238.c48b1950.js +0 -1
- package/__mf/js/async/4421.6ebf935f.js +0 -1
- package/__mf/js/async/4535.f24704ea.js +0 -1
- package/__mf/js/async/4576.f42daf99.js +0 -1
- package/__mf/js/async/4665.cad36935.js +0 -1
- package/__mf/js/async/5257.ce463cb7.js +0 -1
- package/__mf/js/async/5409.955ffd51.js +0 -1
- package/__mf/js/async/5614.cce8ba96.js +0 -1
- package/__mf/js/async/5724.794828e3.js +0 -1
- package/__mf/js/async/5774.a3fae698.js +0 -1
- package/__mf/js/async/5790.a9b31ca8.js +0 -1
- package/__mf/js/async/5981.eb502d27.js +0 -2
- package/__mf/js/async/6292.2afe0c6d.js +0 -1
- package/__mf/js/async/6341.70ddfbe9.js +0 -7
- package/__mf/js/async/6377.c40920f2.js +0 -2
- package/__mf/js/async/6620.5a15a075.js +0 -2
- package/__mf/js/async/6770.7099bb3b.js +0 -1
- package/__mf/js/async/684.4495f632.js +0 -1
- package/__mf/js/async/694.8462a746.js +0 -1
- package/__mf/js/async/7272.6fa2f127.js +0 -1
- package/__mf/js/async/7376.2e948f2b.js +0 -1
- package/__mf/js/async/738.a1ffff79.js +0 -1
- package/__mf/js/async/7740.a8777825.js +0 -1
- package/__mf/js/async/8045.7f554a45.js +0 -10
- package/__mf/js/async/8164.bb3d3363.js +0 -1
- package/__mf/js/async/8216.e689c178.js +0 -1
- package/__mf/js/async/8488.cbbe542b.js +0 -1
- package/__mf/js/async/8587.40df6f5c.js +0 -1
- package/__mf/js/async/8706.08030938.js +0 -1
- package/__mf/js/async/9010.bdb2ef97.js +0 -1
- package/__mf/js/async/9173.915b80af.js +0 -2
- package/__mf/js/async/9550.642ce5ad.js +0 -38
- package/__mf/js/async/9817.70eae424.js +0 -1
- package/__mf/js/async/__federation_expose_PrometheusDatasource.dcb93aae.js +0 -1
- package/__mf/js/async/__federation_expose_PrometheusExplorer.9ab5666d.js +0 -1
- package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.0f7697ac.js +0 -1
- package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.cd804473.js +0 -1
- package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.4c376d6b.js +0 -1
- package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.d4984d73.js +0 -1
- package/__mf/js/main.d76b840e.js +0 -5
- /package/__mf/css/async/{1339.d3010b86.css → 1233.d3010b86.css} +0 -0
- /package/__mf/css/async/{1576.d3010b86.css → 1324.d3010b86.css} +0 -0
- /package/__mf/css/async/{4576.d3010b86.css → 9518.d3010b86.css} +0 -0
- /package/__mf/js/async/{2472.2134f9f7.js.LICENSE.txt → 1490.7e5068f1.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8045.7f554a45.js.LICENSE.txt → 1605.dc180cb8.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2292.57d8fd0d.js.LICENSE.txt → 2043.d0fbb886.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6620.5a15a075.js.LICENSE.txt → 3664.ba8b26b6.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5981.eb502d27.js.LICENSE.txt → 392.7cda691a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{1964.1d168a86.js.LICENSE.txt → 4121.828d661d.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6377.c40920f2.js.LICENSE.txt → 5440.c13c3533.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2178.0f075947.js.LICENSE.txt → 5501.6166367c.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6341.70ddfbe9.js.LICENSE.txt → 6149.19799c37.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{3960.3eedafbd.js.LICENSE.txt → 6274.478a68f8.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{3980.0b0d272c.js.LICENSE.txt → 6283.181cb622.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{9173.915b80af.js.LICENSE.txt → 8470.9b14a625.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{3863.7192dfdf.js.LICENSE.txt → 941.53b13124.js.LICENSE.txt} +0 -0
|
@@ -17,20 +17,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
useLabelValues
|
|
24
|
+
get useLabelValues () {
|
|
25
25
|
return useLabelValues;
|
|
26
26
|
},
|
|
27
|
-
useLabels
|
|
27
|
+
get useLabels () {
|
|
28
28
|
return useLabels;
|
|
29
29
|
},
|
|
30
|
-
useMetricMetadata
|
|
30
|
+
get useMetricMetadata () {
|
|
31
31
|
return useMetricMetadata;
|
|
32
32
|
},
|
|
33
|
-
useSeriesStates
|
|
33
|
+
get useSeriesStates () {
|
|
34
34
|
return useSeriesStates;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
// Copyright 2024 The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
1
|
"use strict";
|
|
14
2
|
function _getRequireWildcardCache(nodeInterop) {
|
|
15
3
|
if (typeof WeakMap !== "function") return null;
|
|
@@ -52,4 +40,16 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
52
40
|
}
|
|
53
41
|
return newObj;
|
|
54
42
|
}
|
|
43
|
+
// Copyright 2024 The Perses Authors
|
|
44
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
45
|
+
// you may not use this file except in compliance with the License.
|
|
46
|
+
// You may obtain a copy of the License at
|
|
47
|
+
//
|
|
48
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
49
|
+
//
|
|
50
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
51
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
52
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
53
|
+
// See the License for the specific language governing permissions and
|
|
54
|
+
// limitations under the License.
|
|
55
55
|
Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bootstrap")));
|
|
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
parseSampleValue
|
|
24
|
+
get parseSampleValue () {
|
|
25
25
|
return parseSampleValue;
|
|
26
26
|
},
|
|
27
|
-
parseValueTuple
|
|
27
|
+
get parseValueTuple () {
|
|
28
28
|
return parseValueTuple;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -17,42 +17,56 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
fetchResults
|
|
24
|
+
get fetchResults () {
|
|
25
25
|
return fetchResults;
|
|
26
26
|
},
|
|
27
|
-
healthCheck
|
|
27
|
+
get healthCheck () {
|
|
28
28
|
return healthCheck;
|
|
29
29
|
},
|
|
30
|
-
instantQuery
|
|
30
|
+
get instantQuery () {
|
|
31
31
|
return instantQuery;
|
|
32
32
|
},
|
|
33
|
-
labelNames
|
|
33
|
+
get labelNames () {
|
|
34
34
|
return labelNames;
|
|
35
35
|
},
|
|
36
|
-
labelValues
|
|
36
|
+
get labelValues () {
|
|
37
37
|
return labelValues;
|
|
38
38
|
},
|
|
39
|
-
metricMetadata
|
|
39
|
+
get metricMetadata () {
|
|
40
40
|
return metricMetadata;
|
|
41
41
|
},
|
|
42
|
-
parseQuery
|
|
42
|
+
get parseQuery () {
|
|
43
43
|
return parseQuery;
|
|
44
44
|
},
|
|
45
|
-
rangeQuery
|
|
45
|
+
get rangeQuery () {
|
|
46
46
|
return rangeQuery;
|
|
47
47
|
},
|
|
48
|
-
series
|
|
48
|
+
get series () {
|
|
49
49
|
return series;
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
const _core = require("@perses-dev/core");
|
|
53
|
+
/**
|
|
54
|
+
* Builds a query string from datasource-level query parameters.
|
|
55
|
+
* Optionally merges with existing URLSearchParams.
|
|
56
|
+
* Returns empty string if no parameters, otherwise returns query string with leading '?'.
|
|
57
|
+
*/ function buildQueryString(queryParams, initialParams) {
|
|
58
|
+
const urlParams = initialParams || new URLSearchParams();
|
|
59
|
+
if (queryParams) {
|
|
60
|
+
Object.entries(queryParams).forEach(([key, value])=>{
|
|
61
|
+
urlParams.set(key, value);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const queryString = urlParams.toString();
|
|
65
|
+
return queryString !== '' ? `?${queryString}` : '';
|
|
66
|
+
}
|
|
53
67
|
function healthCheck(queryOptions) {
|
|
54
68
|
return async ()=>{
|
|
55
|
-
const url = `${queryOptions.datasourceUrl}/-/healthy`;
|
|
69
|
+
const url = `${queryOptions.datasourceUrl}/-/healthy${buildQueryString(queryOptions.queryParams)}`;
|
|
56
70
|
try {
|
|
57
71
|
const resp = await (0, _core.fetch)(url, {
|
|
58
72
|
headers: queryOptions.headers,
|
|
@@ -100,20 +114,16 @@ function parseQuery(params, queryOptions) {
|
|
|
100
114
|
return fetchWithPost(apiURI, params, queryOptions);
|
|
101
115
|
}
|
|
102
116
|
function fetchWithGet(apiURI, params, queryOptions) {
|
|
103
|
-
const { datasourceUrl, headers } = queryOptions;
|
|
104
|
-
|
|
105
|
-
const urlParams = createSearchParams(params).toString();
|
|
106
|
-
if (urlParams !== '') {
|
|
107
|
-
url += `?${urlParams}`;
|
|
108
|
-
}
|
|
117
|
+
const { datasourceUrl, headers, queryParams } = queryOptions;
|
|
118
|
+
const url = `${datasourceUrl}${apiURI}${buildQueryString(queryParams, createSearchParams(params))}`;
|
|
109
119
|
return (0, _core.fetchJson)(url, {
|
|
110
120
|
method: 'GET',
|
|
111
121
|
headers
|
|
112
122
|
});
|
|
113
123
|
}
|
|
114
124
|
function fetchWithPost(apiURI, params, queryOptions) {
|
|
115
|
-
const { datasourceUrl, headers, abortSignal: signal } = queryOptions;
|
|
116
|
-
const url = `${datasourceUrl}${apiURI}`;
|
|
125
|
+
const { datasourceUrl, headers, abortSignal: signal, queryParams } = queryOptions;
|
|
126
|
+
const url = `${datasourceUrl}${apiURI}${buildQueryString(queryParams)}`;
|
|
117
127
|
const init = {
|
|
118
128
|
method: 'POST',
|
|
119
129
|
headers: {
|
|
@@ -17,20 +17,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
DEFAULT_PROM
|
|
24
|
+
get DEFAULT_PROM () {
|
|
25
25
|
return DEFAULT_PROM;
|
|
26
26
|
},
|
|
27
|
-
PROM_DATASOURCE_KIND
|
|
27
|
+
get PROM_DATASOURCE_KIND () {
|
|
28
28
|
return PROM_DATASOURCE_KIND;
|
|
29
29
|
},
|
|
30
|
-
isDefaultPromSelector
|
|
30
|
+
get isDefaultPromSelector () {
|
|
31
31
|
return isDefaultPromSelector;
|
|
32
32
|
},
|
|
33
|
-
isPrometheusDatasourceSelector
|
|
33
|
+
get isPrometheusDatasourceSelector () {
|
|
34
34
|
return isPrometheusDatasourceSelector;
|
|
35
35
|
}
|
|
36
36
|
});
|
package/lib/cjs/model/time.js
CHANGED
|
@@ -17,17 +17,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
getDurationStringSeconds
|
|
24
|
+
get getDurationStringSeconds () {
|
|
25
25
|
return getDurationStringSeconds;
|
|
26
26
|
},
|
|
27
|
-
getPrometheusTimeRange
|
|
27
|
+
get getPrometheusTimeRange () {
|
|
28
28
|
return getPrometheusTimeRange;
|
|
29
29
|
},
|
|
30
|
-
getRangeStep
|
|
30
|
+
get getRangeStep () {
|
|
31
31
|
return getRangeStep;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
@@ -23,15 +23,127 @@ Object.defineProperty(exports, "PrometheusDatasourceEditor", {
|
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
|
-
const
|
|
26
|
+
const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
|
|
27
|
+
const _Minus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Minus"));
|
|
28
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
27
29
|
const _types = require("./types");
|
|
28
30
|
function _interop_require_default(obj) {
|
|
29
31
|
return obj && obj.__esModule ? obj : {
|
|
30
32
|
default: obj
|
|
31
33
|
};
|
|
32
34
|
}
|
|
35
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
36
|
+
if (typeof WeakMap !== "function") return null;
|
|
37
|
+
var cacheBabelInterop = new WeakMap();
|
|
38
|
+
var cacheNodeInterop = new WeakMap();
|
|
39
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
40
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
41
|
+
})(nodeInterop);
|
|
42
|
+
}
|
|
43
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
44
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
45
|
+
return obj;
|
|
46
|
+
}
|
|
47
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
48
|
+
return {
|
|
49
|
+
default: obj
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
53
|
+
if (cache && cache.has(obj)) {
|
|
54
|
+
return cache.get(obj);
|
|
55
|
+
}
|
|
56
|
+
var newObj = {
|
|
57
|
+
__proto__: null
|
|
58
|
+
};
|
|
59
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
60
|
+
for(var key in obj){
|
|
61
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
62
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
63
|
+
if (desc && (desc.get || desc.set)) {
|
|
64
|
+
Object.defineProperty(newObj, key, desc);
|
|
65
|
+
} else {
|
|
66
|
+
newObj[key] = obj[key];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
newObj.default = obj;
|
|
71
|
+
if (cache) {
|
|
72
|
+
cache.set(obj, newObj);
|
|
73
|
+
}
|
|
74
|
+
return newObj;
|
|
75
|
+
}
|
|
33
76
|
function PrometheusDatasourceEditor(props) {
|
|
34
77
|
const { value, onChange, isReadonly } = props;
|
|
78
|
+
// Counter for generating unique IDs
|
|
79
|
+
const nextIdRef = (0, _react.useRef)(0);
|
|
80
|
+
// Use local state to maintain an array of entries during editing, instead of
|
|
81
|
+
// manipulating a map directly which causes weird UX.
|
|
82
|
+
const [entries, setEntries] = (0, _react.useState)(()=>{
|
|
83
|
+
const queryParams = value.queryParams ?? {};
|
|
84
|
+
return Object.entries(queryParams).map(([key, value])=>({
|
|
85
|
+
id: String(nextIdRef.current++),
|
|
86
|
+
key,
|
|
87
|
+
value
|
|
88
|
+
}));
|
|
89
|
+
});
|
|
90
|
+
// Check for duplicate keys
|
|
91
|
+
const keyMap = new Map();
|
|
92
|
+
const duplicateKeys = new Set();
|
|
93
|
+
entries.forEach(({ key })=>{
|
|
94
|
+
if (key !== '') {
|
|
95
|
+
const count = (keyMap.get(key) || 0) + 1;
|
|
96
|
+
keyMap.set(key, count);
|
|
97
|
+
if (count > 1) {
|
|
98
|
+
duplicateKeys.add(key);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
const hasDuplicates = duplicateKeys.size > 0;
|
|
103
|
+
// Convert entries array to object and trigger onChange
|
|
104
|
+
const syncToParent = (newEntries)=>{
|
|
105
|
+
const newParams = {};
|
|
106
|
+
newEntries.forEach(({ key, value })=>{
|
|
107
|
+
if (key !== '') {
|
|
108
|
+
newParams[key] = value;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
onChange({
|
|
112
|
+
...value,
|
|
113
|
+
queryParams: Object.keys(newParams).length > 0 ? newParams : undefined
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
const handleQueryParamChange = (id, field, newValue)=>{
|
|
117
|
+
const newEntries = entries.map((entry)=>{
|
|
118
|
+
if (entry.id !== id) return entry;
|
|
119
|
+
return field === 'key' ? {
|
|
120
|
+
...entry,
|
|
121
|
+
key: newValue
|
|
122
|
+
} : {
|
|
123
|
+
...entry,
|
|
124
|
+
value: newValue
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
setEntries(newEntries);
|
|
128
|
+
syncToParent(newEntries);
|
|
129
|
+
};
|
|
130
|
+
const addQueryParam = ()=>{
|
|
131
|
+
const newEntries = [
|
|
132
|
+
...entries,
|
|
133
|
+
{
|
|
134
|
+
id: String(nextIdRef.current++),
|
|
135
|
+
key: '',
|
|
136
|
+
value: ''
|
|
137
|
+
}
|
|
138
|
+
];
|
|
139
|
+
setEntries(newEntries);
|
|
140
|
+
syncToParent(newEntries);
|
|
141
|
+
};
|
|
142
|
+
const removeQueryParam = (id)=>{
|
|
143
|
+
const newEntries = entries.filter((entry)=>entry.id !== id);
|
|
144
|
+
setEntries(newEntries);
|
|
145
|
+
syncToParent(newEntries);
|
|
146
|
+
};
|
|
35
147
|
const initialSpecDirect = {
|
|
36
148
|
directUrl: ''
|
|
37
149
|
};
|
|
@@ -82,6 +194,7 @@ function PrometheusDatasourceEditor(props) {
|
|
|
82
194
|
children: "General Settings"
|
|
83
195
|
}),
|
|
84
196
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
197
|
+
size: "small",
|
|
85
198
|
fullWidth: true,
|
|
86
199
|
label: "Scrape Interval",
|
|
87
200
|
value: value.scrapeInterval || '',
|
|
@@ -95,7 +208,8 @@ function PrometheusDatasourceEditor(props) {
|
|
|
95
208
|
onChange: (e)=>onChange({
|
|
96
209
|
...value,
|
|
97
210
|
scrapeInterval: e.target.value
|
|
98
|
-
})
|
|
211
|
+
}),
|
|
212
|
+
helperText: "Set it to match the typical scrape interval used in your Prometheus instance."
|
|
99
213
|
}),
|
|
100
214
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.HTTPSettingsEditor, {
|
|
101
215
|
value: value,
|
|
@@ -103,6 +217,65 @@ function PrometheusDatasourceEditor(props) {
|
|
|
103
217
|
isReadonly: isReadonly,
|
|
104
218
|
initialSpecDirect: initialSpecDirect,
|
|
105
219
|
initialSpecProxy: initialSpecProxy
|
|
220
|
+
}),
|
|
221
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
222
|
+
variant: "h5",
|
|
223
|
+
mt: 2,
|
|
224
|
+
mb: 1,
|
|
225
|
+
children: "Query Parameters"
|
|
226
|
+
}),
|
|
227
|
+
entries.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
|
|
228
|
+
children: entries.map((entry)=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
229
|
+
display: "flex",
|
|
230
|
+
alignItems: "center",
|
|
231
|
+
gap: 2,
|
|
232
|
+
mb: 1,
|
|
233
|
+
children: [
|
|
234
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
235
|
+
size: "small",
|
|
236
|
+
label: "Key",
|
|
237
|
+
value: entry.key,
|
|
238
|
+
placeholder: "Parameter name",
|
|
239
|
+
disabled: isReadonly,
|
|
240
|
+
onChange: (e)=>handleQueryParamChange(entry.id, 'key', e.target.value),
|
|
241
|
+
error: duplicateKeys.has(entry.key),
|
|
242
|
+
sx: {
|
|
243
|
+
minWidth: 150
|
|
244
|
+
}
|
|
245
|
+
}),
|
|
246
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
247
|
+
size: "small",
|
|
248
|
+
label: "Value",
|
|
249
|
+
value: entry.value,
|
|
250
|
+
placeholder: "Parameter value",
|
|
251
|
+
disabled: isReadonly,
|
|
252
|
+
onChange: (e)=>handleQueryParamChange(entry.id, 'value', e.target.value),
|
|
253
|
+
sx: {
|
|
254
|
+
minWidth: 150,
|
|
255
|
+
flexGrow: 1
|
|
256
|
+
}
|
|
257
|
+
}),
|
|
258
|
+
!isReadonly && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
259
|
+
onClick: ()=>removeQueryParam(entry.id),
|
|
260
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Minus.default, {})
|
|
261
|
+
})
|
|
262
|
+
]
|
|
263
|
+
}, entry.id))
|
|
264
|
+
}),
|
|
265
|
+
hasDuplicates && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
266
|
+
variant: "body2",
|
|
267
|
+
color: "error",
|
|
268
|
+
mb: 1,
|
|
269
|
+
children: "Duplicate parameter keys detected. Each key must be unique."
|
|
270
|
+
}),
|
|
271
|
+
entries.length === 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
272
|
+
variant: "body2",
|
|
273
|
+
color: "textSecondary",
|
|
274
|
+
children: "No query parameters configured. Use query parameters to pass additional options to Prometheus (e.g., dedup=false for Thanos)."
|
|
275
|
+
}),
|
|
276
|
+
!isReadonly && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
277
|
+
onClick: addQueryParam,
|
|
278
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {})
|
|
106
279
|
})
|
|
107
280
|
]
|
|
108
281
|
});
|
|
@@ -25,7 +25,7 @@ const _PrometheusDatasourceEditor = require("./PrometheusDatasourceEditor");
|
|
|
25
25
|
/**
|
|
26
26
|
* Creates a PrometheusClient for a specific datasource spec.
|
|
27
27
|
*/ const createClient = (spec, options)=>{
|
|
28
|
-
const { directUrl, proxy } = spec;
|
|
28
|
+
const { directUrl, proxy, queryParams } = spec;
|
|
29
29
|
const { proxyUrl } = options;
|
|
30
30
|
// Use the direct URL if specified, but fallback to the proxyUrl by default if not specified
|
|
31
31
|
const datasourceUrl = directUrl ?? proxyUrl;
|
|
@@ -40,42 +40,50 @@ const _PrometheusDatasourceEditor = require("./PrometheusDatasourceEditor");
|
|
|
40
40
|
},
|
|
41
41
|
healthCheck: (0, _model.healthCheck)({
|
|
42
42
|
datasourceUrl,
|
|
43
|
-
headers: specHeaders
|
|
43
|
+
headers: specHeaders,
|
|
44
|
+
queryParams
|
|
44
45
|
}),
|
|
45
46
|
instantQuery: (params, headers, abortSignal)=>(0, _model.instantQuery)(params, {
|
|
46
47
|
datasourceUrl,
|
|
47
48
|
headers: headers ?? specHeaders,
|
|
48
|
-
abortSignal
|
|
49
|
+
abortSignal,
|
|
50
|
+
queryParams
|
|
49
51
|
}),
|
|
50
52
|
rangeQuery: (params, headers, abortSignal)=>(0, _model.rangeQuery)(params, {
|
|
51
53
|
datasourceUrl,
|
|
52
54
|
headers: headers ?? specHeaders,
|
|
53
|
-
abortSignal
|
|
55
|
+
abortSignal,
|
|
56
|
+
queryParams
|
|
54
57
|
}),
|
|
55
58
|
labelNames: (params, headers, abortSignal)=>(0, _model.labelNames)(params, {
|
|
56
59
|
datasourceUrl,
|
|
57
60
|
headers: headers ?? specHeaders,
|
|
58
|
-
abortSignal
|
|
61
|
+
abortSignal,
|
|
62
|
+
queryParams
|
|
59
63
|
}),
|
|
60
64
|
labelValues: (params, headers, abortSignal)=>(0, _model.labelValues)(params, {
|
|
61
65
|
datasourceUrl,
|
|
62
66
|
headers: headers ?? specHeaders,
|
|
63
|
-
abortSignal
|
|
67
|
+
abortSignal,
|
|
68
|
+
queryParams
|
|
64
69
|
}),
|
|
65
70
|
metricMetadata: (params, headers, abortSignal)=>(0, _model.metricMetadata)(params, {
|
|
66
71
|
datasourceUrl,
|
|
67
72
|
headers: headers ?? specHeaders,
|
|
68
|
-
abortSignal
|
|
73
|
+
abortSignal,
|
|
74
|
+
queryParams
|
|
69
75
|
}),
|
|
70
76
|
series: (params, headers, abortSignal)=>(0, _model.series)(params, {
|
|
71
77
|
datasourceUrl,
|
|
72
78
|
headers: headers ?? specHeaders,
|
|
73
|
-
abortSignal
|
|
79
|
+
abortSignal,
|
|
80
|
+
queryParams
|
|
74
81
|
}),
|
|
75
82
|
parseQuery: (params, headers, abortSignal)=>(0, _model.parseQuery)(params, {
|
|
76
83
|
datasourceUrl,
|
|
77
84
|
headers: headers ?? specHeaders,
|
|
78
|
-
abortSignal
|
|
85
|
+
abortSignal,
|
|
86
|
+
queryParams
|
|
79
87
|
})
|
|
80
88
|
};
|
|
81
89
|
};
|
|
@@ -26,12 +26,13 @@ const _pluginsystem = require("@perses-dev/plugin-system");
|
|
|
26
26
|
const _components = require("@perses-dev/components");
|
|
27
27
|
const _material = require("@mui/material");
|
|
28
28
|
const _react = require("react");
|
|
29
|
+
const _dashboards = require("@perses-dev/dashboards");
|
|
29
30
|
const _model = require("../../model");
|
|
30
31
|
const _types = require("../types");
|
|
31
32
|
const _components1 = require("../../components");
|
|
32
33
|
const _queryeditormodel = require("./query-editor-model");
|
|
33
34
|
function PrometheusTimeSeriesQueryEditor(props) {
|
|
34
|
-
const { onChange, value, value: { query, datasource },
|
|
35
|
+
const { onChange, value, value: { query, datasource }, isReadonly } = props;
|
|
35
36
|
const datasourceSelectValue = datasource ?? _model.DEFAULT_PROM;
|
|
36
37
|
const datasourceSelectLabelID = (0, _components.useId)('prom-datasource-label'); // for panels with multiple queries, this component is rendered multiple times on the same page
|
|
37
38
|
const selectedDatasource = (0, _pluginsystem.useDatasourceSelectValueToSelector)(datasourceSelectValue, _model.PROM_DATASOURCE_KIND);
|
|
@@ -52,44 +53,41 @@ function PrometheusTimeSeriesQueryEditor(props) {
|
|
|
52
53
|
const nextDatasource = (0, _model.isDefaultPromSelector)(next) ? undefined : next;
|
|
53
54
|
draft.datasource = nextDatasource;
|
|
54
55
|
}));
|
|
55
|
-
if (queryHandlerSettings?.setWatchOtherSpecs) queryHandlerSettings.setWatchOtherSpecs({
|
|
56
|
-
...value,
|
|
57
|
-
datasource: next
|
|
58
|
-
});
|
|
59
56
|
return;
|
|
60
57
|
}
|
|
61
58
|
throw new Error('Got unexpected non-Prometheus datasource selector');
|
|
62
59
|
};
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
const variableState = (0, _pluginsystem.useAllVariableValues)();
|
|
61
|
+
const { absoluteTimeRange } = (0, _pluginsystem.useTimeRange)();
|
|
62
|
+
const panelEditorContext = (0, _react.useContext)(_dashboards.PanelEditorContext);
|
|
63
|
+
const suggestedStepMs = (0, _pluginsystem.useSuggestedStepMs)(panelEditorContext?.preview.previewPanelWidth);
|
|
64
|
+
const minStepMs = (0, _react.useMemo)(()=>{
|
|
65
|
+
/* Try catch is necessary, because when the minStep value is being typed, it will be valid when the duration unit is added. Example: 2m = 2 + m */ try {
|
|
66
|
+
const durationsSeconds = (0, _model.getDurationStringSeconds)((0, _pluginsystem.replaceVariables)(minStepPlaceholder, variableState));
|
|
67
|
+
return durationsSeconds !== undefined ? durationsSeconds * 1000 : undefined;
|
|
68
|
+
} catch {
|
|
69
|
+
return undefined;
|
|
67
70
|
}
|
|
68
71
|
}, [
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
variableState,
|
|
73
|
+
minStepPlaceholder
|
|
71
74
|
]);
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
...value,
|
|
76
|
-
seriesNameFormat: e.target.value
|
|
77
|
-
});
|
|
75
|
+
const intervalMs = (0, _react.useMemo)(()=>{
|
|
76
|
+
const minStepSeconds = (minStepMs ?? 0) / 1000;
|
|
77
|
+
return (0, _model.getRangeStep)((0, _model.getPrometheusTimeRange)(absoluteTimeRange), minStepSeconds, undefined, suggestedStepMs) * 1000;
|
|
78
78
|
}, [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
absoluteTimeRange,
|
|
80
|
+
minStepMs,
|
|
81
|
+
suggestedStepMs
|
|
82
82
|
]);
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
});
|
|
83
|
+
const treeViewMetadata = (0, _react.useMemo)(()=>{
|
|
84
|
+
return minStepMs && intervalMs ? {
|
|
85
|
+
minStepMs,
|
|
86
|
+
intervalMs
|
|
87
|
+
} : undefined;
|
|
89
88
|
}, [
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
value
|
|
89
|
+
minStepMs,
|
|
90
|
+
intervalMs
|
|
93
91
|
]);
|
|
94
92
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
95
93
|
spacing: 2,
|
|
@@ -115,9 +113,10 @@ function PrometheusTimeSeriesQueryEditor(props) {
|
|
|
115
113
|
},
|
|
116
114
|
value: query,
|
|
117
115
|
datasource: selectedDatasource,
|
|
118
|
-
onChange:
|
|
119
|
-
onBlur:
|
|
120
|
-
isReadOnly: isReadonly
|
|
116
|
+
onChange: handleQueryChange,
|
|
117
|
+
onBlur: handleQueryBlur,
|
|
118
|
+
isReadOnly: isReadonly,
|
|
119
|
+
treeViewMetadata: treeViewMetadata
|
|
121
120
|
}),
|
|
122
121
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
123
122
|
direction: "row",
|
|
@@ -129,8 +128,8 @@ function PrometheusTimeSeriesQueryEditor(props) {
|
|
|
129
128
|
placeholder: "Example: '{{instance}}' will generate series names like 'webserver-123', 'webserver-456'...",
|
|
130
129
|
helperText: "Text to be displayed in the legend and the tooltip. Use {{label_name}} to interpolate label values.",
|
|
131
130
|
value: format ?? '',
|
|
132
|
-
onChange:
|
|
133
|
-
onBlur:
|
|
131
|
+
onChange: (e)=>handleFormatChange(e.target.value),
|
|
132
|
+
onBlur: handleFormatBlur,
|
|
134
133
|
slotProps: {
|
|
135
134
|
inputLabel: {
|
|
136
135
|
shrink: isReadonly ? true : undefined
|
|
@@ -145,8 +144,8 @@ function PrometheusTimeSeriesQueryEditor(props) {
|
|
|
145
144
|
placeholder: minStepPlaceholder,
|
|
146
145
|
helperText: "Lower bound for the step. If not provided, the scrape interval of the datasource is used.",
|
|
147
146
|
value: minStep ?? '',
|
|
148
|
-
onChange:
|
|
149
|
-
onBlur:
|
|
147
|
+
onChange: (e)=>handleMinStepChange(e.target.value ? e.target.value : undefined),
|
|
148
|
+
onBlur: handleMinStepBlur,
|
|
150
149
|
sx: {
|
|
151
150
|
width: '250px'
|
|
152
151
|
},
|
|
@@ -17,17 +17,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
useFormatState
|
|
24
|
+
get useFormatState () {
|
|
25
25
|
return useFormatState;
|
|
26
26
|
},
|
|
27
|
-
useMinStepState
|
|
27
|
+
get useMinStepState () {
|
|
28
28
|
return useMinStepState;
|
|
29
29
|
},
|
|
30
|
-
useQueryState
|
|
30
|
+
get useQueryState () {
|
|
31
31
|
return useQueryState;
|
|
32
32
|
}
|
|
33
33
|
});
|