@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.
Files changed (434) hide show
  1. package/LICENSE +183 -183
  2. package/README.md +41 -0
  3. package/__mf/css/async/2341.dacad691.css +1 -0
  4. package/__mf/css/async/5263.dacad691.css +1 -0
  5. package/__mf/css/async/6759.dacad691.css +1 -0
  6. package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
  7. package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
  8. package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
  9. package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
  10. package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
  11. package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
  12. package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
  13. package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
  14. package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
  15. package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
  16. package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
  17. package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
  18. package/__mf/js/622.f7592106.js +5 -0
  19. package/__mf/js/Prometheus.328aad7c.js +5 -0
  20. package/__mf/js/async/1465.3b5e12d5.js +1 -0
  21. package/__mf/js/async/1495.6c8b8071.js +1 -0
  22. package/__mf/js/async/1620.6376bd14.js +2 -0
  23. package/__mf/js/async/1620.6376bd14.js.LICENSE.txt +9 -0
  24. package/__mf/js/async/1864.df7c4beb.js +1 -0
  25. package/__mf/js/async/1950.704c331e.js +1 -0
  26. package/__mf/js/async/1964.95da06f6.js +2 -0
  27. package/__mf/js/async/1964.95da06f6.js.LICENSE.txt +9 -0
  28. package/__mf/js/async/1996.01084c88.js +2 -0
  29. package/__mf/js/async/1996.01084c88.js.LICENSE.txt +24 -0
  30. package/__mf/js/async/212.bd5d617a.js +1 -0
  31. package/__mf/js/async/2316.fec4907a.js +1 -0
  32. package/__mf/js/async/232.f3523a60.js +1 -0
  33. package/__mf/js/async/2569.daf868a6.js +10 -0
  34. package/__mf/js/async/2569.daf868a6.js.LICENSE.txt +27 -0
  35. package/__mf/js/async/2675.c3b73822.js +1 -0
  36. package/__mf/js/async/3224.23f0dccf.js +1 -0
  37. package/__mf/js/async/3355.a4dbcdb0.js +1 -0
  38. package/__mf/js/async/3436.97c926a4.js +1 -0
  39. package/__mf/js/async/3818.dde21d04.js +1 -0
  40. package/__mf/js/async/3871.6915e369.js +1 -0
  41. package/__mf/js/async/3960.129d5ef5.js +2 -0
  42. package/__mf/js/async/3960.129d5ef5.js.LICENSE.txt +8 -0
  43. package/__mf/js/async/4075.b77ca1c7.js +1 -0
  44. package/__mf/js/async/4238.8e4d29d5.js +1 -0
  45. package/__mf/js/async/4323.4266fd6a.js +1 -0
  46. package/__mf/js/async/4421.1bcc1637.js +1 -0
  47. package/__mf/js/async/4489.3361e7bc.js +29 -0
  48. package/__mf/js/async/4489.3361e7bc.js.LICENSE.txt +59 -0
  49. package/__mf/js/async/5214.027c4332.js +1 -0
  50. package/__mf/js/async/5345.8c2e4b4a.js +1 -0
  51. package/__mf/js/async/537.6911ea2e.js +1 -0
  52. package/__mf/js/async/5387.fd6e16d6.js +1 -0
  53. package/__mf/js/async/5654.ecb41aea.js +38 -0
  54. package/__mf/js/async/5724.6ee6ec51.js +1 -0
  55. package/__mf/js/async/5774.9b0b6be1.js +1 -0
  56. package/__mf/js/async/5790.2273e061.js +1 -0
  57. package/__mf/js/async/5913.9d30fd07.js +73 -0
  58. package/__mf/js/async/5913.9d30fd07.js.LICENSE.txt +19 -0
  59. package/__mf/js/async/5914.bd342d22.js +74 -0
  60. package/__mf/js/async/5981.40bed0d0.js +2 -0
  61. package/__mf/js/async/5981.40bed0d0.js.LICENSE.txt +8 -0
  62. package/__mf/js/async/6292.7b8efa78.js +1 -0
  63. package/__mf/js/async/6333.865a46e0.js +2 -0
  64. package/__mf/js/async/6333.865a46e0.js.LICENSE.txt +9 -0
  65. package/__mf/js/async/6377.ca974d89.js +2 -0
  66. package/__mf/js/async/6377.ca974d89.js.LICENSE.txt +32 -0
  67. package/__mf/js/async/6770.adb1c939.js +1 -0
  68. package/__mf/js/async/684.ca510333.js +1 -0
  69. package/__mf/js/async/694.f861d67c.js +1 -0
  70. package/__mf/js/async/7272.a763aa92.js +1 -0
  71. package/__mf/js/async/738.aca54e25.js +1 -0
  72. package/__mf/js/async/7740.0c5363fd.js +1 -0
  73. package/__mf/js/async/8265.b9e2c31e.js +1 -0
  74. package/__mf/js/async/8488.5237550f.js +1 -0
  75. package/__mf/js/async/8587.4891ea90.js +1 -0
  76. package/__mf/js/async/8610.8300df79.js +1 -0
  77. package/__mf/js/async/87.fdc843ac.js +1 -0
  78. package/__mf/js/async/8930.9fbbc975.js +1 -0
  79. package/__mf/js/async/8997.18901f45.js +28 -0
  80. package/__mf/js/async/9173.e8fbead5.js +2 -0
  81. package/__mf/js/async/9173.e8fbead5.js.LICENSE.txt +19 -0
  82. package/__mf/js/async/__federation_expose_PrometheusDatasource.f6f57299.js +1 -0
  83. package/__mf/js/async/__federation_expose_PrometheusExplorer.5fcf955a.js +1 -0
  84. package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.86d0ad5a.js +1 -0
  85. package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.b2893484.js +1 -0
  86. package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.cd16f6e8.js +1 -0
  87. package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.eb9eefa6.js +1 -0
  88. package/__mf/js/main.154a5b65.js +1 -0
  89. package/lib/bootstrap.d.ts +2 -0
  90. package/lib/bootstrap.d.ts.map +1 -0
  91. package/lib/bootstrap.js +19 -0
  92. package/lib/bootstrap.js.map +1 -0
  93. package/lib/cjs/bootstrap.js +26 -0
  94. package/{dist → lib}/cjs/components/PromQLEditor.js +9 -7
  95. package/lib/cjs/components/TreeNode.js +492 -0
  96. package/{dist → lib}/cjs/components/promql/ast.js +21 -21
  97. package/lib/cjs/components/promql/functionSignatures.js +651 -0
  98. package/lib/cjs/components/promql/serialize.js +88 -0
  99. package/{dist → lib}/cjs/components/promql/utils.js +12 -1
  100. package/{dist/cjs/components/parse.js → lib/cjs/components/query.js} +37 -4
  101. package/lib/cjs/env.d.js +14 -0
  102. package/lib/cjs/explore/PrometheusExplorer.js +203 -0
  103. package/lib/cjs/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js +268 -0
  104. package/lib/cjs/explore/PrometheusMetricsFinder/display/MetricChip.js +61 -0
  105. package/lib/cjs/explore/PrometheusMetricsFinder/display/list/MetricList.js +179 -0
  106. package/lib/cjs/explore/PrometheusMetricsFinder/filter/FilterInputs.js +231 -0
  107. package/lib/cjs/explore/PrometheusMetricsFinder/filter/FinderFilters.js +97 -0
  108. package/{dist/cjs/plugins/prometheus-time-series-query → lib/cjs/explore/PrometheusMetricsFinder}/index.js +1 -1
  109. package/lib/cjs/explore/PrometheusMetricsFinder/overview/MetricOverview.js +235 -0
  110. package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js +144 -0
  111. package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js +423 -0
  112. package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js +53 -0
  113. package/lib/cjs/explore/PrometheusMetricsFinder/types.js +25 -0
  114. package/lib/cjs/explore/PrometheusMetricsFinder/utils.js +203 -0
  115. package/lib/cjs/explore/index.js +19 -0
  116. package/lib/cjs/getPluginModule.js +27 -0
  117. package/lib/cjs/index-federation.js +55 -0
  118. package/lib/cjs/index.js +28 -0
  119. package/{dist → lib}/cjs/model/api-types.js +1 -1
  120. package/{dist → lib}/cjs/model/prometheus-client.js +1 -1
  121. package/lib/cjs/plugins/PrometheusDatasourceEditor.js +109 -0
  122. package/lib/cjs/plugins/PrometheusLabelNamesVariable.js +34 -0
  123. package/lib/cjs/plugins/PrometheusLabelValuesVariable.js +38 -0
  124. package/lib/cjs/plugins/PrometheusPromQLVariable.js +42 -0
  125. package/lib/cjs/plugins/index.js +26 -0
  126. package/{dist → lib}/cjs/plugins/prometheus-datasource.js +9 -9
  127. package/{dist → lib}/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +11 -9
  128. package/{dist → lib}/cjs/plugins/prometheus-time-series-query/get-time-series-data.js +51 -29
  129. package/lib/cjs/plugins/prometheus-time-series-query/index.js +35 -0
  130. package/{dist → lib}/cjs/plugins/prometheus-variables.js +25 -101
  131. package/{dist → lib}/cjs/plugins/variable.js +1 -2
  132. package/lib/cjs/setup-tests.js +19 -0
  133. package/{dist → lib}/cjs/utils/utils.js +1 -2
  134. package/lib/components/PromQLEditor.d.ts.map +1 -0
  135. package/{dist → lib}/components/PromQLEditor.js +9 -7
  136. package/lib/components/PromQLEditor.js.map +1 -0
  137. package/lib/components/TreeNode.d.ts +15 -0
  138. package/lib/components/TreeNode.d.ts.map +1 -0
  139. package/lib/components/TreeNode.js +479 -0
  140. package/lib/components/TreeNode.js.map +1 -0
  141. package/lib/components/index.d.ts.map +1 -0
  142. package/lib/components/index.js.map +1 -0
  143. package/lib/components/promql/ast.d.ts.map +1 -0
  144. package/{dist → lib}/components/promql/ast.js +21 -21
  145. package/lib/components/promql/ast.js.map +1 -0
  146. package/{dist → lib}/components/promql/format.d.ts +1 -1
  147. package/lib/components/promql/format.d.ts.map +1 -0
  148. package/lib/components/promql/format.js.map +1 -0
  149. package/lib/components/promql/functionSignatures.d.ts +3 -0
  150. package/lib/components/promql/functionSignatures.d.ts.map +1 -0
  151. package/lib/components/promql/functionSignatures.js +643 -0
  152. package/lib/components/promql/functionSignatures.js.map +1 -0
  153. package/lib/components/promql/serialize.d.ts +4 -0
  154. package/lib/components/promql/serialize.d.ts.map +1 -0
  155. package/lib/components/promql/serialize.js +80 -0
  156. package/lib/components/promql/serialize.js.map +1 -0
  157. package/{dist → lib}/components/promql/utils.d.ts +1 -0
  158. package/lib/components/promql/utils.d.ts.map +1 -0
  159. package/{dist → lib}/components/promql/utils.js +9 -1
  160. package/lib/components/promql/utils.js.map +1 -0
  161. package/lib/components/query.d.ts +6 -0
  162. package/lib/components/query.d.ts.map +1 -0
  163. package/{dist/components/parse.js → lib/components/query.js} +27 -2
  164. package/lib/components/query.js.map +1 -0
  165. package/lib/env.d.js +15 -0
  166. package/lib/env.d.js.map +1 -0
  167. package/lib/explore/PrometheusExplorer.d.ts +3 -0
  168. package/lib/explore/PrometheusExplorer.d.ts.map +1 -0
  169. package/lib/explore/PrometheusExplorer.js +190 -0
  170. package/lib/explore/PrometheusExplorer.js.map +1 -0
  171. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.d.ts +31 -0
  172. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.d.ts.map +1 -0
  173. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js +244 -0
  174. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js.map +1 -0
  175. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.d.ts +4 -0
  176. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.d.ts.map +1 -0
  177. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.js +53 -0
  178. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.js.map +1 -0
  179. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.d.ts +27 -0
  180. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.d.ts.map +1 -0
  181. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.js +158 -0
  182. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.js.map +1 -0
  183. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.d.ts +23 -0
  184. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.d.ts.map +1 -0
  185. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js +209 -0
  186. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js.map +1 -0
  187. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.d.ts +13 -0
  188. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.d.ts.map +1 -0
  189. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js +84 -0
  190. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js.map +1 -0
  191. package/lib/explore/PrometheusMetricsFinder/index.d.ts +2 -0
  192. package/lib/explore/PrometheusMetricsFinder/index.d.ts.map +1 -0
  193. package/{dist/model/api-types.js → lib/explore/PrometheusMetricsFinder/index.js} +2 -2
  194. package/lib/explore/PrometheusMetricsFinder/index.js.map +1 -0
  195. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.d.ts +23 -0
  196. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.d.ts.map +1 -0
  197. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.js +214 -0
  198. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.js.map +1 -0
  199. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.d.ts +28 -0
  200. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.d.ts.map +1 -0
  201. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js +125 -0
  202. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js.map +1 -0
  203. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.d.ts +25 -0
  204. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.d.ts.map +1 -0
  205. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js +399 -0
  206. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js.map +1 -0
  207. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.d.ts +12 -0
  208. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.d.ts.map +1 -0
  209. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js +45 -0
  210. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js.map +1 -0
  211. package/lib/explore/PrometheusMetricsFinder/types.d.ts +22 -0
  212. package/lib/explore/PrometheusMetricsFinder/types.d.ts.map +1 -0
  213. package/lib/explore/PrometheusMetricsFinder/types.js +17 -0
  214. package/lib/explore/PrometheusMetricsFinder/types.js.map +1 -0
  215. package/lib/explore/PrometheusMetricsFinder/utils.d.ts +22 -0
  216. package/lib/explore/PrometheusMetricsFinder/utils.d.ts.map +1 -0
  217. package/lib/explore/PrometheusMetricsFinder/utils.js +185 -0
  218. package/lib/explore/PrometheusMetricsFinder/utils.js.map +1 -0
  219. package/lib/explore/index.d.ts +3 -0
  220. package/lib/explore/index.d.ts.map +1 -0
  221. package/lib/explore/index.js +4 -0
  222. package/lib/explore/index.js.map +1 -0
  223. package/lib/getPluginModule.d.ts +6 -0
  224. package/lib/getPluginModule.d.ts.map +1 -0
  225. package/lib/getPluginModule.js +16 -0
  226. package/lib/getPluginModule.js.map +1 -0
  227. package/lib/index-federation.d.ts +1 -0
  228. package/lib/index-federation.d.ts.map +1 -0
  229. package/lib/index-federation.js +15 -0
  230. package/{dist/components/index.js.map → lib/index-federation.js.map} +1 -1
  231. package/lib/index.d.ts +6 -0
  232. package/lib/index.d.ts.map +1 -0
  233. package/lib/index.js +7 -0
  234. package/lib/index.js.map +1 -0
  235. package/{dist → lib}/model/api-types.d.ts +18 -1
  236. package/lib/model/api-types.d.ts.map +1 -0
  237. package/{dist/plugins/prometheus-time-series-query/index.js → lib/model/api-types.js} +3 -3
  238. package/lib/model/api-types.js.map +1 -0
  239. package/lib/model/index.d.ts.map +1 -0
  240. package/lib/model/index.js.map +1 -0
  241. package/lib/model/parse-sample-values.d.ts.map +1 -0
  242. package/lib/model/parse-sample-values.js.map +1 -0
  243. package/lib/model/prometheus-client.d.ts.map +1 -0
  244. package/{dist → lib}/model/prometheus-client.js +1 -1
  245. package/lib/model/prometheus-client.js.map +1 -0
  246. package/lib/model/prometheus-selectors.d.ts.map +1 -0
  247. package/lib/model/prometheus-selectors.js.map +1 -0
  248. package/lib/model/time.d.ts.map +1 -0
  249. package/lib/model/time.js.map +1 -0
  250. package/lib/plugins/MatcherEditor.d.ts.map +1 -0
  251. package/lib/plugins/MatcherEditor.js.map +1 -0
  252. package/lib/plugins/PrometheusDatasourceEditor.d.ts.map +1 -0
  253. package/lib/plugins/PrometheusDatasourceEditor.js +96 -0
  254. package/lib/plugins/PrometheusDatasourceEditor.js.map +1 -0
  255. package/lib/plugins/PrometheusLabelNamesVariable.d.ts +4 -0
  256. package/lib/plugins/PrometheusLabelNamesVariable.d.ts.map +1 -0
  257. package/lib/plugins/PrometheusLabelNamesVariable.js +26 -0
  258. package/lib/plugins/PrometheusLabelNamesVariable.js.map +1 -0
  259. package/lib/plugins/PrometheusLabelValuesVariable.d.ts +4 -0
  260. package/lib/plugins/PrometheusLabelValuesVariable.d.ts.map +1 -0
  261. package/lib/plugins/PrometheusLabelValuesVariable.js +30 -0
  262. package/lib/plugins/PrometheusLabelValuesVariable.js.map +1 -0
  263. package/lib/plugins/PrometheusPromQLVariable.d.ts +4 -0
  264. package/lib/plugins/PrometheusPromQLVariable.d.ts.map +1 -0
  265. package/lib/plugins/PrometheusPromQLVariable.js +34 -0
  266. package/lib/plugins/PrometheusPromQLVariable.js.map +1 -0
  267. package/lib/plugins/index.d.ts +10 -0
  268. package/lib/plugins/index.d.ts.map +1 -0
  269. package/lib/plugins/index.js +11 -0
  270. package/lib/plugins/index.js.map +1 -0
  271. package/lib/plugins/prometheus-datasource.d.ts.map +1 -0
  272. package/{dist → lib}/plugins/prometheus-datasource.js +9 -9
  273. package/lib/plugins/prometheus-datasource.js.map +1 -0
  274. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.d.ts.map +1 -0
  275. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js.map +1 -0
  276. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts.map +1 -0
  277. package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +9 -7
  278. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js.map +1 -0
  279. package/lib/plugins/prometheus-time-series-query/get-time-series-data.d.ts.map +1 -0
  280. package/{dist → lib}/plugins/prometheus-time-series-query/get-time-series-data.js +51 -29
  281. package/lib/plugins/prometheus-time-series-query/get-time-series-data.js.map +1 -0
  282. package/lib/plugins/prometheus-time-series-query/index.d.ts +7 -0
  283. package/lib/plugins/prometheus-time-series-query/index.d.ts.map +1 -0
  284. package/lib/plugins/prometheus-time-series-query/index.js +20 -0
  285. package/lib/plugins/prometheus-time-series-query/index.js.map +1 -0
  286. package/lib/plugins/prometheus-time-series-query/query-editor-model.d.ts.map +1 -0
  287. package/lib/plugins/prometheus-time-series-query/query-editor-model.js.map +1 -0
  288. package/lib/plugins/prometheus-time-series-query/replace-prom-builtin-variables.d.ts.map +1 -0
  289. package/lib/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js.map +1 -0
  290. package/lib/plugins/prometheus-time-series-query/time-series-query-model.d.ts.map +1 -0
  291. package/lib/plugins/prometheus-time-series-query/time-series-query-model.js.map +1 -0
  292. package/lib/plugins/prometheus-variables.d.ts +14 -0
  293. package/lib/plugins/prometheus-variables.d.ts.map +1 -0
  294. package/{dist → lib}/plugins/prometheus-variables.js +15 -98
  295. package/lib/plugins/prometheus-variables.js.map +1 -0
  296. package/lib/plugins/types.d.ts.map +1 -0
  297. package/lib/plugins/types.js.map +1 -0
  298. package/lib/plugins/variable.d.ts.map +1 -0
  299. package/{dist → lib}/plugins/variable.js +1 -2
  300. package/lib/plugins/variable.js.map +1 -0
  301. package/lib/setup-tests.d.ts +2 -0
  302. package/lib/setup-tests.d.ts.map +1 -0
  303. package/lib/setup-tests.js +17 -0
  304. package/{dist/utils/index.js.map → lib/setup-tests.js.map} +1 -1
  305. package/lib/test/setup-tests.d.ts.map +1 -0
  306. package/lib/test/setup-tests.js.map +1 -0
  307. package/lib/utils/index.d.ts.map +1 -0
  308. package/lib/utils/index.js.map +1 -0
  309. package/lib/utils/utils.d.ts.map +1 -0
  310. package/{dist → lib}/utils/utils.js +1 -2
  311. package/lib/utils/utils.js.map +1 -0
  312. package/mf-manifest.json +898 -0
  313. package/mf-stats.json +1004 -0
  314. package/package.json +99 -38
  315. package/dist/cjs/components/TreeNode.js +0 -147
  316. package/dist/cjs/index.js +0 -61
  317. package/dist/cjs/plugins/PrometheusDatasourceEditor.js +0 -626
  318. package/dist/components/PromQLEditor.d.ts.map +0 -1
  319. package/dist/components/PromQLEditor.js.map +0 -1
  320. package/dist/components/TreeNode.d.ts +0 -10
  321. package/dist/components/TreeNode.d.ts.map +0 -1
  322. package/dist/components/TreeNode.js +0 -139
  323. package/dist/components/TreeNode.js.map +0 -1
  324. package/dist/components/index.d.ts.map +0 -1
  325. package/dist/components/parse.d.ts +0 -5
  326. package/dist/components/parse.d.ts.map +0 -1
  327. package/dist/components/parse.js.map +0 -1
  328. package/dist/components/promql/ast.d.ts.map +0 -1
  329. package/dist/components/promql/ast.js.map +0 -1
  330. package/dist/components/promql/format.d.ts.map +0 -1
  331. package/dist/components/promql/format.js.map +0 -1
  332. package/dist/components/promql/utils.d.ts.map +0 -1
  333. package/dist/components/promql/utils.js.map +0 -1
  334. package/dist/index.d.ts +0 -8
  335. package/dist/index.d.ts.map +0 -1
  336. package/dist/index.js +0 -24
  337. package/dist/index.js.map +0 -1
  338. package/dist/model/api-types.d.ts.map +0 -1
  339. package/dist/model/api-types.js.map +0 -1
  340. package/dist/model/index.d.ts.map +0 -1
  341. package/dist/model/index.js.map +0 -1
  342. package/dist/model/parse-sample-values.d.ts.map +0 -1
  343. package/dist/model/parse-sample-values.js.map +0 -1
  344. package/dist/model/prometheus-client.d.ts.map +0 -1
  345. package/dist/model/prometheus-client.js.map +0 -1
  346. package/dist/model/prometheus-selectors.d.ts.map +0 -1
  347. package/dist/model/prometheus-selectors.js.map +0 -1
  348. package/dist/model/time.d.ts.map +0 -1
  349. package/dist/model/time.js.map +0 -1
  350. package/dist/plugins/MatcherEditor.d.ts.map +0 -1
  351. package/dist/plugins/MatcherEditor.js.map +0 -1
  352. package/dist/plugins/PrometheusDatasourceEditor.d.ts.map +0 -1
  353. package/dist/plugins/PrometheusDatasourceEditor.js +0 -572
  354. package/dist/plugins/PrometheusDatasourceEditor.js.map +0 -1
  355. package/dist/plugins/prometheus-datasource.d.ts.map +0 -1
  356. package/dist/plugins/prometheus-datasource.js.map +0 -1
  357. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.d.ts.map +0 -1
  358. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js.map +0 -1
  359. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts.map +0 -1
  360. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js.map +0 -1
  361. package/dist/plugins/prometheus-time-series-query/get-time-series-data.d.ts.map +0 -1
  362. package/dist/plugins/prometheus-time-series-query/get-time-series-data.js.map +0 -1
  363. package/dist/plugins/prometheus-time-series-query/index.d.ts +0 -2
  364. package/dist/plugins/prometheus-time-series-query/index.d.ts.map +0 -1
  365. package/dist/plugins/prometheus-time-series-query/index.js.map +0 -1
  366. package/dist/plugins/prometheus-time-series-query/query-editor-model.d.ts.map +0 -1
  367. package/dist/plugins/prometheus-time-series-query/query-editor-model.js.map +0 -1
  368. package/dist/plugins/prometheus-time-series-query/replace-prom-builtin-variables.d.ts.map +0 -1
  369. package/dist/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js.map +0 -1
  370. package/dist/plugins/prometheus-time-series-query/time-series-query-model.d.ts.map +0 -1
  371. package/dist/plugins/prometheus-time-series-query/time-series-query-model.js.map +0 -1
  372. package/dist/plugins/prometheus-variables.d.ts +0 -6
  373. package/dist/plugins/prometheus-variables.d.ts.map +0 -1
  374. package/dist/plugins/prometheus-variables.js.map +0 -1
  375. package/dist/plugins/types.d.ts.map +0 -1
  376. package/dist/plugins/types.js.map +0 -1
  377. package/dist/plugins/variable.d.ts.map +0 -1
  378. package/dist/plugins/variable.js.map +0 -1
  379. package/dist/test/setup-tests.d.ts.map +0 -1
  380. package/dist/test/setup-tests.js.map +0 -1
  381. package/dist/utils/index.d.ts.map +0 -1
  382. package/dist/utils/utils.d.ts.map +0 -1
  383. package/dist/utils/utils.js.map +0 -1
  384. package/plugin.json +0 -58
  385. /package/{dist → lib}/cjs/components/index.js +0 -0
  386. /package/{dist → lib}/cjs/components/promql/format.js +0 -0
  387. /package/{dist → lib}/cjs/model/index.js +0 -0
  388. /package/{dist → lib}/cjs/model/parse-sample-values.js +0 -0
  389. /package/{dist → lib}/cjs/model/prometheus-selectors.js +0 -0
  390. /package/{dist → lib}/cjs/model/time.js +0 -0
  391. /package/{dist → lib}/cjs/plugins/MatcherEditor.js +0 -0
  392. /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js +0 -0
  393. /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/query-editor-model.js +0 -0
  394. /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js +0 -0
  395. /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/time-series-query-model.js +0 -0
  396. /package/{dist → lib}/cjs/plugins/types.js +0 -0
  397. /package/{dist → lib}/cjs/test/setup-tests.js +0 -0
  398. /package/{dist → lib}/cjs/utils/index.js +0 -0
  399. /package/{dist → lib}/components/PromQLEditor.d.ts +0 -0
  400. /package/{dist → lib}/components/index.d.ts +0 -0
  401. /package/{dist → lib}/components/index.js +0 -0
  402. /package/{dist → lib}/components/promql/ast.d.ts +0 -0
  403. /package/{dist → lib}/components/promql/format.js +0 -0
  404. /package/{dist → lib}/model/index.d.ts +0 -0
  405. /package/{dist → lib}/model/index.js +0 -0
  406. /package/{dist → lib}/model/parse-sample-values.d.ts +0 -0
  407. /package/{dist → lib}/model/parse-sample-values.js +0 -0
  408. /package/{dist → lib}/model/prometheus-client.d.ts +0 -0
  409. /package/{dist → lib}/model/prometheus-selectors.d.ts +0 -0
  410. /package/{dist → lib}/model/prometheus-selectors.js +0 -0
  411. /package/{dist → lib}/model/time.d.ts +0 -0
  412. /package/{dist → lib}/model/time.js +0 -0
  413. /package/{dist → lib}/plugins/MatcherEditor.d.ts +0 -0
  414. /package/{dist → lib}/plugins/MatcherEditor.js +0 -0
  415. /package/{dist → lib}/plugins/PrometheusDatasourceEditor.d.ts +0 -0
  416. /package/{dist → lib}/plugins/prometheus-datasource.d.ts +0 -0
  417. /package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.d.ts +0 -0
  418. /package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js +0 -0
  419. /package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts +0 -0
  420. /package/{dist → lib}/plugins/prometheus-time-series-query/get-time-series-data.d.ts +0 -0
  421. /package/{dist → lib}/plugins/prometheus-time-series-query/query-editor-model.d.ts +0 -0
  422. /package/{dist → lib}/plugins/prometheus-time-series-query/query-editor-model.js +0 -0
  423. /package/{dist → lib}/plugins/prometheus-time-series-query/replace-prom-builtin-variables.d.ts +0 -0
  424. /package/{dist → lib}/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js +0 -0
  425. /package/{dist → lib}/plugins/prometheus-time-series-query/time-series-query-model.d.ts +0 -0
  426. /package/{dist → lib}/plugins/prometheus-time-series-query/time-series-query-model.js +0 -0
  427. /package/{dist → lib}/plugins/types.d.ts +0 -0
  428. /package/{dist → lib}/plugins/types.js +0 -0
  429. /package/{dist → lib}/plugins/variable.d.ts +0 -0
  430. /package/{dist → lib}/test/setup-tests.d.ts +0 -0
  431. /package/{dist → lib}/test/setup-tests.js +0 -0
  432. /package/{dist → lib}/utils/index.d.ts +0 -0
  433. /package/{dist → lib}/utils/index.js +0 -0
  434. /package/{dist → lib}/utils/utils.d.ts +0 -0
@@ -0,0 +1,80 @@
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
+ import { formatDuration, msToPrometheusDuration } from '@perses-dev/core';
15
+ import { matchType, vectorMatchCardinality, nodeType } from './ast';
16
+ import { aggregatorsWithParam, maybeParenthesizeBinopChild, escapeString } from './utils';
17
+ const serializeAtAndOffset = (timestamp, startOrEnd, offset)=>`${timestamp !== null ? ` @ ${(timestamp / 1000).toFixed(3)}` : startOrEnd !== null ? ` @ ${startOrEnd}()` : ''}${offset === 0 ? '' : offset > 0 ? ` offset ${formatDuration(msToPrometheusDuration(offset))}` : ` offset -${formatDuration(msToPrometheusDuration(-offset))}`}`;
18
+ const serializeSelector = (node)=>{
19
+ const matchers = node.matchers.filter((m)=>!(m.name === '__name__' && m.type === matchType.equal && m.value === node.name)).map((m)=>`${m.name}${m.type}"${escapeString(m.value)}"`);
20
+ const range = node.type === nodeType.matrixSelector ? `[${formatDuration(msToPrometheusDuration(node.range))}]` : '';
21
+ const atAndOffset = serializeAtAndOffset(node.timestamp, node.startOrEnd, node.offset);
22
+ return `${node.name}${matchers.length > 0 ? `{${matchers.join(',')}}` : ''}${range}${atAndOffset}`;
23
+ };
24
+ const serializeNode = (node, indent = 0, pretty = false, initialIndent = true)=>{
25
+ const childListSeparator = pretty ? '\n' : '';
26
+ const childSeparator = pretty ? '\n' : ' ';
27
+ const childIndent = indent + 2;
28
+ const ind = pretty ? ' '.repeat(indent) : '';
29
+ // Needed for unary operators.
30
+ const initialInd = initialIndent ? ind : '';
31
+ switch(node.type){
32
+ case nodeType.aggregation:
33
+ return `${initialInd}${node.op}${node.without ? ` without(${node.grouping.join(', ')}) ` : node.grouping.length > 0 ? ` by(${node.grouping.join(', ')}) ` : ''}(${childListSeparator}${aggregatorsWithParam.includes(node.op) && node.param !== null ? `${serializeNode(node.param, childIndent, pretty)},${childSeparator}` : ''}${serializeNode(node.expr, childIndent, pretty)}${childListSeparator}${ind})`;
34
+ case nodeType.subquery:
35
+ return `${initialInd}${serializeNode(node.expr, indent, pretty)}[${formatDuration(msToPrometheusDuration(node.range))}:${node.step !== 0 ? formatDuration(msToPrometheusDuration(node.step)) : ''}]${serializeAtAndOffset(node.timestamp, node.startOrEnd, node.offset)}`;
36
+ case nodeType.parenExpr:
37
+ return `${initialInd}(${childListSeparator}${serializeNode(node.expr, childIndent, pretty)}${childListSeparator}${ind})`;
38
+ case nodeType.call:
39
+ {
40
+ const sep = node.args.length > 0 ? childListSeparator : '';
41
+ return `${initialInd}${node.func.name}(${sep}${node.args.map((arg)=>serializeNode(arg, childIndent, pretty)).join(',' + childSeparator)}${sep}${node.args.length > 0 ? ind : ''})`;
42
+ }
43
+ case nodeType.matrixSelector:
44
+ return `${initialInd}${serializeSelector(node)}`;
45
+ case nodeType.vectorSelector:
46
+ return `${initialInd}${serializeSelector(node)}`;
47
+ case nodeType.numberLiteral:
48
+ return `${initialInd}${node.val}`;
49
+ case nodeType.stringLiteral:
50
+ return `${initialInd}"${escapeString(node.val)}"`;
51
+ case nodeType.unaryExpr:
52
+ return `${initialInd}${node.op}${serializeNode(node.expr, indent, pretty, false)}`;
53
+ case nodeType.binaryExpr:
54
+ {
55
+ let matching = '';
56
+ let grouping = '';
57
+ const vm = node.matching;
58
+ if (vm !== null && (vm.labels.length > 0 || vm.on)) {
59
+ if (vm.on) {
60
+ matching = ` on(${vm.labels.join(', ')})`;
61
+ } else {
62
+ matching = ` ignoring(${vm.labels.join(', ')})`;
63
+ }
64
+ if (vm.card === vectorMatchCardinality.manyToOne || vm.card === vectorMatchCardinality.oneToMany) {
65
+ grouping = ` group_${vm.card === vectorMatchCardinality.manyToOne ? 'left' : 'right'}(${vm.include.join(',')})`;
66
+ }
67
+ }
68
+ return `${serializeNode(maybeParenthesizeBinopChild(node.op, node.lhs), childIndent, pretty)}${childSeparator}${ind}${node.op}${node.bool ? ' bool' : ''}${matching}${grouping}${childSeparator}${serializeNode(maybeParenthesizeBinopChild(node.op, node.rhs), childIndent, pretty)}`;
69
+ }
70
+ case nodeType.placeholder:
71
+ // TODO: Should we just throw an error when trying to serialize an AST containing a placeholder node?
72
+ // (that would currently break editing-as-text of ASTs that contain placeholders)
73
+ return `${initialInd}…${node.children.length > 0 ? `(${childListSeparator}${node.children.map((child)=>serializeNode(child, childIndent, pretty)).join(',' + childSeparator)}${childListSeparator}${ind})` : ''}`;
74
+ default:
75
+ throw new Error('unsupported node type');
76
+ }
77
+ };
78
+ export default serializeNode;
79
+
80
+ //# sourceMappingURL=serialize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/promql/serialize.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Forked from https://github.com/prometheus/prometheus/blob/65f610353919b1c7b42d3776c3a95b68046a6bba/web/ui/mantine-ui/src/promql/serialize.ts\n\nimport { formatDuration, msToPrometheusDuration } from '@perses-dev/core';\nimport ASTNode, {\n VectorSelector,\n matchType,\n vectorMatchCardinality,\n nodeType,\n StartOrEnd,\n MatrixSelector,\n} from './ast';\nimport { aggregatorsWithParam, maybeParenthesizeBinopChild, escapeString } from './utils';\n\nconst serializeAtAndOffset = (timestamp: number | null, startOrEnd: StartOrEnd, offset: number): string =>\n `${timestamp !== null ? ` @ ${(timestamp / 1000).toFixed(3)}` : startOrEnd !== null ? ` @ ${startOrEnd}()` : ''}${\n offset === 0\n ? ''\n : offset > 0\n ? ` offset ${formatDuration(msToPrometheusDuration(offset))}`\n : ` offset -${formatDuration(msToPrometheusDuration(-offset))}`\n }`;\n\nconst serializeSelector = (node: VectorSelector | MatrixSelector): string => {\n const matchers = node.matchers\n .filter((m) => !(m.name === '__name__' && m.type === matchType.equal && m.value === node.name))\n .map((m) => `${m.name}${m.type}\"${escapeString(m.value)}\"`);\n\n const range = node.type === nodeType.matrixSelector ? `[${formatDuration(msToPrometheusDuration(node.range))}]` : '';\n const atAndOffset = serializeAtAndOffset(node.timestamp, node.startOrEnd, node.offset);\n\n return `${node.name}${matchers.length > 0 ? `{${matchers.join(',')}}` : ''}${range}${atAndOffset}`;\n};\n\nconst serializeNode = (node: ASTNode, indent = 0, pretty = false, initialIndent = true): string => {\n const childListSeparator = pretty ? '\\n' : '';\n const childSeparator = pretty ? '\\n' : ' ';\n const childIndent = indent + 2;\n const ind = pretty ? ' '.repeat(indent) : '';\n // Needed for unary operators.\n const initialInd = initialIndent ? ind : '';\n\n switch (node.type) {\n case nodeType.aggregation:\n return `${initialInd}${node.op}${\n node.without\n ? ` without(${node.grouping.join(', ')}) `\n : node.grouping.length > 0\n ? ` by(${node.grouping.join(', ')}) `\n : ''\n }(${childListSeparator}${\n aggregatorsWithParam.includes(node.op) && node.param !== null\n ? `${serializeNode(node.param, childIndent, pretty)},${childSeparator}`\n : ''\n }${serializeNode(node.expr, childIndent, pretty)}${childListSeparator}${ind})`;\n\n case nodeType.subquery:\n return `${initialInd}${serializeNode(node.expr, indent, pretty)}[${formatDuration(msToPrometheusDuration(node.range))}:${\n node.step !== 0 ? formatDuration(msToPrometheusDuration(node.step)) : ''\n }]${serializeAtAndOffset(node.timestamp, node.startOrEnd, node.offset)}`;\n\n case nodeType.parenExpr:\n return `${initialInd}(${childListSeparator}${serializeNode(\n node.expr,\n childIndent,\n pretty\n )}${childListSeparator}${ind})`;\n\n case nodeType.call: {\n const sep = node.args.length > 0 ? childListSeparator : '';\n\n return `${initialInd}${node.func.name}(${sep}${node.args\n .map((arg) => serializeNode(arg, childIndent, pretty))\n .join(',' + childSeparator)}${sep}${node.args.length > 0 ? ind : ''})`;\n }\n\n case nodeType.matrixSelector:\n return `${initialInd}${serializeSelector(node)}`;\n\n case nodeType.vectorSelector:\n return `${initialInd}${serializeSelector(node)}`;\n\n case nodeType.numberLiteral:\n return `${initialInd}${node.val}`;\n\n case nodeType.stringLiteral:\n return `${initialInd}\"${escapeString(node.val)}\"`;\n\n case nodeType.unaryExpr:\n return `${initialInd}${node.op}${serializeNode(node.expr, indent, pretty, false)}`;\n\n case nodeType.binaryExpr: {\n let matching = '';\n let grouping = '';\n const vm = node.matching;\n if (vm !== null && (vm.labels.length > 0 || vm.on)) {\n if (vm.on) {\n matching = ` on(${vm.labels.join(', ')})`;\n } else {\n matching = ` ignoring(${vm.labels.join(', ')})`;\n }\n\n if (vm.card === vectorMatchCardinality.manyToOne || vm.card === vectorMatchCardinality.oneToMany) {\n grouping = ` group_${vm.card === vectorMatchCardinality.manyToOne ? 'left' : 'right'}(${vm.include.join(',')})`;\n }\n }\n\n return `${serializeNode(maybeParenthesizeBinopChild(node.op, node.lhs), childIndent, pretty)}${childSeparator}${ind}${\n node.op\n }${node.bool ? ' bool' : ''}${matching}${grouping}${childSeparator}${serializeNode(\n maybeParenthesizeBinopChild(node.op, node.rhs),\n childIndent,\n pretty\n )}`;\n }\n\n case nodeType.placeholder:\n // TODO: Should we just throw an error when trying to serialize an AST containing a placeholder node?\n // (that would currently break editing-as-text of ASTs that contain placeholders)\n return `${initialInd}…${\n node.children.length > 0\n ? `(${childListSeparator}${node.children\n .map((child) => serializeNode(child, childIndent, pretty))\n .join(',' + childSeparator)}${childListSeparator}${ind})`\n : ''\n }`;\n\n default:\n throw new Error('unsupported node type');\n }\n};\n\nexport default serializeNode;\n"],"names":["formatDuration","msToPrometheusDuration","matchType","vectorMatchCardinality","nodeType","aggregatorsWithParam","maybeParenthesizeBinopChild","escapeString","serializeAtAndOffset","timestamp","startOrEnd","offset","toFixed","serializeSelector","node","matchers","filter","m","name","type","equal","value","map","range","matrixSelector","atAndOffset","length","join","serializeNode","indent","pretty","initialIndent","childListSeparator","childSeparator","childIndent","ind","repeat","initialInd","aggregation","op","without","grouping","includes","param","expr","subquery","step","parenExpr","call","sep","args","func","arg","vectorSelector","numberLiteral","val","stringLiteral","unaryExpr","binaryExpr","matching","vm","labels","on","card","manyToOne","oneToMany","include","lhs","bool","rhs","placeholder","children","child","Error"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,+IAA+I;AAE/I,SAASA,cAAc,EAAEC,sBAAsB,QAAQ,mBAAmB;AAC1E,SAEEC,SAAS,EACTC,sBAAsB,EACtBC,QAAQ,QAGH,QAAQ;AACf,SAASC,oBAAoB,EAAEC,2BAA2B,EAAEC,YAAY,QAAQ,UAAU;AAE1F,MAAMC,uBAAuB,CAACC,WAA0BC,YAAwBC,SAC9E,GAAGF,cAAc,OAAO,CAAC,GAAG,EAAE,AAACA,CAAAA,YAAY,IAAG,EAAGG,OAAO,CAAC,IAAI,GAAGF,eAAe,OAAO,CAAC,GAAG,EAAEA,WAAW,EAAE,CAAC,GAAG,KAC3GC,WAAW,IACP,KACAA,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IAAI,CAAC,KAAK,CAAC,CAAC;oBACjH;gBACF;gBAEA,OAAO,GAAGC,cAActB,4BAA4BQ,KAAKyB,EAAE,EAAEzB,KAAKqD,GAAG,GAAGjC,aAAaJ,UAAUG,iBAAiBE,MAC9GrB,KAAKyB,EAAE,GACNzB,KAAKsD,IAAI,GAAG,UAAU,KAAKT,WAAWlB,WAAWR,iBAAiBL,cACnEtB,4BAA4BQ,KAAKyB,EAAE,EAAEzB,KAAKuD,GAAG,GAC7CnC,aACAJ,SACC;YACL;QAEA,KAAK1B,SAASkE,WAAW;YACvB,qGAAqG;YACrG,iFAAiF;YACjF,OAAO,GAAGjC,WAAW,CAAC,EACpBvB,KAAKyD,QAAQ,CAAC7C,MAAM,GAAG,IACnB,CAAC,CAAC,EAAEM,qBAAqBlB,KAAKyD,QAAQ,CACnCjD,GAAG,CAAC,CAACkD,QAAU5C,cAAc4C,OAAOtC,aAAaJ,SACjDH,IAAI,CAAC,MAAMM,kBAAkBD,qBAAqBG,IAAI,CAAC,CAAC,GAC3D,IACJ;QAEJ;YACE,MAAM,IAAIsC,MAAM;IACpB;AACF;AAEA,eAAe7C,cAAc"}
@@ -1,5 +1,6 @@
1
1
  import ASTNode, { binaryOperatorType } from './ast';
2
2
  export declare const maybeParenthesizeBinopChild: (op: binaryOperatorType, child: ASTNode) => ASTNode;
3
3
  export declare const getNodeChildren: (node: ASTNode) => ASTNode[];
4
+ export declare const aggregatorsWithParam: string[];
4
5
  export declare const escapeString: (str: string) => string;
5
6
  //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/promql/utils.ts"],"names":[],"mappings":"AAeA,OAAO,OAAO,EAAE,EAAE,kBAAkB,EAAY,MAAM,OAAO,CAAC;AAqB9D,eAAO,MAAM,2BAA2B,GAAI,IAAI,kBAAkB,EAAE,OAAO,OAAO,KAAG,OAepF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,MAAM,OAAO,KAAG,OAAO,EAwBtD,CAAC;AAEF,eAAO,MAAM,oBAAoB,UAA2E,CAAC;AAE7G,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,MAE1C,CAAC"}
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
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
@@ -83,6 +83,14 @@ export const getNodeChildren = (node)=>{
83
83
  throw new Error('unsupported node type');
84
84
  }
85
85
  };
86
+ export const aggregatorsWithParam = [
87
+ 'topk',
88
+ 'bottomk',
89
+ 'quantile',
90
+ 'count_values',
91
+ 'limitk',
92
+ 'limit_ratio'
93
+ ];
86
94
  export const escapeString = (str)=>{
87
95
  return str.replace(/([\\"])/g, '\\$1');
88
96
  };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/promql/utils.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Forked from https://github.com/prometheus/prometheus/blob/65f610353919b1c7b42d3776c3a95b68046a6bba/web/ui/mantine-ui/src/promql/utils.ts\n\nimport ASTNode, { binaryOperatorType, nodeType } from './ast';\n\nconst binOpPrecedence = {\n [binaryOperatorType.add]: 3,\n [binaryOperatorType.sub]: 3,\n [binaryOperatorType.mul]: 2,\n [binaryOperatorType.div]: 2,\n [binaryOperatorType.mod]: 2,\n [binaryOperatorType.pow]: 1,\n [binaryOperatorType.eql]: 4,\n [binaryOperatorType.neq]: 4,\n [binaryOperatorType.gtr]: 4,\n [binaryOperatorType.lss]: 4,\n [binaryOperatorType.gte]: 4,\n [binaryOperatorType.lte]: 4,\n [binaryOperatorType.and]: 5,\n [binaryOperatorType.or]: 6,\n [binaryOperatorType.unless]: 5,\n [binaryOperatorType.atan2]: 2,\n};\n\nexport const maybeParenthesizeBinopChild = (op: binaryOperatorType, child: ASTNode): ASTNode => {\n if (child.type !== nodeType.binaryExpr) {\n return child;\n }\n\n if (binOpPrecedence[op] > binOpPrecedence[child.op]) {\n return child;\n }\n\n // TODO: Parens aren't necessary for left-associativity within same precedence,\n // or right-associativity between two power operators.\n return {\n type: nodeType.parenExpr,\n expr: child,\n };\n};\n\nexport const getNodeChildren = (node: ASTNode): ASTNode[] => {\n switch (node.type) {\n case nodeType.aggregation:\n return node.param === null ? [node.expr] : [node.param, node.expr];\n case nodeType.subquery:\n return [node.expr];\n case nodeType.parenExpr:\n return [node.expr];\n case nodeType.call:\n return node.args;\n case nodeType.matrixSelector:\n case nodeType.vectorSelector:\n case nodeType.numberLiteral:\n case nodeType.stringLiteral:\n return [];\n case nodeType.placeholder:\n return node.children;\n case nodeType.unaryExpr:\n return [node.expr];\n case nodeType.binaryExpr:\n return [node.lhs, node.rhs];\n default:\n throw new Error('unsupported node type');\n }\n};\n\nexport const aggregatorsWithParam = ['topk', 'bottomk', 'quantile', 'count_values', 'limitk', 'limit_ratio'];\n\nexport const escapeString = (str: string): string => {\n return str.replace(/([\\\\\"])/g, '\\\\$1');\n};\n"],"names":["binaryOperatorType","nodeType","binOpPrecedence","add","sub","mul","div","mod","pow","eql","neq","gtr","lss","gte","lte","and","or","unless","atan2","maybeParenthesizeBinopChild","op","child","type","binaryExpr","parenExpr","expr","getNodeChildren","node","aggregation","param","subquery","call","args","matrixSelector","vectorSelector","numberLiteral","stringLiteral","placeholder","children","unaryExpr","lhs","rhs","Error","aggregatorsWithParam","escapeString","str","replace"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0C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OAAQA,KAAKL,IAAI;QACf,KAAKrB,SAAS2B,WAAW;YACvB,OAAOD,KAAKE,KAAK,KAAK,OAAO;gBAACF,KAAKF,IAAI;aAAC,GAAG;gBAACE,KAAKE,KAAK;gBAAEF,KAAKF,IAAI;aAAC;QACpE,KAAKxB,SAAS6B,QAAQ;YACpB,OAAO;gBAACH,KAAKF,IAAI;aAAC;QACpB,KAAKxB,SAASuB,SAAS;YACrB,OAAO;gBAACG,KAAKF,IAAI;aAAC;QACpB,KAAKxB,SAAS8B,IAAI;YAChB,OAAOJ,KAAKK,IAAI;QAClB,KAAK/B,SAASgC,cAAc;QAC5B,KAAKhC,SAASiC,cAAc;QAC5B,KAAKjC,SAASkC,aAAa;QAC3B,KAAKlC,SAASmC,aAAa;YACzB,OAAO,EAAE;QACX,KAAKnC,SAASoC,WAAW;YACvB,OAAOV,KAAKW,QAAQ;QACtB,KAAKrC,SAASsC,SAAS;YACrB,OAAO;gBAACZ,KAAKF,IAAI;aAAC;QACpB,KAAKxB,SAASsB,UAAU;YACtB,OAAO;gBAACI,KAAKa,GAAG;gBAAEb,KAAKc,GAAG;aAAC;QAC7B;YACE,MAAM,IAAIC,MAAM;IACpB;AACF,EAAE;AAEF,OAAO,MAAMC,uBAAuB;IAAC;IAAQ;IAAW;IAAY;IAAgB;IAAU;CAAc,CAAC;AAE7G,OAAO,MAAMC,eAAe,CAACC;IAC3B,OAAOA,IAAIC,OAAO,CAAC,YAAY;AACjC,EAAE"}
@@ -0,0 +1,6 @@
1
+ import { DatasourceSelector, StatusError } from '@perses-dev/core';
2
+ import { UseQueryResult } from '@tanstack/react-query';
3
+ import { MonitoredInstantQueryResponse, ParseQueryResponse } from '../model';
4
+ export declare function useParseQuery(content: string, datasource: DatasourceSelector, enabled?: boolean): UseQueryResult<ParseQueryResponse, StatusError>;
5
+ export declare function useInstantQuery(content: string, datasource: DatasourceSelector, enabled?: boolean): UseQueryResult<MonitoredInstantQueryResponse, StatusError>;
6
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/components/query.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAY,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAEL,6BAA6B,EAE7B,kBAAkB,EAEnB,MAAM,UAAU,CAAC;AAElB,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,kBAAkB,EAC9B,OAAO,CAAC,EAAE,OAAO,GAChB,cAAc,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAYjD;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,kBAAkB,EAC9B,OAAO,CAAC,EAAE,OAAO,GAChB,cAAc,CAAC,6BAA6B,EAAE,WAAW,CAAC,CAgB5D"}
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
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
@@ -30,5 +30,30 @@ export function useParseQuery(content, datasource, enabled) {
30
30
  }
31
31
  });
32
32
  }
33
+ export function useInstantQuery(content, datasource, enabled) {
34
+ const { data: client } = useDatasourceClient(datasource);
35
+ return useQuery({
36
+ enabled: !!client && enabled,
37
+ // TODO: for some reason the caching is not working: identical nodes still fire their requests after each change made to the promQL
38
+ queryKey: [
39
+ 'instantQuery',
40
+ content,
41
+ 'datasource',
42
+ datasource.kind
43
+ ],
44
+ queryFn: async ()=>{
45
+ const params = {
46
+ query: content
47
+ };
48
+ const startTime = performance.now();
49
+ const response = await client.instantQuery(params);
50
+ const responseTime = performance.now() - startTime;
51
+ return {
52
+ ...response,
53
+ responseTime
54
+ };
55
+ }
56
+ });
57
+ }
33
58
 
34
- //# sourceMappingURL=parse.js.map
59
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/query.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useDatasourceClient } from '@perses-dev/plugin-system';\nimport { DatasourceSelector, StatusError } from '@perses-dev/core';\nimport { useQuery, UseQueryResult } from '@tanstack/react-query';\nimport {\n InstantQueryRequestParameters,\n MonitoredInstantQueryResponse,\n ParseQueryRequestParameters,\n ParseQueryResponse,\n PrometheusClient,\n} from '../model';\n\nexport function useParseQuery(\n content: string,\n datasource: DatasourceSelector,\n enabled?: boolean\n): UseQueryResult<ParseQueryResponse, StatusError> {\n const { data: client } = useDatasourceClient<PrometheusClient>(datasource);\n\n return useQuery<ParseQueryResponse, StatusError>({\n enabled: !!client && enabled,\n queryKey: ['parseQuery', content, 'datasource', datasource],\n queryFn: async () => {\n const params: ParseQueryRequestParameters = { query: content };\n\n return await client!.parseQuery(params);\n },\n });\n}\n\nexport function useInstantQuery(\n content: string,\n datasource: DatasourceSelector,\n enabled?: boolean\n): UseQueryResult<MonitoredInstantQueryResponse, StatusError> {\n const { data: client } = useDatasourceClient<PrometheusClient>(datasource);\n\n return useQuery<MonitoredInstantQueryResponse, StatusError>({\n enabled: !!client && enabled,\n // TODO: for some reason the caching is not working: identical nodes still fire their requests after each change made to the promQL\n queryKey: ['instantQuery', content, 'datasource', datasource.kind],\n queryFn: async () => {\n const params: InstantQueryRequestParameters = { query: content };\n const startTime = performance.now();\n const response = await client!.instantQuery(params);\n const responseTime = performance.now() - startTime;\n\n return { ...response, responseTime };\n },\n });\n}\n"],"names":["useDatasourceClient","useQuery","useParseQuery","content","datasource","enabled","data","client","queryKey","queryFn","params","query","parseQuery","useInstantQuery","kind","startTime","performance","now","response","instantQuery","responseTime"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,mBAAmB,QAAQ,4BAA4B;AAEhE,SAASC,QAAQ,QAAwB,wBAAwB;AASjE,OAAO,SAASC,cACdC,OAAe,EACfC,UAA8B,EAC9BC,OAAiB;IAEjB,MAAM,EAAEC,MAAMC,MAAM,EAAE,GAAGP,oBAAsCI;IAE/D,OAAOH,SAA0C;QAC/CI,SAAS,CAAC,CAACE,UAAUF;QACrBG,UAAU;YAAC;YAAcL;YAAS;YAAcC;SAAW;QAC3DK,SAAS;YACP,MAAMC,SAAsC;gBAAEC,OAAOR;YAAQ;YAE7D,OAAO,MAAMI,OAAQK,UAAU,CAACF;QAClC;IACF;AACF;AAEA,OAAO,SAASG,gBACdV,OAAe,EACfC,UAA8B,EAC9BC,OAAiB;IAEjB,MAAM,EAAEC,MAAMC,MAAM,EAAE,GAAGP,oBAAsCI;IAE/D,OAAOH,SAAqD;QAC1DI,SAAS,CAAC,CAACE,UAAUF;QACrB,mIAAmI;QACnIG,UAAU;YAAC;YAAgBL;YAAS;YAAcC,WAAWU,IAAI;SAAC;QAClEL,SAAS;YACP,MAAMC,SAAwC;gBAAEC,OAAOR;YAAQ;YAC/D,MAAMY,YAAYC,YAAYC,GAAG;YACjC,MAAMC,WAAW,MAAMX,OAAQY,YAAY,CAACT;YAC5C,MAAMU,eAAeJ,YAAYC,GAAG,KAAKF;YAEzC,OAAO;gBAAE,GAAGG,QAAQ;gBAAEE;YAAa;QACrC;IACF;AACF"}
package/lib/env.d.js ADDED
@@ -0,0 +1,15 @@
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
+
15
+ //# sourceMappingURL=env.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/env.d.ts"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/// <reference types=\"@rsbuild/core/types\" />\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,6CAA6C"}
@@ -0,0 +1,3 @@
1
+ import { ReactElement } from 'react';
2
+ export declare function PrometheusExplorer(): ReactElement;
3
+ //# sourceMappingURL=PrometheusExplorer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrometheusExplorer.d.ts","sourceRoot":"","sources":["../../../src/explore/PrometheusExplorer.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAyErC,wBAAgB,kBAAkB,IAAI,YAAY,CAkDjD"}
@@ -0,0 +1,190 @@
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
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { Box, Stack, Tab, Tabs } from '@mui/material';
15
+ import { DataQueriesProvider, MultiQueryEditor, useSuggestedStepMs } from '@perses-dev/plugin-system';
16
+ import { useExplorerManagerContext } from '@perses-dev/explore';
17
+ import useResizeObserver from 'use-resize-observer';
18
+ import { Panel } from '@perses-dev/dashboards';
19
+ import { DEFAULT_PROM } from '../model/prometheus-selectors';
20
+ import { PrometheusMetricsFinder } from './PrometheusMetricsFinder';
21
+ const PANEL_PREVIEW_HEIGHT = 700;
22
+ function TimeSeriesPanel({ queries }) {
23
+ const { width, ref: boxRef } = useResizeObserver();
24
+ const height = PANEL_PREVIEW_HEIGHT;
25
+ const suggestedStepMs = useSuggestedStepMs(width);
26
+ // map TimeSeriesQueryDefinition to Definition<UnknownSpec>
27
+ const definitions = queries.length ? queries.map((query)=>{
28
+ return {
29
+ kind: query.spec.plugin.kind,
30
+ spec: query.spec.plugin.spec
31
+ };
32
+ }) : [];
33
+ return /*#__PURE__*/ _jsx(Box, {
34
+ ref: boxRef,
35
+ height: height,
36
+ children: /*#__PURE__*/ _jsx(DataQueriesProvider, {
37
+ definitions: definitions,
38
+ options: {
39
+ suggestedStepMs,
40
+ mode: 'range'
41
+ },
42
+ children: /*#__PURE__*/ _jsx(Panel, {
43
+ panelOptions: {
44
+ hideHeader: true
45
+ },
46
+ definition: {
47
+ kind: 'Panel',
48
+ spec: {
49
+ queries: queries,
50
+ display: {
51
+ name: ''
52
+ },
53
+ plugin: {
54
+ kind: 'TimeSeriesChart',
55
+ spec: {}
56
+ }
57
+ }
58
+ }
59
+ })
60
+ })
61
+ });
62
+ }
63
+ function MetricDataTable({ queries }) {
64
+ const height = PANEL_PREVIEW_HEIGHT;
65
+ // map TimeSeriesQueryDefinition to Definition<UnknownSpec>
66
+ const definitions = queries.map((query)=>{
67
+ return {
68
+ kind: query.spec.plugin.kind,
69
+ spec: query.spec.plugin.spec
70
+ };
71
+ });
72
+ return /*#__PURE__*/ _jsx(Box, {
73
+ height: height,
74
+ children: /*#__PURE__*/ _jsx(DataQueriesProvider, {
75
+ definitions: definitions,
76
+ options: {
77
+ mode: 'instant'
78
+ },
79
+ children: /*#__PURE__*/ _jsx(Panel, {
80
+ panelOptions: {
81
+ hideHeader: true
82
+ },
83
+ definition: {
84
+ kind: 'Panel',
85
+ spec: {
86
+ queries: queries,
87
+ display: {
88
+ name: ''
89
+ },
90
+ plugin: {
91
+ kind: 'TimeSeriesTable',
92
+ spec: {}
93
+ }
94
+ }
95
+ }
96
+ })
97
+ })
98
+ });
99
+ }
100
+ export function PrometheusExplorer() {
101
+ const { data: { tab = 'table', queries = [], datasource = DEFAULT_PROM, filters = [], exploredMetric = undefined }, setData } = useExplorerManagerContext();
102
+ return /*#__PURE__*/ _jsxs(Stack, {
103
+ gap: 2,
104
+ sx: {
105
+ width: '100%'
106
+ },
107
+ children: [
108
+ /*#__PURE__*/ _jsxs(Tabs, {
109
+ value: tab,
110
+ onChange: (_, state)=>setData({
111
+ tab: state,
112
+ queries
113
+ }),
114
+ variant: "scrollable",
115
+ sx: {
116
+ borderBottom: 1,
117
+ borderColor: 'divider'
118
+ },
119
+ children: [
120
+ /*#__PURE__*/ _jsx(Tab, {
121
+ value: "table",
122
+ label: "Table"
123
+ }),
124
+ /*#__PURE__*/ _jsx(Tab, {
125
+ value: "graph",
126
+ label: "Graph"
127
+ }),
128
+ /*#__PURE__*/ _jsx(Tab, {
129
+ value: "finder",
130
+ label: "Finder"
131
+ })
132
+ ]
133
+ }),
134
+ /*#__PURE__*/ _jsxs(Stack, {
135
+ gap: 1,
136
+ children: [
137
+ tab === 'table' && /*#__PURE__*/ _jsxs(Stack, {
138
+ children: [
139
+ /*#__PURE__*/ _jsx(MultiQueryEditor, {
140
+ queryTypes: [
141
+ 'TimeSeriesQuery'
142
+ ],
143
+ onChange: (state)=>setData({
144
+ tab,
145
+ queries: state
146
+ }),
147
+ queries: queries
148
+ }),
149
+ /*#__PURE__*/ _jsx(MetricDataTable, {
150
+ queries: queries
151
+ })
152
+ ]
153
+ }),
154
+ tab === 'graph' && /*#__PURE__*/ _jsxs(Stack, {
155
+ children: [
156
+ /*#__PURE__*/ _jsx(MultiQueryEditor, {
157
+ queryTypes: [
158
+ 'TimeSeriesQuery'
159
+ ],
160
+ onChange: (state)=>setData({
161
+ tab,
162
+ queries: state
163
+ }),
164
+ queries: queries
165
+ }),
166
+ /*#__PURE__*/ _jsx(TimeSeriesPanel, {
167
+ queries: queries
168
+ })
169
+ ]
170
+ }),
171
+ tab === 'finder' && /*#__PURE__*/ _jsx(Stack, {
172
+ children: /*#__PURE__*/ _jsx(PrometheusMetricsFinder, {
173
+ onChange: (state)=>setData({
174
+ tab,
175
+ ...state
176
+ }),
177
+ value: {
178
+ datasource,
179
+ filters,
180
+ exploredMetric
181
+ }
182
+ })
183
+ })
184
+ ]
185
+ })
186
+ ]
187
+ });
188
+ }
189
+
190
+ //# sourceMappingURL=PrometheusExplorer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/explore/PrometheusExplorer.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { QueryDefinition } from '@perses-dev/core';\nimport { Box, Stack, Tab, Tabs } from '@mui/material';\nimport { DataQueriesProvider, MultiQueryEditor, useSuggestedStepMs } from '@perses-dev/plugin-system';\nimport { useExplorerManagerContext } from '@perses-dev/explore';\nimport useResizeObserver from 'use-resize-observer';\nimport { Panel } from '@perses-dev/dashboards';\nimport { ReactElement } from 'react';\nimport { DEFAULT_PROM } from '../model/prometheus-selectors';\nimport { FinderQueryParams } from './PrometheusMetricsFinder/types';\nimport { PrometheusMetricsFinder } from './PrometheusMetricsFinder';\n\ninterface MetricsExplorerQueryParams extends FinderQueryParams {\n tab?: string;\n queries?: QueryDefinition[];\n}\n\nconst PANEL_PREVIEW_HEIGHT = 700;\n\nfunction TimeSeriesPanel({ queries }: { queries: QueryDefinition[] }): ReactElement {\n const { width, ref: boxRef } = useResizeObserver();\n const height = PANEL_PREVIEW_HEIGHT;\n\n const suggestedStepMs = useSuggestedStepMs(width);\n\n // map TimeSeriesQueryDefinition to Definition<UnknownSpec>\n const definitions = queries.length\n ? queries.map((query) => {\n return {\n kind: query.spec.plugin.kind,\n spec: query.spec.plugin.spec,\n };\n })\n : [];\n\n return (\n <Box ref={boxRef} height={height}>\n <DataQueriesProvider definitions={definitions} options={{ suggestedStepMs, mode: 'range' }}>\n <Panel\n panelOptions={{\n hideHeader: true,\n }}\n definition={{\n kind: 'Panel',\n spec: { queries: queries, display: { name: '' }, plugin: { kind: 'TimeSeriesChart', spec: {} } },\n }}\n />\n </DataQueriesProvider>\n </Box>\n );\n}\n\nfunction MetricDataTable({ queries }: { queries: QueryDefinition[] }): ReactElement {\n const height = PANEL_PREVIEW_HEIGHT;\n\n // map TimeSeriesQueryDefinition to Definition<UnknownSpec>\n const definitions = queries.map((query) => {\n return {\n kind: query.spec.plugin.kind,\n spec: query.spec.plugin.spec,\n };\n });\n\n return (\n <Box height={height}>\n <DataQueriesProvider definitions={definitions} options={{ mode: 'instant' }}>\n <Panel\n panelOptions={{\n hideHeader: true,\n }}\n definition={{\n kind: 'Panel',\n spec: { queries: queries, display: { name: '' }, plugin: { kind: 'TimeSeriesTable', spec: {} } },\n }}\n />\n </DataQueriesProvider>\n </Box>\n );\n}\n\nexport function PrometheusExplorer(): ReactElement {\n const {\n data: { tab = 'table', queries = [], datasource = DEFAULT_PROM, filters = [], exploredMetric = undefined },\n setData,\n } = useExplorerManagerContext<MetricsExplorerQueryParams>();\n\n return (\n <Stack gap={2} sx={{ width: '100%' }}>\n <Tabs\n value={tab}\n onChange={(_, state) => setData({ tab: state, queries })}\n variant=\"scrollable\"\n sx={{ borderBottom: 1, borderColor: 'divider' }}\n >\n <Tab value=\"table\" label=\"Table\" />\n <Tab value=\"graph\" label=\"Graph\" />\n <Tab value=\"finder\" label=\"Finder\" />\n </Tabs>\n <Stack gap={1}>\n {tab === 'table' && (\n <Stack>\n <MultiQueryEditor\n queryTypes={['TimeSeriesQuery']}\n onChange={(state) => setData({ tab, queries: state })}\n queries={queries}\n />\n <MetricDataTable queries={queries} />\n </Stack>\n )}\n {tab === 'graph' && (\n <Stack>\n <MultiQueryEditor\n queryTypes={['TimeSeriesQuery']}\n onChange={(state) => setData({ tab, queries: state })}\n queries={queries}\n />\n <TimeSeriesPanel queries={queries} />\n </Stack>\n )}\n {tab === 'finder' && (\n <Stack>\n <PrometheusMetricsFinder\n onChange={(state) => setData({ tab, ...state })}\n value={{ datasource, filters, exploredMetric }}\n />\n </Stack>\n )}\n </Stack>\n </Stack>\n );\n}\n"],"names":["Box","Stack","Tab","Tabs","DataQueriesProvider","MultiQueryEditor","useSuggestedStepMs","useExplorerManagerContext","useResizeObserver","Panel","DEFAULT_PROM","PrometheusMetricsFinder","PANEL_PREVIEW_HEIGHT","TimeSeriesPanel","queries","width","ref","boxRef","height","suggestedStepMs","definitions","length","map","query","kind","spec","plugin","options","mode","panelOptions","hideHeader","definition","display","name","MetricDataTable","PrometheusExplorer","data","tab","datasource","filters","exploredMetric","undefined","setData","gap","sx","value","onChange","_","state","variant","borderBottom","borderColor","label","queryTypes"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,GAAG,EAAEC,KAAK,EAAEC,GAAG,EAAEC,IAAI,QAAQ,gBAAgB;AACtD,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,kBAAkB,QAAQ,4BAA4B;AACtG,SAASC,yBAAyB,QAAQ,sBAAsB;AAChE,OAAOC,uBAAuB,sBAAsB;AACpD,SAASC,KAAK,QAAQ,yBAAyB;AAE/C,SAASC,YAAY,QAAQ,gCAAgC;AAE7D,SAASC,uBAAuB,QAAQ,4BAA4B;AAOpE,MAAMC,uBAAuB;AAE7B,SAASC,gBAAgB,EAAEC,OAAO,EAAkC;IAClE,MAAM,EAAEC,KAAK,EAAEC,KAAKC,MAAM,EAAE,GAAGT;IAC/B,MAAMU,SAASN;IAEf,MAAMO,kBAAkBb,mBAAmBS;IAE3C,2DAA2D;IAC3D,MAAMK,cAAcN,QAAQO,MAAM,GAC9BP,QAAQQ,GAAG,CAAC,CAACC;QACX,OAAO;YACLC,MAAMD,MAAME,IAAI,CAACC,MAAM,CAACF,IAAI;YAC5BC,MAAMF,MAAME,IAAI,CAACC,MAAM,CAACD,IAAI;QAC9B;IACF,KACA,EAAE;IAEN,qBACE,KAACzB;QAAIgB,KAAKC;QAAQC,QAAQA;kBACxB,cAAA,KAACd;YAAoBgB,aAAaA;YAAaO,SAAS;gBAAER;gBAAiBS,MAAM;YAAQ;sBACvF,cAAA,KAACnB;gBACCoB,cAAc;oBACZC,YAAY;gBACd;gBACAC,YAAY;oBACVP,MAAM;oBACNC,MAAM;wBAAE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AAClD;wBAAI2C,OAAM;wBAASO,OAAM;;;;0BAE5B,MAACnD;gBAAM0C,KAAK;;oBACTN,QAAQ,yBACP,MAACpC;;0CACC,KAACI;gCACCgD,YAAY;oCAAC;iCAAkB;gCAC/BP,UAAU,CAACE,QAAUN,QAAQ;wCAAEL;wCAAKvB,SAASkC;oCAAM;gCACnDlC,SAASA;;0CAEX,KAACoB;gCAAgBpB,SAASA;;;;oBAG7BuB,QAAQ,yBACP,MAACpC;;0CACC,KAACI;gCACCgD,YAAY;oCAAC;iCAAkB;gCAC/BP,UAAU,CAACE,QAAUN,QAAQ;wCAAEL;wCAAKvB,SAASkC;oCAAM;gCACnDlC,SAASA;;0CAEX,KAACD;gCAAgBC,SAASA;;;;oBAG7BuB,QAAQ,0BACP,KAACpC;kCACC,cAAA,KAACU;4BACCmC,UAAU,CAACE,QAAUN,QAAQ;oCAAEL;oCAAK,GAAGW,KAAK;gCAAC;4BAC7CH,OAAO;gCAAEP;gCAAYC;gCAASC;4BAAe;;;;;;;AAO3D"}
@@ -0,0 +1,31 @@
1
+ import { StackProps } from '@mui/material';
2
+ import { DatasourceSelector } from '@perses-dev/core';
3
+ import { ReactElement } from 'react';
4
+ import { LabelFilter, Settings } from './types';
5
+ export interface SettingsMenuProps {
6
+ value: Settings;
7
+ onChange: (value: Settings) => void;
8
+ }
9
+ export declare function SettingsMenu({ value, onChange }: SettingsMenuProps): ReactElement;
10
+ export interface MetricNameExplorerProps extends StackProps {
11
+ datasource: DatasourceSelector;
12
+ filters: LabelFilter[];
13
+ isMetadataEnabled?: boolean;
14
+ onExplore?: (metricName: string) => void;
15
+ }
16
+ export declare function MetricNameExplorer({ datasource, filters, isMetadataEnabled, onExplore, ...props }: MetricNameExplorerProps): ReactElement;
17
+ export interface PrometheusMetricsFinderProps extends Omit<StackProps, 'onChange'> {
18
+ value: {
19
+ datasource: DatasourceSelector;
20
+ filters: LabelFilter[];
21
+ exploredMetric?: string;
22
+ };
23
+ onChange: ({ datasource, filters, exploredMetric, }: {
24
+ datasource: DatasourceSelector;
25
+ filters: LabelFilter[];
26
+ exploredMetric?: string;
27
+ }) => void;
28
+ onExplore?: (metricName: string) => void;
29
+ }
30
+ export declare function PrometheusMetricsFinder({ value: { datasource, filters, exploredMetric }, onChange, onExplore, ...props }: PrometheusMetricsFinderProps): ReactElement;
31
+ //# sourceMappingURL=PrometheusMetricsFinder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrometheusMetricsFinder.d.ts","sourceRoot":"","sources":["../../../../src/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.tsx"],"names":[],"mappings":"AAaA,OAAO,EAUL,UAAU,EAIX,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAKtD,OAAO,EAAc,YAAY,EAAqB,MAAM,OAAO,CAAC;AAMpE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKhD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,QAAQ,CAAC;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;CACrC;AAED,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,iBAAiB,GAAG,YAAY,CAmCjF;AAED,MAAM,WAAW,uBAAwB,SAAQ,UAAU;IACzD,UAAU,EAAE,kBAAkB,CAAC;IAC/B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAED,wBAAgB,kBAAkB,CAAC,EACjC,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,uBAAuB,GAAG,YAAY,CAgDxC;AAED,MAAM,WAAW,4BAA6B,SAAQ,IAAI,CAAC,UAAU,EAAE,UAAU,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