@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,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
|
+
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
|
+
useLabelValues: function() {
|
|
25
|
+
return useLabelValues;
|
|
26
|
+
},
|
|
27
|
+
useLabels: function() {
|
|
28
|
+
return useLabels;
|
|
29
|
+
},
|
|
30
|
+
useMetricMetadata: function() {
|
|
31
|
+
return useMetricMetadata;
|
|
32
|
+
},
|
|
33
|
+
useSeriesStates: function() {
|
|
34
|
+
return useSeriesStates;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
38
|
+
const _reactquery = require("@tanstack/react-query");
|
|
39
|
+
const _react = require("react");
|
|
40
|
+
const _types = require("./types");
|
|
41
|
+
function useMetricMetadata(metricName, datasource, enabled) {
|
|
42
|
+
const { data: client } = (0, _pluginsystem.useDatasourceClient)(datasource);
|
|
43
|
+
// histograms and summaries timeseries desc are not always added to prefixed timeseries
|
|
44
|
+
const name = metricName.replace(/(_count|_sum|_bucket)$/, '');
|
|
45
|
+
const { data, isLoading, error } = (0, _reactquery.useQuery)({
|
|
46
|
+
enabled: !!client && enabled,
|
|
47
|
+
queryKey: [
|
|
48
|
+
'metricMetadata',
|
|
49
|
+
name
|
|
50
|
+
],
|
|
51
|
+
queryFn: async ()=>{
|
|
52
|
+
const params = {
|
|
53
|
+
metric: name
|
|
54
|
+
};
|
|
55
|
+
return await client.metricMetadata(params);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
// Find the first result with help text
|
|
59
|
+
const metadata = (0, _react.useMemo)(()=>{
|
|
60
|
+
for (const metric of data?.data?.[name] ?? []){
|
|
61
|
+
if (metric.help.length > 0) {
|
|
62
|
+
return metric;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return undefined;
|
|
66
|
+
}, [
|
|
67
|
+
data,
|
|
68
|
+
name
|
|
69
|
+
]);
|
|
70
|
+
return {
|
|
71
|
+
metadata,
|
|
72
|
+
isLoading,
|
|
73
|
+
error
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function useLabels(filters, datasource) {
|
|
77
|
+
const { absoluteTimeRange: { start, end } } = (0, _pluginsystem.useTimeRange)();
|
|
78
|
+
const { data: client } = (0, _pluginsystem.useDatasourceClient)(datasource);
|
|
79
|
+
return (0, _reactquery.useQuery)({
|
|
80
|
+
enabled: !!client,
|
|
81
|
+
queryKey: [
|
|
82
|
+
'labels',
|
|
83
|
+
'datasource',
|
|
84
|
+
datasource.name,
|
|
85
|
+
'start',
|
|
86
|
+
start,
|
|
87
|
+
'end',
|
|
88
|
+
end,
|
|
89
|
+
'filters',
|
|
90
|
+
...filters
|
|
91
|
+
],
|
|
92
|
+
queryFn: async ()=>{
|
|
93
|
+
const params = {
|
|
94
|
+
start: start.valueOf() / 1000,
|
|
95
|
+
end: end.valueOf() / 1000
|
|
96
|
+
};
|
|
97
|
+
if (filters.length) {
|
|
98
|
+
params['match[]'] = [
|
|
99
|
+
`{${(0, _types.computeFilterExpr)(filters)}}`
|
|
100
|
+
];
|
|
101
|
+
}
|
|
102
|
+
return await client.labelNames(params);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function useLabelValues(labelName, filters, datasource) {
|
|
107
|
+
const { absoluteTimeRange: { start, end } } = (0, _pluginsystem.useTimeRange)();
|
|
108
|
+
const { data: client } = (0, _pluginsystem.useDatasourceClient)(datasource);
|
|
109
|
+
return (0, _reactquery.useQuery)({
|
|
110
|
+
enabled: !!client,
|
|
111
|
+
queryKey: [
|
|
112
|
+
'labelValues',
|
|
113
|
+
labelName,
|
|
114
|
+
'datasource',
|
|
115
|
+
datasource.name,
|
|
116
|
+
'start',
|
|
117
|
+
start,
|
|
118
|
+
'end',
|
|
119
|
+
'filters',
|
|
120
|
+
...filters
|
|
121
|
+
],
|
|
122
|
+
queryFn: async ()=>{
|
|
123
|
+
const params = {
|
|
124
|
+
labelName: labelName,
|
|
125
|
+
start: start.valueOf() / 1000,
|
|
126
|
+
end: end.valueOf() / 1000
|
|
127
|
+
};
|
|
128
|
+
if (filters.length) {
|
|
129
|
+
params['match[]'] = [
|
|
130
|
+
`{${(0, _types.computeFilterExpr)(filters)}}`
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
return await client.labelValues(params);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function useSeriesStates(metricName, filters, datasource) {
|
|
138
|
+
const { absoluteTimeRange: { start, end } } = (0, _pluginsystem.useTimeRange)();
|
|
139
|
+
const { data: client } = (0, _pluginsystem.useDatasourceClient)(datasource);
|
|
140
|
+
const { data: seriesData, isLoading, isError, error } = (0, _reactquery.useQuery)({
|
|
141
|
+
enabled: !!client,
|
|
142
|
+
queryKey: [
|
|
143
|
+
'series',
|
|
144
|
+
metricName,
|
|
145
|
+
'datasource',
|
|
146
|
+
datasource,
|
|
147
|
+
'start',
|
|
148
|
+
start,
|
|
149
|
+
'end',
|
|
150
|
+
'filters',
|
|
151
|
+
...filters
|
|
152
|
+
],
|
|
153
|
+
queryFn: async ()=>{
|
|
154
|
+
const params = {
|
|
155
|
+
'match[]': [
|
|
156
|
+
`{${(0, _types.computeFilterExpr)(filters)}}`
|
|
157
|
+
],
|
|
158
|
+
start: start.valueOf() / 1000,
|
|
159
|
+
end: end.valueOf() / 1000
|
|
160
|
+
};
|
|
161
|
+
return await client.series(params);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
const labelValueCounters = (0, _react.useMemo)(()=>{
|
|
165
|
+
const result = new Map();
|
|
166
|
+
if (seriesData?.data === undefined) {
|
|
167
|
+
return result;
|
|
168
|
+
}
|
|
169
|
+
for (const series of seriesData.data){
|
|
170
|
+
for (const [label, value] of Object.entries(series)){
|
|
171
|
+
const labelCounters = result.get(label);
|
|
172
|
+
if (labelCounters === undefined) {
|
|
173
|
+
result.set(label, [
|
|
174
|
+
{
|
|
175
|
+
labelValue: value,
|
|
176
|
+
counter: 1
|
|
177
|
+
}
|
|
178
|
+
]);
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
const labelValueCounter = labelCounters.find((counter)=>counter.labelValue === value);
|
|
182
|
+
if (labelValueCounter === undefined) {
|
|
183
|
+
labelCounters.push({
|
|
184
|
+
labelValue: value,
|
|
185
|
+
counter: 1
|
|
186
|
+
});
|
|
187
|
+
} else {
|
|
188
|
+
labelValueCounter.counter += 1;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return result;
|
|
193
|
+
}, [
|
|
194
|
+
seriesData
|
|
195
|
+
]);
|
|
196
|
+
return {
|
|
197
|
+
series: seriesData?.data,
|
|
198
|
+
labelValueCounters,
|
|
199
|
+
isLoading,
|
|
200
|
+
isError,
|
|
201
|
+
error
|
|
202
|
+
};
|
|
203
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_export_star(require("./PrometheusMetricsFinder"), exports);
|
|
6
|
+
_export_star(require("./PrometheusExplorer"), exports);
|
|
7
|
+
function _export_star(from, to) {
|
|
8
|
+
Object.keys(from).forEach(function(k) {
|
|
9
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
10
|
+
Object.defineProperty(to, k, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function() {
|
|
13
|
+
return from[k];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return from;
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getPluginModule", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return getPluginModule;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _packagejson = /*#__PURE__*/ _interop_require_default(require("../package.json"));
|
|
12
|
+
function _interop_require_default(obj) {
|
|
13
|
+
return obj && obj.__esModule ? obj : {
|
|
14
|
+
default: obj
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function getPluginModule() {
|
|
18
|
+
const { name, version, perses } = _packagejson.default;
|
|
19
|
+
return {
|
|
20
|
+
kind: 'PluginModule',
|
|
21
|
+
metadata: {
|
|
22
|
+
name,
|
|
23
|
+
version
|
|
24
|
+
},
|
|
25
|
+
spec: perses
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
15
|
+
if (typeof WeakMap !== "function") return null;
|
|
16
|
+
var cacheBabelInterop = new WeakMap();
|
|
17
|
+
var cacheNodeInterop = new WeakMap();
|
|
18
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
19
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
20
|
+
})(nodeInterop);
|
|
21
|
+
}
|
|
22
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
23
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
24
|
+
return obj;
|
|
25
|
+
}
|
|
26
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
27
|
+
return {
|
|
28
|
+
default: obj
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
32
|
+
if (cache && cache.has(obj)) {
|
|
33
|
+
return cache.get(obj);
|
|
34
|
+
}
|
|
35
|
+
var newObj = {
|
|
36
|
+
__proto__: null
|
|
37
|
+
};
|
|
38
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
39
|
+
for(var key in obj){
|
|
40
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
41
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
42
|
+
if (desc && (desc.get || desc.set)) {
|
|
43
|
+
Object.defineProperty(newObj, key, desc);
|
|
44
|
+
} else {
|
|
45
|
+
newObj[key] = obj[key];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
newObj.default = obj;
|
|
50
|
+
if (cache) {
|
|
51
|
+
cache.set(obj, newObj);
|
|
52
|
+
}
|
|
53
|
+
return newObj;
|
|
54
|
+
}
|
|
55
|
+
Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bootstrap")));
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getPluginModule", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _getPluginModule.getPluginModule;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
_export_star(require("./components"), exports);
|
|
12
|
+
_export_star(require("./explore"), exports);
|
|
13
|
+
const _getPluginModule = require("./getPluginModule");
|
|
14
|
+
_export_star(require("./model"), exports);
|
|
15
|
+
_export_star(require("./plugins"), exports);
|
|
16
|
+
function _export_star(from, to) {
|
|
17
|
+
Object.keys(from).forEach(function(k) {
|
|
18
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
19
|
+
Object.defineProperty(to, k, {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function() {
|
|
22
|
+
return from[k];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return from;
|
|
28
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Copyright 2023 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, "PrometheusDatasourceEditor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return PrometheusDatasourceEditor;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
|
+
const _material = require("@mui/material");
|
|
26
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
27
|
+
const _types = require("./types");
|
|
28
|
+
function _interop_require_default(obj) {
|
|
29
|
+
return obj && obj.__esModule ? obj : {
|
|
30
|
+
default: obj
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function PrometheusDatasourceEditor(props) {
|
|
34
|
+
const { value, onChange, isReadonly } = props;
|
|
35
|
+
const initialSpecDirect = {
|
|
36
|
+
directUrl: ''
|
|
37
|
+
};
|
|
38
|
+
const initialSpecProxy = {
|
|
39
|
+
proxy: {
|
|
40
|
+
kind: 'HTTPProxy',
|
|
41
|
+
spec: {
|
|
42
|
+
allowedEndpoints: [
|
|
43
|
+
// list of standard endpoints suggested by default
|
|
44
|
+
{
|
|
45
|
+
endpointPattern: '/api/v1/labels',
|
|
46
|
+
method: 'POST'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
endpointPattern: '/api/v1/series',
|
|
50
|
+
method: 'POST'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
endpointPattern: '/api/v1/metadata',
|
|
54
|
+
method: 'GET'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
endpointPattern: '/api/v1/query',
|
|
58
|
+
method: 'POST'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
endpointPattern: '/api/v1/query_range',
|
|
62
|
+
method: 'POST'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
endpointPattern: '/api/v1/label/([a-zA-Z0-9_-]+)/values',
|
|
66
|
+
method: 'GET'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
endpointPattern: '/api/v1/parse_query',
|
|
70
|
+
method: 'POST'
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
url: ''
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
78
|
+
children: [
|
|
79
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
80
|
+
variant: "h4",
|
|
81
|
+
mb: 2,
|
|
82
|
+
children: "General Settings"
|
|
83
|
+
}),
|
|
84
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
85
|
+
fullWidth: true,
|
|
86
|
+
label: "Scrape Interval",
|
|
87
|
+
value: value.scrapeInterval || '',
|
|
88
|
+
placeholder: `Default: ${_types.DEFAULT_SCRAPE_INTERVAL}`,
|
|
89
|
+
InputProps: {
|
|
90
|
+
readOnly: isReadonly
|
|
91
|
+
},
|
|
92
|
+
InputLabelProps: {
|
|
93
|
+
shrink: isReadonly ? true : undefined
|
|
94
|
+
},
|
|
95
|
+
onChange: (e)=>onChange({
|
|
96
|
+
...value,
|
|
97
|
+
scrapeInterval: e.target.value
|
|
98
|
+
})
|
|
99
|
+
}),
|
|
100
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.HTTPSettingsEditor, {
|
|
101
|
+
value: value,
|
|
102
|
+
onChange: onChange,
|
|
103
|
+
isReadonly: isReadonly,
|
|
104
|
+
initialSpecDirect: initialSpecDirect,
|
|
105
|
+
initialSpecProxy: initialSpecProxy
|
|
106
|
+
})
|
|
107
|
+
]
|
|
108
|
+
});
|
|
109
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "PrometheusLabelNamesVariable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return PrometheusLabelNamesVariable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
12
|
+
const _model = require("../model");
|
|
13
|
+
const _prometheusvariables = require("./prometheus-variables");
|
|
14
|
+
const PrometheusLabelNamesVariable = {
|
|
15
|
+
getVariableOptions: async (spec, ctx)=>{
|
|
16
|
+
const client = await ctx.datasourceStore.getDatasourceClient(spec.datasource ?? _model.DEFAULT_PROM);
|
|
17
|
+
const match = spec.matchers ? spec.matchers.map((m)=>(0, _pluginsystem.replaceVariables)(m, ctx.variables)) : undefined;
|
|
18
|
+
const timeRange = (0, _model.getPrometheusTimeRange)(ctx.timeRange);
|
|
19
|
+
const { data: options } = await client.labelNames({
|
|
20
|
+
'match[]': match,
|
|
21
|
+
...timeRange
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
data: (0, _prometheusvariables.stringArrayToVariableOptions)(options)
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
dependsOn: (spec)=>{
|
|
28
|
+
return {
|
|
29
|
+
variables: spec.matchers?.map((m)=>(0, _pluginsystem.parseVariables)(m)).flat() || []
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
OptionsEditorComponent: _prometheusvariables.PrometheusLabelNamesVariableEditor,
|
|
33
|
+
createInitialOptions: ()=>({})
|
|
34
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "PrometheusLabelValuesVariable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return PrometheusLabelValuesVariable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
12
|
+
const _model = require("../model");
|
|
13
|
+
const _prometheusvariables = require("./prometheus-variables");
|
|
14
|
+
const PrometheusLabelValuesVariable = {
|
|
15
|
+
getVariableOptions: async (spec, ctx)=>{
|
|
16
|
+
const pluginDef = spec;
|
|
17
|
+
const client = await ctx.datasourceStore.getDatasourceClient(spec.datasource ?? _model.DEFAULT_PROM);
|
|
18
|
+
const match = pluginDef.matchers ? pluginDef.matchers.map((m)=>(0, _pluginsystem.replaceVariables)(m, ctx.variables)) : undefined;
|
|
19
|
+
const timeRange = (0, _model.getPrometheusTimeRange)(ctx.timeRange);
|
|
20
|
+
const { data: options } = await client.labelValues({
|
|
21
|
+
labelName: (0, _pluginsystem.replaceVariables)(pluginDef.labelName, ctx.variables),
|
|
22
|
+
'match[]': match,
|
|
23
|
+
...timeRange
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
data: (0, _prometheusvariables.stringArrayToVariableOptions)(options)
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
dependsOn: (spec)=>{
|
|
30
|
+
return {
|
|
31
|
+
variables: spec.matchers?.map((m)=>(0, _pluginsystem.parseVariables)(m)).flat().concat((0, _pluginsystem.parseVariables)(spec.labelName)) || []
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
OptionsEditorComponent: _prometheusvariables.PrometheusLabelValuesVariableEditor,
|
|
35
|
+
createInitialOptions: ()=>({
|
|
36
|
+
labelName: ''
|
|
37
|
+
})
|
|
38
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "PrometheusPromQLVariable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return PrometheusPromQLVariable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
12
|
+
const _model = require("../model");
|
|
13
|
+
const _prometheusvariables = require("./prometheus-variables");
|
|
14
|
+
const PrometheusPromQLVariable = {
|
|
15
|
+
getVariableOptions: async (spec, ctx)=>{
|
|
16
|
+
const client = await ctx.datasourceStore.getDatasourceClient(spec.datasource ?? _model.DEFAULT_PROM);
|
|
17
|
+
// TODO we may want to manage a range query as well.
|
|
18
|
+
const { data: options } = await client.instantQuery({
|
|
19
|
+
query: (0, _pluginsystem.replaceVariables)(spec.expr, ctx.variables)
|
|
20
|
+
});
|
|
21
|
+
const labelName = (0, _pluginsystem.replaceVariables)(spec.labelName, ctx.variables);
|
|
22
|
+
let values = [];
|
|
23
|
+
if (options?.resultType === 'matrix') {
|
|
24
|
+
values = (0, _prometheusvariables.capturingMatrix)(options, labelName);
|
|
25
|
+
} else if (options?.resultType === 'vector') {
|
|
26
|
+
values = (0, _prometheusvariables.capturingVector)(options, labelName);
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
data: (0, _prometheusvariables.stringArrayToVariableOptions)(values)
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
dependsOn: (spec)=>{
|
|
33
|
+
return {
|
|
34
|
+
variables: (0, _pluginsystem.parseVariables)(spec.expr).concat((0, _pluginsystem.parseVariables)(spec.labelName))
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
OptionsEditorComponent: _prometheusvariables.PrometheusPromQLVariableEditor,
|
|
38
|
+
createInitialOptions: ()=>({
|
|
39
|
+
expr: '',
|
|
40
|
+
labelName: ''
|
|
41
|
+
})
|
|
42
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_export_star(require("./MatcherEditor"), exports);
|
|
6
|
+
_export_star(require("./prometheus-datasource"), exports);
|
|
7
|
+
_export_star(require("./prometheus-time-series-query"), exports);
|
|
8
|
+
_export_star(require("./prometheus-variables"), exports);
|
|
9
|
+
_export_star(require("./PrometheusDatasourceEditor"), exports);
|
|
10
|
+
_export_star(require("./PrometheusLabelNamesVariable"), exports);
|
|
11
|
+
_export_star(require("./PrometheusPromQLVariable"), exports);
|
|
12
|
+
_export_star(require("./types"), exports);
|
|
13
|
+
_export_star(require("./variable"), exports);
|
|
14
|
+
function _export_star(from, to) {
|
|
15
|
+
Object.keys(from).forEach(function(k) {
|
|
16
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
17
|
+
Object.defineProperty(to, k, {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return from[k];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return from;
|
|
26
|
+
}
|
|
@@ -28,11 +28,11 @@ const _PrometheusDatasourceEditor = require("./PrometheusDatasourceEditor");
|
|
|
28
28
|
const { directUrl, proxy } = spec;
|
|
29
29
|
const { proxyUrl } = options;
|
|
30
30
|
// Use the direct URL if specified, but fallback to the proxyUrl by default if not specified
|
|
31
|
-
const datasourceUrl = directUrl
|
|
31
|
+
const datasourceUrl = directUrl ?? proxyUrl;
|
|
32
32
|
if (datasourceUrl === undefined) {
|
|
33
33
|
throw new Error('No URL specified for Prometheus client. You can use directUrl in the spec to configure it.');
|
|
34
34
|
}
|
|
35
|
-
const specHeaders = proxy
|
|
35
|
+
const specHeaders = proxy?.spec.headers;
|
|
36
36
|
// Could think about this becoming a class, although it definitely doesn't have to be
|
|
37
37
|
return {
|
|
38
38
|
options: {
|
|
@@ -44,31 +44,31 @@ const _PrometheusDatasourceEditor = require("./PrometheusDatasourceEditor");
|
|
|
44
44
|
}),
|
|
45
45
|
instantQuery: (params, headers)=>(0, _model.instantQuery)(params, {
|
|
46
46
|
datasourceUrl,
|
|
47
|
-
headers: headers
|
|
47
|
+
headers: headers ?? specHeaders
|
|
48
48
|
}),
|
|
49
49
|
rangeQuery: (params, headers)=>(0, _model.rangeQuery)(params, {
|
|
50
50
|
datasourceUrl,
|
|
51
|
-
headers: headers
|
|
51
|
+
headers: headers ?? specHeaders
|
|
52
52
|
}),
|
|
53
53
|
labelNames: (params, headers)=>(0, _model.labelNames)(params, {
|
|
54
54
|
datasourceUrl,
|
|
55
|
-
headers: headers
|
|
55
|
+
headers: headers ?? specHeaders
|
|
56
56
|
}),
|
|
57
57
|
labelValues: (params, headers)=>(0, _model.labelValues)(params, {
|
|
58
58
|
datasourceUrl,
|
|
59
|
-
headers: headers
|
|
59
|
+
headers: headers ?? specHeaders
|
|
60
60
|
}),
|
|
61
61
|
metricMetadata: (params, headers)=>(0, _model.metricMetadata)(params, {
|
|
62
62
|
datasourceUrl,
|
|
63
|
-
headers: headers
|
|
63
|
+
headers: headers ?? specHeaders
|
|
64
64
|
}),
|
|
65
65
|
series: (params, headers)=>(0, _model.series)(params, {
|
|
66
66
|
datasourceUrl,
|
|
67
|
-
headers: headers
|
|
67
|
+
headers: headers ?? specHeaders
|
|
68
68
|
}),
|
|
69
69
|
parseQuery: (params, headers)=>(0, _model.parseQuery)(params, {
|
|
70
70
|
datasourceUrl,
|
|
71
|
-
headers: headers
|
|
71
|
+
headers: headers ?? specHeaders
|
|
72
72
|
})
|
|
73
73
|
};
|
|
74
74
|
};
|