@perses-dev/loki-plugin 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/LICENSE +201 -0
  2. package/__mf/css/async/1320.7ad02b85.css +1 -0
  3. package/__mf/css/async/2341.7ad02b85.css +1 -0
  4. package/__mf/css/async/9479.7ad02b85.css +1 -0
  5. package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
  6. package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
  7. package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
  8. package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
  9. package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
  10. package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
  11. package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
  12. package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
  13. package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
  14. package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
  15. package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
  16. package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
  17. package/__mf/js/Loki.3789d265.js +5 -0
  18. package/__mf/js/async/1320.ca6d65b6.js +2 -0
  19. package/__mf/js/async/1320.ca6d65b6.js.LICENSE.txt +9 -0
  20. package/__mf/js/async/1540.6b797827.js +74 -0
  21. package/__mf/js/async/1964.7b2e7223.js +2 -0
  22. package/__mf/js/async/1964.7b2e7223.js.LICENSE.txt +9 -0
  23. package/__mf/js/async/2292.35c2eeec.js +2 -0
  24. package/__mf/js/async/2292.35c2eeec.js.LICENSE.txt +24 -0
  25. package/__mf/js/async/2417.993ba27f.js +2 -0
  26. package/__mf/js/async/2417.993ba27f.js.LICENSE.txt +9 -0
  27. package/__mf/js/async/2448.6a132c1c.js +10 -0
  28. package/__mf/js/async/2448.6a132c1c.js.LICENSE.txt +17 -0
  29. package/__mf/js/async/2470.ba894af3.js +7 -0
  30. package/__mf/js/async/2470.ba894af3.js.LICENSE.txt +21 -0
  31. package/__mf/js/async/2651.ef335482.js +1 -0
  32. package/__mf/js/async/282.3d82e785.js +1 -0
  33. package/__mf/js/async/3224.b1170acc.js +1 -0
  34. package/__mf/js/async/3413.6dd92cfd.js +1 -0
  35. package/__mf/js/async/3431.2270637c.js +1 -0
  36. package/__mf/js/async/3849.c4035be2.js +1 -0
  37. package/__mf/js/async/3863.16343b76.js +2 -0
  38. package/__mf/js/async/3863.16343b76.js.LICENSE.txt +9 -0
  39. package/__mf/js/async/3960.6091bb00.js +2 -0
  40. package/__mf/js/async/3960.6091bb00.js.LICENSE.txt +8 -0
  41. package/__mf/js/async/3980.08ab4aef.js +2 -0
  42. package/__mf/js/async/3980.08ab4aef.js.LICENSE.txt +9 -0
  43. package/__mf/js/async/4075.ea5435c6.js +1 -0
  44. package/__mf/js/async/4168.645bbaa1.js +2 -0
  45. package/__mf/js/async/4238.ac5f0a30.js +1 -0
  46. package/__mf/js/async/4269.b4d0f49d.js +2 -0
  47. package/__mf/js/async/4269.b4d0f49d.js.LICENSE.txt +9 -0
  48. package/__mf/js/async/4368.40ff20c1.js +2 -0
  49. package/__mf/js/async/4368.40ff20c1.js.LICENSE.txt +15 -0
  50. package/__mf/js/async/4421.8aeb683a.js +1 -0
  51. package/__mf/js/async/4687.1af57d71.js +2 -0
  52. package/__mf/js/async/4687.1af57d71.js.LICENSE.txt +9 -0
  53. package/__mf/js/async/4693.ba67a5aa.js +1 -0
  54. package/__mf/js/async/5035.15709e1b.js +73 -0
  55. package/__mf/js/async/5035.15709e1b.js.LICENSE.txt +19 -0
  56. package/__mf/js/async/5214.fee648bb.js +1 -0
  57. package/__mf/js/async/5409.ff95cf63.js +1 -0
  58. package/__mf/js/async/5713.3b303108.js +1 -0
  59. package/__mf/js/async/5780.d837c3cd.js +1 -0
  60. package/__mf/js/async/5876.5618763d.js +2 -0
  61. package/__mf/js/async/5876.5618763d.js.LICENSE.txt +21 -0
  62. package/__mf/js/async/592.269748ce.js +1 -0
  63. package/__mf/js/async/5981.a46c5157.js +2 -0
  64. package/__mf/js/async/5981.a46c5157.js.LICENSE.txt +8 -0
  65. package/__mf/js/async/6292.9997ca36.js +1 -0
  66. package/__mf/js/async/6333.01fb6457.js +2 -0
  67. package/__mf/js/async/6333.01fb6457.js.LICENSE.txt +9 -0
  68. package/__mf/js/async/6377.9f308c7f.js +2 -0
  69. package/__mf/js/async/6377.9f308c7f.js.LICENSE.txt +32 -0
  70. package/__mf/js/async/6569.f33ecbef.js +1 -0
  71. package/__mf/js/async/6664.078084ff.js +28 -0
  72. package/__mf/js/async/6770.ba5a38f3.js +1 -0
  73. package/__mf/js/async/694.c25a1f84.js +1 -0
  74. package/__mf/js/async/7376.0459aaf7.js +1 -0
  75. package/__mf/js/async/738.a16c93b6.js +1 -0
  76. package/__mf/js/async/7740.6f193fac.js +1 -0
  77. package/__mf/js/async/8216.d9cc6234.js +1 -0
  78. package/__mf/js/async/8488.5b4b7170.js +1 -0
  79. package/__mf/js/async/8537.dc791586.js +1 -0
  80. package/__mf/js/async/9173.75bbe78a.js +2 -0
  81. package/__mf/js/async/9173.75bbe78a.js.LICENSE.txt +19 -0
  82. package/__mf/js/async/9479.f74b4605.js +1 -0
  83. package/__mf/js/async/9654.575f5449.js +37 -0
  84. package/__mf/js/async/__federation_expose_LogsTable.0bf7a331.js +2 -0
  85. package/__mf/js/async/__federation_expose_LogsTable.0bf7a331.js.LICENSE.txt +9 -0
  86. package/__mf/js/async/__federation_expose_LokiDatasource.875ecaed.js +2 -0
  87. package/__mf/js/async/__federation_expose_LokiDatasource.875ecaed.js.LICENSE.txt +9 -0
  88. package/__mf/js/async/__federation_expose_LokiLogQuery.b5fd8404.js +1 -0
  89. package/__mf/js/async/__federation_expose_LokiTimeSeriesQuery.8e1af800.js +1 -0
  90. package/__mf/js/main.925fc3bf.js +5 -0
  91. package/lib/bootstrap.d.ts +2 -0
  92. package/lib/bootstrap.d.ts.map +1 -0
  93. package/lib/bootstrap.js +7 -0
  94. package/lib/bootstrap.js.map +1 -0
  95. package/lib/cjs/bootstrap.js +14 -0
  96. package/lib/cjs/components/index.js +23 -0
  97. package/lib/cjs/components/logql-editor.js +110 -0
  98. package/lib/cjs/components/logql-extension.js +55 -0
  99. package/lib/cjs/components/logql-highlight.js +40 -0
  100. package/lib/cjs/datasources/index.js +30 -0
  101. package/lib/cjs/datasources/loki-datasource/LokiDatasource.js +77 -0
  102. package/lib/cjs/datasources/loki-datasource/LokiDatasourceEditor.js +83 -0
  103. package/lib/cjs/datasources/loki-datasource/index.js +32 -0
  104. package/lib/cjs/datasources/loki-datasource/loki-datasource-types.js +16 -0
  105. package/lib/cjs/env.d.js +2 -0
  106. package/lib/cjs/getPluginModule.js +27 -0
  107. package/lib/cjs/index-federation.js +43 -0
  108. package/lib/cjs/index.js +28 -0
  109. package/lib/cjs/model/index.js +31 -0
  110. package/lib/cjs/model/loki-client-types.js +16 -0
  111. package/lib/cjs/model/loki-client.js +198 -0
  112. package/lib/cjs/model/loki-data-types.js +16 -0
  113. package/lib/cjs/model/loki-selectors.js +47 -0
  114. package/lib/cjs/panels/index.js +30 -0
  115. package/lib/cjs/panels/logstable/LogsTable.js +41 -0
  116. package/lib/cjs/panels/logstable/LogsTableComponent.js +43 -0
  117. package/lib/cjs/panels/logstable/LogsTableSettingsEditor.js +70 -0
  118. package/lib/cjs/panels/logstable/components/EmptyLogsState.js +49 -0
  119. package/lib/cjs/panels/logstable/components/LogRow/LogRow.js +158 -0
  120. package/lib/cjs/panels/logstable/components/LogRow/LogTimestamp.js +44 -0
  121. package/lib/cjs/panels/logstable/components/LogRow/LogsLabelsTable.js +74 -0
  122. package/lib/cjs/panels/logstable/components/LogRow/LogsStyles.js +77 -0
  123. package/lib/cjs/panels/logstable/components/LogRow/index.js +37 -0
  124. package/lib/cjs/panels/logstable/components/LogsList.js +44 -0
  125. package/lib/cjs/panels/logstable/components/VirtualizedLogsList.js +63 -0
  126. package/lib/cjs/panels/logstable/components/index.js +23 -0
  127. package/lib/cjs/panels/logstable/components/utils.js +39 -0
  128. package/lib/cjs/panels/logstable/hooks/useExpandedRows.js +45 -0
  129. package/lib/cjs/panels/logstable/hooks/useSeverity.js +43 -0
  130. package/lib/cjs/panels/logstable/index.js +33 -0
  131. package/lib/cjs/panels/logstable/logs-types.js +16 -0
  132. package/lib/cjs/queries/constants.js +22 -0
  133. package/lib/cjs/queries/index.js +31 -0
  134. package/lib/cjs/queries/loki-log-query/LokiLogQuery.js +31 -0
  135. package/lib/cjs/queries/loki-log-query/LokiLogQueryEditor.js +157 -0
  136. package/lib/cjs/queries/loki-log-query/get-loki-log-data.js +74 -0
  137. package/lib/cjs/queries/loki-log-query/index.js +21 -0
  138. package/lib/cjs/queries/loki-log-query/log-query-plugin-interface.js +4 -0
  139. package/lib/cjs/queries/loki-log-query/loki-log-query-types.js +4 -0
  140. package/lib/cjs/queries/loki-time-series-query/LokiTimeSeriesQuery.js +43 -0
  141. package/lib/cjs/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js +118 -0
  142. package/lib/cjs/queries/loki-time-series-query/get-loki-time-series-data.js +120 -0
  143. package/lib/cjs/queries/loki-time-series-query/index.js +33 -0
  144. package/lib/cjs/queries/loki-time-series-query/loki-time-series-query-types.js +16 -0
  145. package/lib/cjs/setup-tests.js +7 -0
  146. package/lib/components/index.d.ts +3 -0
  147. package/lib/components/index.d.ts.map +1 -0
  148. package/lib/components/index.js +15 -0
  149. package/lib/components/index.js.map +1 -0
  150. package/lib/components/logql-editor.d.ts +5 -0
  151. package/lib/components/logql-editor.d.ts.map +1 -0
  152. package/lib/components/logql-editor.js +61 -0
  153. package/lib/components/logql-editor.js.map +1 -0
  154. package/lib/components/logql-extension.d.ts +4 -0
  155. package/lib/components/logql-extension.d.ts.map +1 -0
  156. package/lib/components/logql-extension.js +47 -0
  157. package/lib/components/logql-extension.js.map +1 -0
  158. package/lib/components/logql-highlight.d.ts +2 -0
  159. package/lib/components/logql-highlight.d.ts.map +1 -0
  160. package/lib/components/logql-highlight.js +32 -0
  161. package/lib/components/logql-highlight.js.map +1 -0
  162. package/lib/datasources/index.d.ts +2 -0
  163. package/lib/datasources/index.d.ts.map +1 -0
  164. package/lib/datasources/index.js +15 -0
  165. package/lib/datasources/index.js.map +1 -0
  166. package/lib/datasources/loki-datasource/LokiDatasource.d.ts +5 -0
  167. package/lib/datasources/loki-datasource/LokiDatasource.d.ts.map +1 -0
  168. package/lib/datasources/loki-datasource/LokiDatasource.js +69 -0
  169. package/lib/datasources/loki-datasource/LokiDatasource.js.map +1 -0
  170. package/lib/datasources/loki-datasource/LokiDatasourceEditor.d.ts +9 -0
  171. package/lib/datasources/loki-datasource/LokiDatasourceEditor.d.ts.map +1 -0
  172. package/lib/datasources/loki-datasource/LokiDatasourceEditor.js +75 -0
  173. package/lib/datasources/loki-datasource/LokiDatasourceEditor.js.map +1 -0
  174. package/lib/datasources/loki-datasource/index.d.ts +4 -0
  175. package/lib/datasources/loki-datasource/index.d.ts.map +1 -0
  176. package/lib/datasources/loki-datasource/index.js +17 -0
  177. package/lib/datasources/loki-datasource/index.js.map +1 -0
  178. package/lib/datasources/loki-datasource/loki-datasource-types.d.ts +6 -0
  179. package/lib/datasources/loki-datasource/loki-datasource-types.d.ts.map +1 -0
  180. package/lib/datasources/loki-datasource/loki-datasource-types.js +15 -0
  181. package/lib/datasources/loki-datasource/loki-datasource-types.js.map +1 -0
  182. package/lib/env.d.js +3 -0
  183. package/lib/env.d.js.map +1 -0
  184. package/lib/getPluginModule.d.ts +6 -0
  185. package/lib/getPluginModule.d.ts.map +1 -0
  186. package/lib/getPluginModule.js +16 -0
  187. package/lib/getPluginModule.js.map +1 -0
  188. package/lib/index-federation.d.ts +1 -0
  189. package/lib/index-federation.d.ts.map +1 -0
  190. package/lib/index-federation.js +3 -0
  191. package/lib/index-federation.js.map +1 -0
  192. package/lib/index.d.ts +6 -0
  193. package/lib/index.d.ts.map +1 -0
  194. package/lib/index.js +7 -0
  195. package/lib/index.js.map +1 -0
  196. package/lib/model/index.d.ts +3 -0
  197. package/lib/model/index.d.ts.map +1 -0
  198. package/lib/model/index.js +16 -0
  199. package/lib/model/index.js.map +1 -0
  200. package/lib/model/loki-client-types.d.ts +65 -0
  201. package/lib/model/loki-client-types.d.ts.map +1 -0
  202. package/lib/model/loki-client-types.js +15 -0
  203. package/lib/model/loki-client-types.js.map +1 -0
  204. package/lib/model/loki-client.d.ts +50 -0
  205. package/lib/model/loki-client.d.ts.map +1 -0
  206. package/lib/model/loki-client.js +161 -0
  207. package/lib/model/loki-client.js.map +1 -0
  208. package/lib/model/loki-data-types.d.ts +24 -0
  209. package/lib/model/loki-data-types.d.ts.map +1 -0
  210. package/lib/model/loki-data-types.js +15 -0
  211. package/lib/model/loki-data-types.js.map +1 -0
  212. package/lib/model/loki-selectors.d.ts +10 -0
  213. package/lib/model/loki-selectors.d.ts.map +1 -0
  214. package/lib/model/loki-selectors.js +25 -0
  215. package/lib/model/loki-selectors.js.map +1 -0
  216. package/lib/panels/index.d.ts +2 -0
  217. package/lib/panels/index.d.ts.map +1 -0
  218. package/lib/panels/index.js +15 -0
  219. package/lib/panels/index.js.map +1 -0
  220. package/lib/panels/logstable/LogsTable.d.ts +4 -0
  221. package/lib/panels/logstable/LogsTable.d.ts.map +1 -0
  222. package/lib/panels/logstable/LogsTable.js +33 -0
  223. package/lib/panels/logstable/LogsTable.js.map +1 -0
  224. package/lib/panels/logstable/LogsTableComponent.d.ts +4 -0
  225. package/lib/panels/logstable/LogsTableComponent.d.ts.map +1 -0
  226. package/lib/panels/logstable/LogsTableComponent.js +35 -0
  227. package/lib/panels/logstable/LogsTableComponent.js.map +1 -0
  228. package/lib/panels/logstable/LogsTableSettingsEditor.d.ts +7 -0
  229. package/lib/panels/logstable/LogsTableSettingsEditor.d.ts.map +1 -0
  230. package/lib/panels/logstable/LogsTableSettingsEditor.js +62 -0
  231. package/lib/panels/logstable/LogsTableSettingsEditor.js.map +1 -0
  232. package/lib/panels/logstable/components/EmptyLogsState.d.ts +7 -0
  233. package/lib/panels/logstable/components/EmptyLogsState.d.ts.map +1 -0
  234. package/lib/panels/logstable/components/EmptyLogsState.js +36 -0
  235. package/lib/panels/logstable/components/EmptyLogsState.js.map +1 -0
  236. package/lib/panels/logstable/components/LogRow/LogRow.d.ts +14 -0
  237. package/lib/panels/logstable/components/LogRow/LogRow.d.ts.map +1 -0
  238. package/lib/panels/logstable/components/LogRow/LogRow.js +104 -0
  239. package/lib/panels/logstable/components/LogRow/LogRow.js.map +1 -0
  240. package/lib/panels/logstable/components/LogRow/LogTimestamp.d.ts +7 -0
  241. package/lib/panels/logstable/components/LogRow/LogTimestamp.d.ts.map +1 -0
  242. package/lib/panels/logstable/components/LogRow/LogTimestamp.js +31 -0
  243. package/lib/panels/logstable/components/LogRow/LogTimestamp.js.map +1 -0
  244. package/lib/panels/logstable/components/LogRow/LogsLabelsTable.d.ts +7 -0
  245. package/lib/panels/logstable/components/LogRow/LogsLabelsTable.d.ts.map +1 -0
  246. package/lib/panels/logstable/components/LogRow/LogsLabelsTable.js +61 -0
  247. package/lib/panels/logstable/components/LogRow/LogsLabelsTable.js.map +1 -0
  248. package/lib/panels/logstable/components/LogRow/LogsStyles.d.ts +22 -0
  249. package/lib/panels/logstable/components/LogRow/LogsStyles.d.ts.map +1 -0
  250. package/lib/panels/logstable/components/LogRow/LogsStyles.js +55 -0
  251. package/lib/panels/logstable/components/LogRow/LogsStyles.js.map +1 -0
  252. package/lib/panels/logstable/components/LogRow/index.d.ts +3 -0
  253. package/lib/panels/logstable/components/LogRow/index.d.ts.map +1 -0
  254. package/lib/panels/logstable/components/LogRow/index.js +16 -0
  255. package/lib/panels/logstable/components/LogRow/index.js.map +1 -0
  256. package/lib/panels/logstable/components/LogsList.d.ts +10 -0
  257. package/lib/panels/logstable/components/LogsList.d.ts.map +1 -0
  258. package/lib/panels/logstable/components/LogsList.js +31 -0
  259. package/lib/panels/logstable/components/LogsList.js.map +1 -0
  260. package/lib/panels/logstable/components/VirtualizedLogsList.d.ts +12 -0
  261. package/lib/panels/logstable/components/VirtualizedLogsList.d.ts.map +1 -0
  262. package/lib/panels/logstable/components/VirtualizedLogsList.js +50 -0
  263. package/lib/panels/logstable/components/VirtualizedLogsList.js.map +1 -0
  264. package/lib/panels/logstable/components/index.d.ts +2 -0
  265. package/lib/panels/logstable/components/index.d.ts.map +1 -0
  266. package/lib/panels/logstable/components/index.js +15 -0
  267. package/lib/panels/logstable/components/index.js.map +1 -0
  268. package/lib/panels/logstable/components/utils.d.ts +3 -0
  269. package/lib/panels/logstable/components/utils.d.ts.map +1 -0
  270. package/lib/panels/logstable/components/utils.js +31 -0
  271. package/lib/panels/logstable/components/utils.js.map +1 -0
  272. package/lib/panels/logstable/hooks/useExpandedRows.d.ts +6 -0
  273. package/lib/panels/logstable/hooks/useExpandedRows.d.ts.map +1 -0
  274. package/lib/panels/logstable/hooks/useExpandedRows.js +37 -0
  275. package/lib/panels/logstable/hooks/useExpandedRows.js.map +1 -0
  276. package/lib/panels/logstable/hooks/useSeverity.d.ts +3 -0
  277. package/lib/panels/logstable/hooks/useSeverity.d.ts.map +1 -0
  278. package/lib/panels/logstable/hooks/useSeverity.js +35 -0
  279. package/lib/panels/logstable/hooks/useSeverity.js.map +1 -0
  280. package/lib/panels/logstable/index.d.ts +5 -0
  281. package/lib/panels/logstable/index.d.ts.map +1 -0
  282. package/lib/panels/logstable/index.js +18 -0
  283. package/lib/panels/logstable/index.js.map +1 -0
  284. package/lib/panels/logstable/logs-types.d.ts +11 -0
  285. package/lib/panels/logstable/logs-types.d.ts.map +1 -0
  286. package/lib/panels/logstable/logs-types.js +15 -0
  287. package/lib/panels/logstable/logs-types.js.map +1 -0
  288. package/lib/queries/constants.d.ts +5 -0
  289. package/lib/queries/constants.d.ts.map +1 -0
  290. package/lib/queries/constants.js +6 -0
  291. package/lib/queries/constants.js.map +1 -0
  292. package/lib/queries/index.d.ts +3 -0
  293. package/lib/queries/index.d.ts.map +1 -0
  294. package/lib/queries/index.js +16 -0
  295. package/lib/queries/index.js.map +1 -0
  296. package/lib/queries/loki-log-query/LokiLogQuery.d.ts +4 -0
  297. package/lib/queries/loki-log-query/LokiLogQuery.d.ts.map +1 -0
  298. package/lib/queries/loki-log-query/LokiLogQuery.js +23 -0
  299. package/lib/queries/loki-log-query/LokiLogQuery.js.map +1 -0
  300. package/lib/queries/loki-log-query/LokiLogQueryEditor.d.ts +7 -0
  301. package/lib/queries/loki-log-query/LokiLogQueryEditor.d.ts.map +1 -0
  302. package/lib/queries/loki-log-query/LokiLogQueryEditor.js +149 -0
  303. package/lib/queries/loki-log-query/LokiLogQueryEditor.js.map +1 -0
  304. package/lib/queries/loki-log-query/get-loki-log-data.d.ts +4 -0
  305. package/lib/queries/loki-log-query/get-loki-log-data.d.ts.map +1 -0
  306. package/lib/queries/loki-log-query/get-loki-log-data.js +66 -0
  307. package/lib/queries/loki-log-query/get-loki-log-data.js.map +1 -0
  308. package/lib/queries/loki-log-query/index.d.ts +5 -0
  309. package/lib/queries/loki-log-query/index.d.ts.map +1 -0
  310. package/lib/queries/loki-log-query/index.js +6 -0
  311. package/lib/queries/loki-log-query/index.js.map +1 -0
  312. package/lib/queries/loki-log-query/log-query-plugin-interface.d.ts +25 -0
  313. package/lib/queries/loki-log-query/log-query-plugin-interface.d.ts.map +1 -0
  314. package/lib/queries/loki-log-query/log-query-plugin-interface.js +3 -0
  315. package/lib/queries/loki-log-query/log-query-plugin-interface.js.map +1 -0
  316. package/lib/queries/loki-log-query/loki-log-query-types.d.ts +9 -0
  317. package/lib/queries/loki-log-query/loki-log-query-types.d.ts.map +1 -0
  318. package/lib/queries/loki-log-query/loki-log-query-types.js +3 -0
  319. package/lib/queries/loki-log-query/loki-log-query-types.js.map +1 -0
  320. package/lib/queries/loki-time-series-query/LokiTimeSeriesQuery.d.ts +4 -0
  321. package/lib/queries/loki-time-series-query/LokiTimeSeriesQuery.d.ts.map +1 -0
  322. package/lib/queries/loki-time-series-query/LokiTimeSeriesQuery.js +35 -0
  323. package/lib/queries/loki-time-series-query/LokiTimeSeriesQuery.js.map +1 -0
  324. package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.d.ts +7 -0
  325. package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.d.ts.map +1 -0
  326. package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js +110 -0
  327. package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js.map +1 -0
  328. package/lib/queries/loki-time-series-query/get-loki-time-series-data.d.ts +12 -0
  329. package/lib/queries/loki-time-series-query/get-loki-time-series-data.d.ts.map +1 -0
  330. package/lib/queries/loki-time-series-query/get-loki-time-series-data.js +112 -0
  331. package/lib/queries/loki-time-series-query/get-loki-time-series-data.js.map +1 -0
  332. package/lib/queries/loki-time-series-query/index.d.ts +5 -0
  333. package/lib/queries/loki-time-series-query/index.d.ts.map +1 -0
  334. package/lib/queries/loki-time-series-query/index.js +18 -0
  335. package/lib/queries/loki-time-series-query/index.js.map +1 -0
  336. package/lib/queries/loki-time-series-query/loki-time-series-query-types.d.ts +9 -0
  337. package/lib/queries/loki-time-series-query/loki-time-series-query-types.d.ts.map +1 -0
  338. package/lib/queries/loki-time-series-query/loki-time-series-query-types.js +15 -0
  339. package/lib/queries/loki-time-series-query/loki-time-series-query-types.js.map +1 -0
  340. package/lib/setup-tests.d.ts +2 -0
  341. package/lib/setup-tests.d.ts.map +1 -0
  342. package/lib/setup-tests.js +5 -0
  343. package/lib/setup-tests.js.map +1 -0
  344. package/mf-manifest.json +528 -0
  345. package/mf-stats.json +584 -0
  346. package/package.json +7 -7
@@ -0,0 +1,118 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "LokiQueryEditor", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return LokiQueryEditor;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _pluginsystem = require("@perses-dev/plugin-system");
25
+ const _material = require("@mui/material");
26
+ const _react = require("react");
27
+ const _logqleditor = require("../../components/logql-editor");
28
+ const _model = require("../../model");
29
+ const _constants = require("../constants");
30
+ function LokiQueryEditor(props) {
31
+ const { onChange, value } = props;
32
+ const { datasource } = value;
33
+ const datasourceSelectValue = datasource ?? _constants.DEFAULT_DATASOURCE;
34
+ const selectedDatasource = (0, _pluginsystem.useDatasourceSelectValueToSelector)(datasourceSelectValue, _model.LOKI_DATASOURCE_KIND);
35
+ // const { data: client } = useDatasourceClient<LokiClient>(selectedDatasource);
36
+ // const lokiURL = client?.options.datasourceUrl;
37
+ // Local state for editor value to prevent query_range calls on every keystroke
38
+ const [localQuery, setLocalQuery] = (0, _react.useState)(value.query);
39
+ // Update local state when prop changes
40
+ (0, _react.useEffect)(()=>{
41
+ setLocalQuery(value.query);
42
+ }, [
43
+ value.query
44
+ ]);
45
+ const handleDatasourceChange = (newDatasourceSelection)=>{
46
+ if (!(0, _pluginsystem.isVariableDatasource)(newDatasourceSelection) && newDatasourceSelection.kind === _constants.DATASOURCE_KIND) {
47
+ onChange({
48
+ ...value,
49
+ datasource: newDatasourceSelection
50
+ });
51
+ return;
52
+ }
53
+ throw new Error('Got unexpected non LokiQuery datasource selection');
54
+ };
55
+ // Debounced query change handler to prevent excessive query_range calls
56
+ const handleQueryChange = (0, _react.useCallback)((newQuery)=>{
57
+ setLocalQuery(newQuery);
58
+ }, []);
59
+ // Immediate query execution on Enter or blur
60
+ const handleQueryExecute = (0, _react.useCallback)((query)=>{
61
+ onChange({
62
+ ...value,
63
+ query
64
+ });
65
+ }, [
66
+ onChange,
67
+ value
68
+ ]);
69
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
70
+ spacing: 1.5,
71
+ paddingBottom: 1,
72
+ children: [
73
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
74
+ children: [
75
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputLabel, {
76
+ sx: {
77
+ display: 'block',
78
+ marginBottom: '4px',
79
+ fontWeight: 500
80
+ },
81
+ children: "Datasource"
82
+ }),
83
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceSelect, {
84
+ datasourcePluginKind: _constants.DATASOURCE_KIND,
85
+ value: selectedDatasource,
86
+ onChange: handleDatasourceChange,
87
+ label: "Loki Datasource",
88
+ notched: true
89
+ })
90
+ ]
91
+ }),
92
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
93
+ children: [
94
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputLabel, {
95
+ sx: {
96
+ display: 'block',
97
+ marginBottom: '4px',
98
+ fontWeight: 500
99
+ },
100
+ children: "LogQL Query"
101
+ }),
102
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_logqleditor.LogQLEditor, {
103
+ value: localQuery,
104
+ onChange: handleQueryChange,
105
+ onBlur: ()=>handleQueryExecute(localQuery),
106
+ onKeyDown: (event)=>{
107
+ if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {
108
+ event.preventDefault();
109
+ handleQueryExecute(localQuery);
110
+ }
111
+ },
112
+ placeholder: 'Enter LogQL query (e.g. {job="mysql"} |= "error")'
113
+ })
114
+ ]
115
+ })
116
+ ]
117
+ });
118
+ }
@@ -0,0 +1,120 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "getLokiTimeSeriesData", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return getLokiTimeSeriesData;
21
+ }
22
+ });
23
+ const _core = require("@perses-dev/core");
24
+ const _pluginsystem = require("@perses-dev/plugin-system");
25
+ const _datefns = require("date-fns");
26
+ const _constants = require("../constants");
27
+ // Constants for Loki step calculation
28
+ const MAX_LOKI_DATA_POINTS = 10000; // Similar to Prometheus
29
+ const DEFAULT_MIN_STEP_SECONDS = 15; // 15 seconds default minimum
30
+ /**
31
+ * Converts a duration string (like "15s", "1m") to seconds
32
+ */ function getDurationStringSeconds(durationString) {
33
+ if (!durationString) return undefined;
34
+ const duration = (0, _core.parseDurationString)(durationString);
35
+ const ms = (0, _datefns.milliseconds)(duration);
36
+ return Math.floor(ms / 1000);
37
+ }
38
+ /**
39
+ * Calculates appropriate step for Loki range queries
40
+ */ function getLokiRangeStep(startMs, endMs, minStepSeconds = DEFAULT_MIN_STEP_SECONDS, suggestedStepMs = 0) {
41
+ const suggestedStepSeconds = suggestedStepMs / 1000;
42
+ const queryRangeSeconds = (endMs - startMs) / 1000;
43
+ let safeStep = queryRangeSeconds / MAX_LOKI_DATA_POINTS;
44
+ if (safeStep > 1) {
45
+ safeStep = Math.ceil(safeStep);
46
+ }
47
+ return Math.max(suggestedStepSeconds, minStepSeconds, safeStep);
48
+ }
49
+ /**
50
+ * Formats step in seconds as a duration string for Loki API
51
+ */ function formatStepForLoki(stepSeconds) {
52
+ if (stepSeconds < 60) {
53
+ return `${Math.round(stepSeconds)}s`;
54
+ } else if (stepSeconds < 3600) {
55
+ return `${Math.round(stepSeconds / 60)}m`;
56
+ } else {
57
+ return `${Math.round(stepSeconds / 3600)}h`;
58
+ }
59
+ }
60
+ function convertMatrixToTimeSeries(matrix) {
61
+ return matrix.map((series)=>{
62
+ const name = Object.entries(series.metric).map(([k, v])=>`${k}=${v}`).join(', ');
63
+ return {
64
+ name,
65
+ values: series.values.map(([timestamp, value])=>[
66
+ Number(timestamp) * 1000,
67
+ Number(value)
68
+ ]),
69
+ labels: series.metric
70
+ };
71
+ });
72
+ }
73
+ const getLokiTimeSeriesData = async (spec, context)=>{
74
+ if (!spec.query) {
75
+ return {
76
+ series: [],
77
+ timeRange: {
78
+ start: context.timeRange.start,
79
+ end: context.timeRange.end
80
+ },
81
+ stepMs: DEFAULT_MIN_STEP_SECONDS * 1000
82
+ };
83
+ }
84
+ const query = (0, _pluginsystem.replaceVariables)(spec.query, context.variableState);
85
+ const client = await context.datasourceStore.getDatasourceClient(spec.datasource ?? _constants.DEFAULT_DATASOURCE);
86
+ const { start, end } = context.timeRange;
87
+ // Calculate proper step using similar logic to Prometheus
88
+ const minStepSeconds = spec.step ? getDurationStringSeconds(spec.step) ?? DEFAULT_MIN_STEP_SECONDS : DEFAULT_MIN_STEP_SECONDS;
89
+ const stepSeconds = getLokiRangeStep(start.getTime(), end.getTime(), minStepSeconds, context.suggestedStepMs);
90
+ const stepString = formatStepForLoki(stepSeconds);
91
+ const stepMs = stepSeconds * 1000;
92
+ const response = await client.queryRange({
93
+ query,
94
+ start: start.getTime().toString(),
95
+ end: end.getTime().toString(),
96
+ step: stepString
97
+ });
98
+ if (response.data.resultType === 'matrix') {
99
+ const convertedSeries = convertMatrixToTimeSeries(response.data.result);
100
+ return {
101
+ series: convertedSeries,
102
+ timeRange: {
103
+ start,
104
+ end
105
+ },
106
+ stepMs,
107
+ metadata: {
108
+ executedQueryString: query
109
+ }
110
+ };
111
+ }
112
+ return {
113
+ series: [],
114
+ timeRange: {
115
+ start,
116
+ end
117
+ },
118
+ stepMs
119
+ };
120
+ };
@@ -0,0 +1,33 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ _export_star(require("./get-loki-time-series-data"), exports);
18
+ _export_star(require("./LokiTimeSeriesQuery"), exports);
19
+ _export_star(require("./LokiTimeSeriesQueryEditor"), exports);
20
+ _export_star(require("./loki-time-series-query-types"), exports);
21
+ function _export_star(from, to) {
22
+ Object.keys(from).forEach(function(k) {
23
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
24
+ Object.defineProperty(to, k, {
25
+ enumerable: true,
26
+ get: function() {
27
+ return from[k];
28
+ }
29
+ });
30
+ }
31
+ });
32
+ return from;
33
+ }
@@ -0,0 +1,16 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ require("@testing-library/jest-dom");
6
+ // Always mock e-charts during tests since we don't have a proper canvas in jsdom
7
+ jest.mock('echarts/core');
@@ -0,0 +1,3 @@
1
+ export { LogQLEditor } from './logql-editor';
2
+ export type { LogQLEditorProps } from './logql-editor';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,15 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export { LogQLEditor } from './logql-editor';
14
+
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/index.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\nexport { LogQLEditor } from './logql-editor';\nexport type { LogQLEditorProps } from './logql-editor';\n"],"names":["LogQLEditor"],"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,WAAW,QAAQ,iBAAiB"}
@@ -0,0 +1,5 @@
1
+ import { ReactElement } from 'react';
2
+ import { ReactCodeMirrorProps } from '@uiw/react-codemirror';
3
+ export type LogQLEditorProps = Omit<ReactCodeMirrorProps, 'theme' | 'extensions'>;
4
+ export declare function LogQLEditor(props: LogQLEditorProps): ReactElement;
5
+ //# sourceMappingURL=logql-editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logql-editor.d.ts","sourceRoot":"","sources":["../../../src/components/logql-editor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAE9C,OAAmB,EAAc,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAGrF,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,YAAY,CAAC,CAAC;AAElF,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAyCjE"}
@@ -0,0 +1,61 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { useMemo } from 'react';
15
+ import { useTheme } from '@mui/material';
16
+ import CodeMirror, { EditorView } from '@uiw/react-codemirror';
17
+ import { LogQLExtension } from './logql-extension';
18
+ export function LogQLEditor(props) {
19
+ const theme = useTheme();
20
+ const isDarkMode = theme.palette.mode === 'dark';
21
+ const logqlExtension = useMemo(()=>{
22
+ return LogQLExtension();
23
+ }, []);
24
+ const codemirrorTheme = useMemo(()=>{
25
+ const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
26
+ return EditorView.theme({
27
+ '&': {
28
+ backgroundColor: 'transparent !important',
29
+ border: `1px solid ${borderColor}`,
30
+ borderRadius: `${theme.shape.borderRadius}px`
31
+ },
32
+ '&.cm-focused.cm-editor': {
33
+ outline: 'none'
34
+ },
35
+ '.cm-content': {
36
+ padding: '8px'
37
+ }
38
+ });
39
+ }, [
40
+ theme
41
+ ]);
42
+ return /*#__PURE__*/ _jsx(CodeMirror, {
43
+ ...props,
44
+ theme: isDarkMode ? 'dark' : 'light',
45
+ basicSetup: {
46
+ lineNumbers: false,
47
+ highlightActiveLine: false,
48
+ highlightActiveLineGutter: false,
49
+ foldGutter: false,
50
+ syntaxHighlighting: true
51
+ },
52
+ extensions: [
53
+ EditorView.lineWrapping,
54
+ logqlExtension,
55
+ codemirrorTheme
56
+ ],
57
+ placeholder: 'Example: {job="my-service"} |= "error"'
58
+ });
59
+ }
60
+
61
+ //# sourceMappingURL=logql-editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/logql-editor.tsx"],"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 { ReactElement, useMemo } from 'react';\nimport { useTheme } from '@mui/material';\nimport CodeMirror, { EditorView, ReactCodeMirrorProps } from '@uiw/react-codemirror';\nimport { LogQLExtension } from './logql-extension';\n\nexport type LogQLEditorProps = Omit<ReactCodeMirrorProps, 'theme' | 'extensions'>;\n\nexport function LogQLEditor(props: LogQLEditorProps): ReactElement {\n const theme = useTheme();\n const isDarkMode = theme.palette.mode === 'dark';\n\n const logqlExtension = useMemo(() => {\n return LogQLExtension();\n }, []);\n\n const codemirrorTheme = useMemo(() => {\n const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';\n\n return EditorView.theme({\n '&': {\n backgroundColor: 'transparent !important', // required for dark mode\n border: `1px solid ${borderColor}`,\n borderRadius: `${theme.shape.borderRadius}px`,\n },\n '&.cm-focused.cm-editor': {\n outline: 'none',\n },\n '.cm-content': {\n padding: '8px',\n },\n });\n }, [theme]);\n\n return (\n <CodeMirror\n {...props}\n theme={isDarkMode ? 'dark' : 'light'}\n basicSetup={{\n lineNumbers: false,\n highlightActiveLine: false,\n highlightActiveLineGutter: false,\n foldGutter: false,\n syntaxHighlighting: true,\n }}\n extensions={[EditorView.lineWrapping, logqlExtension, codemirrorTheme]}\n placeholder='Example: {job=\"my-service\"} |= \"error\"'\n />\n );\n}\n"],"names":["useMemo","useTheme","CodeMirror","EditorView","LogQLExtension","LogQLEditor","props","theme","isDarkMode","palette","mode","logqlExtension","codemirrorTheme","borderColor","backgroundColor","border","borderRadius","shape","outline","padding","basicSetup","lineNumbers","highlightActiveLine","highlightActiveLineGutter","foldGutter","syntaxHighlighting","extensions","lineWrapping","placeholder"],"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,SAAuBA,OAAO,QAAQ,QAAQ;AAC9C,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,cAAcC,UAAU,QAA8B,wBAAwB;AACrF,SAASC,cAAc,QAAQ,oBAAoB;AAInD,OAAO,SAASC,YAAYC,KAAuB;IACjD,MAAMC,QAAQN;IACd,MAAMO,aAAaD,MAAME,OAAO,CAACC,IAAI,KAAK;IAE1C,MAAMC,iBAAiBX,QAAQ;QAC7B,OAAOI;IACT,GAAG,EAAE;IAEL,MAAMQ,kBAAkBZ,QAAQ;QAC9B,MAAMa,cAAcN,MAAME,OAAO,CAACC,IAAI,KAAK,UAAU,wBAAwB;QAE7E,OAAOP,WAAWI,KAAK,CAAC;YACtB,KAAK;gBACHO,iBAAiB;gBACjBC,QAAQ,CAAC,UAAU,EAAEF,aAAa;gBAClCG,cAAc,GAAGT,MAAMU,KAAK,CAACD,YAAY,CAAC,EAAE,CAAC;YAC/C;YACA,0BAA0B;gBACxBE,SAAS;YACX;YACA,eAAe;gBACbC,SAAS;YACX;QACF;IACF,GAAG;QAACZ;KAAM;IAEV,qBACE,KAACL;QACE,GAAGI,KAAK;QACTC,OAAOC,aAAa,SAAS;QAC7BY,YAAY;YACVC,aAAa;YACbC,qBAAqB;YACrBC,2BAA2B;YAC3BC,YAAY;YACZC,oBAAoB;QACtB;QACAC,YAAY;YAACvB,WAAWwB,YAAY;YAAEhB;YAAgBC;SAAgB;QACtEgB,aAAY;;AAGlB"}
@@ -0,0 +1,4 @@
1
+ import { LRLanguage } from '@codemirror/language';
2
+ import { Extension } from '@uiw/react-codemirror';
3
+ export declare function LogQLExtension(): Array<LRLanguage | Extension>;
4
+ //# sourceMappingURL=logql-extension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logql-extension.d.ts","sourceRoot":"","sources":["../../../src/components/logql-extension.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAelD,wBAAgB,cAAc,IAAI,KAAK,CAAC,UAAU,GAAG,SAAS,CAAC,CAG9D"}
@@ -0,0 +1,47 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { LRLanguage } from '@codemirror/language';
14
+ import { parser } from '@grafana/lezer-logql';
15
+ import { logqlHighlight } from './logql-highlight';
16
+ function logqlLanguage() {
17
+ return LRLanguage.define({
18
+ parser: parser.configure({
19
+ props: [
20
+ logqlHighlight
21
+ ]
22
+ }),
23
+ languageData: {
24
+ closeBrackets: {
25
+ brackets: [
26
+ '(',
27
+ '[',
28
+ '{',
29
+ "'",
30
+ '"',
31
+ '`'
32
+ ]
33
+ },
34
+ commentTokens: {
35
+ line: '#'
36
+ }
37
+ }
38
+ });
39
+ }
40
+ export function LogQLExtension() {
41
+ const language = logqlLanguage();
42
+ return [
43
+ language
44
+ ];
45
+ }
46
+
47
+ //# sourceMappingURL=logql-extension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/logql-extension.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 { LRLanguage } from '@codemirror/language';\nimport { parser } from '@grafana/lezer-logql';\nimport { Extension } from '@uiw/react-codemirror';\nimport { logqlHighlight } from './logql-highlight';\n\nfunction logqlLanguage(): LRLanguage {\n return LRLanguage.define({\n parser: parser.configure({\n props: [logqlHighlight],\n }),\n languageData: {\n closeBrackets: { brackets: ['(', '[', '{', \"'\", '\"', '`'] },\n commentTokens: { line: '#' },\n },\n });\n}\n\nexport function LogQLExtension(): Array<LRLanguage | Extension> {\n const language = logqlLanguage();\n return [language];\n}\n"],"names":["LRLanguage","parser","logqlHighlight","logqlLanguage","define","configure","props","languageData","closeBrackets","brackets","commentTokens","line","LogQLExtension","language"],"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,UAAU,QAAQ,uBAAuB;AAClD,SAASC,MAAM,QAAQ,uBAAuB;AAE9C,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SAASC;IACP,OAAOH,WAAWI,MAAM,CAAC;QACvBH,QAAQA,OAAOI,SAAS,CAAC;YACvBC,OAAO;gBAACJ;aAAe;QACzB;QACAK,cAAc;YACZC,eAAe;gBAAEC,UAAU;oBAAC;oBAAK;oBAAK;oBAAK;oBAAK;oBAAK;iBAAI;YAAC;YAC1DC,eAAe;gBAAEC,MAAM;YAAI;QAC7B;IACF;AACF;AAEA,OAAO,SAASC;IACd,MAAMC,WAAWV;IACjB,OAAO;QAACU;KAAS;AACnB"}
@@ -0,0 +1,2 @@
1
+ export declare const logqlHighlight: import("@lezer/common").NodePropSource;
2
+ //# sourceMappingURL=logql-highlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logql-highlight.d.ts","sourceRoot":"","sources":["../../../src/components/logql-highlight.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,cAAc,wCAgBzB,CAAC"}
@@ -0,0 +1,32 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { styleTags, tags } from '@lezer/highlight';
14
+ export const logqlHighlight = styleTags({
15
+ LineComment: tags.comment,
16
+ 'Identifier StreamSelector': tags.labelName,
17
+ 'LabelName LabelMatcher': tags.labelName,
18
+ String: tags.string,
19
+ 'Number Float Duration': tags.number,
20
+ 'LogRangeAggregation VectorAggregation': tags.function(tags.keyword),
21
+ 'And Or Unless': tags.logicOperator,
22
+ 'Eq Neq Re Nre Gt Lt Gte Lte': tags.compareOperator,
23
+ 'Add Sub Mul Div Mod Pow': tags.arithmeticOperator,
24
+ Pipe: tags.operator,
25
+ 'By Without': tags.keyword,
26
+ '( )': tags.paren,
27
+ '[ ]': tags.squareBracket,
28
+ '{ }': tags.brace,
29
+ '⚠': tags.invalid
30
+ });
31
+
32
+ //# sourceMappingURL=logql-highlight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/logql-highlight.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 { styleTags, tags } from '@lezer/highlight';\n\nexport const logqlHighlight = styleTags({\n LineComment: tags.comment,\n 'Identifier StreamSelector': tags.labelName,\n 'LabelName LabelMatcher': tags.labelName,\n String: tags.string,\n 'Number Float Duration': tags.number,\n 'LogRangeAggregation VectorAggregation': tags.function(tags.keyword),\n 'And Or Unless': tags.logicOperator,\n 'Eq Neq Re Nre Gt Lt Gte Lte': tags.compareOperator,\n 'Add Sub Mul Div Mod Pow': tags.arithmeticOperator,\n Pipe: tags.operator,\n 'By Without': tags.keyword,\n '( )': tags.paren,\n '[ ]': tags.squareBracket,\n '{ }': tags.brace,\n '⚠': tags.invalid,\n});\n"],"names":["styleTags","tags","logqlHighlight","LineComment","comment","labelName","String","string","number","function","keyword","logicOperator","compareOperator","arithmeticOperator","Pipe","operator","paren","squareBracket","brace","invalid"],"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,SAAS,EAAEC,IAAI,QAAQ,mBAAmB;AAEnD,OAAO,MAAMC,iBAAiBF,UAAU;IACtCG,aAAaF,KAAKG,OAAO;IACzB,6BAA6BH,KAAKI,SAAS;IAC3C,0BAA0BJ,KAAKI,SAAS;IACxCC,QAAQL,KAAKM,MAAM;IACnB,yBAAyBN,KAAKO,MAAM;IACpC,yCAAyCP,KAAKQ,QAAQ,CAACR,KAAKS,OAAO;IACnE,iBAAiBT,KAAKU,aAAa;IACnC,+BAA+BV,KAAKW,eAAe;IACnD,2BAA2BX,KAAKY,kBAAkB;IAClDC,MAAMb,KAAKc,QAAQ;IACnB,cAAcd,KAAKS,OAAO;IAC1B,OAAOT,KAAKe,KAAK;IACjB,OAAOf,KAAKgB,aAAa;IACzB,OAAOhB,KAAKiB,KAAK;IACjB,KAAKjB,KAAKkB,OAAO;AACnB,GAAG"}
@@ -0,0 +1,2 @@
1
+ export * from './loki-datasource';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/datasources/index.ts"],"names":[],"mappings":"AAaA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,15 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export * from './loki-datasource';
14
+
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/datasources/index.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\nexport * from './loki-datasource';\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,cAAc,oBAAoB"}
@@ -0,0 +1,5 @@
1
+ import { DatasourcePlugin } from '@perses-dev/plugin-system';
2
+ import { LokiClient } from '../../model/loki-client';
3
+ import { LokiDatasourceSpec } from './loki-datasource-types';
4
+ export declare const LokiDatasource: DatasourcePlugin<LokiDatasourceSpec, LokiClient>;
5
+ //# sourceMappingURL=LokiDatasource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LokiDatasource.d.ts","sourceRoot":"","sources":["../../../../src/datasources/loki-datasource/LokiDatasource.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,UAAU,EASX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAgC7D,eAAO,MAAM,cAAc,EAAE,gBAAgB,CAAC,kBAAkB,EAAE,UAAU,CAI3E,CAAC"}
@@ -0,0 +1,69 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { query, queryRange, labels, labelValues, series, volume, volumeRange, indexStats } from '../../model/loki-client';
14
+ import { LokiDatasourceEditor } from './LokiDatasourceEditor';
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 Loki 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
+ query: (params, headers)=>query(params, {
28
+ datasourceUrl,
29
+ headers: headers ?? specHeaders
30
+ }),
31
+ queryRange: (params, headers)=>queryRange(params, {
32
+ datasourceUrl,
33
+ headers: headers ?? specHeaders
34
+ }),
35
+ labels: (start, end, headers)=>labels(start, end, {
36
+ datasourceUrl,
37
+ headers: headers ?? specHeaders
38
+ }),
39
+ labelValues: (label, start, end, headers)=>labelValues(label, start, end, {
40
+ datasourceUrl,
41
+ headers: headers ?? specHeaders
42
+ }),
43
+ series: (match, start, end, headers)=>series(match, start, end, {
44
+ datasourceUrl,
45
+ headers: headers ?? specHeaders
46
+ }),
47
+ volume: (params, headers)=>volume(params, {
48
+ datasourceUrl,
49
+ headers: headers ?? specHeaders
50
+ }),
51
+ volumeRange: (params, headers)=>volumeRange(params, {
52
+ datasourceUrl,
53
+ headers: headers ?? specHeaders
54
+ }),
55
+ indexStats: (query, start, end, headers)=>indexStats(query, start, end, {
56
+ datasourceUrl,
57
+ headers: headers ?? specHeaders
58
+ })
59
+ };
60
+ };
61
+ export const LokiDatasource = {
62
+ createClient,
63
+ OptionsEditorComponent: LokiDatasourceEditor,
64
+ createInitialOptions: ()=>({
65
+ directUrl: ''
66
+ })
67
+ };
68
+
69
+ //# sourceMappingURL=LokiDatasource.js.map