@perses-dev/tempo-plugin 0.50.3 → 0.51.0-beta.2
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 +183 -183
- package/README.md +41 -0
- package/__mf/css/async/1580.c10cf504.css +1 -0
- package/__mf/css/async/2341.c10cf504.css +1 -0
- package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
- package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
- package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
- package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
- package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
- package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
- package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
- package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
- package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
- package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
- package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
- package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
- package/__mf/js/1096.3bbe4065.js +5 -0
- package/__mf/js/Tempo.a8981810.js +5 -0
- package/__mf/js/async/1465.21c847e0.js +1 -0
- package/__mf/js/async/1540.089c4f28.js +74 -0
- package/__mf/js/async/1580.a18202be.js +2 -0
- package/__mf/js/async/1580.a18202be.js.LICENSE.txt +9 -0
- package/__mf/js/async/1620.45989def.js +2 -0
- package/__mf/js/async/1620.45989def.js.LICENSE.txt +9 -0
- package/__mf/js/async/1964.75933dd4.js +2 -0
- package/__mf/js/async/1964.75933dd4.js.LICENSE.txt +9 -0
- package/__mf/js/async/2114.c74c6b40.js +2 -0
- package/__mf/js/async/2114.c74c6b40.js.LICENSE.txt +9 -0
- package/__mf/js/async/2292.93559ffc.js +2 -0
- package/__mf/js/async/2292.93559ffc.js.LICENSE.txt +24 -0
- package/__mf/js/async/232.90224262.js +1 -0
- package/__mf/js/async/3224.8d499a63.js +1 -0
- package/__mf/js/async/3498.4c9a082f.js +73 -0
- package/__mf/js/async/3498.4c9a082f.js.LICENSE.txt +19 -0
- package/__mf/js/async/3539.e15e8cee.js +1 -0
- package/__mf/js/async/3847.bf6978f1.js +2 -0
- package/__mf/js/async/3847.bf6978f1.js.LICENSE.txt +9 -0
- package/__mf/js/async/3960.2228bf7e.js +2 -0
- package/__mf/js/async/3960.2228bf7e.js.LICENSE.txt +8 -0
- package/__mf/js/async/4075.4c40db9f.js +1 -0
- package/__mf/js/async/4238.db631f1f.js +1 -0
- package/__mf/js/async/4289.5e2073e0.js +1 -0
- package/__mf/js/async/5066.46d1b7c5.js +29 -0
- package/__mf/js/async/5066.46d1b7c5.js.LICENSE.txt +59 -0
- package/__mf/js/async/5214.fb1215df.js +1 -0
- package/__mf/js/async/5220.80e3b05e.js +10 -0
- package/__mf/js/async/5220.80e3b05e.js.LICENSE.txt +17 -0
- package/__mf/js/async/5409.446b7e6f.js +1 -0
- package/__mf/js/async/5790.949d8d1c.js +1 -0
- package/__mf/js/async/5981.4700ddf6.js +2 -0
- package/__mf/js/async/5981.4700ddf6.js.LICENSE.txt +8 -0
- package/__mf/js/async/6047.665e5323.js +28 -0
- package/__mf/js/async/6292.2481b399.js +1 -0
- package/__mf/js/async/6333.0a267ee3.js +2 -0
- package/__mf/js/async/6333.0a267ee3.js.LICENSE.txt +9 -0
- package/__mf/js/async/6374.b59f6408.js +1 -0
- package/__mf/js/async/6377.f9347b2d.js +2 -0
- package/__mf/js/async/6377.f9347b2d.js.LICENSE.txt +32 -0
- package/__mf/js/async/6770.4b9911ea.js +1 -0
- package/__mf/js/async/694.91676c53.js +1 -0
- package/__mf/js/async/7376.a69c2e5a.js +1 -0
- package/__mf/js/async/738.2cdddba7.js +1 -0
- package/__mf/js/async/76.be29ee59.js +1 -0
- package/__mf/js/async/7740.1ecb3732.js +1 -0
- package/__mf/js/async/7748.883f23aa.js +38 -0
- package/__mf/js/async/7786.6b891ba5.js +1 -0
- package/__mf/js/async/8488.d3005164.js +1 -0
- package/__mf/js/async/8597.07c3a890.js +1 -0
- package/__mf/js/async/8930.ae855fbe.js +1 -0
- package/__mf/js/async/9173.83562213.js +2 -0
- package/__mf/js/async/9173.83562213.js.LICENSE.txt +19 -0
- package/__mf/js/async/9478.57f45cd9.js +2 -0
- package/__mf/js/async/9478.57f45cd9.js.LICENSE.txt +9 -0
- package/__mf/js/async/9793.4e26e34d.js +2 -0
- package/__mf/js/async/9793.4e26e34d.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_TempoDatasource.8911fb14.js +2 -0
- package/__mf/js/async/__federation_expose_TempoDatasource.8911fb14.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_TempoExplorer.da1cd27d.js +2 -0
- package/__mf/js/async/__federation_expose_TempoExplorer.da1cd27d.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_TempoTraceQuery.fbc781c3.js +1 -0
- package/__mf/js/main.a9148968.js +1 -0
- package/lib/bootstrap.d.ts +2 -0
- package/lib/bootstrap.d.ts.map +1 -0
- package/{dist/model/api-types.js → lib/bootstrap.js} +7 -7
- package/lib/bootstrap.js.map +1 -0
- package/lib/cjs/bootstrap.js +26 -0
- package/{dist → lib}/cjs/components/TraceQLEditor.js +2 -3
- package/{dist → lib}/cjs/components/complete.js +11 -18
- package/lib/cjs/env.d.js +14 -0
- package/lib/cjs/explore/TempoExplorer.js +168 -0
- package/lib/cjs/explore/index.js +18 -0
- package/lib/cjs/getPluginModule.js +27 -0
- package/lib/cjs/index-federation.js +55 -0
- package/lib/cjs/index.js +28 -0
- package/lib/cjs/model/api-types.js +16 -0
- package/{dist → lib}/cjs/model/index.js +1 -1
- package/{dist → lib}/cjs/model/tempo-client.js +12 -12
- package/{dist → lib}/cjs/model/tempo-selectors.js +1 -1
- package/{dist → lib}/cjs/model/trace-query-model.js +1 -1
- package/lib/cjs/plugins/TempoDatasourceEditor.js +70 -0
- package/lib/cjs/plugins/index.js +21 -0
- package/{dist → lib}/cjs/plugins/tempo-datasource-types.js +1 -1
- package/{dist → lib}/cjs/plugins/tempo-datasource.js +10 -10
- package/{dist → lib}/cjs/plugins/tempo-trace-query/TempoTraceQuery.js +1 -1
- package/{dist → lib}/cjs/plugins/tempo-trace-query/TempoTraceQueryEditor.js +12 -7
- package/{dist → lib}/cjs/plugins/tempo-trace-query/get-trace-data.js +7 -88
- package/lib/cjs/plugins/tempo-trace-query/index.js +21 -0
- package/{dist → lib}/cjs/plugins/tempo-trace-query/query-editor-model.js +1 -1
- package/lib/cjs/setup-tests.js +19 -0
- package/{dist → lib}/cjs/test/index.js +1 -1
- package/{dist → lib}/cjs/test/mock-data.js +1 -182
- package/{dist → lib}/cjs/test/setup-tests.js +1 -1
- package/lib/components/TraceQLEditor.d.ts.map +1 -0
- package/{dist → lib}/components/TraceQLEditor.js +2 -3
- package/lib/components/TraceQLEditor.js.map +1 -0
- package/lib/components/TraceQLExtension.d.ts.map +1 -0
- package/lib/components/TraceQLExtension.js.map +1 -0
- package/lib/components/complete.d.ts.map +1 -0
- package/{dist → lib}/components/complete.js +11 -18
- package/lib/components/complete.js.map +1 -0
- package/lib/components/highlight.d.ts.map +1 -0
- package/lib/components/highlight.js.map +1 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js.map +1 -0
- package/lib/env.d.js +15 -0
- package/lib/env.d.js.map +1 -0
- package/lib/explore/TempoExplorer.d.ts +3 -0
- package/lib/explore/TempoExplorer.d.ts.map +1 -0
- package/lib/explore/TempoExplorer.js +160 -0
- package/lib/explore/TempoExplorer.js.map +1 -0
- package/lib/explore/index.d.ts +2 -0
- package/lib/explore/index.d.ts.map +1 -0
- package/lib/explore/index.js +3 -0
- package/lib/explore/index.js.map +1 -0
- package/lib/getPluginModule.d.ts +6 -0
- package/lib/getPluginModule.d.ts.map +1 -0
- package/lib/getPluginModule.js +16 -0
- package/lib/getPluginModule.js.map +1 -0
- package/lib/index-federation.d.ts +1 -0
- package/lib/index-federation.d.ts.map +1 -0
- package/lib/index-federation.js +15 -0
- package/{dist/components/index.js.map → lib/index-federation.js.map} +1 -1
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -0
- package/{dist → lib}/model/api-types.d.ts +3 -58
- package/lib/model/api-types.d.ts.map +1 -0
- package/lib/model/api-types.js +15 -0
- package/lib/model/api-types.js.map +1 -0
- package/lib/model/index.d.ts.map +1 -0
- package/{dist → lib}/model/index.js +1 -1
- package/lib/model/index.js.map +1 -0
- package/{dist → lib}/model/tempo-client.d.ts +1 -1
- package/lib/model/tempo-client.d.ts.map +1 -0
- package/{dist → lib}/model/tempo-client.js +13 -13
- package/lib/model/tempo-client.js.map +1 -0
- package/lib/model/tempo-selectors.d.ts.map +1 -0
- package/{dist → lib}/model/tempo-selectors.js +1 -1
- package/lib/model/tempo-selectors.js.map +1 -0
- package/lib/model/trace-query-model.d.ts.map +1 -0
- package/{dist → lib}/model/trace-query-model.js +1 -1
- package/lib/model/trace-query-model.js.map +1 -0
- package/lib/plugins/TempoDatasourceEditor.d.ts +9 -0
- package/lib/plugins/TempoDatasourceEditor.d.ts.map +1 -0
- package/lib/plugins/TempoDatasourceEditor.js +57 -0
- package/lib/plugins/TempoDatasourceEditor.js.map +1 -0
- package/lib/plugins/index.d.ts +5 -0
- package/lib/plugins/index.d.ts.map +1 -0
- package/lib/plugins/index.js +6 -0
- package/lib/plugins/index.js.map +1 -0
- package/lib/plugins/tempo-datasource-types.d.ts.map +1 -0
- package/{dist → lib}/plugins/tempo-datasource-types.js +1 -1
- package/lib/plugins/tempo-datasource-types.js.map +1 -0
- package/lib/plugins/tempo-datasource.d.ts.map +1 -0
- package/{dist → lib}/plugins/tempo-datasource.js +10 -10
- package/lib/plugins/tempo-datasource.js.map +1 -0
- package/lib/plugins/tempo-trace-query/TempoTraceQuery.d.ts.map +1 -0
- package/{dist → lib}/plugins/tempo-trace-query/TempoTraceQuery.js +1 -1
- package/lib/plugins/tempo-trace-query/TempoTraceQuery.js.map +1 -0
- package/lib/plugins/tempo-trace-query/TempoTraceQueryEditor.d.ts.map +1 -0
- package/{dist → lib}/plugins/tempo-trace-query/TempoTraceQueryEditor.js +10 -5
- package/lib/plugins/tempo-trace-query/TempoTraceQueryEditor.js.map +1 -0
- package/lib/plugins/tempo-trace-query/get-trace-data.d.ts.map +1 -0
- package/lib/plugins/tempo-trace-query/get-trace-data.js +90 -0
- package/lib/plugins/tempo-trace-query/get-trace-data.js.map +1 -0
- package/lib/plugins/tempo-trace-query/index.d.ts +5 -0
- package/lib/plugins/tempo-trace-query/index.d.ts.map +1 -0
- package/lib/plugins/tempo-trace-query/index.js +6 -0
- package/lib/plugins/tempo-trace-query/index.js.map +1 -0
- package/lib/plugins/tempo-trace-query/query-editor-model.d.ts.map +1 -0
- package/{dist → lib}/plugins/tempo-trace-query/query-editor-model.js +1 -1
- package/lib/plugins/tempo-trace-query/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/lib/test/index.d.ts.map +1 -0
- package/{dist → lib}/test/index.js +1 -1
- package/lib/test/index.js.map +1 -0
- package/{dist → lib}/test/mock-data.d.ts +0 -1
- package/lib/test/mock-data.d.ts.map +1 -0
- package/{dist → lib}/test/mock-data.js +1 -179
- package/lib/test/mock-data.js.map +1 -0
- package/lib/test/setup-tests.d.ts.map +1 -0
- package/{dist → lib}/test/setup-tests.js +1 -1
- package/lib/test/setup-tests.js.map +1 -0
- package/mf-manifest.json +610 -0
- package/mf-stats.json +693 -0
- package/package.json +83 -44
- package/dist/cjs/index.js +0 -47
- package/dist/cjs/model/api-types.js +0 -38
- package/dist/components/TraceQLEditor.d.ts.map +0 -1
- package/dist/components/TraceQLEditor.js.map +0 -1
- package/dist/components/TraceQLExtension.d.ts.map +0 -1
- package/dist/components/TraceQLExtension.js.map +0 -1
- package/dist/components/complete.d.ts.map +0 -1
- package/dist/components/complete.js.map +0 -1
- package/dist/components/highlight.d.ts.map +0 -1
- package/dist/components/highlight.js.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -22
- package/dist/index.js.map +0 -1
- package/dist/model/api-types.d.ts.map +0 -1
- package/dist/model/api-types.js.map +0 -1
- package/dist/model/index.d.ts.map +0 -1
- package/dist/model/index.js.map +0 -1
- package/dist/model/tempo-client.d.ts.map +0 -1
- package/dist/model/tempo-client.js.map +0 -1
- package/dist/model/tempo-selectors.d.ts.map +0 -1
- package/dist/model/tempo-selectors.js.map +0 -1
- package/dist/model/trace-query-model.d.ts.map +0 -1
- package/dist/model/trace-query-model.js.map +0 -1
- package/dist/plugins/tempo-datasource-types.d.ts.map +0 -1
- package/dist/plugins/tempo-datasource-types.js.map +0 -1
- package/dist/plugins/tempo-datasource.d.ts.map +0 -1
- package/dist/plugins/tempo-datasource.js.map +0 -1
- package/dist/plugins/tempo-trace-query/TempoTraceQuery.d.ts.map +0 -1
- package/dist/plugins/tempo-trace-query/TempoTraceQuery.js.map +0 -1
- package/dist/plugins/tempo-trace-query/TempoTraceQueryEditor.d.ts.map +0 -1
- package/dist/plugins/tempo-trace-query/TempoTraceQueryEditor.js.map +0 -1
- package/dist/plugins/tempo-trace-query/get-trace-data.d.ts.map +0 -1
- package/dist/plugins/tempo-trace-query/get-trace-data.js +0 -171
- package/dist/plugins/tempo-trace-query/get-trace-data.js.map +0 -1
- package/dist/plugins/tempo-trace-query/query-editor-model.d.ts.map +0 -1
- package/dist/plugins/tempo-trace-query/query-editor-model.js.map +0 -1
- package/dist/test/index.d.ts.map +0 -1
- package/dist/test/index.js.map +0 -1
- package/dist/test/mock-data.d.ts.map +0 -1
- package/dist/test/mock-data.js.map +0 -1
- package/dist/test/setup-tests.d.ts.map +0 -1
- package/dist/test/setup-tests.js.map +0 -1
- package/plugin.json +0 -26
- /package/{dist → lib}/cjs/components/TraceQLExtension.js +0 -0
- /package/{dist → lib}/cjs/components/highlight.js +0 -0
- /package/{dist → lib}/cjs/components/index.js +0 -0
- /package/{dist → lib}/components/TraceQLEditor.d.ts +0 -0
- /package/{dist → lib}/components/TraceQLExtension.d.ts +0 -0
- /package/{dist → lib}/components/TraceQLExtension.js +0 -0
- /package/{dist → lib}/components/complete.d.ts +0 -0
- /package/{dist → lib}/components/highlight.d.ts +0 -0
- /package/{dist → lib}/components/highlight.js +0 -0
- /package/{dist → lib}/components/index.d.ts +0 -0
- /package/{dist → lib}/components/index.js +0 -0
- /package/{dist → lib}/model/index.d.ts +0 -0
- /package/{dist → lib}/model/tempo-selectors.d.ts +0 -0
- /package/{dist → lib}/model/trace-query-model.d.ts +0 -0
- /package/{dist → lib}/plugins/tempo-datasource-types.d.ts +0 -0
- /package/{dist → lib}/plugins/tempo-datasource.d.ts +0 -0
- /package/{dist → lib}/plugins/tempo-trace-query/TempoTraceQuery.d.ts +0 -0
- /package/{dist → lib}/plugins/tempo-trace-query/TempoTraceQueryEditor.d.ts +0 -0
- /package/{dist → lib}/plugins/tempo-trace-query/get-trace-data.d.ts +0 -0
- /package/{dist → lib}/plugins/tempo-trace-query/query-editor-model.d.ts +0 -0
- /package/{dist → lib}/test/index.d.ts +0 -0
- /package/{dist → lib}/test/setup-tests.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/TraceQLEditor.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useMemo } from 'react';\nimport { InputLabel, Stack, useTheme } from '@mui/material';\nimport CodeMirror, { EditorView, ReactCodeMirrorProps } from '@uiw/react-codemirror';\nimport { isValidTraceId } from '@perses-dev/core';\nimport { CompletionConfig, TraceQLExtension } from './TraceQLExtension';\n\nexport interface TraceQLEditorProps extends Omit<ReactCodeMirrorProps, 'theme' | 'extensions'> {\n completeConfig: CompletionConfig;\n}\n\nexport function TraceQLEditor({ completeConfig, ...rest }: TraceQLEditorProps): ReactElement {\n const theme = useTheme();\n const isDarkMode = theme.palette.mode === 'dark';\n\n const traceQLExtension = useMemo(() => {\n return TraceQLExtension(completeConfig);\n }, [completeConfig]);\n\n const codemirrorTheme = useMemo(() => {\n // https://github.com/mui/material-ui/blob/v5.16.7/packages/mui-material/src/OutlinedInput/OutlinedInput.js#L43\n const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';\n\n return EditorView.theme({\n '&': {\n backgroundColor: 'transparent !important', // required for dark mode\n border: `1px solid ${borderColor}`,\n borderRadius: `${theme.shape.borderRadius}px`,\n },\n '&.cm-focused.cm-editor': {\n outline: 'none', // remove dotted outline on focus\n },\n '.cm-content': {\n padding: '8px',\n },\n });\n }, [theme]);\n\n return (\n <Stack position=\"relative\" sx={{ flexGrow: 1 }}>\n <InputLabel // reproduce the same kind of input label that regular MUI TextFields have\n shrink\n sx={{\n position: 'absolute',\n top: '-6px',\n left: '10px',\n padding: '0 4px',\n color: theme.palette.text.primary,\n backgroundColor: theme.palette.background.default,\n zIndex: 1,\n }}\n >\n TraceQL Expression\n </InputLabel>\n <CodeMirror\n {...rest}\n theme={isDarkMode ? 'dark' : 'light'}\n basicSetup={{\n lineNumbers: false,\n highlightActiveLine: false,\n highlightActiveLineGutter: false,\n foldGutter: false,\n // The explore view accepts either a TraceQL query or a Trace ID as input. The lezer grammar marks Trace IDs as invalid,\n // therefore let's disable syntax highlighting if the input is a Trace ID.\n syntaxHighlighting: !isValidTraceId(rest.value ?? ''),\n }}\n extensions={[EditorView.lineWrapping, traceQLExtension, codemirrorTheme]}\n placeholder='Example: {span.http.method = \"GET\"}'\n />\n </Stack>\n );\n}\n"],"names":["useMemo","InputLabel","Stack","useTheme","CodeMirror","EditorView","isValidTraceId","TraceQLExtension","TraceQLEditor","completeConfig","rest","theme","isDarkMode","palette","mode","traceQLExtension","codemirrorTheme","borderColor","backgroundColor","border","borderRadius","shape","outline","padding","position","sx","flexGrow","shrink","top","left","color","text","primary","background","default","zIndex","basicSetup","lineNumbers","highlightActiveLine","highlightActiveLineGutter","foldGutter","syntaxHighlighting","value","extensions","lineWrapping","placeholder"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAAuBA,OAAO,QAAQ,QAAQ;AAC9C,SAASC,UAAU,EAAEC,KAAK,EAAEC,QAAQ,QAAQ,gBAAgB;AAC5D,OAAOC,cAAcC,UAAU,QAA8B,wBAAwB;AACrF,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAA2BC,gBAAgB,QAAQ,qBAAqB;AAMxE,OAAO,SAASC,cAAc,EAAEC,cAAc,EAAE,GAAGC,MAA0B;IAC3E,MAAMC,QAAQR;IACd,MAAMS,aAAaD,MAAME,OAAO,CAACC,IAAI,KAAK;IAE1C,MAAMC,mBAAmBf,QAAQ;QAC/B,OAAOO,iBAAiBE;IAC1B,GAAG;QAACA;KAAe;IAEnB,MAAMO,kBAAkBhB,QAAQ;QAC9B,+GAA+G;QAC/G,MAAMiB,cAAcN,MAAME,OAAO,CAACC,IAAI,KAAK,UAAU,wBAAwB;QAE7E,OAAOT,WAAWM,KAAK,CAAC;YACtB,KAAK;gBACHO,iBAAiB;gBACjBC,QAAQ,CAAC,UAAU,EAAEF,aAAa;gBAClCG,cAAc,GAAGT,MAAMU,KAAK,CAACD,YAAY,CAAC,EAAE,CAAC;YAC/C;YACA,0BAA0B;gBACxBE,SAAS;YACX;YACA,eAAe;gBACbC,SAAS;YACX;QACF;IACF,GAAG;QAACZ;KAAM;IAEV,qBACE,MAACT;QAAMsB,UAAS;QAAWC,IAAI;YAAEC,UAAU;QAAE;;0BAC3C,KAACzB,WAAW,0EAA0E;;gBACpF0B,MAAM;gBACNF,IAAI;oBACFD,UAAU;oBACVI,KAAK;oBACLC,MAAM;oBACNN,SAAS;oBACTO,OAAOnB,MAAME,OAAO,CAACkB,IAAI,CAACC,OAAO;oBACjCd,iBAAiBP,MAAME,OAAO,CAACoB,UAAU,CAACC,OAAO;oBACjDC,QAAQ;gBACV;0BACD;;0BAGD,KAAC/B;gBACE,GAAGM,IAAI;gBACRC,OAAOC,aAAa,SAAS;gBAC7BwB,YAAY;oBACVC,aAAa;oBACbC,qBAAqB;oBACrBC,2BAA2B;oBAC3BC,YAAY;oBACZ,wHAAwH;oBACxH,0EAA0E;oBAC1EC,oBAAoB,CAACnC,eAAeI,KAAKgC,KAAK,IAAI;gBACpD;gBACAC,YAAY;oBAACtC,WAAWuC,YAAY;oBAAE7B;oBAAkBC;iBAAgB;gBACxE6B,aAAY;;;;AAIpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TraceQLExtension.d.ts","sourceRoot":"","sources":["../../../src/components/TraceQLExtension.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AA2BpD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,gBAAgB,GAAG,KAAK,CAAC,UAAU,GAAG,SAAS,CAAC,CAQ/F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/TraceQLExtension.ts"],"sourcesContent":["// Copyright 2024 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 { LRLanguage } from '@codemirror/language';\nimport { parser } from '@grafana/lezer-traceql';\nimport { CompletionContext } from '@codemirror/autocomplete';\nimport { Extension } from '@uiw/react-codemirror';\nimport { TempoClient } from '../model/tempo-client';\nimport { TempoDatasource } from '../plugins/tempo-datasource';\nimport { traceQLHighlight } from './highlight';\nimport { complete } from './complete';\n\nfunction traceQLLanguage(): LRLanguage {\n return LRLanguage.define({\n parser: parser.configure({\n props: [traceQLHighlight],\n }),\n languageData: {\n closeBrackets: { brackets: ['(', '[', '{', \"'\", '\"', '`'] },\n commentTokens: { line: '//' },\n },\n });\n}\n\nfunction getTempoClient(completionCfg: CompletionConfig): TempoClient | undefined {\n if (completionCfg.client) {\n return completionCfg.client;\n }\n if (completionCfg.endpoint) {\n return TempoDatasource.createClient({ directUrl: completionCfg.endpoint }, {});\n }\n return undefined;\n}\n\nexport interface CompletionConfig {\n client?: TempoClient;\n endpoint?: string;\n}\n\nexport function TraceQLExtension(completionCfg: CompletionConfig): Array<LRLanguage | Extension> {\n const tempoClient = getTempoClient(completionCfg);\n const language = traceQLLanguage();\n const completion = language.data.of({\n autocomplete: (ctx: CompletionContext) =>\n complete(ctx, tempoClient).catch((e) => console.error('error during TraceQL auto-complete', e)),\n });\n return [language, completion];\n}\n"],"names":["LRLanguage","parser","TempoDatasource","traceQLHighlight","complete","traceQLLanguage","define","configure","props","languageData","closeBrackets","brackets","commentTokens","line","getTempoClient","completionCfg","client","endpoint","createClient","directUrl","undefined","TraceQLExtension","tempoClient","language","completion","data","of","autocomplete","ctx","catch","e","console","error"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,UAAU,QAAQ,uBAAuB;AAClD,SAASC,MAAM,QAAQ,yBAAyB;AAIhD,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,gBAAgB,QAAQ,cAAc;AAC/C,SAASC,QAAQ,QAAQ,aAAa;AAEtC,SAASC;IACP,OAAOL,WAAWM,MAAM,CAAC;QACvBL,QAAQA,OAAOM,SAAS,CAAC;YACvBC,OAAO;gBAACL;aAAiB;QAC3B;QACAM,cAAc;YACZC,eAAe;gBAAEC,UAAU;oBAAC;oBAAK;oBAAK;oBAAK;oBAAK;oBAAK;iBAAI;YAAC;YAC1DC,eAAe;gBAAEC,MAAM;YAAK;QAC9B;IACF;AACF;AAEA,SAASC,eAAeC,aAA+B;IACrD,IAAIA,cAAcC,MAAM,EAAE;QACxB,OAAOD,cAAcC,MAAM;IAC7B;IACA,IAAID,cAAcE,QAAQ,EAAE;QAC1B,OAAOf,gBAAgBgB,YAAY,CAAC;YAAEC,WAAWJ,cAAcE,QAAQ;QAAC,GAAG,CAAC;IAC9E;IACA,OAAOG;AACT;AAOA,OAAO,SAASC,iBAAiBN,aAA+B;IAC9D,MAAMO,cAAcR,eAAeC;IACnC,MAAMQ,WAAWlB;IACjB,MAAMmB,aAAaD,SAASE,IAAI,CAACC,EAAE,CAAC;QAClCC,cAAc,CAACC,MACbxB,SAASwB,KAAKN,aAAaO,KAAK,CAAC,CAACC,IAAMC,QAAQC,KAAK,CAAC,sCAAsCF;IAChG;IACA,OAAO;QAACP;QAAUC;KAAW;AAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complete.d.ts","sourceRoot":"","sources":["../../../src/components/complete.ts"],"names":[],"mappings":"AAaA,OAAO,EAAc,iBAAiB,EAAE,gBAAgB,EAAwB,MAAM,0BAA0B,CAAC;AAEjH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAYrC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,uGAAuG;AACvG,KAAK,eAAe,GAChB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,WAAW,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtC;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAsB,QAAQ,CAC5B,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,iBAAiB,EACjC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAWlC;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,WAAW,GAAG,SAAS,CA4HxG"}
|
|
@@ -39,11 +39,10 @@ export async function complete({ state, pos }, client) {
|
|
|
39
39
|
const node = tree.resolveInner(pos, -1);
|
|
40
40
|
switch(node.type.id){
|
|
41
41
|
case SpansetFilter:
|
|
42
|
-
var _node_firstChild;
|
|
43
42
|
// autocomplete {
|
|
44
43
|
// autocomplete {}
|
|
45
44
|
// do not autocomplete if cursor is after } or { status=ok }
|
|
46
|
-
if ((node.firstChild === null ||
|
|
45
|
+
if ((node.firstChild === null || node.firstChild?.type.id === 0) && !state.sliceDoc(node.from, pos).includes('}')) {
|
|
47
46
|
return {
|
|
48
47
|
scopes: [
|
|
49
48
|
{
|
|
@@ -73,9 +72,8 @@ export async function complete({ state, pos }, client) {
|
|
|
73
72
|
from: pos
|
|
74
73
|
};
|
|
75
74
|
case AttributeField:
|
|
76
|
-
var _node_firstChild1, _node_firstChild2;
|
|
77
75
|
// autocomplete { resource.
|
|
78
|
-
if (
|
|
76
|
+
if (node.firstChild?.type.id === Resource) {
|
|
79
77
|
return {
|
|
80
78
|
scopes: [
|
|
81
79
|
{
|
|
@@ -87,7 +85,7 @@ export async function complete({ state, pos }, client) {
|
|
|
87
85
|
};
|
|
88
86
|
}
|
|
89
87
|
// autocomplete { span.
|
|
90
|
-
if (
|
|
88
|
+
if (node.firstChild?.type.id === Span) {
|
|
91
89
|
return {
|
|
92
90
|
scopes: [
|
|
93
91
|
{
|
|
@@ -116,9 +114,7 @@ export async function complete({ state, pos }, client) {
|
|
|
116
114
|
}
|
|
117
115
|
break;
|
|
118
116
|
case Identifier:
|
|
119
|
-
|
|
120
|
-
if (((_node_parent = node.parent) === null || _node_parent === void 0 ? void 0 : _node_parent.type.id) === AttributeField) {
|
|
121
|
-
var _node_parent_firstChild, _node_parent1, _node_parent_firstChild1, _node_parent2, _node_parent_firstChild2, _node_parent3;
|
|
117
|
+
if (node.parent?.type.id === AttributeField) {
|
|
122
118
|
const text = state.sliceDoc(node.parent.from, node.parent.to);
|
|
123
119
|
// autocomplete { span:s
|
|
124
120
|
// only intrinsic fields can have a : in the name.
|
|
@@ -134,7 +130,7 @@ export async function complete({ state, pos }, client) {
|
|
|
134
130
|
};
|
|
135
131
|
}
|
|
136
132
|
// autocomplete { resource.s
|
|
137
|
-
if (
|
|
133
|
+
if (node.parent?.firstChild?.type.id === Resource) {
|
|
138
134
|
return {
|
|
139
135
|
scopes: [
|
|
140
136
|
{
|
|
@@ -146,7 +142,7 @@ export async function complete({ state, pos }, client) {
|
|
|
146
142
|
};
|
|
147
143
|
}
|
|
148
144
|
// autocomplete { span.s
|
|
149
|
-
if (
|
|
145
|
+
if (node.parent?.firstChild?.type.id === Span) {
|
|
150
146
|
return {
|
|
151
147
|
scopes: [
|
|
152
148
|
{
|
|
@@ -158,7 +154,7 @@ export async function complete({ state, pos }, client) {
|
|
|
158
154
|
};
|
|
159
155
|
}
|
|
160
156
|
// autocomplete { .s
|
|
161
|
-
if (
|
|
157
|
+
if (node.parent?.firstChild?.type.id === Identifier) {
|
|
162
158
|
return {
|
|
163
159
|
scopes: [
|
|
164
160
|
{
|
|
@@ -176,10 +172,9 @@ export async function complete({ state, pos }, client) {
|
|
|
176
172
|
}
|
|
177
173
|
break;
|
|
178
174
|
case FieldOp:
|
|
179
|
-
var _node_parent_firstChild3, _node_parent4;
|
|
180
175
|
// autocomplete { status=
|
|
181
176
|
// autocomplete { span.http.method=
|
|
182
|
-
if (
|
|
177
|
+
if (node.parent?.firstChild?.type.id === FieldExpression) {
|
|
183
178
|
const fieldExpr = node.parent.firstChild;
|
|
184
179
|
const attribute = state.sliceDoc(fieldExpr.from, fieldExpr.to);
|
|
185
180
|
return {
|
|
@@ -194,10 +189,9 @@ export async function complete({ state, pos }, client) {
|
|
|
194
189
|
}
|
|
195
190
|
break;
|
|
196
191
|
case StringType:
|
|
197
|
-
var _node_parent_parent_parent_firstChild, _node_parent_parent_parent, _node_parent_parent, _node_parent5;
|
|
198
192
|
// autocomplete { resource.service.name="
|
|
199
193
|
// do not autocomplete if cursor is after closing quotes { resource.service.name=""
|
|
200
|
-
if (
|
|
194
|
+
if (node.parent?.parent?.parent?.firstChild?.type.id === FieldExpression && !/^".*"$/.test(state.sliceDoc(node.from, pos))) {
|
|
201
195
|
const fieldExpr = node.parent.parent.parent.firstChild;
|
|
202
196
|
const attribute = state.sliceDoc(fieldExpr.from, fieldExpr.to);
|
|
203
197
|
return {
|
|
@@ -212,9 +206,8 @@ export async function complete({ state, pos }, client) {
|
|
|
212
206
|
}
|
|
213
207
|
break;
|
|
214
208
|
case 0 /* error node */ :
|
|
215
|
-
var _node_prevSibling, _node_parent_firstChild4, _node_parent6, _node_parent7, _node_parent8;
|
|
216
209
|
// autocomplete { status=e
|
|
217
|
-
if (
|
|
210
|
+
if (node.prevSibling?.type.id === FieldOp && node.parent?.firstChild?.type.id === FieldExpression) {
|
|
218
211
|
const fieldExpr = node.parent.firstChild;
|
|
219
212
|
const attribute = state.sliceDoc(fieldExpr.from, fieldExpr.to);
|
|
220
213
|
// ignore leading " in { name="HT
|
|
@@ -231,7 +224,7 @@ export async function complete({ state, pos }, client) {
|
|
|
231
224
|
}
|
|
232
225
|
// autocomplete { s
|
|
233
226
|
// autocomplete { status=ok && s
|
|
234
|
-
if (
|
|
227
|
+
if (node.parent?.type.id === SpansetFilter || node.parent?.type.id === FieldExpression) {
|
|
235
228
|
return {
|
|
236
229
|
scopes: [
|
|
237
230
|
{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/complete.ts"],"sourcesContent":["// Copyright 2024 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 { Completion, CompletionContext, CompletionResult, insertCompletionText } from '@codemirror/autocomplete';\nimport { syntaxTree } from '@codemirror/language';\nimport { EditorState } from '@codemirror/state';\nimport { Tree } from '@lezer/common';\nimport {\n String as StringType,\n FieldExpression,\n AttributeField,\n Resource,\n Identifier,\n Span,\n SpansetFilter,\n FieldOp,\n} from '@grafana/lezer-traceql';\nimport { EditorView } from '@uiw/react-codemirror';\nimport { TempoClient } from '../model/tempo-client';\n\n/** CompletionScope specifies the completion kind, e.g. whether to complete tag names or values etc. */\ntype CompletionScope =\n | { kind: 'Scopes' } // 'resource'|'span'\n | { kind: 'TagName'; scope: 'resource' | 'span' | 'intrinsic' }\n | { kind: 'TagValue'; tag: string };\n\n/**\n * Completions specifies the identified scopes and position of the completion in the current editor text.\n * For example, when entering '{' the following completions are possible: Scopes(), TagName(scope=intrinsic)\n */\nexport interface Completions {\n scopes: CompletionScope[];\n from: number;\n to?: number;\n}\n\nexport async function complete(\n { state, pos }: CompletionContext,\n client?: TempoClient\n): Promise<CompletionResult | null> {\n // First, identify the completion scopes, for example Scopes() and TagName(scope=intrinsic)\n const completions = identifyCompletions(state, pos, syntaxTree(state));\n if (!completions) {\n // No completion scopes found for current cursor position.\n return null;\n }\n\n // Then, retrieve completion options for all identified scopes (from the Tempo API).\n const options = await retrieveOptions(completions.scopes, client);\n return { options, from: completions.from, to: completions.to };\n}\n\n/**\n * Identify completion scopes (e.g. TagValue) and position, based on the current node in the syntax tree.\n *\n * For development, you can visualize the tree of a TraceQL query using this tool:\n * https://github.com/grafana/lezer-traceql/blob/main/tools/tree-viz.html\n *\n * Function is exported for tests only.\n */\nexport function identifyCompletions(state: EditorState, pos: number, tree: Tree): Completions | undefined {\n const node = tree.resolveInner(pos, -1);\n\n switch (node.type.id) {\n case SpansetFilter:\n // autocomplete {\n // autocomplete {}\n // do not autocomplete if cursor is after } or { status=ok }\n if (\n (node.firstChild === null || node.firstChild?.type.id === 0) &&\n !state.sliceDoc(node.from, pos).includes('}')\n ) {\n return {\n scopes: [{ kind: 'Scopes' }, { kind: 'TagName', scope: 'intrinsic' }],\n from: pos,\n };\n }\n break;\n\n case FieldExpression:\n // autocomplete { status=ok &&\n return {\n scopes: [{ kind: 'Scopes' }, { kind: 'TagName', scope: 'intrinsic' }],\n from: pos,\n };\n\n case AttributeField:\n // autocomplete { resource.\n if (node.firstChild?.type.id === Resource) {\n return { scopes: [{ kind: 'TagName', scope: 'resource' }], from: pos };\n }\n\n // autocomplete { span.\n if (node.firstChild?.type.id === Span) {\n return { scopes: [{ kind: 'TagName', scope: 'span' }], from: pos };\n }\n\n // autocomplete { .\n if (state.sliceDoc(node.from, node.to) === '.') {\n return {\n scopes: [\n { kind: 'TagName', scope: 'resource' },\n { kind: 'TagName', scope: 'span' },\n ],\n from: pos,\n };\n }\n break;\n\n case Identifier:\n if (node.parent?.type.id === AttributeField) {\n const text = state.sliceDoc(node.parent.from, node.parent.to);\n // autocomplete { span:s\n // only intrinsic fields can have a : in the name.\n if (text.includes(':')) {\n return { scopes: [{ kind: 'TagName', scope: 'intrinsic' }], from: node.parent.from };\n }\n\n // autocomplete { resource.s\n if (node.parent?.firstChild?.type.id === Resource) {\n return { scopes: [{ kind: 'TagName', scope: 'resource' }], from: node.from };\n }\n\n // autocomplete { span.s\n if (node.parent?.firstChild?.type.id === Span) {\n return { scopes: [{ kind: 'TagName', scope: 'span' }], from: node.from };\n }\n\n // autocomplete { .s\n if (node.parent?.firstChild?.type.id === Identifier) {\n return {\n scopes: [\n { kind: 'TagName', scope: 'resource' },\n { kind: 'TagName', scope: 'span' },\n ],\n from: node.from,\n };\n }\n }\n break;\n\n case FieldOp:\n // autocomplete { status=\n // autocomplete { span.http.method=\n if (node.parent?.firstChild?.type.id === FieldExpression) {\n const fieldExpr = node.parent.firstChild;\n const attribute = state.sliceDoc(fieldExpr.from, fieldExpr.to);\n return { scopes: [{ kind: 'TagValue', tag: attribute }], from: pos };\n }\n break;\n\n case StringType:\n // autocomplete { resource.service.name=\"\n // do not autocomplete if cursor is after closing quotes { resource.service.name=\"\"\n if (\n node.parent?.parent?.parent?.firstChild?.type.id === FieldExpression &&\n !/^\".*\"$/.test(state.sliceDoc(node.from, pos))\n ) {\n const fieldExpr = node.parent.parent.parent.firstChild;\n const attribute = state.sliceDoc(fieldExpr.from, fieldExpr.to);\n return { scopes: [{ kind: 'TagValue', tag: attribute }], from: node.from + 1 }; // node.from+1 to ignore leading \"\n }\n break;\n\n case 0 /* error node */:\n // autocomplete { status=e\n if (node.prevSibling?.type.id === FieldOp && node.parent?.firstChild?.type.id === FieldExpression) {\n const fieldExpr = node.parent.firstChild;\n const attribute = state.sliceDoc(fieldExpr.from, fieldExpr.to);\n // ignore leading \" in { name=\"HT\n const from = state.sliceDoc(node.from, node.from + 1) === '\"' ? node.from + 1 : node.from;\n return { scopes: [{ kind: 'TagValue', tag: attribute }], from };\n }\n\n // autocomplete { s\n // autocomplete { status=ok && s\n if (node.parent?.type.id === SpansetFilter || node.parent?.type.id === FieldExpression) {\n return {\n scopes: [{ kind: 'Scopes' }, { kind: 'TagName', scope: 'intrinsic' }],\n from: node.from,\n };\n }\n break;\n }\n}\n\n/**\n * Retrieve all completion options based on the previously identified completion scopes.\n */\nasync function retrieveOptions(completions: CompletionScope[], client?: TempoClient): Promise<Completion[]> {\n const results: Array<Promise<Completion[]>> = [];\n\n for (const completion of completions) {\n switch (completion.kind) {\n case 'Scopes':\n results.push(Promise.resolve([{ label: 'span' }, { label: 'resource' }]));\n break;\n\n case 'TagName':\n if (client) {\n results.push(completeTagName(client, completion.scope));\n }\n break;\n\n case 'TagValue':\n if (client) {\n results.push(completeTagValue(client, completion.tag));\n }\n break;\n }\n }\n\n // Retrieve options concurrently\n // e.g. for unscoped attribute fields, retrieve list of span and resource attributes concurrently.\n const options = await Promise.all(results);\n return options.flat();\n}\n\nasync function completeTagName(client: TempoClient, scope: 'resource' | 'span' | 'intrinsic'): Promise<Completion[]> {\n const response = await client.searchTags({ scope });\n return response.scopes.flatMap((scope) => scope.tags).map((tag) => ({ label: tag }));\n}\n\n/**\n * Add quotes to the completion text in case quotes are not present already.\n * This handles the following cases:\n * { name=HTTP\n * { name=\"x\n * { name=\"x\" where cursor is after the 'x'\n */\nfunction applyQuotedCompletion(view: EditorView, completion: Completion, from: number, to: number): void {\n let insertText = completion.label;\n if (view.state.sliceDoc(from - 1, from) !== '\"') {\n insertText = '\"' + insertText;\n }\n if (view.state.sliceDoc(to, to + 1) !== '\"') {\n insertText = insertText + '\"';\n }\n view.dispatch(insertCompletionText(view.state, insertText, from, to));\n}\n\nasync function completeTagValue(client: TempoClient, tag: string): Promise<Completion[]> {\n const response = await client.searchTagValues({ tag });\n const completions: Completion[] = [];\n for (const { type, value } of response.tagValues) {\n switch (type) {\n case 'string':\n completions.push({ label: value, apply: applyQuotedCompletion });\n break;\n\n case 'keyword':\n case 'int':\n completions.push({ label: value });\n break;\n }\n }\n return completions;\n}\n"],"names":["insertCompletionText","syntaxTree","String","StringType","FieldExpression","AttributeField","Resource","Identifier","Span","SpansetFilter","FieldOp","complete","state","pos","client","completions","identifyCompletions","options","retrieveOptions","scopes","from","to","tree","node","resolveInner","type","id","firstChild","sliceDoc","includes","kind","scope","parent","text","fieldExpr","attribute","tag","test","prevSibling","results","completion","push","Promise","resolve","label","completeTagName","completeTagValue","all","flat","response","searchTags","flatMap","tags","map","applyQuotedCompletion","view","insertText","dispatch","searchTagValues","value","tagValues","apply"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAA0DA,oBAAoB,QAAQ,2BAA2B;AACjH,SAASC,UAAU,QAAQ,uBAAuB;AAGlD,SACEC,UAAUC,UAAU,EACpBC,eAAe,EACfC,cAAc,EACdC,QAAQ,EACRC,UAAU,EACVC,IAAI,EACJC,aAAa,EACbC,OAAO,QACF,yBAAyB;AAoBhC,OAAO,eAAeC,SACpB,EAAEC,KAAK,EAAEC,GAAG,EAAqB,EACjCC,MAAoB;IAEpB,2FAA2F;IAC3F,M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,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/highlight.ts"],"sourcesContent":["// Copyright 2024 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 { styleTags, tags } from '@lezer/highlight';\n\nexport const traceQLHighlight = styleTags({\n LineComment: tags.comment,\n 'Parent Resource Span Identifier': tags.labelName,\n IntrinsicField: tags.labelName,\n String: tags.string,\n 'Integer Float Duration': tags.number,\n Static: tags.literal,\n 'Aggregate AggregateExpression': tags.function(tags.keyword),\n 'And Or': tags.logicOperator,\n 'Gt Lt Desc Anc tilde ExperimentalOp': tags.bitwiseOperator, // structural operators\n ComparisonOp: tags.compareOperator,\n Pipe: tags.operator,\n ScalarOp: tags.arithmeticOperator,\n '( )': tags.paren,\n '[ ]': tags.squareBracket,\n '{ }': tags.brace,\n '⚠': tags.invalid,\n});\n"],"names":["styleTags","tags","traceQLHighlight","LineComment","comment","labelName","IntrinsicField","String","string","number","Static","literal","function","keyword","logicOperator","bitwiseOperator","ComparisonOp","compareOperator","Pipe","operator","ScalarOp","arithmeticOperator","paren","squareBracket","brace","invalid"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,SAAS,EAAEC,IAAI,QAAQ,mBAAmB;AAEnD,OAAO,MAAMC,mBAAmBF,UAAU;IACxCG,aAAaF,KAAKG,OAAO;IACzB,mCAAmCH,KAAKI,SAAS;IACjDC,gBAAgBL,KAAKI,SAAS;IAC9BE,QAAQN,KAAKO,MAAM;IACnB,0BAA0BP,KAAKQ,MAAM;IACrCC,QAAQT,KAAKU,OAAO;IACpB,iCAAiCV,KAAKW,QAAQ,CAACX,KAAKY,OAAO;IAC3D,UAAUZ,KAAKa,aAAa;IAC5B,uCAAuCb,KAAKc,eAAe;IAC3DC,cAAcf,KAAKgB,eAAe;IAClCC,MAAMjB,KAAKkB,QAAQ;IACnBC,UAAUnB,KAAKoB,kBAAkB;IACjC,OAAOpB,KAAKqB,KAAK;IACjB,OAAOrB,KAAKsB,aAAa;IACzB,OAAOtB,KAAKuB,KAAK;IACjB,KAAKvB,KAAKwB,OAAO;AACnB,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAaA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["// Copyright 2024 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 './TraceQLEditor';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,kBAAkB"}
|
package/lib/env.d.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2024 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
|
+
/// <reference types="@rsbuild/core/types" />
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=env.d.js.map
|
package/lib/env.d.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/env.d.ts"],"sourcesContent":["// Copyright 2024 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\n/// <reference types=\"@rsbuild/core/types\" />\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,6CAA6C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TempoExplorer.d.ts","sourceRoot":"","sources":["../../../src/explore/TempoExplorer.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAyErC,wBAAgB,aAAa,IAAI,YAAY,CAwC5C"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
import { Box, Stack } from '@mui/material';
|
|
15
|
+
import { ErrorAlert, ErrorBoundary, LoadingOverlay, NoDataOverlay } from '@perses-dev/components';
|
|
16
|
+
import { isValidTraceId } from '@perses-dev/core';
|
|
17
|
+
import { Panel } from '@perses-dev/dashboards';
|
|
18
|
+
import { useExplorerManagerContext } from '@perses-dev/explore';
|
|
19
|
+
import { DataQueriesProvider, MultiQueryEditor, useDataQueries } from '@perses-dev/plugin-system';
|
|
20
|
+
function SearchResultsPanel({ queries }) {
|
|
21
|
+
const { isFetching, isLoading, queryResults } = useDataQueries('TraceQuery');
|
|
22
|
+
// no query executed, show empty panel
|
|
23
|
+
if (queryResults.length === 0) {
|
|
24
|
+
return /*#__PURE__*/ _jsx(_Fragment, {});
|
|
25
|
+
}
|
|
26
|
+
if (isLoading || isFetching) {
|
|
27
|
+
return /*#__PURE__*/ _jsx(LoadingOverlay, {});
|
|
28
|
+
}
|
|
29
|
+
const queryError = queryResults.find((d)=>d.error);
|
|
30
|
+
if (queryError) {
|
|
31
|
+
throw queryError.error;
|
|
32
|
+
}
|
|
33
|
+
const tracesFound = queryResults.some((traceData)=>(traceData.data?.searchResult ?? []).length > 0);
|
|
34
|
+
if (!tracesFound) {
|
|
35
|
+
return /*#__PURE__*/ _jsx(NoDataOverlay, {
|
|
36
|
+
resource: "traces"
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
40
|
+
sx: {
|
|
41
|
+
height: '100%'
|
|
42
|
+
},
|
|
43
|
+
gap: 2,
|
|
44
|
+
children: [
|
|
45
|
+
/*#__PURE__*/ _jsx(Box, {
|
|
46
|
+
sx: {
|
|
47
|
+
height: '35%',
|
|
48
|
+
flexShrink: 0
|
|
49
|
+
},
|
|
50
|
+
children: /*#__PURE__*/ _jsx(Panel, {
|
|
51
|
+
panelOptions: {
|
|
52
|
+
hideHeader: true
|
|
53
|
+
},
|
|
54
|
+
definition: {
|
|
55
|
+
kind: 'Panel',
|
|
56
|
+
spec: {
|
|
57
|
+
queries,
|
|
58
|
+
display: {
|
|
59
|
+
name: ''
|
|
60
|
+
},
|
|
61
|
+
plugin: {
|
|
62
|
+
kind: 'ScatterChart',
|
|
63
|
+
spec: {}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
}),
|
|
69
|
+
/*#__PURE__*/ _jsx(Panel, {
|
|
70
|
+
sx: {
|
|
71
|
+
flexGrow: 1
|
|
72
|
+
},
|
|
73
|
+
panelOptions: {
|
|
74
|
+
hideHeader: true
|
|
75
|
+
},
|
|
76
|
+
definition: {
|
|
77
|
+
kind: 'Panel',
|
|
78
|
+
spec: {
|
|
79
|
+
queries,
|
|
80
|
+
display: {
|
|
81
|
+
name: ''
|
|
82
|
+
},
|
|
83
|
+
plugin: {
|
|
84
|
+
kind: 'TraceTable',
|
|
85
|
+
spec: {}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function TracingGanttChartPanel({ queries }) {
|
|
94
|
+
return /*#__PURE__*/ _jsx(Panel, {
|
|
95
|
+
panelOptions: {
|
|
96
|
+
hideHeader: true
|
|
97
|
+
},
|
|
98
|
+
definition: {
|
|
99
|
+
kind: 'Panel',
|
|
100
|
+
spec: {
|
|
101
|
+
queries,
|
|
102
|
+
display: {
|
|
103
|
+
name: ''
|
|
104
|
+
},
|
|
105
|
+
plugin: {
|
|
106
|
+
kind: 'TracingGanttChart',
|
|
107
|
+
spec: {}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
export function TempoExplorer() {
|
|
114
|
+
const { data: { queries = [] }, setData } = useExplorerManagerContext();
|
|
115
|
+
// map TraceQueryDefinition to Definition<UnknownSpec>
|
|
116
|
+
const definitions = queries.length ? queries.map((query)=>{
|
|
117
|
+
return {
|
|
118
|
+
kind: query.spec.plugin.kind,
|
|
119
|
+
spec: query.spec.plugin.spec
|
|
120
|
+
};
|
|
121
|
+
}) : [];
|
|
122
|
+
// Cannot cast to TempoTraceQuerySpec because 'tempo-plugin' types are not accessible in @perses-dev/explore
|
|
123
|
+
const isSingleTrace = queries.length === 1 && queries[0]?.kind === 'TraceQuery' && queries[0]?.spec.plugin.kind === 'TempoTraceQuery' && isValidTraceId((queries[0]?.spec.plugin.spec).query ?? ''); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
124
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
125
|
+
gap: 2,
|
|
126
|
+
sx: {
|
|
127
|
+
width: '100%'
|
|
128
|
+
},
|
|
129
|
+
children: [
|
|
130
|
+
/*#__PURE__*/ _jsx(MultiQueryEditor, {
|
|
131
|
+
queryTypes: [
|
|
132
|
+
'TraceQuery'
|
|
133
|
+
],
|
|
134
|
+
onChange: (newQueries)=>setData({
|
|
135
|
+
queries: newQueries
|
|
136
|
+
}),
|
|
137
|
+
queries: queries
|
|
138
|
+
}),
|
|
139
|
+
/*#__PURE__*/ _jsx(ErrorBoundary, {
|
|
140
|
+
FallbackComponent: ErrorAlert,
|
|
141
|
+
resetKeys: [
|
|
142
|
+
queries
|
|
143
|
+
],
|
|
144
|
+
children: /*#__PURE__*/ _jsx(DataQueriesProvider, {
|
|
145
|
+
definitions: definitions,
|
|
146
|
+
children: /*#__PURE__*/ _jsx(Box, {
|
|
147
|
+
height: 700,
|
|
148
|
+
children: isSingleTrace ? /*#__PURE__*/ _jsx(TracingGanttChartPanel, {
|
|
149
|
+
queries: queries
|
|
150
|
+
}) : /*#__PURE__*/ _jsx(SearchResultsPanel, {
|
|
151
|
+
queries: queries
|
|
152
|
+
})
|
|
153
|
+
})
|
|
154
|
+
})
|
|
155
|
+
})
|
|
156
|
+
]
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
//# sourceMappingURL=TempoExplorer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/explore/TempoExplorer.tsx"],"sourcesContent":["// Copyright 2024 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 { Box, Stack } from '@mui/material';\nimport { ErrorAlert, ErrorBoundary, LoadingOverlay, NoDataOverlay } from '@perses-dev/components';\nimport { QueryDefinition, isValidTraceId } from '@perses-dev/core';\nimport { Panel } from '@perses-dev/dashboards';\nimport { useExplorerManagerContext } from '@perses-dev/explore';\nimport { DataQueriesProvider, MultiQueryEditor, useDataQueries } from '@perses-dev/plugin-system';\nimport { ReactElement } from 'react';\n\ninterface TracesExplorerQueryParams {\n queries?: QueryDefinition[];\n}\n\ninterface SearchResultsPanelProps {\n queries: QueryDefinition[];\n}\n\nfunction SearchResultsPanel({ queries }: SearchResultsPanelProps): ReactElement {\n const { isFetching, isLoading, queryResults } = useDataQueries('TraceQuery');\n\n // no query executed, show empty panel\n if (queryResults.length === 0) {\n return <></>;\n }\n\n if (isLoading || isFetching) {\n return <LoadingOverlay />;\n }\n\n const queryError = queryResults.find((d) => d.error);\n if (queryError) {\n throw queryError.error;\n }\n\n const tracesFound = queryResults.some((traceData) => (traceData.data?.searchResult ?? []).length > 0);\n if (!tracesFound) {\n return <NoDataOverlay resource=\"traces\" />;\n }\n\n return (\n <Stack sx={{ height: '100%' }} gap={2}>\n <Box sx={{ height: '35%', flexShrink: 0 }}>\n <Panel\n panelOptions={{\n hideHeader: true,\n }}\n definition={{\n kind: 'Panel',\n spec: { queries, display: { name: '' }, plugin: { kind: 'ScatterChart', spec: {} } },\n }}\n />\n </Box>\n <Panel\n sx={{ flexGrow: 1 }}\n panelOptions={{\n hideHeader: true,\n }}\n definition={{\n kind: 'Panel',\n spec: { queries, display: { name: '' }, plugin: { kind: 'TraceTable', spec: {} } },\n }}\n />\n </Stack>\n );\n}\n\nfunction TracingGanttChartPanel({ queries }: { queries: QueryDefinition[] }): ReactElement {\n return (\n <Panel\n panelOptions={{\n hideHeader: true,\n }}\n definition={{\n kind: 'Panel',\n spec: { queries, display: { name: '' }, plugin: { kind: 'TracingGanttChart', spec: {} } },\n }}\n />\n );\n}\n\nexport function TempoExplorer(): ReactElement {\n const {\n data: { queries = [] },\n setData,\n } = useExplorerManagerContext<TracesExplorerQueryParams>();\n\n // map TraceQueryDefinition to Definition<UnknownSpec>\n const definitions = queries.length\n ? queries.map((query: QueryDefinition) => {\n return {\n kind: query.spec.plugin.kind,\n spec: query.spec.plugin.spec,\n };\n })\n : [];\n\n // Cannot cast to TempoTraceQuerySpec because 'tempo-plugin' types are not accessible in @perses-dev/explore\n const isSingleTrace =\n queries.length === 1 &&\n queries[0]?.kind === 'TraceQuery' &&\n queries[0]?.spec.plugin.kind === 'TempoTraceQuery' &&\n isValidTraceId((queries[0]?.spec.plugin.spec as any).query ?? ''); // eslint-disable-line @typescript-eslint/no-explicit-any\n\n return (\n <Stack gap={2} sx={{ width: '100%' }}>\n <MultiQueryEditor\n queryTypes={['TraceQuery']}\n onChange={(newQueries) => setData({ queries: newQueries })}\n queries={queries}\n />\n\n <ErrorBoundary FallbackComponent={ErrorAlert} resetKeys={[queries]}>\n <DataQueriesProvider definitions={definitions}>\n <Box height={700}>\n {isSingleTrace ? <TracingGanttChartPanel queries={queries} /> : <SearchResultsPanel queries={queries} />}\n </Box>\n </DataQueriesProvider>\n </ErrorBoundary>\n </Stack>\n );\n}\n"],"names":["Box","Stack","ErrorAlert","ErrorBoundary","LoadingOverlay","NoDataOverlay","isValidTraceId","Panel","useExplorerManagerContext","DataQueriesProvider","MultiQueryEditor","useDataQueries","SearchResultsPanel","queries","isFetching","isLoading","queryResults","length","queryError","find","d","error","tracesFound","some","traceData","data","searchResult","resource","sx","height","gap","flexShrink","panelOptions","hideHeader","definition","kind","spec","display","name","plugin","flexGrow","TracingGanttChartPanel","TempoExplorer","setData","definitions","map","query","isSingleTrace","width","queryTypes","onChange","newQueries","FallbackComponent","resetKeys"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,EAAEC,KAAK,QAAQ,gBAAgB;AAC3C,SAASC,UAAU,EAAEC,aAAa,EAAEC,cAAc,EAAEC,aAAa,QAAQ,yBAAyB;AAClG,SAA0BC,cAAc,QAAQ,mBAAmB;AACnE,SAASC,KAAK,QAAQ,yBAAyB;AAC/C,SAASC,yBAAyB,QAAQ,sBAAsB;AAChE,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,cAAc,QAAQ,4BAA4B;AAWlG,SAASC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Root":"","sources":["../../../src/explore/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/explore/index.ts"],"sourcesContent":["export * from './TempoExplorer';\n"],"names":[],"mappings":"AAAA,cAAc,kBAAkB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPluginModule.d.ts","sourceRoot":"","sources":["../../src/getPluginModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAoB,MAAM,2BAA2B,CAAC;AAGnF;;GAEG;AACH,wBAAgB,eAAe,IAAI,oBAAoB,CAUtD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import packageJson from '../package.json';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the plugin module information from package.json
|
|
4
|
+
*/ export function getPluginModule() {
|
|
5
|
+
const { name, version, perses } = packageJson;
|
|
6
|
+
return {
|
|
7
|
+
kind: 'PluginModule',
|
|
8
|
+
metadata: {
|
|
9
|
+
name,
|
|
10
|
+
version
|
|
11
|
+
},
|
|
12
|
+
spec: perses
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=getPluginModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/getPluginModule.ts"],"sourcesContent":["import { PluginModuleResource, PluginModuleSpec } from '@perses-dev/plugin-system';\nimport packageJson from '../package.json';\n\n/**\n * Returns the plugin module information from package.json\n */\nexport function getPluginModule(): PluginModuleResource {\n const { name, version, perses } = packageJson;\n return {\n kind: 'PluginModule',\n metadata: {\n name,\n version,\n },\n spec: perses as PluginModuleSpec,\n };\n}\n"],"names":["packageJson","getPluginModule","name","version","perses","kind","metadata","spec"],"mappings":"AACA,OAAOA,iBAAiB,kBAAkB;AAE1C;;CAEC,GACD,OAAO,SAASC;IACd,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGJ;IAClC,OAAO;QACLK,MAAM;QACNC,UAAU;YACRJ;YACAC;QACF;QACAI,MAAMH;IACR;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index-federation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-federation.d.ts","sourceRoot":"","sources":["../../src/index-federation.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2024 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('./bootstrap');
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index-federation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/
|
|
1
|
+
{"version":3,"sources":["../../src/index-federation.ts"],"sourcesContent":["// Copyright 2024 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('./bootstrap');\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,MAAM,CAAC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
|
package/lib/index.js
ADDED
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { getPluginModule } from './getPluginModule';\nexport * from './components';\nexport * from './explore';\nexport * from './model';\nexport * from './plugins';\n"],"names":["getPluginModule"],"mappings":"AAAA,SAASA,eAAe,QAAQ,oBAAoB;AACpD,cAAc,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,UAAU;AACxB,cAAc,YAAY"}
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Common types
|
|
3
|
-
*/
|
|
4
|
-
export interface Attribute {
|
|
5
|
-
key: string;
|
|
6
|
-
value: AttributeValue;
|
|
7
|
-
}
|
|
8
|
-
export type AttributeValue = {
|
|
9
|
-
stringValue: string;
|
|
10
|
-
} | {
|
|
11
|
-
intValue: string;
|
|
12
|
-
} | {
|
|
13
|
-
boolValue: boolean;
|
|
14
|
-
} | {
|
|
15
|
-
arrayValue: {
|
|
16
|
-
values: AttributeValue[];
|
|
17
|
-
};
|
|
18
|
-
};
|
|
1
|
+
import { otlpcommonv1, otlptracev1 } from '@perses-dev/core';
|
|
19
2
|
/**
|
|
20
3
|
* Request parameters of Tempo HTTP API endpoint GET /api/search
|
|
21
4
|
* https://grafana.com/docs/tempo/latest/api_docs/#search
|
|
@@ -60,7 +43,7 @@ export interface SpanSearchResponse {
|
|
|
60
43
|
name?: string;
|
|
61
44
|
startTimeUnixNano: string;
|
|
62
45
|
durationNanos: string;
|
|
63
|
-
attributes?:
|
|
46
|
+
attributes?: otlpcommonv1.KeyValue[];
|
|
64
47
|
}
|
|
65
48
|
export interface ServiceStats {
|
|
66
49
|
spanCount: number;
|
|
@@ -79,46 +62,8 @@ export interface QueryRequestParameters {
|
|
|
79
62
|
* OTEL trace proto: https://github.com/open-telemetry/opentelemetry-proto-go/blob/main/otlp/trace/v1/trace.pb.go
|
|
80
63
|
*/
|
|
81
64
|
export interface QueryResponse {
|
|
82
|
-
batches:
|
|
83
|
-
}
|
|
84
|
-
export interface Batch {
|
|
85
|
-
resource: Resource;
|
|
86
|
-
scopeSpans: ScopeSpan[];
|
|
87
|
-
}
|
|
88
|
-
export interface Resource {
|
|
89
|
-
attributes: Attribute[];
|
|
90
|
-
}
|
|
91
|
-
export interface ScopeSpan {
|
|
92
|
-
scope: Scope;
|
|
93
|
-
spans: Span[];
|
|
94
|
-
}
|
|
95
|
-
export interface Scope {
|
|
96
|
-
name: string;
|
|
97
|
-
}
|
|
98
|
-
export interface Span {
|
|
99
|
-
traceId: string;
|
|
100
|
-
spanId: string;
|
|
101
|
-
parentSpanId?: string;
|
|
102
|
-
name: string;
|
|
103
|
-
kind: string;
|
|
104
|
-
startTimeUnixNano: string;
|
|
105
|
-
endTimeUnixNano: string;
|
|
106
|
-
attributes?: Attribute[];
|
|
107
|
-
events?: SpanEvent[];
|
|
108
|
-
status?: SpanStatus;
|
|
109
|
-
}
|
|
110
|
-
export interface SpanEvent {
|
|
111
|
-
timeUnixNano: string;
|
|
112
|
-
name: string;
|
|
113
|
-
attributes?: Attribute[];
|
|
114
|
-
}
|
|
115
|
-
export interface SpanStatus {
|
|
116
|
-
code?: typeof SpanStatusUnset | typeof SpanStatusOk | typeof SpanStatusError;
|
|
117
|
-
message?: string;
|
|
65
|
+
batches: otlptracev1.ResourceSpan[];
|
|
118
66
|
}
|
|
119
|
-
export declare const SpanStatusUnset = "STATUS_CODE_UNSET";
|
|
120
|
-
export declare const SpanStatusOk = "STATUS_CODE_OK";
|
|
121
|
-
export declare const SpanStatusError = "STATUS_CODE_ERROR";
|
|
122
67
|
/**
|
|
123
68
|
* Request parameters of Tempo HTTP API endpoint GET /api/v2/search/tags
|
|
124
69
|
* https://grafana.com/docs/tempo/latest/api_docs/#search-tags-v2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-types.d.ts","sourceRoot":"","sources":["../../../src/model/api-types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,mBAAmB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,kBAAkB,EAAE,CAAC;QAC5B,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,QAAQ,CAAC,EAAE,KAAK,CAAC;QACf,KAAK,EAAE,kBAAkB,EAAE,CAAC;QAC5B,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CA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