@perses-dev/victorialogs-plugin 0.4.0 → 0.5.0-beta.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/__mf/js/{VictoriaLogs.db5cc46b.js → VictoriaLogs.72a4d689.js} +3 -3
- package/__mf/js/async/1522.e41aa623.js +22 -0
- package/__mf/js/async/1616.f91f6c7b.js +1 -0
- package/__mf/js/async/198.4b388f96.js +2 -0
- package/__mf/js/async/2377.1627ef61.js +1 -0
- package/__mf/js/async/2786.4ba35a40.js +2 -0
- package/__mf/js/async/2901.21debf59.js +1 -0
- package/__mf/js/async/3865.3eba8e7a.js +1 -0
- package/__mf/js/async/392.8532b8b9.js +2 -0
- package/__mf/js/async/4121.43679b06.js +2 -0
- package/__mf/js/async/4248.f3720fee.js +1 -0
- package/__mf/js/async/4960.813e0b59.js +2 -0
- package/__mf/js/async/5019.a912bf58.js +1 -0
- package/__mf/js/async/5440.e2ea1262.js +2 -0
- package/__mf/js/async/5587.144f3899.js +1 -0
- package/__mf/js/async/560.ebacb2ba.js +37 -0
- package/__mf/js/async/5623.6fc3cf67.js +1 -0
- package/__mf/js/async/5706.38c46b8c.js +1 -0
- package/__mf/js/async/6274.efc9c64a.js +2 -0
- package/__mf/js/async/663.cccc183b.js +1 -0
- package/__mf/js/async/7155.68cbed18.js +7 -0
- package/__mf/js/async/7155.68cbed18.js.LICENSE.txt +102 -0
- package/__mf/js/async/7192.9670a853.js +1 -0
- package/__mf/js/async/7740.c8cb2613.js +101 -0
- package/__mf/js/async/7817.620f3116.js +2 -0
- package/__mf/js/async/7862.e6de7017.js +2 -0
- package/__mf/js/async/7873.4d25d71e.js +2 -0
- package/__mf/js/async/7968.69cffbaf.js +1 -0
- package/__mf/js/async/8356.d0bcc56a.js +1 -0
- package/__mf/js/async/8470.6cf8f7b1.js +2 -0
- package/__mf/js/async/9235.bfe14cc5.js +1 -0
- package/__mf/js/async/941.73cfe62f.js +2 -0
- package/__mf/js/async/9440.37da95ff.js +10 -0
- package/__mf/js/async/9700.72a5372d.js +3 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsDatasource.db12b897.js +2 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldNamesVariable.59ed2274.js +2 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldValuesVariable.fcbe16ef.js +2 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsLogQuery.803dba77.js +1 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsTimeSeriesQuery.6d5fdbb1.js +1 -0
- package/__mf/js/{main.0d99a16b.js → main.00381beb.js} +2 -2
- package/lib/bootstrap.js +2 -2
- package/lib/components/index.js +1 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/logsql-editor.d.ts +2 -2
- package/lib/components/logsql-editor.d.ts.map +1 -1
- package/lib/components/logsql-editor.js +4 -4
- package/lib/components/logsql-editor.js.map +1 -1
- package/lib/components/logsql-extension.d.ts +1 -1
- package/lib/components/logsql-extension.d.ts.map +1 -1
- package/lib/components/logsql-extension.js +3 -3
- package/lib/components/logsql-extension.js.map +1 -1
- package/lib/components/logsql-highlight.js +1 -1
- package/lib/datasources/index.js +1 -1
- package/lib/datasources/index.js.map +1 -1
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.d.ts +3 -3
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.d.ts.map +1 -1
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.js +2 -2
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.js.map +1 -1
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasourceEditor.d.ts +2 -2
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasourceEditor.d.ts.map +1 -1
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasourceEditor.js +1 -1
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasourceEditor.js.map +1 -1
- package/lib/datasources/victorialogs-datasource/index.js +3 -3
- package/lib/datasources/victorialogs-datasource/index.js.map +1 -1
- package/lib/datasources/victorialogs-datasource/types.d.ts +1 -1
- package/lib/datasources/victorialogs-datasource/types.d.ts.map +1 -1
- package/lib/datasources/victorialogs-datasource/types.js.map +1 -1
- package/lib/getPluginModule.d.ts +1 -1
- package/lib/getPluginModule.d.ts.map +1 -1
- package/lib/getPluginModule.js +3 -1
- package/lib/getPluginModule.js.map +1 -1
- package/lib/index-federation.js +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/model/client.d.ts +1 -1
- package/lib/model/client.d.ts.map +1 -1
- package/lib/model/client.js.map +1 -1
- package/lib/model/index.js +3 -3
- package/lib/model/index.js.map +1 -1
- package/lib/model/selectors.d.ts +2 -2
- package/lib/model/selectors.d.ts.map +1 -1
- package/lib/model/selectors.js +1 -1
- package/lib/model/selectors.js.map +1 -1
- package/lib/queries/index.js +2 -2
- package/lib/queries/index.js.map +1 -1
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQuery.d.ts +2 -2
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQuery.d.ts.map +1 -1
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQuery.js +4 -6
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQuery.js.map +1 -1
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.d.ts +3 -3
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.d.ts.map +1 -1
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.js +7 -7
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.js.map +1 -1
- package/lib/queries/victorialogs-log-query/index.js +4 -4
- package/lib/queries/victorialogs-log-query/index.js.map +1 -1
- package/lib/queries/victorialogs-log-query/query.d.ts +2 -2
- package/lib/queries/victorialogs-log-query/query.d.ts.map +1 -1
- package/lib/queries/victorialogs-log-query/query.js +2 -2
- package/lib/queries/victorialogs-log-query/query.js.map +1 -1
- package/lib/queries/victorialogs-log-query/types.d.ts +1 -1
- package/lib/queries/victorialogs-log-query/types.d.ts.map +1 -1
- package/lib/queries/victorialogs-log-query/types.js.map +1 -1
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.d.ts +2 -2
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.d.ts.map +1 -1
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.js +4 -6
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.js.map +1 -1
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.d.ts +3 -3
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.d.ts.map +1 -1
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.js +7 -7
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.js.map +1 -1
- package/lib/queries/victorialogs-time-series-query/index.js +4 -4
- package/lib/queries/victorialogs-time-series-query/index.js.map +1 -1
- package/lib/queries/victorialogs-time-series-query/query.d.ts +2 -2
- package/lib/queries/victorialogs-time-series-query/query.d.ts.map +1 -1
- package/lib/queries/victorialogs-time-series-query/query.js +4 -4
- package/lib/queries/victorialogs-time-series-query/query.js.map +1 -1
- package/lib/queries/victorialogs-time-series-query/types.d.ts +1 -1
- package/lib/queries/victorialogs-time-series-query/types.d.ts.map +1 -1
- package/lib/queries/victorialogs-time-series-query/types.js.map +1 -1
- package/lib/setup-tests.d.ts +1 -1
- package/lib/setup-tests.d.ts.map +1 -1
- package/lib/setup-tests.js +2 -2
- package/lib/setup-tests.js.map +1 -1
- package/lib/variables/index.js +2 -2
- package/lib/variables/index.js.map +1 -1
- package/lib/variables/types.d.ts +2 -2
- package/lib/variables/types.d.ts.map +1 -1
- package/lib/variables/types.js.map +1 -1
- package/lib/variables/utils.d.ts +5 -5
- package/lib/variables/utils.d.ts.map +1 -1
- package/lib/variables/utils.js +2 -2
- package/lib/variables/utils.js.map +1 -1
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariable.d.ts +2 -2
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariable.d.ts.map +1 -1
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariable.js +4 -4
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariable.js.map +1 -1
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariableEditor.d.ts +3 -3
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariableEditor.d.ts.map +1 -1
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariableEditor.js +5 -5
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariableEditor.js.map +1 -1
- package/lib/variables/victorialogs-field-names/index.js +1 -1
- package/lib/variables/victorialogs-field-names/index.js.map +1 -1
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariable.d.ts +2 -2
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariable.d.ts.map +1 -1
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariable.js +4 -4
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariable.js.map +1 -1
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.d.ts +3 -3
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.d.ts.map +1 -1
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.js +6 -6
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.js.map +1 -1
- package/lib/variables/victorialogs-field-values/index.js +1 -1
- package/lib/variables/victorialogs-field-values/index.js.map +1 -1
- package/mf-manifest.json +117 -230
- package/mf-stats.json +117 -242
- package/package.json +20 -12
- package/__mf/js/async/1170.532d9fb3.js +0 -101
- package/__mf/js/async/1616.5a6b8ab3.js +0 -1
- package/__mf/js/async/1728.b01c38aa.js +0 -1
- package/__mf/js/async/1969.fc35e1b4.js +0 -1
- package/__mf/js/async/198.fbb67f8a.js +0 -2
- package/__mf/js/async/2043.b149adfd.js +0 -2
- package/__mf/js/async/2043.b149adfd.js.LICENSE.txt +0 -24
- package/__mf/js/async/2377.9265b0a7.js +0 -1
- package/__mf/js/async/2728.fd6779e6.js +0 -1
- package/__mf/js/async/2749.71c38fe0.js +0 -2
- package/__mf/js/async/2842.3740ca9b.js +0 -1
- package/__mf/js/async/3059.fe1cdfc3.js +0 -1
- package/__mf/js/async/392.c6e57bd8.js +0 -2
- package/__mf/js/async/3981.02c66856.js +0 -3
- package/__mf/js/async/3998.e9a3cf1a.js +0 -2
- package/__mf/js/async/4121.5468ac01.js +0 -2
- package/__mf/js/async/4225.744952e9.js +0 -10
- package/__mf/js/async/4248.9b99209c.js +0 -1
- package/__mf/js/async/5019.51d94aab.js +0 -1
- package/__mf/js/async/5071.6ac86637.js +0 -1
- package/__mf/js/async/5405.004a286a.js +0 -2
- package/__mf/js/async/5405.004a286a.js.LICENSE.txt +0 -37
- package/__mf/js/async/5440.7765ad14.js +0 -2
- package/__mf/js/async/5481.b7b48b8f.js +0 -2
- package/__mf/js/async/5587.12959dbf.js +0 -1
- package/__mf/js/async/5706.55b9ef2f.js +0 -1
- package/__mf/js/async/6274.0634d636.js +0 -2
- package/__mf/js/async/6408.2bc7e8f4.js +0 -7
- package/__mf/js/async/6408.2bc7e8f4.js.LICENSE.txt +0 -39
- package/__mf/js/async/6410.63a88be6.js +0 -1
- package/__mf/js/async/6592.24e266ac.js +0 -1
- package/__mf/js/async/6854.21ddded3.js +0 -1
- package/__mf/js/async/6864.66bc6315.js +0 -2
- package/__mf/js/async/7177.dfbac40a.js +0 -1
- package/__mf/js/async/7192.339adba2.js +0 -1
- package/__mf/js/async/7793.43841fdc.js +0 -1
- package/__mf/js/async/7817.5e96b0dd.js +0 -2
- package/__mf/js/async/7968.d586d9f8.js +0 -1
- package/__mf/js/async/7978.895bbb5f.js +0 -1
- package/__mf/js/async/7984.194982d6.js +0 -22
- package/__mf/js/async/8356.053c21d0.js +0 -1
- package/__mf/js/async/8470.cb89de3b.js +0 -2
- package/__mf/js/async/873.4df0ea19.js +0 -1
- package/__mf/js/async/8787.c3298397.js +0 -2
- package/__mf/js/async/9235.3e1de7b9.js +0 -1
- package/__mf/js/async/941.a44f722e.js +0 -2
- package/__mf/js/async/9588.c379dd44.js +0 -1
- package/__mf/js/async/9836.fd9de3af.js +0 -1
- package/__mf/js/async/9877.8b83de3c.js +0 -38
- package/__mf/js/async/9944.4d41cb7b.js +0 -1
- package/__mf/js/async/__federation_expose_VictoriaLogsDatasource.807ae747.js +0 -2
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldNamesVariable.ccafeb36.js +0 -1
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldValuesVariable.5e29c327.js +0 -1
- package/__mf/js/async/__federation_expose_VictoriaLogsLogQuery.6e607640.js +0 -1
- package/__mf/js/async/__federation_expose_VictoriaLogsTimeSeriesQuery.91a8ad9d.js +0 -1
- package/lib/cjs/bootstrap.js +0 -26
- package/lib/cjs/components/index.js +0 -23
- package/lib/cjs/components/logsql-editor.js +0 -110
- package/lib/cjs/components/logsql-extension.js +0 -55
- package/lib/cjs/components/logsql-highlight.js +0 -40
- package/lib/cjs/datasources/index.js +0 -30
- package/lib/cjs/datasources/victorialogs-datasource/VictoriaLogsDatasource.js +0 -61
- package/lib/cjs/datasources/victorialogs-datasource/VictoriaLogsDatasourceEditor.js +0 -95
- package/lib/cjs/datasources/victorialogs-datasource/index.js +0 -32
- package/lib/cjs/datasources/victorialogs-datasource/types.js +0 -16
- package/lib/cjs/env.d.js +0 -14
- package/lib/cjs/getPluginModule.js +0 -39
- package/lib/cjs/index-federation.js +0 -55
- package/lib/cjs/index.js +0 -39
- package/lib/cjs/model/client.js +0 -156
- package/lib/cjs/model/index.js +0 -32
- package/lib/cjs/model/selectors.js +0 -47
- package/lib/cjs/model/types.js +0 -16
- package/lib/cjs/queries/constants.js +0 -34
- package/lib/cjs/queries/index.js +0 -31
- package/lib/cjs/queries/victorialogs-log-query/VictoriaLogsLogQuery.js +0 -63
- package/lib/cjs/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.js +0 -114
- package/lib/cjs/queries/victorialogs-log-query/index.js +0 -33
- package/lib/cjs/queries/victorialogs-log-query/query.js +0 -73
- package/lib/cjs/queries/victorialogs-log-query/types.js +0 -16
- package/lib/cjs/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.js +0 -43
- package/lib/cjs/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.js +0 -112
- package/lib/cjs/queries/victorialogs-time-series-query/index.js +0 -33
- package/lib/cjs/queries/victorialogs-time-series-query/query.js +0 -126
- package/lib/cjs/queries/victorialogs-time-series-query/types.js +0 -16
- package/lib/cjs/setup-tests.js +0 -19
- package/lib/cjs/variables/index.js +0 -31
- package/lib/cjs/variables/types.js +0 -16
- package/lib/cjs/variables/utils.js +0 -97
- package/lib/cjs/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariable.js +0 -57
- package/lib/cjs/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariableEditor.js +0 -80
- package/lib/cjs/variables/victorialogs-field-names/index.js +0 -30
- package/lib/cjs/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariable.js +0 -61
- package/lib/cjs/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.js +0 -113
- package/lib/cjs/variables/victorialogs-field-values/index.js +0 -30
- /package/__mf/css/async/{6408.85c2cbf6.css → 7155.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{7984.194982d6.js.LICENSE.txt → 1522.e41aa623.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{198.fbb67f8a.js.LICENSE.txt → 198.4b388f96.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2749.71c38fe0.js.LICENSE.txt → 2786.4ba35a40.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.c6e57bd8.js.LICENSE.txt → 392.8532b8b9.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4121.5468ac01.js.LICENSE.txt → 4121.43679b06.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{3998.e9a3cf1a.js.LICENSE.txt → 4960.813e0b59.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5440.7765ad14.js.LICENSE.txt → 5440.e2ea1262.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6274.0634d636.js.LICENSE.txt → 6274.efc9c64a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6864.66bc6315.js.LICENSE.txt → 7817.620f3116.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5481.b7b48b8f.js.LICENSE.txt → 7862.e6de7017.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8470.cb89de3b.js.LICENSE.txt → 8470.6cf8f7b1.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{7817.5e96b0dd.js.LICENSE.txt → 941.73cfe62f.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4225.744952e9.js.LICENSE.txt → 9440.37da95ff.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8787.c3298397.js.LICENSE.txt → __federation_expose_VictoriaLogsDatasource.db12b897.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.a44f722e.js.LICENSE.txt → __federation_expose_VictoriaLogsFieldNamesVariable.59ed2274.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_VictoriaLogsDatasource.807ae747.js.LICENSE.txt → __federation_expose_VictoriaLogsFieldValuesVariable.fcbe16ef.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQuery.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQuery.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { LogQueryPlugin, LogQueryContext } from '@perses-dev/plugin-system';\nimport { calculateVolumeInterval, parseVariables } from '@perses-dev/plugin-system';\nimport type { QueryDefinition } from '@perses-dev/spec';\n\nimport { getVictoriaLogsLogData } from './query';\nimport type { VictoriaLogsLogQuerySpec } from './types';\nimport { VictoriaLogsLogQueryEditor } from './VictoriaLogsLogQueryEditor';\n\nexport const VictoriaLogsLogQuery: LogQueryPlugin<VictoriaLogsLogQuerySpec> = {\n getLogData: getVictoriaLogsLogData,\n OptionsEditorComponent: VictoriaLogsLogQueryEditor,\n createInitialOptions: () => ({ query: '' }),\n dependsOn: (spec) => {\n const queryVariables = parseVariables(spec.query);\n const allVariables = [...new Set(queryVariables)];\n return {\n variables: allVariables,\n };\n },\n createVolumeQuery: (spec: VictoriaLogsLogQuerySpec, ctx: LogQueryContext): QueryDefinition | null => {\n if (!spec.query || !spec.query.trim()) {\n return null;\n }\n\n const interval = calculateVolumeInterval(ctx.timeRange.end.getTime() - ctx.timeRange.start.getTime());\n const volumeQuery = `${spec.query} | stats by (_time:${interval}, _stream) count() as volume`;\n\n return {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'VictoriaLogsTimeSeriesQuery',\n spec: {\n query: volumeQuery,\n datasource: spec.datasource,\n step: interval,\n },\n },\n },\n };\n },\n};\n"],"names":["calculateVolumeInterval","parseVariables","getVictoriaLogsLogData","VictoriaLogsLogQueryEditor","VictoriaLogsLogQuery","getLogData","OptionsEditorComponent","createInitialOptions","query","dependsOn","spec","queryVariables","allVariables","Set","variables","createVolumeQuery","ctx","trim","interval","timeRange","end","getTime","start","volumeQuery","kind","plugin","datasource","step"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,uBAAuB,EAAEC,cAAc,QAAQ,4BAA4B;AAGpF,SAASC,sBAAsB,QAAQ,aAAU;AAEjD,SAASC,0BAA0B,QAAQ,kCAA+B;AAE1E,OAAO,MAAMC,uBAAiE;IAC5EC,YAAYH;IACZI,wBAAwBH;IACxBI,sBAAsB,IAAO,CAAA;YAAEC,OAAO;QAAG,CAAA;IACzCC,WAAW,CAACC;QACV,MAAMC,iBAAiBV,eAAeS,KAAKF,KAAK;QAChD,MAAMI,eAAe;eAAI,IAAIC,IAAIF;SAAgB;QACjD,OAAO;YACLG,WAAWF;QACb;IACF;IACAG,mBAAmB,CAACL,MAAgCM;QAClD,IAAI,CAACN,KAAKF,KAAK,IAAI,CAACE,KAAKF,KAAK,CAACS,IAAI,IAAI;YACrC,OAAO;QACT;QAEA,MAAMC,WAAWlB,wBAAwBgB,IAAIG,SAAS,CAACC,GAAG,CAACC,OAAO,KAAKL,IAAIG,SAAS,CAACG,KAAK,CAACD,OAAO;QAClG,MAAME,cAAc,GAAGb,KAAKF,KAAK,CAAC,mBAAmB,EAAEU,SAAS,4BAA4B,CAAC;QAE7F,OAAO;YACLM,MAAM;YACNd,MAAM;gBACJe,QAAQ;oBACND,MAAM;oBACNd,MAAM;wBACJF,OAAOe;wBACPG,YAAYhB,KAAKgB,UAAU;wBAC3BC,MAAMT;oBACR;gBACF;YACF;QACF;IACF;AACF,EAAE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OptionsEditorProps } from '@perses-dev/plugin-system';
|
|
2
|
-
import { ReactElement } from 'react';
|
|
3
|
-
import { VictoriaLogsLogQuerySpec } from './types';
|
|
1
|
+
import type { OptionsEditorProps } from '@perses-dev/plugin-system';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { VictoriaLogsLogQuerySpec } from './types';
|
|
4
4
|
type VictoriaLogsQueryEditorProps = OptionsEditorProps<VictoriaLogsLogQuerySpec>;
|
|
5
5
|
export declare function VictoriaLogsLogQueryEditor(props: VictoriaLogsQueryEditorProps): ReactElement;
|
|
6
6
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VictoriaLogsLogQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VictoriaLogsLogQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAyB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD,KAAK,4BAA4B,GAAG,kBAAkB,CAAC,wBAAwB,CAAC,CAAC;AAEjF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,4BAA4B,GAAG,YAAY,CAoF5F"}
|
|
@@ -11,13 +11,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { LogsQLEditor } from
|
|
19
|
-
import { VICTORIALOGS_DATASOURCE_KIND } from
|
|
20
|
-
import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from
|
|
14
|
+
import { InputLabel, Stack } from "@mui/material";
|
|
15
|
+
import { createModEnterHandler } from "@perses-dev/dashboards";
|
|
16
|
+
import { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from "@perses-dev/plugin-system";
|
|
17
|
+
import { useCallback, useState, useEffect } from "react";
|
|
18
|
+
import { LogsQLEditor } from "../../components/logsql-editor.js";
|
|
19
|
+
import { VICTORIALOGS_DATASOURCE_KIND } from "../../model/index.js";
|
|
20
|
+
import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from "../constants.js";
|
|
21
21
|
export function VictoriaLogsLogQueryEditor(props) {
|
|
22
22
|
const { onChange, value } = props;
|
|
23
23
|
const { datasource } = value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { InputLabel, Stack } from '@mui/material';\nimport { createModEnterHandler } from '@perses-dev/dashboards';\nimport type { DatasourceSelectProps, OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from '@perses-dev/plugin-system';\nimport type { ReactElement } from 'react';\nimport { useCallback, useState, useEffect } from 'react';\n\nimport { LogsQLEditor } from '../../components/logsql-editor';\nimport type { VictoriaLogsDatasourceSelector } from '../../model';\nimport { VICTORIALOGS_DATASOURCE_KIND } from '../../model';\nimport { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';\nimport type { VictoriaLogsLogQuerySpec } from './types';\n\ntype VictoriaLogsQueryEditorProps = OptionsEditorProps<VictoriaLogsLogQuerySpec>;\n\nexport function VictoriaLogsLogQueryEditor(props: VictoriaLogsQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const datasourceSelectValue = datasource ?? DEFAULT_DATASOURCE;\n const selectedDatasource = useDatasourceSelectValueToSelector(\n datasourceSelectValue,\n VICTORIALOGS_DATASOURCE_KIND,\n ) as VictoriaLogsDatasourceSelector;\n\n // const { data: client } = useDatasourceClient<VictoriaLogsClient>(selectedDatasource);\n // const victorialogsURL = client?.options.datasourceUrl;\n\n // Local state for editor value to prevent query_range calls on every keystroke\n const [localQuery, setLocalQuery] = useState(value.query);\n\n // Update local state when prop changes\n useEffect(() => {\n setLocalQuery(value.query);\n }, [value.query]);\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (newDatasourceSelection) => {\n if (!isVariableDatasource(newDatasourceSelection) && newDatasourceSelection.kind === DATASOURCE_KIND) {\n onChange({ ...value, datasource: newDatasourceSelection });\n return;\n }\n\n throw new Error('Got unexpected non VictoriaLogsQuery datasource selection');\n };\n\n // Debounced query change handler to prevent excessive query_range calls\n const handleQueryChange = useCallback((newQuery: string) => {\n setLocalQuery(newQuery);\n }, []);\n\n // Immediate query execution on Enter or blur\n const handleQueryExecute = useCallback(\n (query: string) => {\n onChange({ ...value, query });\n },\n [onChange, value],\n );\n\n return (\n <Stack spacing={1.5} paddingBottom={1}>\n <div>\n <InputLabel\n sx={{\n display: 'block',\n marginBottom: '4px',\n fontWeight: 500,\n }}\n >\n Datasource\n </InputLabel>\n <DatasourceSelect\n datasourcePluginKind={DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n label=\"VictoriaLogs Datasource\"\n notched\n />\n </div>\n\n <div>\n <InputLabel\n sx={{\n display: 'block',\n marginBottom: '4px',\n fontWeight: 500,\n }}\n >\n LogsQL Query\n </InputLabel>\n <LogsQLEditor\n value={localQuery}\n onChange={handleQueryChange}\n onBlur={() => handleQueryExecute(localQuery)}\n onKeyDown={createModEnterHandler(() => handleQueryExecute(localQuery))}\n placeholder='Enter LogsQL query (e.g. {job=\"mysql\"} |= \"error\")'\n // height=\"120px\"\n />\n </div>\n </Stack>\n );\n}\n"],"names":["InputLabel","Stack","createModEnterHandler","DatasourceSelect","isVariableDatasource","useDatasourceSelectValueToSelector","useCallback","useState","useEffect","LogsQLEditor","VICTORIALOGS_DATASOURCE_KIND","DATASOURCE_KIND","DEFAULT_DATASOURCE","VictoriaLogsLogQueryEditor","props","onChange","value","datasource","datasourceSelectValue","selectedDatasource","localQuery","setLocalQuery","query","handleDatasourceChange","newDatasourceSelection","kind","Error","handleQueryChange","newQuery","handleQueryExecute","spacing","paddingBottom","div","sx","display","marginBottom","fontWeight","datasourcePluginKind","label","notched","onBlur","onKeyDown","placeholder"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,UAAU,EAAEC,KAAK,QAAQ,gBAAgB;AAClD,SAASC,qBAAqB,QAAQ,yBAAyB;AAE/D,SAASC,gBAAgB,EAAEC,oBAAoB,EAAEC,kCAAkC,QAAQ,4BAA4B;AAEvH,SAASC,WAAW,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,QAAQ;AAEzD,SAASC,YAAY,QAAQ,oCAAiC;AAE9D,SAASC,4BAA4B,QAAQ,uBAAc;AAC3D,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,kBAAe;AAKnE,OAAO,SAASC,2BAA2BC,KAAmC;IAC5E,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,wBAAwBD,cAAcL;IAC5C,MAAMO,qBAAqBd,mCACzBa,uBACAR;IAGF,wFAAwF;IACxF,yDAAyD;IAEzD,+EAA+E;IAC/E,MAAM,CAACU,YAAYC,cAAc,GAAGd,SAASS,MAAMM,KAAK;IAExD,uCAAuC;IACvCd,UAAU;QACRa,cAAcL,MAAMM,KAAK;IAC3B,GAAG;QAACN,MAAMM,KAAK;KAAC;IAEhB,MAAMC,yBAA4D,CAACC;QACjE,IAAI,CAACpB,qBAAqBoB,2BAA2BA,uBAAuBC,IAAI,KAAKd,iBAAiB;YACpGI,SAAS;gBAAE,GAAGC,KAAK;gBAAEC,YAAYO;YAAuB;YACxD;QACF;QAEA,MAAM,IAAIE,MAAM;IAClB;IAEA,wEAAwE;IACxE,MAAMC,oBAAoBrB,YAAY,CAACsB;QACrCP,cAAcO;IAChB,GAAG,EAAE;IAEL,6CAA6C;IAC7C,MAAMC,qBAAqBvB,YACzB,CAACgB;QACCP,SAAS;YAAE,GAAGC,KAAK;YAAEM;QAAM;IAC7B,GACA;QAACP;QAAUC;KAAM;IAGnB,qBACE,MAACf;QAAM6B,SAAS;QAAKC,eAAe;;0BAClC,MAACC;;kCACC,KAAChC;wBACCiC,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAACjC;wBACCkC,sBAAsB1B;wBACtBK,OAAOG;wBACPJ,UAAUQ;wBACVe,OAAM;wBACNC,OAAO;;;;0BAIX,MAACP;;kCACC,KAAChC;wBACCiC,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAAC3B;wBACCO,OAAOI;wBACPL,UAAUY;wBACVa,QAAQ,IAAMX,mBAAmBT;wBACjCqB,WAAWvC,sBAAsB,IAAM2B,mBAAmBT;wBAC1DsB,aAAY;;;;;;AAMtB"}
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
13
|
+
export * from "./query.js";
|
|
14
|
+
export * from "./VictoriaLogsLogQuery.js";
|
|
15
|
+
export * from "./VictoriaLogsLogQueryEditor.js";
|
|
16
|
+
export * from "./types.js";
|
|
17
17
|
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/victorialogs-log-query/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './query';\nexport * from './VictoriaLogsLogQuery';\nexport * from './VictoriaLogsLogQueryEditor';\nexport * from './types';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/victorialogs-log-query/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './query';\nexport * from './VictoriaLogsLogQuery';\nexport * from './VictoriaLogsLogQueryEditor';\nexport * from './types';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,aAAU;AACxB,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,aAAU"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LogQueryPlugin } from '@perses-dev/plugin-system';
|
|
2
|
-
import { VictoriaLogsLogQuerySpec } from './types';
|
|
1
|
+
import type { LogQueryPlugin } from '@perses-dev/plugin-system';
|
|
2
|
+
import type { VictoriaLogsLogQuerySpec } from './types';
|
|
3
3
|
export declare const getVictoriaLogsLogData: LogQueryPlugin<VictoriaLogsLogQuerySpec>['getLogData'];
|
|
4
4
|
//# sourceMappingURL=query.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-log-query/query.ts"],"names":[],"mappings":"AAaA,OAAO,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-log-query/query.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,2BAA2B,CAAC;AAOjF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAqBxD,eAAO,MAAM,sBAAsB,EAAE,cAAc,CAAC,wBAAwB,CAAC,CAAC,YAAY,CAiCzF,CAAC"}
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { replaceVariables } from
|
|
14
|
-
import { DEFAULT_DATASOURCE } from
|
|
13
|
+
import { replaceVariables } from "@perses-dev/plugin-system";
|
|
14
|
+
import { DEFAULT_DATASOURCE } from "../constants.js";
|
|
15
15
|
function convertStreamToLogs(data, defaultTime) {
|
|
16
16
|
const entries = [];
|
|
17
17
|
data.forEach((entry)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/victorialogs-log-query/query.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/victorialogs-log-query/query.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { LogQueryPlugin, LogQueryContext } from '@perses-dev/plugin-system';\nimport { replaceVariables } from '@perses-dev/plugin-system';\nimport type { LogData, LogEntry } from '@perses-dev/spec';\n\nimport type { VictoriaLogsClient } from '../../model/client';\nimport type { VictoriaLogsStreamQueryRangeResponse } from '../../model/types';\nimport { DEFAULT_DATASOURCE } from '../constants';\nimport type { VictoriaLogsLogQuerySpec } from './types';\n\nfunction convertStreamToLogs(data: VictoriaLogsStreamQueryRangeResponse, defaultTime: string): LogData {\n const entries: LogEntry[] = [];\n\n data.forEach((entry) => {\n const { _msg, _time, ...labels } = entry;\n const time = !_time && !_msg ? defaultTime : Date.parse(_time);\n entries.push({\n timestamp: Number(time) / 1000,\n line: _msg || '',\n labels: labels,\n });\n });\n\n return {\n entries,\n totalCount: entries.length,\n };\n}\n\nexport const getVictoriaLogsLogData: LogQueryPlugin<VictoriaLogsLogQuerySpec>['getLogData'] = async (\n spec: VictoriaLogsLogQuerySpec,\n context: LogQueryContext,\n) => {\n if (!spec.query) {\n return {\n logs: { entries: [], totalCount: 0 },\n timeRange: { start: context.timeRange.start, end: context.timeRange.end },\n };\n }\n\n const query = replaceVariables(spec.query, context.variableState);\n const client = (await context.datasourceStore.getDatasourceClient<VictoriaLogsClient>(\n spec.datasource ?? DEFAULT_DATASOURCE,\n )) as VictoriaLogsClient;\n\n const { start, end } = context.timeRange;\n\n const response: VictoriaLogsStreamQueryRangeResponse = await client.streamQueryRange({\n query,\n start: start.toISOString(),\n end: end.toISOString(),\n });\n\n const logs = convertStreamToLogs(response, end.getTime().toString());\n\n return {\n logs,\n timeRange: { start, end },\n metadata: {\n executedQueryString: query,\n },\n };\n};\n"],"names":["replaceVariables","DEFAULT_DATASOURCE","convertStreamToLogs","data","defaultTime","entries","forEach","entry","_msg","_time","labels","time","Date","parse","push","timestamp","Number","line","totalCount","length","getVictoriaLogsLogData","spec","context","query","logs","timeRange","start","end","variableState","client","datasourceStore","getDatasourceClient","datasource","response","streamQueryRange","toISOString","getTime","toString","metadata","executedQueryString"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,gBAAgB,QAAQ,4BAA4B;AAK7D,SAASC,kBAAkB,QAAQ,kBAAe;AAGlD,SAASC,oBAAoBC,IAA0C,EAAEC,WAAmB;IAC1F,MAAMC,UAAsB,EAAE;IAE9BF,KAAKG,OAAO,CAAC,CAACC;QACZ,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGC,QAAQ,GAAGH;QACnC,MAAMI,OAAO,CAACF,SAAS,CAACD,OAAOJ,cAAcQ,KAAKC,KAAK,CAACJ;QACxDJ,QAAQS,IAAI,CAAC;YACXC,WAAWC,OAAOL,QAAQ;YAC1BM,MAAMT,QAAQ;YACdE,QAAQA;QACV;IACF;IAEA,OAAO;QACLL;QACAa,YAAYb,QAAQc,MAAM;IAC5B;AACF;AAEA,OAAO,MAAMC,yBAAiF,OAC5FC,MACAC;IAEA,IAAI,CAACD,KAAKE,KAAK,EAAE;QACf,OAAO;YACLC,MAAM;gBAAEnB,SAAS,EAAE;gBAAEa,YAAY;YAAE;YACnCO,WAAW;gBAAEC,OAAOJ,QAAQG,SAAS,CAACC,KAAK;gBAAEC,KAAKL,QAAQG,SAAS,CAACE,GAAG;YAAC;QAC1E;IACF;IAEA,MAAMJ,QAAQvB,iBAAiBqB,KAAKE,KAAK,EAAED,QAAQM,aAAa;IAChE,MAAMC,SAAU,MAAMP,QAAQQ,eAAe,CAACC,mBAAmB,CAC/DV,KAAKW,UAAU,IAAI/B;IAGrB,MAAM,EAAEyB,KAAK,EAAEC,GAAG,EAAE,GAAGL,QAAQG,SAAS;IAExC,MAAMQ,WAAiD,MAAMJ,OAAOK,gBAAgB,CAAC;QACnFX;QACAG,OAAOA,MAAMS,WAAW;QACxBR,KAAKA,IAAIQ,WAAW;IACtB;IAEA,MAAMX,OAAOtB,oBAAoB+B,UAAUN,IAAIS,OAAO,GAAGC,QAAQ;IAEjE,OAAO;QACLb;QACAC,WAAW;YAAEC;YAAOC;QAAI;QACxBW,UAAU;YACRC,qBAAqBhB;QACvB;IACF;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-log-query/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-log-query/types.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,kBAAkB,CAAC;CACjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/victorialogs-log-query/types.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DatasourceSelector } from '@perses-dev/spec';\n\nexport interface VictoriaLogsLogQuerySpec {\n query: string;\n datasource?: DatasourceSelector;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,WAGC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/victorialogs-log-query/types.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { DatasourceSelector } from '@perses-dev/spec';\n\nexport interface VictoriaLogsLogQuerySpec {\n query: string;\n datasource?: DatasourceSelector;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,WAGC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';
|
|
2
|
-
import { VictoriaLogsTimeSeriesQuerySpec } from './types';
|
|
1
|
+
import type { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';
|
|
2
|
+
import type { VictoriaLogsTimeSeriesQuerySpec } from './types';
|
|
3
3
|
export declare const VictoriaLogsTimeSeriesQuery: TimeSeriesQueryPlugin<VictoriaLogsTimeSeriesQuerySpec>;
|
|
4
4
|
//# sourceMappingURL=VictoriaLogsTimeSeriesQuery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VictoriaLogsTimeSeriesQuery.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"VictoriaLogsTimeSeriesQuery.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAIvE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAG/D,eAAO,MAAM,2BAA2B,EAAE,qBAAqB,CAAC,+BAA+B,CAW9F,CAAC"}
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { parseVariables } from
|
|
14
|
-
import { getVictoriaLogsTimeSeriesData } from
|
|
15
|
-
import { VictoriaLogsQueryEditor } from
|
|
13
|
+
import { parseVariables } from "@perses-dev/plugin-system";
|
|
14
|
+
import { getVictoriaLogsTimeSeriesData } from "./query.js";
|
|
15
|
+
import { VictoriaLogsQueryEditor } from "./VictoriaLogsTimeSeriesQueryEditor.js";
|
|
16
16
|
export const VictoriaLogsTimeSeriesQuery = {
|
|
17
17
|
getTimeSeriesData: getVictoriaLogsTimeSeriesData,
|
|
18
18
|
OptionsEditorComponent: VictoriaLogsQueryEditor,
|
|
@@ -22,9 +22,7 @@ export const VictoriaLogsTimeSeriesQuery = {
|
|
|
22
22
|
dependsOn: (spec)=>{
|
|
23
23
|
const queryVariables = parseVariables(spec.query);
|
|
24
24
|
const allVariables = [
|
|
25
|
-
...new Set(
|
|
26
|
-
...queryVariables
|
|
27
|
-
])
|
|
25
|
+
...new Set(queryVariables)
|
|
28
26
|
];
|
|
29
27
|
return {
|
|
30
28
|
variables: allVariables
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TimeSeriesQueryPlugin
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';\nimport { parseVariables } from '@perses-dev/plugin-system';\n\nimport { getVictoriaLogsTimeSeriesData } from './query';\nimport type { VictoriaLogsTimeSeriesQuerySpec } from './types';\nimport { VictoriaLogsQueryEditor } from './VictoriaLogsTimeSeriesQueryEditor';\n\nexport const VictoriaLogsTimeSeriesQuery: TimeSeriesQueryPlugin<VictoriaLogsTimeSeriesQuerySpec> = {\n getTimeSeriesData: getVictoriaLogsTimeSeriesData,\n OptionsEditorComponent: VictoriaLogsQueryEditor,\n createInitialOptions: () => ({ query: '' }),\n dependsOn: (spec) => {\n const queryVariables = parseVariables(spec.query);\n const allVariables = [...new Set(queryVariables)];\n return {\n variables: allVariables,\n };\n },\n};\n"],"names":["parseVariables","getVictoriaLogsTimeSeriesData","VictoriaLogsQueryEditor","VictoriaLogsTimeSeriesQuery","getTimeSeriesData","OptionsEditorComponent","createInitialOptions","query","dependsOn","spec","queryVariables","allVariables","Set","variables"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,cAAc,QAAQ,4BAA4B;AAE3D,SAASC,6BAA6B,QAAQ,aAAU;AAExD,SAASC,uBAAuB,QAAQ,yCAAsC;AAE9E,OAAO,MAAMC,8BAAsF;IACjGC,mBAAmBH;IACnBI,wBAAwBH;IACxBI,sBAAsB,IAAO,CAAA;YAAEC,OAAO;QAAG,CAAA;IACzCC,WAAW,CAACC;QACV,MAAMC,iBAAiBV,eAAeS,KAAKF,KAAK;QAChD,MAAMI,eAAe;eAAI,IAAIC,IAAIF;SAAgB;QACjD,OAAO;YACLG,WAAWF;QACb;IACF;AACF,EAAE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OptionsEditorProps } from '@perses-dev/plugin-system';
|
|
2
|
-
import { ReactElement } from 'react';
|
|
3
|
-
import { VictoriaLogsTimeSeriesQuerySpec } from './types';
|
|
1
|
+
import type { OptionsEditorProps } from '@perses-dev/plugin-system';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { VictoriaLogsTimeSeriesQuerySpec } from './types';
|
|
4
4
|
type VictoriaLogsQueryEditorProps = OptionsEditorProps<VictoriaLogsTimeSeriesQuerySpec>;
|
|
5
5
|
export declare function VictoriaLogsQueryEditor(props: VictoriaLogsQueryEditorProps): ReactElement;
|
|
6
6
|
export {};
|
package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VictoriaLogsTimeSeriesQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VictoriaLogsTimeSeriesQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAyB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D,KAAK,4BAA4B,GAAG,kBAAkB,CAAC,+BAA+B,CAAC,CAAC;AAExF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,GAAG,YAAY,CAiFzF"}
|
|
@@ -11,13 +11,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { LogsQLEditor } from
|
|
19
|
-
import { VICTORIALOGS_DATASOURCE_KIND } from
|
|
20
|
-
import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from
|
|
14
|
+
import { InputLabel, Stack } from "@mui/material";
|
|
15
|
+
import { createModEnterHandler } from "@perses-dev/dashboards";
|
|
16
|
+
import { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from "@perses-dev/plugin-system";
|
|
17
|
+
import { useCallback, useState, useEffect } from "react";
|
|
18
|
+
import { LogsQLEditor } from "../../components/logsql-editor.js";
|
|
19
|
+
import { VICTORIALOGS_DATASOURCE_KIND } from "../../model/index.js";
|
|
20
|
+
import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from "../constants.js";
|
|
21
21
|
export function VictoriaLogsQueryEditor(props) {
|
|
22
22
|
const { onChange, value } = props;
|
|
23
23
|
const { datasource } = value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { InputLabel, Stack } from '@mui/material';\nimport { createModEnterHandler } from '@perses-dev/dashboards';\nimport type { DatasourceSelectProps, OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from '@perses-dev/plugin-system';\nimport type { ReactElement } from 'react';\nimport { useCallback, useState, useEffect } from 'react';\n\nimport { LogsQLEditor } from '../../components/logsql-editor';\nimport type { VictoriaLogsDatasourceSelector } from '../../model';\nimport { VICTORIALOGS_DATASOURCE_KIND } from '../../model';\nimport { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';\nimport type { VictoriaLogsTimeSeriesQuerySpec } from './types';\n\ntype VictoriaLogsQueryEditorProps = OptionsEditorProps<VictoriaLogsTimeSeriesQuerySpec>;\n\nexport function VictoriaLogsQueryEditor(props: VictoriaLogsQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const datasourceSelectValue = datasource ?? DEFAULT_DATASOURCE;\n const selectedDatasource = useDatasourceSelectValueToSelector(\n datasourceSelectValue,\n VICTORIALOGS_DATASOURCE_KIND,\n ) as VictoriaLogsDatasourceSelector;\n\n // Local state for editor value to prevent query_range calls on every keystroke\n const [localQuery, setLocalQuery] = useState(value.query);\n\n // Update local state when prop changes\n useEffect(() => {\n setLocalQuery(value.query);\n }, [value.query]);\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (newDatasourceSelection) => {\n if (!isVariableDatasource(newDatasourceSelection) && newDatasourceSelection.kind === DATASOURCE_KIND) {\n onChange({ ...value, datasource: newDatasourceSelection });\n return;\n }\n\n throw new Error('Got unexpected non VictoriaLogsQuery datasource selection');\n };\n\n // Debounced query change handler to prevent excessive query_range calls\n const handleQueryChange = useCallback((newQuery: string) => {\n setLocalQuery(newQuery);\n }, []);\n\n // Immediate query execution on Enter or blur\n const handleQueryExecute = useCallback(\n (query: string) => {\n onChange({ ...value, query });\n },\n [onChange, value],\n );\n\n return (\n <Stack spacing={1.5} paddingBottom={1}>\n <div>\n <InputLabel\n sx={{\n display: 'block',\n marginBottom: '4px',\n fontWeight: 500,\n }}\n >\n Datasource\n </InputLabel>\n <DatasourceSelect\n datasourcePluginKind={DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n label=\"VictoriaLogs Datasource\"\n notched\n />\n </div>\n\n <div>\n <InputLabel\n sx={{\n display: 'block',\n marginBottom: '4px',\n fontWeight: 500,\n }}\n >\n LogsQL Query\n </InputLabel>\n <LogsQLEditor\n value={localQuery}\n onChange={handleQueryChange}\n onBlur={() => handleQueryExecute(localQuery)}\n onKeyDown={createModEnterHandler(() => handleQueryExecute(localQuery))}\n placeholder='Enter LogsQL query (e.g. {job=\"mysql\"} |= \"error\")'\n // height=\"120px\"\n />\n </div>\n </Stack>\n );\n}\n"],"names":["InputLabel","Stack","createModEnterHandler","DatasourceSelect","isVariableDatasource","useDatasourceSelectValueToSelector","useCallback","useState","useEffect","LogsQLEditor","VICTORIALOGS_DATASOURCE_KIND","DATASOURCE_KIND","DEFAULT_DATASOURCE","VictoriaLogsQueryEditor","props","onChange","value","datasource","datasourceSelectValue","selectedDatasource","localQuery","setLocalQuery","query","handleDatasourceChange","newDatasourceSelection","kind","Error","handleQueryChange","newQuery","handleQueryExecute","spacing","paddingBottom","div","sx","display","marginBottom","fontWeight","datasourcePluginKind","label","notched","onBlur","onKeyDown","placeholder"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,UAAU,EAAEC,KAAK,QAAQ,gBAAgB;AAClD,SAASC,qBAAqB,QAAQ,yBAAyB;AAE/D,SAASC,gBAAgB,EAAEC,oBAAoB,EAAEC,kCAAkC,QAAQ,4BAA4B;AAEvH,SAASC,WAAW,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,QAAQ;AAEzD,SAASC,YAAY,QAAQ,oCAAiC;AAE9D,SAASC,4BAA4B,QAAQ,uBAAc;AAC3D,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,kBAAe;AAKnE,OAAO,SAASC,wBAAwBC,KAAmC;IACzE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,wBAAwBD,cAAcL;IAC5C,MAAMO,qBAAqBd,mCACzBa,uBACAR;IAGF,+EAA+E;IAC/E,MAAM,CAACU,YAAYC,cAAc,GAAGd,SAASS,MAAMM,KAAK;IAExD,uCAAuC;IACvCd,UAAU;QACRa,cAAcL,MAAMM,KAAK;IAC3B,GAAG;QAACN,MAAMM,KAAK;KAAC;IAEhB,MAAMC,yBAA4D,CAACC;QACjE,IAAI,CAACpB,qBAAqBoB,2BAA2BA,uBAAuBC,IAAI,KAAKd,iBAAiB;YACpGI,SAAS;gBAAE,GAAGC,KAAK;gBAAEC,YAAYO;YAAuB;YACxD;QACF;QAEA,MAAM,IAAIE,MAAM;IAClB;IAEA,wEAAwE;IACxE,MAAMC,oBAAoBrB,YAAY,CAACsB;QACrCP,cAAcO;IAChB,GAAG,EAAE;IAEL,6CAA6C;IAC7C,MAAMC,qBAAqBvB,YACzB,CAACgB;QACCP,SAAS;YAAE,GAAGC,KAAK;YAAEM;QAAM;IAC7B,GACA;QAACP;QAAUC;KAAM;IAGnB,qBACE,MAACf;QAAM6B,SAAS;QAAKC,eAAe;;0BAClC,MAACC;;kCACC,KAAChC;wBACCiC,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAACjC;wBACCkC,sBAAsB1B;wBACtBK,OAAOG;wBACPJ,UAAUQ;wBACVe,OAAM;wBACNC,OAAO;;;;0BAIX,MAACP;;kCACC,KAAChC;wBACCiC,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAAC3B;wBACCO,OAAOI;wBACPL,UAAUY;wBACVa,QAAQ,IAAMX,mBAAmBT;wBACjCqB,WAAWvC,sBAAsB,IAAM2B,mBAAmBT;wBAC1DsB,aAAY;;;;;;AAMtB"}
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
13
|
+
export * from "./query.js";
|
|
14
|
+
export * from "./VictoriaLogsTimeSeriesQuery.js";
|
|
15
|
+
export * from "./VictoriaLogsTimeSeriesQueryEditor.js";
|
|
16
|
+
export * from "./types.js";
|
|
17
17
|
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './query';\nexport * from './VictoriaLogsTimeSeriesQuery';\nexport * from './VictoriaLogsTimeSeriesQueryEditor';\nexport * from './types';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './query';\nexport * from './VictoriaLogsTimeSeriesQuery';\nexport * from './VictoriaLogsTimeSeriesQueryEditor';\nexport * from './types';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,aAAU;AACxB,cAAc,mCAAgC;AAC9C,cAAc,yCAAsC;AACpD,cAAc,aAAU"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';
|
|
2
|
-
import { VictoriaLogsTimeSeriesQuerySpec } from './types';
|
|
1
|
+
import type { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';
|
|
2
|
+
import type { VictoriaLogsTimeSeriesQuerySpec } from './types';
|
|
3
3
|
export type VictoriaLogsMatrixResult = {
|
|
4
4
|
metric: Record<string, string>;
|
|
5
5
|
values: Array<[number, string]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/query.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/query.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AASvE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,EAAE,QAAQ,CAAC;IACrB,MAAM,EAAE,wBAAwB,EAAE,CAAC;CACpC,CAAC;AA+EF,eAAO,MAAM,6BAA6B,EAAE,qBAAqB,CAAC,+BAA+B,CAAC,CAAC,mBAAmB,CAkDnH,CAAC"}
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { replaceVariables } from
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { DEFAULT_DATASOURCE } from
|
|
13
|
+
import { replaceVariables } from "@perses-dev/plugin-system";
|
|
14
|
+
import { parseDurationString } from "@perses-dev/spec";
|
|
15
|
+
import { milliseconds } from "date-fns";
|
|
16
|
+
import { DEFAULT_DATASOURCE } from "../constants.js";
|
|
17
17
|
// Constants for VictoriaLogs step calculation
|
|
18
18
|
const MAX_VICTORIALOGS_DATA_POINTS = 10000; // Similar to Prometheus
|
|
19
19
|
const DEFAULT_MIN_STEP_SECONDS = 15; // 15 seconds default minimum
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/query.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TimeSeriesQueryPlugin
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/query.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';\nimport { replaceVariables } from '@perses-dev/plugin-system';\nimport type { DurationString, TimeSeries } from '@perses-dev/spec';\nimport { parseDurationString } from '@perses-dev/spec';\nimport { milliseconds } from 'date-fns';\n\nimport type { VictoriaLogsClient } from '../../model/client';\nimport type { VictoriaLogsStatsQueryRangeResponse } from '../../model/types';\nimport { DEFAULT_DATASOURCE } from '../constants';\nimport type { VictoriaLogsTimeSeriesQuerySpec } from './types';\n\nexport type VictoriaLogsMatrixResult = {\n metric: Record<string, string>;\n values: Array<[number, string]>;\n};\n\nexport type VictoriaLogsMatrixResponse = {\n resultType: 'matrix';\n result: VictoriaLogsMatrixResult[];\n};\n\n// Constants for VictoriaLogs step calculation\nconst MAX_VICTORIALOGS_DATA_POINTS = 10000; // Similar to Prometheus\nconst DEFAULT_MIN_STEP_SECONDS = 15; // 15 seconds default minimum\n\n/**\n * Converts a duration string (like \"15s\", \"1m\") to seconds\n */\nfunction getDurationStringSeconds(durationString?: DurationString): number | undefined {\n if (!durationString) return undefined;\n\n const duration = parseDurationString(durationString);\n const ms = milliseconds(duration);\n return Math.floor(ms / 1000);\n}\n\n/**\n * Calculates appropriate step for VictoriaLogs range queries\n */\nfunction getVictoriaLogsRangeStep(\n startMs: number,\n endMs: number,\n minStepSeconds = DEFAULT_MIN_STEP_SECONDS,\n suggestedStepMs = 0,\n): number {\n const suggestedStepSeconds = suggestedStepMs / 1000;\n const querySeconds = (endMs - startMs) / 1000;\n\n let safeStep = querySeconds / MAX_VICTORIALOGS_DATA_POINTS;\n if (safeStep > 1) {\n safeStep = Math.ceil(safeStep);\n }\n\n return Math.max(suggestedStepSeconds, minStepSeconds, safeStep);\n}\n\n/**\n * Formats step in seconds as a duration string for VictoriaLogs API\n */\nfunction formatStepForVictoriaLogs(stepSeconds: number): string {\n if (stepSeconds < 60) {\n return `${Math.round(stepSeconds)}s`;\n } else if (stepSeconds < 3600) {\n return `${Math.round(stepSeconds / 60)}m`;\n } else {\n return `${Math.round(stepSeconds / 3600)}h`;\n }\n}\n\nfunction convertMatrixToTimeSeries(matrix: VictoriaLogsMatrixResult[]): TimeSeries[] {\n return matrix.map((series) => {\n const labels = { ...series.metric };\n delete labels._stream;\n delete labels.__name__;\n\n if (series.metric._stream) {\n const match = series.metric._stream.match(/{([^}]+)}/);\n if (match && match[1]) {\n match[1].split(',').forEach((labelPair) => {\n const [key, val] = labelPair.split('=').map((s) => s.trim().replace(/^\"|\"$/g, ''));\n if (key && val) labels[key] = val;\n });\n }\n }\n const name = Object.entries(labels)\n .map(([k, v]) => `${k}=${v}`)\n .join(', ');\n return {\n name: name,\n values: series.values.map(([timestamp, value]) => [\n Number(timestamp) * 1000, // Convert seconds to milliseconds\n Number(value),\n ]),\n labels,\n };\n });\n}\n\nexport const getVictoriaLogsTimeSeriesData: TimeSeriesQueryPlugin<VictoriaLogsTimeSeriesQuerySpec>['getTimeSeriesData'] =\n async (spec, context) => {\n if (!spec.query) {\n return {\n series: [],\n timeRange: { start: context.timeRange.start, end: context.timeRange.end },\n stepMs: DEFAULT_MIN_STEP_SECONDS * 1000,\n };\n }\n\n const query = replaceVariables(spec.query, context.variableState);\n const client = (await context.datasourceStore.getDatasourceClient<VictoriaLogsClient>(\n spec.datasource ?? DEFAULT_DATASOURCE,\n )) as VictoriaLogsClient;\n\n const { start, end } = context.timeRange;\n\n const minStepSeconds = spec.step\n ? (getDurationStringSeconds(spec.step as DurationString) ?? DEFAULT_MIN_STEP_SECONDS)\n : DEFAULT_MIN_STEP_SECONDS;\n const stepSeconds = getVictoriaLogsRangeStep(\n start.getTime(),\n end.getTime(),\n minStepSeconds,\n context.suggestedStepMs,\n );\n const stepString = formatStepForVictoriaLogs(stepSeconds);\n const stepMs = stepSeconds * 1000;\n\n const response: VictoriaLogsStatsQueryRangeResponse = await client.statsQueryRange({\n query,\n step: stepString,\n start: start.toISOString(),\n end: end.toISOString(),\n });\n\n if (response.status === 'error') {\n throw new Error(response.error);\n }\n\n const series = convertMatrixToTimeSeries(response.data.result as VictoriaLogsMatrixResult[]);\n\n return {\n series: series,\n timeRange: { start, end },\n stepMs,\n metadata: {\n executedQueryString: query,\n },\n };\n };\n"],"names":["replaceVariables","parseDurationString","milliseconds","DEFAULT_DATASOURCE","MAX_VICTORIALOGS_DATA_POINTS","DEFAULT_MIN_STEP_SECONDS","getDurationStringSeconds","durationString","undefined","duration","ms","Math","floor","getVictoriaLogsRangeStep","startMs","endMs","minStepSeconds","suggestedStepMs","suggestedStepSeconds","querySeconds","safeStep","ceil","max","formatStepForVictoriaLogs","stepSeconds","round","convertMatrixToTimeSeries","matrix","map","series","labels","metric","_stream","__name__","match","split","forEach","labelPair","key","val","s","trim","replace","name","Object","entries","k","v","join","values","timestamp","value","Number","getVictoriaLogsTimeSeriesData","spec","context","query","timeRange","start","end","stepMs","variableState","client","datasourceStore","getDatasourceClient","datasource","step","getTime","stepString","response","statsQueryRange","toISOString","status","Error","error","data","result","metadata","executedQueryString"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,gBAAgB,QAAQ,4BAA4B;AAE7D,SAASC,mBAAmB,QAAQ,mBAAmB;AACvD,SAASC,YAAY,QAAQ,WAAW;AAIxC,SAASC,kBAAkB,QAAQ,kBAAe;AAalD,8CAA8C;AAC9C,MAAMC,+BAA+B,OAAO,wBAAwB;AACpE,MAAMC,2BAA2B,IAAI,6BAA6B;AAElE;;CAEC,GACD,SAASC,yBAAyBC,cAA+B;IAC/D,IAAI,CAACA,gBAAgB,OAAOC;IAE5B,MAAMC,WAAWR,oBAAoBM;IACrC,MAAMG,KAAKR,aAAaO;IACxB,OAAOE,KAAKC,KAAK,CAACF,KAAK;AACzB;AAEA;;CAEC,GACD,SAASG,yBACPC,OAAe,EACfC,KAAa,EACbC,iBAAiBX,wBAAwB,EACzCY,kBAAkB,CAAC;IAEnB,MAAMC,uBAAuBD,kBAAkB;IAC/C,MAAME,eAAe,AAACJ,CAAAA,QAAQD,OAAM,IAAK;IAEzC,IAAIM,WAAWD,eAAef;IAC9B,IAAIgB,WAAW,GAAG;QAChBA,WAAWT,KAAKU,IAAI,CAACD;IACvB;IAEA,OAAOT,KAAKW,GAAG,CAACJ,sBAAsBF,gBAAgBI;AACxD;AAEA;;CAEC,GACD,SAASG,0BAA0BC,WAAmB;IACpD,IAAIA,cAAc,IAAI;QACpB,OAAO,GAAGb,KAAKc,KAAK,CAACD,aAAa,CAAC,CAAC;IACtC,OAAO,IAAIA,cAAc,MAAM;QAC7B,OAAO,GAAGb,KAAKc,KAAK,CAACD,cAAc,IAAI,CAAC,CAAC;IAC3C,OAAO;QACL,OAAO,GAAGb,KAAKc,KAAK,CAACD,cAAc,MAAM,CAAC,CAAC;IAC7C;AACF;AAEA,SAASE,0BAA0BC,MAAkC;IACnE,OAAOA,OAAOC,GAAG,CAAC,CAACC;QACjB,MAAMC,SAAS;YAAE,GAAGD,OAAOE,MAAM;QAAC;QAClC,OAAOD,OAAOE,OAAO;QACrB,OAAOF,OAAOG,QAAQ;QAEtB,IAAIJ,OAAOE,MAAM,CAACC,OAAO,EAAE;YACzB,MAAME,QAAQL,OAAOE,MAAM,CAACC,OAAO,CAACE,KAAK,CAAC;YAC1C,IAAIA,SAASA,KAAK,CAAC,EAAE,EAAE;gBACrBA,KAAK,CAAC,EAAE,CAACC,KAAK,CAAC,KAAKC,OAAO,CAAC,CAACC;oBAC3B,MAAM,CAACC,KAAKC,IAAI,GAAGF,UAAUF,KAAK,CAAC,KAAKP,GAAG,CAAC,CAACY,IAAMA,EAAEC,IAAI,GAAGC,OAAO,CAAC,UAAU;oBAC9E,IAAIJ,OAAOC,KAAKT,MAAM,CAACQ,IAAI,GAAGC;gBAChC;YACF;QACF;QACA,MAAMI,OAAOC,OAAOC,OAAO,CAACf,QACzBF,GAAG,CAAC,CAAC,CAACkB,GAAGC,EAAE,GAAK,GAAGD,EAAE,CAAC,EAAEC,GAAG,EAC3BC,IAAI,CAAC;QACR,OAAO;YACLL,MAAMA;YACNM,QAAQpB,OAAOoB,MAAM,CAACrB,GAAG,CAAC,CAAC,CAACsB,WAAWC,MAAM,GAAK;oBAChDC,OAAOF,aAAa;oBACpBE,OAAOD;iBACR;YACDrB;QACF;IACF;AACF;AAEA,OAAO,MAAMuB,gCACX,OAAOC,MAAMC;IACX,IAAI,CAACD,KAAKE,KAAK,EAAE;QACf,OAAO;YACL3B,QAAQ,EAAE;YACV4B,WAAW;gBAAEC,OAAOH,QAAQE,SAAS,CAACC,KAAK;gBAAEC,KAAKJ,QAAQE,SAAS,CAACE,GAAG;YAAC;YACxEC,QAAQvD,2BAA2B;QACrC;IACF;IAEA,MAAMmD,QAAQxD,iBAAiBsD,KAAKE,KAAK,EAAED,QAAQM,aAAa;IAChE,MAAMC,SAAU,MAAMP,QAAQQ,eAAe,CAACC,mBAAmB,CAC/DV,KAAKW,UAAU,IAAI9D;IAGrB,MAAM,EAAEuD,KAAK,EAAEC,GAAG,EAAE,GAAGJ,QAAQE,SAAS;IAExC,MAAMzC,iBAAiBsC,KAAKY,IAAI,GAC3B5D,yBAAyBgD,KAAKY,IAAI,KAAuB7D,2BAC1DA;IACJ,MAAMmB,cAAcX,yBAClB6C,MAAMS,OAAO,IACbR,IAAIQ,OAAO,IACXnD,gBACAuC,QAAQtC,eAAe;IAEzB,MAAMmD,aAAa7C,0BAA0BC;IAC7C,MAAMoC,SAASpC,cAAc;IAE7B,MAAM6C,WAAgD,MAAMP,OAAOQ,eAAe,CAAC;QACjFd;QACAU,MAAME;QACNV,OAAOA,MAAMa,WAAW;QACxBZ,KAAKA,IAAIY,WAAW;IACtB;IAEA,IAAIF,SAASG,MAAM,KAAK,SAAS;QAC/B,MAAM,IAAIC,MAAMJ,SAASK,KAAK;IAChC;IAEA,MAAM7C,SAASH,0BAA0B2C,SAASM,IAAI,CAACC,MAAM;IAE7D,OAAO;QACL/C,QAAQA;QACR4B,WAAW;YAAEC;YAAOC;QAAI;QACxBC;QACAiB,UAAU;YACRC,qBAAqBtB;QACvB;IACF;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/types.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/types.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DatasourceSelector } from '@perses-dev/spec';\n\nexport interface VictoriaLogsTimeSeriesQuerySpec {\n query: string;\n datasource?: DatasourceSelector;\n step?: string;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,WAIC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/types.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { DatasourceSelector } from '@perses-dev/spec';\n\nexport interface VictoriaLogsTimeSeriesQuerySpec {\n query: string;\n datasource?: DatasourceSelector;\n step?: string;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,WAIC"}
|
package/lib/setup-tests.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
1
|
+
import '@testing-library/jest-dom/vitest';
|
|
2
2
|
//# sourceMappingURL=setup-tests.d.ts.map
|
package/lib/setup-tests.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-tests.d.ts","sourceRoot":"","sources":["../../src/setup-tests.ts"],"names":[],"mappings":"AAaA,OAAO,
|
|
1
|
+
{"version":3,"file":"setup-tests.d.ts","sourceRoot":"","sources":["../../src/setup-tests.ts"],"names":[],"mappings":"AAaA,OAAO,kCAAkC,CAAC"}
|
package/lib/setup-tests.js
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import
|
|
13
|
+
import "@testing-library/jest-dom/vitest";
|
|
14
14
|
// Always mock e-charts during tests since we don't have a proper canvas in jsdom
|
|
15
|
-
|
|
15
|
+
vi.mock('echarts/core');
|
|
16
16
|
|
|
17
17
|
//# sourceMappingURL=setup-tests.js.map
|
package/lib/setup-tests.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/setup-tests.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport '@testing-library/jest-dom';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\
|
|
1
|
+
{"version":3,"sources":["../../src/setup-tests.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport '@testing-library/jest-dom/vitest';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\nvi.mock('echarts/core');\n"],"names":["vi","mock"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,mCAAmC;AAE1C,iFAAiF;AACjFA,GAAGC,IAAI,CAAC"}
|
package/lib/variables/index.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
13
|
+
export * from "./victorialogs-field-names/index.js";
|
|
14
|
+
export * from "./victorialogs-field-values/index.js";
|
|
15
15
|
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/variables/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './victorialogs-field-names';\nexport * from './victorialogs-field-values';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,
|
|
1
|
+
{"version":3,"sources":["../../../src/variables/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './victorialogs-field-names';\nexport * from './victorialogs-field-values';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,sCAA6B;AAC3C,cAAc,uCAA8B"}
|
package/lib/variables/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DatasourceSelectValue } from '@perses-dev/plugin-system';
|
|
2
|
-
import { VictoriaLogsDatasourceSelector } from '../model';
|
|
1
|
+
import type { DatasourceSelectValue } from '@perses-dev/plugin-system';
|
|
2
|
+
import type { VictoriaLogsDatasourceSelector } from '../model';
|
|
3
3
|
export interface VictoriaLogsVariableOptionsBase {
|
|
4
4
|
datasource?: DatasourceSelectValue<VictoriaLogsDatasourceSelector>;
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/variables/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/variables/types.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAE/D,MAAM,WAAW,+BAA+B;IAC9C,UAAU,CAAC,EAAE,qBAAqB,CAAC,8BAA8B,CAAC,CAAC;CACpE;AAED,MAAM,MAAM,qCAAqC,GAAG,+BAA+B,GAAG;IACpF,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,sCAAsC,GAAG,+BAA+B,GAAG;IACrF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/variables/types.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DatasourceSelectValue } from '@perses-dev/plugin-system';\nimport { VictoriaLogsDatasourceSelector } from '../model';\n\nexport interface VictoriaLogsVariableOptionsBase {\n datasource?: DatasourceSelectValue<VictoriaLogsDatasourceSelector>;\n}\n\nexport type VictoriaLogsFieldNamesVariableOptions = VictoriaLogsVariableOptionsBase & {\n query: string;\n};\n\nexport type VictoriaLogsFieldValuesVariableOptions = VictoriaLogsVariableOptionsBase & {\n field: string;\n query: string;\n};\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;
|
|
1
|
+
{"version":3,"sources":["../../../src/variables/types.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { DatasourceSelectValue } from '@perses-dev/plugin-system';\n\nimport type { VictoriaLogsDatasourceSelector } from '../model';\n\nexport interface VictoriaLogsVariableOptionsBase {\n datasource?: DatasourceSelectValue<VictoriaLogsDatasourceSelector>;\n}\n\nexport type VictoriaLogsFieldNamesVariableOptions = VictoriaLogsVariableOptionsBase & {\n query: string;\n};\n\nexport type VictoriaLogsFieldValuesVariableOptions = VictoriaLogsVariableOptionsBase & {\n field: string;\n query: string;\n};\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAcjC,WAGE"}
|
package/lib/variables/utils.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { AbsoluteTimeRange, DatasourceSelector } from '@perses-dev/spec';
|
|
4
|
-
import {
|
|
5
|
-
import { VictoriaLogsFieldItem, VictoriaLogsFieldNamesResponse, VictoriaLogsFieldValuesResponse } from '../model';
|
|
1
|
+
import type { StatusError } from '@perses-dev/client';
|
|
2
|
+
import type { VariableOption } from '@perses-dev/plugin-system';
|
|
3
|
+
import type { AbsoluteTimeRange, DatasourceSelector } from '@perses-dev/spec';
|
|
4
|
+
import type { UseQueryResult } from '@tanstack/react-query';
|
|
5
|
+
import type { VictoriaLogsFieldItem, VictoriaLogsFieldNamesResponse, VictoriaLogsFieldValuesResponse } from '../model';
|
|
6
6
|
export declare const fieldItemsToVariableOptions: (values?: VictoriaLogsFieldItem[]) => VariableOption[];
|
|
7
7
|
export declare function getVictoriaLogsTimeRange(timeRange: AbsoluteTimeRange): {
|
|
8
8
|
start: string;
|