@perses-dev/loki-plugin 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/__mf/css/async/1320.7ad02b85.css +1 -0
- package/__mf/css/async/2341.7ad02b85.css +1 -0
- package/__mf/css/async/9479.7ad02b85.css +1 -0
- package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
- package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
- package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
- package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
- package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
- package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
- package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
- package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
- package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
- package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
- package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
- package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
- package/__mf/js/Loki.e3bb11f6.js +6 -0
- package/__mf/js/async/1320.ca6d65b6.js +2 -0
- package/__mf/js/async/1320.ca6d65b6.js.LICENSE.txt +9 -0
- package/__mf/js/async/1540.6b797827.js +74 -0
- package/__mf/js/async/1964.7b2e7223.js +2 -0
- package/__mf/js/async/1964.7b2e7223.js.LICENSE.txt +9 -0
- package/__mf/js/async/2292.35c2eeec.js +2 -0
- package/__mf/js/async/2292.35c2eeec.js.LICENSE.txt +24 -0
- package/__mf/js/async/2448.6a132c1c.js +10 -0
- package/__mf/js/async/2448.6a132c1c.js.LICENSE.txt +17 -0
- package/__mf/js/async/2470.32c642b9.js +7 -0
- package/__mf/js/async/2470.32c642b9.js.LICENSE.txt +21 -0
- package/__mf/js/async/2651.ef335482.js +1 -0
- package/__mf/js/async/282.3d82e785.js +1 -0
- package/__mf/js/async/3224.b1170acc.js +1 -0
- package/__mf/js/async/3246.240e9404.js +1 -0
- package/__mf/js/async/3413.6dd92cfd.js +1 -0
- package/__mf/js/async/3431.2270637c.js +1 -0
- package/__mf/js/async/3849.c4035be2.js +1 -0
- package/__mf/js/async/3863.16343b76.js +2 -0
- package/__mf/js/async/3863.16343b76.js.LICENSE.txt +9 -0
- package/__mf/js/async/3869.4e06bfcb.js +2 -0
- package/__mf/js/async/3869.4e06bfcb.js.LICENSE.txt +9 -0
- package/__mf/js/async/3960.6091bb00.js +2 -0
- package/__mf/js/async/3960.6091bb00.js.LICENSE.txt +8 -0
- package/__mf/js/async/3980.08ab4aef.js +2 -0
- package/__mf/js/async/3980.08ab4aef.js.LICENSE.txt +9 -0
- package/__mf/js/async/4075.ea5435c6.js +1 -0
- package/__mf/js/async/4168.645bbaa1.js +2 -0
- package/__mf/js/async/4238.ac5f0a30.js +1 -0
- package/__mf/js/async/4269.b4d0f49d.js +2 -0
- package/__mf/js/async/4269.b4d0f49d.js.LICENSE.txt +9 -0
- package/__mf/js/async/4368.438b431f.js +2 -0
- package/__mf/js/async/4368.438b431f.js.LICENSE.txt +15 -0
- package/__mf/js/async/4421.fef63995.js +1 -0
- package/__mf/js/async/4687.1af57d71.js +2 -0
- package/__mf/js/async/4687.1af57d71.js.LICENSE.txt +9 -0
- package/__mf/js/async/4693.ba67a5aa.js +1 -0
- package/__mf/js/async/5214.fee648bb.js +1 -0
- package/__mf/js/async/5409.ff95cf63.js +1 -0
- package/__mf/js/async/5780.d837c3cd.js +1 -0
- package/__mf/js/async/5876.5618763d.js +2 -0
- package/__mf/js/async/5876.5618763d.js.LICENSE.txt +21 -0
- package/__mf/js/async/592.269748ce.js +1 -0
- package/__mf/js/async/5981.a46c5157.js +2 -0
- package/__mf/js/async/5981.a46c5157.js.LICENSE.txt +8 -0
- package/__mf/js/async/6292.9997ca36.js +1 -0
- package/__mf/js/async/6333.01fb6457.js +2 -0
- package/__mf/js/async/6333.01fb6457.js.LICENSE.txt +9 -0
- package/__mf/js/async/6377.9f308c7f.js +2 -0
- package/__mf/js/async/6377.9f308c7f.js.LICENSE.txt +32 -0
- package/__mf/js/async/6569.f33ecbef.js +1 -0
- package/__mf/js/async/6664.078084ff.js +28 -0
- package/__mf/js/async/6770.ba5a38f3.js +1 -0
- package/__mf/js/async/694.c25a1f84.js +1 -0
- package/__mf/js/async/7152.e8100fb6.js +73 -0
- package/__mf/js/async/7152.e8100fb6.js.LICENSE.txt +19 -0
- package/__mf/js/async/7376.0459aaf7.js +1 -0
- package/__mf/js/async/738.a16c93b6.js +1 -0
- package/__mf/js/async/7740.6f193fac.js +1 -0
- package/__mf/js/async/8216.d9cc6234.js +1 -0
- package/__mf/js/async/8488.5b4b7170.js +1 -0
- package/__mf/js/async/8537.dc791586.js +1 -0
- package/__mf/js/async/9173.75bbe78a.js +2 -0
- package/__mf/js/async/9173.75bbe78a.js.LICENSE.txt +19 -0
- package/__mf/js/async/9479.f74b4605.js +1 -0
- package/__mf/js/async/9654.575f5449.js +37 -0
- package/__mf/js/async/__federation_expose_LogsTable.3952e904.js +2 -0
- package/__mf/js/async/__federation_expose_LogsTable.3952e904.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_LokiDatasource.5fbd8f68.js +2 -0
- package/__mf/js/async/__federation_expose_LokiDatasource.5fbd8f68.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_LokiLogQuery.0720038a.js +1 -0
- package/__mf/js/async/__federation_expose_LokiTimeSeriesQuery.8c7f7602.js +1 -0
- package/__mf/js/main.a5b9ede8.js +6 -0
- package/lib/bootstrap.d.ts +2 -0
- package/lib/bootstrap.d.ts.map +1 -0
- package/lib/bootstrap.js +7 -0
- package/lib/bootstrap.js.map +1 -0
- package/lib/cjs/bootstrap.js +14 -0
- package/lib/cjs/components/index.js +23 -0
- package/lib/cjs/components/logql-editor.js +110 -0
- package/lib/cjs/components/logql-extension.js +55 -0
- package/lib/cjs/components/logql-highlight.js +40 -0
- package/lib/cjs/datasources/index.js +30 -0
- package/lib/cjs/datasources/loki-datasource/LokiDatasource.js +77 -0
- package/lib/cjs/datasources/loki-datasource/LokiDatasourceEditor.js +83 -0
- package/lib/cjs/datasources/loki-datasource/index.js +32 -0
- package/lib/cjs/datasources/loki-datasource/loki-datasource-types.js +16 -0
- package/lib/cjs/env.d.js +2 -0
- package/lib/cjs/getPluginModule.js +27 -0
- package/lib/cjs/index-federation.js +43 -0
- package/lib/cjs/index.js +28 -0
- package/lib/cjs/model/index.js +31 -0
- package/lib/cjs/model/loki-client-types.js +16 -0
- package/lib/cjs/model/loki-client.js +198 -0
- package/lib/cjs/model/loki-data-types.js +16 -0
- package/lib/cjs/model/loki-selectors.js +47 -0
- package/lib/cjs/panels/index.js +30 -0
- package/lib/cjs/panels/logstable/LogsTable.js +41 -0
- package/lib/cjs/panels/logstable/LogsTableComponent.js +43 -0
- package/lib/cjs/panels/logstable/LogsTableSettingsEditor.js +70 -0
- package/lib/cjs/panels/logstable/components/EmptyLogsState.js +49 -0
- package/lib/cjs/panels/logstable/components/LogRow/LogRow.js +158 -0
- package/lib/cjs/panels/logstable/components/LogRow/LogTimestamp.js +44 -0
- package/lib/cjs/panels/logstable/components/LogRow/LogsLabelsTable.js +74 -0
- package/lib/cjs/panels/logstable/components/LogRow/LogsStyles.js +77 -0
- package/lib/cjs/panels/logstable/components/LogRow/index.js +37 -0
- package/lib/cjs/panels/logstable/components/LogsList.js +44 -0
- package/lib/cjs/panels/logstable/components/VirtualizedLogsList.js +63 -0
- package/lib/cjs/panels/logstable/components/index.js +23 -0
- package/lib/cjs/panels/logstable/components/utils.js +39 -0
- package/lib/cjs/panels/logstable/hooks/useExpandedRows.js +45 -0
- package/lib/cjs/panels/logstable/hooks/useSeverity.js +43 -0
- package/lib/cjs/panels/logstable/index.js +33 -0
- package/lib/cjs/panels/logstable/logs-types.js +16 -0
- package/lib/cjs/queries/constants.js +22 -0
- package/lib/cjs/queries/index.js +31 -0
- package/lib/cjs/queries/loki-log-query/LokiLogQuery.js +31 -0
- package/lib/cjs/queries/loki-log-query/LokiLogQueryEditor.js +157 -0
- package/lib/cjs/queries/loki-log-query/get-loki-log-data.js +74 -0
- package/lib/cjs/queries/loki-log-query/index.js +21 -0
- package/lib/cjs/queries/loki-log-query/log-query-plugin-interface.js +4 -0
- package/lib/cjs/queries/loki-log-query/loki-log-query-types.js +4 -0
- package/lib/cjs/queries/loki-time-series-query/LokiTimeSeriesQuery.js +43 -0
- package/lib/cjs/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js +118 -0
- package/lib/cjs/queries/loki-time-series-query/get-loki-time-series-data.js +120 -0
- package/lib/cjs/queries/loki-time-series-query/index.js +33 -0
- package/lib/cjs/queries/loki-time-series-query/loki-time-series-query-types.js +16 -0
- package/lib/cjs/setup-tests.js +7 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +15 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/logql-editor.d.ts +5 -0
- package/lib/components/logql-editor.d.ts.map +1 -0
- package/lib/components/logql-editor.js +61 -0
- package/lib/components/logql-editor.js.map +1 -0
- package/lib/components/logql-extension.d.ts +4 -0
- package/lib/components/logql-extension.d.ts.map +1 -0
- package/lib/components/logql-extension.js +47 -0
- package/lib/components/logql-extension.js.map +1 -0
- package/lib/components/logql-highlight.d.ts +2 -0
- package/lib/components/logql-highlight.d.ts.map +1 -0
- package/lib/components/logql-highlight.js +32 -0
- package/lib/components/logql-highlight.js.map +1 -0
- package/lib/datasources/index.d.ts +2 -0
- package/lib/datasources/index.d.ts.map +1 -0
- package/lib/datasources/index.js +15 -0
- package/lib/datasources/index.js.map +1 -0
- package/lib/datasources/loki-datasource/LokiDatasource.d.ts +5 -0
- package/lib/datasources/loki-datasource/LokiDatasource.d.ts.map +1 -0
- package/lib/datasources/loki-datasource/LokiDatasource.js +69 -0
- package/lib/datasources/loki-datasource/LokiDatasource.js.map +1 -0
- package/lib/datasources/loki-datasource/LokiDatasourceEditor.d.ts +9 -0
- package/lib/datasources/loki-datasource/LokiDatasourceEditor.d.ts.map +1 -0
- package/lib/datasources/loki-datasource/LokiDatasourceEditor.js +75 -0
- package/lib/datasources/loki-datasource/LokiDatasourceEditor.js.map +1 -0
- package/lib/datasources/loki-datasource/index.d.ts +4 -0
- package/lib/datasources/loki-datasource/index.d.ts.map +1 -0
- package/lib/datasources/loki-datasource/index.js +17 -0
- package/lib/datasources/loki-datasource/index.js.map +1 -0
- package/lib/datasources/loki-datasource/loki-datasource-types.d.ts +6 -0
- package/lib/datasources/loki-datasource/loki-datasource-types.d.ts.map +1 -0
- package/lib/datasources/loki-datasource/loki-datasource-types.js +15 -0
- package/lib/datasources/loki-datasource/loki-datasource-types.js.map +1 -0
- package/lib/env.d.js +3 -0
- package/lib/env.d.js.map +1 -0
- package/lib/getPluginModule.d.ts +6 -0
- package/lib/getPluginModule.d.ts.map +1 -0
- package/lib/getPluginModule.js +16 -0
- package/lib/getPluginModule.js.map +1 -0
- package/lib/index-federation.d.ts +1 -0
- package/lib/index-federation.d.ts.map +1 -0
- package/lib/index-federation.js +3 -0
- package/lib/index-federation.js.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -0
- package/lib/model/index.d.ts +3 -0
- package/lib/model/index.d.ts.map +1 -0
- package/lib/model/index.js +16 -0
- package/lib/model/index.js.map +1 -0
- package/lib/model/loki-client-types.d.ts +65 -0
- package/lib/model/loki-client-types.d.ts.map +1 -0
- package/lib/model/loki-client-types.js +15 -0
- package/lib/model/loki-client-types.js.map +1 -0
- package/lib/model/loki-client.d.ts +50 -0
- package/lib/model/loki-client.d.ts.map +1 -0
- package/lib/model/loki-client.js +161 -0
- package/lib/model/loki-client.js.map +1 -0
- package/lib/model/loki-data-types.d.ts +24 -0
- package/lib/model/loki-data-types.d.ts.map +1 -0
- package/lib/model/loki-data-types.js +15 -0
- package/lib/model/loki-data-types.js.map +1 -0
- package/lib/model/loki-selectors.d.ts +10 -0
- package/lib/model/loki-selectors.d.ts.map +1 -0
- package/lib/model/loki-selectors.js +25 -0
- package/lib/model/loki-selectors.js.map +1 -0
- package/lib/panels/index.d.ts +2 -0
- package/lib/panels/index.d.ts.map +1 -0
- package/lib/panels/index.js +15 -0
- package/lib/panels/index.js.map +1 -0
- package/lib/panels/logstable/LogsTable.d.ts +4 -0
- package/lib/panels/logstable/LogsTable.d.ts.map +1 -0
- package/lib/panels/logstable/LogsTable.js +33 -0
- package/lib/panels/logstable/LogsTable.js.map +1 -0
- package/lib/panels/logstable/LogsTableComponent.d.ts +4 -0
- package/lib/panels/logstable/LogsTableComponent.d.ts.map +1 -0
- package/lib/panels/logstable/LogsTableComponent.js +35 -0
- package/lib/panels/logstable/LogsTableComponent.js.map +1 -0
- package/lib/panels/logstable/LogsTableSettingsEditor.d.ts +7 -0
- package/lib/panels/logstable/LogsTableSettingsEditor.d.ts.map +1 -0
- package/lib/panels/logstable/LogsTableSettingsEditor.js +62 -0
- package/lib/panels/logstable/LogsTableSettingsEditor.js.map +1 -0
- package/lib/panels/logstable/components/EmptyLogsState.d.ts +7 -0
- package/lib/panels/logstable/components/EmptyLogsState.d.ts.map +1 -0
- package/lib/panels/logstable/components/EmptyLogsState.js +36 -0
- package/lib/panels/logstable/components/EmptyLogsState.js.map +1 -0
- package/lib/panels/logstable/components/LogRow/LogRow.d.ts +14 -0
- package/lib/panels/logstable/components/LogRow/LogRow.d.ts.map +1 -0
- package/lib/panels/logstable/components/LogRow/LogRow.js +104 -0
- package/lib/panels/logstable/components/LogRow/LogRow.js.map +1 -0
- package/lib/panels/logstable/components/LogRow/LogTimestamp.d.ts +7 -0
- package/lib/panels/logstable/components/LogRow/LogTimestamp.d.ts.map +1 -0
- package/lib/panels/logstable/components/LogRow/LogTimestamp.js +31 -0
- package/lib/panels/logstable/components/LogRow/LogTimestamp.js.map +1 -0
- package/lib/panels/logstable/components/LogRow/LogsLabelsTable.d.ts +7 -0
- package/lib/panels/logstable/components/LogRow/LogsLabelsTable.d.ts.map +1 -0
- package/lib/panels/logstable/components/LogRow/LogsLabelsTable.js +61 -0
- package/lib/panels/logstable/components/LogRow/LogsLabelsTable.js.map +1 -0
- package/lib/panels/logstable/components/LogRow/LogsStyles.d.ts +22 -0
- package/lib/panels/logstable/components/LogRow/LogsStyles.d.ts.map +1 -0
- package/lib/panels/logstable/components/LogRow/LogsStyles.js +55 -0
- package/lib/panels/logstable/components/LogRow/LogsStyles.js.map +1 -0
- package/lib/panels/logstable/components/LogRow/index.d.ts +3 -0
- package/lib/panels/logstable/components/LogRow/index.d.ts.map +1 -0
- package/lib/panels/logstable/components/LogRow/index.js +16 -0
- package/lib/panels/logstable/components/LogRow/index.js.map +1 -0
- package/lib/panels/logstable/components/LogsList.d.ts +10 -0
- package/lib/panels/logstable/components/LogsList.d.ts.map +1 -0
- package/lib/panels/logstable/components/LogsList.js +31 -0
- package/lib/panels/logstable/components/LogsList.js.map +1 -0
- package/lib/panels/logstable/components/VirtualizedLogsList.d.ts +12 -0
- package/lib/panels/logstable/components/VirtualizedLogsList.d.ts.map +1 -0
- package/lib/panels/logstable/components/VirtualizedLogsList.js +50 -0
- package/lib/panels/logstable/components/VirtualizedLogsList.js.map +1 -0
- package/lib/panels/logstable/components/index.d.ts +2 -0
- package/lib/panels/logstable/components/index.d.ts.map +1 -0
- package/lib/panels/logstable/components/index.js +15 -0
- package/lib/panels/logstable/components/index.js.map +1 -0
- package/lib/panels/logstable/components/utils.d.ts +3 -0
- package/lib/panels/logstable/components/utils.d.ts.map +1 -0
- package/lib/panels/logstable/components/utils.js +31 -0
- package/lib/panels/logstable/components/utils.js.map +1 -0
- package/lib/panels/logstable/hooks/useExpandedRows.d.ts +6 -0
- package/lib/panels/logstable/hooks/useExpandedRows.d.ts.map +1 -0
- package/lib/panels/logstable/hooks/useExpandedRows.js +37 -0
- package/lib/panels/logstable/hooks/useExpandedRows.js.map +1 -0
- package/lib/panels/logstable/hooks/useSeverity.d.ts +3 -0
- package/lib/panels/logstable/hooks/useSeverity.d.ts.map +1 -0
- package/lib/panels/logstable/hooks/useSeverity.js +35 -0
- package/lib/panels/logstable/hooks/useSeverity.js.map +1 -0
- package/lib/panels/logstable/index.d.ts +5 -0
- package/lib/panels/logstable/index.d.ts.map +1 -0
- package/lib/panels/logstable/index.js +18 -0
- package/lib/panels/logstable/index.js.map +1 -0
- package/lib/panels/logstable/logs-types.d.ts +11 -0
- package/lib/panels/logstable/logs-types.d.ts.map +1 -0
- package/lib/panels/logstable/logs-types.js +15 -0
- package/lib/panels/logstable/logs-types.js.map +1 -0
- package/lib/queries/constants.d.ts +5 -0
- package/lib/queries/constants.d.ts.map +1 -0
- package/lib/queries/constants.js +6 -0
- package/lib/queries/constants.js.map +1 -0
- package/lib/queries/index.d.ts +3 -0
- package/lib/queries/index.d.ts.map +1 -0
- package/lib/queries/index.js +16 -0
- package/lib/queries/index.js.map +1 -0
- package/lib/queries/loki-log-query/LokiLogQuery.d.ts +4 -0
- package/lib/queries/loki-log-query/LokiLogQuery.d.ts.map +1 -0
- package/lib/queries/loki-log-query/LokiLogQuery.js +23 -0
- package/lib/queries/loki-log-query/LokiLogQuery.js.map +1 -0
- package/lib/queries/loki-log-query/LokiLogQueryEditor.d.ts +7 -0
- package/lib/queries/loki-log-query/LokiLogQueryEditor.d.ts.map +1 -0
- package/lib/queries/loki-log-query/LokiLogQueryEditor.js +149 -0
- package/lib/queries/loki-log-query/LokiLogQueryEditor.js.map +1 -0
- package/lib/queries/loki-log-query/get-loki-log-data.d.ts +4 -0
- package/lib/queries/loki-log-query/get-loki-log-data.d.ts.map +1 -0
- package/lib/queries/loki-log-query/get-loki-log-data.js +66 -0
- package/lib/queries/loki-log-query/get-loki-log-data.js.map +1 -0
- package/lib/queries/loki-log-query/index.d.ts +5 -0
- package/lib/queries/loki-log-query/index.d.ts.map +1 -0
- package/lib/queries/loki-log-query/index.js +6 -0
- package/lib/queries/loki-log-query/index.js.map +1 -0
- package/lib/queries/loki-log-query/log-query-plugin-interface.d.ts +25 -0
- package/lib/queries/loki-log-query/log-query-plugin-interface.d.ts.map +1 -0
- package/lib/queries/loki-log-query/log-query-plugin-interface.js +3 -0
- package/lib/queries/loki-log-query/log-query-plugin-interface.js.map +1 -0
- package/lib/queries/loki-log-query/loki-log-query-types.d.ts +9 -0
- package/lib/queries/loki-log-query/loki-log-query-types.d.ts.map +1 -0
- package/lib/queries/loki-log-query/loki-log-query-types.js +3 -0
- package/lib/queries/loki-log-query/loki-log-query-types.js.map +1 -0
- package/lib/queries/loki-time-series-query/LokiTimeSeriesQuery.d.ts +4 -0
- package/lib/queries/loki-time-series-query/LokiTimeSeriesQuery.d.ts.map +1 -0
- package/lib/queries/loki-time-series-query/LokiTimeSeriesQuery.js +35 -0
- package/lib/queries/loki-time-series-query/LokiTimeSeriesQuery.js.map +1 -0
- package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.d.ts +7 -0
- package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.d.ts.map +1 -0
- package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js +110 -0
- package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js.map +1 -0
- package/lib/queries/loki-time-series-query/get-loki-time-series-data.d.ts +12 -0
- package/lib/queries/loki-time-series-query/get-loki-time-series-data.d.ts.map +1 -0
- package/lib/queries/loki-time-series-query/get-loki-time-series-data.js +112 -0
- package/lib/queries/loki-time-series-query/get-loki-time-series-data.js.map +1 -0
- package/lib/queries/loki-time-series-query/index.d.ts +5 -0
- package/lib/queries/loki-time-series-query/index.d.ts.map +1 -0
- package/lib/queries/loki-time-series-query/index.js +18 -0
- package/lib/queries/loki-time-series-query/index.js.map +1 -0
- package/lib/queries/loki-time-series-query/loki-time-series-query-types.d.ts +9 -0
- package/lib/queries/loki-time-series-query/loki-time-series-query-types.d.ts.map +1 -0
- package/lib/queries/loki-time-series-query/loki-time-series-query-types.js +15 -0
- package/lib/queries/loki-time-series-query/loki-time-series-query-types.js.map +1 -0
- package/lib/setup-tests.d.ts +2 -0
- package/lib/setup-tests.d.ts.map +1 -0
- package/lib/setup-tests.js +5 -0
- package/lib/setup-tests.js.map +1 -0
- package/mf-manifest.json +528 -0
- package/mf-stats.json +584 -0
- package/package.json +1 -1
|
@@ -0,0 +1,63 @@
|
|
|
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, "VirtualizedLogsList", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return VirtualizedLogsList;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
25
|
+
const _material = require("@mui/material");
|
|
26
|
+
const _reactvirtuoso = require("react-virtuoso");
|
|
27
|
+
const _LogRow = require("./LogRow/LogRow");
|
|
28
|
+
function _interop_require_default(obj) {
|
|
29
|
+
return obj && obj.__esModule ? obj : {
|
|
30
|
+
default: obj
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const VirtualizedLogsList = ({ logs, spec, expandedRows, onToggleExpand })=>{
|
|
34
|
+
const theme = (0, _material.useTheme)();
|
|
35
|
+
const renderLogRow = (index)=>{
|
|
36
|
+
const log = logs[index];
|
|
37
|
+
if (!log) return null;
|
|
38
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_LogRow.LogRow, {
|
|
39
|
+
isExpandable: spec.enableDetails,
|
|
40
|
+
log: log,
|
|
41
|
+
index: index,
|
|
42
|
+
isExpanded: expandedRows.has(index),
|
|
43
|
+
onToggle: onToggleExpand,
|
|
44
|
+
wrap: spec.wrap,
|
|
45
|
+
time: spec.time
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
49
|
+
sx: {
|
|
50
|
+
height: '100%',
|
|
51
|
+
backgroundColor: theme.palette.background.default,
|
|
52
|
+
overflow: 'hidden',
|
|
53
|
+
boxShadow: theme.shadows[1]
|
|
54
|
+
},
|
|
55
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactvirtuoso.Virtuoso, {
|
|
56
|
+
style: {
|
|
57
|
+
height: '100%'
|
|
58
|
+
},
|
|
59
|
+
totalCount: logs.length,
|
|
60
|
+
itemContent: renderLogRow
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
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, "LogsList", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return _LogsList.LogsList;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _LogsList = require("./LogsList");
|
|
@@ -0,0 +1,39 @@
|
|
|
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, "getSeverity", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return getSeverity;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const getSeverity = (log)=>{
|
|
24
|
+
const message = log.line.toLowerCase();
|
|
25
|
+
const level = log.labels.level?.toLowerCase();
|
|
26
|
+
if (level) {
|
|
27
|
+
if (level.includes('error') || level.includes('err')) return 'error';
|
|
28
|
+
if (level.includes('warn')) return 'warn';
|
|
29
|
+
if (level.includes('info')) return 'info';
|
|
30
|
+
if (level.includes('debug')) return 'debug';
|
|
31
|
+
}
|
|
32
|
+
if (message.includes('error') || message.includes('exception') || message.includes('fail')) {
|
|
33
|
+
return 'error';
|
|
34
|
+
}
|
|
35
|
+
if (message.includes('warn')) return 'warn';
|
|
36
|
+
if (message.includes('info')) return 'info';
|
|
37
|
+
if (message.includes('debug')) return 'debug';
|
|
38
|
+
return 'unknown';
|
|
39
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
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, "useExpandedRows", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return useExpandedRows;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _react = require("react");
|
|
24
|
+
const useExpandedRows = ()=>{
|
|
25
|
+
const [expandedRows, setExpandedRows] = (0, _react.useState)(new Set());
|
|
26
|
+
const toggleExpand = (0, _react.useCallback)((index)=>{
|
|
27
|
+
setExpandedRows((prev)=>{
|
|
28
|
+
const newSet = new Set(prev);
|
|
29
|
+
if (newSet.has(index)) {
|
|
30
|
+
newSet.delete(index);
|
|
31
|
+
} else {
|
|
32
|
+
newSet.add(index);
|
|
33
|
+
}
|
|
34
|
+
return newSet;
|
|
35
|
+
});
|
|
36
|
+
}, []);
|
|
37
|
+
const clearExpanded = (0, _react.useCallback)(()=>{
|
|
38
|
+
setExpandedRows(new Set());
|
|
39
|
+
}, []);
|
|
40
|
+
return {
|
|
41
|
+
expandedRows,
|
|
42
|
+
toggleExpand,
|
|
43
|
+
clearExpanded
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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, "useSeverityColor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return useSeverityColor;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _material = require("@mui/material");
|
|
24
|
+
const _utils = require("../components/utils");
|
|
25
|
+
const useSeverityColor = (log)=>{
|
|
26
|
+
const theme = (0, _material.useTheme)();
|
|
27
|
+
if (!log) {
|
|
28
|
+
return theme.palette.text.secondary;
|
|
29
|
+
}
|
|
30
|
+
const severity = (0, _utils.getSeverity)(log);
|
|
31
|
+
switch(severity){
|
|
32
|
+
case 'error':
|
|
33
|
+
return theme.palette.error.main;
|
|
34
|
+
case 'warn':
|
|
35
|
+
return theme.palette.warning.main;
|
|
36
|
+
case 'info':
|
|
37
|
+
return theme.palette.info.main;
|
|
38
|
+
case 'debug':
|
|
39
|
+
return theme.palette.primary.main;
|
|
40
|
+
default:
|
|
41
|
+
return theme.palette.text.secondary;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -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("./LogsTable"), exports);
|
|
18
|
+
_export_star(require("./LogsTableComponent"), exports);
|
|
19
|
+
_export_star(require("./LogsTableSettingsEditor"), exports);
|
|
20
|
+
_export_star(require("./logs-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,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
DATASOURCE_KIND: function() {
|
|
13
|
+
return DATASOURCE_KIND;
|
|
14
|
+
},
|
|
15
|
+
DEFAULT_DATASOURCE: function() {
|
|
16
|
+
return DEFAULT_DATASOURCE;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const DATASOURCE_KIND = 'LokiDatasource';
|
|
20
|
+
const DEFAULT_DATASOURCE = {
|
|
21
|
+
kind: DATASOURCE_KIND
|
|
22
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
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("./loki-time-series-query"), exports);
|
|
18
|
+
_export_star(require("./loki-log-query"), exports);
|
|
19
|
+
function _export_star(from, to) {
|
|
20
|
+
Object.keys(from).forEach(function(k) {
|
|
21
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
22
|
+
Object.defineProperty(to, k, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return from[k];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return from;
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "LokiLogQuery", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return LokiLogQuery;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
12
|
+
const _getlokilogdata = require("./get-loki-log-data");
|
|
13
|
+
const _LokiLogQueryEditor = require("./LokiLogQueryEditor");
|
|
14
|
+
const LokiLogQuery = {
|
|
15
|
+
getLogData: _getlokilogdata.getLokiLogData,
|
|
16
|
+
OptionsEditorComponent: _LokiLogQueryEditor.LokiLogQueryEditor,
|
|
17
|
+
createInitialOptions: ()=>({
|
|
18
|
+
query: ''
|
|
19
|
+
}),
|
|
20
|
+
dependsOn: (spec)=>{
|
|
21
|
+
const queryVariables = (0, _pluginsystem.parseVariables)(spec.query);
|
|
22
|
+
const allVariables = [
|
|
23
|
+
...new Set([
|
|
24
|
+
...queryVariables
|
|
25
|
+
])
|
|
26
|
+
];
|
|
27
|
+
return {
|
|
28
|
+
variables: allVariables
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -0,0 +1,157 @@
|
|
|
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, "LokiLogQueryEditor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return LokiLogQueryEditor;
|
|
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 _immer = require("immer");
|
|
28
|
+
const _components = require("@perses-dev/components");
|
|
29
|
+
const _logqleditor = require("../../components/logql-editor");
|
|
30
|
+
const _model = require("../../model");
|
|
31
|
+
const _constants = require("../constants");
|
|
32
|
+
function LokiLogQueryEditor(props) {
|
|
33
|
+
const { onChange, value } = props;
|
|
34
|
+
const { datasource } = value;
|
|
35
|
+
const datasourceSelectValue = datasource ?? _constants.DEFAULT_DATASOURCE;
|
|
36
|
+
const selectedDatasource = (0, _pluginsystem.useDatasourceSelectValueToSelector)(datasourceSelectValue, _model.LOKI_DATASOURCE_KIND);
|
|
37
|
+
// const { data: client } = useDatasourceClient<LokiClient>(selectedDatasource);
|
|
38
|
+
// const lokiURL = client?.options.datasourceUrl;
|
|
39
|
+
// Local state for editor value to prevent query_range calls on every keystroke
|
|
40
|
+
const [localQuery, setLocalQuery] = (0, _react.useState)(value.query);
|
|
41
|
+
// Update local state when prop changes
|
|
42
|
+
(0, _react.useEffect)(()=>{
|
|
43
|
+
setLocalQuery(value.query);
|
|
44
|
+
}, [
|
|
45
|
+
value.query
|
|
46
|
+
]);
|
|
47
|
+
const handleDatasourceChange = (newDatasourceSelection)=>{
|
|
48
|
+
if (!(0, _pluginsystem.isVariableDatasource)(newDatasourceSelection) && newDatasourceSelection.kind === _constants.DATASOURCE_KIND) {
|
|
49
|
+
onChange({
|
|
50
|
+
...value,
|
|
51
|
+
datasource: newDatasourceSelection
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
throw new Error('Got unexpected non LokiQuery datasource selection');
|
|
56
|
+
};
|
|
57
|
+
// Debounced query change handler to prevent excessive query_range calls
|
|
58
|
+
const handleQueryChange = (0, _react.useCallback)((newQuery)=>{
|
|
59
|
+
setLocalQuery(newQuery);
|
|
60
|
+
}, []);
|
|
61
|
+
const handleLogsDirection = (_, v)=>onChange((0, _immer.produce)(value, (draft)=>{
|
|
62
|
+
draft.direction = v;
|
|
63
|
+
}));
|
|
64
|
+
// Immediate query execution on Enter or blur
|
|
65
|
+
const handleQueryExecute = (0, _react.useCallback)((query)=>{
|
|
66
|
+
onChange({
|
|
67
|
+
...value,
|
|
68
|
+
query
|
|
69
|
+
});
|
|
70
|
+
}, [
|
|
71
|
+
onChange,
|
|
72
|
+
value
|
|
73
|
+
]);
|
|
74
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
75
|
+
spacing: 1.5,
|
|
76
|
+
paddingBottom: 1,
|
|
77
|
+
children: [
|
|
78
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
79
|
+
children: [
|
|
80
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputLabel, {
|
|
81
|
+
sx: {
|
|
82
|
+
display: 'block',
|
|
83
|
+
marginBottom: '4px',
|
|
84
|
+
fontWeight: 500
|
|
85
|
+
},
|
|
86
|
+
children: "Datasource"
|
|
87
|
+
}),
|
|
88
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceSelect, {
|
|
89
|
+
datasourcePluginKind: _constants.DATASOURCE_KIND,
|
|
90
|
+
value: selectedDatasource,
|
|
91
|
+
onChange: handleDatasourceChange,
|
|
92
|
+
label: "Loki Datasource",
|
|
93
|
+
notched: true
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
}),
|
|
97
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
98
|
+
children: [
|
|
99
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputLabel, {
|
|
100
|
+
sx: {
|
|
101
|
+
display: 'block',
|
|
102
|
+
marginBottom: '4px',
|
|
103
|
+
fontWeight: 500
|
|
104
|
+
},
|
|
105
|
+
children: "LogQL Query"
|
|
106
|
+
}),
|
|
107
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_logqleditor.LogQLEditor, {
|
|
108
|
+
value: localQuery,
|
|
109
|
+
onChange: handleQueryChange,
|
|
110
|
+
onBlur: ()=>handleQueryExecute(localQuery),
|
|
111
|
+
onKeyDown: (event)=>{
|
|
112
|
+
if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
handleQueryExecute(localQuery);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
placeholder: 'Enter LogQL query (e.g. {job="mysql"} |= "error")'
|
|
118
|
+
})
|
|
119
|
+
]
|
|
120
|
+
}),
|
|
121
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
122
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
123
|
+
label: "Order",
|
|
124
|
+
// description="Percentage means thresholds relative to min & max"
|
|
125
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.ToggleButtonGroup, {
|
|
126
|
+
exclusive: true,
|
|
127
|
+
value: value?.direction ?? 'backward',
|
|
128
|
+
onChange: handleLogsDirection,
|
|
129
|
+
sx: {
|
|
130
|
+
height: '36px',
|
|
131
|
+
marginLeft: '10px',
|
|
132
|
+
width: 'max-content'
|
|
133
|
+
},
|
|
134
|
+
children: [
|
|
135
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButton, {
|
|
136
|
+
"aria-label": "backward",
|
|
137
|
+
value: "backward",
|
|
138
|
+
sx: {
|
|
139
|
+
fontWeight: 500
|
|
140
|
+
},
|
|
141
|
+
children: "Newest first"
|
|
142
|
+
}),
|
|
143
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButton, {
|
|
144
|
+
"aria-label": "forward",
|
|
145
|
+
value: "forward",
|
|
146
|
+
sx: {
|
|
147
|
+
fontWeight: 500
|
|
148
|
+
},
|
|
149
|
+
children: "Oldest first"
|
|
150
|
+
})
|
|
151
|
+
]
|
|
152
|
+
})
|
|
153
|
+
})
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
});
|
|
157
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getLokiLogData", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return getLokiLogData;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
12
|
+
const _constants = require("../constants");
|
|
13
|
+
function convertStreamsToLogs(streams) {
|
|
14
|
+
const entries = [];
|
|
15
|
+
streams.forEach((stream)=>{
|
|
16
|
+
stream.values.forEach(([timestamp, logLine])=>{
|
|
17
|
+
entries.push({
|
|
18
|
+
timestamp: Number(timestamp) / 1000000000,
|
|
19
|
+
line: logLine,
|
|
20
|
+
labels: stream.stream
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
entries,
|
|
26
|
+
totalCount: entries.length
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const getLokiLogData = async (spec, context)=>{
|
|
30
|
+
if (!spec.query) {
|
|
31
|
+
return {
|
|
32
|
+
logs: {
|
|
33
|
+
entries: [],
|
|
34
|
+
totalCount: 0
|
|
35
|
+
},
|
|
36
|
+
timeRange: {
|
|
37
|
+
start: context.timeRange.start,
|
|
38
|
+
end: context.timeRange.end
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const query = (0, _pluginsystem.replaceVariables)(spec.query, context.variableState);
|
|
43
|
+
const client = await context.datasourceStore.getDatasourceClient(spec.datasource ?? _constants.DEFAULT_DATASOURCE);
|
|
44
|
+
const { start, end } = context.timeRange;
|
|
45
|
+
const response = await client.queryRange({
|
|
46
|
+
query,
|
|
47
|
+
start: start.getTime().toString(),
|
|
48
|
+
end: end.getTime().toString(),
|
|
49
|
+
direction: spec.direction
|
|
50
|
+
});
|
|
51
|
+
if (response.data.resultType === 'streams') {
|
|
52
|
+
const logs = convertStreamsToLogs(response.data.result);
|
|
53
|
+
return {
|
|
54
|
+
logs,
|
|
55
|
+
timeRange: {
|
|
56
|
+
start,
|
|
57
|
+
end
|
|
58
|
+
},
|
|
59
|
+
metadata: {
|
|
60
|
+
executedQueryString: query
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
logs: {
|
|
66
|
+
entries: [],
|
|
67
|
+
totalCount: 0
|
|
68
|
+
},
|
|
69
|
+
timeRange: {
|
|
70
|
+
start,
|
|
71
|
+
end
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_export_star(require("./get-loki-log-data"), exports);
|
|
6
|
+
_export_star(require("./LokiLogQuery"), exports);
|
|
7
|
+
_export_star(require("./LokiLogQueryEditor"), exports);
|
|
8
|
+
_export_star(require("./loki-log-query-types"), exports);
|
|
9
|
+
function _export_star(from, to) {
|
|
10
|
+
Object.keys(from).forEach(function(k) {
|
|
11
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
12
|
+
Object.defineProperty(to, k, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function() {
|
|
15
|
+
return from[k];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return from;
|
|
21
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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, "LokiTimeSeriesQuery", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return LokiTimeSeriesQuery;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
|
+
const _getlokitimeseriesdata = require("./get-loki-time-series-data");
|
|
25
|
+
const _LokiTimeSeriesQueryEditor = require("./LokiTimeSeriesQueryEditor");
|
|
26
|
+
const LokiTimeSeriesQuery = {
|
|
27
|
+
getTimeSeriesData: _getlokitimeseriesdata.getLokiTimeSeriesData,
|
|
28
|
+
OptionsEditorComponent: _LokiTimeSeriesQueryEditor.LokiQueryEditor,
|
|
29
|
+
createInitialOptions: ()=>({
|
|
30
|
+
query: ''
|
|
31
|
+
}),
|
|
32
|
+
dependsOn: (spec)=>{
|
|
33
|
+
const queryVariables = (0, _pluginsystem.parseVariables)(spec.query);
|
|
34
|
+
const allVariables = [
|
|
35
|
+
...new Set([
|
|
36
|
+
...queryVariables
|
|
37
|
+
])
|
|
38
|
+
];
|
|
39
|
+
return {
|
|
40
|
+
variables: allVariables
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
};
|