@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,77 @@
|
|
|
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, "LokiDatasource", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return LokiDatasource;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _lokiclient = require("../../model/loki-client");
|
|
24
|
+
const _LokiDatasourceEditor = require("./LokiDatasourceEditor");
|
|
25
|
+
const createClient = (spec, options)=>{
|
|
26
|
+
const { directUrl, proxy } = spec;
|
|
27
|
+
const { proxyUrl } = options;
|
|
28
|
+
const datasourceUrl = directUrl ?? proxyUrl;
|
|
29
|
+
if (datasourceUrl === undefined) {
|
|
30
|
+
throw new Error('No URL specified for Loki client. You can use directUrl in the spec to configure it.');
|
|
31
|
+
}
|
|
32
|
+
const specHeaders = proxy?.spec.headers;
|
|
33
|
+
return {
|
|
34
|
+
options: {
|
|
35
|
+
datasourceUrl
|
|
36
|
+
},
|
|
37
|
+
query: (params, headers)=>(0, _lokiclient.query)(params, {
|
|
38
|
+
datasourceUrl,
|
|
39
|
+
headers: headers ?? specHeaders
|
|
40
|
+
}),
|
|
41
|
+
queryRange: (params, headers)=>(0, _lokiclient.queryRange)(params, {
|
|
42
|
+
datasourceUrl,
|
|
43
|
+
headers: headers ?? specHeaders
|
|
44
|
+
}),
|
|
45
|
+
labels: (start, end, headers)=>(0, _lokiclient.labels)(start, end, {
|
|
46
|
+
datasourceUrl,
|
|
47
|
+
headers: headers ?? specHeaders
|
|
48
|
+
}),
|
|
49
|
+
labelValues: (label, start, end, headers)=>(0, _lokiclient.labelValues)(label, start, end, {
|
|
50
|
+
datasourceUrl,
|
|
51
|
+
headers: headers ?? specHeaders
|
|
52
|
+
}),
|
|
53
|
+
series: (match, start, end, headers)=>(0, _lokiclient.series)(match, start, end, {
|
|
54
|
+
datasourceUrl,
|
|
55
|
+
headers: headers ?? specHeaders
|
|
56
|
+
}),
|
|
57
|
+
volume: (params, headers)=>(0, _lokiclient.volume)(params, {
|
|
58
|
+
datasourceUrl,
|
|
59
|
+
headers: headers ?? specHeaders
|
|
60
|
+
}),
|
|
61
|
+
volumeRange: (params, headers)=>(0, _lokiclient.volumeRange)(params, {
|
|
62
|
+
datasourceUrl,
|
|
63
|
+
headers: headers ?? specHeaders
|
|
64
|
+
}),
|
|
65
|
+
indexStats: (query, start, end, headers)=>(0, _lokiclient.indexStats)(query, start, end, {
|
|
66
|
+
datasourceUrl,
|
|
67
|
+
headers: headers ?? specHeaders
|
|
68
|
+
})
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
const LokiDatasource = {
|
|
72
|
+
createClient,
|
|
73
|
+
OptionsEditorComponent: _LokiDatasourceEditor.LokiDatasourceEditor,
|
|
74
|
+
createInitialOptions: ()=>({
|
|
75
|
+
directUrl: ''
|
|
76
|
+
})
|
|
77
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
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, "LokiDatasourceEditor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return LokiDatasourceEditor;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
|
+
function LokiDatasourceEditor(props) {
|
|
26
|
+
const { value, onChange, isReadonly } = props;
|
|
27
|
+
const initialSpecDirect = {
|
|
28
|
+
directUrl: ''
|
|
29
|
+
};
|
|
30
|
+
const initialSpecProxy = {
|
|
31
|
+
proxy: {
|
|
32
|
+
kind: 'HTTPProxy',
|
|
33
|
+
spec: {
|
|
34
|
+
allowedEndpoints: [
|
|
35
|
+
{
|
|
36
|
+
endpointPattern: '/loki/api/v1/query',
|
|
37
|
+
method: 'GET'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
endpointPattern: '/loki/api/v1/query_range',
|
|
41
|
+
method: 'GET'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
endpointPattern: '/loki/api/v1/labels',
|
|
45
|
+
method: 'GET'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
endpointPattern: '/loki/api/v1/label/([a-zA-Z0-9_-]+)/values',
|
|
49
|
+
method: 'GET'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
endpointPattern: '/loki/api/v1/series',
|
|
53
|
+
method: 'GET'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
endpointPattern: '/loki/api/v1/index/volume',
|
|
57
|
+
method: 'GET'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
endpointPattern: '/loki/api/v1/index/volume_range',
|
|
61
|
+
method: 'GET'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
endpointPattern: '/loki/api/v1/index/stats',
|
|
65
|
+
method: 'GET'
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
endpointPattern: '/loki/api/v1/tail',
|
|
69
|
+
method: 'GET'
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
url: ''
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.HTTPSettingsEditor, {
|
|
77
|
+
value: value,
|
|
78
|
+
onChange: onChange,
|
|
79
|
+
isReadonly: isReadonly,
|
|
80
|
+
initialSpecDirect: initialSpecDirect,
|
|
81
|
+
initialSpecProxy: initialSpecProxy
|
|
82
|
+
});
|
|
83
|
+
}
|
|
@@ -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
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_export_star(require("./LokiDatasource"), exports);
|
|
18
|
+
_export_star(require("./LokiDatasourceEditor"), exports);
|
|
19
|
+
_export_star(require("./loki-datasource-types"), exports);
|
|
20
|
+
function _export_star(from, to) {
|
|
21
|
+
Object.keys(from).forEach(function(k) {
|
|
22
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
23
|
+
Object.defineProperty(to, k, {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function() {
|
|
26
|
+
return from[k];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return from;
|
|
32
|
+
}
|
|
@@ -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
|
+
});
|
package/lib/cjs/env.d.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getPluginModule", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return getPluginModule;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _packagejson = /*#__PURE__*/ _interop_require_default(require("../package.json"));
|
|
12
|
+
function _interop_require_default(obj) {
|
|
13
|
+
return obj && obj.__esModule ? obj : {
|
|
14
|
+
default: obj
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function getPluginModule() {
|
|
18
|
+
const { name, version, perses } = _packagejson.default;
|
|
19
|
+
return {
|
|
20
|
+
kind: 'PluginModule',
|
|
21
|
+
metadata: {
|
|
22
|
+
name,
|
|
23
|
+
version
|
|
24
|
+
},
|
|
25
|
+
spec: perses
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
3
|
+
if (typeof WeakMap !== "function") return null;
|
|
4
|
+
var cacheBabelInterop = new WeakMap();
|
|
5
|
+
var cacheNodeInterop = new WeakMap();
|
|
6
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
7
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
8
|
+
})(nodeInterop);
|
|
9
|
+
}
|
|
10
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
11
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
15
|
+
return {
|
|
16
|
+
default: obj
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
20
|
+
if (cache && cache.has(obj)) {
|
|
21
|
+
return cache.get(obj);
|
|
22
|
+
}
|
|
23
|
+
var newObj = {
|
|
24
|
+
__proto__: null
|
|
25
|
+
};
|
|
26
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
27
|
+
for(var key in obj){
|
|
28
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
29
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
30
|
+
if (desc && (desc.get || desc.set)) {
|
|
31
|
+
Object.defineProperty(newObj, key, desc);
|
|
32
|
+
} else {
|
|
33
|
+
newObj[key] = obj[key];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
newObj.default = obj;
|
|
38
|
+
if (cache) {
|
|
39
|
+
cache.set(obj, newObj);
|
|
40
|
+
}
|
|
41
|
+
return newObj;
|
|
42
|
+
}
|
|
43
|
+
Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bootstrap")));
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getPluginModule", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _getPluginModule.getPluginModule;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _getPluginModule = require("./getPluginModule");
|
|
12
|
+
_export_star(require("./model"), exports);
|
|
13
|
+
_export_star(require("./panels"), exports);
|
|
14
|
+
_export_star(require("./queries"), exports);
|
|
15
|
+
_export_star(require("./datasources"), exports);
|
|
16
|
+
function _export_star(from, to) {
|
|
17
|
+
Object.keys(from).forEach(function(k) {
|
|
18
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
19
|
+
Object.defineProperty(to, k, {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function() {
|
|
22
|
+
return from[k];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return from;
|
|
28
|
+
}
|
|
@@ -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-client"), exports);
|
|
18
|
+
_export_star(require("./loki-selectors"), 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,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,198 @@
|
|
|
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
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
indexStats: function() {
|
|
25
|
+
return indexStats;
|
|
26
|
+
},
|
|
27
|
+
labelValues: function() {
|
|
28
|
+
return labelValues;
|
|
29
|
+
},
|
|
30
|
+
labels: function() {
|
|
31
|
+
return labels;
|
|
32
|
+
},
|
|
33
|
+
query: function() {
|
|
34
|
+
return query;
|
|
35
|
+
},
|
|
36
|
+
queryRange: function() {
|
|
37
|
+
return queryRange;
|
|
38
|
+
},
|
|
39
|
+
series: function() {
|
|
40
|
+
return series;
|
|
41
|
+
},
|
|
42
|
+
toUnixSeconds: function() {
|
|
43
|
+
return toUnixSeconds;
|
|
44
|
+
},
|
|
45
|
+
volume: function() {
|
|
46
|
+
return volume;
|
|
47
|
+
},
|
|
48
|
+
volumeRange: function() {
|
|
49
|
+
return volumeRange;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
async function query(params, options) {
|
|
53
|
+
const url = buildUrl('/loki/api/v1/query', options.datasourceUrl);
|
|
54
|
+
url.searchParams.append('query', params.query);
|
|
55
|
+
if (params.time) url.searchParams.append('time', params.time);
|
|
56
|
+
if (params.direction) url.searchParams.append('direction', params.direction);
|
|
57
|
+
if (params.limit) url.searchParams.append('limit', params.limit.toString());
|
|
58
|
+
const response = await fetch(url.toString(), {
|
|
59
|
+
method: 'GET',
|
|
60
|
+
headers: {
|
|
61
|
+
'Content-Type': 'application/json',
|
|
62
|
+
...options.headers
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return response.json();
|
|
66
|
+
}
|
|
67
|
+
function buildUrl(path, datasourceUrl) {
|
|
68
|
+
if (datasourceUrl.startsWith('http://') || datasourceUrl.startsWith('https://')) {
|
|
69
|
+
return new URL(path, datasourceUrl);
|
|
70
|
+
}
|
|
71
|
+
let fullPath = datasourceUrl;
|
|
72
|
+
// Assume relative path, ensure no double slashes
|
|
73
|
+
if (datasourceUrl.endsWith('/') && path.startsWith('/')) {
|
|
74
|
+
fullPath = datasourceUrl + path.slice(1);
|
|
75
|
+
} else if (!datasourceUrl.endsWith('/') && !path.startsWith('/')) {
|
|
76
|
+
fullPath = datasourceUrl + '/' + path;
|
|
77
|
+
} else {
|
|
78
|
+
fullPath = datasourceUrl + path;
|
|
79
|
+
}
|
|
80
|
+
return new URL(fullPath, window.location.origin);
|
|
81
|
+
}
|
|
82
|
+
function toUnixSeconds(val) {
|
|
83
|
+
if (val instanceof Date) return Math.floor(val.getTime() / 1000).toString();
|
|
84
|
+
if (typeof val === 'number') {
|
|
85
|
+
// If it's in ms (>= 10^12), convert to s
|
|
86
|
+
return Math.floor(val > 1e11 ? val / 1000 : val).toString();
|
|
87
|
+
}
|
|
88
|
+
if (/^\d+$/.test(val)) {
|
|
89
|
+
const num = Number(val);
|
|
90
|
+
return Math.floor(num > 1e11 ? num / 1000 : num).toString();
|
|
91
|
+
}
|
|
92
|
+
const d = new Date(val);
|
|
93
|
+
return Math.floor(d.getTime() / 1000).toString();
|
|
94
|
+
}
|
|
95
|
+
async function queryRange(params, options) {
|
|
96
|
+
const url = buildUrl('/loki/api/v1/query_range', options.datasourceUrl);
|
|
97
|
+
url.searchParams.append('query', params.query);
|
|
98
|
+
url.searchParams.append('start', toUnixSeconds(params.start));
|
|
99
|
+
url.searchParams.append('end', toUnixSeconds(params.end));
|
|
100
|
+
if (params.step) url.searchParams.append('step', params.step);
|
|
101
|
+
if (params.interval) url.searchParams.append('interval', params.interval);
|
|
102
|
+
if (params.direction) url.searchParams.append('direction', params.direction);
|
|
103
|
+
if (params.limit) url.searchParams.append('limit', params.limit.toString());
|
|
104
|
+
const response = await fetch(url.toString(), {
|
|
105
|
+
method: 'GET',
|
|
106
|
+
headers: {
|
|
107
|
+
'Content-Type': 'application/json',
|
|
108
|
+
...options.headers
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
return response.json();
|
|
112
|
+
}
|
|
113
|
+
async function labels(start, end, options) {
|
|
114
|
+
const url = buildUrl('/loki/api/v1/labels', options.datasourceUrl);
|
|
115
|
+
if (start) url.searchParams.append('start', start);
|
|
116
|
+
if (end) url.searchParams.append('end', end);
|
|
117
|
+
const response = await fetch(url.toString(), {
|
|
118
|
+
method: 'GET',
|
|
119
|
+
headers: {
|
|
120
|
+
'Content-Type': 'application/json',
|
|
121
|
+
...options.headers
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
return response.json();
|
|
125
|
+
}
|
|
126
|
+
async function labelValues(label, start, end, options) {
|
|
127
|
+
const url = buildUrl(`/loki/api/v1/label/${label}/values`, options.datasourceUrl);
|
|
128
|
+
if (start) url.searchParams.append('start', start);
|
|
129
|
+
if (end) url.searchParams.append('end', end);
|
|
130
|
+
const response = await fetch(url.toString(), {
|
|
131
|
+
method: 'GET',
|
|
132
|
+
headers: {
|
|
133
|
+
'Content-Type': 'application/json',
|
|
134
|
+
...options.headers
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
return response.json();
|
|
138
|
+
}
|
|
139
|
+
async function series(match, start, end, options) {
|
|
140
|
+
const url = buildUrl('/loki/api/v1/series', options.datasourceUrl);
|
|
141
|
+
match.forEach((m)=>url.searchParams.append('match[]', m));
|
|
142
|
+
if (start) url.searchParams.append('start', start);
|
|
143
|
+
if (end) url.searchParams.append('end', end);
|
|
144
|
+
const response = await fetch(url.toString(), {
|
|
145
|
+
method: 'GET',
|
|
146
|
+
headers: {
|
|
147
|
+
'Content-Type': 'application/json',
|
|
148
|
+
...options.headers
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
return response.json();
|
|
152
|
+
}
|
|
153
|
+
async function volume(params, options) {
|
|
154
|
+
const url = buildUrl('/loki/api/v1/index/volume', options.datasourceUrl);
|
|
155
|
+
url.searchParams.append('query', params.query);
|
|
156
|
+
url.searchParams.append('start', params.start);
|
|
157
|
+
url.searchParams.append('end', params.end);
|
|
158
|
+
if (params.step) url.searchParams.append('step', params.step);
|
|
159
|
+
if (params.limit) url.searchParams.append('limit', params.limit.toString());
|
|
160
|
+
const response = await fetch(url.toString(), {
|
|
161
|
+
method: 'GET',
|
|
162
|
+
headers: {
|
|
163
|
+
'Content-Type': 'application/json',
|
|
164
|
+
...options.headers
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
return response.json();
|
|
168
|
+
}
|
|
169
|
+
async function volumeRange(params, options) {
|
|
170
|
+
const url = buildUrl('/loki/api/v1/index/volume_range', options.datasourceUrl);
|
|
171
|
+
url.searchParams.append('query', params.query);
|
|
172
|
+
url.searchParams.append('start', params.start);
|
|
173
|
+
url.searchParams.append('end', params.end);
|
|
174
|
+
if (params.step) url.searchParams.append('step', params.step);
|
|
175
|
+
if (params.limit) url.searchParams.append('limit', params.limit.toString());
|
|
176
|
+
const response = await fetch(url.toString(), {
|
|
177
|
+
method: 'GET',
|
|
178
|
+
headers: {
|
|
179
|
+
'Content-Type': 'application/json',
|
|
180
|
+
...options.headers
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
return response.json();
|
|
184
|
+
}
|
|
185
|
+
async function indexStats(query, start, end, options) {
|
|
186
|
+
const url = buildUrl('/loki/api/v1/index/stats', options.datasourceUrl);
|
|
187
|
+
url.searchParams.append('query', query);
|
|
188
|
+
if (start) url.searchParams.append('start', start);
|
|
189
|
+
if (end) url.searchParams.append('end', end);
|
|
190
|
+
const response = await fetch(url.toString(), {
|
|
191
|
+
method: 'GET',
|
|
192
|
+
headers: {
|
|
193
|
+
'Content-Type': 'application/json',
|
|
194
|
+
...options.headers
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
return response.json();
|
|
198
|
+
}
|
|
@@ -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,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
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
DEFAULT_LOKI: function() {
|
|
25
|
+
return DEFAULT_LOKI;
|
|
26
|
+
},
|
|
27
|
+
LOKI_DATASOURCE_KIND: function() {
|
|
28
|
+
return LOKI_DATASOURCE_KIND;
|
|
29
|
+
},
|
|
30
|
+
isDefaultLokiSelector: function() {
|
|
31
|
+
return isDefaultLokiSelector;
|
|
32
|
+
},
|
|
33
|
+
isLokiDatasourceSelector: function() {
|
|
34
|
+
return isLokiDatasourceSelector;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
38
|
+
const LOKI_DATASOURCE_KIND = 'LokiDatasource';
|
|
39
|
+
const DEFAULT_LOKI = {
|
|
40
|
+
kind: LOKI_DATASOURCE_KIND
|
|
41
|
+
};
|
|
42
|
+
function isDefaultLokiSelector(datasourceSelectValue) {
|
|
43
|
+
return !(0, _pluginsystem.isVariableDatasource)(datasourceSelectValue) && datasourceSelectValue.name === undefined;
|
|
44
|
+
}
|
|
45
|
+
function isLokiDatasourceSelector(datasourceSelectValue) {
|
|
46
|
+
return (0, _pluginsystem.isVariableDatasource)(datasourceSelectValue) || datasourceSelectValue.kind === LOKI_DATASOURCE_KIND;
|
|
47
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
function _export_star(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return from;
|
|
30
|
+
}
|