@perses-dev/prometheus-plugin 0.50.3 → 0.51.0-beta.2
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/LICENSE +183 -183
- package/README.md +41 -0
- package/__mf/css/async/2341.dacad691.css +1 -0
- package/__mf/css/async/5263.dacad691.css +1 -0
- package/__mf/css/async/6759.dacad691.css +1 -0
- 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/622.f7592106.js +5 -0
- package/__mf/js/Prometheus.328aad7c.js +5 -0
- package/__mf/js/async/1465.3b5e12d5.js +1 -0
- package/__mf/js/async/1495.6c8b8071.js +1 -0
- package/__mf/js/async/1620.6376bd14.js +2 -0
- package/__mf/js/async/1620.6376bd14.js.LICENSE.txt +9 -0
- package/__mf/js/async/1864.df7c4beb.js +1 -0
- package/__mf/js/async/1950.704c331e.js +1 -0
- package/__mf/js/async/1964.95da06f6.js +2 -0
- package/__mf/js/async/1964.95da06f6.js.LICENSE.txt +9 -0
- package/__mf/js/async/1996.01084c88.js +2 -0
- package/__mf/js/async/1996.01084c88.js.LICENSE.txt +24 -0
- package/__mf/js/async/212.bd5d617a.js +1 -0
- package/__mf/js/async/2316.fec4907a.js +1 -0
- package/__mf/js/async/232.f3523a60.js +1 -0
- package/__mf/js/async/2569.daf868a6.js +10 -0
- package/__mf/js/async/2569.daf868a6.js.LICENSE.txt +27 -0
- package/__mf/js/async/2675.c3b73822.js +1 -0
- package/__mf/js/async/3224.23f0dccf.js +1 -0
- package/__mf/js/async/3355.a4dbcdb0.js +1 -0
- package/__mf/js/async/3436.97c926a4.js +1 -0
- package/__mf/js/async/3818.dde21d04.js +1 -0
- package/__mf/js/async/3871.6915e369.js +1 -0
- package/__mf/js/async/3960.129d5ef5.js +2 -0
- package/__mf/js/async/3960.129d5ef5.js.LICENSE.txt +8 -0
- package/__mf/js/async/4075.b77ca1c7.js +1 -0
- package/__mf/js/async/4238.8e4d29d5.js +1 -0
- package/__mf/js/async/4323.4266fd6a.js +1 -0
- package/__mf/js/async/4421.1bcc1637.js +1 -0
- package/__mf/js/async/4489.3361e7bc.js +29 -0
- package/__mf/js/async/4489.3361e7bc.js.LICENSE.txt +59 -0
- package/__mf/js/async/5214.027c4332.js +1 -0
- package/__mf/js/async/5345.8c2e4b4a.js +1 -0
- package/__mf/js/async/537.6911ea2e.js +1 -0
- package/__mf/js/async/5387.fd6e16d6.js +1 -0
- package/__mf/js/async/5654.ecb41aea.js +38 -0
- package/__mf/js/async/5724.6ee6ec51.js +1 -0
- package/__mf/js/async/5774.9b0b6be1.js +1 -0
- package/__mf/js/async/5790.2273e061.js +1 -0
- package/__mf/js/async/5913.9d30fd07.js +73 -0
- package/__mf/js/async/5913.9d30fd07.js.LICENSE.txt +19 -0
- package/__mf/js/async/5914.bd342d22.js +74 -0
- package/__mf/js/async/5981.40bed0d0.js +2 -0
- package/__mf/js/async/5981.40bed0d0.js.LICENSE.txt +8 -0
- package/__mf/js/async/6292.7b8efa78.js +1 -0
- package/__mf/js/async/6333.865a46e0.js +2 -0
- package/__mf/js/async/6333.865a46e0.js.LICENSE.txt +9 -0
- package/__mf/js/async/6377.ca974d89.js +2 -0
- package/__mf/js/async/6377.ca974d89.js.LICENSE.txt +32 -0
- package/__mf/js/async/6770.adb1c939.js +1 -0
- package/__mf/js/async/684.ca510333.js +1 -0
- package/__mf/js/async/694.f861d67c.js +1 -0
- package/__mf/js/async/7272.a763aa92.js +1 -0
- package/__mf/js/async/738.aca54e25.js +1 -0
- package/__mf/js/async/7740.0c5363fd.js +1 -0
- package/__mf/js/async/8265.b9e2c31e.js +1 -0
- package/__mf/js/async/8488.5237550f.js +1 -0
- package/__mf/js/async/8587.4891ea90.js +1 -0
- package/__mf/js/async/8610.8300df79.js +1 -0
- package/__mf/js/async/87.fdc843ac.js +1 -0
- package/__mf/js/async/8930.9fbbc975.js +1 -0
- package/__mf/js/async/8997.18901f45.js +28 -0
- package/__mf/js/async/9173.e8fbead5.js +2 -0
- package/__mf/js/async/9173.e8fbead5.js.LICENSE.txt +19 -0
- package/__mf/js/async/__federation_expose_PrometheusDatasource.f6f57299.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusExplorer.5fcf955a.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.86d0ad5a.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.b2893484.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.cd16f6e8.js +1 -0
- package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.eb9eefa6.js +1 -0
- package/__mf/js/main.154a5b65.js +1 -0
- package/lib/bootstrap.d.ts +2 -0
- package/lib/bootstrap.d.ts.map +1 -0
- package/lib/bootstrap.js +19 -0
- package/lib/bootstrap.js.map +1 -0
- package/lib/cjs/bootstrap.js +26 -0
- package/{dist → lib}/cjs/components/PromQLEditor.js +9 -7
- package/lib/cjs/components/TreeNode.js +492 -0
- package/{dist → lib}/cjs/components/promql/ast.js +21 -21
- package/lib/cjs/components/promql/functionSignatures.js +651 -0
- package/lib/cjs/components/promql/serialize.js +88 -0
- package/{dist → lib}/cjs/components/promql/utils.js +12 -1
- package/{dist/cjs/components/parse.js → lib/cjs/components/query.js} +37 -4
- package/lib/cjs/env.d.js +14 -0
- package/lib/cjs/explore/PrometheusExplorer.js +203 -0
- package/lib/cjs/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js +268 -0
- package/lib/cjs/explore/PrometheusMetricsFinder/display/MetricChip.js +61 -0
- package/lib/cjs/explore/PrometheusMetricsFinder/display/list/MetricList.js +179 -0
- package/lib/cjs/explore/PrometheusMetricsFinder/filter/FilterInputs.js +231 -0
- package/lib/cjs/explore/PrometheusMetricsFinder/filter/FinderFilters.js +97 -0
- package/{dist/cjs/plugins/prometheus-time-series-query → lib/cjs/explore/PrometheusMetricsFinder}/index.js +1 -1
- package/lib/cjs/explore/PrometheusMetricsFinder/overview/MetricOverview.js +235 -0
- package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js +144 -0
- package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js +423 -0
- package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js +53 -0
- package/lib/cjs/explore/PrometheusMetricsFinder/types.js +25 -0
- package/lib/cjs/explore/PrometheusMetricsFinder/utils.js +203 -0
- package/lib/cjs/explore/index.js +19 -0
- package/lib/cjs/getPluginModule.js +27 -0
- package/lib/cjs/index-federation.js +55 -0
- package/lib/cjs/index.js +28 -0
- package/{dist → lib}/cjs/model/api-types.js +1 -1
- package/{dist → lib}/cjs/model/prometheus-client.js +1 -1
- package/lib/cjs/plugins/PrometheusDatasourceEditor.js +109 -0
- package/lib/cjs/plugins/PrometheusLabelNamesVariable.js +34 -0
- package/lib/cjs/plugins/PrometheusLabelValuesVariable.js +38 -0
- package/lib/cjs/plugins/PrometheusPromQLVariable.js +42 -0
- package/lib/cjs/plugins/index.js +26 -0
- package/{dist → lib}/cjs/plugins/prometheus-datasource.js +9 -9
- package/{dist → lib}/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +11 -9
- package/{dist → lib}/cjs/plugins/prometheus-time-series-query/get-time-series-data.js +51 -29
- package/lib/cjs/plugins/prometheus-time-series-query/index.js +35 -0
- package/{dist → lib}/cjs/plugins/prometheus-variables.js +25 -101
- package/{dist → lib}/cjs/plugins/variable.js +1 -2
- package/lib/cjs/setup-tests.js +19 -0
- package/{dist → lib}/cjs/utils/utils.js +1 -2
- package/lib/components/PromQLEditor.d.ts.map +1 -0
- package/{dist → lib}/components/PromQLEditor.js +9 -7
- package/lib/components/PromQLEditor.js.map +1 -0
- package/lib/components/TreeNode.d.ts +15 -0
- package/lib/components/TreeNode.d.ts.map +1 -0
- package/lib/components/TreeNode.js +479 -0
- package/lib/components/TreeNode.js.map +1 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/promql/ast.d.ts.map +1 -0
- package/{dist → lib}/components/promql/ast.js +21 -21
- package/lib/components/promql/ast.js.map +1 -0
- package/{dist → lib}/components/promql/format.d.ts +1 -1
- package/lib/components/promql/format.d.ts.map +1 -0
- package/lib/components/promql/format.js.map +1 -0
- package/lib/components/promql/functionSignatures.d.ts +3 -0
- package/lib/components/promql/functionSignatures.d.ts.map +1 -0
- package/lib/components/promql/functionSignatures.js +643 -0
- package/lib/components/promql/functionSignatures.js.map +1 -0
- package/lib/components/promql/serialize.d.ts +4 -0
- package/lib/components/promql/serialize.d.ts.map +1 -0
- package/lib/components/promql/serialize.js +80 -0
- package/lib/components/promql/serialize.js.map +1 -0
- package/{dist → lib}/components/promql/utils.d.ts +1 -0
- package/lib/components/promql/utils.d.ts.map +1 -0
- package/{dist → lib}/components/promql/utils.js +9 -1
- package/lib/components/promql/utils.js.map +1 -0
- package/lib/components/query.d.ts +6 -0
- package/lib/components/query.d.ts.map +1 -0
- package/{dist/components/parse.js → lib/components/query.js} +27 -2
- package/lib/components/query.js.map +1 -0
- package/lib/env.d.js +15 -0
- package/lib/env.d.js.map +1 -0
- package/lib/explore/PrometheusExplorer.d.ts +3 -0
- package/lib/explore/PrometheusExplorer.d.ts.map +1 -0
- package/lib/explore/PrometheusExplorer.js +190 -0
- package/lib/explore/PrometheusExplorer.js.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.d.ts +31 -0
- package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.d.ts.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js +244 -0
- package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/display/MetricChip.d.ts +4 -0
- package/lib/explore/PrometheusMetricsFinder/display/MetricChip.d.ts.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/display/MetricChip.js +53 -0
- package/lib/explore/PrometheusMetricsFinder/display/MetricChip.js.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.d.ts +27 -0
- package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.d.ts.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.js +158 -0
- package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.js.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.d.ts +23 -0
- package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.d.ts.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js +209 -0
- package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.d.ts +13 -0
- package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.d.ts.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js +84 -0
- package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/index.d.ts +2 -0
- package/lib/explore/PrometheusMetricsFinder/index.d.ts.map +1 -0
- package/{dist/model/api-types.js → lib/explore/PrometheusMetricsFinder/index.js} +2 -2
- package/lib/explore/PrometheusMetricsFinder/index.js.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.d.ts +23 -0
- package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.d.ts.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.js +214 -0
- package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.js.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.d.ts +28 -0
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.d.ts.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js +125 -0
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.d.ts +25 -0
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.d.ts.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js +399 -0
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.d.ts +12 -0
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.d.ts.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js +45 -0
- package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/types.d.ts +22 -0
- package/lib/explore/PrometheusMetricsFinder/types.d.ts.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/types.js +17 -0
- package/lib/explore/PrometheusMetricsFinder/types.js.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/utils.d.ts +22 -0
- package/lib/explore/PrometheusMetricsFinder/utils.d.ts.map +1 -0
- package/lib/explore/PrometheusMetricsFinder/utils.js +185 -0
- package/lib/explore/PrometheusMetricsFinder/utils.js.map +1 -0
- package/lib/explore/index.d.ts +3 -0
- package/lib/explore/index.d.ts.map +1 -0
- package/lib/explore/index.js +4 -0
- package/lib/explore/index.js.map +1 -0
- package/lib/getPluginModule.d.ts +6 -0
- package/lib/getPluginModule.d.ts.map +1 -0
- package/lib/getPluginModule.js +16 -0
- package/lib/getPluginModule.js.map +1 -0
- package/lib/index-federation.d.ts +1 -0
- package/lib/index-federation.d.ts.map +1 -0
- package/lib/index-federation.js +15 -0
- package/{dist/components/index.js.map → lib/index-federation.js.map} +1 -1
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -0
- package/{dist → lib}/model/api-types.d.ts +18 -1
- package/lib/model/api-types.d.ts.map +1 -0
- package/{dist/plugins/prometheus-time-series-query/index.js → lib/model/api-types.js} +3 -3
- package/lib/model/api-types.js.map +1 -0
- package/lib/model/index.d.ts.map +1 -0
- package/lib/model/index.js.map +1 -0
- package/lib/model/parse-sample-values.d.ts.map +1 -0
- package/lib/model/parse-sample-values.js.map +1 -0
- package/lib/model/prometheus-client.d.ts.map +1 -0
- package/{dist → lib}/model/prometheus-client.js +1 -1
- package/lib/model/prometheus-client.js.map +1 -0
- package/lib/model/prometheus-selectors.d.ts.map +1 -0
- package/lib/model/prometheus-selectors.js.map +1 -0
- package/lib/model/time.d.ts.map +1 -0
- package/lib/model/time.js.map +1 -0
- package/lib/plugins/MatcherEditor.d.ts.map +1 -0
- package/lib/plugins/MatcherEditor.js.map +1 -0
- package/lib/plugins/PrometheusDatasourceEditor.d.ts.map +1 -0
- package/lib/plugins/PrometheusDatasourceEditor.js +96 -0
- package/lib/plugins/PrometheusDatasourceEditor.js.map +1 -0
- package/lib/plugins/PrometheusLabelNamesVariable.d.ts +4 -0
- package/lib/plugins/PrometheusLabelNamesVariable.d.ts.map +1 -0
- package/lib/plugins/PrometheusLabelNamesVariable.js +26 -0
- package/lib/plugins/PrometheusLabelNamesVariable.js.map +1 -0
- package/lib/plugins/PrometheusLabelValuesVariable.d.ts +4 -0
- package/lib/plugins/PrometheusLabelValuesVariable.d.ts.map +1 -0
- package/lib/plugins/PrometheusLabelValuesVariable.js +30 -0
- package/lib/plugins/PrometheusLabelValuesVariable.js.map +1 -0
- package/lib/plugins/PrometheusPromQLVariable.d.ts +4 -0
- package/lib/plugins/PrometheusPromQLVariable.d.ts.map +1 -0
- package/lib/plugins/PrometheusPromQLVariable.js +34 -0
- package/lib/plugins/PrometheusPromQLVariable.js.map +1 -0
- package/lib/plugins/index.d.ts +10 -0
- package/lib/plugins/index.d.ts.map +1 -0
- package/lib/plugins/index.js +11 -0
- package/lib/plugins/index.js.map +1 -0
- package/lib/plugins/prometheus-datasource.d.ts.map +1 -0
- package/{dist → lib}/plugins/prometheus-datasource.js +9 -9
- package/lib/plugins/prometheus-datasource.js.map +1 -0
- package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.d.ts.map +1 -0
- package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js.map +1 -0
- package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts.map +1 -0
- package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +9 -7
- package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js.map +1 -0
- package/lib/plugins/prometheus-time-series-query/get-time-series-data.d.ts.map +1 -0
- package/{dist → lib}/plugins/prometheus-time-series-query/get-time-series-data.js +51 -29
- package/lib/plugins/prometheus-time-series-query/get-time-series-data.js.map +1 -0
- package/lib/plugins/prometheus-time-series-query/index.d.ts +7 -0
- package/lib/plugins/prometheus-time-series-query/index.d.ts.map +1 -0
- package/lib/plugins/prometheus-time-series-query/index.js +20 -0
- package/lib/plugins/prometheus-time-series-query/index.js.map +1 -0
- package/lib/plugins/prometheus-time-series-query/query-editor-model.d.ts.map +1 -0
- package/lib/plugins/prometheus-time-series-query/query-editor-model.js.map +1 -0
- package/lib/plugins/prometheus-time-series-query/replace-prom-builtin-variables.d.ts.map +1 -0
- package/lib/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js.map +1 -0
- package/lib/plugins/prometheus-time-series-query/time-series-query-model.d.ts.map +1 -0
- package/lib/plugins/prometheus-time-series-query/time-series-query-model.js.map +1 -0
- package/lib/plugins/prometheus-variables.d.ts +14 -0
- package/lib/plugins/prometheus-variables.d.ts.map +1 -0
- package/{dist → lib}/plugins/prometheus-variables.js +15 -98
- package/lib/plugins/prometheus-variables.js.map +1 -0
- package/lib/plugins/types.d.ts.map +1 -0
- package/lib/plugins/types.js.map +1 -0
- package/lib/plugins/variable.d.ts.map +1 -0
- package/{dist → lib}/plugins/variable.js +1 -2
- package/lib/plugins/variable.js.map +1 -0
- package/lib/setup-tests.d.ts +2 -0
- package/lib/setup-tests.d.ts.map +1 -0
- package/lib/setup-tests.js +17 -0
- package/{dist/utils/index.js.map → lib/setup-tests.js.map} +1 -1
- package/lib/test/setup-tests.d.ts.map +1 -0
- package/lib/test/setup-tests.js.map +1 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/utils.d.ts.map +1 -0
- package/{dist → lib}/utils/utils.js +1 -2
- package/lib/utils/utils.js.map +1 -0
- package/mf-manifest.json +898 -0
- package/mf-stats.json +1004 -0
- package/package.json +99 -38
- package/dist/cjs/components/TreeNode.js +0 -147
- package/dist/cjs/index.js +0 -61
- package/dist/cjs/plugins/PrometheusDatasourceEditor.js +0 -626
- package/dist/components/PromQLEditor.d.ts.map +0 -1
- package/dist/components/PromQLEditor.js.map +0 -1
- package/dist/components/TreeNode.d.ts +0 -10
- package/dist/components/TreeNode.d.ts.map +0 -1
- package/dist/components/TreeNode.js +0 -139
- package/dist/components/TreeNode.js.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/parse.d.ts +0 -5
- package/dist/components/parse.d.ts.map +0 -1
- package/dist/components/parse.js.map +0 -1
- package/dist/components/promql/ast.d.ts.map +0 -1
- package/dist/components/promql/ast.js.map +0 -1
- package/dist/components/promql/format.d.ts.map +0 -1
- package/dist/components/promql/format.js.map +0 -1
- package/dist/components/promql/utils.d.ts.map +0 -1
- package/dist/components/promql/utils.js.map +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -24
- package/dist/index.js.map +0 -1
- package/dist/model/api-types.d.ts.map +0 -1
- package/dist/model/api-types.js.map +0 -1
- package/dist/model/index.d.ts.map +0 -1
- package/dist/model/index.js.map +0 -1
- package/dist/model/parse-sample-values.d.ts.map +0 -1
- package/dist/model/parse-sample-values.js.map +0 -1
- package/dist/model/prometheus-client.d.ts.map +0 -1
- package/dist/model/prometheus-client.js.map +0 -1
- package/dist/model/prometheus-selectors.d.ts.map +0 -1
- package/dist/model/prometheus-selectors.js.map +0 -1
- package/dist/model/time.d.ts.map +0 -1
- package/dist/model/time.js.map +0 -1
- package/dist/plugins/MatcherEditor.d.ts.map +0 -1
- package/dist/plugins/MatcherEditor.js.map +0 -1
- package/dist/plugins/PrometheusDatasourceEditor.d.ts.map +0 -1
- package/dist/plugins/PrometheusDatasourceEditor.js +0 -572
- package/dist/plugins/PrometheusDatasourceEditor.js.map +0 -1
- package/dist/plugins/prometheus-datasource.d.ts.map +0 -1
- package/dist/plugins/prometheus-datasource.js.map +0 -1
- package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.d.ts.map +0 -1
- package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js.map +0 -1
- package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts.map +0 -1
- package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js.map +0 -1
- package/dist/plugins/prometheus-time-series-query/get-time-series-data.d.ts.map +0 -1
- package/dist/plugins/prometheus-time-series-query/get-time-series-data.js.map +0 -1
- package/dist/plugins/prometheus-time-series-query/index.d.ts +0 -2
- package/dist/plugins/prometheus-time-series-query/index.d.ts.map +0 -1
- package/dist/plugins/prometheus-time-series-query/index.js.map +0 -1
- package/dist/plugins/prometheus-time-series-query/query-editor-model.d.ts.map +0 -1
- package/dist/plugins/prometheus-time-series-query/query-editor-model.js.map +0 -1
- package/dist/plugins/prometheus-time-series-query/replace-prom-builtin-variables.d.ts.map +0 -1
- package/dist/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js.map +0 -1
- package/dist/plugins/prometheus-time-series-query/time-series-query-model.d.ts.map +0 -1
- package/dist/plugins/prometheus-time-series-query/time-series-query-model.js.map +0 -1
- package/dist/plugins/prometheus-variables.d.ts +0 -6
- package/dist/plugins/prometheus-variables.d.ts.map +0 -1
- package/dist/plugins/prometheus-variables.js.map +0 -1
- package/dist/plugins/types.d.ts.map +0 -1
- package/dist/plugins/types.js.map +0 -1
- package/dist/plugins/variable.d.ts.map +0 -1
- package/dist/plugins/variable.js.map +0 -1
- package/dist/test/setup-tests.d.ts.map +0 -1
- package/dist/test/setup-tests.js.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/utils.d.ts.map +0 -1
- package/dist/utils/utils.js.map +0 -1
- package/plugin.json +0 -58
- /package/{dist → lib}/cjs/components/index.js +0 -0
- /package/{dist → lib}/cjs/components/promql/format.js +0 -0
- /package/{dist → lib}/cjs/model/index.js +0 -0
- /package/{dist → lib}/cjs/model/parse-sample-values.js +0 -0
- /package/{dist → lib}/cjs/model/prometheus-selectors.js +0 -0
- /package/{dist → lib}/cjs/model/time.js +0 -0
- /package/{dist → lib}/cjs/plugins/MatcherEditor.js +0 -0
- /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js +0 -0
- /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/query-editor-model.js +0 -0
- /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js +0 -0
- /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/time-series-query-model.js +0 -0
- /package/{dist → lib}/cjs/plugins/types.js +0 -0
- /package/{dist → lib}/cjs/test/setup-tests.js +0 -0
- /package/{dist → lib}/cjs/utils/index.js +0 -0
- /package/{dist → lib}/components/PromQLEditor.d.ts +0 -0
- /package/{dist → lib}/components/index.d.ts +0 -0
- /package/{dist → lib}/components/index.js +0 -0
- /package/{dist → lib}/components/promql/ast.d.ts +0 -0
- /package/{dist → lib}/components/promql/format.js +0 -0
- /package/{dist → lib}/model/index.d.ts +0 -0
- /package/{dist → lib}/model/index.js +0 -0
- /package/{dist → lib}/model/parse-sample-values.d.ts +0 -0
- /package/{dist → lib}/model/parse-sample-values.js +0 -0
- /package/{dist → lib}/model/prometheus-client.d.ts +0 -0
- /package/{dist → lib}/model/prometheus-selectors.d.ts +0 -0
- /package/{dist → lib}/model/prometheus-selectors.js +0 -0
- /package/{dist → lib}/model/time.d.ts +0 -0
- /package/{dist → lib}/model/time.js +0 -0
- /package/{dist → lib}/plugins/MatcherEditor.d.ts +0 -0
- /package/{dist → lib}/plugins/MatcherEditor.js +0 -0
- /package/{dist → lib}/plugins/PrometheusDatasourceEditor.d.ts +0 -0
- /package/{dist → lib}/plugins/prometheus-datasource.d.ts +0 -0
- /package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.d.ts +0 -0
- /package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js +0 -0
- /package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts +0 -0
- /package/{dist → lib}/plugins/prometheus-time-series-query/get-time-series-data.d.ts +0 -0
- /package/{dist → lib}/plugins/prometheus-time-series-query/query-editor-model.d.ts +0 -0
- /package/{dist → lib}/plugins/prometheus-time-series-query/query-editor-model.js +0 -0
- /package/{dist → lib}/plugins/prometheus-time-series-query/replace-prom-builtin-variables.d.ts +0 -0
- /package/{dist → lib}/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js +0 -0
- /package/{dist → lib}/plugins/prometheus-time-series-query/time-series-query-model.d.ts +0 -0
- /package/{dist → lib}/plugins/prometheus-time-series-query/time-series-query-model.js +0 -0
- /package/{dist → lib}/plugins/types.d.ts +0 -0
- /package/{dist → lib}/plugins/types.js +0 -0
- /package/{dist → lib}/plugins/variable.d.ts +0 -0
- /package/{dist → lib}/test/setup-tests.d.ts +0 -0
- /package/{dist → lib}/test/setup-tests.js +0 -0
- /package/{dist → lib}/utils/index.d.ts +0 -0
- /package/{dist → lib}/utils/index.js +0 -0
- /package/{dist → lib}/utils/utils.d.ts +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
// Forked from https://github.com/prometheus/prometheus/blob/65f610353919b1c7b42d3776c3a95b68046a6bba/web/ui/mantine-ui/src/promql/serialize.ts
|
|
14
|
+
"use strict";
|
|
15
|
+
Object.defineProperty(exports, "__esModule", {
|
|
16
|
+
value: true
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "default", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function() {
|
|
21
|
+
return _default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const _core = require("@perses-dev/core");
|
|
25
|
+
const _ast = require("./ast");
|
|
26
|
+
const _utils = require("./utils");
|
|
27
|
+
const serializeAtAndOffset = (timestamp, startOrEnd, offset)=>`${timestamp !== null ? ` @ ${(timestamp / 1000).toFixed(3)}` : startOrEnd !== null ? ` @ ${startOrEnd}()` : ''}${offset === 0 ? '' : offset > 0 ? ` offset ${(0, _core.formatDuration)((0, _core.msToPrometheusDuration)(offset))}` : ` offset -${(0, _core.formatDuration)((0, _core.msToPrometheusDuration)(-offset))}`}`;
|
|
28
|
+
const serializeSelector = (node)=>{
|
|
29
|
+
const matchers = node.matchers.filter((m)=>!(m.name === '__name__' && m.type === _ast.matchType.equal && m.value === node.name)).map((m)=>`${m.name}${m.type}"${(0, _utils.escapeString)(m.value)}"`);
|
|
30
|
+
const range = node.type === _ast.nodeType.matrixSelector ? `[${(0, _core.formatDuration)((0, _core.msToPrometheusDuration)(node.range))}]` : '';
|
|
31
|
+
const atAndOffset = serializeAtAndOffset(node.timestamp, node.startOrEnd, node.offset);
|
|
32
|
+
return `${node.name}${matchers.length > 0 ? `{${matchers.join(',')}}` : ''}${range}${atAndOffset}`;
|
|
33
|
+
};
|
|
34
|
+
const serializeNode = (node, indent = 0, pretty = false, initialIndent = true)=>{
|
|
35
|
+
const childListSeparator = pretty ? '\n' : '';
|
|
36
|
+
const childSeparator = pretty ? '\n' : ' ';
|
|
37
|
+
const childIndent = indent + 2;
|
|
38
|
+
const ind = pretty ? ' '.repeat(indent) : '';
|
|
39
|
+
// Needed for unary operators.
|
|
40
|
+
const initialInd = initialIndent ? ind : '';
|
|
41
|
+
switch(node.type){
|
|
42
|
+
case _ast.nodeType.aggregation:
|
|
43
|
+
return `${initialInd}${node.op}${node.without ? ` without(${node.grouping.join(', ')}) ` : node.grouping.length > 0 ? ` by(${node.grouping.join(', ')}) ` : ''}(${childListSeparator}${_utils.aggregatorsWithParam.includes(node.op) && node.param !== null ? `${serializeNode(node.param, childIndent, pretty)},${childSeparator}` : ''}${serializeNode(node.expr, childIndent, pretty)}${childListSeparator}${ind})`;
|
|
44
|
+
case _ast.nodeType.subquery:
|
|
45
|
+
return `${initialInd}${serializeNode(node.expr, indent, pretty)}[${(0, _core.formatDuration)((0, _core.msToPrometheusDuration)(node.range))}:${node.step !== 0 ? (0, _core.formatDuration)((0, _core.msToPrometheusDuration)(node.step)) : ''}]${serializeAtAndOffset(node.timestamp, node.startOrEnd, node.offset)}`;
|
|
46
|
+
case _ast.nodeType.parenExpr:
|
|
47
|
+
return `${initialInd}(${childListSeparator}${serializeNode(node.expr, childIndent, pretty)}${childListSeparator}${ind})`;
|
|
48
|
+
case _ast.nodeType.call:
|
|
49
|
+
{
|
|
50
|
+
const sep = node.args.length > 0 ? childListSeparator : '';
|
|
51
|
+
return `${initialInd}${node.func.name}(${sep}${node.args.map((arg)=>serializeNode(arg, childIndent, pretty)).join(',' + childSeparator)}${sep}${node.args.length > 0 ? ind : ''})`;
|
|
52
|
+
}
|
|
53
|
+
case _ast.nodeType.matrixSelector:
|
|
54
|
+
return `${initialInd}${serializeSelector(node)}`;
|
|
55
|
+
case _ast.nodeType.vectorSelector:
|
|
56
|
+
return `${initialInd}${serializeSelector(node)}`;
|
|
57
|
+
case _ast.nodeType.numberLiteral:
|
|
58
|
+
return `${initialInd}${node.val}`;
|
|
59
|
+
case _ast.nodeType.stringLiteral:
|
|
60
|
+
return `${initialInd}"${(0, _utils.escapeString)(node.val)}"`;
|
|
61
|
+
case _ast.nodeType.unaryExpr:
|
|
62
|
+
return `${initialInd}${node.op}${serializeNode(node.expr, indent, pretty, false)}`;
|
|
63
|
+
case _ast.nodeType.binaryExpr:
|
|
64
|
+
{
|
|
65
|
+
let matching = '';
|
|
66
|
+
let grouping = '';
|
|
67
|
+
const vm = node.matching;
|
|
68
|
+
if (vm !== null && (vm.labels.length > 0 || vm.on)) {
|
|
69
|
+
if (vm.on) {
|
|
70
|
+
matching = ` on(${vm.labels.join(', ')})`;
|
|
71
|
+
} else {
|
|
72
|
+
matching = ` ignoring(${vm.labels.join(', ')})`;
|
|
73
|
+
}
|
|
74
|
+
if (vm.card === _ast.vectorMatchCardinality.manyToOne || vm.card === _ast.vectorMatchCardinality.oneToMany) {
|
|
75
|
+
grouping = ` group_${vm.card === _ast.vectorMatchCardinality.manyToOne ? 'left' : 'right'}(${vm.include.join(',')})`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return `${serializeNode((0, _utils.maybeParenthesizeBinopChild)(node.op, node.lhs), childIndent, pretty)}${childSeparator}${ind}${node.op}${node.bool ? ' bool' : ''}${matching}${grouping}${childSeparator}${serializeNode((0, _utils.maybeParenthesizeBinopChild)(node.op, node.rhs), childIndent, pretty)}`;
|
|
79
|
+
}
|
|
80
|
+
case _ast.nodeType.placeholder:
|
|
81
|
+
// TODO: Should we just throw an error when trying to serialize an AST containing a placeholder node?
|
|
82
|
+
// (that would currently break editing-as-text of ASTs that contain placeholders)
|
|
83
|
+
return `${initialInd}…${node.children.length > 0 ? `(${childListSeparator}${node.children.map((child)=>serializeNode(child, childIndent, pretty)).join(',' + childSeparator)}${childListSeparator}${ind})` : ''}`;
|
|
84
|
+
default:
|
|
85
|
+
throw new Error('unsupported node type');
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const _default = serializeNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -22,6 +22,9 @@ function _export(target, all) {
|
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
_export(exports, {
|
|
25
|
+
aggregatorsWithParam: function() {
|
|
26
|
+
return aggregatorsWithParam;
|
|
27
|
+
},
|
|
25
28
|
escapeString: function() {
|
|
26
29
|
return escapeString;
|
|
27
30
|
},
|
|
@@ -104,6 +107,14 @@ const getNodeChildren = (node)=>{
|
|
|
104
107
|
throw new Error('unsupported node type');
|
|
105
108
|
}
|
|
106
109
|
};
|
|
110
|
+
const aggregatorsWithParam = [
|
|
111
|
+
'topk',
|
|
112
|
+
'bottomk',
|
|
113
|
+
'quantile',
|
|
114
|
+
'count_values',
|
|
115
|
+
'limitk',
|
|
116
|
+
'limit_ratio'
|
|
117
|
+
];
|
|
107
118
|
const escapeString = (str)=>{
|
|
108
119
|
return str.replace(/([\\"])/g, '\\$1');
|
|
109
120
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -14,9 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
useInstantQuery: function() {
|
|
25
|
+
return useInstantQuery;
|
|
26
|
+
},
|
|
27
|
+
useParseQuery: function() {
|
|
20
28
|
return useParseQuery;
|
|
21
29
|
}
|
|
22
30
|
});
|
|
@@ -40,3 +48,28 @@ function useParseQuery(content, datasource, enabled) {
|
|
|
40
48
|
}
|
|
41
49
|
});
|
|
42
50
|
}
|
|
51
|
+
function useInstantQuery(content, datasource, enabled) {
|
|
52
|
+
const { data: client } = (0, _pluginsystem.useDatasourceClient)(datasource);
|
|
53
|
+
return (0, _reactquery.useQuery)({
|
|
54
|
+
enabled: !!client && enabled,
|
|
55
|
+
// TODO: for some reason the caching is not working: identical nodes still fire their requests after each change made to the promQL
|
|
56
|
+
queryKey: [
|
|
57
|
+
'instantQuery',
|
|
58
|
+
content,
|
|
59
|
+
'datasource',
|
|
60
|
+
datasource.kind
|
|
61
|
+
],
|
|
62
|
+
queryFn: async ()=>{
|
|
63
|
+
const params = {
|
|
64
|
+
query: content
|
|
65
|
+
};
|
|
66
|
+
const startTime = performance.now();
|
|
67
|
+
const response = await client.instantQuery(params);
|
|
68
|
+
const responseTime = performance.now() - startTime;
|
|
69
|
+
return {
|
|
70
|
+
...response,
|
|
71
|
+
responseTime
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
package/lib/cjs/env.d.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
/// <reference types="@rsbuild/core/types" />
|
|
14
|
+
"use strict";
|
|
@@ -0,0 +1,203 @@
|
|
|
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
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "PrometheusExplorer", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return PrometheusExplorer;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
26
|
+
const _explore = require("@perses-dev/explore");
|
|
27
|
+
const _useresizeobserver = /*#__PURE__*/ _interop_require_default(require("use-resize-observer"));
|
|
28
|
+
const _dashboards = require("@perses-dev/dashboards");
|
|
29
|
+
const _prometheusselectors = require("../model/prometheus-selectors");
|
|
30
|
+
const _PrometheusMetricsFinder = require("./PrometheusMetricsFinder");
|
|
31
|
+
function _interop_require_default(obj) {
|
|
32
|
+
return obj && obj.__esModule ? obj : {
|
|
33
|
+
default: obj
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const PANEL_PREVIEW_HEIGHT = 700;
|
|
37
|
+
function TimeSeriesPanel({ queries }) {
|
|
38
|
+
const { width, ref: boxRef } = (0, _useresizeobserver.default)();
|
|
39
|
+
const height = PANEL_PREVIEW_HEIGHT;
|
|
40
|
+
const suggestedStepMs = (0, _pluginsystem.useSuggestedStepMs)(width);
|
|
41
|
+
// map TimeSeriesQueryDefinition to Definition<UnknownSpec>
|
|
42
|
+
const definitions = queries.length ? queries.map((query)=>{
|
|
43
|
+
return {
|
|
44
|
+
kind: query.spec.plugin.kind,
|
|
45
|
+
spec: query.spec.plugin.spec
|
|
46
|
+
};
|
|
47
|
+
}) : [];
|
|
48
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
49
|
+
ref: boxRef,
|
|
50
|
+
height: height,
|
|
51
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DataQueriesProvider, {
|
|
52
|
+
definitions: definitions,
|
|
53
|
+
options: {
|
|
54
|
+
suggestedStepMs,
|
|
55
|
+
mode: 'range'
|
|
56
|
+
},
|
|
57
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_dashboards.Panel, {
|
|
58
|
+
panelOptions: {
|
|
59
|
+
hideHeader: true
|
|
60
|
+
},
|
|
61
|
+
definition: {
|
|
62
|
+
kind: 'Panel',
|
|
63
|
+
spec: {
|
|
64
|
+
queries: queries,
|
|
65
|
+
display: {
|
|
66
|
+
name: ''
|
|
67
|
+
},
|
|
68
|
+
plugin: {
|
|
69
|
+
kind: 'TimeSeriesChart',
|
|
70
|
+
spec: {}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function MetricDataTable({ queries }) {
|
|
79
|
+
const height = PANEL_PREVIEW_HEIGHT;
|
|
80
|
+
// map TimeSeriesQueryDefinition to Definition<UnknownSpec>
|
|
81
|
+
const definitions = queries.map((query)=>{
|
|
82
|
+
return {
|
|
83
|
+
kind: query.spec.plugin.kind,
|
|
84
|
+
spec: query.spec.plugin.spec
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
88
|
+
height: height,
|
|
89
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DataQueriesProvider, {
|
|
90
|
+
definitions: definitions,
|
|
91
|
+
options: {
|
|
92
|
+
mode: 'instant'
|
|
93
|
+
},
|
|
94
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_dashboards.Panel, {
|
|
95
|
+
panelOptions: {
|
|
96
|
+
hideHeader: true
|
|
97
|
+
},
|
|
98
|
+
definition: {
|
|
99
|
+
kind: 'Panel',
|
|
100
|
+
spec: {
|
|
101
|
+
queries: queries,
|
|
102
|
+
display: {
|
|
103
|
+
name: ''
|
|
104
|
+
},
|
|
105
|
+
plugin: {
|
|
106
|
+
kind: 'TimeSeriesTable',
|
|
107
|
+
spec: {}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function PrometheusExplorer() {
|
|
116
|
+
const { data: { tab = 'table', queries = [], datasource = _prometheusselectors.DEFAULT_PROM, filters = [], exploredMetric = undefined }, setData } = (0, _explore.useExplorerManagerContext)();
|
|
117
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
118
|
+
gap: 2,
|
|
119
|
+
sx: {
|
|
120
|
+
width: '100%'
|
|
121
|
+
},
|
|
122
|
+
children: [
|
|
123
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Tabs, {
|
|
124
|
+
value: tab,
|
|
125
|
+
onChange: (_, state)=>setData({
|
|
126
|
+
tab: state,
|
|
127
|
+
queries
|
|
128
|
+
}),
|
|
129
|
+
variant: "scrollable",
|
|
130
|
+
sx: {
|
|
131
|
+
borderBottom: 1,
|
|
132
|
+
borderColor: 'divider'
|
|
133
|
+
},
|
|
134
|
+
children: [
|
|
135
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Tab, {
|
|
136
|
+
value: "table",
|
|
137
|
+
label: "Table"
|
|
138
|
+
}),
|
|
139
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Tab, {
|
|
140
|
+
value: "graph",
|
|
141
|
+
label: "Graph"
|
|
142
|
+
}),
|
|
143
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Tab, {
|
|
144
|
+
value: "finder",
|
|
145
|
+
label: "Finder"
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
}),
|
|
149
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
150
|
+
gap: 1,
|
|
151
|
+
children: [
|
|
152
|
+
tab === 'table' && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
153
|
+
children: [
|
|
154
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.MultiQueryEditor, {
|
|
155
|
+
queryTypes: [
|
|
156
|
+
'TimeSeriesQuery'
|
|
157
|
+
],
|
|
158
|
+
onChange: (state)=>setData({
|
|
159
|
+
tab,
|
|
160
|
+
queries: state
|
|
161
|
+
}),
|
|
162
|
+
queries: queries
|
|
163
|
+
}),
|
|
164
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(MetricDataTable, {
|
|
165
|
+
queries: queries
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
}),
|
|
169
|
+
tab === 'graph' && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
170
|
+
children: [
|
|
171
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.MultiQueryEditor, {
|
|
172
|
+
queryTypes: [
|
|
173
|
+
'TimeSeriesQuery'
|
|
174
|
+
],
|
|
175
|
+
onChange: (state)=>setData({
|
|
176
|
+
tab,
|
|
177
|
+
queries: state
|
|
178
|
+
}),
|
|
179
|
+
queries: queries
|
|
180
|
+
}),
|
|
181
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(TimeSeriesPanel, {
|
|
182
|
+
queries: queries
|
|
183
|
+
})
|
|
184
|
+
]
|
|
185
|
+
}),
|
|
186
|
+
tab === 'finder' && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
187
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PrometheusMetricsFinder.PrometheusMetricsFinder, {
|
|
188
|
+
onChange: (state)=>setData({
|
|
189
|
+
tab,
|
|
190
|
+
...state
|
|
191
|
+
}),
|
|
192
|
+
value: {
|
|
193
|
+
datasource,
|
|
194
|
+
filters,
|
|
195
|
+
exploredMetric
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
})
|
|
199
|
+
]
|
|
200
|
+
})
|
|
201
|
+
]
|
|
202
|
+
});
|
|
203
|
+
}
|
|
@@ -0,0 +1,268 @@
|
|
|
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
|
+
"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: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
MetricNameExplorer: function() {
|
|
25
|
+
return MetricNameExplorer;
|
|
26
|
+
},
|
|
27
|
+
PrometheusMetricsFinder: function() {
|
|
28
|
+
return PrometheusMetricsFinder;
|
|
29
|
+
},
|
|
30
|
+
SettingsMenu: function() {
|
|
31
|
+
return SettingsMenu;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
35
|
+
const _material = require("@mui/material");
|
|
36
|
+
const _fuzzy = require("@nexucis/fuzzy");
|
|
37
|
+
const _explore = require("@perses-dev/explore");
|
|
38
|
+
const _ArrowLeft = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ArrowLeft"));
|
|
39
|
+
const _Cog = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Cog"));
|
|
40
|
+
const _Magnify = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Magnify"));
|
|
41
|
+
const _react = require("react");
|
|
42
|
+
const _reactrouterdom = require("react-router-dom");
|
|
43
|
+
const _model = require("../../model");
|
|
44
|
+
const _MetricList = require("./display/list/MetricList");
|
|
45
|
+
const _FinderFilters = require("./filter/FinderFilters");
|
|
46
|
+
const _MetricOverview = require("./overview/MetricOverview");
|
|
47
|
+
const _utils = require("./utils");
|
|
48
|
+
function _interop_require_default(obj) {
|
|
49
|
+
return obj && obj.__esModule ? obj : {
|
|
50
|
+
default: obj
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const PERSES_METRICS_FINDER_SETTINGS = 'PERSES_METRICS_FINDER_SETTINGS';
|
|
54
|
+
function SettingsMenu({ value, onChange }) {
|
|
55
|
+
const [anchorEl, setAnchorEl] = (0, _react.useState)(null);
|
|
56
|
+
const open = Boolean(anchorEl);
|
|
57
|
+
const handleClick = (event)=>{
|
|
58
|
+
setAnchorEl(event.currentTarget);
|
|
59
|
+
};
|
|
60
|
+
const handleClose = ()=>{
|
|
61
|
+
setAnchorEl(null);
|
|
62
|
+
};
|
|
63
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
64
|
+
children: [
|
|
65
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
66
|
+
"aria-label": "settings",
|
|
67
|
+
size: "large",
|
|
68
|
+
onClick: handleClick,
|
|
69
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Cog.default, {})
|
|
70
|
+
}),
|
|
71
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Menu, {
|
|
72
|
+
id: "finder-settings-menu",
|
|
73
|
+
anchorEl: anchorEl,
|
|
74
|
+
open: open,
|
|
75
|
+
onClose: handleClose,
|
|
76
|
+
children: [
|
|
77
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
78
|
+
onClick: (e)=>e.preventDefault(),
|
|
79
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControlLabel, {
|
|
80
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Checkbox, {}),
|
|
81
|
+
label: "Enable Metadata",
|
|
82
|
+
checked: value.isMetadataEnabled,
|
|
83
|
+
onClick: ()=>onChange({
|
|
84
|
+
...value,
|
|
85
|
+
isMetadataEnabled: !value.isMetadataEnabled
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
}),
|
|
89
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
90
|
+
onClick: (e)=>e.preventDefault(),
|
|
91
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControlLabel, {
|
|
92
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Checkbox, {}),
|
|
93
|
+
label: "Enable Time Series Chart",
|
|
94
|
+
checked: value.isPanelEnabled,
|
|
95
|
+
onClick: ()=>onChange({
|
|
96
|
+
...value,
|
|
97
|
+
isPanelEnabled: !value.isPanelEnabled
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function MetricNameExplorer({ datasource, filters, isMetadataEnabled, onExplore, ...props }) {
|
|
107
|
+
const { data, isLoading, error } = (0, _utils.useLabelValues)('__name__', filters, datasource);
|
|
108
|
+
const [search, setSearch] = (0, _react.useState)('');
|
|
109
|
+
const fuzzy = (0, _react.useMemo)(()=>new _fuzzy.Fuzzy({
|
|
110
|
+
includeMatches: true,
|
|
111
|
+
excludedChars: [
|
|
112
|
+
' '
|
|
113
|
+
]
|
|
114
|
+
}), []);
|
|
115
|
+
const filteredResults = (0, _react.useMemo)(()=>{
|
|
116
|
+
if (search && data?.data) {
|
|
117
|
+
return fuzzy.filter(search, data.data).sort((a, b)=>b.score - a.score);
|
|
118
|
+
}
|
|
119
|
+
return undefined;
|
|
120
|
+
}, [
|
|
121
|
+
data,
|
|
122
|
+
fuzzy,
|
|
123
|
+
search
|
|
124
|
+
]);
|
|
125
|
+
if (error) {
|
|
126
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
127
|
+
width: "100%",
|
|
128
|
+
children: [
|
|
129
|
+
"Error: ",
|
|
130
|
+
error.message
|
|
131
|
+
]
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
if (isLoading) {
|
|
135
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
136
|
+
width: "100%",
|
|
137
|
+
sx: {
|
|
138
|
+
alignItems: 'center',
|
|
139
|
+
justifyContent: 'center'
|
|
140
|
+
},
|
|
141
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.CircularProgress, {})
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
145
|
+
...props,
|
|
146
|
+
children: [
|
|
147
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
148
|
+
value: search,
|
|
149
|
+
onChange: (e)=>setSearch(e.target.value),
|
|
150
|
+
placeholder: "Search metric name...",
|
|
151
|
+
InputProps: {
|
|
152
|
+
startAdornment: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputAdornment, {
|
|
153
|
+
position: "start",
|
|
154
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Magnify.default, {})
|
|
155
|
+
})
|
|
156
|
+
}
|
|
157
|
+
}),
|
|
158
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_MetricList.MetricList, {
|
|
159
|
+
metricNames: data?.data ?? [],
|
|
160
|
+
filteredResults: filteredResults,
|
|
161
|
+
datasource: datasource,
|
|
162
|
+
filters: filters,
|
|
163
|
+
isMetadataEnabled: isMetadataEnabled,
|
|
164
|
+
onExplore: onExplore
|
|
165
|
+
})
|
|
166
|
+
]
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function PrometheusMetricsFinder({ value: { datasource = _model.DEFAULT_PROM, filters = [], exploredMetric }, onChange, onExplore, ...props }) {
|
|
170
|
+
const settingsStored = localStorage.getItem(PERSES_METRICS_FINDER_SETTINGS);
|
|
171
|
+
const [settings, setSettings] = (0, _react.useState)(settingsStored ? JSON.parse(settingsStored) : {
|
|
172
|
+
isMetadataEnabled: true
|
|
173
|
+
});
|
|
174
|
+
function handleSettingsUpdate(value) {
|
|
175
|
+
setSettings(value);
|
|
176
|
+
localStorage.setItem(PERSES_METRICS_FINDER_SETTINGS, JSON.stringify(value));
|
|
177
|
+
}
|
|
178
|
+
const isMobileSize = (0, _material.useMediaQuery)((0, _material.useTheme)().breakpoints.down('md'));
|
|
179
|
+
// Remove duplicated filters and filters without label or labelValues
|
|
180
|
+
const filteredFilters = (0, _react.useMemo)(()=>{
|
|
181
|
+
return filters.filter((filter)=>filter.label && filter.labelValues.length > 0);
|
|
182
|
+
}, [
|
|
183
|
+
filters
|
|
184
|
+
]);
|
|
185
|
+
const searchParams = (0, _explore.useExplorerQueryParams)({
|
|
186
|
+
data: {
|
|
187
|
+
tab: 'finder',
|
|
188
|
+
datasource,
|
|
189
|
+
filters,
|
|
190
|
+
exploredMetric: undefined
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
function setDatasource(value) {
|
|
194
|
+
onChange({
|
|
195
|
+
datasource: value,
|
|
196
|
+
filters,
|
|
197
|
+
exploredMetric
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function setFilters(value) {
|
|
201
|
+
onChange({
|
|
202
|
+
datasource,
|
|
203
|
+
filters: value,
|
|
204
|
+
exploredMetric
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
208
|
+
...props,
|
|
209
|
+
gap: 1,
|
|
210
|
+
children: [
|
|
211
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
212
|
+
direction: isMobileSize ? 'column' : 'row',
|
|
213
|
+
gap: 2,
|
|
214
|
+
justifyContent: "space-between",
|
|
215
|
+
children: [
|
|
216
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_FinderFilters.FinderFilters, {
|
|
217
|
+
datasource: datasource ?? _model.DEFAULT_PROM,
|
|
218
|
+
filters: filters ?? [],
|
|
219
|
+
filteredFilters: filteredFilters,
|
|
220
|
+
onDatasourceChange: setDatasource,
|
|
221
|
+
onFiltersChange: setFilters
|
|
222
|
+
}),
|
|
223
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
224
|
+
direction: "row",
|
|
225
|
+
gap: 1,
|
|
226
|
+
alignItems: "center",
|
|
227
|
+
children: [
|
|
228
|
+
exploredMetric && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
229
|
+
variant: "contained",
|
|
230
|
+
"aria-label": "back to metric explorer",
|
|
231
|
+
startIcon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ArrowLeft.default, {}),
|
|
232
|
+
component: _reactrouterdom.Link,
|
|
233
|
+
to: `?${searchParams}`,
|
|
234
|
+
children: "Back"
|
|
235
|
+
}),
|
|
236
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
237
|
+
direction: "row",
|
|
238
|
+
sx: {
|
|
239
|
+
width: isMobileSize ? '100%' : 'unset'
|
|
240
|
+
},
|
|
241
|
+
justifyContent: isMobileSize ? 'end' : 'unset',
|
|
242
|
+
alignItems: "center",
|
|
243
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(SettingsMenu, {
|
|
244
|
+
value: settings,
|
|
245
|
+
onChange: handleSettingsUpdate
|
|
246
|
+
})
|
|
247
|
+
})
|
|
248
|
+
]
|
|
249
|
+
})
|
|
250
|
+
]
|
|
251
|
+
}),
|
|
252
|
+
exploredMetric ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_MetricOverview.MetricOverview, {
|
|
253
|
+
metricName: exploredMetric,
|
|
254
|
+
datasource: datasource ?? _model.DEFAULT_PROM,
|
|
255
|
+
filters: filteredFilters,
|
|
256
|
+
isMetadataEnabled: settings.isMetadataEnabled,
|
|
257
|
+
isPanelEnabled: settings.isPanelEnabled,
|
|
258
|
+
onFiltersChange: setFilters,
|
|
259
|
+
onExplore: onExplore
|
|
260
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(MetricNameExplorer, {
|
|
261
|
+
datasource: datasource ?? _model.DEFAULT_PROM,
|
|
262
|
+
filters: filteredFilters,
|
|
263
|
+
isMetadataEnabled: settings.isMetadataEnabled,
|
|
264
|
+
onExplore: onExplore
|
|
265
|
+
})
|
|
266
|
+
]
|
|
267
|
+
});
|
|
268
|
+
}
|