@perses-dev/prometheus-plugin 0.57.1 → 0.58.0-beta.1
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/css/async/1872.85c2cbf6.css +1 -0
- package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
- package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
- package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
- package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
- package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
- package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
- package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
- package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
- package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
- package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
- package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
- package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
- package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
- package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
- package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
- package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
- package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
- package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
- package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
- package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
- package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
- package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
- package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
- package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
- package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
- package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
- package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
- package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
- package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
- package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
- package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
- package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
- package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
- package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
- package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
- package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
- package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
- package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
- package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
- package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
- package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
- package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
- package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
- package/__mf/js/Prometheus.d3a12aa6.js +7 -0
- package/__mf/js/async/1432.0bb0ef6b.js +1 -0
- package/__mf/js/async/1605.7c7a0998.js +110 -0
- package/__mf/js/async/{1605.dc180cb8.js.LICENSE.txt → 1605.7c7a0998.js.LICENSE.txt} +1 -1
- package/__mf/js/async/1616.ed429c53.js +1 -0
- package/__mf/js/async/1728.e8350fb6.js +1 -0
- package/__mf/js/async/1872.7a33d27d.js +7 -0
- package/__mf/js/async/{1266.72ab943c.js.LICENSE.txt → 1872.7a33d27d.js.LICENSE.txt} +19 -1
- package/__mf/js/async/1969.a1e1979e.js +1 -0
- package/__mf/js/async/2043.c2948add.js +2 -0
- package/__mf/js/async/{2186.e58838a5.js → 2186.9a98bd8f.js} +2 -2
- package/__mf/js/async/2228.53db17f4.js +2 -0
- package/__mf/js/async/{4657.f0c3ccd6.js.LICENSE.txt → 2228.53db17f4.js.LICENSE.txt} +17 -1
- package/__mf/js/async/2340.1f49ce2e.js +1 -0
- package/__mf/js/async/2506.baf20a10.js +1 -0
- package/__mf/js/async/2814.fbf52858.js +1 -0
- package/__mf/js/async/2979.1d711dae.js +1 -0
- package/__mf/js/async/3499.19c4bfa6.js +1 -0
- package/__mf/js/async/392.233c0945.js +2 -0
- package/__mf/js/async/3963.81c8be7e.js +1 -0
- package/__mf/js/async/4121.9ed83f2a.js +2 -0
- package/__mf/js/async/425.b9d2dc6f.js +1 -0
- package/__mf/js/async/4402.2c6a54dd.js +1 -0
- package/__mf/js/async/4626.90ae092f.js +1 -0
- package/__mf/js/async/4987.f7360bdf.js +1 -0
- package/__mf/js/async/5002.bd952313.js +1 -0
- package/__mf/js/async/5071.5fcfd9a8.js +1 -0
- package/__mf/js/async/5440.52ec91ad.js +2 -0
- package/__mf/js/async/5587.e4d331db.js +1 -0
- package/__mf/js/async/5763.ccf403b7.js +1 -0
- package/__mf/js/async/5922.ba33c996.js +1 -0
- package/__mf/js/async/6274.f04c9ecd.js +2 -0
- package/__mf/js/async/6438.b86a2aba.js +1 -0
- package/__mf/js/async/6507.71182781.js +1 -0
- package/__mf/js/async/7177.0ab860e0.js +1 -0
- package/__mf/js/async/7192.bbf62500.js +1 -0
- package/__mf/js/async/7647.82297501.js +1 -0
- package/__mf/js/async/7670.3e71874a.js +1 -0
- package/__mf/js/async/7862.e13fbb9d.js +2 -0
- package/__mf/js/async/7894.9fe90396.js +1 -0
- package/__mf/js/async/7968.253f5f1d.js +1 -0
- package/__mf/js/async/7978.be30c741.js +1 -0
- package/__mf/js/async/8356.6a2bfd53.js +1 -0
- package/__mf/js/async/8470.84935087.js +2 -0
- package/__mf/js/async/873.6aafbb7b.js +1 -0
- package/__mf/js/async/8750.7d02f3b6.js +3 -0
- package/__mf/js/async/8888.3a188176.js +1 -0
- package/__mf/js/async/9184.e6de21be.js +1 -0
- package/__mf/js/async/9235.85fb6b63.js +1 -0
- package/__mf/js/async/941.075ed563.js +2 -0
- package/__mf/js/async/9588.dfdaeff2.js +1 -0
- package/__mf/js/async/9594.d1a3d0d9.js +1 -0
- package/__mf/js/async/9745.0a6c90a2.js +1 -0
- package/__mf/js/async/9836.888f4ed2.js +1 -0
- package/__mf/js/async/9916.11d16715.js +22 -0
- package/__mf/js/async/__federation_expose_PrometheusDatasource.2d013450.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusExplorer.f82cdff6.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.c01296a1.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.e47f56d4.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.593376e2.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.ee2d94d2.js +1 -0
- package/__mf/js/main.31c60b65.js +7 -0
- package/lib/cjs/components/promql/format.js +6 -6
- package/lib/cjs/components/promql/serialize.js +4 -4
- package/lib/cjs/model/prometheus-client.js +25 -20
- package/lib/cjs/model/time.js +2 -2
- package/lib/cjs/plugins/PrometheusDatasourceEditor.js +10 -48
- package/lib/cjs/plugins/PrometheusLabelNamesVariable.js +3 -2
- package/lib/cjs/plugins/PrometheusLabelValuesVariable.js +3 -2
- package/lib/cjs/plugins/PrometheusPromQLVariable.js +3 -2
- package/lib/cjs/plugins/interpolation.js +54 -0
- package/lib/cjs/plugins/prometheus-datasource.js +15 -42
- package/lib/cjs/plugins/prometheus-time-series-query/get-time-series-data.js +12 -4
- package/lib/cjs/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js +3 -3
- package/lib/components/TreeNode.d.ts.map +1 -1
- package/lib/components/TreeNode.js.map +1 -1
- package/lib/components/promql/format.d.ts.map +1 -1
- package/lib/components/promql/format.js +6 -6
- package/lib/components/promql/format.js.map +1 -1
- package/lib/components/promql/serialize.js +4 -4
- package/lib/components/promql/serialize.js.map +1 -1
- package/lib/components/query.d.ts +2 -1
- package/lib/components/query.d.ts.map +1 -1
- package/lib/components/query.js.map +1 -1
- package/lib/explore/PrometheusExplorer.d.ts.map +1 -1
- package/lib/explore/PrometheusExplorer.js +1 -1
- package/lib/explore/PrometheusExplorer.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.d.ts +1 -1
- package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.d.ts.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.d.ts +1 -1
- package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.d.ts.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.d.ts +1 -1
- package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.d.ts.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.d.ts +1 -1
- package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.d.ts.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.d.ts +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.d.ts.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.d.ts +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.d.ts.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.d.ts +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.d.ts.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.d.ts +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.d.ts.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js +1 -1
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/types.d.ts +1 -1
- package/lib/explore/PrometheusMetricsFinder/types.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/utils.d.ts +2 -1
- package/lib/explore/PrometheusMetricsFinder/utils.d.ts.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/utils.js.map +1 -1
- package/lib/model/api-types.d.ts +2 -2
- package/lib/model/api-types.d.ts.map +1 -1
- package/lib/model/api-types.js.map +1 -1
- package/lib/model/prometheus-client.d.ts +17 -14
- package/lib/model/prometheus-client.d.ts.map +1 -1
- package/lib/model/prometheus-client.js +20 -17
- package/lib/model/prometheus-client.js.map +1 -1
- package/lib/model/prometheus-selectors.d.ts +1 -1
- package/lib/model/prometheus-selectors.d.ts.map +1 -1
- package/lib/model/prometheus-selectors.js.map +1 -1
- package/lib/model/time.d.ts +1 -1
- package/lib/model/time.d.ts.map +1 -1
- package/lib/model/time.js +1 -1
- package/lib/model/time.js.map +1 -1
- package/lib/plugins/PrometheusDatasourceEditor.d.ts.map +1 -1
- package/lib/plugins/PrometheusDatasourceEditor.js +11 -8
- package/lib/plugins/PrometheusDatasourceEditor.js.map +1 -1
- package/lib/plugins/PrometheusLabelNamesVariable.d.ts.map +1 -1
- package/lib/plugins/PrometheusLabelNamesVariable.js +3 -2
- package/lib/plugins/PrometheusLabelNamesVariable.js.map +1 -1
- package/lib/plugins/PrometheusLabelValuesVariable.d.ts.map +1 -1
- package/lib/plugins/PrometheusLabelValuesVariable.js +3 -2
- package/lib/plugins/PrometheusLabelValuesVariable.js.map +1 -1
- package/lib/plugins/PrometheusPromQLVariable.d.ts.map +1 -1
- package/lib/plugins/PrometheusPromQLVariable.js +3 -2
- package/lib/plugins/PrometheusPromQLVariable.js.map +1 -1
- package/lib/plugins/interpolation.d.ts +12 -0
- package/lib/plugins/interpolation.d.ts.map +1 -0
- package/lib/plugins/interpolation.js +38 -0
- package/lib/plugins/interpolation.js.map +1 -0
- package/lib/plugins/prometheus-datasource.d.ts.map +1 -1
- package/lib/plugins/prometheus-datasource.js +16 -43
- package/lib/plugins/prometheus-datasource.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 +11 -3
- package/lib/plugins/prometheus-time-series-query/get-time-series-data.js.map +1 -1
- package/lib/plugins/prometheus-time-series-query/query-editor-model.d.ts +1 -1
- package/lib/plugins/prometheus-time-series-query/query-editor-model.js.map +1 -1
- package/lib/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js +3 -3
- package/lib/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js.map +1 -1
- package/lib/plugins/prometheus-time-series-query/time-series-query-model.d.ts +1 -1
- package/lib/plugins/prometheus-time-series-query/time-series-query-model.d.ts.map +1 -1
- package/lib/plugins/prometheus-time-series-query/time-series-query-model.js.map +1 -1
- package/lib/plugins/types.d.ts +3 -2
- package/lib/plugins/types.d.ts.map +1 -1
- package/lib/plugins/types.js.map +1 -1
- package/mf-manifest.json +312 -294
- package/mf-stats.json +331 -297
- package/package.json +8 -7
- package/__mf/css/async/1233.d3010b86.css +0 -1
- package/__mf/css/async/1324.d3010b86.css +0 -1
- package/__mf/css/async/9518.d3010b86.css +0 -1
- package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
- package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
- package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
- package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
- package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
- package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
- package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
- package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
- package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
- package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
- package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
- package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
- package/__mf/js/Prometheus.3e36625f.js +0 -6
- package/__mf/js/async/1233.0ab88b51.js +0 -1
- package/__mf/js/async/1266.72ab943c.js +0 -7
- package/__mf/js/async/1324.ce01eced.js +0 -1
- package/__mf/js/async/1432.0c3e4ed0.js +0 -1
- package/__mf/js/async/1605.dc180cb8.js +0 -110
- package/__mf/js/async/1616.7587ce79.js +0 -1
- package/__mf/js/async/1728.77be26a7.js +0 -1
- package/__mf/js/async/1969.372d36b8.js +0 -1
- package/__mf/js/async/2043.d0fbb886.js +0 -2
- package/__mf/js/async/208.72798a8d.js +0 -4
- package/__mf/js/async/208.72798a8d.js.LICENSE.txt +0 -15
- package/__mf/js/async/2506.1e336b3b.js +0 -1
- package/__mf/js/async/3184.6b4ad42e.js +0 -1
- package/__mf/js/async/3499.bef2e2e5.js +0 -1
- package/__mf/js/async/392.f1b4a590.js +0 -2
- package/__mf/js/async/3963.5fef6ffb.js +0 -1
- package/__mf/js/async/3996.69a9c1dc.js +0 -1
- package/__mf/js/async/4121.828d661d.js +0 -2
- package/__mf/js/async/425.1ec8867f.js +0 -1
- package/__mf/js/async/4626.173e602a.js +0 -1
- package/__mf/js/async/4657.f0c3ccd6.js +0 -2
- package/__mf/js/async/4987.c12b89cb.js +0 -1
- package/__mf/js/async/5002.e4f54e8e.js +0 -1
- package/__mf/js/async/5071.e1c33fa7.js +0 -1
- package/__mf/js/async/529.2303b01b.js +0 -1
- package/__mf/js/async/54.5c908585.js +0 -22
- package/__mf/js/async/5440.8ced5513.js +0 -2
- package/__mf/js/async/5587.4d72fc35.js +0 -1
- package/__mf/js/async/5763.4ba478ff.js +0 -1
- package/__mf/js/async/5922.d1619ac1.js +0 -1
- package/__mf/js/async/6274.478a68f8.js +0 -2
- package/__mf/js/async/6283.181cb622.js +0 -2
- package/__mf/js/async/6969.b959b6f8.js +0 -1
- package/__mf/js/async/7177.205c9aaf.js +0 -1
- package/__mf/js/async/7192.d835931b.js +0 -1
- package/__mf/js/async/7894.9c5245d7.js +0 -1
- package/__mf/js/async/7968.6ac0ce96.js +0 -1
- package/__mf/js/async/7978.9532d5b8.js +0 -1
- package/__mf/js/async/8356.789e1dfb.js +0 -1
- package/__mf/js/async/8470.9b14a625.js +0 -2
- package/__mf/js/async/873.448eab23.js +0 -1
- package/__mf/js/async/8888.59eb50a2.js +0 -1
- package/__mf/js/async/9020.01c02370.js +0 -1
- package/__mf/js/async/9184.43a8d927.js +0 -1
- package/__mf/js/async/9235.36c3cd8c.js +0 -1
- package/__mf/js/async/9351.715f25c3.js +0 -1
- package/__mf/js/async/941.53b13124.js +0 -2
- package/__mf/js/async/9518.38e38a33.js +0 -1
- package/__mf/js/async/9588.9081c7de.js +0 -1
- package/__mf/js/async/9605.a92ec9c1.js +0 -1
- package/__mf/js/async/9836.00da6086.js +0 -1
- package/__mf/js/async/__federation_expose_PrometheusDatasource.3c1c02b3.js +0 -1
- package/__mf/js/async/__federation_expose_PrometheusExplorer.f4a5fd3b.js +0 -1
- package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.e524cab6.js +0 -1
- package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.0677c3da.js +0 -1
- package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.c52e7d2f.js +0 -1
- package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.d384e1e0.js +0 -1
- package/__mf/js/main.6ad7fbba.js +0 -6
- /package/__mf/js/async/{2043.d0fbb886.js.LICENSE.txt → 2043.c2948add.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.f1b4a590.js.LICENSE.txt → 392.233c0945.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4121.828d661d.js.LICENSE.txt → 4121.9ed83f2a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5440.8ced5513.js.LICENSE.txt → 5440.52ec91ad.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6274.478a68f8.js.LICENSE.txt → 6274.f04c9ecd.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6283.181cb622.js.LICENSE.txt → 7862.e13fbb9d.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8470.9b14a625.js.LICENSE.txt → 8470.84935087.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.53b13124.js.LICENSE.txt → 941.075ed563.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{54.5c908585.js.LICENSE.txt → 9916.11d16715.js.LICENSE.txt} +0 -0
|
@@ -21,9 +21,6 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
get fetchResults () {
|
|
25
|
-
return fetchResults;
|
|
26
|
-
},
|
|
27
24
|
get healthCheck () {
|
|
28
25
|
return healthCheck;
|
|
29
26
|
},
|
|
@@ -36,6 +33,9 @@ _export(exports, {
|
|
|
36
33
|
get labelValues () {
|
|
37
34
|
return labelValues;
|
|
38
35
|
},
|
|
36
|
+
get mergeQueryParams () {
|
|
37
|
+
return mergeQueryParams;
|
|
38
|
+
},
|
|
39
39
|
get metricMetadata () {
|
|
40
40
|
return metricMetadata;
|
|
41
41
|
},
|
|
@@ -49,7 +49,7 @@ _export(exports, {
|
|
|
49
49
|
return series;
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
-
const
|
|
52
|
+
const _client = require("@perses-dev/client");
|
|
53
53
|
/**
|
|
54
54
|
* Builds a query string from datasource-level query parameters.
|
|
55
55
|
* Optionally merges with existing URLSearchParams.
|
|
@@ -58,19 +58,31 @@ const _core = require("@perses-dev/core");
|
|
|
58
58
|
const urlParams = initialParams || new URLSearchParams();
|
|
59
59
|
if (queryParams) {
|
|
60
60
|
Object.entries(queryParams).forEach(([key, value])=>{
|
|
61
|
-
|
|
61
|
+
if (initialParams?.has(key)) return;
|
|
62
|
+
if (Array.isArray(value)) {
|
|
63
|
+
value.forEach((v)=>urlParams.append(key, v));
|
|
64
|
+
} else {
|
|
65
|
+
urlParams.set(key, value);
|
|
66
|
+
}
|
|
62
67
|
});
|
|
63
68
|
}
|
|
64
69
|
const queryString = urlParams.toString();
|
|
65
70
|
return queryString !== '' ? `?${queryString}` : '';
|
|
66
71
|
}
|
|
72
|
+
function mergeQueryParams(defaults, overrides) {
|
|
73
|
+
if (!defaults && !overrides) return undefined;
|
|
74
|
+
return {
|
|
75
|
+
...defaults,
|
|
76
|
+
...overrides
|
|
77
|
+
};
|
|
78
|
+
}
|
|
67
79
|
function healthCheck(queryOptions) {
|
|
68
80
|
return async ()=>{
|
|
69
81
|
const url = `${queryOptions.datasourceUrl}/-/healthy${buildQueryString(queryOptions.queryParams)}`;
|
|
70
82
|
try {
|
|
71
|
-
const resp = await
|
|
83
|
+
const resp = await fetch(url, {
|
|
72
84
|
headers: queryOptions.headers,
|
|
73
|
-
signal: queryOptions.
|
|
85
|
+
signal: queryOptions.signal
|
|
74
86
|
});
|
|
75
87
|
return resp.status === 200;
|
|
76
88
|
} catch {
|
|
@@ -114,15 +126,16 @@ function parseQuery(params, queryOptions) {
|
|
|
114
126
|
return fetchWithPost(apiURI, params, queryOptions);
|
|
115
127
|
}
|
|
116
128
|
function fetchWithGet(apiURI, params, queryOptions) {
|
|
117
|
-
const { datasourceUrl, headers, queryParams } = queryOptions;
|
|
129
|
+
const { datasourceUrl, headers, queryParams, signal } = queryOptions;
|
|
118
130
|
const url = `${datasourceUrl}${apiURI}${buildQueryString(queryParams, createSearchParams(params))}`;
|
|
119
|
-
return (0,
|
|
131
|
+
return (0, _client.fetchJson)(url, {
|
|
120
132
|
method: 'GET',
|
|
121
|
-
headers
|
|
133
|
+
headers,
|
|
134
|
+
signal
|
|
122
135
|
});
|
|
123
136
|
}
|
|
124
137
|
function fetchWithPost(apiURI, params, queryOptions) {
|
|
125
|
-
const { datasourceUrl, headers,
|
|
138
|
+
const { datasourceUrl, headers, signal, queryParams } = queryOptions;
|
|
126
139
|
const url = `${datasourceUrl}${apiURI}${buildQueryString(queryParams)}`;
|
|
127
140
|
const init = {
|
|
128
141
|
method: 'POST',
|
|
@@ -133,7 +146,7 @@ function fetchWithPost(apiURI, params, queryOptions) {
|
|
|
133
146
|
signal,
|
|
134
147
|
body: createSearchParams(params)
|
|
135
148
|
};
|
|
136
|
-
return
|
|
149
|
+
return (0, _client.fetchJson)(url, init);
|
|
137
150
|
}
|
|
138
151
|
/**
|
|
139
152
|
* Creates URLSearchParams from a request params object.
|
|
@@ -156,11 +169,3 @@ function fetchWithPost(apiURI, params, queryOptions) {
|
|
|
156
169
|
}
|
|
157
170
|
return searchParams;
|
|
158
171
|
}
|
|
159
|
-
async function fetchResults(...args) {
|
|
160
|
-
const response = await (0, _core.fetch)(...args);
|
|
161
|
-
const json = await response.json();
|
|
162
|
-
return {
|
|
163
|
-
...json,
|
|
164
|
-
rawResponse: response
|
|
165
|
-
};
|
|
166
|
-
}
|
package/lib/cjs/model/time.js
CHANGED
|
@@ -31,8 +31,8 @@ _export(exports, {
|
|
|
31
31
|
return getRangeStep;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
const _core = require("@perses-dev/core");
|
|
35
34
|
const _datefns = require("date-fns");
|
|
35
|
+
const _spec = require("@perses-dev/spec");
|
|
36
36
|
function getPrometheusTimeRange(timeRange) {
|
|
37
37
|
const { start, end } = timeRange;
|
|
38
38
|
return {
|
|
@@ -54,7 +54,7 @@ function getRangeStep(timeRange, minStepSeconds = 15, resolution = 1, suggestedS
|
|
|
54
54
|
}
|
|
55
55
|
function getDurationStringSeconds(durationString) {
|
|
56
56
|
if (!durationString) return undefined;
|
|
57
|
-
const duration = (0,
|
|
57
|
+
const duration = (0, _spec.parseDurationString)(durationString);
|
|
58
58
|
const ms = (0, _datefns.milliseconds)(duration);
|
|
59
59
|
return Math.floor(ms / 1000);
|
|
60
60
|
}
|
|
@@ -21,58 +21,17 @@ Object.defineProperty(exports, "PrometheusDatasourceEditor", {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
24
|
const _material = require("@mui/material");
|
|
26
|
-
const
|
|
25
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
27
26
|
const _Minus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Minus"));
|
|
28
|
-
const
|
|
27
|
+
const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
|
|
28
|
+
const _react = require("react");
|
|
29
29
|
const _types = require("./types");
|
|
30
30
|
function _interop_require_default(obj) {
|
|
31
31
|
return obj && obj.__esModule ? obj : {
|
|
32
32
|
default: obj
|
|
33
33
|
};
|
|
34
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
|
-
}
|
|
76
35
|
function PrometheusDatasourceEditor(props) {
|
|
77
36
|
const { value, onChange, isReadonly } = props;
|
|
78
37
|
// Counter for generating unique IDs
|
|
@@ -81,10 +40,10 @@ function PrometheusDatasourceEditor(props) {
|
|
|
81
40
|
// manipulating a map directly which causes weird UX.
|
|
82
41
|
const [entries, setEntries] = (0, _react.useState)(()=>{
|
|
83
42
|
const queryParams = value.queryParams ?? {};
|
|
84
|
-
return Object.entries(queryParams).map(([key,
|
|
43
|
+
return Object.entries(queryParams).map(([key, val])=>({
|
|
85
44
|
id: String(nextIdRef.current++),
|
|
86
45
|
key,
|
|
87
|
-
value
|
|
46
|
+
value: Array.isArray(val) ? val.join(',') : val
|
|
88
47
|
}));
|
|
89
48
|
});
|
|
90
49
|
// Check for duplicate keys
|
|
@@ -100,12 +59,15 @@ function PrometheusDatasourceEditor(props) {
|
|
|
100
59
|
}
|
|
101
60
|
});
|
|
102
61
|
const hasDuplicates = duplicateKeys.size > 0;
|
|
103
|
-
// Convert entries array to object and trigger onChange
|
|
62
|
+
// Convert entries array to object and trigger onChange.
|
|
63
|
+
// Values containing commas are stored as arrays to preserve the round-trip
|
|
64
|
+
// with the load-time join(',') in useState above.
|
|
104
65
|
const syncToParent = (newEntries)=>{
|
|
105
66
|
const newParams = {};
|
|
106
67
|
newEntries.forEach(({ key, value })=>{
|
|
107
68
|
if (key !== '') {
|
|
108
|
-
|
|
69
|
+
const parts = value.split(',');
|
|
70
|
+
newParams[key] = parts.length > 1 ? parts : value;
|
|
109
71
|
}
|
|
110
72
|
});
|
|
111
73
|
onChange({
|
|
@@ -23,16 +23,17 @@ Object.defineProperty(exports, "PrometheusLabelNamesVariable", {
|
|
|
23
23
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
24
|
const _model = require("../model");
|
|
25
25
|
const _prometheusvariables = require("./prometheus-variables");
|
|
26
|
+
const _interpolation = require("./interpolation");
|
|
26
27
|
const PrometheusLabelNamesVariable = {
|
|
27
28
|
getVariableOptions: async (spec, ctx)=>{
|
|
28
29
|
const datasourceSelector = (0, _pluginsystem.datasourceSelectValueToSelector)(spec.datasource ?? _model.DEFAULT_PROM, ctx.variables, await ctx.datasourceStore.listDatasourceSelectItems(_model.PROM_DATASOURCE_KIND)) ?? _model.DEFAULT_PROM;
|
|
29
|
-
const client = await ctx.datasourceStore.
|
|
30
|
+
const { client, requestOptions } = await (0, _interpolation.resolvePrometheusDatasource)(ctx.datasourceStore, datasourceSelector, ctx.variables);
|
|
30
31
|
const match = spec.matchers ? spec.matchers.map((m)=>(0, _pluginsystem.replaceVariables)(m, ctx.variables)) : undefined;
|
|
31
32
|
const timeRange = (0, _model.getPrometheusTimeRange)(ctx.timeRange);
|
|
32
33
|
const { data: options } = await client.labelNames({
|
|
33
34
|
'match[]': match,
|
|
34
35
|
...timeRange
|
|
35
|
-
});
|
|
36
|
+
}, requestOptions);
|
|
36
37
|
return {
|
|
37
38
|
data: (0, _prometheusvariables.stringArrayToVariableOptions)(options)
|
|
38
39
|
};
|
|
@@ -23,18 +23,19 @@ Object.defineProperty(exports, "PrometheusLabelValuesVariable", {
|
|
|
23
23
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
24
|
const _model = require("../model");
|
|
25
25
|
const _prometheusvariables = require("./prometheus-variables");
|
|
26
|
+
const _interpolation = require("./interpolation");
|
|
26
27
|
const PrometheusLabelValuesVariable = {
|
|
27
28
|
getVariableOptions: async (spec, ctx)=>{
|
|
28
29
|
const pluginDef = spec;
|
|
29
30
|
const datasourceSelector = (0, _pluginsystem.datasourceSelectValueToSelector)(spec.datasource ?? _model.DEFAULT_PROM, ctx.variables, await ctx.datasourceStore.listDatasourceSelectItems(_model.PROM_DATASOURCE_KIND)) ?? _model.DEFAULT_PROM;
|
|
30
|
-
const client = await ctx.datasourceStore.
|
|
31
|
+
const { client, requestOptions } = await (0, _interpolation.resolvePrometheusDatasource)(ctx.datasourceStore, datasourceSelector, ctx.variables);
|
|
31
32
|
const match = pluginDef.matchers ? pluginDef.matchers.map((m)=>(0, _pluginsystem.replaceVariables)(m, ctx.variables)) : undefined;
|
|
32
33
|
const timeRange = (0, _model.getPrometheusTimeRange)(ctx.timeRange);
|
|
33
34
|
const { data: options } = await client.labelValues({
|
|
34
35
|
labelName: (0, _pluginsystem.replaceVariables)(pluginDef.labelName, ctx.variables),
|
|
35
36
|
'match[]': match,
|
|
36
37
|
...timeRange
|
|
37
|
-
});
|
|
38
|
+
}, requestOptions);
|
|
38
39
|
return {
|
|
39
40
|
data: (0, _prometheusvariables.stringArrayToVariableOptions)(options)
|
|
40
41
|
};
|
|
@@ -23,14 +23,15 @@ Object.defineProperty(exports, "PrometheusPromQLVariable", {
|
|
|
23
23
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
24
|
const _model = require("../model");
|
|
25
25
|
const _prometheusvariables = require("./prometheus-variables");
|
|
26
|
+
const _interpolation = require("./interpolation");
|
|
26
27
|
const PrometheusPromQLVariable = {
|
|
27
28
|
getVariableOptions: async (spec, ctx)=>{
|
|
28
29
|
const datasourceSelector = (0, _pluginsystem.datasourceSelectValueToSelector)(spec.datasource ?? _model.DEFAULT_PROM, ctx.variables, await ctx.datasourceStore.listDatasourceSelectItems(_model.PROM_DATASOURCE_KIND)) ?? _model.DEFAULT_PROM;
|
|
29
|
-
const client = await ctx.datasourceStore.
|
|
30
|
+
const { client, requestOptions } = await (0, _interpolation.resolvePrometheusDatasource)(ctx.datasourceStore, datasourceSelector, ctx.variables);
|
|
30
31
|
// TODO we may want to manage a range query as well.
|
|
31
32
|
const { data: options } = await client.instantQuery({
|
|
32
33
|
query: (0, _pluginsystem.replaceVariables)(spec.expr, ctx.variables)
|
|
33
|
-
});
|
|
34
|
+
}, requestOptions);
|
|
34
35
|
const labelName = (0, _pluginsystem.replaceVariables)(spec.labelName, ctx.variables);
|
|
35
36
|
let values = [];
|
|
36
37
|
if (options?.resultType === 'matrix') {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Copyright 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
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get interpolateDatasourceProxyParams () {
|
|
25
|
+
return interpolateDatasourceProxyParams;
|
|
26
|
+
},
|
|
27
|
+
get resolvePrometheusDatasource () {
|
|
28
|
+
return resolvePrometheusDatasource;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const _components = require("@perses-dev/components");
|
|
32
|
+
async function resolvePrometheusDatasource(datasourceStore, selector, variableState) {
|
|
33
|
+
const [client, datasource] = await Promise.all([
|
|
34
|
+
datasourceStore.getDatasourceClient(selector),
|
|
35
|
+
datasourceStore.getDatasource(selector)
|
|
36
|
+
]);
|
|
37
|
+
const { headers, queryParams } = interpolateDatasourceProxyParams(datasource, variableState);
|
|
38
|
+
return {
|
|
39
|
+
client,
|
|
40
|
+
requestOptions: {
|
|
41
|
+
headers,
|
|
42
|
+
queryParams
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function interpolateDatasourceProxyParams(datasource, variableState) {
|
|
47
|
+
const spec = datasource.plugin.spec;
|
|
48
|
+
const rawHeaders = spec.proxy?.spec?.headers;
|
|
49
|
+
const rawQueryParams = spec.queryParams;
|
|
50
|
+
return {
|
|
51
|
+
headers: rawHeaders ? (0, _components.interpolateHeaders)(rawHeaders, variableState) : undefined,
|
|
52
|
+
queryParams: rawQueryParams ? (0, _components.interpolateQueryParams)(rawQueryParams, variableState) : undefined
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -22,6 +22,14 @@ Object.defineProperty(exports, "PrometheusDatasource", {
|
|
|
22
22
|
});
|
|
23
23
|
const _model = require("../model");
|
|
24
24
|
const _PrometheusDatasourceEditor = require("./PrometheusDatasourceEditor");
|
|
25
|
+
function wrapClientMethod(fn, datasourceUrl, specHeaders, specQueryParams) {
|
|
26
|
+
return (params, options)=>fn(params, {
|
|
27
|
+
datasourceUrl,
|
|
28
|
+
headers: options?.headers ?? specHeaders,
|
|
29
|
+
signal: options?.signal,
|
|
30
|
+
queryParams: (0, _model.mergeQueryParams)(specQueryParams, options?.queryParams)
|
|
31
|
+
});
|
|
32
|
+
}
|
|
25
33
|
/**
|
|
26
34
|
* Creates a PrometheusClient for a specific datasource spec.
|
|
27
35
|
*/ const createClient = (spec, options)=>{
|
|
@@ -43,48 +51,13 @@ const _PrometheusDatasourceEditor = require("./PrometheusDatasourceEditor");
|
|
|
43
51
|
headers: specHeaders,
|
|
44
52
|
queryParams
|
|
45
53
|
}),
|
|
46
|
-
instantQuery: (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
datasourceUrl,
|
|
54
|
-
headers: headers ?? specHeaders,
|
|
55
|
-
abortSignal,
|
|
56
|
-
queryParams
|
|
57
|
-
}),
|
|
58
|
-
labelNames: (params, headers, abortSignal)=>(0, _model.labelNames)(params, {
|
|
59
|
-
datasourceUrl,
|
|
60
|
-
headers: headers ?? specHeaders,
|
|
61
|
-
abortSignal,
|
|
62
|
-
queryParams
|
|
63
|
-
}),
|
|
64
|
-
labelValues: (params, headers, abortSignal)=>(0, _model.labelValues)(params, {
|
|
65
|
-
datasourceUrl,
|
|
66
|
-
headers: headers ?? specHeaders,
|
|
67
|
-
abortSignal,
|
|
68
|
-
queryParams
|
|
69
|
-
}),
|
|
70
|
-
metricMetadata: (params, headers, abortSignal)=>(0, _model.metricMetadata)(params, {
|
|
71
|
-
datasourceUrl,
|
|
72
|
-
headers: headers ?? specHeaders,
|
|
73
|
-
abortSignal,
|
|
74
|
-
queryParams
|
|
75
|
-
}),
|
|
76
|
-
series: (params, headers, abortSignal)=>(0, _model.series)(params, {
|
|
77
|
-
datasourceUrl,
|
|
78
|
-
headers: headers ?? specHeaders,
|
|
79
|
-
abortSignal,
|
|
80
|
-
queryParams
|
|
81
|
-
}),
|
|
82
|
-
parseQuery: (params, headers, abortSignal)=>(0, _model.parseQuery)(params, {
|
|
83
|
-
datasourceUrl,
|
|
84
|
-
headers: headers ?? specHeaders,
|
|
85
|
-
abortSignal,
|
|
86
|
-
queryParams
|
|
87
|
-
})
|
|
54
|
+
instantQuery: wrapClientMethod(_model.instantQuery, datasourceUrl, specHeaders, queryParams),
|
|
55
|
+
rangeQuery: wrapClientMethod(_model.rangeQuery, datasourceUrl, specHeaders, queryParams),
|
|
56
|
+
labelNames: wrapClientMethod(_model.labelNames, datasourceUrl, specHeaders, queryParams),
|
|
57
|
+
labelValues: wrapClientMethod(_model.labelValues, datasourceUrl, specHeaders, queryParams),
|
|
58
|
+
metricMetadata: wrapClientMethod(_model.metricMetadata, datasourceUrl, specHeaders, queryParams),
|
|
59
|
+
series: wrapClientMethod(_model.series, datasourceUrl, specHeaders, queryParams),
|
|
60
|
+
parseQuery: wrapClientMethod(_model.parseQuery, datasourceUrl, specHeaders, queryParams)
|
|
88
61
|
};
|
|
89
62
|
};
|
|
90
63
|
const getBuiltinVariableDefinitions = ()=>{
|
|
@@ -20,11 +20,12 @@ Object.defineProperty(exports, "getTimeSeriesData", {
|
|
|
20
20
|
return getTimeSeriesData;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
const _core = require("@perses-dev/core");
|
|
24
23
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
24
|
const _datefns = require("date-fns");
|
|
25
|
+
const _spec = require("@perses-dev/spec");
|
|
26
26
|
const _model = require("../../model");
|
|
27
27
|
const _utils = require("../../utils");
|
|
28
|
+
const _interpolation = require("../interpolation");
|
|
28
29
|
const _types = require("../types");
|
|
29
30
|
const _replaceprombuiltinvariables = require("./replace-prom-builtin-variables");
|
|
30
31
|
const getTimeSeriesData = async (spec, context, abortSignal)=>{
|
|
@@ -37,7 +38,8 @@ const getTimeSeriesData = async (spec, context, abortSignal)=>{
|
|
|
37
38
|
const listDatasourceSelectItems = await context.datasourceStore.listDatasourceSelectItems(_model.PROM_DATASOURCE_KIND);
|
|
38
39
|
const selectedDatasource = (0, _pluginsystem.datasourceSelectValueToSelector)(spec.datasource ?? _model.DEFAULT_PROM, context.variableState, listDatasourceSelectItems) ?? _model.DEFAULT_PROM;
|
|
39
40
|
const datasource = await context.datasourceStore.getDatasource(selectedDatasource);
|
|
40
|
-
const
|
|
41
|
+
const interpolatedOptions = (0, _interpolation.interpolateDatasourceProxyParams)(datasource, context.variableState);
|
|
42
|
+
const datasourceScrapeInterval = Math.trunc((0, _datefns.milliseconds)((0, _spec.parseDurationString)(datasource.plugin.spec.scrapeInterval ?? _types.DEFAULT_SCRAPE_INTERVAL)) / 1000);
|
|
41
43
|
// Min step is the lower bound of the interval between data points
|
|
42
44
|
// If no value is provided for it, it should default to the scrape interval of the datasource
|
|
43
45
|
const minStep = (0, _model.getDurationStringSeconds)(// resolve any variable that may have been provided
|
|
@@ -79,7 +81,10 @@ const getTimeSeriesData = async (spec, context, abortSignal)=>{
|
|
|
79
81
|
response = await client.instantQuery({
|
|
80
82
|
query,
|
|
81
83
|
time: end
|
|
82
|
-
},
|
|
84
|
+
}, {
|
|
85
|
+
...interpolatedOptions,
|
|
86
|
+
signal: abortSignal
|
|
87
|
+
});
|
|
83
88
|
break;
|
|
84
89
|
case 'range':
|
|
85
90
|
default:
|
|
@@ -88,7 +93,10 @@ const getTimeSeriesData = async (spec, context, abortSignal)=>{
|
|
|
88
93
|
start,
|
|
89
94
|
end,
|
|
90
95
|
step
|
|
91
|
-
},
|
|
96
|
+
}, {
|
|
97
|
+
...interpolatedOptions,
|
|
98
|
+
signal: abortSignal
|
|
99
|
+
});
|
|
92
100
|
break;
|
|
93
101
|
}
|
|
94
102
|
// TODO: What about error responses from Prom that have a response body?
|
|
@@ -21,13 +21,13 @@ Object.defineProperty(exports, "replacePromBuiltinVariables", {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
|
-
const
|
|
24
|
+
const _spec = require("@perses-dev/spec");
|
|
25
25
|
function replacePromBuiltinVariables(query, minStepMs, intervalMs) {
|
|
26
26
|
let updatedQuery = (0, _pluginsystem.replaceVariable)(query, '__interval_ms', intervalMs.toString());
|
|
27
|
-
updatedQuery = (0, _pluginsystem.replaceVariable)(updatedQuery, '__interval', (0,
|
|
27
|
+
updatedQuery = (0, _pluginsystem.replaceVariable)(updatedQuery, '__interval', (0, _spec.formatDuration)((0, _spec.convertTimeToDuration)(intervalMs)));
|
|
28
28
|
// The $__rate_interval variable is meant to be used with the rate() promQL function.
|
|
29
29
|
// It is defined as max($__interval + Min step, 4 * Min step)
|
|
30
30
|
const rateIntervalMs = Math.max(intervalMs + minStepMs, 4 * minStepMs);
|
|
31
|
-
updatedQuery = (0, _pluginsystem.replaceVariable)(updatedQuery, '__rate_interval', (0,
|
|
31
|
+
updatedQuery = (0, _pluginsystem.replaceVariable)(updatedQuery, '__rate_interval', (0, _spec.formatDuration)((0, _spec.convertTimeToDuration)(rateIntervalMs)));
|
|
32
32
|
return updatedQuery;
|
|
33
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeNode.d.ts","sourceRoot":"","sources":["../../../src/components/TreeNode.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,YAAY,EAA8D,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TreeNode.d.ts","sourceRoot":"","sources":["../../../src/components/TreeNode.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,YAAY,EAA8D,MAAM,OAAO,CAAC;AAIjG,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,OAAqB,MAAM,cAAc,CAAC;AAejD,KAAK,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAiB7D,UAAU,aAAa;IAErB,IAAI,EAAE,OAAO,CAAC;IAEd,QAAQ,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAEjC,OAAO,EAAE,OAAO,CAAC;IAEjB,UAAU,EAAE,4BAA4B,CAAC;IAGzC,QAAQ,EAAE,MAAM,CAAC;IAGjB,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CAChE;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,UAAU,EACV,QAAQ,EACR,eAAe,GAChB,EAAE,aAAa,GAAG,YAAY,CAoP9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/TreeNode.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Forked from https://github.com/prometheus/prometheus/blob/65f610353919b1c7b42d3776c3a95b68046a6bba/web/ui/mantine-ui/src/pages/query/TreeNode.tsx\n\nimport { Box, CircularProgress, List, ListItem, Stack, Tooltip, Typography, useTheme } from '@mui/material';\nimport CircleIcon from 'mdi-material-ui/Circle';\nimport { ReactElement, useCallback, useEffect, useLayoutEffect, useMemo, useState } from 'react';\nimport AlertCircle from 'mdi-material-ui/AlertCircle';\nimport { StatusError } from '@perses-dev/core';\nimport { PrometheusDatasourceSelector } from '../model';\nimport ASTNode, { nodeType } from './promql/ast';\nimport { escapeString, getNodeChildren } from './promql/utils';\nimport { formatNode } from './promql/format';\nimport serializeNode from './promql/serialize';\nimport { functionSignatures } from './promql/functionSignatures';\nimport { useInstantQuery } from './query';\n\n// The indentation factor for each level of the tree.\nconst nodeIndent = 5;\nconst connectorWidth = nodeIndent * 5;\n\n// max number of label names and values to show in the individual query status\nconst maxLabelNames = 10;\nconst maxLabelValues = 10;\n\ntype NodeState = 'waiting' | 'running' | 'error' | 'success';\n\n// mergeChildStates basically returns the \"worst\" state found among the children.\nconst mergeChildStates = (states: NodeState[]): NodeState => {\n if (states.includes('error')) {\n return 'error';\n }\n if (states.includes('waiting')) {\n return 'waiting';\n }\n if (states.includes('running')) {\n return 'running';\n }\n\n return 'success';\n};\n\ninterface TreeNodeProps {\n // The AST node to render.\n node: ASTNode;\n // The parent element of this node.\n parentEl?: HTMLDivElement | null;\n // Used to compute the position of the connector line between this node and its parent.\n reverse: boolean;\n // Datasource used for the node's individual query.\n datasource: PrometheusDatasourceSelector;\n // The index of this node in its parent's children.\n // Used to render the node's individual query.\n childIdx: number;\n // Function to report the node state to the parent.\n // Used to render the node's individual query.\n reportNodeState?: (childIdx: number, state: NodeState) => void;\n}\n\nexport default function TreeNode({\n node,\n parentEl,\n reverse,\n datasource,\n childIdx,\n reportNodeState,\n}: TreeNodeProps): ReactElement {\n const theme = useTheme();\n const children = getNodeChildren(node);\n\n // A normal ref won't work properly here because the ref's `current` property\n // going from `null` to defined won't trigger a re-render of the child\n // component, since it's not a React state update. So we manually have to\n // create a state update using a callback ref. See also\n // https://tkdodo.eu/blog/avoiding-use-effect-with-callback-refs\n const [nodeEl, setNodeEl] = useState<HTMLDivElement | null>(null);\n const nodeRef = useCallback((node: HTMLDivElement) => setNodeEl(node), []);\n\n const [resultStats, setResultStats] = useState<{\n numSeries: number;\n labelExamples: Record<string, Array<{ value: string; count: number }>>;\n sortedLabelCards: Array<[string, number]>;\n }>({\n numSeries: 0,\n labelExamples: {},\n sortedLabelCards: [],\n });\n\n const [connectorStyle, setConnectorStyle] = useState({\n borderColor: theme.palette.grey['500'],\n borderLeftStyle: 'solid',\n borderLeftWidth: 2,\n width: connectorWidth,\n left: -connectorWidth,\n });\n\n const [childStates, setChildStates] = useState<NodeState[]>(children.map(() => 'waiting'));\n const mergedChildState = useMemo(() => mergeChildStates(childStates), [childStates]);\n\n // Optimize range vector selector fetches to give us the info we're looking for\n // more cheaply. E.g. 'foo[7w]' can be expensive to fully fetch, but wrapping it\n // in 'last_over_time(foo[7w])' is cheaper and also gives us all the info we\n // need (number of series and labels).\n let queryNode = node;\n if (queryNode.type === nodeType.matrixSelector) {\n queryNode = {\n type: nodeType.call,\n func: functionSignatures.last_over_time!,\n args: [node],\n };\n }\n\n // Individual query for the current node\n const {\n data: instantQueryResponse,\n isFetching,\n error,\n } = useInstantQuery(serializeNode(queryNode) ?? '', datasource, mergedChildState === 'success');\n\n // report the node state to the parent\n useEffect(() => {\n if (reportNodeState) {\n if (mergedChildState === 'error' || error) {\n reportNodeState(childIdx, 'error');\n } else if (isFetching) {\n reportNodeState(childIdx, 'running');\n }\n }\n }, [mergedChildState, error, isFetching, reportNodeState, childIdx]);\n\n // This function is passed down to the child nodes so they can report their state.\n const childReportNodeState = useCallback(\n (childIdx: number, state: NodeState) => {\n setChildStates((prev) => {\n const newStates = [...prev];\n newStates[childIdx] = state;\n return newStates;\n });\n },\n [setChildStates]\n );\n\n // Update the size and position of tree connector lines based on the node's and its parent's position.\n useLayoutEffect(() => {\n if (parentEl === undefined) {\n // We're the root node.\n return;\n }\n\n if (parentEl === null || nodeEl === null) {\n // Either of the two connected nodes hasn't been rendered yet.\n return;\n }\n\n const parentRect = parentEl.getBoundingClientRect();\n const nodeRect = nodeEl.getBoundingClientRect();\n if (reverse) {\n setConnectorStyle((prevStyle) => ({\n ...prevStyle,\n top: 'calc(50% - 1px)',\n bottom: nodeRect.bottom - parentRect.top,\n borderTopLeftRadius: 10,\n borderTopStyle: 'solid',\n borderBottomLeftRadius: undefined,\n }));\n } else {\n setConnectorStyle((prevStyle) => ({\n ...prevStyle,\n top: parentRect.bottom - nodeRect.top,\n bottom: 'calc(50% - 1px)',\n borderBottomLeftRadius: 10,\n borderBottomStyle: 'solid',\n borderTopLeftRadius: undefined,\n }));\n }\n }, [parentEl, nodeEl, reverse, nodeRef, setConnectorStyle]);\n\n // Update the node info state based on the query result.\n useEffect(() => {\n if (instantQueryResponse?.status !== 'success') {\n return;\n }\n\n if (reportNodeState) {\n reportNodeState(childIdx, 'success');\n }\n\n let resultSeries = 0;\n // labelValuesByName records the number of times each label value appears for each label name.\n const labelValuesByName: Record<string, Record<string, number>> = {};\n const { resultType, result } = instantQueryResponse.data;\n\n if (resultType === 'scalar' || resultType === 'string') {\n resultSeries = 1;\n } else if (result && result.length > 0) {\n resultSeries = result.length;\n result.forEach((s) => {\n Object.entries(s.metric).forEach(([ln, lv]) => {\n // TODO: If we ever want to include __name__ here again, we cannot use the\n // last_over_time(foo[7d]) optimization since that removes the metric name.\n if (ln !== '__name__') {\n labelValuesByName[ln] = labelValuesByName[ln] ?? {};\n labelValuesByName[ln]![lv] = (labelValuesByName[ln]![lv] ?? 0) + 1;\n }\n });\n });\n }\n\n // labelCardinalities records the number of unique label values for each label name.\n const labelCardinalities: Record<string, number> = {};\n // labelExamples records the most common label values for each label name.\n const labelExamples: Record<string, Array<{ value: string; count: number }>> = {};\n Object.entries(labelValuesByName).forEach(([ln, lvs]) => {\n labelCardinalities[ln] = Object.keys(lvs).length;\n // Sort label values by their number of occurrences within this label name.\n labelExamples[ln] = Object.entries(lvs)\n .sort(([, aCnt], [, bCnt]) => bCnt - aCnt)\n .slice(0, maxLabelValues)\n .map(([lv, cnt]) => ({ value: lv, count: cnt }));\n });\n\n setResultStats({\n numSeries: resultSeries,\n sortedLabelCards: Object.entries(labelCardinalities).sort((a, b) => b[1] - a[1]),\n labelExamples,\n });\n }, [instantQueryResponse, reportNodeState, childIdx]);\n\n const innerNode = (\n <Stack direction=\"row\" gap={2}>\n <Box\n ref={nodeRef}\n sx={{\n position: 'relative',\n display: 'inline-block',\n padding: 1,\n marginBottom: 1.5,\n borderRadius: 2,\n backgroundColor: theme.palette.background.code,\n }}\n >\n {parentEl !== undefined && (\n // Connector line between this node and its parent.\n <Box\n sx={{\n position: 'absolute',\n display: 'inline-block',\n ...connectorStyle,\n }}\n />\n )}\n {/* The node (visible box) itself. */}\n {formatNode(node, false, 1)}\n </Box>\n {/* The node's individual query: */}\n <QueryStatus\n mergedChildState={mergedChildState}\n isFetching={isFetching}\n error={error}\n resultStats={resultStats}\n responseTime={instantQueryResponse?.responseTime}\n />\n </Stack>\n );\n\n if (node.type === nodeType.binaryExpr) {\n return (\n <div>\n <Box ml={nodeIndent}>\n <TreeNode\n node={children[0]!}\n parentEl={nodeEl}\n reverse={true}\n datasource={datasource}\n childIdx={0}\n reportNodeState={childReportNodeState}\n />\n </Box>\n {innerNode}\n <Box ml={nodeIndent}>\n <TreeNode\n node={children[1]!}\n parentEl={nodeEl}\n reverse={false}\n datasource={datasource}\n childIdx={1}\n reportNodeState={childReportNodeState}\n />\n </Box>\n </div>\n );\n }\n\n return (\n <div>\n {innerNode}\n {children.map((child, idx) => (\n <Box ml={nodeIndent} key={idx}>\n <TreeNode\n node={child}\n parentEl={nodeEl}\n reverse={false}\n datasource={datasource}\n childIdx={idx}\n reportNodeState={childReportNodeState}\n />\n </Box>\n ))}\n </div>\n );\n}\n\ninterface QueryStatusProps {\n mergedChildState: NodeState;\n isFetching: boolean;\n error: StatusError | null;\n resultStats: {\n numSeries: number;\n labelExamples: Record<string, Array<{ value: string; count: number }>>;\n sortedLabelCards: Array<[string, number]>;\n };\n responseTime?: number;\n}\n\nfunction QueryStatus({\n mergedChildState,\n isFetching,\n error,\n resultStats,\n responseTime,\n}: QueryStatusProps): ReactElement {\n if (mergedChildState === 'waiting') {\n return <ProgressState text=\"Waiting for child query\" />;\n }\n\n if (mergedChildState === 'running') {\n return <ProgressState text=\"Running\" />;\n }\n\n if (mergedChildState === 'error') {\n return (\n <Stack>\n <AlertCircle />\n Blocked on child query error\n </Stack>\n );\n }\n\n if (isFetching) {\n return <ProgressState text=\"Loading\" />;\n }\n\n if (error) {\n return (\n <Box\n display=\"flex\"\n alignItems=\"center\"\n gap={1}\n sx={{ color: (theme) => theme.palette.error.main }}\n marginBottom={1.5}\n >\n <AlertCircle />\n <Typography variant=\"body2\">\n <strong>Error executing query:</strong> {error.message}\n </Typography>\n </Box>\n );\n }\n\n return (\n <Stack direction=\"row\" gap={1} alignItems=\"center\" marginBottom={1.5}>\n <Typography variant=\"body2\" component=\"span\" sx={{ color: (theme) => theme.palette.grey[500] }}>\n {resultStats.numSeries} result{resultStats.numSeries !== 1 && 's'}\n – \n {responseTime ? `${Math.round(responseTime)}ms` : '? ms'}\n {resultStats.sortedLabelCards.length > 0 && <> –</>}\n </Typography>\n {resultStats.sortedLabelCards.slice(0, maxLabelNames).map(([ln, cnt]) => (\n <Tooltip\n key={ln}\n title={\n <Box>\n <List dense>\n {resultStats.labelExamples[ln]?.map(({ value, count }) => (\n <ListItem\n key={value}\n sx={{\n display: 'flex',\n gap: 1,\n py: 0,\n px: 0.5,\n }}\n >\n <CircleIcon sx={{ fontSize: 8 }} />\n <Typography\n variant=\"body2\"\n component=\"span\"\n sx={{\n color: (theme) =>\n theme.palette.mode === 'dark' // TODO we shouldnt have to do that I guess..\n ? theme.palette.warning.dark\n : theme.palette.warning.main,\n fontFamily: 'monospace',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n flexGrow: 1,\n }}\n >\n {escapeString(value)}\n </Typography>\n <Typography\n variant=\"body2\"\n component=\"span\"\n sx={{\n whiteSpace: 'nowrap',\n flexShrink: 0,\n }}\n >\n ({count}x)\n </Typography>\n </ListItem>\n ))}\n {cnt > maxLabelValues && (\n <ListItem\n sx={{\n display: 'flex',\n gap: 1,\n py: 0,\n px: 0.5,\n }}\n >\n <CircleIcon sx={{ fontSize: 8 }} />\n <Typography variant=\"body2\">. . .</Typography>\n </ListItem>\n )}\n </List>\n </Box>\n }\n arrow\n >\n <span style={{ cursor: 'pointer', whiteSpace: 'nowrap' }}>\n <Typography\n variant=\"body2\"\n component=\"span\"\n sx={{ fontFamily: 'monospace', color: (theme) => theme.palette.success.main }}\n >\n {ln}\n </Typography>\n <Typography variant=\"body2\" component=\"span\" sx={{ color: (theme) => theme.palette.grey[500] }}>\n : {cnt}\n </Typography>\n </span>\n </Tooltip>\n ))}\n {resultStats.sortedLabelCards.length > maxLabelNames ? (\n <Typography variant=\"body2\">...{resultStats.sortedLabelCards.length - maxLabelNames} more...</Typography>\n ) : null}\n </Stack>\n );\n}\n\nfunction ProgressState({ text }: { text: string }): ReactElement {\n return (\n <Box display=\"flex\" alignItems=\"center\" gap={1} marginBottom={1.5}>\n <CircularProgress size={16} color=\"secondary\" />\n <Typography variant=\"body2\" color=\"text.secondary\">\n {text}...\n </Typography>\n </Box>\n );\n}\n"],"names":["Box","CircularProgress","List","ListItem","Stack","Tooltip","Typography","useTheme","CircleIcon","useCallback","useEffect","useLayoutEffect","useMemo","useState","AlertCircle","nodeType","escapeString","getNodeChildren","formatNode","serializeNode","functionSignatures","useInstantQuery","nodeIndent","connectorWidth","maxLabelNames","maxLabelValues","mergeChildStates","states","includes","TreeNode","node","parentEl","reverse","datasource","childIdx","reportNodeState","theme","children","nodeEl","setNodeEl","nodeRef","resultStats","setResultStats","numSeries","labelExamples","sortedLabelCards","connectorStyle","setConnectorStyle","borderColor","palette","grey","borderLeftStyle","borderLeftWidth","width","left","childStates","setChildStates","map","mergedChildState","queryNode","type","matrixSelector","call","func","last_over_time","args","data","instantQueryResponse","isFetching","error","childReportNodeState","state","prev","newStates","undefined","parentRect","getBoundingClientRect","nodeRect","prevStyle","top","bottom","borderTopLeftRadius","borderTopStyle","borderBottomLeftRadius","borderBottomStyle","status","resultSeries","labelValuesByName","resultType","result","length","forEach","s","Object","entries","metric","ln","lv","labelCardinalities","lvs","keys","sort","aCnt","bCnt","slice","cnt","value","count","a","b","innerNode","direction","gap","ref","sx","position","display","padding","marginBottom","borderRadius","backgroundColor","background","code","QueryStatus","responseTime","binaryExpr","div","ml","child","idx","ProgressState","text","alignItems","color","main","variant","strong","message","component","Math","round","title","dense","py","px","fontSize","mode","warning","dark","fontFamily","whiteSpace","overflow","textOverflow","flexGrow","flexShrink","arrow","span","style","cursor","success","size"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,oJAAoJ;AAEpJ,SAASA,GAAG,EAAEC,gBAAgB,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,OAAO,EAAEC,UAAU,EAAEC,QAAQ,QAAQ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oBAC/BF;oBAAK;;;;;AAId"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/TreeNode.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Forked from https://github.com/prometheus/prometheus/blob/65f610353919b1c7b42d3776c3a95b68046a6bba/web/ui/mantine-ui/src/pages/query/TreeNode.tsx\n\nimport { Box, CircularProgress, List, ListItem, Stack, Tooltip, Typography, useTheme } from '@mui/material';\nimport CircleIcon from 'mdi-material-ui/Circle';\nimport { ReactElement, useCallback, useEffect, useLayoutEffect, useMemo, useState } from 'react';\nimport AlertCircle from 'mdi-material-ui/AlertCircle';\n\nimport { StatusError } from '@perses-dev/client';\nimport { PrometheusDatasourceSelector } from '../model';\nimport ASTNode, { nodeType } from './promql/ast';\nimport { escapeString, getNodeChildren } from './promql/utils';\nimport { formatNode } from './promql/format';\nimport serializeNode from './promql/serialize';\nimport { functionSignatures } from './promql/functionSignatures';\nimport { useInstantQuery } from './query';\n\n// The indentation factor for each level of the tree.\nconst nodeIndent = 5;\nconst connectorWidth = nodeIndent * 5;\n\n// max number of label names and values to show in the individual query status\nconst maxLabelNames = 10;\nconst maxLabelValues = 10;\n\ntype NodeState = 'waiting' | 'running' | 'error' | 'success';\n\n// mergeChildStates basically returns the \"worst\" state found among the children.\nconst mergeChildStates = (states: NodeState[]): NodeState => {\n if (states.includes('error')) {\n return 'error';\n }\n if (states.includes('waiting')) {\n return 'waiting';\n }\n if (states.includes('running')) {\n return 'running';\n }\n\n return 'success';\n};\n\ninterface TreeNodeProps {\n // The AST node to render.\n node: ASTNode;\n // The parent element of this node.\n parentEl?: HTMLDivElement | null;\n // Used to compute the position of the connector line between this node and its parent.\n reverse: boolean;\n // Datasource used for the node's individual query.\n datasource: PrometheusDatasourceSelector;\n // The index of this node in its parent's children.\n // Used to render the node's individual query.\n childIdx: number;\n // Function to report the node state to the parent.\n // Used to render the node's individual query.\n reportNodeState?: (childIdx: number, state: NodeState) => void;\n}\n\nexport default function TreeNode({\n node,\n parentEl,\n reverse,\n datasource,\n childIdx,\n reportNodeState,\n}: TreeNodeProps): ReactElement {\n const theme = useTheme();\n const children = getNodeChildren(node);\n\n // A normal ref won't work properly here because the ref's `current` property\n // going from `null` to defined won't trigger a re-render of the child\n // component, since it's not a React state update. So we manually have to\n // create a state update using a callback ref. See also\n // https://tkdodo.eu/blog/avoiding-use-effect-with-callback-refs\n const [nodeEl, setNodeEl] = useState<HTMLDivElement | null>(null);\n const nodeRef = useCallback((node: HTMLDivElement) => setNodeEl(node), []);\n\n const [resultStats, setResultStats] = useState<{\n numSeries: number;\n labelExamples: Record<string, Array<{ value: string; count: number }>>;\n sortedLabelCards: Array<[string, number]>;\n }>({\n numSeries: 0,\n labelExamples: {},\n sortedLabelCards: [],\n });\n\n const [connectorStyle, setConnectorStyle] = useState({\n borderColor: theme.palette.grey['500'],\n borderLeftStyle: 'solid',\n borderLeftWidth: 2,\n width: connectorWidth,\n left: -connectorWidth,\n });\n\n const [childStates, setChildStates] = useState<NodeState[]>(children.map(() => 'waiting'));\n const mergedChildState = useMemo(() => mergeChildStates(childStates), [childStates]);\n\n // Optimize range vector selector fetches to give us the info we're looking for\n // more cheaply. E.g. 'foo[7w]' can be expensive to fully fetch, but wrapping it\n // in 'last_over_time(foo[7w])' is cheaper and also gives us all the info we\n // need (number of series and labels).\n let queryNode = node;\n if (queryNode.type === nodeType.matrixSelector) {\n queryNode = {\n type: nodeType.call,\n func: functionSignatures.last_over_time!,\n args: [node],\n };\n }\n\n // Individual query for the current node\n const {\n data: instantQueryResponse,\n isFetching,\n error,\n } = useInstantQuery(serializeNode(queryNode) ?? '', datasource, mergedChildState === 'success');\n\n // report the node state to the parent\n useEffect(() => {\n if (reportNodeState) {\n if (mergedChildState === 'error' || error) {\n reportNodeState(childIdx, 'error');\n } else if (isFetching) {\n reportNodeState(childIdx, 'running');\n }\n }\n }, [mergedChildState, error, isFetching, reportNodeState, childIdx]);\n\n // This function is passed down to the child nodes so they can report their state.\n const childReportNodeState = useCallback(\n (childIdx: number, state: NodeState) => {\n setChildStates((prev) => {\n const newStates = [...prev];\n newStates[childIdx] = state;\n return newStates;\n });\n },\n [setChildStates]\n );\n\n // Update the size and position of tree connector lines based on the node's and its parent's position.\n useLayoutEffect(() => {\n if (parentEl === undefined) {\n // We're the root node.\n return;\n }\n\n if (parentEl === null || nodeEl === null) {\n // Either of the two connected nodes hasn't been rendered yet.\n return;\n }\n\n const parentRect = parentEl.getBoundingClientRect();\n const nodeRect = nodeEl.getBoundingClientRect();\n if (reverse) {\n setConnectorStyle((prevStyle) => ({\n ...prevStyle,\n top: 'calc(50% - 1px)',\n bottom: nodeRect.bottom - parentRect.top,\n borderTopLeftRadius: 10,\n borderTopStyle: 'solid',\n borderBottomLeftRadius: undefined,\n }));\n } else {\n setConnectorStyle((prevStyle) => ({\n ...prevStyle,\n top: parentRect.bottom - nodeRect.top,\n bottom: 'calc(50% - 1px)',\n borderBottomLeftRadius: 10,\n borderBottomStyle: 'solid',\n borderTopLeftRadius: undefined,\n }));\n }\n }, [parentEl, nodeEl, reverse, nodeRef, setConnectorStyle]);\n\n // Update the node info state based on the query result.\n useEffect(() => {\n if (instantQueryResponse?.status !== 'success') {\n return;\n }\n\n if (reportNodeState) {\n reportNodeState(childIdx, 'success');\n }\n\n let resultSeries = 0;\n // labelValuesByName records the number of times each label value appears for each label name.\n const labelValuesByName: Record<string, Record<string, number>> = {};\n const { resultType, result } = instantQueryResponse.data;\n\n if (resultType === 'scalar' || resultType === 'string') {\n resultSeries = 1;\n } else if (result && result.length > 0) {\n resultSeries = result.length;\n result.forEach((s) => {\n Object.entries(s.metric).forEach(([ln, lv]) => {\n // TODO: If we ever want to include __name__ here again, we cannot use the\n // last_over_time(foo[7d]) optimization since that removes the metric name.\n if (ln !== '__name__') {\n labelValuesByName[ln] = labelValuesByName[ln] ?? {};\n labelValuesByName[ln]![lv] = (labelValuesByName[ln]![lv] ?? 0) + 1;\n }\n });\n });\n }\n\n // labelCardinalities records the number of unique label values for each label name.\n const labelCardinalities: Record<string, number> = {};\n // labelExamples records the most common label values for each label name.\n const labelExamples: Record<string, Array<{ value: string; count: number }>> = {};\n Object.entries(labelValuesByName).forEach(([ln, lvs]) => {\n labelCardinalities[ln] = Object.keys(lvs).length;\n // Sort label values by their number of occurrences within this label name.\n labelExamples[ln] = Object.entries(lvs)\n .sort(([, aCnt], [, bCnt]) => bCnt - aCnt)\n .slice(0, maxLabelValues)\n .map(([lv, cnt]) => ({ value: lv, count: cnt }));\n });\n\n setResultStats({\n numSeries: resultSeries,\n sortedLabelCards: Object.entries(labelCardinalities).sort((a, b) => b[1] - a[1]),\n labelExamples,\n });\n }, [instantQueryResponse, reportNodeState, childIdx]);\n\n const innerNode = (\n <Stack direction=\"row\" gap={2}>\n <Box\n ref={nodeRef}\n sx={{\n position: 'relative',\n display: 'inline-block',\n padding: 1,\n marginBottom: 1.5,\n borderRadius: 2,\n backgroundColor: theme.palette.background.code,\n }}\n >\n {parentEl !== undefined && (\n // Connector line between this node and its parent.\n <Box\n sx={{\n position: 'absolute',\n display: 'inline-block',\n ...connectorStyle,\n }}\n />\n )}\n {/* The node (visible box) itself. */}\n {formatNode(node, false, 1)}\n </Box>\n {/* The node's individual query: */}\n <QueryStatus\n mergedChildState={mergedChildState}\n isFetching={isFetching}\n error={error}\n resultStats={resultStats}\n responseTime={instantQueryResponse?.responseTime}\n />\n </Stack>\n );\n\n if (node.type === nodeType.binaryExpr) {\n return (\n <div>\n <Box ml={nodeIndent}>\n <TreeNode\n node={children[0]!}\n parentEl={nodeEl}\n reverse={true}\n datasource={datasource}\n childIdx={0}\n reportNodeState={childReportNodeState}\n />\n </Box>\n {innerNode}\n <Box ml={nodeIndent}>\n <TreeNode\n node={children[1]!}\n parentEl={nodeEl}\n reverse={false}\n datasource={datasource}\n childIdx={1}\n reportNodeState={childReportNodeState}\n />\n </Box>\n </div>\n );\n }\n\n return (\n <div>\n {innerNode}\n {children.map((child, idx) => (\n <Box ml={nodeIndent} key={idx}>\n <TreeNode\n node={child}\n parentEl={nodeEl}\n reverse={false}\n datasource={datasource}\n childIdx={idx}\n reportNodeState={childReportNodeState}\n />\n </Box>\n ))}\n </div>\n );\n}\n\ninterface QueryStatusProps {\n mergedChildState: NodeState;\n isFetching: boolean;\n error: StatusError | null;\n resultStats: {\n numSeries: number;\n labelExamples: Record<string, Array<{ value: string; count: number }>>;\n sortedLabelCards: Array<[string, number]>;\n };\n responseTime?: number;\n}\n\nfunction QueryStatus({\n mergedChildState,\n isFetching,\n error,\n resultStats,\n responseTime,\n}: QueryStatusProps): ReactElement {\n if (mergedChildState === 'waiting') {\n return <ProgressState text=\"Waiting for child query\" />;\n }\n\n if (mergedChildState === 'running') {\n return <ProgressState text=\"Running\" />;\n }\n\n if (mergedChildState === 'error') {\n return (\n <Stack>\n <AlertCircle />\n Blocked on child query error\n </Stack>\n );\n }\n\n if (isFetching) {\n return <ProgressState text=\"Loading\" />;\n }\n\n if (error) {\n return (\n <Box\n display=\"flex\"\n alignItems=\"center\"\n gap={1}\n sx={{ color: (theme) => theme.palette.error.main }}\n marginBottom={1.5}\n >\n <AlertCircle />\n <Typography variant=\"body2\">\n <strong>Error executing query:</strong> {error.message}\n </Typography>\n </Box>\n );\n }\n\n return (\n <Stack direction=\"row\" gap={1} alignItems=\"center\" marginBottom={1.5}>\n <Typography variant=\"body2\" component=\"span\" sx={{ color: (theme) => theme.palette.grey[500] }}>\n {resultStats.numSeries} result{resultStats.numSeries !== 1 && 's'}\n – \n {responseTime ? `${Math.round(responseTime)}ms` : '? ms'}\n {resultStats.sortedLabelCards.length > 0 && <> –</>}\n </Typography>\n {resultStats.sortedLabelCards.slice(0, maxLabelNames).map(([ln, cnt]) => (\n <Tooltip\n key={ln}\n title={\n <Box>\n <List dense>\n {resultStats.labelExamples[ln]?.map(({ value, count }) => (\n <ListItem\n key={value}\n sx={{\n display: 'flex',\n gap: 1,\n py: 0,\n px: 0.5,\n }}\n >\n <CircleIcon sx={{ fontSize: 8 }} />\n <Typography\n variant=\"body2\"\n component=\"span\"\n sx={{\n color: (theme) =>\n theme.palette.mode === 'dark' // TODO we shouldnt have to do that I guess..\n ? theme.palette.warning.dark\n : theme.palette.warning.main,\n fontFamily: 'monospace',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n flexGrow: 1,\n }}\n >\n {escapeString(value)}\n </Typography>\n <Typography\n variant=\"body2\"\n component=\"span\"\n sx={{\n whiteSpace: 'nowrap',\n flexShrink: 0,\n }}\n >\n ({count}x)\n </Typography>\n </ListItem>\n ))}\n {cnt > maxLabelValues && (\n <ListItem\n sx={{\n display: 'flex',\n gap: 1,\n py: 0,\n px: 0.5,\n }}\n >\n <CircleIcon sx={{ fontSize: 8 }} />\n <Typography variant=\"body2\">. . .</Typography>\n </ListItem>\n )}\n </List>\n </Box>\n }\n arrow\n >\n <span style={{ cursor: 'pointer', whiteSpace: 'nowrap' }}>\n <Typography\n variant=\"body2\"\n component=\"span\"\n sx={{ fontFamily: 'monospace', color: (theme) => theme.palette.success.main }}\n >\n {ln}\n </Typography>\n <Typography variant=\"body2\" component=\"span\" sx={{ color: (theme) => theme.palette.grey[500] }}>\n : {cnt}\n </Typography>\n </span>\n </Tooltip>\n ))}\n {resultStats.sortedLabelCards.length > maxLabelNames ? (\n <Typography variant=\"body2\">...{resultStats.sortedLabelCards.length - maxLabelNames} more...</Typography>\n ) : null}\n </Stack>\n );\n}\n\nfunction ProgressState({ text }: { text: string }): ReactElement {\n return (\n <Box display=\"flex\" alignItems=\"center\" gap={1} marginBottom={1.5}>\n <CircularProgress size={16} color=\"secondary\" />\n <Typography variant=\"body2\" color=\"text.secondary\">\n {text}...\n </Typography>\n </Box>\n );\n}\n"],"names":["Box","CircularProgress","List","ListItem","Stack","Tooltip","Typography","useTheme","CircleIcon","useCallback","useEffect","useLayoutEffect","useMemo","useState","AlertCircle","nodeType","escapeString","getNodeChildren","formatNode","serializeNode","functionSignatures","useInstantQuery","nodeIndent","connectorWidth","maxLabelNames","maxLabelValues","mergeChildStates","states","includes","TreeNode","node","parentEl","reverse","datasource","childIdx","reportNodeState","theme","children","nodeEl","setNodeEl","nodeRef","resultStats","setResultStats","numSeries","labelExamples","sortedLabelCards","connectorStyle","setConnectorStyle","borderColor","palette","grey","borderLeftStyle","borderLeftWidth","width","left","childStates","setChildStates","map","mergedChildState","queryNode","type","matrixSelector","call","func","last_over_time","args","data","instantQueryResponse","isFetching","error","childReportNodeState","state","prev","newStates","undefined","parentRect","getBoundingClientRect","nodeRect","prevStyle","top","bottom","borderTopLeftRadius","borderTopStyle","borderBottomLeftRadius","borderBottomStyle","status","resultSeries","labelValuesByName","resultType","result","length","forEach","s","Object","entries","metric","ln","lv","labelCardinalities","lvs","keys","sort","aCnt","bCnt","slice","cnt","value","count","a","b","innerNode","direction","gap","ref","sx","position","display","padding","marginBottom","borderRadius","backgroundColor","background","code","QueryStatus","responseTime","binaryExpr","div","ml","child","idx","ProgressState","text","alignItems","color","main","variant","strong","message","component","Math","round","title","dense","py","px","fontSize","mode","warning","dark","fontFamily","whiteSpace","overflow","textOverflow","flexGrow","flexShrink","arrow","span","style","cursor","success","size"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,oJAAoJ;AAEpJ,SAASA,GAAG,EAAEC,gBAAgB,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,KAAK,EAAE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AAC/H;gBAAWiI,SAAQ;gBAAQF,OAAM;;oBAC/BF;oBAAK;;;;;AAId"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/components/promql/format.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAkC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/components/promql/format.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAIvD,OAAO,OAON,MAAM,OAAO,CAAC;AA6Cf,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,EAAE,KAAG,KAAK,CAAC,SAAS,EAS/D,CAAC;AAiPF,eAAO,MAAM,UAAU,GAAI,MAAM,OAAO,EAAE,cAAc,OAAO,EAAE,WAAW,MAAM,KAAG,KAAK,CAAC,YAE1F,CAAC"}
|