@perses-dev/alert-manager-plugin 0.1.0

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 (380) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +41 -0
  3. package/__mf/css/async/7790.85c2cbf6.css +1 -0
  4. package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
  5. package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
  6. package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
  7. package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
  8. package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
  9. package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
  10. package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
  11. package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
  12. package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
  13. package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
  14. package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
  15. package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
  16. package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
  17. package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
  18. package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
  19. package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
  20. package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
  21. package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
  22. package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
  23. package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
  24. package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
  25. package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
  26. package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
  27. package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
  28. package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
  29. package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
  30. package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
  31. package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
  32. package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
  33. package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
  34. package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
  35. package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
  36. package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
  37. package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
  38. package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
  39. package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
  40. package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
  41. package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
  42. package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
  43. package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
  44. package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
  45. package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
  46. package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
  47. package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
  48. package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
  49. package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
  50. package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
  51. package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
  52. package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
  53. package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
  54. package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
  55. package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
  56. package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
  57. package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
  58. package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
  59. package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
  60. package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
  61. package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
  62. package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
  63. package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
  64. package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
  65. package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
  66. package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
  67. package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
  68. package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
  69. package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
  70. package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
  71. package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
  72. package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
  73. package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
  74. package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
  75. package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
  76. package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
  77. package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
  78. package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
  79. package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
  80. package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
  81. package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
  82. package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
  83. package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
  84. package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
  85. package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
  86. package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
  87. package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
  88. package/__mf/js/AlertManager.f762e62c.js +7 -0
  89. package/__mf/js/async/1616.24f00c9d.js +1 -0
  90. package/__mf/js/async/1728.83bb9a7c.js +1 -0
  91. package/__mf/js/async/1871.23ff54b3.js +1 -0
  92. package/__mf/js/async/1969.a83b1b48.js +1 -0
  93. package/__mf/js/async/2218.7829c9d9.js +2 -0
  94. package/__mf/js/async/2218.7829c9d9.js.LICENSE.txt +9 -0
  95. package/__mf/js/async/2377.f8875a4e.js +1 -0
  96. package/__mf/js/async/2657.fe8dd44f.js +1 -0
  97. package/__mf/js/async/2954.3ac1f636.js +2 -0
  98. package/__mf/js/async/392.7e11dd69.js +2 -0
  99. package/__mf/js/async/392.7e11dd69.js.LICENSE.txt +8 -0
  100. package/__mf/js/async/3963.fb6246d2.js +1 -0
  101. package/__mf/js/async/4121.ec666be2.js +2 -0
  102. package/__mf/js/async/4121.ec666be2.js.LICENSE.txt +9 -0
  103. package/__mf/js/async/4133.e94df4f8.js +28 -0
  104. package/__mf/js/async/4213.a0c4f2eb.js +1 -0
  105. package/__mf/js/async/4397.d399eecb.js +2 -0
  106. package/__mf/js/async/4397.d399eecb.js.LICENSE.txt +37 -0
  107. package/__mf/js/async/4466.a8145edd.js +74 -0
  108. package/__mf/js/async/4732.e866a740.js +1 -0
  109. package/__mf/js/async/4788.49ffeac3.js +1 -0
  110. package/__mf/js/async/5038.269393e3.js +2 -0
  111. package/__mf/js/async/5038.269393e3.js.LICENSE.txt +9 -0
  112. package/__mf/js/async/573.214f2003.js +2 -0
  113. package/__mf/js/async/573.214f2003.js.LICENSE.txt +9 -0
  114. package/__mf/js/async/6274.8c77cb1a.js +2 -0
  115. package/__mf/js/async/6274.8c77cb1a.js.LICENSE.txt +8 -0
  116. package/__mf/js/async/6390.3f6f279d.js +2 -0
  117. package/__mf/js/async/6390.3f6f279d.js.LICENSE.txt +9 -0
  118. package/__mf/js/async/6401.1a59dbad.js +1 -0
  119. package/__mf/js/async/6593.acc8b704.js +4 -0
  120. package/__mf/js/async/6593.acc8b704.js.LICENSE.txt +24 -0
  121. package/__mf/js/async/6594.b02adfd9.js +2 -0
  122. package/__mf/js/async/6594.b02adfd9.js.LICENSE.txt +9 -0
  123. package/__mf/js/async/663.5445c7e0.js +1 -0
  124. package/__mf/js/async/6854.1d628838.js +1 -0
  125. package/__mf/js/async/7177.27c86137.js +1 -0
  126. package/__mf/js/async/7192.ede9860b.js +1 -0
  127. package/__mf/js/async/733.22ab2a8a.js +1 -0
  128. package/__mf/js/async/7422.33d76364.js +2 -0
  129. package/__mf/js/async/7422.33d76364.js.LICENSE.txt +9 -0
  130. package/__mf/js/async/7790.a75199e6.js +7 -0
  131. package/__mf/js/async/7790.a75199e6.js.LICENSE.txt +64 -0
  132. package/__mf/js/async/7862.556c038f.js +2 -0
  133. package/__mf/js/async/7862.556c038f.js.LICENSE.txt +9 -0
  134. package/__mf/js/async/7984.49fa1156.js +22 -0
  135. package/__mf/js/async/7984.49fa1156.js.LICENSE.txt +19 -0
  136. package/__mf/js/async/804.23da0d30.js +37 -0
  137. package/__mf/js/async/8470.2df0db71.js +2 -0
  138. package/__mf/js/async/8470.2df0db71.js.LICENSE.txt +19 -0
  139. package/__mf/js/async/8697.c13c6603.js +1 -0
  140. package/__mf/js/async/8907.9e3edf43.js +1 -0
  141. package/__mf/js/async/9040.94717f28.js +10 -0
  142. package/__mf/js/async/9040.94717f28.js.LICENSE.txt +17 -0
  143. package/__mf/js/async/9184.27a439a4.js +1 -0
  144. package/__mf/js/async/9235.00f9412f.js +1 -0
  145. package/__mf/js/async/941.d3bc6208.js +2 -0
  146. package/__mf/js/async/941.d3bc6208.js.LICENSE.txt +9 -0
  147. package/__mf/js/async/9634.3a366799.js +1 -0
  148. package/__mf/js/async/9836.cc839227.js +1 -0
  149. package/__mf/js/async/__federation_expose_AlertManagerAlertsExplorer.d4fb76c0.js +2 -0
  150. package/__mf/js/async/__federation_expose_AlertManagerAlertsExplorer.d4fb76c0.js.LICENSE.txt +9 -0
  151. package/__mf/js/async/__federation_expose_AlertManagerAlertsQuery.9ea3093c.js +1 -0
  152. package/__mf/js/async/__federation_expose_AlertManagerDatasource.2fbf067c.js +2 -0
  153. package/__mf/js/async/__federation_expose_AlertManagerDatasource.2fbf067c.js.LICENSE.txt +9 -0
  154. package/__mf/js/async/__federation_expose_AlertManagerSilencesExplorer.d2527c12.js +2 -0
  155. package/__mf/js/async/__federation_expose_AlertManagerSilencesExplorer.d2527c12.js.LICENSE.txt +9 -0
  156. package/__mf/js/async/__federation_expose_AlertManagerSilencesQuery.7aca31d3.js +2 -0
  157. package/__mf/js/async/__federation_expose_AlertManagerSilencesQuery.7aca31d3.js.LICENSE.txt +9 -0
  158. package/__mf/js/async/__federation_expose_AlertTable.4a636b80.js +1 -0
  159. package/__mf/js/async/__federation_expose_SilenceTable.11259028.js +1 -0
  160. package/__mf/js/async/lib-router.19f64904.js +2 -0
  161. package/__mf/js/async/lib-router.19f64904.js.LICENSE.txt +32 -0
  162. package/__mf/js/main.a1362788.js +7 -0
  163. package/lib/bootstrap.d.ts +2 -0
  164. package/lib/bootstrap.d.ts.map +1 -0
  165. package/lib/bootstrap.js +19 -0
  166. package/lib/bootstrap.js.map +1 -0
  167. package/lib/cjs/bootstrap.js +26 -0
  168. package/lib/cjs/components/ColumnsEditor.js +271 -0
  169. package/lib/cjs/components/LazyTextField.js +50 -0
  170. package/lib/cjs/components/MatcherEditor.js +153 -0
  171. package/lib/cjs/components/MatchersList.js +46 -0
  172. package/lib/cjs/components/SilenceForm.js +205 -0
  173. package/lib/cjs/components/StatusBadge.js +71 -0
  174. package/lib/cjs/components/index.js +44 -0
  175. package/lib/cjs/explore/AlertManagerAlertsExplorer.js +79 -0
  176. package/lib/cjs/explore/AlertManagerSilencesExplorer.js +153 -0
  177. package/lib/cjs/getPluginModule.js +39 -0
  178. package/lib/cjs/index-federation.js +55 -0
  179. package/lib/cjs/index.js +39 -0
  180. package/lib/cjs/model/alertmanager-client.js +128 -0
  181. package/lib/cjs/model/alertmanager-selectors.js +66 -0
  182. package/lib/cjs/model/api-types.js +22 -0
  183. package/lib/cjs/model/index.js +32 -0
  184. package/lib/cjs/plugins/AlertManagerDatasourceEditor.js +71 -0
  185. package/lib/cjs/plugins/alert-table/AlertTable.js +56 -0
  186. package/lib/cjs/plugins/alert-table/AlertTableColumnsEditor.js +110 -0
  187. package/lib/cjs/plugins/alert-table/AlertTableDeduplicationEditor.js +138 -0
  188. package/lib/cjs/plugins/alert-table/AlertTableLabelsEditor.js +277 -0
  189. package/lib/cjs/plugins/alert-table/AlertTableOptionsEditor.js +128 -0
  190. package/lib/cjs/plugins/alert-table/AlertTablePanel.js +773 -0
  191. package/lib/cjs/plugins/alert-table/alert-table-model.js +142 -0
  192. package/lib/cjs/plugins/alert-table/alert-table-sorting.js +205 -0
  193. package/lib/cjs/plugins/alert-table/label-colors.js +170 -0
  194. package/lib/cjs/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.js +51 -0
  195. package/lib/cjs/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.js +138 -0
  196. package/lib/cjs/plugins/alertmanager-alerts-query/get-alerts-data.js +124 -0
  197. package/lib/cjs/plugins/alertmanager-datasource.js +69 -0
  198. package/lib/cjs/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.js +45 -0
  199. package/lib/cjs/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.js +78 -0
  200. package/lib/cjs/plugins/alertmanager-silences-query/get-silences-data.js +64 -0
  201. package/lib/cjs/plugins/index.js +74 -0
  202. package/lib/cjs/plugins/silence-table/SilenceTable.js +42 -0
  203. package/lib/cjs/plugins/silence-table/SilenceTableColumnsEditor.js +137 -0
  204. package/lib/cjs/plugins/silence-table/SilenceTableOptionsEditor.js +63 -0
  205. package/lib/cjs/plugins/silence-table/SilenceTablePanel.js +345 -0
  206. package/lib/cjs/plugins/silence-table/silence-table-model.js +116 -0
  207. package/lib/cjs/plugins/silence-table/silence-table-sorting.js +68 -0
  208. package/lib/cjs/plugins/types.js +16 -0
  209. package/lib/cjs/setup-tests.js +18 -0
  210. package/lib/components/ColumnsEditor.d.ts +25 -0
  211. package/lib/components/ColumnsEditor.d.ts.map +1 -0
  212. package/lib/components/ColumnsEditor.js +258 -0
  213. package/lib/components/ColumnsEditor.js.map +1 -0
  214. package/lib/components/LazyTextField.d.ts +12 -0
  215. package/lib/components/LazyTextField.d.ts.map +1 -0
  216. package/lib/components/LazyTextField.js +42 -0
  217. package/lib/components/LazyTextField.js.map +1 -0
  218. package/lib/components/MatcherEditor.d.ts +17 -0
  219. package/lib/components/MatcherEditor.d.ts.map +1 -0
  220. package/lib/components/MatcherEditor.js +142 -0
  221. package/lib/components/MatcherEditor.js.map +1 -0
  222. package/lib/components/MatchersList.d.ts +10 -0
  223. package/lib/components/MatchersList.d.ts.map +1 -0
  224. package/lib/components/MatchersList.js +40 -0
  225. package/lib/components/MatchersList.js.map +1 -0
  226. package/lib/components/SilenceForm.d.ts +13 -0
  227. package/lib/components/SilenceForm.d.ts.map +1 -0
  228. package/lib/components/SilenceForm.js +194 -0
  229. package/lib/components/SilenceForm.js.map +1 -0
  230. package/lib/components/StatusBadge.d.ts +10 -0
  231. package/lib/components/StatusBadge.d.ts.map +1 -0
  232. package/lib/components/StatusBadge.js +65 -0
  233. package/lib/components/StatusBadge.js.map +1 -0
  234. package/lib/components/index.d.ts +11 -0
  235. package/lib/components/index.d.ts.map +1 -0
  236. package/lib/components/index.js +19 -0
  237. package/lib/components/index.js.map +1 -0
  238. package/lib/explore/AlertManagerAlertsExplorer.d.ts +3 -0
  239. package/lib/explore/AlertManagerAlertsExplorer.d.ts.map +1 -0
  240. package/lib/explore/AlertManagerAlertsExplorer.js +71 -0
  241. package/lib/explore/AlertManagerAlertsExplorer.js.map +1 -0
  242. package/lib/explore/AlertManagerSilencesExplorer.d.ts +3 -0
  243. package/lib/explore/AlertManagerSilencesExplorer.d.ts.map +1 -0
  244. package/lib/explore/AlertManagerSilencesExplorer.js +140 -0
  245. package/lib/explore/AlertManagerSilencesExplorer.js.map +1 -0
  246. package/lib/getPluginModule.d.ts +3 -0
  247. package/lib/getPluginModule.d.ts.map +1 -0
  248. package/lib/getPluginModule.js +26 -0
  249. package/lib/getPluginModule.js.map +1 -0
  250. package/lib/index-federation.d.ts +1 -0
  251. package/lib/index-federation.d.ts.map +1 -0
  252. package/lib/index-federation.js +15 -0
  253. package/lib/index-federation.js.map +1 -0
  254. package/lib/index.d.ts +5 -0
  255. package/lib/index.d.ts.map +1 -0
  256. package/lib/index.js +18 -0
  257. package/lib/index.js.map +1 -0
  258. package/lib/model/alertmanager-client.d.ts +27 -0
  259. package/lib/model/alertmanager-client.d.ts.map +1 -0
  260. package/lib/model/alertmanager-client.js +100 -0
  261. package/lib/model/alertmanager-client.js.map +1 -0
  262. package/lib/model/alertmanager-selectors.d.ts +13 -0
  263. package/lib/model/alertmanager-selectors.d.ts.map +1 -0
  264. package/lib/model/alertmanager-selectors.js +41 -0
  265. package/lib/model/alertmanager-selectors.js.map +1 -0
  266. package/lib/model/api-types.d.ts +120 -0
  267. package/lib/model/api-types.d.ts.map +1 -0
  268. package/lib/model/api-types.js +23 -0
  269. package/lib/model/api-types.js.map +1 -0
  270. package/lib/model/index.d.ts +4 -0
  271. package/lib/model/index.d.ts.map +1 -0
  272. package/lib/model/index.js +17 -0
  273. package/lib/model/index.js.map +1 -0
  274. package/lib/plugins/AlertManagerDatasourceEditor.d.ts +9 -0
  275. package/lib/plugins/AlertManagerDatasourceEditor.d.ts.map +1 -0
  276. package/lib/plugins/AlertManagerDatasourceEditor.js +63 -0
  277. package/lib/plugins/AlertManagerDatasourceEditor.js.map +1 -0
  278. package/lib/plugins/alert-table/AlertTable.d.ts +8 -0
  279. package/lib/plugins/alert-table/AlertTable.d.ts.map +1 -0
  280. package/lib/plugins/alert-table/AlertTable.js +50 -0
  281. package/lib/plugins/alert-table/AlertTable.js.map +1 -0
  282. package/lib/plugins/alert-table/AlertTableColumnsEditor.d.ts +5 -0
  283. package/lib/plugins/alert-table/AlertTableColumnsEditor.d.ts.map +1 -0
  284. package/lib/plugins/alert-table/AlertTableColumnsEditor.js +102 -0
  285. package/lib/plugins/alert-table/AlertTableColumnsEditor.js.map +1 -0
  286. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.d.ts +5 -0
  287. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.d.ts.map +1 -0
  288. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.js +130 -0
  289. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.js.map +1 -0
  290. package/lib/plugins/alert-table/AlertTableLabelsEditor.d.ts +5 -0
  291. package/lib/plugins/alert-table/AlertTableLabelsEditor.d.ts.map +1 -0
  292. package/lib/plugins/alert-table/AlertTableLabelsEditor.js +264 -0
  293. package/lib/plugins/alert-table/AlertTableLabelsEditor.js.map +1 -0
  294. package/lib/plugins/alert-table/AlertTableOptionsEditor.d.ts +5 -0
  295. package/lib/plugins/alert-table/AlertTableOptionsEditor.d.ts.map +1 -0
  296. package/lib/plugins/alert-table/AlertTableOptionsEditor.js +120 -0
  297. package/lib/plugins/alert-table/AlertTableOptionsEditor.js.map +1 -0
  298. package/lib/plugins/alert-table/AlertTablePanel.d.ts +11 -0
  299. package/lib/plugins/alert-table/AlertTablePanel.d.ts.map +1 -0
  300. package/lib/plugins/alert-table/AlertTablePanel.js +763 -0
  301. package/lib/plugins/alert-table/AlertTablePanel.js.map +1 -0
  302. package/lib/plugins/alert-table/alert-table-model.d.ts +73 -0
  303. package/lib/plugins/alert-table/alert-table-model.d.ts.map +1 -0
  304. package/lib/plugins/alert-table/alert-table-model.js +127 -0
  305. package/lib/plugins/alert-table/alert-table-model.js.map +1 -0
  306. package/lib/plugins/alert-table/alert-table-sorting.d.ts +13 -0
  307. package/lib/plugins/alert-table/alert-table-sorting.d.ts.map +1 -0
  308. package/lib/plugins/alert-table/alert-table-sorting.js +180 -0
  309. package/lib/plugins/alert-table/alert-table-sorting.js.map +1 -0
  310. package/lib/plugins/alert-table/label-colors.d.ts +6 -0
  311. package/lib/plugins/alert-table/label-colors.d.ts.map +1 -0
  312. package/lib/plugins/alert-table/label-colors.js +148 -0
  313. package/lib/plugins/alert-table/label-colors.js.map +1 -0
  314. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.d.ts +4 -0
  315. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.d.ts.map +1 -0
  316. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.js +43 -0
  317. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.js.map +1 -0
  318. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.d.ts +9 -0
  319. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.d.ts.map +1 -0
  320. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.js +130 -0
  321. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.js.map +1 -0
  322. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.d.ts +8 -0
  323. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.d.ts.map +1 -0
  324. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.js +118 -0
  325. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.js.map +1 -0
  326. package/lib/plugins/alertmanager-datasource.d.ts +5 -0
  327. package/lib/plugins/alertmanager-datasource.d.ts.map +1 -0
  328. package/lib/plugins/alertmanager-datasource.js +61 -0
  329. package/lib/plugins/alertmanager-datasource.js.map +1 -0
  330. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.d.ts +4 -0
  331. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.d.ts.map +1 -0
  332. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.js +37 -0
  333. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.js.map +1 -0
  334. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.d.ts +9 -0
  335. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.d.ts.map +1 -0
  336. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.js +70 -0
  337. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.js.map +1 -0
  338. package/lib/plugins/alertmanager-silences-query/get-silences-data.d.ts +8 -0
  339. package/lib/plugins/alertmanager-silences-query/get-silences-data.d.ts.map +1 -0
  340. package/lib/plugins/alertmanager-silences-query/get-silences-data.js +58 -0
  341. package/lib/plugins/alertmanager-silences-query/get-silences-data.js.map +1 -0
  342. package/lib/plugins/index.d.ts +19 -0
  343. package/lib/plugins/index.d.ts.map +1 -0
  344. package/lib/plugins/index.js +30 -0
  345. package/lib/plugins/index.js.map +1 -0
  346. package/lib/plugins/silence-table/SilenceTable.d.ts +7 -0
  347. package/lib/plugins/silence-table/SilenceTable.d.ts.map +1 -0
  348. package/lib/plugins/silence-table/SilenceTable.js +36 -0
  349. package/lib/plugins/silence-table/SilenceTable.js.map +1 -0
  350. package/lib/plugins/silence-table/SilenceTableColumnsEditor.d.ts +5 -0
  351. package/lib/plugins/silence-table/SilenceTableColumnsEditor.d.ts.map +1 -0
  352. package/lib/plugins/silence-table/SilenceTableColumnsEditor.js +129 -0
  353. package/lib/plugins/silence-table/SilenceTableColumnsEditor.js.map +1 -0
  354. package/lib/plugins/silence-table/SilenceTableOptionsEditor.d.ts +5 -0
  355. package/lib/plugins/silence-table/SilenceTableOptionsEditor.d.ts.map +1 -0
  356. package/lib/plugins/silence-table/SilenceTableOptionsEditor.js +55 -0
  357. package/lib/plugins/silence-table/SilenceTableOptionsEditor.js.map +1 -0
  358. package/lib/plugins/silence-table/SilenceTablePanel.d.ts +11 -0
  359. package/lib/plugins/silence-table/SilenceTablePanel.d.ts.map +1 -0
  360. package/lib/plugins/silence-table/SilenceTablePanel.js +335 -0
  361. package/lib/plugins/silence-table/SilenceTablePanel.js.map +1 -0
  362. package/lib/plugins/silence-table/silence-table-model.d.ts +29 -0
  363. package/lib/plugins/silence-table/silence-table-model.d.ts.map +1 -0
  364. package/lib/plugins/silence-table/silence-table-model.js +90 -0
  365. package/lib/plugins/silence-table/silence-table-model.js.map +1 -0
  366. package/lib/plugins/silence-table/silence-table-sorting.d.ts +9 -0
  367. package/lib/plugins/silence-table/silence-table-sorting.d.ts.map +1 -0
  368. package/lib/plugins/silence-table/silence-table-sorting.js +60 -0
  369. package/lib/plugins/silence-table/silence-table-sorting.js.map +1 -0
  370. package/lib/plugins/types.d.ts +30 -0
  371. package/lib/plugins/types.d.ts.map +1 -0
  372. package/lib/plugins/types.js +17 -0
  373. package/lib/plugins/types.js.map +1 -0
  374. package/lib/setup-tests.d.ts +2 -0
  375. package/lib/setup-tests.d.ts.map +1 -0
  376. package/lib/setup-tests.js +16 -0
  377. package/lib/setup-tests.js.map +1 -0
  378. package/mf-manifest.json +631 -0
  379. package/mf-stats.json +752 -0
  380. package/package.json +115 -0
@@ -0,0 +1,148 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ const SEVERITY_LEVEL_COLORS = {
14
+ critical: '#d32f2f',
15
+ error: '#ef6c00',
16
+ warning: '#f9a825',
17
+ info: '#0288d1',
18
+ debug: '#7b1fa2',
19
+ trace: '#6a1b9a',
20
+ unknown: '#757575',
21
+ other: '#9e9e9e'
22
+ };
23
+ const SEVERITY_ABBREVIATIONS = {
24
+ critical: [
25
+ 'critical',
26
+ 'crit',
27
+ 'fatal',
28
+ 'emerg',
29
+ 'alert',
30
+ 'page'
31
+ ],
32
+ error: [
33
+ 'error',
34
+ 'err',
35
+ 'eror',
36
+ 'high',
37
+ 'severe'
38
+ ],
39
+ warning: [
40
+ 'warning',
41
+ 'warn',
42
+ 'medium'
43
+ ],
44
+ info: [
45
+ 'info',
46
+ 'inf',
47
+ 'information',
48
+ 'informational',
49
+ 'notice',
50
+ 'low'
51
+ ],
52
+ debug: [
53
+ 'debug',
54
+ 'dbug'
55
+ ],
56
+ trace: [
57
+ 'trace'
58
+ ],
59
+ unknown: [
60
+ 'unknown'
61
+ ],
62
+ other: [
63
+ 'other',
64
+ 'none',
65
+ 'minor',
66
+ ''
67
+ ]
68
+ };
69
+ const SEVERITY_COLORS = {};
70
+ for (const [level, abbrevs] of Object.entries(SEVERITY_ABBREVIATIONS)){
71
+ const color = SEVERITY_LEVEL_COLORS[level];
72
+ for (const abbrev of abbrevs){
73
+ SEVERITY_COLORS[abbrev] = color;
74
+ }
75
+ }
76
+ export const SEVERITY_ORDER = [
77
+ 'critical',
78
+ 'error',
79
+ 'warning',
80
+ 'info',
81
+ 'debug',
82
+ 'trace',
83
+ 'unknown',
84
+ 'other'
85
+ ];
86
+ export function getSeverityWeight(value) {
87
+ const normalized = value.toLowerCase();
88
+ for (const [level, abbrevs] of Object.entries(SEVERITY_ABBREVIATIONS)){
89
+ if (abbrevs.includes(normalized)) {
90
+ const idx = SEVERITY_ORDER.indexOf(level);
91
+ return idx === -1 ? SEVERITY_ORDER.length : idx;
92
+ }
93
+ }
94
+ return SEVERITY_ORDER.length;
95
+ }
96
+ const MANUAL_FALLBACK = '#9e9e9e';
97
+ const ERROR_HUE_CUTOFF = 20;
98
+ export function hashStringToColor(value) {
99
+ let hash = 5381;
100
+ for(let i = 0; i < value.length; i++){
101
+ hash = hash * 33 ^ value.charCodeAt(i);
102
+ }
103
+ hash = Math.abs(hash);
104
+ const hue = ERROR_HUE_CUTOFF + hash % (360 - ERROR_HUE_CUTOFF);
105
+ const saturation = 55 + hash % 25;
106
+ const lightness = 45 + hash % 15;
107
+ return `hsl(${hue}, ${saturation}%, ${lightness}%)`;
108
+ }
109
+ const MAX_REGEX_CACHE_SIZE = 1000;
110
+ const regexCache = new Map();
111
+ function getCompiledRegex(pattern) {
112
+ if (regexCache.has(pattern)) return regexCache.get(pattern);
113
+ if (regexCache.size >= MAX_REGEX_CACHE_SIZE) regexCache.clear();
114
+ try {
115
+ const re = new RegExp(pattern);
116
+ regexCache.set(pattern, re);
117
+ return re;
118
+ } catch {
119
+ regexCache.set(pattern, null);
120
+ return null;
121
+ }
122
+ }
123
+ function matchesOverride(labelValue, pattern, isRegex) {
124
+ if (isRegex) {
125
+ const re = getCompiledRegex(pattern);
126
+ return re !== null && re.test(labelValue);
127
+ }
128
+ return labelValue === pattern;
129
+ }
130
+ export function getLabelColor(value, mapping) {
131
+ if (mapping.overrides) {
132
+ for (const override of mapping.overrides){
133
+ if (matchesOverride(value, override.value, override.isRegex)) {
134
+ return override.color;
135
+ }
136
+ }
137
+ }
138
+ switch(mapping.mode){
139
+ case 'severity':
140
+ return SEVERITY_COLORS[value.toLowerCase()] ?? hashStringToColor(value);
141
+ case 'auto':
142
+ return hashStringToColor(value);
143
+ case 'manual':
144
+ return MANUAL_FALLBACK;
145
+ }
146
+ }
147
+
148
+ //# sourceMappingURL=label-colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/plugins/alert-table/label-colors.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 { LabelColorMapping } from './alert-table-model';\n\nconst SEVERITY_LEVEL_COLORS: Record<string, string> = {\n critical: '#d32f2f',\n error: '#ef6c00',\n warning: '#f9a825',\n info: '#0288d1',\n debug: '#7b1fa2',\n trace: '#6a1b9a',\n unknown: '#757575',\n other: '#9e9e9e',\n};\n\nconst SEVERITY_ABBREVIATIONS: Record<string, string[]> = {\n critical: ['critical', 'crit', 'fatal', 'emerg', 'alert', 'page'],\n error: ['error', 'err', 'eror', 'high', 'severe'],\n warning: ['warning', 'warn', 'medium'],\n info: ['info', 'inf', 'information', 'informational', 'notice', 'low'],\n debug: ['debug', 'dbug'],\n trace: ['trace'],\n unknown: ['unknown'],\n other: ['other', 'none', 'minor', ''],\n};\n\nconst SEVERITY_COLORS: Record<string, string> = {};\nfor (const [level, abbrevs] of Object.entries(SEVERITY_ABBREVIATIONS)) {\n const color = SEVERITY_LEVEL_COLORS[level]!;\n for (const abbrev of abbrevs) {\n SEVERITY_COLORS[abbrev] = color;\n }\n}\n\nexport const SEVERITY_ORDER: string[] = ['critical', 'error', 'warning', 'info', 'debug', 'trace', 'unknown', 'other'];\n\nexport function getSeverityWeight(value: string): number {\n const normalized = value.toLowerCase();\n for (const [level, abbrevs] of Object.entries(SEVERITY_ABBREVIATIONS)) {\n if (abbrevs.includes(normalized)) {\n const idx = SEVERITY_ORDER.indexOf(level);\n return idx === -1 ? SEVERITY_ORDER.length : idx;\n }\n }\n return SEVERITY_ORDER.length;\n}\n\nconst MANUAL_FALLBACK = '#9e9e9e';\nconst ERROR_HUE_CUTOFF = 20;\n\nexport function hashStringToColor(value: string): string {\n let hash = 5381;\n for (let i = 0; i < value.length; i++) {\n hash = (hash * 33) ^ value.charCodeAt(i);\n }\n hash = Math.abs(hash);\n\n const hue = ERROR_HUE_CUTOFF + (hash % (360 - ERROR_HUE_CUTOFF));\n const saturation = 55 + (hash % 25);\n const lightness = 45 + (hash % 15);\n return `hsl(${hue}, ${saturation}%, ${lightness}%)`;\n}\n\nconst MAX_REGEX_CACHE_SIZE = 1000;\nconst regexCache = new Map<string, RegExp | null>();\n\nfunction getCompiledRegex(pattern: string): RegExp | null {\n if (regexCache.has(pattern)) return regexCache.get(pattern)!;\n if (regexCache.size >= MAX_REGEX_CACHE_SIZE) regexCache.clear();\n try {\n const re = new RegExp(pattern);\n regexCache.set(pattern, re);\n return re;\n } catch {\n regexCache.set(pattern, null);\n return null;\n }\n}\n\nfunction matchesOverride(labelValue: string, pattern: string, isRegex: boolean): boolean {\n if (isRegex) {\n const re = getCompiledRegex(pattern);\n return re !== null && re.test(labelValue);\n }\n return labelValue === pattern;\n}\n\nexport function getLabelColor(value: string, mapping: LabelColorMapping): string {\n if (mapping.overrides) {\n for (const override of mapping.overrides) {\n if (matchesOverride(value, override.value, override.isRegex)) {\n return override.color;\n }\n }\n }\n\n switch (mapping.mode) {\n case 'severity':\n return SEVERITY_COLORS[value.toLowerCase()] ?? hashStringToColor(value);\n case 'auto':\n return hashStringToColor(value);\n case 'manual':\n return MANUAL_FALLBACK;\n }\n}\n"],"names":["SEVERITY_LEVEL_COLORS","critical","error","warning","info","debug","trace","unknown","other","SEVERITY_ABBREVIATIONS","SEVERITY_COLORS","level","abbrevs","Object","entries","color","abbrev","SEVERITY_ORDER","getSeverityWeight","value","normalized","toLowerCase","includes","idx","indexOf","length","MANUAL_FALLBACK","ERROR_HUE_CUTOFF","hashStringToColor","hash","i","charCodeAt","Math","abs","hue","saturation","lightness","MAX_REGEX_CACHE_SIZE","regexCache","Map","getCompiledRegex","pattern","has","get","size","clear","re","RegExp","set","matchesOverride","labelValue","isRegex","test","getLabelColor","mapping","overrides","override","mode"],"mappings":"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"}
@@ -0,0 +1,4 @@
1
+ import { AlertsQueryPlugin } from '@perses-dev/plugin-system';
2
+ import { AlertManagerAlertsQuerySpec } from '../types';
3
+ export declare const AlertManagerAlertsQuery: AlertsQueryPlugin<AlertManagerAlertsQuerySpec>;
4
+ //# sourceMappingURL=AlertManagerAlertsQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlertManagerAlertsQuery.d.ts","sourceRoot":"","sources":["../../../../src/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAwC,MAAM,2BAA2B,CAAC;AACpG,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAIvD,eAAO,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,2BAA2B,CAmBlF,CAAC"}
@@ -0,0 +1,43 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { isVariableDatasource, parseVariables } from '@perses-dev/plugin-system';
14
+ import { getAlertsData } from './get-alerts-data';
15
+ import { AlertManagerAlertsQueryEditor } from './AlertManagerAlertsQueryEditor';
16
+ export const AlertManagerAlertsQuery = {
17
+ getAlertsData,
18
+ OptionsEditorComponent: AlertManagerAlertsQueryEditor,
19
+ createInitialOptions: ()=>({
20
+ datasource: undefined,
21
+ filters: [],
22
+ active: true,
23
+ silenced: false,
24
+ inhibited: false,
25
+ receiver: undefined
26
+ }),
27
+ dependsOn: (spec)=>{
28
+ const datasourceVariables = isVariableDatasource(spec.datasource) ? parseVariables(spec.datasource ?? '') : [];
29
+ const filterVariables = spec.filters?.flatMap((f)=>parseVariables(f)) ?? [];
30
+ const receiverVariables = spec.receiver ? parseVariables(spec.receiver) : [];
31
+ return {
32
+ variables: [
33
+ ...new Set([
34
+ ...datasourceVariables,
35
+ ...filterVariables,
36
+ ...receiverVariables
37
+ ])
38
+ ]
39
+ };
40
+ }
41
+ };
42
+
43
+ //# sourceMappingURL=AlertManagerAlertsQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.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 { AlertsQueryPlugin, isVariableDatasource, parseVariables } from '@perses-dev/plugin-system';\nimport { AlertManagerAlertsQuerySpec } from '../types';\nimport { getAlertsData } from './get-alerts-data';\nimport { AlertManagerAlertsQueryEditor } from './AlertManagerAlertsQueryEditor';\n\nexport const AlertManagerAlertsQuery: AlertsQueryPlugin<AlertManagerAlertsQuerySpec> = {\n getAlertsData,\n OptionsEditorComponent: AlertManagerAlertsQueryEditor,\n createInitialOptions: (): AlertManagerAlertsQuerySpec => ({\n datasource: undefined,\n filters: [],\n active: true,\n silenced: false,\n inhibited: false,\n receiver: undefined,\n }),\n dependsOn: (spec: AlertManagerAlertsQuerySpec) => {\n const datasourceVariables = isVariableDatasource(spec.datasource) ? parseVariables(spec.datasource ?? '') : [];\n const filterVariables = spec.filters?.flatMap((f) => parseVariables(f)) ?? [];\n const receiverVariables = spec.receiver ? parseVariables(spec.receiver) : [];\n return {\n variables: [...new Set([...datasourceVariables, ...filterVariables, ...receiverVariables])],\n };\n },\n};\n"],"names":["isVariableDatasource","parseVariables","getAlertsData","AlertManagerAlertsQueryEditor","AlertManagerAlertsQuery","OptionsEditorComponent","createInitialOptions","datasource","undefined","filters","active","silenced","inhibited","receiver","dependsOn","spec","datasourceVariables","filterVariables","flatMap","f","receiverVariables","variables","Set"],"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,SAA4BA,oBAAoB,EAAEC,cAAc,QAAQ,4BAA4B;AAEpG,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,6BAA6B,QAAQ,kCAAkC;AAEhF,OAAO,MAAMC,0BAA0E;IACrFF;IACAG,wBAAwBF;IACxBG,sBAAsB,IAAoC,CAAA;YACxDC,YAAYC;YACZC,SAAS,EAAE;YACXC,QAAQ;YACRC,UAAU;YACVC,WAAW;YACXC,UAAUL;QACZ,CAAA;IACAM,WAAW,CAACC;QACV,MAAMC,sBAAsBhB,qBAAqBe,KAAKR,UAAU,IAAIN,eAAec,KAAKR,UAAU,IAAI,MAAM,EAAE;QAC9G,MAAMU,kBAAkBF,KAAKN,OAAO,EAAES,QAAQ,CAACC,IAAMlB,eAAekB,OAAO,EAAE;QAC7E,MAAMC,oBAAoBL,KAAKF,QAAQ,GAAGZ,eAAec,KAAKF,QAAQ,IAAI,EAAE;QAC5E,OAAO;YACLQ,WAAW;mBAAI,IAAIC,IAAI;uBAAIN;uBAAwBC;uBAAoBG;iBAAkB;aAAE;QAC7F;IACF;AACF,EAAE"}
@@ -0,0 +1,9 @@
1
+ import { ReactElement } from 'react';
2
+ import { AlertManagerAlertsQuerySpec } from '../types';
3
+ interface AlertManagerAlertsQueryEditorProps {
4
+ value: AlertManagerAlertsQuerySpec;
5
+ onChange: (next: AlertManagerAlertsQuerySpec) => void;
6
+ }
7
+ export declare function AlertManagerAlertsQueryEditor(props: AlertManagerAlertsQueryEditorProps): ReactElement;
8
+ export {};
9
+ //# sourceMappingURL=AlertManagerAlertsQueryEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlertManagerAlertsQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,YAAY,EAAe,MAAM,OAAO,CAAC;AAQlD,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAEvD,UAAU,kCAAkC;IAC1C,KAAK,EAAE,2BAA2B,CAAC;IACnC,QAAQ,EAAE,CAAC,IAAI,EAAE,2BAA2B,KAAK,IAAI,CAAC;CACvD;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,kCAAkC,GAAG,YAAY,CAyHrG"}
@@ -0,0 +1,130 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Copyright The Perses Authors
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { Checkbox, FormControl, FormControlLabel, Stack } from '@mui/material';
15
+ import { useId } from '@perses-dev/components';
16
+ import { DatasourceSelect } from '@perses-dev/plugin-system';
17
+ import { produce } from 'immer';
18
+ import { useCallback } from 'react';
19
+ import { LazyTextField } from '../../components/LazyTextField';
20
+ import { ALERTMANAGER_DATASOURCE_KIND, DEFAULT_ALERTMANAGER, isAlertManagerDatasourceSelector, isDefaultAlertManagerSelector } from '../../model';
21
+ export function AlertManagerAlertsQueryEditor(props) {
22
+ const { onChange, value } = props;
23
+ const datasourceSelectValue = value.datasource ?? DEFAULT_ALERTMANAGER;
24
+ const datasourceSelectLabelID = useId('alertmanager-datasource-label');
25
+ const handleDatasourceChange = (next)=>{
26
+ if (isAlertManagerDatasourceSelector(next)) {
27
+ onChange(produce(value, (draft)=>{
28
+ draft.datasource = isDefaultAlertManagerSelector(next) ? undefined : next;
29
+ }));
30
+ return;
31
+ }
32
+ throw new Error('Got unexpected non-AlertManager datasource selector');
33
+ };
34
+ const handleFiltersChange = useCallback((filtersText)=>{
35
+ onChange(produce(value, (draft)=>{
36
+ draft.filters = filtersText.split('\n').map((f)=>f.trim()).filter((f)=>f !== '');
37
+ }));
38
+ }, [
39
+ onChange,
40
+ value
41
+ ]);
42
+ const handleBooleanChange = useCallback((field, checked)=>{
43
+ onChange(produce(value, (draft)=>{
44
+ draft[field] = checked;
45
+ }));
46
+ }, [
47
+ onChange,
48
+ value
49
+ ]);
50
+ const handleReceiverChange = useCallback((receiver)=>{
51
+ onChange(produce(value, (draft)=>{
52
+ draft.receiver = receiver.trim() === '' ? undefined : receiver.trim();
53
+ }));
54
+ }, [
55
+ onChange,
56
+ value
57
+ ]);
58
+ return /*#__PURE__*/ _jsxs(Stack, {
59
+ spacing: 2,
60
+ children: [
61
+ /*#__PURE__*/ _jsx(FormControl, {
62
+ margin: "dense",
63
+ fullWidth: false,
64
+ children: /*#__PURE__*/ _jsx(DatasourceSelect, {
65
+ datasourcePluginKind: ALERTMANAGER_DATASOURCE_KIND,
66
+ value: datasourceSelectValue,
67
+ onChange: handleDatasourceChange,
68
+ labelId: datasourceSelectLabelID,
69
+ label: "Alert Manager Datasource",
70
+ notched: true
71
+ })
72
+ }),
73
+ /*#__PURE__*/ _jsxs(Stack, {
74
+ direction: "row",
75
+ spacing: 2,
76
+ sx: {
77
+ flexWrap: 'wrap',
78
+ rowGap: 1
79
+ },
80
+ children: [
81
+ /*#__PURE__*/ _jsx(FormControlLabel, {
82
+ control: /*#__PURE__*/ _jsx(Checkbox, {
83
+ checked: value.active ?? true,
84
+ onChange: (e)=>handleBooleanChange('active', e.target.checked)
85
+ }),
86
+ label: "Active"
87
+ }),
88
+ /*#__PURE__*/ _jsx(FormControlLabel, {
89
+ control: /*#__PURE__*/ _jsx(Checkbox, {
90
+ checked: value.silenced ?? false,
91
+ onChange: (e)=>handleBooleanChange('silenced', e.target.checked)
92
+ }),
93
+ label: "Silenced"
94
+ }),
95
+ /*#__PURE__*/ _jsx(FormControlLabel, {
96
+ control: /*#__PURE__*/ _jsx(Checkbox, {
97
+ checked: value.inhibited ?? false,
98
+ onChange: (e)=>handleBooleanChange('inhibited', e.target.checked)
99
+ }),
100
+ label: "Inhibited"
101
+ }),
102
+ /*#__PURE__*/ _jsx(FormControlLabel, {
103
+ control: /*#__PURE__*/ _jsx(Checkbox, {
104
+ checked: value.unprocessed ?? false,
105
+ onChange: (e)=>handleBooleanChange('unprocessed', e.target.checked)
106
+ }),
107
+ label: "Unprocessed"
108
+ })
109
+ ]
110
+ }),
111
+ /*#__PURE__*/ _jsx(LazyTextField, {
112
+ label: "Receiver",
113
+ value: value.receiver,
114
+ onCommit: handleReceiverChange,
115
+ placeholder: "e.g. team-a"
116
+ }),
117
+ /*#__PURE__*/ _jsx(LazyTextField, {
118
+ label: "Filters (one per line)",
119
+ value: (value.filters ?? []).join('\n'),
120
+ onCommit: handleFiltersChange,
121
+ placeholder: 'alertname="HighMemory"\nseverity="critical"\nenvironment=~"${env:pipe}"',
122
+ helperText: "PromQL-style matchers, one per line.",
123
+ multiline: true,
124
+ minRows: 3
125
+ })
126
+ ]
127
+ });
128
+ }
129
+
130
+ //# sourceMappingURL=AlertManagerAlertsQueryEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.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 { Checkbox, FormControl, FormControlLabel, Stack } from '@mui/material';\nimport { useId } from '@perses-dev/components';\nimport { DatasourceSelect, DatasourceSelectProps } from '@perses-dev/plugin-system';\nimport { produce } from 'immer';\nimport { ReactElement, useCallback } from 'react';\nimport { LazyTextField } from '../../components/LazyTextField';\nimport {\n ALERTMANAGER_DATASOURCE_KIND,\n DEFAULT_ALERTMANAGER,\n isAlertManagerDatasourceSelector,\n isDefaultAlertManagerSelector,\n} from '../../model';\nimport { AlertManagerAlertsQuerySpec } from '../types';\n\ninterface AlertManagerAlertsQueryEditorProps {\n value: AlertManagerAlertsQuerySpec;\n onChange: (next: AlertManagerAlertsQuerySpec) => void;\n}\n\nexport function AlertManagerAlertsQueryEditor(props: AlertManagerAlertsQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const datasourceSelectValue = value.datasource ?? DEFAULT_ALERTMANAGER;\n const datasourceSelectLabelID = useId('alertmanager-datasource-label');\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (next) => {\n if (isAlertManagerDatasourceSelector(next)) {\n onChange(\n produce(value, (draft) => {\n draft.datasource = isDefaultAlertManagerSelector(next) ? undefined : next;\n })\n );\n return;\n }\n\n throw new Error('Got unexpected non-AlertManager datasource selector');\n };\n\n const handleFiltersChange = useCallback(\n (filtersText: string): void => {\n onChange(\n produce(value, (draft) => {\n draft.filters = filtersText\n .split('\\n')\n .map((f) => f.trim())\n .filter((f) => f !== '');\n })\n );\n },\n [onChange, value]\n );\n\n const handleBooleanChange = useCallback(\n (field: 'active' | 'silenced' | 'inhibited' | 'unprocessed', checked: boolean): void => {\n onChange(\n produce(value, (draft) => {\n draft[field] = checked;\n })\n );\n },\n [onChange, value]\n );\n\n const handleReceiverChange = useCallback(\n (receiver: string): void => {\n onChange(\n produce(value, (draft) => {\n draft.receiver = receiver.trim() === '' ? undefined : receiver.trim();\n })\n );\n },\n [onChange, value]\n );\n\n return (\n <Stack spacing={2}>\n <FormControl margin=\"dense\" fullWidth={false}>\n <DatasourceSelect\n datasourcePluginKind={ALERTMANAGER_DATASOURCE_KIND}\n value={datasourceSelectValue}\n onChange={handleDatasourceChange}\n labelId={datasourceSelectLabelID}\n label=\"Alert Manager Datasource\"\n notched\n />\n </FormControl>\n <Stack direction=\"row\" spacing={2} sx={{ flexWrap: 'wrap', rowGap: 1 }}>\n <FormControlLabel\n control={\n <Checkbox\n checked={value.active ?? true}\n onChange={(e) => handleBooleanChange('active', e.target.checked)}\n />\n }\n label=\"Active\"\n />\n <FormControlLabel\n control={\n <Checkbox\n checked={value.silenced ?? false}\n onChange={(e) => handleBooleanChange('silenced', e.target.checked)}\n />\n }\n label=\"Silenced\"\n />\n <FormControlLabel\n control={\n <Checkbox\n checked={value.inhibited ?? false}\n onChange={(e) => handleBooleanChange('inhibited', e.target.checked)}\n />\n }\n label=\"Inhibited\"\n />\n <FormControlLabel\n control={\n <Checkbox\n checked={value.unprocessed ?? false}\n onChange={(e) => handleBooleanChange('unprocessed', e.target.checked)}\n />\n }\n label=\"Unprocessed\"\n />\n </Stack>\n <LazyTextField\n label=\"Receiver\"\n value={value.receiver}\n onCommit={handleReceiverChange}\n placeholder=\"e.g. team-a\"\n />\n <LazyTextField\n label=\"Filters (one per line)\"\n value={(value.filters ?? []).join('\\n')}\n onCommit={handleFiltersChange}\n placeholder={'alertname=\"HighMemory\"\\nseverity=\"critical\"\\nenvironment=~\"${env:pipe}\"'}\n helperText=\"PromQL-style matchers, one per line.\"\n multiline\n minRows={3}\n />\n </Stack>\n );\n}\n"],"names":["Checkbox","FormControl","FormControlLabel","Stack","useId","DatasourceSelect","produce","useCallback","LazyTextField","ALERTMANAGER_DATASOURCE_KIND","DEFAULT_ALERTMANAGER","isAlertManagerDatasourceSelector","isDefaultAlertManagerSelector","AlertManagerAlertsQueryEditor","props","onChange","value","datasourceSelectValue","datasource","datasourceSelectLabelID","handleDatasourceChange","next","draft","undefined","Error","handleFiltersChange","filtersText","filters","split","map","f","trim","filter","handleBooleanChange","field","checked","handleReceiverChange","receiver","spacing","margin","fullWidth","datasourcePluginKind","labelId","label","notched","direction","sx","flexWrap","rowGap","control","active","e","target","silenced","inhibited","unprocessed","onCommit","placeholder","join","helperText","multiline","minRows"],"mappings":"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"}
@@ -0,0 +1,8 @@
1
+ import { AlertsQueryContext } from '@perses-dev/plugin-system';
2
+ import { AlertsData } from '@perses-dev/spec';
3
+ import { AlertManagerAlertsQuerySpec } from '../types';
4
+ /**
5
+ * Get alerts data from Alert Manager, transforming the API response into the plugin-system AlertsData format.
6
+ */
7
+ export declare function getAlertsData(spec: AlertManagerAlertsQuerySpec, context: AlertsQueryContext): Promise<AlertsData>;
8
+ //# sourceMappingURL=get-alerts-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-alerts-data.d.ts","sourceRoot":"","sources":["../../../../src/plugins/alertmanager-alerts-query/get-alerts-data.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAqD,MAAM,2BAA2B,CAAC;AAClH,OAAO,EAAqB,UAAU,EAAmB,MAAM,kBAAkB,CAAC;AAElF,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AA0EvD;;GAEG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,2BAA2B,EACjC,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,UAAU,CAAC,CA4BrB"}
@@ -0,0 +1,118 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { datasourceSelectValueToSelector, replaceVariables } from '@perses-dev/plugin-system';
14
+ import { ALERTMANAGER_DATASOURCE_KIND, DEFAULT_ALERTMANAGER } from '../../model';
15
+ /**
16
+ * Map Alertmanager API alert state to the generic AlertState.
17
+ *
18
+ * AM `active` → generic `firing`
19
+ * AM `suppressed` → generic `firing` (with `suppressed: true`)
20
+ * AM `unprocessed` → generic `pending`
21
+ */ function mapAlertState(amState) {
22
+ switch(amState){
23
+ case 'active':
24
+ case 'suppressed':
25
+ return 'firing';
26
+ case 'unprocessed':
27
+ return 'pending';
28
+ }
29
+ }
30
+ /**
31
+ * Build SuppressionRule entries from the Alertmanager status fields.
32
+ */ function buildSuppressionRules(status) {
33
+ const rules = [];
34
+ for (const id of status.silencedBy){
35
+ rules.push({
36
+ type: 'silence',
37
+ id
38
+ });
39
+ }
40
+ for (const id of status.inhibitedBy){
41
+ rules.push({
42
+ type: 'inhibition',
43
+ id
44
+ });
45
+ }
46
+ for (const id of status.mutedBy){
47
+ rules.push({
48
+ type: 'mute',
49
+ id
50
+ });
51
+ }
52
+ return rules;
53
+ }
54
+ /**
55
+ * Transform a GettableAlert from the Alertmanager API into our normalized Alert format.
56
+ */ function transformAlert(apiAlert) {
57
+ const isSuppressed = apiAlert.status.state === 'suppressed';
58
+ const suppressionRules = buildSuppressionRules(apiAlert.status);
59
+ const alert = {
60
+ id: apiAlert.fingerprint,
61
+ name: apiAlert.labels['alertname'] ?? '',
62
+ state: mapAlertState(apiAlert.status.state),
63
+ labels: apiAlert.labels,
64
+ annotations: apiAlert.annotations,
65
+ startsAt: apiAlert.startsAt,
66
+ endsAt: apiAlert.endsAt,
67
+ updatedAt: apiAlert.updatedAt,
68
+ receivers: apiAlert.receivers.map((r)=>r.name)
69
+ };
70
+ if (apiAlert.labels['severity']) {
71
+ alert.severity = apiAlert.labels['severity'];
72
+ }
73
+ if (apiAlert.generatorURL) {
74
+ alert.sourceURL = apiAlert.generatorURL;
75
+ }
76
+ if (isSuppressed) {
77
+ alert.suppressed = true;
78
+ }
79
+ if (suppressionRules.length > 0) {
80
+ alert.suppressedBy = suppressionRules;
81
+ }
82
+ return alert;
83
+ }
84
+ /**
85
+ * Get alerts data from Alert Manager, transforming the API response into the plugin-system AlertsData format.
86
+ */ export async function getAlertsData(spec, context) {
87
+ const listDatasourceSelectItems = await context.datasourceStore.listDatasourceSelectItems(ALERTMANAGER_DATASOURCE_KIND);
88
+ const datasourceSelector = datasourceSelectValueToSelector(spec.datasource, context.variableState, listDatasourceSelectItems) ?? DEFAULT_ALERTMANAGER;
89
+ const client = await context.datasourceStore.getDatasourceClient(datasourceSelector);
90
+ const interpolatedFilters = spec.filters?.map((f)=>replaceVariables(f, context.variableState));
91
+ const interpolatedReceiver = spec.receiver ? replaceVariables(spec.receiver, context.variableState) : undefined;
92
+ const apiAlerts = await client.getAlerts({
93
+ filter: interpolatedFilters,
94
+ active: spec.active,
95
+ silenced: spec.silenced,
96
+ inhibited: spec.inhibited,
97
+ unprocessed: spec.unprocessed,
98
+ receiver: interpolatedReceiver
99
+ });
100
+ const alerts = apiAlerts.map(transformAlert);
101
+ return {
102
+ alerts,
103
+ metadata: {
104
+ executedQueryString: buildQueryString(spec)
105
+ }
106
+ };
107
+ }
108
+ function buildQueryString(spec) {
109
+ return JSON.stringify(Object.fromEntries(Object.entries({
110
+ filters: spec.filters,
111
+ active: spec.active,
112
+ silenced: spec.silenced,
113
+ inhibited: spec.inhibited,
114
+ receiver: spec.receiver
115
+ }).filter(([, value])=>value !== undefined)));
116
+ }
117
+
118
+ //# sourceMappingURL=get-alerts-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/plugins/alertmanager-alerts-query/get-alerts-data.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 { AlertsQueryContext, datasourceSelectValueToSelector, replaceVariables } from '@perses-dev/plugin-system';\nimport { Alert, AlertState, AlertsData, SuppressionRule } from '@perses-dev/spec';\nimport { ALERTMANAGER_DATASOURCE_KIND, AlertManagerClient, DEFAULT_ALERTMANAGER, GettableAlert } from '../../model';\nimport { AlertManagerAlertsQuerySpec } from '../types';\n\n/**\n * Map Alertmanager API alert state to the generic AlertState.\n *\n * AM `active` → generic `firing`\n * AM `suppressed` → generic `firing` (with `suppressed: true`)\n * AM `unprocessed` → generic `pending`\n */\nfunction mapAlertState(amState: 'unprocessed' | 'active' | 'suppressed'): AlertState {\n switch (amState) {\n case 'active':\n case 'suppressed':\n return 'firing';\n case 'unprocessed':\n return 'pending';\n }\n}\n\n/**\n * Build SuppressionRule entries from the Alertmanager status fields.\n */\nfunction buildSuppressionRules(status: GettableAlert['status']): SuppressionRule[] {\n const rules: SuppressionRule[] = [];\n for (const id of status.silencedBy) {\n rules.push({ type: 'silence', id });\n }\n for (const id of status.inhibitedBy) {\n rules.push({ type: 'inhibition', id });\n }\n for (const id of status.mutedBy) {\n rules.push({ type: 'mute', id });\n }\n return rules;\n}\n\n/**\n * Transform a GettableAlert from the Alertmanager API into our normalized Alert format.\n */\nfunction transformAlert(apiAlert: GettableAlert): Alert {\n const isSuppressed = apiAlert.status.state === 'suppressed';\n const suppressionRules = buildSuppressionRules(apiAlert.status);\n\n const alert: Alert = {\n id: apiAlert.fingerprint,\n name: apiAlert.labels['alertname'] ?? '',\n state: mapAlertState(apiAlert.status.state),\n labels: apiAlert.labels,\n annotations: apiAlert.annotations,\n startsAt: apiAlert.startsAt,\n endsAt: apiAlert.endsAt,\n updatedAt: apiAlert.updatedAt,\n receivers: apiAlert.receivers.map((r) => r.name),\n };\n\n if (apiAlert.labels['severity']) {\n alert.severity = apiAlert.labels['severity'];\n }\n\n if (apiAlert.generatorURL) {\n alert.sourceURL = apiAlert.generatorURL;\n }\n\n if (isSuppressed) {\n alert.suppressed = true;\n }\n\n if (suppressionRules.length > 0) {\n alert.suppressedBy = suppressionRules;\n }\n\n return alert;\n}\n\n/**\n * Get alerts data from Alert Manager, transforming the API response into the plugin-system AlertsData format.\n */\nexport async function getAlertsData(\n spec: AlertManagerAlertsQuerySpec,\n context: AlertsQueryContext\n): Promise<AlertsData> {\n const listDatasourceSelectItems =\n await context.datasourceStore.listDatasourceSelectItems(ALERTMANAGER_DATASOURCE_KIND);\n const datasourceSelector =\n datasourceSelectValueToSelector(spec.datasource, context.variableState, listDatasourceSelectItems) ??\n DEFAULT_ALERTMANAGER;\n const client = await context.datasourceStore.getDatasourceClient<AlertManagerClient>(datasourceSelector);\n\n const interpolatedFilters = spec.filters?.map((f) => replaceVariables(f, context.variableState));\n const interpolatedReceiver = spec.receiver ? replaceVariables(spec.receiver, context.variableState) : undefined;\n\n const apiAlerts = await client.getAlerts({\n filter: interpolatedFilters,\n active: spec.active,\n silenced: spec.silenced,\n inhibited: spec.inhibited,\n unprocessed: spec.unprocessed,\n receiver: interpolatedReceiver,\n });\n\n const alerts = apiAlerts.map(transformAlert);\n\n return {\n alerts,\n metadata: {\n executedQueryString: buildQueryString(spec),\n },\n };\n}\n\nfunction buildQueryString(spec: AlertManagerAlertsQuerySpec): string {\n return JSON.stringify(\n Object.fromEntries(\n Object.entries({\n filters: spec.filters,\n active: spec.active,\n silenced: spec.silenced,\n inhibited: spec.inhibited,\n receiver: spec.receiver,\n }).filter(([, value]) => value !== undefined)\n )\n );\n}\n"],"names":["datasourceSelectValueToSelector","replaceVariables","ALERTMANAGER_DATASOURCE_KIND","DEFAULT_ALERTMANAGER","mapAlertState","amState","buildSuppressionRules","status","rules","id","silencedBy","push","type","inhibitedBy","mutedBy","transformAlert","apiAlert","isSuppressed","state","suppressionRules","alert","fingerprint","name","labels","annotations","startsAt","endsAt","updatedAt","receivers","map","r","severity","generatorURL","sourceURL","suppressed","length","suppressedBy","getAlertsData","spec","context","listDatasourceSelectItems","datasourceStore","datasourceSelector","datasource","variableState","client","getDatasourceClient","interpolatedFilters","filters","f","interpolatedReceiver","receiver","undefined","apiAlerts","getAlerts","filter","active","silenced","inhibited","unprocessed","alerts","metadata","executedQueryString","buildQueryString","JSON","stringify","Object","fromEntries","entries","value"],"mappings":"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"}
@@ -0,0 +1,5 @@
1
+ import { DatasourcePlugin } from '@perses-dev/plugin-system';
2
+ import { AlertManagerClient } from '../model';
3
+ import { AlertManagerDatasourceSpec } from './types';
4
+ export declare const AlertManagerDatasource: DatasourcePlugin<AlertManagerDatasourceSpec, AlertManagerClient>;
5
+ //# sourceMappingURL=alertmanager-datasource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alertmanager-datasource.d.ts","sourceRoot":"","sources":["../../../src/plugins/alertmanager-datasource.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,kBAAkB,EAOnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AA8BrD,eAAO,MAAM,sBAAsB,EAAE,gBAAgB,CAAC,0BAA0B,EAAE,kBAAkB,CAInG,CAAC"}
@@ -0,0 +1,61 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { getAlerts, getSilences, getSilence, createSilence, deleteSilence, getStatus } from '../model';
14
+ import { AlertManagerDatasourceEditor } from './AlertManagerDatasourceEditor';
15
+ const createClient = (spec, options)=>{
16
+ const { directUrl, proxy } = spec;
17
+ const { proxyUrl } = options;
18
+ const datasourceUrl = directUrl ?? proxyUrl;
19
+ if (datasourceUrl === undefined) {
20
+ throw new Error('No URL specified for Alert Manager client. You can use directUrl in the spec to configure it.');
21
+ }
22
+ const specHeaders = proxy?.spec.headers;
23
+ return {
24
+ options: {
25
+ datasourceUrl
26
+ },
27
+ getAlerts: (params, headers)=>getAlerts(params, {
28
+ datasourceUrl,
29
+ headers: headers ?? specHeaders
30
+ }),
31
+ getSilences: (params, headers)=>getSilences(params, {
32
+ datasourceUrl,
33
+ headers: headers ?? specHeaders
34
+ }),
35
+ getSilence: (id, headers)=>getSilence(id, {
36
+ datasourceUrl,
37
+ headers: headers ?? specHeaders
38
+ }),
39
+ createSilence: (silence, headers)=>createSilence(silence, {
40
+ datasourceUrl,
41
+ headers: headers ?? specHeaders
42
+ }),
43
+ deleteSilence: (id, headers)=>deleteSilence(id, {
44
+ datasourceUrl,
45
+ headers: headers ?? specHeaders
46
+ }),
47
+ getStatus: (headers)=>getStatus({
48
+ datasourceUrl,
49
+ headers: headers ?? specHeaders
50
+ })
51
+ };
52
+ };
53
+ export const AlertManagerDatasource = {
54
+ createClient,
55
+ OptionsEditorComponent: AlertManagerDatasourceEditor,
56
+ createInitialOptions: ()=>({
57
+ directUrl: ''
58
+ })
59
+ };
60
+
61
+ //# sourceMappingURL=alertmanager-datasource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/plugins/alertmanager-datasource.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 { DatasourcePlugin } from '@perses-dev/plugin-system';\nimport {\n AlertManagerClient,\n getAlerts,\n getSilences,\n getSilence,\n createSilence,\n deleteSilence,\n getStatus,\n} from '../model';\nimport { AlertManagerDatasourceSpec } from './types';\nimport { AlertManagerDatasourceEditor } from './AlertManagerDatasourceEditor';\n\nconst createClient: DatasourcePlugin<AlertManagerDatasourceSpec, AlertManagerClient>['createClient'] = (\n spec,\n options\n) => {\n const { directUrl, proxy } = spec;\n const { proxyUrl } = options;\n\n const datasourceUrl = directUrl ?? proxyUrl;\n if (datasourceUrl === undefined) {\n throw new Error('No URL specified for Alert Manager client. You can use directUrl in the spec to configure it.');\n }\n\n const specHeaders = proxy?.spec.headers;\n\n return {\n options: {\n datasourceUrl,\n },\n getAlerts: (params, headers) => getAlerts(params, { datasourceUrl, headers: headers ?? specHeaders }),\n getSilences: (params, headers) => getSilences(params, { datasourceUrl, headers: headers ?? specHeaders }),\n getSilence: (id, headers) => getSilence(id, { datasourceUrl, headers: headers ?? specHeaders }),\n createSilence: (silence, headers) => createSilence(silence, { datasourceUrl, headers: headers ?? specHeaders }),\n deleteSilence: (id, headers) => deleteSilence(id, { datasourceUrl, headers: headers ?? specHeaders }),\n getStatus: (headers) => getStatus({ datasourceUrl, headers: headers ?? specHeaders }),\n };\n};\n\nexport const AlertManagerDatasource: DatasourcePlugin<AlertManagerDatasourceSpec, AlertManagerClient> = {\n createClient,\n OptionsEditorComponent: AlertManagerDatasourceEditor,\n createInitialOptions: () => ({ directUrl: '' }),\n};\n"],"names":["getAlerts","getSilences","getSilence","createSilence","deleteSilence","getStatus","AlertManagerDatasourceEditor","createClient","spec","options","directUrl","proxy","proxyUrl","datasourceUrl","undefined","Error","specHeaders","headers","params","id","silence","AlertManagerDatasource","OptionsEditorComponent","createInitialOptions"],"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,SAEEA,SAAS,EACTC,WAAW,EACXC,UAAU,EACVC,aAAa,EACbC,aAAa,EACbC,SAAS,QACJ,WAAW;AAElB,SAASC,4BAA4B,QAAQ,iCAAiC;AAE9E,MAAMC,eAAiG,CACrGC,MACAC;IAEA,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGH;IAC7B,MAAM,EAAEI,QAAQ,EAAE,GAAGH;IAErB,MAAMI,gBAAgBH,aAAaE;IACnC,IAAIC,kBAAkBC,WAAW;QAC/B,MAAM,IAAIC,MAAM;IAClB;IAEA,MAAMC,cAAcL,OAAOH,KAAKS;IAEhC,OAAO;QACLR,SAAS;YACPI;QACF;QACAb,WAAW,CAACkB,QAAQD,UAAYjB,UAAUkB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QACnGf,aAAa,CAACiB,QAAQD,UAAYhB,YAAYiB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QACvGd,YAAY,CAACiB,IAAIF,UAAYf,WAAWiB,IAAI;gBAAEN;gBAAeI,SAASA,WAAWD;YAAY;QAC7Fb,eAAe,CAACiB,SAASH,UAAYd,cAAciB,SAAS;gBAAEP;gBAAeI,SAASA,WAAWD;YAAY;QAC7GZ,eAAe,CAACe,IAAIF,UAAYb,cAAce,IAAI;gBAAEN;gBAAeI,SAASA,WAAWD;YAAY;QACnGX,WAAW,CAACY,UAAYZ,UAAU;gBAAEQ;gBAAeI,SAASA,WAAWD;YAAY;IACrF;AACF;AAEA,OAAO,MAAMK,yBAA2F;IACtGd;IACAe,wBAAwBhB;IACxBiB,sBAAsB,IAAO,CAAA;YAAEb,WAAW;QAAG,CAAA;AAC/C,EAAE"}
@@ -0,0 +1,4 @@
1
+ import { SilencesQueryPlugin } from '@perses-dev/plugin-system';
2
+ import { AlertManagerSilencesQuerySpec } from '../types';
3
+ export declare const AlertManagerSilencesQuery: SilencesQueryPlugin<AlertManagerSilencesQuerySpec>;
4
+ //# sourceMappingURL=AlertManagerSilencesQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlertManagerSilencesQuery.d.ts","sourceRoot":"","sources":["../../../../src/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.ts"],"names":[],"mappings":"AAaA,OAAO,EAAwC,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACtG,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAIzD,eAAO,MAAM,yBAAyB,EAAE,mBAAmB,CAAC,6BAA6B,CAcxF,CAAC"}