@perses-dev/prometheus-plugin 0.56.0 → 0.57.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/__mf/js/Prometheus.3cac2d10.js +6 -0
  2. package/__mf/js/async/1233.0ab88b51.js +1 -0
  3. package/__mf/js/async/1324.ce01eced.js +1 -0
  4. package/__mf/js/async/1432.0c3e4ed0.js +1 -0
  5. package/__mf/js/async/1605.dc180cb8.js +110 -0
  6. package/__mf/js/async/1616.7587ce79.js +1 -0
  7. package/__mf/js/async/1728.46efbfb8.js +1 -0
  8. package/__mf/js/async/1969.372d36b8.js +1 -0
  9. package/__mf/js/async/2043.d0fbb886.js +2 -0
  10. package/__mf/js/async/2186.e58838a5.js +38 -0
  11. package/__mf/js/async/2506.1e336b3b.js +1 -0
  12. package/__mf/js/async/3184.6b4ad42e.js +1 -0
  13. package/__mf/js/async/3499.bef2e2e5.js +1 -0
  14. package/__mf/js/async/3652.fc1e5f95.js +7 -0
  15. package/__mf/js/async/392.7cda691a.js +2 -0
  16. package/__mf/js/async/3963.5fef6ffb.js +1 -0
  17. package/__mf/js/async/3996.69a9c1dc.js +1 -0
  18. package/__mf/js/async/{1964.1d168a86.js → 4121.828d661d.js} +2 -2
  19. package/__mf/js/async/425.1ec8867f.js +1 -0
  20. package/__mf/js/async/4626.173e602a.js +1 -0
  21. package/__mf/js/async/4657.e3d53a21.js +2 -0
  22. package/__mf/js/async/4987.c12b89cb.js +1 -0
  23. package/__mf/js/async/{8930.700a5439.js → 5002.e4f54e8e.js} +1 -1
  24. package/__mf/js/async/5071.e1c33fa7.js +1 -0
  25. package/__mf/js/async/529.2303b01b.js +1 -0
  26. package/__mf/js/async/54.f6f480ef.js +22 -0
  27. package/__mf/js/async/5440.8ced5513.js +2 -0
  28. package/__mf/js/async/{6377.c40920f2.js.LICENSE.txt → 5440.8ced5513.js.LICENSE.txt} +3 -3
  29. package/__mf/js/async/{5214.0fca84ed.js → 5587.4d72fc35.js} +1 -1
  30. package/__mf/js/async/5763.4ba478ff.js +1 -0
  31. package/__mf/js/async/5922.d1619ac1.js +1 -0
  32. package/__mf/js/async/6274.478a68f8.js +2 -0
  33. package/__mf/js/async/6283.181cb622.js +2 -0
  34. package/__mf/js/async/6969.b959b6f8.js +1 -0
  35. package/__mf/js/async/{4062.06f48b93.js → 7177.205c9aaf.js} +1 -1
  36. package/__mf/js/async/7192.d835931b.js +1 -0
  37. package/__mf/js/async/7894.9c5245d7.js +1 -0
  38. package/__mf/js/async/7968.6ac0ce96.js +1 -0
  39. package/__mf/js/async/7978.9532d5b8.js +1 -0
  40. package/__mf/js/async/8356.789e1dfb.js +1 -0
  41. package/__mf/js/async/8470.9b14a625.js +2 -0
  42. package/__mf/js/async/873.448eab23.js +1 -0
  43. package/__mf/js/async/8888.59eb50a2.js +1 -0
  44. package/__mf/js/async/9010.15208552.js +2 -0
  45. package/__mf/js/async/9020.662dc353.js +1 -0
  46. package/__mf/js/async/9184.43a8d927.js +1 -0
  47. package/__mf/js/async/9235.36c3cd8c.js +1 -0
  48. package/__mf/js/async/9351.715f25c3.js +1 -0
  49. package/__mf/js/async/941.53b13124.js +2 -0
  50. package/__mf/js/async/9518.38e38a33.js +1 -0
  51. package/__mf/js/async/9588.9081c7de.js +1 -0
  52. package/__mf/js/async/9605.a92ec9c1.js +1 -0
  53. package/__mf/js/async/9836.00da6086.js +1 -0
  54. package/__mf/js/async/__federation_expose_PrometheusDatasource.caac7bfc.js +1 -0
  55. package/__mf/js/async/__federation_expose_PrometheusExplorer.22434cd0.js +1 -0
  56. package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.087a9360.js +1 -0
  57. package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.f9135d9a.js +1 -0
  58. package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.d3f9f4b7.js +1 -0
  59. package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.95a9abcc.js +1 -0
  60. package/__mf/js/main.8eeb4292.js +6 -0
  61. package/lib/bootstrap.js +2 -2
  62. package/lib/bootstrap.js.map +1 -1
  63. package/lib/cjs/bootstrap.js +1 -1
  64. package/lib/cjs/components/PromQLEditor.js +5 -8
  65. package/lib/cjs/components/TreeNode.js +1 -1
  66. package/lib/cjs/components/index.js +1 -1
  67. package/lib/cjs/components/promql/ast.js +11 -11
  68. package/lib/cjs/components/promql/format.js +4 -4
  69. package/lib/cjs/components/promql/functionSignatures.js +1 -1
  70. package/lib/cjs/components/promql/serialize.js +1 -1
  71. package/lib/cjs/components/promql/utils.js +6 -6
  72. package/lib/cjs/components/query.js +4 -4
  73. package/lib/cjs/env.d.js +1 -1
  74. package/lib/cjs/explore/PrometheusExplorer.js +11 -7
  75. package/lib/cjs/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js +5 -5
  76. package/lib/cjs/explore/PrometheusMetricsFinder/display/MetricChip.js +1 -1
  77. package/lib/cjs/explore/PrometheusMetricsFinder/display/list/MetricList.js +4 -4
  78. package/lib/cjs/explore/PrometheusMetricsFinder/filter/FilterInputs.js +5 -5
  79. package/lib/cjs/explore/PrometheusMetricsFinder/filter/FinderFilters.js +1 -1
  80. package/lib/cjs/explore/PrometheusMetricsFinder/index.js +1 -1
  81. package/lib/cjs/explore/PrometheusMetricsFinder/overview/MetricOverview.js +4 -4
  82. package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js +5 -5
  83. package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js +5 -5
  84. package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js +1 -1
  85. package/lib/cjs/explore/PrometheusMetricsFinder/types.js +1 -1
  86. package/lib/cjs/explore/PrometheusMetricsFinder/utils.js +6 -6
  87. package/lib/cjs/explore/index.js +12 -0
  88. package/lib/cjs/getPluginModule.js +12 -0
  89. package/lib/cjs/index-federation.js +12 -12
  90. package/lib/cjs/index.js +12 -0
  91. package/lib/cjs/model/api-types.js +1 -1
  92. package/lib/cjs/model/index.js +1 -1
  93. package/lib/cjs/model/parse-sample-values.js +4 -4
  94. package/lib/cjs/model/prometheus-client.js +30 -20
  95. package/lib/cjs/model/prometheus-selectors.js +6 -6
  96. package/lib/cjs/model/time.js +5 -5
  97. package/lib/cjs/plugins/MatcherEditor.js +1 -1
  98. package/lib/cjs/plugins/PrometheusDatasourceEditor.js +176 -3
  99. package/lib/cjs/plugins/PrometheusLabelNamesVariable.js +12 -0
  100. package/lib/cjs/plugins/PrometheusLabelValuesVariable.js +12 -0
  101. package/lib/cjs/plugins/PrometheusPromQLVariable.js +12 -0
  102. package/lib/cjs/plugins/index.js +12 -0
  103. package/lib/cjs/plugins/prometheus-datasource.js +18 -10
  104. package/lib/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js +1 -1
  105. package/lib/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +37 -2
  106. package/lib/cjs/plugins/prometheus-time-series-query/get-time-series-data.js +1 -1
  107. package/lib/cjs/plugins/prometheus-time-series-query/index.js +1 -1
  108. package/lib/cjs/plugins/prometheus-time-series-query/query-editor-model.js +5 -5
  109. package/lib/cjs/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js +1 -1
  110. package/lib/cjs/plugins/prometheus-time-series-query/time-series-query-model.js +1 -1
  111. package/lib/cjs/plugins/prometheus-variables.js +53 -34
  112. package/lib/cjs/plugins/test/setup-tests.js +1 -1
  113. package/lib/cjs/plugins/types.js +1 -1
  114. package/lib/cjs/plugins/variable.js +1 -1
  115. package/lib/cjs/setup-tests.js +1 -1
  116. package/lib/cjs/utils/index.js +1 -1
  117. package/lib/cjs/utils/utils.js +5 -5
  118. package/lib/components/PromQLEditor.d.ts +5 -1
  119. package/lib/components/PromQLEditor.d.ts.map +1 -1
  120. package/lib/components/PromQLEditor.js +6 -9
  121. package/lib/components/PromQLEditor.js.map +1 -1
  122. package/lib/components/TreeNode.js +2 -2
  123. package/lib/components/TreeNode.js.map +1 -1
  124. package/lib/components/index.js +1 -1
  125. package/lib/components/index.js.map +1 -1
  126. package/lib/components/promql/ast.js +1 -1
  127. package/lib/components/promql/ast.js.map +1 -1
  128. package/lib/components/promql/format.js +2 -2
  129. package/lib/components/promql/format.js.map +1 -1
  130. package/lib/components/promql/functionSignatures.js +1 -1
  131. package/lib/components/promql/functionSignatures.js.map +1 -1
  132. package/lib/components/promql/serialize.js +1 -1
  133. package/lib/components/promql/serialize.js.map +1 -1
  134. package/lib/components/promql/utils.js +1 -1
  135. package/lib/components/promql/utils.js.map +1 -1
  136. package/lib/components/query.js +1 -1
  137. package/lib/components/query.js.map +1 -1
  138. package/lib/env.d.js +1 -1
  139. package/lib/env.d.js.map +1 -1
  140. package/lib/explore/PrometheusExplorer.d.ts.map +1 -1
  141. package/lib/explore/PrometheusExplorer.js +11 -7
  142. package/lib/explore/PrometheusExplorer.js.map +1 -1
  143. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js +2 -2
  144. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js.map +1 -1
  145. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.js +2 -2
  146. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.js.map +1 -1
  147. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.js +2 -2
  148. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.js.map +1 -1
  149. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js +2 -2
  150. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js.map +1 -1
  151. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js +2 -2
  152. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js.map +1 -1
  153. package/lib/explore/PrometheusMetricsFinder/index.js +1 -1
  154. package/lib/explore/PrometheusMetricsFinder/index.js.map +1 -1
  155. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.js +2 -2
  156. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.js.map +1 -1
  157. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js +1 -1
  158. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js.map +1 -1
  159. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js +1 -1
  160. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js.map +1 -1
  161. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js +1 -1
  162. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js.map +1 -1
  163. package/lib/explore/PrometheusMetricsFinder/types.js +1 -1
  164. package/lib/explore/PrometheusMetricsFinder/types.js.map +1 -1
  165. package/lib/explore/PrometheusMetricsFinder/utils.js +1 -1
  166. package/lib/explore/PrometheusMetricsFinder/utils.js.map +1 -1
  167. package/lib/explore/index.d.ts.map +1 -1
  168. package/lib/explore/index.js +12 -0
  169. package/lib/explore/index.js.map +1 -1
  170. package/lib/getPluginModule.d.ts.map +1 -1
  171. package/lib/getPluginModule.js +12 -0
  172. package/lib/getPluginModule.js.map +1 -1
  173. package/lib/index-federation.js +1 -1
  174. package/lib/index-federation.js.map +1 -1
  175. package/lib/index.d.ts.map +1 -1
  176. package/lib/index.js +12 -0
  177. package/lib/index.js.map +1 -1
  178. package/lib/model/api-types.js +1 -1
  179. package/lib/model/api-types.js.map +1 -1
  180. package/lib/model/index.js +1 -1
  181. package/lib/model/index.js.map +1 -1
  182. package/lib/model/parse-sample-values.js +1 -1
  183. package/lib/model/parse-sample-values.js.map +1 -1
  184. package/lib/model/prometheus-client.d.ts +1 -0
  185. package/lib/model/prometheus-client.d.ts.map +1 -1
  186. package/lib/model/prometheus-client.js +20 -10
  187. package/lib/model/prometheus-client.js.map +1 -1
  188. package/lib/model/prometheus-selectors.js +1 -1
  189. package/lib/model/prometheus-selectors.js.map +1 -1
  190. package/lib/model/time.js +1 -1
  191. package/lib/model/time.js.map +1 -1
  192. package/lib/plugins/MatcherEditor.js +2 -2
  193. package/lib/plugins/MatcherEditor.js.map +1 -1
  194. package/lib/plugins/PrometheusDatasourceEditor.d.ts.map +1 -1
  195. package/lib/plugins/PrometheusDatasourceEditor.js +136 -4
  196. package/lib/plugins/PrometheusDatasourceEditor.js.map +1 -1
  197. package/lib/plugins/PrometheusLabelNamesVariable.d.ts.map +1 -1
  198. package/lib/plugins/PrometheusLabelNamesVariable.js +12 -0
  199. package/lib/plugins/PrometheusLabelNamesVariable.js.map +1 -1
  200. package/lib/plugins/PrometheusLabelValuesVariable.d.ts.map +1 -1
  201. package/lib/plugins/PrometheusLabelValuesVariable.js +12 -0
  202. package/lib/plugins/PrometheusLabelValuesVariable.js.map +1 -1
  203. package/lib/plugins/PrometheusPromQLVariable.d.ts.map +1 -1
  204. package/lib/plugins/PrometheusPromQLVariable.js +12 -0
  205. package/lib/plugins/PrometheusPromQLVariable.js.map +1 -1
  206. package/lib/plugins/index.d.ts.map +1 -1
  207. package/lib/plugins/index.js +12 -0
  208. package/lib/plugins/index.js.map +1 -1
  209. package/lib/plugins/prometheus-datasource.js +18 -10
  210. package/lib/plugins/prometheus-datasource.js.map +1 -1
  211. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js +1 -1
  212. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js.map +1 -1
  213. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts.map +1 -1
  214. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +40 -5
  215. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js.map +1 -1
  216. package/lib/plugins/prometheus-time-series-query/get-time-series-data.d.ts.map +1 -1
  217. package/lib/plugins/prometheus-time-series-query/get-time-series-data.js +1 -1
  218. package/lib/plugins/prometheus-time-series-query/get-time-series-data.js.map +1 -1
  219. package/lib/plugins/prometheus-time-series-query/index.js +1 -1
  220. package/lib/plugins/prometheus-time-series-query/index.js.map +1 -1
  221. package/lib/plugins/prometheus-time-series-query/query-editor-model.js +1 -1
  222. package/lib/plugins/prometheus-time-series-query/query-editor-model.js.map +1 -1
  223. package/lib/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js +1 -1
  224. package/lib/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js.map +1 -1
  225. package/lib/plugins/prometheus-time-series-query/time-series-query-model.js +1 -1
  226. package/lib/plugins/prometheus-time-series-query/time-series-query-model.js.map +1 -1
  227. package/lib/plugins/prometheus-variables.d.ts.map +1 -1
  228. package/lib/plugins/prometheus-variables.js +48 -29
  229. package/lib/plugins/prometheus-variables.js.map +1 -1
  230. package/lib/plugins/test/setup-tests.js +1 -1
  231. package/lib/plugins/test/setup-tests.js.map +1 -1
  232. package/lib/plugins/types.d.ts +1 -0
  233. package/lib/plugins/types.d.ts.map +1 -1
  234. package/lib/plugins/types.js +1 -1
  235. package/lib/plugins/types.js.map +1 -1
  236. package/lib/plugins/variable.js +1 -1
  237. package/lib/plugins/variable.js.map +1 -1
  238. package/lib/setup-tests.js +1 -1
  239. package/lib/setup-tests.js.map +1 -1
  240. package/lib/utils/index.js +1 -1
  241. package/lib/utils/index.js.map +1 -1
  242. package/lib/utils/utils.js +1 -1
  243. package/lib/utils/utils.js.map +1 -1
  244. package/mf-manifest.json +270 -255
  245. package/mf-stats.json +276 -259
  246. package/package.json +7 -7
  247. package/__mf/js/Prometheus.4d0d5812.js +0 -5
  248. package/__mf/js/async/1339.194207db.js +0 -1
  249. package/__mf/js/async/1441.c735f7dd.js +0 -1
  250. package/__mf/js/async/1576.8eac7ce9.js +0 -1
  251. package/__mf/js/async/212.5fcca998.js +0 -1
  252. package/__mf/js/async/2292.57d8fd0d.js +0 -2
  253. package/__mf/js/async/3224.b63f87bf.js +0 -1
  254. package/__mf/js/async/3507.f1653337.js +0 -101
  255. package/__mf/js/async/3749.3ecd9372.js +0 -1
  256. package/__mf/js/async/3863.7192dfdf.js +0 -2
  257. package/__mf/js/async/3960.3eedafbd.js +0 -2
  258. package/__mf/js/async/3980.0b0d272c.js +0 -2
  259. package/__mf/js/async/4075.dab1b7b8.js +0 -1
  260. package/__mf/js/async/4238.c48b1950.js +0 -1
  261. package/__mf/js/async/4421.1fcb466e.js +0 -1
  262. package/__mf/js/async/4535.f24704ea.js +0 -1
  263. package/__mf/js/async/4557.f3eb9456.js +0 -2
  264. package/__mf/js/async/4576.f42daf99.js +0 -1
  265. package/__mf/js/async/4665.cad36935.js +0 -1
  266. package/__mf/js/async/4676.b7a22f90.js +0 -22
  267. package/__mf/js/async/5257.ce463cb7.js +0 -1
  268. package/__mf/js/async/5409.955ffd51.js +0 -1
  269. package/__mf/js/async/5614.cce8ba96.js +0 -1
  270. package/__mf/js/async/5724.794828e3.js +0 -1
  271. package/__mf/js/async/5774.a3fae698.js +0 -1
  272. package/__mf/js/async/5790.a9b31ca8.js +0 -1
  273. package/__mf/js/async/58.1c9a8daa.js +0 -2
  274. package/__mf/js/async/5981.eb502d27.js +0 -2
  275. package/__mf/js/async/6292.2afe0c6d.js +0 -1
  276. package/__mf/js/async/6341.20eccf91.js +0 -7
  277. package/__mf/js/async/6377.c40920f2.js +0 -2
  278. package/__mf/js/async/6770.7099bb3b.js +0 -1
  279. package/__mf/js/async/684.4495f632.js +0 -1
  280. package/__mf/js/async/694.8462a746.js +0 -1
  281. package/__mf/js/async/7272.6fa2f127.js +0 -1
  282. package/__mf/js/async/7376.2e948f2b.js +0 -1
  283. package/__mf/js/async/738.a1ffff79.js +0 -1
  284. package/__mf/js/async/7740.a8777825.js +0 -1
  285. package/__mf/js/async/8045.7f554a45.js +0 -10
  286. package/__mf/js/async/8164.bb3d3363.js +0 -1
  287. package/__mf/js/async/8216.e689c178.js +0 -1
  288. package/__mf/js/async/8488.cbbe542b.js +0 -1
  289. package/__mf/js/async/8587.40df6f5c.js +0 -1
  290. package/__mf/js/async/8706.89677575.js +0 -1
  291. package/__mf/js/async/9010.bdb2ef97.js +0 -1
  292. package/__mf/js/async/9173.915b80af.js +0 -2
  293. package/__mf/js/async/9550.642ce5ad.js +0 -38
  294. package/__mf/js/async/9817.70eae424.js +0 -1
  295. package/__mf/js/async/__federation_expose_PrometheusDatasource.45ee94e2.js +0 -1
  296. package/__mf/js/async/__federation_expose_PrometheusExplorer.b8e555e1.js +0 -1
  297. package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.00dfb1dd.js +0 -1
  298. package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.956ef2d0.js +0 -1
  299. package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.59f2d170.js +0 -1
  300. package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.d7143352.js +0 -1
  301. package/__mf/js/main.afc2ee60.js +0 -5
  302. /package/__mf/css/async/{1339.d3010b86.css → 1233.d3010b86.css} +0 -0
  303. /package/__mf/css/async/{1576.d3010b86.css → 1324.d3010b86.css} +0 -0
  304. /package/__mf/css/async/{4576.d3010b86.css → 9518.d3010b86.css} +0 -0
  305. /package/__mf/js/async/{8045.7f554a45.js.LICENSE.txt → 1605.dc180cb8.js.LICENSE.txt} +0 -0
  306. /package/__mf/js/async/{2292.57d8fd0d.js.LICENSE.txt → 2043.d0fbb886.js.LICENSE.txt} +0 -0
  307. /package/__mf/js/async/{6341.20eccf91.js.LICENSE.txt → 3652.fc1e5f95.js.LICENSE.txt} +0 -0
  308. /package/__mf/js/async/{5981.eb502d27.js.LICENSE.txt → 392.7cda691a.js.LICENSE.txt} +0 -0
  309. /package/__mf/js/async/{1964.1d168a86.js.LICENSE.txt → 4121.828d661d.js.LICENSE.txt} +0 -0
  310. /package/__mf/js/async/{58.1c9a8daa.js.LICENSE.txt → 4657.e3d53a21.js.LICENSE.txt} +0 -0
  311. /package/__mf/js/async/{4676.b7a22f90.js.LICENSE.txt → 54.f6f480ef.js.LICENSE.txt} +0 -0
  312. /package/__mf/js/async/{3960.3eedafbd.js.LICENSE.txt → 6274.478a68f8.js.LICENSE.txt} +0 -0
  313. /package/__mf/js/async/{3980.0b0d272c.js.LICENSE.txt → 6283.181cb622.js.LICENSE.txt} +0 -0
  314. /package/__mf/js/async/{9173.915b80af.js.LICENSE.txt → 8470.9b14a625.js.LICENSE.txt} +0 -0
  315. /package/__mf/js/async/{4557.f3eb9456.js.LICENSE.txt → 9010.15208552.js.LICENSE.txt} +0 -0
  316. /package/__mf/js/async/{3863.7192dfdf.js.LICENSE.txt → 941.53b13124.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/promql/functionSignatures.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/functionSignatures.ts\n\nimport { valueType, Func } from './ast';\n\nexport const functionSignatures: Record<string, Func> = {\n abs: { name: 'abs', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n absent: { name: 'absent', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n absent_over_time: {\n name: 'absent_over_time',\n argTypes: [valueType.matrix],\n variadic: 0,\n returnType: valueType.vector,\n },\n acos: { name: 'acos', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n acosh: { name: 'acosh', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n asin: { name: 'asin', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n asinh: { name: 'asinh', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n atan: { name: 'atan', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n atanh: { name: 'atanh', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n avg_over_time: { name: 'avg_over_time', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n ceil: { name: 'ceil', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n changes: { name: 'changes', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n clamp: {\n name: 'clamp',\n argTypes: [valueType.vector, valueType.scalar, valueType.scalar],\n variadic: 0,\n returnType: valueType.vector,\n },\n clamp_max: {\n name: 'clamp_max',\n argTypes: [valueType.vector, valueType.scalar],\n variadic: 0,\n returnType: valueType.vector,\n },\n clamp_min: {\n name: 'clamp_min',\n argTypes: [valueType.vector, valueType.scalar],\n variadic: 0,\n returnType: valueType.vector,\n },\n cos: { name: 'cos', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n cosh: { name: 'cosh', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n count_over_time: { name: 'count_over_time', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n day_of_month: { name: 'day_of_month', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n day_of_week: { name: 'day_of_week', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n day_of_year: { name: 'day_of_year', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n days_in_month: { name: 'days_in_month', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n deg: { name: 'deg', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n delta: { name: 'delta', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n deriv: { name: 'deriv', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n exp: { name: 'exp', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n floor: { name: 'floor', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n histogram_avg: { name: 'histogram_avg', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n histogram_count: { name: 'histogram_count', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n histogram_fraction: {\n name: 'histogram_fraction',\n argTypes: [valueType.scalar, valueType.scalar, valueType.vector],\n variadic: 0,\n returnType: valueType.vector,\n },\n histogram_quantile: {\n name: 'histogram_quantile',\n argTypes: [valueType.scalar, valueType.vector],\n variadic: 0,\n returnType: valueType.vector,\n },\n histogram_stddev: {\n name: 'histogram_stddev',\n argTypes: [valueType.vector],\n variadic: 0,\n returnType: valueType.vector,\n },\n histogram_stdvar: {\n name: 'histogram_stdvar',\n argTypes: [valueType.vector],\n variadic: 0,\n returnType: valueType.vector,\n },\n histogram_sum: { name: 'histogram_sum', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n double_exponential_smoothing: {\n name: 'double_exponential_smoothing',\n argTypes: [valueType.matrix, valueType.scalar, valueType.scalar],\n variadic: 0,\n returnType: valueType.vector,\n },\n hour: { name: 'hour', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n idelta: { name: 'idelta', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n increase: { name: 'increase', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n irate: { name: 'irate', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n label_join: {\n name: 'label_join',\n argTypes: [valueType.vector, valueType.string, valueType.string, valueType.string],\n variadic: -1,\n returnType: valueType.vector,\n },\n label_replace: {\n name: 'label_replace',\n argTypes: [valueType.vector, valueType.string, valueType.string, valueType.string, valueType.string],\n variadic: 0,\n returnType: valueType.vector,\n },\n last_over_time: { name: 'last_over_time', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n ln: { name: 'ln', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n log10: { name: 'log10', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n log2: { name: 'log2', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n mad_over_time: { name: 'mad_over_time', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n max_over_time: { name: 'max_over_time', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n min_over_time: { name: 'min_over_time', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n minute: { name: 'minute', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n month: { name: 'month', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n pi: { name: 'pi', argTypes: [], variadic: 0, returnType: valueType.scalar },\n predict_linear: {\n name: 'predict_linear',\n argTypes: [valueType.matrix, valueType.scalar],\n variadic: 0,\n returnType: valueType.vector,\n },\n present_over_time: {\n name: 'present_over_time',\n argTypes: [valueType.matrix],\n variadic: 0,\n returnType: valueType.vector,\n },\n quantile_over_time: {\n name: 'quantile_over_time',\n argTypes: [valueType.scalar, valueType.matrix],\n variadic: 0,\n returnType: valueType.vector,\n },\n rad: { name: 'rad', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n rate: { name: 'rate', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n resets: { name: 'resets', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n round: { name: 'round', argTypes: [valueType.vector, valueType.scalar], variadic: 1, returnType: valueType.vector },\n scalar: { name: 'scalar', argTypes: [valueType.vector], variadic: 0, returnType: valueType.scalar },\n sgn: { name: 'sgn', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n sin: { name: 'sin', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n sinh: { name: 'sinh', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n sort: { name: 'sort', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n sort_by_label: {\n name: 'sort_by_label',\n argTypes: [valueType.vector, valueType.string],\n variadic: -1,\n returnType: valueType.vector,\n },\n sort_by_label_desc: {\n name: 'sort_by_label_desc',\n argTypes: [valueType.vector, valueType.string],\n variadic: -1,\n returnType: valueType.vector,\n },\n sort_desc: { name: 'sort_desc', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n sqrt: { name: 'sqrt', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n stddev_over_time: {\n name: 'stddev_over_time',\n argTypes: [valueType.matrix],\n variadic: 0,\n returnType: valueType.vector,\n },\n stdvar_over_time: {\n name: 'stdvar_over_time',\n argTypes: [valueType.matrix],\n variadic: 0,\n returnType: valueType.vector,\n },\n sum_over_time: { name: 'sum_over_time', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n tan: { name: 'tan', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n tanh: { name: 'tanh', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n time: { name: 'time', argTypes: [], variadic: 0, returnType: valueType.scalar },\n timestamp: { name: 'timestamp', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n vector: { name: 'vector', argTypes: [valueType.scalar], variadic: 0, returnType: valueType.vector },\n year: { name: 'year', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n};\n"],"names":["valueType","functionSignatures","abs","name","argTypes","vector","variadic","returnType","absent","absent_over_time","matrix","acos","acosh","asin","asinh","atan","atanh","avg_over_time","ceil","changes","clamp","scalar","clamp_max","clamp_min","cos","cosh","count_over_time","day_of_month","day_of_week","day_of_year","days_in_month","deg","delta","deriv","exp","floor","histogram_avg","histogram_count","histogram_fraction","histogram_quantile","histogram_stddev","histogram_stdvar","histogram_sum","double_exponential_smoothing","hour","idelta","increase","irate","label_join","string","label_replace","last_over_time","ln","log10","log2","mad_over_time","max_over_time","min_over_time","minute","month","pi","predict_linear","present_over_time","quantile_over_time","rad","rate","resets","round","sgn","sin","sinh","sort","sort_by_label","sort_by_label_desc","sort_desc","sqrt","stddev_over_time","stdvar_over_time","sum_over_time","tan","tanh","time","timestamp","year"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EA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e;QAAE3E,MAAM;QAAiBC,UAAU;YAACJ,UAAUU,MAAM;SAAC;QAAEJ,UAAU;QAAGC,YAAYP,UAAUK,MAAM;IAAC;IAChH0E,KAAK;QAAE5E,MAAM;QAAOC,UAAU;YAACJ,UAAUK,MAAM;SAAC;QAAEC,UAAU;QAAGC,YAAYP,UAAUK,MAAM;IAAC;IAC5F2E,MAAM;QAAE7E,MAAM;QAAQC,UAAU;YAACJ,UAAUK,MAAM;SAAC;QAAEC,UAAU;QAAGC,YAAYP,UAAUK,MAAM;IAAC;IAC9F4E,MAAM;QAAE9E,MAAM;QAAQC,UAAU,EAAE;QAAEE,UAAU;QAAGC,YAAYP,UAAUqB,MAAM;IAAC;IAC9E6D,WAAW;QAAE/E,MAAM;QAAaC,UAAU;YAACJ,UAAUK,MAAM;SAAC;QAAEC,UAAU;QAAGC,YAAYP,UAAUK,MAAM;IAAC;IACxGA,QAAQ;QAAEF,MAAM;QAAUC,UAAU;YAACJ,UAAUqB,MAAM;SAAC;QAAEf,UAAU;QAAGC,YAAYP,UAAUK,MAAM;IAAC;IAClG8E,MAAM;QAAEhF,MAAM;QAAQC,UAAU;YAACJ,UAAUK,MAAM;SAAC;QAAEC,UAAU;QAAGC,YAAYP,UAAUK,MAAM;IAAC;AAChG,EAAE"}
1
+ {"version":3,"sources":["../../../../src/components/promql/functionSignatures.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Forked from https://github.com/prometheus/prometheus/blob/65f610353919b1c7b42d3776c3a95b68046a6bba/web/ui/mantine-ui/src/promql/functionSignatures.ts\n\nimport { valueType, Func } from './ast';\n\nexport const functionSignatures: Record<string, Func> = {\n abs: { name: 'abs', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n absent: { name: 'absent', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n absent_over_time: {\n name: 'absent_over_time',\n argTypes: [valueType.matrix],\n variadic: 0,\n returnType: valueType.vector,\n },\n acos: { name: 'acos', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n acosh: { name: 'acosh', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n asin: { name: 'asin', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n asinh: { name: 'asinh', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n atan: { name: 'atan', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n atanh: { name: 'atanh', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n avg_over_time: { name: 'avg_over_time', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n ceil: { name: 'ceil', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n changes: { name: 'changes', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n clamp: {\n name: 'clamp',\n argTypes: [valueType.vector, valueType.scalar, valueType.scalar],\n variadic: 0,\n returnType: valueType.vector,\n },\n clamp_max: {\n name: 'clamp_max',\n argTypes: [valueType.vector, valueType.scalar],\n variadic: 0,\n returnType: valueType.vector,\n },\n clamp_min: {\n name: 'clamp_min',\n argTypes: [valueType.vector, valueType.scalar],\n variadic: 0,\n returnType: valueType.vector,\n },\n cos: { name: 'cos', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n cosh: { name: 'cosh', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n count_over_time: { name: 'count_over_time', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n day_of_month: { name: 'day_of_month', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n day_of_week: { name: 'day_of_week', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n day_of_year: { name: 'day_of_year', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n days_in_month: { name: 'days_in_month', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n deg: { name: 'deg', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n delta: { name: 'delta', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n deriv: { name: 'deriv', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n exp: { name: 'exp', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n floor: { name: 'floor', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n histogram_avg: { name: 'histogram_avg', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n histogram_count: { name: 'histogram_count', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n histogram_fraction: {\n name: 'histogram_fraction',\n argTypes: [valueType.scalar, valueType.scalar, valueType.vector],\n variadic: 0,\n returnType: valueType.vector,\n },\n histogram_quantile: {\n name: 'histogram_quantile',\n argTypes: [valueType.scalar, valueType.vector],\n variadic: 0,\n returnType: valueType.vector,\n },\n histogram_stddev: {\n name: 'histogram_stddev',\n argTypes: [valueType.vector],\n variadic: 0,\n returnType: valueType.vector,\n },\n histogram_stdvar: {\n name: 'histogram_stdvar',\n argTypes: [valueType.vector],\n variadic: 0,\n returnType: valueType.vector,\n },\n histogram_sum: { name: 'histogram_sum', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n double_exponential_smoothing: {\n name: 'double_exponential_smoothing',\n argTypes: [valueType.matrix, valueType.scalar, valueType.scalar],\n variadic: 0,\n returnType: valueType.vector,\n },\n hour: { name: 'hour', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n idelta: { name: 'idelta', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n increase: { name: 'increase', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n irate: { name: 'irate', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n label_join: {\n name: 'label_join',\n argTypes: [valueType.vector, valueType.string, valueType.string, valueType.string],\n variadic: -1,\n returnType: valueType.vector,\n },\n label_replace: {\n name: 'label_replace',\n argTypes: [valueType.vector, valueType.string, valueType.string, valueType.string, valueType.string],\n variadic: 0,\n returnType: valueType.vector,\n },\n last_over_time: { name: 'last_over_time', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n ln: { name: 'ln', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n log10: { name: 'log10', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n log2: { name: 'log2', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n mad_over_time: { name: 'mad_over_time', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n max_over_time: { name: 'max_over_time', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n min_over_time: { name: 'min_over_time', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n minute: { name: 'minute', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n month: { name: 'month', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n pi: { name: 'pi', argTypes: [], variadic: 0, returnType: valueType.scalar },\n predict_linear: {\n name: 'predict_linear',\n argTypes: [valueType.matrix, valueType.scalar],\n variadic: 0,\n returnType: valueType.vector,\n },\n present_over_time: {\n name: 'present_over_time',\n argTypes: [valueType.matrix],\n variadic: 0,\n returnType: valueType.vector,\n },\n quantile_over_time: {\n name: 'quantile_over_time',\n argTypes: [valueType.scalar, valueType.matrix],\n variadic: 0,\n returnType: valueType.vector,\n },\n rad: { name: 'rad', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n rate: { name: 'rate', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n resets: { name: 'resets', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n round: { name: 'round', argTypes: [valueType.vector, valueType.scalar], variadic: 1, returnType: valueType.vector },\n scalar: { name: 'scalar', argTypes: [valueType.vector], variadic: 0, returnType: valueType.scalar },\n sgn: { name: 'sgn', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n sin: { name: 'sin', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n sinh: { name: 'sinh', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n sort: { name: 'sort', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n sort_by_label: {\n name: 'sort_by_label',\n argTypes: [valueType.vector, valueType.string],\n variadic: -1,\n returnType: valueType.vector,\n },\n sort_by_label_desc: {\n name: 'sort_by_label_desc',\n argTypes: [valueType.vector, valueType.string],\n variadic: -1,\n returnType: valueType.vector,\n },\n sort_desc: { name: 'sort_desc', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n sqrt: { name: 'sqrt', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n stddev_over_time: {\n name: 'stddev_over_time',\n argTypes: [valueType.matrix],\n variadic: 0,\n returnType: valueType.vector,\n },\n stdvar_over_time: {\n name: 'stdvar_over_time',\n argTypes: [valueType.matrix],\n variadic: 0,\n returnType: valueType.vector,\n },\n sum_over_time: { name: 'sum_over_time', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },\n tan: { name: 'tan', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n tanh: { name: 'tanh', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n time: { name: 'time', argTypes: [], variadic: 0, returnType: valueType.scalar },\n timestamp: { name: 'timestamp', argTypes: [valueType.vector], variadic: 0, returnType: valueType.vector },\n vector: { name: 'vector', argTypes: [valueType.scalar], variadic: 0, returnType: valueType.vector },\n year: { name: 'year', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },\n};\n"],"names":["valueType","functionSignatures","abs","name","argTypes","vector","variadic","returnType","absent","absent_over_time","matrix","acos","acosh","asin","asinh","atan","atanh","avg_over_time","ceil","changes","clamp","scalar","clamp_max","clamp_min","cos","cosh","count_over_time","day_of_month","day_of_week","day_of_year","days_in_month","deg","delta","deriv","exp","floor","histogram_avg","histogram_count","histogram_fraction","histogram_quantile","histogram_stddev","histogram_stdvar","histogram_sum","double_exponential_smoothing","hour","idelta","increase","irate","label_join","string","label_replace","last_over_time","ln","log10","log2","mad_over_time","max_over_time","min_over_time","minute","month","pi","predict_linear","present_over_time","quantile_over_time","rad","rate","resets","round","sgn","sin","sinh","sort","sort_by_label","sort_by_label_desc","sort_desc","sqrt","stddev_over_time","stdvar_over_time","sum_over_time","tan","tanh","time","timestamp","year"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,wJAAwJ;AAExJ,SAASA,SAAS,QAAc,QAAQ;AAExC,OAAO,MAAMC,qBAA2C;IACtDC,KAAK;QAAEC,MAAM;QAAOC,UAAU;YAACJ,UAAUK,MAAM;SAAC;QAAEC,UAAU;QAAGC,YAAYP,UAAUK,MAAM;IAAC;IAC5FG,QAAQ;QAAEL,MAAM;QAAUC,UAAU;YAACJ,UAAUK,MAAM;SAAC;QAAEC,UAAU;QAAGC,YAAYP,UAAUK,MAAM;IAAC;IAClGI,kBAAkB;QAChBN,MAAM;QACNC,UAAU;YAACJ,UAAUU,MAAM;SAAC;QAC5BJ,UAAU;QACVC,YAAYP,UAAUK,MAAM;IAC9B;IACAM,MAAM;QAAER,MAAM;QAAQC,UAAU;YAACJ,UAAUK,MAAM;SAAC;QAAEC,UAAU;QAAGC,YAAYP,UAAUK,MAAM;IAAC;IAC9FO,OAAO;QAAET,MAAM;QAASC,UAAU;YAACJ,UAAUK,MAAM;SAAC;QAAEC,UAAU;QAAGC,YAAYP,UAAUK,MAAM;IAAC;IAChGQ,MAAM;QAAEV,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,UAAU;QAAGC,YAAYP,UAAUK,MAAM;IAAC;AAChG,EAAE"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright 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
@@ -1 +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","oneToM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kBD,qBAAqBG,IAAI,CAAC,CAAC,GAC3D,IACJ;QAEJ;YACE,MAAM,IAAIsC,MAAM;IACpB;AACF;AAEA,eAAe7C,cAAc"}
1
+ {"version":3,"sources":["../../../../src/components/promql/serialize.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Forked from https://github.com/prometheus/prometheus/blob/65f610353919b1c7b42d3776c3a95b68046a6bba/web/ui/mantine-ui/src/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,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAA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}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright 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
@@ -1 +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,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,2IAA2I;AAE3I,SAAkBA,kBAAkB,EAAEC,QAAQ,QAAQ,QAAQ;AAE9D,MAAMC,kBAAkB;IACtB,CAACF,mBAAmBG,GAAG,CAAC,EAAE;IAC1B,CAACH,mBAAmBI,GAAG,CAAC,EAAE;IAC1B,CAACJ,mBAAmBK,GAAG,CAAC,EAAE;IAC1B,CAACL,mBAAmBM,GAAG,CAAC,EAAE;IAC1B,CAACN,mBAAmBO,GAAG,CAA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iC,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"}
1
+ {"version":3,"sources":["../../../../src/components/promql/utils.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Forked from https://github.com/prometheus/prometheus/blob/65f610353919b1c7b42d3776c3a95b68046a6bba/web/ui/mantine-ui/src/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,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,o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E,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"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright 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
@@ -1 +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"}
1
+ {"version":3,"sources":["../../../src/components/query.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\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,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,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 CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright 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
package/lib/env.d.js.map CHANGED
@@ -1 +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"}
1
+ {"version":3,"sources":["../../src/env.d.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/// <reference types=\"@rsbuild/core/types\" />\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,6CAA6C"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrometheusExplorer.d.ts","sourceRoot":"","sources":["../../../src/explore/PrometheusExplorer.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AA0ErC,wBAAgB,kBAAkB,IAAI,YAAY,CAoDjD"}
1
+ {"version":3,"file":"PrometheusExplorer.d.ts","sourceRoot":"","sources":["../../../src/explore/PrometheusExplorer.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AA0E/C,wBAAgB,kBAAkB,IAAI,YAAY,CAwDjD"}
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright 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
@@ -16,6 +16,7 @@ import { DataQueriesProvider, MultiQueryEditor, useSuggestedStepMs } from '@pers
16
16
  import { useExplorerManagerContext } from '@perses-dev/explore';
17
17
  import useResizeObserver from 'use-resize-observer';
18
18
  import { Panel } from '@perses-dev/dashboards';
19
+ import { useState } from 'react';
19
20
  import { DEFAULT_PROM } from '../model/prometheus-selectors';
20
21
  import { PrometheusMetricsFinder } from './PrometheusMetricsFinder';
21
22
  const PANEL_PREVIEW_HEIGHT = 700;
@@ -102,6 +103,7 @@ function MetricDataTable({ queries }) {
102
103
  }
103
104
  export function PrometheusExplorer() {
104
105
  const { data: { tab = 'table', queries = [], datasource = DEFAULT_PROM, filters = [], exploredMetric = undefined }, setData } = useExplorerManagerContext();
106
+ const [queryDefinitions, setQueryDefinitions] = useState(queries);
105
107
  return /*#__PURE__*/ _jsxs(Stack, {
106
108
  gap: 2,
107
109
  sx: {
@@ -143,11 +145,12 @@ export function PrometheusExplorer() {
143
145
  queryTypes: [
144
146
  'TimeSeriesQuery'
145
147
  ],
146
- onChange: (state)=>setData({
148
+ onChange: (state)=>setQueryDefinitions(state),
149
+ queries: queryDefinitions,
150
+ onQueryRun: ()=>setData({
147
151
  tab,
148
- queries: state
152
+ queries: queryDefinitions
149
153
  }),
150
- queries: queries,
151
154
  filteredQueryPlugins: FILTERED_QUERY_PLUGINS
152
155
  }),
153
156
  /*#__PURE__*/ _jsx(MetricDataTable, {
@@ -161,11 +164,12 @@ export function PrometheusExplorer() {
161
164
  queryTypes: [
162
165
  'TimeSeriesQuery'
163
166
  ],
164
- onChange: (state)=>setData({
167
+ onChange: (state)=>setQueryDefinitions(state),
168
+ queries: queryDefinitions,
169
+ onQueryRun: ()=>setData({
165
170
  tab,
166
- queries: state
171
+ queries: queryDefinitions
167
172
  }),
168
- queries: queries,
169
173
  filteredQueryPlugins: FILTERED_QUERY_PLUGINS
170
174
  }),
171
175
  /*#__PURE__*/ _jsx(TimeSeriesPanel, {
@@ -1 +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;\nconst FILTERED_QUERY_PLUGINS = ['PrometheusTimeSeriesQuery'];\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 filteredQueryPlugins={FILTERED_QUERY_PLUGINS}\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 filteredQueryPlugins={FILTERED_QUERY_PLUGINS}\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","FILTERED_QUERY_PLUGINS","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","filteredQueryPlugins"],"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;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GAAGW,KAAK;gCAAC;4BAC7CH,OAAO;gCAAEP;gCAAYC;gCAASC;4BAAe;;;;;;;AAO3D"}
1
+ {"version":3,"sources":["../../../src/explore/PrometheusExplorer.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\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, useState } 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;\nconst FILTERED_QUERY_PLUGINS = ['PrometheusTimeSeriesQuery'];\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 const [queryDefinitions, setQueryDefinitions] = useState<QueryDefinition[]>(queries);\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) => setQueryDefinitions(state)}\n queries={queryDefinitions}\n onQueryRun={() => setData({ tab, queries: queryDefinitions })}\n filteredQueryPlugins={FILTERED_QUERY_PLUGINS}\n />\n <MetricDataTable queries={queries} />\n </Stack>\n )}\n {tab === 'graph' && (\n <Stack>\n <MultiQueryEditor\n queryTypes={['TimeSeriesQuery']}\n onChange={(state) => setQueryDefinitions(state)}\n queries={queryDefinitions}\n onQueryRun={() => setData({ tab, queries: queryDefinitions })}\n filteredQueryPlugins={FILTERED_QUERY_PLUGINS}\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","useState","DEFAULT_PROM","PrometheusMetricsFinder","PANEL_PREVIEW_HEIGHT","FILTERED_QUERY_PLUGINS","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","queryDefinitions","setQueryDefinitions","gap","sx","value","onChange","_","state","variant","borderBottom","borderColor","label","queryTypes","onQueryRun","filteredQueryPlugins"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;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;AAC/C,SAAuBC,QAAQ,QAAQ,QAAQ;AAC/C,SAASC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CACTa,YAAY,IAAMd,QAAQ;wCAAEL;wCAAKvB,SAAS6B;oCAAiB;gCAC3Dc,sBAAsB7C;;0CAExB,KAACC;gCAAgBC,SAASA;;;;oBAG7BuB,QAAQ,0BACP,KAACtC;kCACC,cAAA,KAACW;4BACCsC,UAAU,CAACE,QAAUR,QAAQ;oCAAEL;oCAAK,GAAGa,KAAK;gCAAC;4BAC7CH,OAAO;gCAAET;gCAAYC;gCAASC;4BAAe;;;;;;;AAO3D"}
@@ -1,4 +1,5 @@
1
- // Copyright 2024 The Perses Authors
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ // Copyright The Perses Authors
2
3
  // Licensed under the Apache License, Version 2.0 (the "License");
3
4
  // you may not use this file except in compliance with the License.
4
5
  // You may obtain a copy of the License at
@@ -10,7 +11,6 @@
10
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
12
  // See the License for the specific language governing permissions and
12
13
  // limitations under the License.
13
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
14
  import { Button, Checkbox, CircularProgress, FormControlLabel, IconButton, InputAdornment, Menu, MenuItem, Stack, TextField, useMediaQuery, useTheme } from '@mui/material';
15
15
  import { Fuzzy } from '@nexucis/fuzzy';
16
16
  import { useExplorerQueryParams } from '@perses-dev/explore';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.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 {\n Button,\n Checkbox,\n CircularProgress,\n FormControlLabel,\n IconButton,\n InputAdornment,\n Menu,\n MenuItem,\n Stack,\n StackProps,\n TextField,\n useMediaQuery,\n useTheme,\n} from '@mui/material';\nimport { Fuzzy, FuzzyMatchingInterval } from '@nexucis/fuzzy';\nimport { DatasourceSelector } from '@perses-dev/core';\nimport { useExplorerQueryParams } from '@perses-dev/explore';\nimport ArrowLeftIcon from 'mdi-material-ui/ArrowLeft';\nimport CogIcon from 'mdi-material-ui/Cog';\nimport Magnify from 'mdi-material-ui/Magnify';\nimport { MouseEvent, ReactElement, useMemo, useState } from 'react';\nimport { Link as RouterLink } from 'react-router-dom';\nimport { DEFAULT_PROM } from '../../model';\nimport { MetricList } from './display/list/MetricList';\nimport { FinderFilters } from './filter/FinderFilters';\nimport { MetricOverview } from './overview/MetricOverview';\nimport { LabelFilter, Settings } from './types';\nimport { useLabelValues } from './utils';\n\nconst PERSES_METRICS_FINDER_SETTINGS = 'PERSES_METRICS_FINDER_SETTINGS';\n\nexport interface SettingsMenuProps {\n value: Settings;\n onChange: (value: Settings) => void;\n}\n\nexport function SettingsMenu({ value, onChange }: SettingsMenuProps): ReactElement {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n const open = Boolean(anchorEl);\n const handleClick = (event: MouseEvent<HTMLButtonElement>): void => {\n setAnchorEl(event.currentTarget);\n };\n const handleClose = (): void => {\n setAnchorEl(null);\n };\n\n return (\n <>\n <IconButton aria-label=\"settings\" size=\"large\" onClick={handleClick}>\n <CogIcon />\n </IconButton>\n <Menu id=\"finder-settings-menu\" anchorEl={anchorEl} open={open} onClose={handleClose}>\n <MenuItem onClick={(e) => e.preventDefault()}>\n <FormControlLabel\n control={<Checkbox />}\n label=\"Enable Metadata\"\n checked={value.isMetadataEnabled}\n onClick={() => onChange({ ...value, isMetadataEnabled: !value.isMetadataEnabled })}\n />\n </MenuItem>\n <MenuItem onClick={(e) => e.preventDefault()}>\n <FormControlLabel\n control={<Checkbox />}\n label=\"Enable Time Series Chart\"\n checked={value.isPanelEnabled}\n onClick={() => onChange({ ...value, isPanelEnabled: !value.isPanelEnabled })}\n />\n </MenuItem>\n </Menu>\n </>\n );\n}\n\nexport interface MetricNameExplorerProps extends StackProps {\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n isMetadataEnabled?: boolean;\n onExplore?: (metricName: string) => void;\n}\n\nexport function MetricNameExplorer({\n datasource,\n filters,\n isMetadataEnabled,\n onExplore,\n ...props\n}: MetricNameExplorerProps): ReactElement {\n const { data, isLoading, error } = useLabelValues('__name__', filters, datasource);\n const [search, setSearch] = useState('');\n const fuzzy = useMemo(() => new Fuzzy({ includeMatches: true, excludedChars: [' '] }), []);\n\n const filteredResults: Array<{ original: string; intervals?: FuzzyMatchingInterval[] }> | undefined = useMemo(() => {\n if (search && data?.data) {\n return fuzzy.filter(search, data.data).sort((a, b) => b.score - a.score);\n }\n return undefined;\n }, [data, fuzzy, search]);\n\n if (error) {\n return <Stack width=\"100%\">Error: {error.message}</Stack>;\n }\n\n if (isLoading) {\n return (\n <Stack width=\"100%\" sx={{ alignItems: 'center', justifyContent: 'center' }}>\n <CircularProgress />\n </Stack>\n );\n }\n\n return (\n <Stack {...props}>\n <TextField\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n placeholder=\"Search metric name...\"\n slotProps={{\n input: {\n startAdornment: (\n <InputAdornment position=\"start\">\n <Magnify />\n </InputAdornment>\n ),\n },\n }}\n />\n <MetricList\n metricNames={data?.data ?? []}\n filteredResults={filteredResults}\n datasource={datasource}\n filters={filters}\n isMetadataEnabled={isMetadataEnabled}\n onExplore={onExplore}\n />\n </Stack>\n );\n}\n\nexport interface PrometheusMetricsFinderProps extends Omit<StackProps, 'onChange'> {\n value: {\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n exploredMetric?: string;\n };\n onChange: ({\n datasource,\n filters,\n exploredMetric,\n }: {\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n exploredMetric?: string;\n }) => void;\n onExplore?: (metricName: string) => void;\n}\n\nexport function PrometheusMetricsFinder({\n value: { datasource = DEFAULT_PROM, filters = [], exploredMetric },\n onChange,\n onExplore,\n ...props\n}: PrometheusMetricsFinderProps): ReactElement {\n const settingsStored = localStorage.getItem(PERSES_METRICS_FINDER_SETTINGS);\n const [settings, setSettings] = useState<Settings>(\n settingsStored ? JSON.parse(settingsStored) : { isMetadataEnabled: true }\n );\n\n function handleSettingsUpdate(value: Settings): void {\n setSettings(value);\n localStorage.setItem(PERSES_METRICS_FINDER_SETTINGS, JSON.stringify(value));\n }\n\n const isMobileSize = useMediaQuery(useTheme().breakpoints.down('md'));\n\n // Remove duplicated filters and filters without label or labelValues\n const filteredFilters: LabelFilter[] = useMemo(() => {\n return filters.filter(({ label, labelValues }) => label && labelValues?.[0]);\n }, [filters]);\n\n const searchParams = useExplorerQueryParams({\n data: { tab: 'finder', datasource, filters, exploredMetric: undefined },\n });\n\n function setDatasource(value: DatasourceSelector): void {\n onChange({ datasource: value, filters, exploredMetric });\n }\n\n function setFilters(value: LabelFilter[]): void {\n onChange({ datasource, filters: value, exploredMetric });\n }\n\n return (\n <Stack {...props} gap={1}>\n <Stack direction={isMobileSize ? 'column' : 'row'} gap={2} justifyContent=\"space-between\">\n <FinderFilters\n datasource={datasource ?? DEFAULT_PROM}\n filters={filters ?? []}\n filteredFilters={filteredFilters}\n onDatasourceChange={setDatasource}\n onFiltersChange={setFilters}\n />\n <Stack direction=\"row\" gap={1} alignItems=\"center\">\n {exploredMetric && (\n <Button\n variant=\"contained\"\n aria-label=\"back to metric explorer\"\n startIcon={<ArrowLeftIcon />}\n component={RouterLink}\n to={`?${searchParams}`}\n >\n Back\n </Button>\n )}\n <Stack\n direction=\"row\"\n sx={{ width: isMobileSize ? '100%' : 'unset' }}\n justifyContent={isMobileSize ? 'end' : 'unset'}\n alignItems=\"center\"\n >\n <SettingsMenu value={settings} onChange={handleSettingsUpdate} />\n </Stack>\n </Stack>\n </Stack>\n {exploredMetric ? (\n <MetricOverview\n metricName={exploredMetric}\n datasource={datasource ?? DEFAULT_PROM}\n filters={filteredFilters}\n isMetadataEnabled={settings.isMetadataEnabled}\n isPanelEnabled={settings.isPanelEnabled}\n onFiltersChange={setFilters}\n onExplore={onExplore}\n />\n ) : (\n <MetricNameExplorer\n datasource={datasource ?? DEFAULT_PROM}\n filters={filteredFilters}\n isMetadataEnabled={settings.isMetadataEnabled}\n onExplore={onExplore}\n />\n )}\n </Stack>\n );\n}\n"],"names":["Button","Checkbox","CircularProgress","FormControlLabel","IconButton","InputAdornment","Menu","MenuItem","Stack","TextField","useMediaQuery","useTheme","Fuzzy","useExplorerQueryParams","ArrowLeftIcon","CogIcon","Magnify","useMemo","useState","Link","RouterLink","DEFAULT_PROM","MetricList","FinderFilters","MetricOverview","useLabelValues","PERSES_METRICS_FINDER_SETTINGS","SettingsMenu","value","onChange","anchorEl","setAnchorEl","open","Boolean","handleClick","event","currentTarget","handleClose","aria-label","size","onClick","id","onClose","e","preventDefault","control","label","checked","isMetadataEnabled","isPanelEnabled","MetricNameExplorer","datasource","filters","onExplore","props","data","isLoading","error","search","setSearch","fuzzy","includeMatches","excludedChars","filteredResults","filter","sort","a","b","score","undefined","width","message","sx","alignItems","justifyContent","target","placeholder","slotProps","input","startAdornment","position","metricNames","PrometheusMetricsFinder","exploredMetric","settingsStored","localStorage","getItem","settings","setSettings","JSON","parse","handleSettingsUpdate","setItem","stringify","isMobileSize","breakpoints","down","filteredFilters","labelValues","searchParams","tab","setDatasource","setFilters","gap","direction","onDatasourceChange","onFiltersChange","variant","startIcon","component","to","metricName"],"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,SACEA,MAAM,EACNC,QAAQ,EACRC,gBAAgB,EAChBC,gBAAgB,EAChBC,UAAU,E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eAAe,WAAW;gBAAOS,KAAK;gBAAG7B,gBAAe;;kCACxE,KAACnD;wBACC4B,YAAYA,cAAc9B;wBAC1B+B,SAASA,WAAW,EAAE;wBACtB6C,iBAAiBA;wBACjBQ,oBAAoBJ;wBACpBK,iBAAiBJ;;kCAEnB,MAAC9F;wBAAMgG,WAAU;wBAAMD,KAAK;wBAAG9B,YAAW;;4BACvCU,gCACC,KAACnF;gCACC2G,SAAQ;gCACRrE,cAAW;gCACXsE,yBAAW,KAAC9F;gCACZ+F,WAAWzF;gCACX0F,IAAI,CAAC,CAAC,EAAEX,cAAc;0CACvB;;0CAIH,KAAC3F;gCACCgG,WAAU;gCACVhC,IAAI;oCAAEF,OAAOwB,eAAe,SAAS;gCAAQ;gCAC7CpB,gBAAgBoB,eAAe,QAAQ;gCACvCrB,YAAW;0CAEX,cAAA,KAAC9C;oCAAaC,OAAO2D;oCAAU1D,UAAU8D;;;;;;;YAI9CR,+BACC,KAAC3D;gBACCuF,YAAY5B;gBACZhC,YAAYA,cAAc9B;gBAC1B+B,SAAS6C;gBACTjD,mBAAmBuC,SAASvC,iBAAiB;gBAC7CC,gBAAgBsC,SAAStC,cAAc;gBACvCyD,iBAAiBJ;gBACjBjD,WAAWA;+BAGb,KAACH;gBACCC,YAAYA,cAAc9B;gBAC1B+B,SAAS6C;gBACTjD,mBAAmBuC,SAASvC,iBAAiB;gBAC7CK,WAAWA;;;;AAKrB"}
1
+ {"version":3,"sources":["../../../../src/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {\n Button,\n Checkbox,\n CircularProgress,\n FormControlLabel,\n IconButton,\n InputAdornment,\n Menu,\n MenuItem,\n Stack,\n StackProps,\n TextField,\n useMediaQuery,\n useTheme,\n} from '@mui/material';\nimport { Fuzzy, FuzzyMatchingInterval } from '@nexucis/fuzzy';\nimport { DatasourceSelector } from '@perses-dev/core';\nimport { useExplorerQueryParams } from '@perses-dev/explore';\nimport ArrowLeftIcon from 'mdi-material-ui/ArrowLeft';\nimport CogIcon from 'mdi-material-ui/Cog';\nimport Magnify from 'mdi-material-ui/Magnify';\nimport { MouseEvent, ReactElement, useMemo, useState } from 'react';\nimport { Link as RouterLink } from 'react-router-dom';\nimport { DEFAULT_PROM } from '../../model';\nimport { MetricList } from './display/list/MetricList';\nimport { FinderFilters } from './filter/FinderFilters';\nimport { MetricOverview } from './overview/MetricOverview';\nimport { LabelFilter, Settings } from './types';\nimport { useLabelValues } from './utils';\n\nconst PERSES_METRICS_FINDER_SETTINGS = 'PERSES_METRICS_FINDER_SETTINGS';\n\nexport interface SettingsMenuProps {\n value: Settings;\n onChange: (value: Settings) => void;\n}\n\nexport function SettingsMenu({ value, onChange }: SettingsMenuProps): ReactElement {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n const open = Boolean(anchorEl);\n const handleClick = (event: MouseEvent<HTMLButtonElement>): void => {\n setAnchorEl(event.currentTarget);\n };\n const handleClose = (): void => {\n setAnchorEl(null);\n };\n\n return (\n <>\n <IconButton aria-label=\"settings\" size=\"large\" onClick={handleClick}>\n <CogIcon />\n </IconButton>\n <Menu id=\"finder-settings-menu\" anchorEl={anchorEl} open={open} onClose={handleClose}>\n <MenuItem onClick={(e) => e.preventDefault()}>\n <FormControlLabel\n control={<Checkbox />}\n label=\"Enable Metadata\"\n checked={value.isMetadataEnabled}\n onClick={() => onChange({ ...value, isMetadataEnabled: !value.isMetadataEnabled })}\n />\n </MenuItem>\n <MenuItem onClick={(e) => e.preventDefault()}>\n <FormControlLabel\n control={<Checkbox />}\n label=\"Enable Time Series Chart\"\n checked={value.isPanelEnabled}\n onClick={() => onChange({ ...value, isPanelEnabled: !value.isPanelEnabled })}\n />\n </MenuItem>\n </Menu>\n </>\n );\n}\n\nexport interface MetricNameExplorerProps extends StackProps {\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n isMetadataEnabled?: boolean;\n onExplore?: (metricName: string) => void;\n}\n\nexport function MetricNameExplorer({\n datasource,\n filters,\n isMetadataEnabled,\n onExplore,\n ...props\n}: MetricNameExplorerProps): ReactElement {\n const { data, isLoading, error } = useLabelValues('__name__', filters, datasource);\n const [search, setSearch] = useState('');\n const fuzzy = useMemo(() => new Fuzzy({ includeMatches: true, excludedChars: [' '] }), []);\n\n const filteredResults: Array<{ original: string; intervals?: FuzzyMatchingInterval[] }> | undefined = useMemo(() => {\n if (search && data?.data) {\n return fuzzy.filter(search, data.data).sort((a, b) => b.score - a.score);\n }\n return undefined;\n }, [data, fuzzy, search]);\n\n if (error) {\n return <Stack width=\"100%\">Error: {error.message}</Stack>;\n }\n\n if (isLoading) {\n return (\n <Stack width=\"100%\" sx={{ alignItems: 'center', justifyContent: 'center' }}>\n <CircularProgress />\n </Stack>\n );\n }\n\n return (\n <Stack {...props}>\n <TextField\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n placeholder=\"Search metric name...\"\n slotProps={{\n input: {\n startAdornment: (\n <InputAdornment position=\"start\">\n <Magnify />\n </InputAdornment>\n ),\n },\n }}\n />\n <MetricList\n metricNames={data?.data ?? []}\n filteredResults={filteredResults}\n datasource={datasource}\n filters={filters}\n isMetadataEnabled={isMetadataEnabled}\n onExplore={onExplore}\n />\n </Stack>\n );\n}\n\nexport interface PrometheusMetricsFinderProps extends Omit<StackProps, 'onChange'> {\n value: {\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n exploredMetric?: string;\n };\n onChange: ({\n datasource,\n filters,\n exploredMetric,\n }: {\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n exploredMetric?: string;\n }) => void;\n onExplore?: (metricName: string) => void;\n}\n\nexport function PrometheusMetricsFinder({\n value: { datasource = DEFAULT_PROM, filters = [], exploredMetric },\n onChange,\n onExplore,\n ...props\n}: PrometheusMetricsFinderProps): ReactElement {\n const settingsStored = localStorage.getItem(PERSES_METRICS_FINDER_SETTINGS);\n const [settings, setSettings] = useState<Settings>(\n settingsStored ? JSON.parse(settingsStored) : { isMetadataEnabled: true }\n );\n\n function handleSettingsUpdate(value: Settings): void {\n setSettings(value);\n localStorage.setItem(PERSES_METRICS_FINDER_SETTINGS, JSON.stringify(value));\n }\n\n const isMobileSize = useMediaQuery(useTheme().breakpoints.down('md'));\n\n // Remove duplicated filters and filters without label or labelValues\n const filteredFilters: LabelFilter[] = useMemo(() => {\n return filters.filter(({ label, labelValues }) => label && labelValues?.[0]);\n }, [filters]);\n\n const searchParams = useExplorerQueryParams({\n data: { tab: 'finder', datasource, filters, exploredMetric: undefined },\n });\n\n function setDatasource(value: DatasourceSelector): void {\n onChange({ datasource: value, filters, exploredMetric });\n }\n\n function setFilters(value: LabelFilter[]): void {\n onChange({ datasource, filters: value, exploredMetric });\n }\n\n return (\n <Stack {...props} gap={1}>\n <Stack direction={isMobileSize ? 'column' : 'row'} gap={2} justifyContent=\"space-between\">\n <FinderFilters\n datasource={datasource ?? DEFAULT_PROM}\n filters={filters ?? []}\n filteredFilters={filteredFilters}\n onDatasourceChange={setDatasource}\n onFiltersChange={setFilters}\n />\n <Stack direction=\"row\" gap={1} alignItems=\"center\">\n {exploredMetric && (\n <Button\n variant=\"contained\"\n aria-label=\"back to metric explorer\"\n startIcon={<ArrowLeftIcon />}\n component={RouterLink}\n to={`?${searchParams}`}\n >\n Back\n </Button>\n )}\n <Stack\n direction=\"row\"\n sx={{ width: isMobileSize ? '100%' : 'unset' }}\n justifyContent={isMobileSize ? 'end' : 'unset'}\n alignItems=\"center\"\n >\n <SettingsMenu value={settings} onChange={handleSettingsUpdate} />\n </Stack>\n </Stack>\n </Stack>\n {exploredMetric ? (\n <MetricOverview\n metricName={exploredMetric}\n datasource={datasource ?? DEFAULT_PROM}\n filters={filteredFilters}\n isMetadataEnabled={settings.isMetadataEnabled}\n isPanelEnabled={settings.isPanelEnabled}\n onFiltersChange={setFilters}\n onExplore={onExplore}\n />\n ) : (\n <MetricNameExplorer\n datasource={datasource ?? DEFAULT_PROM}\n filters={filteredFilters}\n isMetadataEnabled={settings.isMetadataEnabled}\n onExplore={onExplore}\n />\n )}\n </Stack>\n );\n}\n"],"names":["Button","Checkbox","CircularProgress","FormControlLabel","IconButton","InputAdornment","Menu","MenuItem","Stack","TextField","useMediaQuery","useTheme","Fuzzy","useExplorerQueryParams","ArrowLeftIcon","CogIcon","Magnify","useMemo","useState","Link","RouterLink","DEFAULT_PROM","MetricList","FinderFilters","MetricOverview","useLabelValues","PERSES_METRICS_FINDER_SETTINGS","SettingsMenu","value","onChange","anchorEl","setAnchorEl","open","Boolean","handleClick","event","currentTarget","handleClose","aria-label","size","onClick","id","onClose","e","preventDefault","control","label","checked","isMetadataEnabled","isPanelEnabled","MetricNameExplorer","datasource","filters","onExplore","props","data","isLoading","error","search","setSearch","fuzzy","includeMatches","excludedChars","filteredResults","filter","sort","a","b","score","undefined","width","message","sx","alignItems","justifyContent","target","placeholder","slotProps","input","startAdornment","position","metricNames","PrometheusMetricsFinder","exploredMetric","settingsStored","localStorage","getItem","settings","setSettings","JSON","parse","handleSettingsUpdate","setItem","stringify","isMobileSize","breakpoints","down","filteredFilters","labelValues","searchParams","tab","setDatasource","setFilters","gap","direction","onDatasourceChange","onFiltersChange","variant","startIcon","component","to","metricName"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SACEA,MAAM,EACNC,QAAQ,EACRC,gBAAgB,EAChBC,gBAAgB,EACh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gG,WAAWV,eAAe,WAAW;gBAAOS,KAAK;gBAAG7B,gBAAe;;kCACxE,KAACnD;wBACC4B,YAAYA,cAAc9B;wBAC1B+B,SAASA,WAAW,EAAE;wBACtB6C,iBAAiBA;wBACjBQ,oBAAoBJ;wBACpBK,iBAAiBJ;;kCAEnB,MAAC9F;wBAAMgG,WAAU;wBAAMD,KAAK;wBAAG9B,YAAW;;4BACvCU,gCACC,KAACnF;gCACC2G,SAAQ;gCACRrE,cAAW;gCACXsE,yBAAW,KAAC9F;gCACZ+F,WAAWzF;gCACX0F,IAAI,CAAC,CAAC,EAAEX,cAAc;0CACvB;;0CAIH,KAAC3F;gCACCgG,WAAU;gCACVhC,IAAI;oCAAEF,OAAOwB,eAAe,SAAS;gCAAQ;gCAC7CpB,gBAAgBoB,eAAe,QAAQ;gCACvCrB,YAAW;0CAEX,cAAA,KAAC9C;oCAAaC,OAAO2D;oCAAU1D,UAAU8D;;;;;;;YAI9CR,+BACC,KAAC3D;gBACCuF,YAAY5B;gBACZhC,YAAYA,cAAc9B;gBAC1B+B,SAAS6C;gBACTjD,mBAAmBuC,SAASvC,iBAAiB;gBAC7CC,gBAAgBsC,SAAStC,cAAc;gBACvCyD,iBAAiBJ;gBACjBjD,WAAWA;+BAGb,KAACH;gBACCC,YAAYA,cAAc9B;gBAC1B+B,SAAS6C;gBACTjD,mBAAmBuC,SAASvC,iBAAiB;gBAC7CK,WAAWA;;;;AAKrB"}
@@ -1,4 +1,5 @@
1
- // Copyright 2024 The Perses Authors
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // Copyright The Perses Authors
2
3
  // Licensed under the Apache License, Version 2.0 (the "License");
3
4
  // you may not use this file except in compliance with the License.
4
5
  // You may obtain a copy of the License at
@@ -10,7 +11,6 @@
10
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
12
  // See the License for the specific language governing permissions and
12
13
  // limitations under the License.
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { Chip } from '@mui/material';
15
15
  export function MetricChip({ label, ...props }) {
16
16
  if (label === 'gauge') {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/explore/PrometheusMetricsFinder/display/MetricChip.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 { Chip, ChipProps } from '@mui/material';\nimport { ReactElement } from 'react';\n\nexport function MetricChip({ label, ...props }: ChipProps): ReactElement {\n if (label === 'gauge') {\n return <Chip label={label} color=\"success\" {...props} />;\n }\n if (label === 'counter') {\n return <Chip label={label} color=\"primary\" {...props} />;\n }\n if (label === 'histogram') {\n return <Chip label={label} color=\"warning\" {...props} />;\n }\n if (label === 'summary') {\n return <Chip label={label} color=\"secondary\" {...props} />;\n }\n\n return <Chip label={label} sx={{ fontStyle: label === 'unknown' ? 'italic' : 'initial' }} {...props} />;\n}\n"],"names":["Chip","MetricChip","label","props","color","sx","fontStyle"],"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,IAAI,QAAmB,gBAAgB;AAGhD,OAAO,SAASC,WAAW,EAAEC,KAAK,EAAE,GAAGC,OAAkB;IACvD,IAAID,UAAU,SAAS;QACrB,qBAAO,KAACF;YAAKE,OAAOA;YAAOE,OAAM;YAAW,GAAGD,KAAK;;IACtD;IACA,IAAID,UAAU,WAAW;QACvB,qBAAO,KAACF;YAAKE,OAAOA;YAAOE,OAAM;YAAW,GAAGD,KAAK;;IACtD;IACA,IAAID,UAAU,aAAa;QACzB,qBAAO,KAACF;YAAKE,OAAOA;YAAOE,OAAM;YAAW,GAAGD,KAAK;;IACtD;IACA,IAAID,UAAU,WAAW;QACvB,qBAAO,KAACF;YAAKE,OAAOA;YAAOE,OAAM;YAAa,GAAGD,KAAK;;IACxD;IAEA,qBAAO,KAACH;QAAKE,OAAOA;QAAOG,IAAI;YAAEC,WAAWJ,UAAU,YAAY,WAAW;QAAU;QAAI,GAAGC,KAAK;;AACrG"}
1
+ {"version":3,"sources":["../../../../../src/explore/PrometheusMetricsFinder/display/MetricChip.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Chip, ChipProps } from '@mui/material';\nimport { ReactElement } from 'react';\n\nexport function MetricChip({ label, ...props }: ChipProps): ReactElement {\n if (label === 'gauge') {\n return <Chip label={label} color=\"success\" {...props} />;\n }\n if (label === 'counter') {\n return <Chip label={label} color=\"primary\" {...props} />;\n }\n if (label === 'histogram') {\n return <Chip label={label} color=\"warning\" {...props} />;\n }\n if (label === 'summary') {\n return <Chip label={label} color=\"secondary\" {...props} />;\n }\n\n return <Chip label={label} sx={{ fontStyle: label === 'unknown' ? 'italic' : 'initial' }} {...props} />;\n}\n"],"names":["Chip","MetricChip","label","props","color","sx","fontStyle"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,IAAI,QAAmB,gBAAgB;AAGhD,OAAO,SAASC,WAAW,EAAEC,KAAK,EAAE,GAAGC,OAAkB;IACvD,IAAID,UAAU,SAAS;QACrB,qBAAO,KAACF;YAAKE,OAAOA;YAAOE,OAAM;YAAW,GAAGD,KAAK;;IACtD;IACA,IAAID,UAAU,WAAW;QACvB,qBAAO,KAACF;YAAKE,OAAOA;YAAOE,OAAM;YAAW,GAAGD,KAAK;;IACtD;IACA,IAAID,UAAU,aAAa;QACzB,qBAAO,KAACF;YAAKE,OAAOA;YAAOE,OAAM;YAAW,GAAGD,KAAK;;IACtD;IACA,IAAID,UAAU,WAAW;QACvB,qBAAO,KAACF;YAAKE,OAAOA;YAAOE,OAAM;YAAa,GAAGD,KAAK;;IACxD;IAEA,qBAAO,KAACH;QAAKE,OAAOA;QAAOG,IAAI;YAAEC,WAAWJ,UAAU,YAAY,WAAW;QAAU;QAAI,GAAGC,KAAK;;AACrG"}
@@ -1,4 +1,5 @@
1
- // Copyright 2024 The Perses Authors
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ // Copyright The Perses Authors
2
3
  // Licensed under the Apache License, Version 2.0 (the "License");
3
4
  // you may not use this file except in compliance with the License.
4
5
  // You may obtain a copy of the License at
@@ -10,7 +11,6 @@
10
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
12
  // See the License for the specific language governing permissions and
12
13
  // limitations under the License.
13
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
14
  import { Button, Divider, Skeleton, Stack, TableCell, Typography } from '@mui/material';
15
15
  import { Fuzzy } from '@nexucis/fuzzy';
16
16
  import { useExplorerQueryParams } from '@perses-dev/explore';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/explore/PrometheusMetricsFinder/display/list/MetricList.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 { Button, Divider, Skeleton, Stack, StackProps, TableCell, Typography } from '@mui/material';\nimport { Fuzzy, FuzzyMatchingInterval } from '@nexucis/fuzzy';\nimport { DatasourceSelector } from '@perses-dev/core';\nimport { useExplorerQueryParams } from '@perses-dev/explore';\nimport CompassIcon from 'mdi-material-ui/Compass';\nimport { ReactElement, ReactNode, useMemo } from 'react';\nimport { Link as RouterLink } from 'react-router-dom';\nimport { TableVirtuoso } from 'react-virtuoso';\nimport { LabelFilter } from '../../types';\nimport { useMetricMetadata } from '../../utils';\nimport { MetricChip } from '../MetricChip';\n\nexport interface MetricRowProps {\n children?: ReactNode;\n metricName: string;\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n isMetadataEnabled?: boolean;\n onExplore?: (metricName: string) => void;\n}\n\nexport function MetricRow({\n children,\n metricName,\n datasource,\n filters,\n isMetadataEnabled,\n onExplore,\n}: MetricRowProps): ReactElement {\n const { metadata, isLoading } = useMetricMetadata(metricName, datasource, isMetadataEnabled);\n\n const searchParams = useExplorerQueryParams({\n data: { tab: 'finder', datasource, filters, exploredMetric: metricName },\n });\n\n return (\n <>\n <TableCell style={{ width: '300px' }}>\n <Typography sx={{ fontFamily: 'monospace' }}>{children ?? metricName}</Typography>\n </TableCell>\n\n <TableCell style={{ width: 115, textAlign: 'center' }}>\n {isMetadataEnabled && isLoading ? (\n <Skeleton variant=\"rounded\" width={75} />\n ) : (\n <MetricChip label={metadata?.type ?? 'unknown'} />\n )}\n </TableCell>\n <TableCell style={{ width: '100%' }}>\n {isMetadataEnabled && isLoading ? (\n <Skeleton variant=\"text\" width={180} />\n ) : (\n <Typography sx={{ fontStyle: metadata?.help ? 'initial' : 'italic', minWidth: '30vw' }}>\n {metadata ? metadata.help : 'unknown'}\n </Typography>\n )}\n </TableCell>\n <TableCell style={{ width: 140 }}>\n <Button\n aria-label={`explore metric ${metricName}`}\n variant=\"contained\"\n startIcon={<CompassIcon />}\n style={{ textWrap: 'nowrap' }}\n onClick={() => onExplore?.(metricName)}\n component={RouterLink}\n to={`?${searchParams}`}\n >\n Explore\n </Button>\n </TableCell>\n </>\n );\n}\n\nexport interface MetricListProps extends StackProps {\n metricNames: string[];\n filteredResults?: Array<{ original: string; intervals?: FuzzyMatchingInterval[] }>;\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n isMetadataEnabled?: boolean;\n onExplore?: (metricName: string) => void;\n}\n\nexport function MetricList({\n metricNames,\n filteredResults,\n datasource,\n filters,\n isMetadataEnabled,\n onExplore,\n ...props\n}: MetricListProps): ReactElement {\n const fuzzy = new Fuzzy();\n\n const fuzzyMetrics: Array<{ original: string; intervals?: FuzzyMatchingInterval[] }> = useMemo(() => {\n if (filteredResults) {\n return filteredResults;\n }\n return metricNames.map((metricName) => ({ original: metricName }));\n }, [filteredResults, metricNames]);\n\n return (\n <Stack gap={2} width=\"100%\" divider={<Divider orientation=\"horizontal\" flexItem />} {...props}>\n <TableVirtuoso\n style={{ height: '70vh', width: '100%' }}\n totalCount={fuzzyMetrics.length}\n itemContent={(index) => (\n <MetricRow\n metricName={fuzzyMetrics[index]!.original}\n datasource={datasource}\n filters={filters}\n isMetadataEnabled={isMetadataEnabled}\n onExplore={onExplore}\n >\n <span\n dangerouslySetInnerHTML={{\n __html: fuzzy.render(fuzzyMetrics[index]!.original, fuzzyMetrics[index]!.intervals ?? [], {\n pre: '<strong style=\"color:darkorange\">',\n post: '</strong>',\n escapeHTML: true,\n }),\n }}\n />\n </MetricRow>\n )}\n />\n <Stack sx={{ width: '100%' }} textAlign=\"end\">\n <Typography data-testid=\"finder-total\">\n Total: <strong>{metricNames.length}</strong> metrics\n </Typography>\n </Stack>\n </Stack>\n );\n}\n"],"names":["Button","Divider","Skeleton","Stack","TableCell","Typography","Fuzzy","useExplorerQueryParams","CompassIcon","useMemo","Link","RouterLink","TableVirtuoso","useMetricMetadata","MetricChip","MetricRow","children","metricName","datasource","filters","isMetadataEnabled","onExplore","metadata","isLoading","searchParams","data","tab","exploredMetric","style","width","sx","fontFamily","textAlign","variant","label","type","fontStyle","help","minWidth","aria-label","startIcon","textWrap","onClick","component","to","MetricList","metricNames","filteredResults","props","fuzzy","fuzzyMetrics","map","original","gap","divider","orientation","flexItem","height","totalCount","length","itemContent","index","span","dangerouslySetInnerHTML","__html","render","intervals","pre","post","escapeHTML","data-testid","strong"],"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,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,KAAK,EAAcC,SAAS,EAAEC,UAAU,QAAQ,gBAAgB;AACpG,SAASC,KAAK,QAA+B,iBAAiB;AAE9D,SAASC,sBAAsB,QAAQ,sBAAsB;AAC7D,OAAOC,iBAAiB,0BAA0B;AAClD,SAAkCC,OAAO,QAAQ,QAAQ;AACzD,SAASC,QAAQC,UAAU,QAAQ,mBAAmB;AACtD,SAASC,aAAa,QAAQ,iBAAiB;AAE/C,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SAASC,UAAU,QAAQ,gBAAgB;AAW3C,OAAO,SAASC,UAAU,EACxBC,QAAQ,EACRC,UAAU,EACVC,UAAU,EACVC,OAAO,EACPC,iBAAiB,EACjBC,SAAS,EACM;IACf,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGV,kBAAkBI,YAAYC,YAAYE;IAE1E,MAAMI,eAAejB,uBAAu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AUnC;YAAW,CAAA;IACjE,GAAG;QAAC8B;QAAiBD;KAAY;IAEjC,qBACE,MAAC3C;QAAMkD,KAAK;QAAGxB,OAAM;QAAOyB,uBAAS,KAACrD;YAAQsD,aAAY;YAAaC,QAAQ;;QAAM,GAAGR,KAAK;;0BAC3F,KAACpC;gBACCgB,OAAO;oBAAE6B,QAAQ;oBAAQ5B,OAAO;gBAAO;gBACvC6B,YAAYR,aAAaS,MAAM;gBAC/BC,aAAa,CAACC,sBACZ,KAAC9C;wBACCE,YAAYiC,YAAY,CAACW,MAAM,CAAET,QAAQ;wBACzClC,YAAYA;wBACZC,SAASA;wBACTC,mBAAmBA;wBACnBC,WAAWA;kCAEX,cAAA,KAACyC;4BACCC,yBAAyB;gCACvBC,QAAQf,MAAMgB,MAAM,CAACf,YAAY,CAACW,MAAM,CAAET,QAAQ,EAAEF,YAAY,CAACW,MAAM,CAAEK,SAAS,IAAI,EAAE,EAAE;oCACxFC,KAAK;oCACLC,MAAM;oCACNC,YAAY;gCACd;4BACF;;;;0BAKR,KAAClE;gBAAM2B,IAAI;oBAAED,OAAO;gBAAO;gBAAGG,WAAU;0BACtC,cAAA,MAAC3B;oBAAWiE,eAAY;;wBAAe;sCAC9B,KAACC;sCAAQzB,YAAYa,MAAM;;wBAAU;;;;;;AAKtD"}
1
+ {"version":3,"sources":["../../../../../../src/explore/PrometheusMetricsFinder/display/list/MetricList.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Button, Divider, Skeleton, Stack, StackProps, TableCell, Typography } from '@mui/material';\nimport { Fuzzy, FuzzyMatchingInterval } from '@nexucis/fuzzy';\nimport { DatasourceSelector } from '@perses-dev/core';\nimport { useExplorerQueryParams } from '@perses-dev/explore';\nimport CompassIcon from 'mdi-material-ui/Compass';\nimport { ReactElement, ReactNode, useMemo } from 'react';\nimport { Link as RouterLink } from 'react-router-dom';\nimport { TableVirtuoso } from 'react-virtuoso';\nimport { LabelFilter } from '../../types';\nimport { useMetricMetadata } from '../../utils';\nimport { MetricChip } from '../MetricChip';\n\nexport interface MetricRowProps {\n children?: ReactNode;\n metricName: string;\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n isMetadataEnabled?: boolean;\n onExplore?: (metricName: string) => void;\n}\n\nexport function MetricRow({\n children,\n metricName,\n datasource,\n filters,\n isMetadataEnabled,\n onExplore,\n}: MetricRowProps): ReactElement {\n const { metadata, isLoading } = useMetricMetadata(metricName, datasource, isMetadataEnabled);\n\n const searchParams = useExplorerQueryParams({\n data: { tab: 'finder', datasource, filters, exploredMetric: metricName },\n });\n\n return (\n <>\n <TableCell style={{ width: '300px' }}>\n <Typography sx={{ fontFamily: 'monospace' }}>{children ?? metricName}</Typography>\n </TableCell>\n\n <TableCell style={{ width: 115, textAlign: 'center' }}>\n {isMetadataEnabled && isLoading ? (\n <Skeleton variant=\"rounded\" width={75} />\n ) : (\n <MetricChip label={metadata?.type ?? 'unknown'} />\n )}\n </TableCell>\n <TableCell style={{ width: '100%' }}>\n {isMetadataEnabled && isLoading ? (\n <Skeleton variant=\"text\" width={180} />\n ) : (\n <Typography sx={{ fontStyle: metadata?.help ? 'initial' : 'italic', minWidth: '30vw' }}>\n {metadata ? metadata.help : 'unknown'}\n </Typography>\n )}\n </TableCell>\n <TableCell style={{ width: 140 }}>\n <Button\n aria-label={`explore metric ${metricName}`}\n variant=\"contained\"\n startIcon={<CompassIcon />}\n style={{ textWrap: 'nowrap' }}\n onClick={() => onExplore?.(metricName)}\n component={RouterLink}\n to={`?${searchParams}`}\n >\n Explore\n </Button>\n </TableCell>\n </>\n );\n}\n\nexport interface MetricListProps extends StackProps {\n metricNames: string[];\n filteredResults?: Array<{ original: string; intervals?: FuzzyMatchingInterval[] }>;\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n isMetadataEnabled?: boolean;\n onExplore?: (metricName: string) => void;\n}\n\nexport function MetricList({\n metricNames,\n filteredResults,\n datasource,\n filters,\n isMetadataEnabled,\n onExplore,\n ...props\n}: MetricListProps): ReactElement {\n const fuzzy = new Fuzzy();\n\n const fuzzyMetrics: Array<{ original: string; intervals?: FuzzyMatchingInterval[] }> = useMemo(() => {\n if (filteredResults) {\n return filteredResults;\n }\n return metricNames.map((metricName) => ({ original: metricName }));\n }, [filteredResults, metricNames]);\n\n return (\n <Stack gap={2} width=\"100%\" divider={<Divider orientation=\"horizontal\" flexItem />} {...props}>\n <TableVirtuoso\n style={{ height: '70vh', width: '100%' }}\n totalCount={fuzzyMetrics.length}\n itemContent={(index) => (\n <MetricRow\n metricName={fuzzyMetrics[index]!.original}\n datasource={datasource}\n filters={filters}\n isMetadataEnabled={isMetadataEnabled}\n onExplore={onExplore}\n >\n <span\n dangerouslySetInnerHTML={{\n __html: fuzzy.render(fuzzyMetrics[index]!.original, fuzzyMetrics[index]!.intervals ?? [], {\n pre: '<strong style=\"color:darkorange\">',\n post: '</strong>',\n escapeHTML: true,\n }),\n }}\n />\n </MetricRow>\n )}\n />\n <Stack sx={{ width: '100%' }} textAlign=\"end\">\n <Typography data-testid=\"finder-total\">\n Total: <strong>{metricNames.length}</strong> metrics\n </Typography>\n </Stack>\n </Stack>\n );\n}\n"],"names":["Button","Divider","Skeleton","Stack","TableCell","Typography","Fuzzy","useExplorerQueryParams","CompassIcon","useMemo","Link","RouterLink","TableVirtuoso","useMetricMetadata","MetricChip","MetricRow","children","metricName","datasource","filters","isMetadataEnabled","onExplore","metadata","isLoading","searchParams","data","tab","exploredMetric","style","width","sx","fontFamily","textAlign","variant","label","type","fontStyle","help","minWidth","aria-label","startIcon","textWrap","onClick","component","to","MetricList","metricNames","filteredResults","props","fuzzy","fuzzyMetrics","map","original","gap","divider","orientation","flexItem","height","totalCount","length","itemContent","index","span","dangerouslySetInnerHTML","__html","render","intervals","pre","post","escapeHTML","data-testid","strong"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,KAAK,EAAcC,SAAS,EAAEC,UAAU,QAAQ,gBAAgB;AACpG,SAASC,KAAK,QAA+B,iBAAiB;AAE9D,SAASC,sBAAsB,QAAQ,sBAAsB;AAC7D,OAAOC,iBAAiB,0BAA0B;AAClD,SAAkCC,OAAO,QAAQ,QAAQ;AACzD,SAASC,QAAQC,UAAU,QAAQ,mBAAmB;AACtD,SAASC,aAAa,QAAQ,iBAAiB;AAE/C,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SAASC,UAAU,QAAQ,gBAAgB;AAW3C,OAAO,SAASC,UAAU,EACxBC,QAAQ,EACRC,UAAU,EACVC,UAAU,EACVC,OAAO,EACPC,iBAAiB,EACjBC,SAAS,EACM;IACf,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGV,kBAAkBI,YAAYC,YAAYE;IAE1E,MAAMI,eAAejB,uBAAuB;QAC1CkB,MAAM;YAAEC,KAAK;YAAUR;YAAYC;YAASQ,gBAAgBV;QAAW;IACzE;IAEA,qBACE;;0BACE,KAACb;gBAAUwB,OAAO;oBAAEC,OAAO;gBAAQ;0BACjC,cAAA,KAACxB;oBAAWyB,IAAI;wBAAEC,YAAY;oBAAY;8BAAIf,YAAYC;;;0BAG5D,KAACb;gBAAUwB,OAAO;oBAAEC,OAAO;oBAAKG,WAAW;gBAAS;0BACjDZ,qBAAqBG,0BACpB,KAACrB;oBAAS+B,SAAQ;oBAAU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CAACW,MAAM,CAAET,QAAQ;wBACzClC,YAAYA;wBACZC,SAASA;wBACTC,mBAAmBA;wBACnBC,WAAWA;kCAEX,cAAA,KAACyC;4BACCC,yBAAyB;gCACvBC,QAAQf,MAAMgB,MAAM,CAACf,YAAY,CAACW,MAAM,CAAET,QAAQ,EAAEF,YAAY,CAACW,MAAM,CAAEK,SAAS,IAAI,EAAE,EAAE;oCACxFC,KAAK;oCACLC,MAAM;oCACNC,YAAY;gCACd;4BACF;;;;0BAKR,KAAClE;gBAAM2B,IAAI;oBAAED,OAAO;gBAAO;gBAAGG,WAAU;0BACtC,cAAA,MAAC3B;oBAAWiE,eAAY;;wBAAe;sCAC9B,KAACC;sCAAQzB,YAAYa,MAAM;;wBAAU;;;;;;AAKtD"}
@@ -1,4 +1,5 @@
1
- // Copyright 2024 The Perses Authors
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Copyright The Perses Authors
2
3
  // Licensed under the Apache License, Version 2.0 (the "License");
3
4
  // you may not use this file except in compliance with the License.
4
5
  // You may obtain a copy of the License at
@@ -10,7 +11,6 @@
10
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
12
  // See the License for the specific language governing permissions and
12
13
  // limitations under the License.
13
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  import { cloneElement, forwardRef, useMemo, useRef, useState } from 'react';
15
15
  import { Autocomplete, CircularProgress, IconButton, InputAdornment, MenuItem, Select, Stack, TextField } from '@mui/material';
16
16
  import DeleteIcon from 'mdi-material-ui/Delete';