@perses-dev/greptimedb-plugin 0.1.0-beta.0
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/README.md +41 -0
- package/__mf/css/async/8077.85c2cbf6.css +1 -0
- package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
- package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
- package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
- package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
- package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
- package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
- package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
- package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
- package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
- package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
- package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
- package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
- package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
- package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
- package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
- package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
- package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
- package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
- package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
- package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
- package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
- package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
- package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
- package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
- package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
- package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
- package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
- package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
- package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
- package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
- package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
- package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
- package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
- package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
- package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
- package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
- package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
- package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
- package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
- package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
- package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
- package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
- package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
- package/__mf/js/GreptimeDB.7a063e9e.js +7 -0
- package/__mf/js/async/1616.20d43f7e.js +1 -0
- package/__mf/js/async/2043.97b1f27f.js +2 -0
- package/__mf/js/async/2043.97b1f27f.js.LICENSE.txt +24 -0
- package/__mf/js/async/2269.f1322789.js +3 -0
- package/__mf/js/async/2386.b7243314.js +2 -0
- package/__mf/js/async/2386.b7243314.js.LICENSE.txt +9 -0
- package/__mf/js/async/3181.7ac30201.js +2 -0
- package/__mf/js/async/3181.7ac30201.js.LICENSE.txt +9 -0
- package/__mf/js/async/3247.65183b95.js +2 -0
- package/__mf/js/async/3247.65183b95.js.LICENSE.txt +37 -0
- package/__mf/js/async/392.91ae0e19.js +2 -0
- package/__mf/js/async/392.91ae0e19.js.LICENSE.txt +8 -0
- package/__mf/js/async/3944.12d0f358.js +10 -0
- package/__mf/js/async/3944.12d0f358.js.LICENSE.txt +17 -0
- package/__mf/js/async/4121.06b9cab6.js +2 -0
- package/__mf/js/async/4121.06b9cab6.js.LICENSE.txt +9 -0
- package/__mf/js/async/5002.0a422150.js +1 -0
- package/__mf/js/async/5071.e5cc2bd7.js +1 -0
- package/__mf/js/async/5402.eda0fb07.js +101 -0
- package/__mf/js/async/5440.7abefadb.js +2 -0
- package/__mf/js/async/5440.7abefadb.js.LICENSE.txt +32 -0
- package/__mf/js/async/5562.a39a5d1e.js +2 -0
- package/__mf/js/async/5562.a39a5d1e.js.LICENSE.txt +9 -0
- package/__mf/js/async/5587.a3fb718a.js +1 -0
- package/__mf/js/async/6045.10e9fa5a.js +1 -0
- package/__mf/js/async/6274.6f0093e7.js +2 -0
- package/__mf/js/async/6274.6f0093e7.js.LICENSE.txt +8 -0
- package/__mf/js/async/6753.1e42e819.js +1 -0
- package/__mf/js/async/7177.78bced1c.js +1 -0
- package/__mf/js/async/7192.e0362dae.js +1 -0
- package/__mf/js/async/7862.8048abcc.js +2 -0
- package/__mf/js/async/7862.8048abcc.js.LICENSE.txt +9 -0
- package/__mf/js/async/7968.7b2e2836.js +1 -0
- package/__mf/js/async/7978.8cd67008.js +1 -0
- package/__mf/js/async/8077.fe9828a3.js +7 -0
- package/__mf/js/async/8077.fe9828a3.js.LICENSE.txt +39 -0
- package/__mf/js/async/8356.ac21fc24.js +1 -0
- package/__mf/js/async/8470.a2e67e3a.js +2 -0
- package/__mf/js/async/8470.a2e67e3a.js.LICENSE.txt +19 -0
- package/__mf/js/async/873.863f53e4.js +1 -0
- package/__mf/js/async/9235.7651eaca.js +1 -0
- package/__mf/js/async/941.4155d3cc.js +2 -0
- package/__mf/js/async/941.4155d3cc.js.LICENSE.txt +9 -0
- package/__mf/js/async/9558.215ad80c.js +1 -0
- package/__mf/js/async/9588.2f544a41.js +1 -0
- package/__mf/js/async/9877.8766524e.js +38 -0
- package/__mf/js/async/9916.2a1eb7a0.js +22 -0
- package/__mf/js/async/9916.2a1eb7a0.js.LICENSE.txt +19 -0
- package/__mf/js/async/__federation_expose_GreptimeDBDatasource.bf1dec3c.js +2 -0
- package/__mf/js/async/__federation_expose_GreptimeDBDatasource.bf1dec3c.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_GreptimeDBLogQuery.d80b2965.js +21 -0
- package/__mf/js/async/__federation_expose_GreptimeDBLogQuery.d80b2965.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_GreptimeDBTimeSeriesQuery.59cda507.js +21 -0
- package/__mf/js/async/__federation_expose_GreptimeDBTimeSeriesQuery.59cda507.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_GreptimeDBTraceQuery.00464f43.js +21 -0
- package/__mf/js/async/__federation_expose_GreptimeDBTraceQuery.00464f43.js.LICENSE.txt +9 -0
- package/__mf/js/main.a4e4afce.js +7 -0
- package/lib/bootstrap.d.ts +2 -0
- package/lib/bootstrap.d.ts.map +1 -0
- package/lib/bootstrap.js +19 -0
- package/lib/bootstrap.js.map +1 -0
- package/lib/cjs/bootstrap.js +26 -0
- package/lib/cjs/components/GreptimeDBQLEditor.js +72 -0
- package/lib/cjs/components/constants.js +42 -0
- package/lib/cjs/components/index.js +31 -0
- package/lib/cjs/datasources/greptimedb-datasource/GreptimeDBDatasource.js +53 -0
- package/lib/cjs/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.js +51 -0
- package/lib/cjs/datasources/greptimedb-datasource/greptimedb-datasource-types.js +16 -0
- package/lib/cjs/datasources/greptimedb-datasource/index.js +32 -0
- package/lib/cjs/datasources/index.js +30 -0
- package/lib/cjs/env.d.js +14 -0
- package/lib/cjs/getPluginModule.js +39 -0
- package/lib/cjs/index-federation.js +55 -0
- package/lib/cjs/index.js +38 -0
- package/lib/cjs/model/greptimedb-client.js +76 -0
- package/lib/cjs/model/greptimedb-data-types.js +16 -0
- package/lib/cjs/queries/constants.js +34 -0
- package/lib/cjs/queries/greptimedb-log-query/GreptimeDBLogQuery.js +43 -0
- package/lib/cjs/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.js +108 -0
- package/lib/cjs/queries/greptimedb-log-query/get-greptimedb-log-data.js +103 -0
- package/lib/cjs/queries/greptimedb-log-query/greptimedb-log-query-types.js +16 -0
- package/lib/cjs/queries/greptimedb-log-query/index.js +33 -0
- package/lib/cjs/queries/greptimedb-log-query/log-query-plugin-interface.js +16 -0
- package/lib/cjs/queries/greptimedb-query-data-model.js +152 -0
- package/lib/cjs/queries/greptimedb-time-series-query/GreptimeDBQuery.js +43 -0
- package/lib/cjs/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.js +107 -0
- package/lib/cjs/queries/greptimedb-time-series-query/get-greptimedb-data.js +184 -0
- package/lib/cjs/queries/greptimedb-time-series-query/greptimedb-query-types.js +16 -0
- package/lib/cjs/queries/greptimedb-time-series-query/index.js +33 -0
- package/lib/cjs/queries/greptimedb-trace-query/GreptimeDBTraceQuery.js +40 -0
- package/lib/cjs/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.js +79 -0
- package/lib/cjs/queries/greptimedb-trace-query/get-greptimedb-trace-data.js +518 -0
- package/lib/cjs/queries/greptimedb-trace-query/greptimedb-trace-query-types.js +16 -0
- package/lib/cjs/queries/greptimedb-trace-query/index.js +33 -0
- package/lib/cjs/queries/greptimedb-trace-query/trace-query-sql.js +25 -0
- package/lib/cjs/queries/index.js +32 -0
- package/lib/cjs/queries/query-editor-model.js +47 -0
- package/lib/cjs/setup-tests.js +19 -0
- package/lib/components/GreptimeDBQLEditor.d.ts +4 -0
- package/lib/components/GreptimeDBQLEditor.d.ts.map +1 -0
- package/lib/components/GreptimeDBQLEditor.js +59 -0
- package/lib/components/GreptimeDBQLEditor.js.map +1 -0
- package/lib/components/constants.d.ts +2 -0
- package/lib/components/constants.d.ts.map +1 -0
- package/lib/components/constants.js +34 -0
- package/lib/components/constants.js.map +1 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +16 -0
- package/lib/components/index.js.map +1 -0
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.d.ts +4 -0
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.d.ts.map +1 -0
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.js +45 -0
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.js.map +1 -0
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.d.ts +9 -0
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.d.ts.map +1 -0
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.js +43 -0
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.js.map +1 -0
- package/lib/datasources/greptimedb-datasource/greptimedb-datasource-types.d.ts +29 -0
- package/lib/datasources/greptimedb-datasource/greptimedb-datasource-types.d.ts.map +1 -0
- package/lib/datasources/greptimedb-datasource/greptimedb-datasource-types.js +15 -0
- package/lib/datasources/greptimedb-datasource/greptimedb-datasource-types.js.map +1 -0
- package/lib/datasources/greptimedb-datasource/index.d.ts +4 -0
- package/lib/datasources/greptimedb-datasource/index.d.ts.map +1 -0
- package/lib/datasources/greptimedb-datasource/index.js +17 -0
- package/lib/datasources/greptimedb-datasource/index.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/env.d.js +15 -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 +28 -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 +15 -0
- package/lib/index-federation.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +17 -0
- package/lib/index.js.map +1 -0
- package/lib/model/greptimedb-client.d.ts +17 -0
- package/lib/model/greptimedb-client.d.ts.map +1 -0
- package/lib/model/greptimedb-client.js +68 -0
- package/lib/model/greptimedb-client.js.map +1 -0
- package/lib/model/greptimedb-data-types.d.ts +21 -0
- package/lib/model/greptimedb-data-types.d.ts.map +1 -0
- package/lib/model/greptimedb-data-types.js +15 -0
- package/lib/model/greptimedb-data-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 +18 -0
- package/lib/queries/constants.js.map +1 -0
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.d.ts +4 -0
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.d.ts.map +1 -0
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.js +35 -0
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.js.map +1 -0
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.d.ts +7 -0
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.d.ts.map +1 -0
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.js +100 -0
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.js.map +1 -0
- package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.d.ts +4 -0
- package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.d.ts.map +1 -0
- package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.js +95 -0
- package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.js.map +1 -0
- package/lib/queries/greptimedb-log-query/greptimedb-log-query-types.d.ts +6 -0
- package/lib/queries/greptimedb-log-query/greptimedb-log-query-types.d.ts.map +1 -0
- package/lib/queries/greptimedb-log-query/greptimedb-log-query-types.js +15 -0
- package/lib/queries/greptimedb-log-query/greptimedb-log-query-types.js.map +1 -0
- package/lib/queries/greptimedb-log-query/index.d.ts +5 -0
- package/lib/queries/greptimedb-log-query/index.d.ts.map +1 -0
- package/lib/queries/greptimedb-log-query/index.js +18 -0
- package/lib/queries/greptimedb-log-query/index.js.map +1 -0
- package/lib/queries/greptimedb-log-query/log-query-plugin-interface.d.ts +23 -0
- package/lib/queries/greptimedb-log-query/log-query-plugin-interface.d.ts.map +1 -0
- package/lib/queries/greptimedb-log-query/log-query-plugin-interface.js +15 -0
- package/lib/queries/greptimedb-log-query/log-query-plugin-interface.js.map +1 -0
- package/lib/queries/greptimedb-query-data-model.d.ts +18 -0
- package/lib/queries/greptimedb-query-data-model.d.ts.map +1 -0
- package/lib/queries/greptimedb-query-data-model.js +138 -0
- package/lib/queries/greptimedb-query-data-model.js.map +1 -0
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.d.ts +4 -0
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.d.ts.map +1 -0
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.js +35 -0
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.js.map +1 -0
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.d.ts +7 -0
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.d.ts.map +1 -0
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.js +99 -0
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.js.map +1 -0
- package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.d.ts +4 -0
- package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.d.ts.map +1 -0
- package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.js +176 -0
- package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.js.map +1 -0
- package/lib/queries/greptimedb-time-series-query/greptimedb-query-types.d.ts +7 -0
- package/lib/queries/greptimedb-time-series-query/greptimedb-query-types.d.ts.map +1 -0
- package/lib/queries/greptimedb-time-series-query/greptimedb-query-types.js +15 -0
- package/lib/queries/greptimedb-time-series-query/greptimedb-query-types.js.map +1 -0
- package/lib/queries/greptimedb-time-series-query/index.d.ts +5 -0
- package/lib/queries/greptimedb-time-series-query/index.d.ts.map +1 -0
- package/lib/queries/greptimedb-time-series-query/index.js +18 -0
- package/lib/queries/greptimedb-time-series-query/index.js.map +1 -0
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.d.ts +4 -0
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.d.ts.map +1 -0
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.js +32 -0
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.js.map +1 -0
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.d.ts +7 -0
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.d.ts.map +1 -0
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.js +71 -0
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.js.map +1 -0
- package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.d.ts +11 -0
- package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.d.ts.map +1 -0
- package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.js +466 -0
- package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.js.map +1 -0
- package/lib/queries/greptimedb-trace-query/greptimedb-trace-query-types.d.ts +6 -0
- package/lib/queries/greptimedb-trace-query/greptimedb-trace-query-types.d.ts.map +1 -0
- package/lib/queries/greptimedb-trace-query/greptimedb-trace-query-types.js +15 -0
- package/lib/queries/greptimedb-trace-query/greptimedb-trace-query-types.js.map +1 -0
- package/lib/queries/greptimedb-trace-query/index.d.ts +5 -0
- package/lib/queries/greptimedb-trace-query/index.d.ts.map +1 -0
- package/lib/queries/greptimedb-trace-query/index.js +18 -0
- package/lib/queries/greptimedb-trace-query/index.js.map +1 -0
- package/lib/queries/greptimedb-trace-query/trace-query-sql.d.ts +2 -0
- package/lib/queries/greptimedb-trace-query/trace-query-sql.d.ts.map +1 -0
- package/lib/queries/greptimedb-trace-query/trace-query-sql.js +17 -0
- package/lib/queries/greptimedb-trace-query/trace-query-sql.js.map +1 -0
- package/lib/queries/index.d.ts +4 -0
- package/lib/queries/index.d.ts.map +1 -0
- package/lib/queries/index.js +17 -0
- package/lib/queries/index.js.map +1 -0
- package/lib/queries/query-editor-model.d.ts +19 -0
- package/lib/queries/query-editor-model.d.ts.map +1 -0
- package/lib/queries/query-editor-model.js +44 -0
- package/lib/queries/query-editor-model.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 +17 -0
- package/lib/setup-tests.js.map +1 -0
- package/mf-manifest.json +462 -0
- package/mf-stats.json +530 -0
- package/package.json +86 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GreptimeDBTraceQuery.d.ts","sourceRoot":"","sources":["../../../../src/queries/greptimedb-trace-query/GreptimeDBTraceQuery.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAkB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAI1E,eAAO,MAAM,oBAAoB,EAAE,gBAAgB,CAAC,wBAAwB,CAY3E,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright 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 { parseVariables } from '@perses-dev/plugin-system';
|
|
14
|
+
import { getGreptimeDBTraceData } from './get-greptimedb-trace-data';
|
|
15
|
+
import { GreptimeDBTraceQueryEditor } from './GreptimeDBTraceQueryEditor';
|
|
16
|
+
export const GreptimeDBTraceQuery = {
|
|
17
|
+
getTraceData: getGreptimeDBTraceData,
|
|
18
|
+
OptionsEditorComponent: GreptimeDBTraceQueryEditor,
|
|
19
|
+
createInitialOptions: ()=>({
|
|
20
|
+
query: ''
|
|
21
|
+
}),
|
|
22
|
+
dependsOn: (spec)=>{
|
|
23
|
+
const queryVariables = parseVariables(spec.query);
|
|
24
|
+
return {
|
|
25
|
+
variables: [
|
|
26
|
+
...new Set(queryVariables)
|
|
27
|
+
]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=GreptimeDBTraceQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/greptimedb-trace-query/GreptimeDBTraceQuery.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 { parseVariables, TraceQueryPlugin } from '@perses-dev/plugin-system';\nimport { GreptimeDBTraceQuerySpec } from './greptimedb-trace-query-types';\nimport { getGreptimeDBTraceData } from './get-greptimedb-trace-data';\nimport { GreptimeDBTraceQueryEditor } from './GreptimeDBTraceQueryEditor';\n\nexport const GreptimeDBTraceQuery: TraceQueryPlugin<GreptimeDBTraceQuerySpec> = {\n getTraceData: getGreptimeDBTraceData,\n OptionsEditorComponent: GreptimeDBTraceQueryEditor,\n createInitialOptions: () => ({\n query: '',\n }),\n dependsOn: (spec) => {\n const queryVariables = parseVariables(spec.query);\n return {\n variables: [...new Set(queryVariables)],\n };\n },\n};\n"],"names":["parseVariables","getGreptimeDBTraceData","GreptimeDBTraceQueryEditor","GreptimeDBTraceQuery","getTraceData","OptionsEditorComponent","createInitialOptions","query","dependsOn","spec","queryVariables","variables","Set"],"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,cAAc,QAA0B,4BAA4B;AAE7E,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,0BAA0B,QAAQ,+BAA+B;AAE1E,OAAO,MAAMC,uBAAmE;IAC9EC,cAAcH;IACdI,wBAAwBH;IACxBI,sBAAsB,IAAO,CAAA;YAC3BC,OAAO;QACT,CAAA;IACAC,WAAW,CAACC;QACV,MAAMC,iBAAiBV,eAAeS,KAAKF,KAAK;QAChD,OAAO;YACLI,WAAW;mBAAI,IAAIC,IAAIF;aAAgB;QACzC;IACF;AACF,EAAE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OptionsEditorProps } from '@perses-dev/plugin-system';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { GreptimeDBTraceQuerySpec } from './greptimedb-trace-query-types';
|
|
4
|
+
type GreptimeDBTraceQueryEditorProps = OptionsEditorProps<GreptimeDBTraceQuerySpec>;
|
|
5
|
+
export declare function GreptimeDBTraceQueryEditor(props: GreptimeDBTraceQueryEditorProps): ReactElement;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=GreptimeDBTraceQueryEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GreptimeDBTraceQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,EAIL,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAe,MAAM,OAAO,CAAC;AAIlD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,KAAK,+BAA+B,GAAG,kBAAkB,CAAC,wBAAwB,CAAC,CAAC;AAEpF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,+BAA+B,GAAG,YAAY,CAwD/F"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Copyright The Perses Authors
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
import { Stack } from '@mui/material';
|
|
15
|
+
import { produce } from 'immer';
|
|
16
|
+
import { DatasourceSelect, isVariableDatasource } from '@perses-dev/plugin-system';
|
|
17
|
+
import { useCallback } from 'react';
|
|
18
|
+
import { GreptimeDBQLEditor } from '../../components';
|
|
19
|
+
import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';
|
|
20
|
+
import { useQueryState } from '../query-editor-model';
|
|
21
|
+
export function GreptimeDBTraceQueryEditor(props) {
|
|
22
|
+
const { onChange, value } = props;
|
|
23
|
+
const { datasource } = value;
|
|
24
|
+
const selectedDatasource = datasource ?? DEFAULT_DATASOURCE;
|
|
25
|
+
const { query, handleQueryChange, handleQueryBlur } = useQueryState(props);
|
|
26
|
+
const handleDatasourceChange = (newDatasourceSelection)=>{
|
|
27
|
+
if (!isVariableDatasource(newDatasourceSelection) && newDatasourceSelection.kind === DATASOURCE_KIND) {
|
|
28
|
+
onChange(produce(value, (draft)=>{
|
|
29
|
+
draft.datasource = newDatasourceSelection;
|
|
30
|
+
}));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
throw new Error('Got unexpected non GreptimeDB datasource selection');
|
|
34
|
+
};
|
|
35
|
+
const handleQueryExecute = (queryValue)=>{
|
|
36
|
+
onChange(produce(value, (draft)=>{
|
|
37
|
+
draft.query = queryValue;
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
40
|
+
const handleGreptimeDBQueryChange = useCallback((next)=>{
|
|
41
|
+
handleQueryChange(next);
|
|
42
|
+
}, [
|
|
43
|
+
handleQueryChange
|
|
44
|
+
]);
|
|
45
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
46
|
+
spacing: 1.5,
|
|
47
|
+
children: [
|
|
48
|
+
/*#__PURE__*/ _jsx(DatasourceSelect, {
|
|
49
|
+
datasourcePluginKind: DATASOURCE_KIND,
|
|
50
|
+
value: selectedDatasource,
|
|
51
|
+
onChange: handleDatasourceChange,
|
|
52
|
+
label: "GreptimeDB Datasource",
|
|
53
|
+
notched: true
|
|
54
|
+
}),
|
|
55
|
+
/*#__PURE__*/ _jsx(GreptimeDBQLEditor, {
|
|
56
|
+
value: query,
|
|
57
|
+
onChange: handleGreptimeDBQueryChange,
|
|
58
|
+
onBlur: handleQueryBlur,
|
|
59
|
+
onKeyDown: (event)=>{
|
|
60
|
+
if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
handleQueryExecute(query);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
placeholder: "Enter SQL for trace search or trace details"
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=GreptimeDBTraceQueryEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.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 { Stack } from '@mui/material';\nimport { produce } from 'immer';\nimport {\n DatasourceSelect,\n DatasourceSelectProps,\n isVariableDatasource,\n OptionsEditorProps,\n} from '@perses-dev/plugin-system';\nimport { ReactElement, useCallback } from 'react';\nimport { GreptimeDBQLEditor } from '../../components';\nimport { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';\nimport { useQueryState } from '../query-editor-model';\nimport { GreptimeDBTraceQuerySpec } from './greptimedb-trace-query-types';\n\ntype GreptimeDBTraceQueryEditorProps = OptionsEditorProps<GreptimeDBTraceQuerySpec>;\n\nexport function GreptimeDBTraceQueryEditor(props: GreptimeDBTraceQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const selectedDatasource = datasource ?? DEFAULT_DATASOURCE;\n const { query, handleQueryChange, handleQueryBlur } = useQueryState(props);\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (newDatasourceSelection) => {\n if (!isVariableDatasource(newDatasourceSelection) && newDatasourceSelection.kind === DATASOURCE_KIND) {\n onChange(\n produce(value, (draft) => {\n draft.datasource = newDatasourceSelection;\n })\n );\n return;\n }\n throw new Error('Got unexpected non GreptimeDB datasource selection');\n };\n\n const handleQueryExecute = (queryValue: string): void => {\n onChange(\n produce(value, (draft) => {\n draft.query = queryValue;\n })\n );\n };\n\n const handleGreptimeDBQueryChange = useCallback(\n (next: string) => {\n handleQueryChange(next);\n },\n [handleQueryChange]\n );\n\n return (\n <Stack spacing={1.5}>\n <DatasourceSelect\n datasourcePluginKind={DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n label=\"GreptimeDB Datasource\"\n notched\n />\n <GreptimeDBQLEditor\n value={query}\n onChange={handleGreptimeDBQueryChange}\n onBlur={handleQueryBlur}\n onKeyDown={(event) => {\n if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n handleQueryExecute(query);\n }\n }}\n placeholder=\"Enter SQL for trace search or trace details\"\n />\n </Stack>\n );\n}\n"],"names":["Stack","produce","DatasourceSelect","isVariableDatasource","useCallback","GreptimeDBQLEditor","DATASOURCE_KIND","DEFAULT_DATASOURCE","useQueryState","GreptimeDBTraceQueryEditor","props","onChange","value","datasource","selectedDatasource","query","handleQueryChange","handleQueryBlur","handleDatasourceChange","newDatasourceSelection","kind","draft","Error","handleQueryExecute","queryValue","handleGreptimeDBQueryChange","next","spacing","datasourcePluginKind","label","notched","onBlur","onKeyDown","event","key","ctrlKey","metaKey","preventDefault","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,KAAK,QAAQ,gBAAgB;AACtC,SAASC,OAAO,QAAQ,QAAQ;AAChC,SACEC,gBAAgB,EAEhBC,oBAAoB,QAEf,4BAA4B;AACnC,SAAuBC,WAAW,QAAQ,QAAQ;AAClD,SAASC,kBAAkB,QAAQ,mBAAmB;AACtD,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,eAAe;AACnE,SAASC,aAAa,QAAQ,wBAAwB;AAKtD,OAAO,SAASC,2BAA2BC,KAAsC;IAC/E,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,qBAAqBD,cAAcN;IACzC,MAAM,EAAEQ,KAAK,EAAEC,iBAAiB,EAAEC,eAAe,EAAE,GAAGT,cAAcE;IAEpE,MAAMQ,yBAA4D,CAACC;QACjE,IAAI,CAAChB,qBAAqBgB,2BAA2BA,uBAAuBC,IAAI,KAAKd,iBAAiB;YACpGK,SACEV,QAAQW,OAAO,CAACS;gBACdA,MAAMR,UAAU,GAAGM;YACrB;YAEF;QACF;QACA,MAAM,IAAIG,MAAM;IAClB;IAEA,MAAMC,qBAAqB,CAACC;QAC1Bb,SACEV,QAAQW,OAAO,CAACS;YACdA,MAAMN,KAAK,GAAGS;QAChB;IAEJ;IAEA,MAAMC,8BAA8BrB,YAClC,CAACsB;QACCV,kBAAkBU;IACpB,GACA;QAACV;KAAkB;IAGrB,qBACE,MAAChB;QAAM2B,SAAS;;0BACd,KAACzB;gBACC0B,sBAAsBtB;gBACtBM,OAAOE;gBACPH,UAAUO;gBACVW,OAAM;gBACNC,OAAO;;0BAET,KAACzB;gBACCO,OAAOG;gBACPJ,UAAUc;gBACVM,QAAQd;gBACRe,WAAW,CAACC;oBACV,IAAIA,MAAMC,GAAG,KAAK,WAAYD,CAAAA,MAAME,OAAO,IAAIF,MAAMG,OAAO,AAAD,GAAI;wBAC7DH,MAAMI,cAAc;wBACpBd,mBAAmBR;oBACrB;gBACF;gBACAuB,aAAY;;;;AAIpB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TraceQueryPlugin } from '@perses-dev/plugin-system';
|
|
2
|
+
import { GreptimeDBTraceQuerySpec } from './greptimedb-trace-query-types';
|
|
3
|
+
export declare const getGreptimeDBTraceData: TraceQueryPlugin<GreptimeDBTraceQuerySpec>['getTraceData'];
|
|
4
|
+
/**
|
|
5
|
+
* SQL column values only (timestamp, timestamp_end, duration_nano, …).
|
|
6
|
+
* Requires data_type from getColumnDataType. GreptimeDB /v1/sql returns numeric cells (and numeric strings).
|
|
7
|
+
* - Timestamp* (TIMESTAMP(9) on opentelemetry_traces) → scale to nanoseconds.
|
|
8
|
+
* - Int64/UInt64 (duration_nano) → already nanoseconds, no scaling.
|
|
9
|
+
*/
|
|
10
|
+
export declare function toNanoString(value: unknown, dataType: string): string | undefined;
|
|
11
|
+
//# sourceMappingURL=get-greptimedb-trace-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-greptimedb-trace-data.d.ts","sourceRoot":"","sources":["../../../../src/queries/greptimedb-trace-query/get-greptimedb-trace-data.ts"],"names":[],"mappings":"AAaA,OAAO,EAAoB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAY/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAe1E,eAAO,MAAM,sBAAsB,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC,cAAc,CAuC7F,CAAC;AAsNF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYjF"}
|
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
// Copyright 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 { replaceVariables } from '@perses-dev/plugin-system';
|
|
14
|
+
import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace';
|
|
15
|
+
import { DEFAULT_DATASOURCE } from '../constants';
|
|
16
|
+
import { normalizeRecords, toTimestampMs } from '../greptimedb-query-data-model';
|
|
17
|
+
import { isLikelyTraceDetailSQL } from './trace-query-sql';
|
|
18
|
+
export const getGreptimeDBTraceData = async (spec, context)=>{
|
|
19
|
+
const rawQuery = replaceVariables(spec.query ?? '', context.variableState).trim();
|
|
20
|
+
if (rawQuery.length === 0) {
|
|
21
|
+
return {
|
|
22
|
+
searchResult: []
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const datasourceSelector = normalizeDatasourceSelector(spec.datasource);
|
|
26
|
+
const client = await context.datasourceStore.getDatasourceClient(datasourceSelector ?? DEFAULT_DATASOURCE);
|
|
27
|
+
const start = context.absoluteTimeRange?.start.getTime().toString() ?? '0';
|
|
28
|
+
const end = context.absoluteTimeRange?.end.getTime().toString() ?? '0';
|
|
29
|
+
const response = await client.query({
|
|
30
|
+
query: rawQuery,
|
|
31
|
+
start,
|
|
32
|
+
end
|
|
33
|
+
});
|
|
34
|
+
if (response.status === 'error') {
|
|
35
|
+
throw new Error(response.error ?? 'GreptimeDB trace query failed');
|
|
36
|
+
}
|
|
37
|
+
const records = normalizeRecords(response.data);
|
|
38
|
+
const isDetailQuery = isLikelyTraceDetailSQL(rawQuery);
|
|
39
|
+
if (isDetailQuery && isTraceDetailsResult(records)) {
|
|
40
|
+
return {
|
|
41
|
+
trace: convertRowsToTrace(records),
|
|
42
|
+
metadata: {
|
|
43
|
+
executedQueryString: rawQuery
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
searchResult: buildSearchResult(records),
|
|
49
|
+
metadata: {
|
|
50
|
+
executedQueryString: rawQuery
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
function normalizeDatasourceSelector(datasource) {
|
|
55
|
+
if (!datasource) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
// Deep links may carry an empty datasource name. Treat it as "default datasource for this kind".
|
|
59
|
+
if (typeof datasource.name === 'string' && datasource.name.trim() === '') {
|
|
60
|
+
const { kind } = datasource;
|
|
61
|
+
return kind ? {
|
|
62
|
+
kind
|
|
63
|
+
} : undefined;
|
|
64
|
+
}
|
|
65
|
+
return datasource;
|
|
66
|
+
}
|
|
67
|
+
function buildColumnIndexMap(columns) {
|
|
68
|
+
const map = {};
|
|
69
|
+
(columns ?? []).forEach((c, index)=>{
|
|
70
|
+
map[c.name.toLowerCase()] = index;
|
|
71
|
+
});
|
|
72
|
+
return map;
|
|
73
|
+
}
|
|
74
|
+
/** GreptimeDB /v1/sql includes data_type on every column_schemas entry. */ function getColumnDataType(columns, index) {
|
|
75
|
+
const column = columns[index];
|
|
76
|
+
if (!column) {
|
|
77
|
+
throw new Error(`GreptimeDB SQL response missing column at index ${index}`);
|
|
78
|
+
}
|
|
79
|
+
const dataType = column.data_type;
|
|
80
|
+
if (!dataType) {
|
|
81
|
+
throw new Error(`GreptimeDB SQL response missing data_type for column "${column.name}"`);
|
|
82
|
+
}
|
|
83
|
+
return dataType;
|
|
84
|
+
}
|
|
85
|
+
function isTraceDetailsResult(records) {
|
|
86
|
+
const columns = records?.schema?.column_schemas ?? [];
|
|
87
|
+
if (columns.length === 0) return false;
|
|
88
|
+
const map = buildColumnIndexMap(columns);
|
|
89
|
+
// Trace detail queries should return span-level columns for gantt visualization.
|
|
90
|
+
return map.trace_id !== undefined && map.span_id !== undefined;
|
|
91
|
+
}
|
|
92
|
+
function getCell(row, map, names) {
|
|
93
|
+
for (const name of names){
|
|
94
|
+
const idx = map[name.toLowerCase()];
|
|
95
|
+
if (idx !== undefined) {
|
|
96
|
+
return row[idx];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
function getString(value) {
|
|
102
|
+
if (value === null || value === undefined) return undefined;
|
|
103
|
+
return String(value);
|
|
104
|
+
}
|
|
105
|
+
function getNumber(value) {
|
|
106
|
+
if (value === null || value === undefined) return undefined;
|
|
107
|
+
if (typeof value === 'number') return Number.isFinite(value) ? value : undefined;
|
|
108
|
+
const parsed = Number(value);
|
|
109
|
+
return Number.isFinite(parsed) ? parsed : undefined;
|
|
110
|
+
}
|
|
111
|
+
function isErrorStatus(value) {
|
|
112
|
+
const normalized = String(value ?? '').trim().toUpperCase();
|
|
113
|
+
return normalized === 'STATUS_CODE_ERROR' || normalized === 'ERROR' || normalized === '2';
|
|
114
|
+
}
|
|
115
|
+
function getDurationMs(row, columns, map) {
|
|
116
|
+
const durationMs = getNumber(getCell(row, map, [
|
|
117
|
+
'duration_ms'
|
|
118
|
+
]));
|
|
119
|
+
if (durationMs !== undefined) return durationMs;
|
|
120
|
+
const durationNano = getNumber(getCell(row, map, [
|
|
121
|
+
'duration_nano',
|
|
122
|
+
'duration_ns'
|
|
123
|
+
]));
|
|
124
|
+
if (durationNano !== undefined) return durationNano / 1_000_000;
|
|
125
|
+
const startIndex = map.timestamp ?? map.start_time ?? map.start_time_unix_nano;
|
|
126
|
+
const endIndex = map.timestamp_end ?? map.end_time ?? map.end_time_unix_nano;
|
|
127
|
+
if (columns && startIndex !== undefined && endIndex !== undefined) {
|
|
128
|
+
const startMs = toTimestampMs(row[startIndex], getColumnDataType(columns, startIndex));
|
|
129
|
+
const endMs = toTimestampMs(row[endIndex], getColumnDataType(columns, endIndex));
|
|
130
|
+
if (startMs !== null && endMs !== null) return Math.max(0, endMs - startMs);
|
|
131
|
+
}
|
|
132
|
+
return 0;
|
|
133
|
+
}
|
|
134
|
+
function getStartMs(row, columns, map) {
|
|
135
|
+
const candidates = [
|
|
136
|
+
'timestamp',
|
|
137
|
+
'start_time',
|
|
138
|
+
'start_time_unix_nano',
|
|
139
|
+
'start_time_unix_ns',
|
|
140
|
+
'start_time_unix_ms',
|
|
141
|
+
'start_time_unix'
|
|
142
|
+
];
|
|
143
|
+
for (const c of candidates){
|
|
144
|
+
const idx = map[c];
|
|
145
|
+
if (idx === undefined) continue;
|
|
146
|
+
if (!columns) continue;
|
|
147
|
+
const ts = toTimestampMs(row[idx], getColumnDataType(columns, idx));
|
|
148
|
+
if (ts !== null) return ts;
|
|
149
|
+
}
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
152
|
+
function getEndMs(row, columns, map) {
|
|
153
|
+
const candidates = [
|
|
154
|
+
'timestamp_end',
|
|
155
|
+
'end_time',
|
|
156
|
+
'end_time_unix_nano',
|
|
157
|
+
'end_time_unix_ns',
|
|
158
|
+
'end_time_unix_ms'
|
|
159
|
+
];
|
|
160
|
+
for (const c of candidates){
|
|
161
|
+
const idx = map[c];
|
|
162
|
+
if (idx === undefined) continue;
|
|
163
|
+
if (!columns) continue;
|
|
164
|
+
const ts = toTimestampMs(row[idx], getColumnDataType(columns, idx));
|
|
165
|
+
if (ts !== null) return ts;
|
|
166
|
+
}
|
|
167
|
+
return undefined;
|
|
168
|
+
}
|
|
169
|
+
function buildSearchResult(records) {
|
|
170
|
+
const columns = records?.schema?.column_schemas ?? [];
|
|
171
|
+
const rows = records?.rows ?? [];
|
|
172
|
+
if (!columns.length || !rows.length) return [];
|
|
173
|
+
const map = buildColumnIndexMap(columns);
|
|
174
|
+
const traceMap = new Map();
|
|
175
|
+
rows.forEach((row)=>{
|
|
176
|
+
const traceId = getString(getCell(row, map, [
|
|
177
|
+
'trace_id',
|
|
178
|
+
'traceid',
|
|
179
|
+
'traceId'
|
|
180
|
+
]));
|
|
181
|
+
if (!traceId) return;
|
|
182
|
+
const startMs = getStartMs(row, columns, map);
|
|
183
|
+
const durationMs = getDurationMs(row, columns, map);
|
|
184
|
+
const endMs = getEndMs(row, columns, map) ?? (startMs !== undefined ? startMs + durationMs : undefined);
|
|
185
|
+
const serviceName = getString(getCell(row, map, [
|
|
186
|
+
'service_name',
|
|
187
|
+
'root_service_name'
|
|
188
|
+
])) ?? 'unknown';
|
|
189
|
+
const spanName = getString(getCell(row, map, [
|
|
190
|
+
'span_name',
|
|
191
|
+
'root_trace_name',
|
|
192
|
+
'operation_name',
|
|
193
|
+
'name'
|
|
194
|
+
])) ?? '(unknown span)';
|
|
195
|
+
const parentSpanId = getString(getCell(row, map, [
|
|
196
|
+
'parent_span_id',
|
|
197
|
+
'parentspanid',
|
|
198
|
+
'parentSpanId'
|
|
199
|
+
]));
|
|
200
|
+
const existing = traceMap.get(traceId);
|
|
201
|
+
if (!existing) {
|
|
202
|
+
traceMap.set(traceId, {
|
|
203
|
+
traceId,
|
|
204
|
+
startTimeUnixMs: startMs ?? 0,
|
|
205
|
+
endTimeUnixMs: endMs ?? startMs ?? 0,
|
|
206
|
+
rootServiceName: serviceName,
|
|
207
|
+
rootTraceName: spanName,
|
|
208
|
+
serviceStats: {
|
|
209
|
+
[serviceName]: {
|
|
210
|
+
spanCount: 1,
|
|
211
|
+
errorCount: isErrorStatus(getCell(row, map, [
|
|
212
|
+
'span_status_code',
|
|
213
|
+
'status_code'
|
|
214
|
+
])) ? 1 : 0
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (startMs !== undefined) {
|
|
221
|
+
existing.startTimeUnixMs = existing.startTimeUnixMs === 0 ? startMs : Math.min(existing.startTimeUnixMs, startMs);
|
|
222
|
+
}
|
|
223
|
+
if (endMs !== undefined) {
|
|
224
|
+
existing.endTimeUnixMs = Math.max(existing.endTimeUnixMs, endMs);
|
|
225
|
+
}
|
|
226
|
+
if (!parentSpanId) {
|
|
227
|
+
existing.rootTraceName = spanName;
|
|
228
|
+
existing.rootServiceName = serviceName;
|
|
229
|
+
}
|
|
230
|
+
if (!existing.serviceStats[serviceName]) {
|
|
231
|
+
existing.serviceStats[serviceName] = {
|
|
232
|
+
spanCount: 0,
|
|
233
|
+
errorCount: 0
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
existing.serviceStats[serviceName].spanCount += 1;
|
|
237
|
+
if (isErrorStatus(getCell(row, map, [
|
|
238
|
+
'span_status_code',
|
|
239
|
+
'status_code'
|
|
240
|
+
]))) {
|
|
241
|
+
existing.serviceStats[serviceName].errorCount += 1;
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
return Array.from(traceMap.values()).map((entry)=>({
|
|
245
|
+
traceId: entry.traceId,
|
|
246
|
+
startTimeUnixMs: entry.startTimeUnixMs,
|
|
247
|
+
durationMs: Math.max(0, entry.endTimeUnixMs - entry.startTimeUnixMs),
|
|
248
|
+
rootServiceName: entry.rootServiceName,
|
|
249
|
+
rootTraceName: entry.rootTraceName,
|
|
250
|
+
serviceStats: entry.serviceStats
|
|
251
|
+
})).sort((a, b)=>b.startTimeUnixMs - a.startTimeUnixMs);
|
|
252
|
+
}
|
|
253
|
+
function isIntegerGreptimeDataType(dataType) {
|
|
254
|
+
const normalized = dataType.toLowerCase();
|
|
255
|
+
return normalized.includes('int') || normalized.includes('uint') || normalized === 'bigint';
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* span_events JSON only: OTLP timeUnixNano is already nanoseconds (not a GreptimeDB TIMESTAMP column).
|
|
259
|
+
* @see https://docs.greptime.com/user-guide/traces/data-model/
|
|
260
|
+
*/ function otlpEventTimeToNanoString(value) {
|
|
261
|
+
if (value === undefined || value === null) return undefined;
|
|
262
|
+
const raw = getNumber(value);
|
|
263
|
+
if (raw !== undefined) return String(BigInt(Math.trunc(raw)));
|
|
264
|
+
const dateMs = new Date(String(value)).getTime();
|
|
265
|
+
if (!Number.isNaN(dateMs)) return String(BigInt(Math.trunc(dateMs)) * 1_000_000n);
|
|
266
|
+
return undefined;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* SQL column values only (timestamp, timestamp_end, duration_nano, …).
|
|
270
|
+
* Requires data_type from getColumnDataType. GreptimeDB /v1/sql returns numeric cells (and numeric strings).
|
|
271
|
+
* - Timestamp* (TIMESTAMP(9) on opentelemetry_traces) → scale to nanoseconds.
|
|
272
|
+
* - Int64/UInt64 (duration_nano) → already nanoseconds, no scaling.
|
|
273
|
+
*/ export function toNanoString(value, dataType) {
|
|
274
|
+
if (value === undefined || value === null) return undefined;
|
|
275
|
+
const raw = getNumber(value);
|
|
276
|
+
if (raw === undefined) return undefined;
|
|
277
|
+
const normalized = dataType.toLowerCase();
|
|
278
|
+
if (normalized.includes('nanosecond')) return String(BigInt(Math.trunc(raw)));
|
|
279
|
+
if (normalized.includes('microsecond')) return String(BigInt(Math.trunc(raw)) * 1000n);
|
|
280
|
+
if (normalized.includes('millisecond')) return String(BigInt(Math.trunc(raw)) * 1_000_000n);
|
|
281
|
+
if (normalized.includes('second')) return String(BigInt(Math.trunc(raw)) * 1_000_000_000n);
|
|
282
|
+
if (isIntegerGreptimeDataType(dataType)) return String(BigInt(Math.trunc(raw)));
|
|
283
|
+
throw new Error(`Unsupported GreptimeDB data_type: ${dataType}`);
|
|
284
|
+
}
|
|
285
|
+
function parseJsonArray(value) {
|
|
286
|
+
if (Array.isArray(value)) return value;
|
|
287
|
+
if (typeof value === 'string') {
|
|
288
|
+
try {
|
|
289
|
+
const parsed = JSON.parse(value);
|
|
290
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
291
|
+
} catch {
|
|
292
|
+
return [];
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return [];
|
|
296
|
+
}
|
|
297
|
+
function toAnyValue(value) {
|
|
298
|
+
return {
|
|
299
|
+
stringValue: typeof value === 'string' ? value : JSON.stringify(value)
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
function toKeyValue(key, value) {
|
|
303
|
+
return {
|
|
304
|
+
key,
|
|
305
|
+
value: toAnyValue(value)
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
function parseStatusCode(value) {
|
|
309
|
+
const normalized = String(value ?? '').trim().toUpperCase();
|
|
310
|
+
if (!normalized) return undefined;
|
|
311
|
+
if (normalized === 'STATUS_CODE_OK' || normalized === 'OK' || normalized === '1') {
|
|
312
|
+
return otlptracev1.StatusCodeOk;
|
|
313
|
+
}
|
|
314
|
+
if (normalized === 'STATUS_CODE_ERROR' || normalized === 'ERROR' || normalized === '2') {
|
|
315
|
+
return otlptracev1.StatusCodeError;
|
|
316
|
+
}
|
|
317
|
+
return otlptracev1.StatusCodeUnset;
|
|
318
|
+
}
|
|
319
|
+
function convertRowsToTrace(records) {
|
|
320
|
+
const columns = records?.schema?.column_schemas ?? [];
|
|
321
|
+
const rows = records?.rows ?? [];
|
|
322
|
+
if (!columns.length || !rows.length) return {
|
|
323
|
+
resourceSpans: []
|
|
324
|
+
};
|
|
325
|
+
const map = buildColumnIndexMap(columns);
|
|
326
|
+
const spanColumns = columns.filter((col)=>col.name.startsWith('span_attributes.'));
|
|
327
|
+
const resourceColumns = columns.filter((col)=>col.name.startsWith('resource_attributes.'));
|
|
328
|
+
const byService = new Map();
|
|
329
|
+
rows.forEach((row)=>{
|
|
330
|
+
const traceId = getString(getCell(row, map, [
|
|
331
|
+
'trace_id',
|
|
332
|
+
'traceid',
|
|
333
|
+
'traceId'
|
|
334
|
+
]));
|
|
335
|
+
const spanId = getString(getCell(row, map, [
|
|
336
|
+
'span_id',
|
|
337
|
+
'spanid',
|
|
338
|
+
'spanId'
|
|
339
|
+
]));
|
|
340
|
+
if (!traceId || !spanId) return;
|
|
341
|
+
const parentSpanId = getString(getCell(row, map, [
|
|
342
|
+
'parent_span_id',
|
|
343
|
+
'parentspanid',
|
|
344
|
+
'parentSpanId'
|
|
345
|
+
]));
|
|
346
|
+
const name = getString(getCell(row, map, [
|
|
347
|
+
'span_name',
|
|
348
|
+
'name',
|
|
349
|
+
'operation_name'
|
|
350
|
+
])) ?? '(unknown span)';
|
|
351
|
+
const kind = getString(getCell(row, map, [
|
|
352
|
+
'span_kind',
|
|
353
|
+
'kind'
|
|
354
|
+
])) ?? 'SPAN_KIND_UNSPECIFIED';
|
|
355
|
+
const serviceName = getString(getCell(row, map, [
|
|
356
|
+
'service_name'
|
|
357
|
+
])) ?? 'unknown';
|
|
358
|
+
const scopeName = getString(getCell(row, map, [
|
|
359
|
+
'scope_name'
|
|
360
|
+
])) ?? '';
|
|
361
|
+
const scopeVersion = getString(getCell(row, map, [
|
|
362
|
+
'scope_version'
|
|
363
|
+
])) ?? '';
|
|
364
|
+
const startIndex = map.timestamp ?? map.start_time ?? map.start_time_unix_nano;
|
|
365
|
+
const endIndex = map.timestamp_end ?? map.end_time ?? map.end_time_unix_nano;
|
|
366
|
+
const durationIndex = map.duration_nano ?? map.duration_ns;
|
|
367
|
+
const startTimeUnixNano = startIndex !== undefined ? toNanoString(row[startIndex], getColumnDataType(columns, startIndex)) ?? '0' : '0';
|
|
368
|
+
const endTimeUnixNano = (endIndex !== undefined ? toNanoString(row[endIndex], getColumnDataType(columns, endIndex)) ?? '0' : undefined) ?? (durationIndex !== undefined ? String(BigInt(startTimeUnixNano) + BigInt(toNanoString(row[durationIndex], getColumnDataType(columns, durationIndex)) ?? '0')) : startTimeUnixNano);
|
|
369
|
+
const spanAttributes = spanColumns.map((c)=>{
|
|
370
|
+
const idx = map[c.name.toLowerCase()];
|
|
371
|
+
if (idx === undefined) return undefined;
|
|
372
|
+
const value = row[idx];
|
|
373
|
+
if (value === undefined || value === null || value === '') return undefined;
|
|
374
|
+
return toKeyValue(c.name.replace(/^span_attributes\./, ''), value);
|
|
375
|
+
}).filter((v)=>v !== undefined);
|
|
376
|
+
// span_events / span_links: JSON columns (data_type Json). Only events need OTLP time parsing.
|
|
377
|
+
const spanEvents = parseJsonArray(getCell(row, map, [
|
|
378
|
+
'span_events'
|
|
379
|
+
])).map((event)=>{
|
|
380
|
+
const e = event;
|
|
381
|
+
const eventTime = otlpEventTimeToNanoString(e.timeUnixNano ?? e.time_unix_nano) ?? startTimeUnixNano;
|
|
382
|
+
const eventName = getString(e.name) ?? 'event';
|
|
383
|
+
const attrs = e.attributes;
|
|
384
|
+
const attributes = attrs ? Object.entries(attrs).map(([k, v])=>toKeyValue(k, v)) : [];
|
|
385
|
+
return {
|
|
386
|
+
timeUnixNano: eventTime,
|
|
387
|
+
name: eventName,
|
|
388
|
+
attributes
|
|
389
|
+
};
|
|
390
|
+
});
|
|
391
|
+
const spanLinks = parseJsonArray(getCell(row, map, [
|
|
392
|
+
'span_links'
|
|
393
|
+
])).map((link)=>{
|
|
394
|
+
const l = link;
|
|
395
|
+
const attrs = l.attributes;
|
|
396
|
+
const attributes = attrs ? Object.entries(attrs).map(([k, v])=>toKeyValue(k, v)) : [];
|
|
397
|
+
return {
|
|
398
|
+
traceId: getString(l.traceId ?? l.trace_id) ?? '',
|
|
399
|
+
spanId: getString(l.spanId ?? l.span_id) ?? '',
|
|
400
|
+
attributes
|
|
401
|
+
};
|
|
402
|
+
});
|
|
403
|
+
const statusMessage = getString(getCell(row, map, [
|
|
404
|
+
'span_status_message'
|
|
405
|
+
])) ?? '';
|
|
406
|
+
const statusCode = parseStatusCode(getCell(row, map, [
|
|
407
|
+
'span_status_code',
|
|
408
|
+
'status_code'
|
|
409
|
+
]));
|
|
410
|
+
const span = {
|
|
411
|
+
traceId,
|
|
412
|
+
spanId,
|
|
413
|
+
parentSpanId,
|
|
414
|
+
name,
|
|
415
|
+
kind,
|
|
416
|
+
startTimeUnixNano,
|
|
417
|
+
endTimeUnixNano,
|
|
418
|
+
attributes: spanAttributes,
|
|
419
|
+
events: spanEvents,
|
|
420
|
+
links: spanLinks,
|
|
421
|
+
status: {
|
|
422
|
+
message: statusMessage,
|
|
423
|
+
code: statusCode
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
if (!byService.has(serviceName)) {
|
|
427
|
+
const resourceAttrs = [
|
|
428
|
+
toKeyValue('service.name', serviceName)
|
|
429
|
+
];
|
|
430
|
+
resourceColumns.forEach((c)=>{
|
|
431
|
+
const idx = map[c.name.toLowerCase()];
|
|
432
|
+
if (idx === undefined) return;
|
|
433
|
+
const value = row[idx];
|
|
434
|
+
if (value === undefined || value === null || value === '') return;
|
|
435
|
+
resourceAttrs.push(toKeyValue(c.name.replace(/^resource_attributes\./, ''), value));
|
|
436
|
+
});
|
|
437
|
+
byService.set(serviceName, {
|
|
438
|
+
resourceAttrs,
|
|
439
|
+
scopeSpans: new Map()
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
const serviceGroup = byService.get(serviceName);
|
|
443
|
+
const scopeKey = `${scopeName}|${scopeVersion}`;
|
|
444
|
+
if (!serviceGroup.scopeSpans.has(scopeKey)) {
|
|
445
|
+
serviceGroup.scopeSpans.set(scopeKey, {
|
|
446
|
+
scope: {
|
|
447
|
+
name: scopeName,
|
|
448
|
+
version: scopeVersion
|
|
449
|
+
},
|
|
450
|
+
spans: []
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
serviceGroup.scopeSpans.get(scopeKey).spans.push(span);
|
|
454
|
+
});
|
|
455
|
+
const resourceSpans = Array.from(byService.entries()).map(([_, value])=>({
|
|
456
|
+
resource: {
|
|
457
|
+
attributes: value.resourceAttrs
|
|
458
|
+
},
|
|
459
|
+
scopeSpans: Array.from(value.scopeSpans.values())
|
|
460
|
+
}));
|
|
461
|
+
return {
|
|
462
|
+
resourceSpans
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
//# sourceMappingURL=get-greptimedb-trace-data.js.map
|