@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 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/loki-datasource/LokiDatasource.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DatasourcePlugin } from '@perses-dev/plugin-system';\nimport {\n LokiClient,\n query,\n queryRange,\n labels,\n labelValues,\n series,\n volume,\n volumeRange,\n indexStats,\n} from '../../model/loki-client';\nimport { LokiDatasourceSpec } from './loki-datasource-types';\nimport { LokiDatasourceEditor } from './LokiDatasourceEditor';\n\nconst createClient: DatasourcePlugin<LokiDatasourceSpec, LokiClient>['createClient'] = (spec, options) => {\n const { directUrl, proxy } = spec;\n const { proxyUrl } = options;\n\n const datasourceUrl = directUrl ?? proxyUrl;\n if (datasourceUrl === undefined) {\n throw new Error('No URL specified for Loki client. You can use directUrl in the spec to configure it.');\n }\n\n const specHeaders = proxy?.spec.headers;\n\n return {\n options: {\n datasourceUrl,\n },\n query: (params, headers) => query(params, { datasourceUrl, headers: headers ?? specHeaders }),\n queryRange: (params, headers) => queryRange(params, { datasourceUrl, headers: headers ?? specHeaders }),\n labels: (start, end, headers) => labels(start, end, { datasourceUrl, headers: headers ?? specHeaders }),\n labelValues: (label, start, end, headers) =>\n labelValues(label, start, end, { datasourceUrl, headers: headers ?? specHeaders }),\n series: (match, start, end, headers) =>\n series(match, start, end, { datasourceUrl, headers: headers ?? specHeaders }),\n volume: (params, headers) => volume(params, { datasourceUrl, headers: headers ?? specHeaders }),\n volumeRange: (params, headers) => volumeRange(params, { datasourceUrl, headers: headers ?? specHeaders }),\n indexStats: (query, start, end, headers) =>\n indexStats(query, start, end, { datasourceUrl, headers: headers ?? specHeaders }),\n };\n};\n\nexport const LokiDatasource: DatasourcePlugin<LokiDatasourceSpec, LokiClient> = {\n createClient,\n OptionsEditorComponent: LokiDatasourceEditor,\n createInitialOptions: () => ({ directUrl: '' }),\n};\n"],"names":["query","queryRange","labels","labelValues","series","volume","volumeRange","indexStats","LokiDatasourceEditor","createClient","spec","options","directUrl","proxy","proxyUrl","datasourceUrl","undefined","Error","specHeaders","headers","params","start","end","label","match","LokiDatasource","OptionsEditorComponent","createInitialOptions"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAEEA,KAAK,EACLC,UAAU,EACVC,MAAM,EACNC,WAAW,EACXC,MAAM,EACNC,MAAM,EACNC,WAAW,EACXC,UAAU,QACL,0BAA0B;AAEjC,SAASC,oBAAoB,QAAQ,yBAAyB;AAE9D,MAAMC,eAAiF,CAACC,MAAMC;IAC5F,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGH;IAC7B,MAAM,EAAEI,QAAQ,EAAE,GAAGH;IAErB,MAAMI,gBAAgBH,aAAaE;IACnC,IAAIC,kBAAkBC,WAAW;QAC/B,MAAM,IAAIC,MAAM;IAClB;IAEA,MAAMC,cAAcL,OAAOH,KAAKS;IAEhC,OAAO;QACLR,SAAS;YACPI;QACF;QACAf,OAAO,CAACoB,QAAQD,UAAYnB,MAAMoB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QAC3FjB,YAAY,CAACmB,QAAQD,UAAYlB,WAAWmB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QACrGhB,QAAQ,CAACmB,OAAOC,KAAKH,UAAYjB,OAAOmB,OAAOC,KAAK;gBAAEP;gBAAeI,SAASA,WAAWD;YAAY;QACrGf,aAAa,CAACoB,OAAOF,OAAOC,KAAKH,UAC/BhB,YAAYoB,OAAOF,OAAOC,KAAK;gBAAEP;gBAAeI,SAASA,WAAWD;YAAY;QAClFd,QAAQ,CAACoB,OAAOH,OAAOC,KAAKH,UAC1Bf,OAAOoB,OAAOH,OAAOC,KAAK;gBAAEP;gBAAeI,SAASA,WAAWD;YAAY;QAC7Eb,QAAQ,CAACe,QAAQD,UAAYd,OAAOe,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QAC7FZ,aAAa,CAACc,QAAQD,UAAYb,YAAYc,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QACvGX,YAAY,CAACP,OAAOqB,OAAOC,KAAKH,UAC9BZ,WAAWP,OAAOqB,OAAOC,KAAK;gBAAEP;gBAAeI,SAASA,WAAWD;YAAY;IACnF;AACF;AAEA,OAAO,MAAMO,iBAAmE;IAC9EhB;IACAiB,wBAAwBlB;IACxBmB,sBAAsB,IAAO,CAAA;YAAEf,WAAW;QAAG,CAAA;AAC/C,EAAE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { LokiDatasourceSpec } from './loki-datasource-types';
|
|
3
|
+
export interface LokiDatasourceEditorProps {
|
|
4
|
+
value: LokiDatasourceSpec;
|
|
5
|
+
onChange: (next: LokiDatasourceSpec) => void;
|
|
6
|
+
isReadonly?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function LokiDatasourceEditor(props: LokiDatasourceEditorProps): ReactElement;
|
|
9
|
+
//# sourceMappingURL=LokiDatasourceEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LokiDatasourceEditor.d.ts","sourceRoot":"","sources":["../../../../src/datasources/loki-datasource/LokiDatasourceEditor.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,YAAY,CA+DnF"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { HTTPSettingsEditor } from '@perses-dev/plugin-system';
|
|
15
|
+
export function LokiDatasourceEditor(props) {
|
|
16
|
+
const { value, onChange, isReadonly } = props;
|
|
17
|
+
const initialSpecDirect = {
|
|
18
|
+
directUrl: ''
|
|
19
|
+
};
|
|
20
|
+
const initialSpecProxy = {
|
|
21
|
+
proxy: {
|
|
22
|
+
kind: 'HTTPProxy',
|
|
23
|
+
spec: {
|
|
24
|
+
allowedEndpoints: [
|
|
25
|
+
{
|
|
26
|
+
endpointPattern: '/loki/api/v1/query',
|
|
27
|
+
method: 'GET'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
endpointPattern: '/loki/api/v1/query_range',
|
|
31
|
+
method: 'GET'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
endpointPattern: '/loki/api/v1/labels',
|
|
35
|
+
method: 'GET'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
endpointPattern: '/loki/api/v1/label/([a-zA-Z0-9_-]+)/values',
|
|
39
|
+
method: 'GET'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
endpointPattern: '/loki/api/v1/series',
|
|
43
|
+
method: 'GET'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
endpointPattern: '/loki/api/v1/index/volume',
|
|
47
|
+
method: 'GET'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
endpointPattern: '/loki/api/v1/index/volume_range',
|
|
51
|
+
method: 'GET'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
endpointPattern: '/loki/api/v1/index/stats',
|
|
55
|
+
method: 'GET'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
endpointPattern: '/loki/api/v1/tail',
|
|
59
|
+
method: 'GET'
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
url: ''
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
return /*#__PURE__*/ _jsx(HTTPSettingsEditor, {
|
|
67
|
+
value: value,
|
|
68
|
+
onChange: onChange,
|
|
69
|
+
isReadonly: isReadonly,
|
|
70
|
+
initialSpecDirect: initialSpecDirect,
|
|
71
|
+
initialSpecProxy: initialSpecProxy
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=LokiDatasourceEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/loki-datasource/LokiDatasourceEditor.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { HTTPSettingsEditor } from '@perses-dev/plugin-system';\nimport { ReactElement } from 'react';\nimport { LokiDatasourceSpec } from './loki-datasource-types';\n\nexport interface LokiDatasourceEditorProps {\n value: LokiDatasourceSpec;\n onChange: (next: LokiDatasourceSpec) => void;\n isReadonly?: boolean;\n}\n\nexport function LokiDatasourceEditor(props: LokiDatasourceEditorProps): ReactElement {\n const { value, onChange, isReadonly } = props;\n\n const initialSpecDirect: LokiDatasourceSpec = {\n directUrl: '',\n };\n\n const initialSpecProxy: LokiDatasourceSpec = {\n proxy: {\n kind: 'HTTPProxy',\n spec: {\n allowedEndpoints: [\n {\n endpointPattern: '/loki/api/v1/query',\n method: 'GET',\n },\n {\n endpointPattern: '/loki/api/v1/query_range',\n method: 'GET',\n },\n {\n endpointPattern: '/loki/api/v1/labels',\n method: 'GET',\n },\n {\n endpointPattern: '/loki/api/v1/label/([a-zA-Z0-9_-]+)/values',\n method: 'GET',\n },\n {\n endpointPattern: '/loki/api/v1/series',\n method: 'GET',\n },\n {\n endpointPattern: '/loki/api/v1/index/volume',\n method: 'GET',\n },\n {\n endpointPattern: '/loki/api/v1/index/volume_range',\n method: 'GET',\n },\n {\n endpointPattern: '/loki/api/v1/index/stats',\n method: 'GET',\n },\n {\n endpointPattern: '/loki/api/v1/tail',\n method: 'GET',\n },\n ],\n url: '',\n },\n },\n };\n\n return (\n <HTTPSettingsEditor\n value={value}\n onChange={onChange}\n isReadonly={isReadonly}\n initialSpecDirect={initialSpecDirect}\n initialSpecProxy={initialSpecProxy}\n />\n );\n}\n"],"names":["HTTPSettingsEditor","LokiDatasourceEditor","props","value","onChange","isReadonly","initialSpecDirect","directUrl","initialSpecProxy","proxy","kind","spec","allowedEndpoints","endpointPattern","method","url"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,kBAAkB,QAAQ,4BAA4B;AAU/D,OAAO,SAASC,qBAAqBC,KAAgC;IACnE,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGH;IAExC,MAAMI,oBAAwC;QAC5CC,WAAW;IACb;IAEA,MAAMC,mBAAuC;QAC3CC,OAAO;YACLC,MAAM;YACNC,MAAM;gBACJC,kBAAkB;oBAChB;wBACEC,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;iBACD;gBACDC,KAAK;YACP;QACF;IACF;IAEA,qBACE,KAACf;QACCG,OAAOA;QACPC,UAAUA;QACVC,YAAYA;QACZC,mBAAmBA;QACnBE,kBAAkBA;;AAGxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/datasources/loki-datasource/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
export * from './LokiDatasource';
|
|
14
|
+
export * from './LokiDatasourceEditor';
|
|
15
|
+
export * from './loki-datasource-types';
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/loki-datasource/index.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './LokiDatasource';\nexport * from './LokiDatasourceEditor';\nexport * from './loki-datasource-types';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,0BAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loki-datasource-types.d.ts","sourceRoot":"","sources":["../../../../src/datasources/loki-datasource/loki-datasource-types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
export { };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=loki-datasource-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/loki-datasource/loki-datasource-types.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { HTTPProxy } from '@perses-dev/core';\n\nexport interface LokiDatasourceSpec {\n directUrl?: string;\n proxy?: HTTPProxy;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,WAGC"}
|
package/lib/env.d.js
ADDED
package/lib/env.d.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/env.d.ts"],"sourcesContent":["/// <reference types=\"@rsbuild/core/types\" />\n"],"names":[],"mappings":"AAAA,6CAA6C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPluginModule.d.ts","sourceRoot":"","sources":["../../src/getPluginModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAoB,MAAM,2BAA2B,CAAC;AAGnF;;GAEG;AACH,wBAAgB,eAAe,IAAI,oBAAoB,CAUtD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import packageJson from '../package.json';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the plugin module information from package.json
|
|
4
|
+
*/ export function getPluginModule() {
|
|
5
|
+
const { name, version, perses } = packageJson;
|
|
6
|
+
return {
|
|
7
|
+
kind: 'PluginModule',
|
|
8
|
+
metadata: {
|
|
9
|
+
name,
|
|
10
|
+
version
|
|
11
|
+
},
|
|
12
|
+
spec: perses
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=getPluginModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/getPluginModule.ts"],"sourcesContent":["import { PluginModuleResource, PluginModuleSpec } from '@perses-dev/plugin-system';\nimport packageJson from '../package.json';\n\n/**\n * Returns the plugin module information from package.json\n */\nexport function getPluginModule(): PluginModuleResource {\n const { name, version, perses } = packageJson;\n return {\n kind: 'PluginModule',\n metadata: {\n name,\n version,\n },\n spec: perses as PluginModuleSpec,\n };\n}\n"],"names":["packageJson","getPluginModule","name","version","perses","kind","metadata","spec"],"mappings":"AACA,OAAOA,iBAAiB,kBAAkB;AAE1C;;CAEC,GACD,OAAO,SAASC;IACd,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGJ;IAClC,OAAO;QACLK,MAAM;QACNC,UAAU;YACRJ;YACAC;QACF;QACAI,MAAMH;IACR;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index-federation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-federation.d.ts","sourceRoot":"","sources":["../../src/index-federation.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index-federation.ts"],"sourcesContent":["import('./bootstrap');\n"],"names":[],"mappings":"AAAA,MAAM,CAAC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
|
package/lib/index.js
ADDED
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { getPluginModule } from './getPluginModule';\nexport * from './model';\nexport * from './panels';\nexport * from './queries';\nexport * from './datasources';\n"],"names":["getPluginModule"],"mappings":"AAAA,SAASA,eAAe,QAAQ,oBAAoB;AACpD,cAAc,UAAU;AACxB,cAAc,WAAW;AACzB,cAAc,YAAY;AAC1B,cAAc,gBAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/model/index.ts"],"names":[],"mappings":"AAaA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
|
|
@@ -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
|
+
export * from './loki-client';
|
|
14
|
+
export * from './loki-selectors';
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/model/index.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './loki-client';\nexport * from './loki-selectors';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,gBAAgB;AAC9B,cAAc,mBAAmB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export type LokiResultType = 'vector' | 'matrix' | 'streams';
|
|
2
|
+
export interface LokiQueryStats {
|
|
3
|
+
ingester?: Record<string, unknown>;
|
|
4
|
+
store?: Record<string, unknown>;
|
|
5
|
+
summary?: Record<string, unknown>;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface LokiVectorResult {
|
|
9
|
+
metric: Record<string, string>;
|
|
10
|
+
value: [number, string];
|
|
11
|
+
}
|
|
12
|
+
export interface LokiMatrixResult {
|
|
13
|
+
metric: Record<string, string>;
|
|
14
|
+
values: Array<[number, string]>;
|
|
15
|
+
}
|
|
16
|
+
export interface LokiStreamResult {
|
|
17
|
+
stream: Record<string, string>;
|
|
18
|
+
values: Array<[string, string]>;
|
|
19
|
+
}
|
|
20
|
+
export interface LokiQueryResponse {
|
|
21
|
+
status: 'success' | 'error';
|
|
22
|
+
data: {
|
|
23
|
+
resultType: 'vector' | 'streams';
|
|
24
|
+
result: LokiVectorResult[] | LokiStreamResult[];
|
|
25
|
+
stats?: LokiQueryStats;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export type LokiQueryRangeResponse = LokiQueryRangeMatrixResponse & LokiQueryRangeStreamsResponse;
|
|
29
|
+
export interface LokiQueryRangeMatrixResponse {
|
|
30
|
+
status: 'success' | 'error';
|
|
31
|
+
data: {
|
|
32
|
+
resultType: 'matrix';
|
|
33
|
+
result: LokiMatrixResult[];
|
|
34
|
+
stats?: LokiQueryStats;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface LokiQueryRangeStreamsResponse {
|
|
38
|
+
status: 'success' | 'error';
|
|
39
|
+
data: {
|
|
40
|
+
resultType: 'streams';
|
|
41
|
+
result: LokiStreamResult[];
|
|
42
|
+
stats?: LokiQueryStats;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface LokiLabelsResponse {
|
|
46
|
+
status: 'success' | 'error';
|
|
47
|
+
data: string[];
|
|
48
|
+
}
|
|
49
|
+
export interface LokiLabelValuesResponse {
|
|
50
|
+
status: 'success' | 'error';
|
|
51
|
+
data: string[];
|
|
52
|
+
}
|
|
53
|
+
export interface LokiSeriesResponse {
|
|
54
|
+
status: 'success' | 'error';
|
|
55
|
+
data: Array<Record<string, string>>;
|
|
56
|
+
}
|
|
57
|
+
export interface LokiIndexStatsResponse {
|
|
58
|
+
streams: number;
|
|
59
|
+
chunks: number;
|
|
60
|
+
entries: number;
|
|
61
|
+
bytes: number;
|
|
62
|
+
}
|
|
63
|
+
export type LokiVolumeResponse = Record<string, unknown>;
|
|
64
|
+
export type LokiRequestHeaders = Record<string, string>;
|
|
65
|
+
//# sourceMappingURL=loki-client-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loki-client-types.d.ts","sourceRoot":"","sources":["../../../src/model/loki-client-types.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE;QACJ,UAAU,EAAE,QAAQ,GAAG,SAAS,CAAC;QACjC,MAAM,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAAC;QAChD,KAAK,CAAC,EAAE,cAAc,CAAC;KACxB,CAAC;CACH;AAED,MAAM,MAAM,sBAAsB,GAAG,4BAA4B,GAAG,6BAA6B,CAAC;AAElG,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE;QACJ,UAAU,EAAE,QAAQ,CAAC;QACrB,MAAM,EAAE,gBAAgB,EAAE,CAAC;QAC3B,KAAK,CAAC,EAAE,cAAc,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE;QACJ,UAAU,EAAE,SAAS,CAAC;QACtB,MAAM,EAAE,gBAAgB,EAAE,CAAC;QAC3B,KAAK,CAAC,EAAE,cAAc,CAAC;KACxB,CAAC;CACH;AACD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEzD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
export { };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=loki-client-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/model/loki-client-types.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport type LokiResultType = 'vector' | 'matrix' | 'streams';\n\nexport interface LokiQueryStats {\n ingester?: Record<string, unknown>;\n store?: Record<string, unknown>;\n summary?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\nexport interface LokiVectorResult {\n metric: Record<string, string>;\n value: [number, string];\n}\n\nexport interface LokiMatrixResult {\n metric: Record<string, string>;\n values: Array<[number, string]>;\n}\n\nexport interface LokiStreamResult {\n stream: Record<string, string>;\n values: Array<[string, string]>;\n}\n\nexport interface LokiQueryResponse {\n status: 'success' | 'error';\n data: {\n resultType: 'vector' | 'streams';\n result: LokiVectorResult[] | LokiStreamResult[];\n stats?: LokiQueryStats;\n };\n}\n\nexport type LokiQueryRangeResponse = LokiQueryRangeMatrixResponse & LokiQueryRangeStreamsResponse;\n\nexport interface LokiQueryRangeMatrixResponse {\n status: 'success' | 'error';\n data: {\n resultType: 'matrix';\n result: LokiMatrixResult[];\n stats?: LokiQueryStats;\n };\n}\n\nexport interface LokiQueryRangeStreamsResponse {\n status: 'success' | 'error';\n data: {\n resultType: 'streams';\n result: LokiStreamResult[];\n stats?: LokiQueryStats;\n };\n}\nexport interface LokiLabelsResponse {\n status: 'success' | 'error';\n data: string[];\n}\n\nexport interface LokiLabelValuesResponse {\n status: 'success' | 'error';\n data: string[];\n}\n\nexport interface LokiSeriesResponse {\n status: 'success' | 'error';\n data: Array<Record<string, string>>;\n}\n\nexport interface LokiIndexStatsResponse {\n streams: number;\n chunks: number;\n entries: number;\n bytes: number;\n}\n\nexport type LokiVolumeResponse = Record<string, unknown>;\n\nexport type LokiRequestHeaders = Record<string, string>;\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA8EjC,WAAwD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { LokiQueryResponse, LokiQueryRangeResponse, LokiLabelsResponse, LokiLabelValuesResponse, LokiSeriesResponse, LokiIndexStatsResponse, LokiVolumeResponse, LokiRequestHeaders } from './loki-client-types';
|
|
2
|
+
export interface LokiQueryParams {
|
|
3
|
+
query: string;
|
|
4
|
+
time?: string;
|
|
5
|
+
direction?: 'forward' | 'backward';
|
|
6
|
+
limit?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface LokiQueryRangeParams {
|
|
9
|
+
query: string;
|
|
10
|
+
start: string;
|
|
11
|
+
end: string;
|
|
12
|
+
step?: string;
|
|
13
|
+
interval?: string;
|
|
14
|
+
direction?: 'forward' | 'backward';
|
|
15
|
+
limit?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface LokiVolumeParams {
|
|
18
|
+
query: string;
|
|
19
|
+
start: string;
|
|
20
|
+
end: string;
|
|
21
|
+
step?: string;
|
|
22
|
+
limit?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface LokiApiOptions {
|
|
25
|
+
datasourceUrl: string;
|
|
26
|
+
headers?: LokiRequestHeaders;
|
|
27
|
+
}
|
|
28
|
+
export interface LokiClient {
|
|
29
|
+
options: {
|
|
30
|
+
datasourceUrl: string;
|
|
31
|
+
};
|
|
32
|
+
query: (params: LokiQueryParams, headers?: LokiRequestHeaders) => Promise<LokiQueryResponse>;
|
|
33
|
+
queryRange: (params: LokiQueryRangeParams, headers?: LokiRequestHeaders) => Promise<LokiQueryRangeResponse>;
|
|
34
|
+
labels: (start?: string, end?: string, headers?: LokiRequestHeaders) => Promise<LokiLabelsResponse>;
|
|
35
|
+
labelValues: (label: string, start?: string, end?: string, headers?: LokiRequestHeaders) => Promise<LokiLabelValuesResponse>;
|
|
36
|
+
series: (match: string[], start?: string, end?: string, headers?: LokiRequestHeaders) => Promise<LokiSeriesResponse>;
|
|
37
|
+
volume: (params: LokiVolumeParams, headers?: LokiRequestHeaders) => Promise<LokiVolumeResponse>;
|
|
38
|
+
volumeRange: (params: LokiVolumeParams, headers?: LokiRequestHeaders) => Promise<LokiVolumeResponse>;
|
|
39
|
+
indexStats: (query: string, start?: string, end?: string, headers?: LokiRequestHeaders) => Promise<LokiIndexStatsResponse>;
|
|
40
|
+
}
|
|
41
|
+
export declare function query(params: LokiQueryParams, options: LokiApiOptions): Promise<LokiQueryResponse>;
|
|
42
|
+
export declare function toUnixSeconds(val: string | number | Date): string;
|
|
43
|
+
export declare function queryRange(params: LokiQueryRangeParams, options: LokiApiOptions): Promise<LokiQueryRangeResponse>;
|
|
44
|
+
export declare function labels(start: string | undefined, end: string | undefined, options: LokiApiOptions): Promise<LokiLabelsResponse>;
|
|
45
|
+
export declare function labelValues(label: string, start: string | undefined, end: string | undefined, options: LokiApiOptions): Promise<LokiLabelValuesResponse>;
|
|
46
|
+
export declare function series(match: string[], start: string | undefined, end: string | undefined, options: LokiApiOptions): Promise<LokiSeriesResponse>;
|
|
47
|
+
export declare function volume(params: LokiVolumeParams, options: LokiApiOptions): Promise<LokiVolumeResponse>;
|
|
48
|
+
export declare function volumeRange(params: LokiVolumeParams, options: LokiApiOptions): Promise<LokiVolumeResponse>;
|
|
49
|
+
export declare function indexStats(query: string, start: string | undefined, end: string | undefined, options: LokiApiOptions): Promise<LokiIndexStatsResponse>;
|
|
50
|
+
//# sourceMappingURL=loki-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loki-client.d.ts","sourceRoot":"","sources":["../../../src/model/loki-client.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
export async function query(params, options) {
|
|
14
|
+
const url = buildUrl('/loki/api/v1/query', options.datasourceUrl);
|
|
15
|
+
url.searchParams.append('query', params.query);
|
|
16
|
+
if (params.time) url.searchParams.append('time', params.time);
|
|
17
|
+
if (params.direction) url.searchParams.append('direction', params.direction);
|
|
18
|
+
if (params.limit) url.searchParams.append('limit', params.limit.toString());
|
|
19
|
+
const response = await fetch(url.toString(), {
|
|
20
|
+
method: 'GET',
|
|
21
|
+
headers: {
|
|
22
|
+
'Content-Type': 'application/json',
|
|
23
|
+
...options.headers
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return response.json();
|
|
27
|
+
}
|
|
28
|
+
function buildUrl(path, datasourceUrl) {
|
|
29
|
+
if (datasourceUrl.startsWith('http://') || datasourceUrl.startsWith('https://')) {
|
|
30
|
+
return new URL(path, datasourceUrl);
|
|
31
|
+
}
|
|
32
|
+
let fullPath = datasourceUrl;
|
|
33
|
+
// Assume relative path, ensure no double slashes
|
|
34
|
+
if (datasourceUrl.endsWith('/') && path.startsWith('/')) {
|
|
35
|
+
fullPath = datasourceUrl + path.slice(1);
|
|
36
|
+
} else if (!datasourceUrl.endsWith('/') && !path.startsWith('/')) {
|
|
37
|
+
fullPath = datasourceUrl + '/' + path;
|
|
38
|
+
} else {
|
|
39
|
+
fullPath = datasourceUrl + path;
|
|
40
|
+
}
|
|
41
|
+
return new URL(fullPath, window.location.origin);
|
|
42
|
+
}
|
|
43
|
+
export function toUnixSeconds(val) {
|
|
44
|
+
if (val instanceof Date) return Math.floor(val.getTime() / 1000).toString();
|
|
45
|
+
if (typeof val === 'number') {
|
|
46
|
+
// If it's in ms (>= 10^12), convert to s
|
|
47
|
+
return Math.floor(val > 1e11 ? val / 1000 : val).toString();
|
|
48
|
+
}
|
|
49
|
+
if (/^\d+$/.test(val)) {
|
|
50
|
+
const num = Number(val);
|
|
51
|
+
return Math.floor(num > 1e11 ? num / 1000 : num).toString();
|
|
52
|
+
}
|
|
53
|
+
const d = new Date(val);
|
|
54
|
+
return Math.floor(d.getTime() / 1000).toString();
|
|
55
|
+
}
|
|
56
|
+
export async function queryRange(params, options) {
|
|
57
|
+
const url = buildUrl('/loki/api/v1/query_range', options.datasourceUrl);
|
|
58
|
+
url.searchParams.append('query', params.query);
|
|
59
|
+
url.searchParams.append('start', toUnixSeconds(params.start));
|
|
60
|
+
url.searchParams.append('end', toUnixSeconds(params.end));
|
|
61
|
+
if (params.step) url.searchParams.append('step', params.step);
|
|
62
|
+
if (params.interval) url.searchParams.append('interval', params.interval);
|
|
63
|
+
if (params.direction) url.searchParams.append('direction', params.direction);
|
|
64
|
+
if (params.limit) url.searchParams.append('limit', params.limit.toString());
|
|
65
|
+
const response = await fetch(url.toString(), {
|
|
66
|
+
method: 'GET',
|
|
67
|
+
headers: {
|
|
68
|
+
'Content-Type': 'application/json',
|
|
69
|
+
...options.headers
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return response.json();
|
|
73
|
+
}
|
|
74
|
+
export async function labels(start, end, options) {
|
|
75
|
+
const url = buildUrl('/loki/api/v1/labels', options.datasourceUrl);
|
|
76
|
+
if (start) url.searchParams.append('start', start);
|
|
77
|
+
if (end) url.searchParams.append('end', end);
|
|
78
|
+
const response = await fetch(url.toString(), {
|
|
79
|
+
method: 'GET',
|
|
80
|
+
headers: {
|
|
81
|
+
'Content-Type': 'application/json',
|
|
82
|
+
...options.headers
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
return response.json();
|
|
86
|
+
}
|
|
87
|
+
export async function labelValues(label, start, end, options) {
|
|
88
|
+
const url = buildUrl(`/loki/api/v1/label/${label}/values`, options.datasourceUrl);
|
|
89
|
+
if (start) url.searchParams.append('start', start);
|
|
90
|
+
if (end) url.searchParams.append('end', end);
|
|
91
|
+
const response = await fetch(url.toString(), {
|
|
92
|
+
method: 'GET',
|
|
93
|
+
headers: {
|
|
94
|
+
'Content-Type': 'application/json',
|
|
95
|
+
...options.headers
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
return response.json();
|
|
99
|
+
}
|
|
100
|
+
export async function series(match, start, end, options) {
|
|
101
|
+
const url = buildUrl('/loki/api/v1/series', options.datasourceUrl);
|
|
102
|
+
match.forEach((m)=>url.searchParams.append('match[]', m));
|
|
103
|
+
if (start) url.searchParams.append('start', start);
|
|
104
|
+
if (end) url.searchParams.append('end', end);
|
|
105
|
+
const response = await fetch(url.toString(), {
|
|
106
|
+
method: 'GET',
|
|
107
|
+
headers: {
|
|
108
|
+
'Content-Type': 'application/json',
|
|
109
|
+
...options.headers
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return response.json();
|
|
113
|
+
}
|
|
114
|
+
export async function volume(params, options) {
|
|
115
|
+
const url = buildUrl('/loki/api/v1/index/volume', options.datasourceUrl);
|
|
116
|
+
url.searchParams.append('query', params.query);
|
|
117
|
+
url.searchParams.append('start', params.start);
|
|
118
|
+
url.searchParams.append('end', params.end);
|
|
119
|
+
if (params.step) url.searchParams.append('step', params.step);
|
|
120
|
+
if (params.limit) url.searchParams.append('limit', params.limit.toString());
|
|
121
|
+
const response = await fetch(url.toString(), {
|
|
122
|
+
method: 'GET',
|
|
123
|
+
headers: {
|
|
124
|
+
'Content-Type': 'application/json',
|
|
125
|
+
...options.headers
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
return response.json();
|
|
129
|
+
}
|
|
130
|
+
export async function volumeRange(params, options) {
|
|
131
|
+
const url = buildUrl('/loki/api/v1/index/volume_range', options.datasourceUrl);
|
|
132
|
+
url.searchParams.append('query', params.query);
|
|
133
|
+
url.searchParams.append('start', params.start);
|
|
134
|
+
url.searchParams.append('end', params.end);
|
|
135
|
+
if (params.step) url.searchParams.append('step', params.step);
|
|
136
|
+
if (params.limit) url.searchParams.append('limit', params.limit.toString());
|
|
137
|
+
const response = await fetch(url.toString(), {
|
|
138
|
+
method: 'GET',
|
|
139
|
+
headers: {
|
|
140
|
+
'Content-Type': 'application/json',
|
|
141
|
+
...options.headers
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
return response.json();
|
|
145
|
+
}
|
|
146
|
+
export async function indexStats(query, start, end, options) {
|
|
147
|
+
const url = buildUrl('/loki/api/v1/index/stats', options.datasourceUrl);
|
|
148
|
+
url.searchParams.append('query', query);
|
|
149
|
+
if (start) url.searchParams.append('start', start);
|
|
150
|
+
if (end) url.searchParams.append('end', end);
|
|
151
|
+
const response = await fetch(url.toString(), {
|
|
152
|
+
method: 'GET',
|
|
153
|
+
headers: {
|
|
154
|
+
'Content-Type': 'application/json',
|
|
155
|
+
...options.headers
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
return response.json();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
//# sourceMappingURL=loki-client.js.map
|