@perses-dev/tempo-plugin 0.57.0-beta.0 → 0.57.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.
Files changed (155) hide show
  1. package/__mf/js/{Tempo.7093dd4a.js → Tempo.a15c7ca4.js} +3 -3
  2. package/__mf/js/async/1728.988e2b29.js +1 -0
  3. package/__mf/js/async/1905.d3c01a20.js +2 -0
  4. package/__mf/js/async/{7583.bfd2f519.js → 3064.2462a755.js} +1 -1
  5. package/__mf/js/async/392.b27ef564.js +2 -0
  6. package/__mf/js/async/54.812deb71.js +22 -0
  7. package/__mf/js/async/7902.57efc83f.js +2 -0
  8. package/__mf/js/async/7958.4ba5d596.js +7 -0
  9. package/__mf/js/async/9877.d18186e5.js +38 -0
  10. package/__mf/js/async/{__federation_expose_TempoDatasource.a0c321ab.js → __federation_expose_TempoDatasource.1f9ab43f.js} +2 -2
  11. package/__mf/js/async/__federation_expose_TempoExplorer.003c9970.js +1 -0
  12. package/__mf/js/async/{__federation_expose_TempoTraceQuery.e1786579.js → __federation_expose_TempoTraceQuery.eff34861.js} +1 -1
  13. package/__mf/js/async/lib-router.66abf9e6.js +2 -0
  14. package/__mf/js/async/{lib-router.4c755752.js.LICENSE.txt → lib-router.66abf9e6.js.LICENSE.txt} +3 -3
  15. package/__mf/js/{main.db74e654.js → main.6a6654b6.js} +3 -3
  16. package/lib/bootstrap.js +1 -1
  17. package/lib/bootstrap.js.map +1 -1
  18. package/lib/cjs/bootstrap.js +1 -1
  19. package/lib/cjs/components/AttributeFilters.js +1 -1
  20. package/lib/cjs/components/ClosableAlert.js +40 -0
  21. package/lib/cjs/components/TraceQLEditor.js +1 -1
  22. package/lib/cjs/components/TraceQLExtension.js +1 -1
  23. package/lib/cjs/components/complete.js +1 -1
  24. package/lib/cjs/components/filter/filter.js +12 -0
  25. package/lib/cjs/components/filter/filter_to_traceql.js +12 -0
  26. package/lib/cjs/components/filter/index.js +1 -1
  27. package/lib/cjs/components/filter/traceql_to_filter.js +12 -0
  28. package/lib/cjs/components/highlight.js +1 -1
  29. package/lib/cjs/components/index.js +1 -1
  30. package/lib/cjs/env.d.js +1 -1
  31. package/lib/cjs/explore/TempoExplorer.js +6 -5
  32. package/lib/cjs/explore/index.js +12 -0
  33. package/lib/cjs/explore/links.js +1 -1
  34. package/lib/cjs/getPluginModule.js +12 -0
  35. package/lib/cjs/index-federation.js +1 -1
  36. package/lib/cjs/index.js +12 -0
  37. package/lib/cjs/model/api-types.js +1 -1
  38. package/lib/cjs/model/index.js +1 -1
  39. package/lib/cjs/model/tempo-client.js +1 -1
  40. package/lib/cjs/model/tempo-selectors.js +1 -1
  41. package/lib/cjs/model/trace-query-model.js +1 -1
  42. package/lib/cjs/plugins/TempoDatasourceEditor.js +1 -1
  43. package/lib/cjs/plugins/index.js +12 -0
  44. package/lib/cjs/plugins/tempo-datasource-types.js +1 -1
  45. package/lib/cjs/plugins/tempo-datasource.js +1 -1
  46. package/lib/cjs/plugins/tempo-trace-query/TempoTraceQuery.js +1 -1
  47. package/lib/cjs/plugins/tempo-trace-query/TempoTraceQueryEditor.js +1 -1
  48. package/lib/cjs/plugins/tempo-trace-query/get-trace-data.js +1 -1
  49. package/lib/cjs/plugins/tempo-trace-query/index.js +12 -0
  50. package/lib/cjs/plugins/tempo-trace-query/query-editor-model.js +1 -1
  51. package/lib/cjs/setup-tests.js +1 -1
  52. package/lib/cjs/test/index.js +1 -1
  53. package/lib/cjs/test/mock-data.js +1 -1
  54. package/lib/cjs/test/setup-tests.js +1 -1
  55. package/lib/components/AttributeFilters.js +1 -1
  56. package/lib/components/AttributeFilters.js.map +1 -1
  57. package/lib/components/ClosableAlert.d.ts +3 -0
  58. package/lib/components/ClosableAlert.d.ts.map +1 -0
  59. package/lib/components/ClosableAlert.js +32 -0
  60. package/lib/components/ClosableAlert.js.map +1 -0
  61. package/lib/components/TraceQLEditor.js +1 -1
  62. package/lib/components/TraceQLEditor.js.map +1 -1
  63. package/lib/components/TraceQLExtension.js +1 -1
  64. package/lib/components/TraceQLExtension.js.map +1 -1
  65. package/lib/components/complete.js +1 -1
  66. package/lib/components/complete.js.map +1 -1
  67. package/lib/components/filter/filter.d.ts.map +1 -1
  68. package/lib/components/filter/filter.js +12 -0
  69. package/lib/components/filter/filter.js.map +1 -1
  70. package/lib/components/filter/filter_to_traceql.d.ts.map +1 -1
  71. package/lib/components/filter/filter_to_traceql.js +12 -0
  72. package/lib/components/filter/filter_to_traceql.js.map +1 -1
  73. package/lib/components/filter/index.js +1 -1
  74. package/lib/components/filter/index.js.map +1 -1
  75. package/lib/components/filter/traceql_to_filter.d.ts.map +1 -1
  76. package/lib/components/filter/traceql_to_filter.js +12 -0
  77. package/lib/components/filter/traceql_to_filter.js.map +1 -1
  78. package/lib/components/highlight.js +1 -1
  79. package/lib/components/highlight.js.map +1 -1
  80. package/lib/components/index.js +1 -1
  81. package/lib/components/index.js.map +1 -1
  82. package/lib/env.d.js +1 -1
  83. package/lib/env.d.js.map +1 -1
  84. package/lib/explore/TempoExplorer.d.ts.map +1 -1
  85. package/lib/explore/TempoExplorer.js +7 -6
  86. package/lib/explore/TempoExplorer.js.map +1 -1
  87. package/lib/explore/index.d.ts.map +1 -1
  88. package/lib/explore/index.js +12 -0
  89. package/lib/explore/index.js.map +1 -1
  90. package/lib/explore/links.js +1 -1
  91. package/lib/explore/links.js.map +1 -1
  92. package/lib/getPluginModule.d.ts.map +1 -1
  93. package/lib/getPluginModule.js +12 -0
  94. package/lib/getPluginModule.js.map +1 -1
  95. package/lib/index-federation.js +1 -1
  96. package/lib/index-federation.js.map +1 -1
  97. package/lib/index.d.ts.map +1 -1
  98. package/lib/index.js +12 -0
  99. package/lib/index.js.map +1 -1
  100. package/lib/model/api-types.js +1 -1
  101. package/lib/model/api-types.js.map +1 -1
  102. package/lib/model/index.js +1 -1
  103. package/lib/model/index.js.map +1 -1
  104. package/lib/model/tempo-client.js +1 -1
  105. package/lib/model/tempo-client.js.map +1 -1
  106. package/lib/model/tempo-selectors.js +1 -1
  107. package/lib/model/tempo-selectors.js.map +1 -1
  108. package/lib/model/trace-query-model.js +1 -1
  109. package/lib/model/trace-query-model.js.map +1 -1
  110. package/lib/plugins/TempoDatasourceEditor.js +1 -1
  111. package/lib/plugins/TempoDatasourceEditor.js.map +1 -1
  112. package/lib/plugins/index.d.ts.map +1 -1
  113. package/lib/plugins/index.js +12 -0
  114. package/lib/plugins/index.js.map +1 -1
  115. package/lib/plugins/tempo-datasource-types.js +1 -1
  116. package/lib/plugins/tempo-datasource-types.js.map +1 -1
  117. package/lib/plugins/tempo-datasource.js +1 -1
  118. package/lib/plugins/tempo-datasource.js.map +1 -1
  119. package/lib/plugins/tempo-trace-query/TempoTraceQuery.js +1 -1
  120. package/lib/plugins/tempo-trace-query/TempoTraceQuery.js.map +1 -1
  121. package/lib/plugins/tempo-trace-query/TempoTraceQueryEditor.js +1 -1
  122. package/lib/plugins/tempo-trace-query/TempoTraceQueryEditor.js.map +1 -1
  123. package/lib/plugins/tempo-trace-query/get-trace-data.js +1 -1
  124. package/lib/plugins/tempo-trace-query/get-trace-data.js.map +1 -1
  125. package/lib/plugins/tempo-trace-query/index.d.ts.map +1 -1
  126. package/lib/plugins/tempo-trace-query/index.js +12 -0
  127. package/lib/plugins/tempo-trace-query/index.js.map +1 -1
  128. package/lib/plugins/tempo-trace-query/query-editor-model.js +1 -1
  129. package/lib/plugins/tempo-trace-query/query-editor-model.js.map +1 -1
  130. package/lib/setup-tests.js +1 -1
  131. package/lib/setup-tests.js.map +1 -1
  132. package/lib/test/index.js +1 -1
  133. package/lib/test/index.js.map +1 -1
  134. package/lib/test/mock-data.js +1 -1
  135. package/lib/test/mock-data.js.map +1 -1
  136. package/lib/test/setup-tests.js +1 -1
  137. package/lib/test/setup-tests.js.map +1 -1
  138. package/mf-manifest.json +36 -36
  139. package/mf-stats.json +36 -36
  140. package/package.json +6 -6
  141. package/__mf/js/async/1490.cc0a832d.js +0 -22
  142. package/__mf/js/async/1728.21067e6f.js +0 -1
  143. package/__mf/js/async/3849.d1b5a7aa.js +0 -7
  144. package/__mf/js/async/392.fd3eade4.js +0 -2
  145. package/__mf/js/async/4746.c0ce20c6.js +0 -2
  146. package/__mf/js/async/5214.d2077bec.js +0 -2
  147. package/__mf/js/async/8035.ce79a5fb.js +0 -38
  148. package/__mf/js/async/__federation_expose_TempoExplorer.79065666.js +0 -1
  149. package/__mf/js/async/lib-router.4c755752.js +0 -2
  150. /package/__mf/js/async/{4746.c0ce20c6.js.LICENSE.txt → 1905.d3c01a20.js.LICENSE.txt} +0 -0
  151. /package/__mf/js/async/{392.fd3eade4.js.LICENSE.txt → 392.b27ef564.js.LICENSE.txt} +0 -0
  152. /package/__mf/js/async/{1490.cc0a832d.js.LICENSE.txt → 54.812deb71.js.LICENSE.txt} +0 -0
  153. /package/__mf/js/async/{5214.d2077bec.js.LICENSE.txt → 7902.57efc83f.js.LICENSE.txt} +0 -0
  154. /package/__mf/js/async/{3849.d1b5a7aa.js.LICENSE.txt → 7958.4ba5d596.js.LICENSE.txt} +0 -0
  155. /package/__mf/js/async/{__federation_expose_TempoDatasource.a0c321ab.js.LICENSE.txt → __federation_expose_TempoDatasource.1f9ab43f.js.LICENSE.txt} +0 -0
@@ -1 +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 { getUnixTimeRange } from '../plugins/tempo-trace-query';\nimport { CompletionConfig } from './TraceQLExtension';\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\nconst quoteChars = ['\"', '`'];\nconst defaultQuoteChar = '\"';\n\nexport async function complete(\n completionCfg: CompletionConfig,\n { state, pos }: CompletionContext\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(completionCfg, completions.scopes);\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 = quoteChars.includes(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(completionCfg: CompletionConfig, completions: CompletionScope[]): 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 results.push(completeTagName(completionCfg, completion.scope));\n break;\n\n case 'TagValue':\n results.push(completeTagValue(completionCfg, completion.tag));\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(\n completionCfg: CompletionConfig,\n scope: 'resource' | 'span' | 'intrinsic'\n): Promise<Completion[]> {\n if (!completionCfg.client) {\n return [];\n }\n\n const { start, end } = completionCfg.timeRange ? getUnixTimeRange(completionCfg.timeRange) : {};\n const { limit, maxStaleValues } = completionCfg;\n\n const response = await completionCfg.client.searchTags({ scope, start, end, limit, maxStaleValues });\n return response.scopes.flatMap((scope) => scope.tags).map((tag) => ({ label: tag }));\n}\n\nfunction escapeString(input: string, quoteChar: string) {\n // do not escape raw strings (when using backticks)\n if (quoteChar === '`') {\n return input;\n }\n\n let escaped = input;\n // escape sequences: https://grafana.com/docs/tempo/v2.8.x/traceql/construct-traceql-queries/#quoted-attribute-names\n escaped = escaped.replaceAll('\\\\', '\\\\\\\\');\n escaped = escaped.replaceAll('\"', '\\\\\"');\n return escaped;\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 */\nexport function applyQuotedCompletion(view: EditorView, completion: Completion, from: number, to: number): void {\n let quoteChar = defaultQuoteChar;\n if (quoteChars.includes(view.state.sliceDoc(from - 1, from))) {\n quoteChar = view.state.sliceDoc(from - 1, from);\n from--;\n }\n if (quoteChars.includes(view.state.sliceDoc(to, to + 1))) {\n quoteChar = view.state.sliceDoc(to, to + 1);\n to++;\n }\n\n // When using raw strings (`), we cannot escape a backtick.\n // Therefore, switch the quote character.\n if (completion.label.includes('`')) {\n quoteChar = '\"';\n }\n\n const insertText = `${quoteChar}${escapeString(completion.label, quoteChar)}${quoteChar}`;\n view.dispatch(insertCompletionText(view.state, insertText, from, to));\n}\n\nasync function completeTagValue(completionCfg: CompletionConfig, tag: string): Promise<Completion[]> {\n if (!completionCfg.client) {\n return [];\n }\n\n const { start, end } = completionCfg.timeRange ? getUnixTimeRange(completionCfg.timeRange) : {};\n const { limit, maxStaleValues } = completionCfg;\n\n const response = await completionCfg.client.searchTagValues({ tag, start, end, limit, maxStaleValues });\n const completions: Completion[] = [];\n for (const { type, value } of response.tagValues) {\n switch (type) {\n case 'string':\n completions.push({ label: value ?? '', displayLabel: value ?? '(empty string)', apply: applyQuotedCompletion });\n break;\n\n case 'keyword':\n case 'int':\n completions.push({ label: value ?? '', displayLabel: value ?? '(empty string)' });\n break;\n }\n }\n return completions;\n}\n"],"names":["insertCompletionText","syntaxTree","String","StringType","FieldExpression","AttributeField","Resource","Identifier","Span","SpansetFilter","FieldOp","getUnixTimeRange","quoteChars","defaultQuoteChar","complete","completionCfg","state","pos","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","client","start","end","timeRange","limit","maxStaleValues","response","searchTags","flatMap","tags","map","escapeString","input","quoteChar","escaped","replaceAll","applyQuotedCompletion","view","insertText","dispatch","searchTagValues","value","tagValues","displayLabel","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;AAEhC,SAASC,gBAAgB,QAAQ,+BAA+B;AAmBhE,MAAMC,aAAa;IAAC;IAAK;CAAI;AAC7B,MAAMC,mBAAmB;AAEzB,OAAO,eAAeC,SACpBC,aAA+B,EAC/B,EAAEC,KAAK,EAAEC,GAAG,EAAqB;IAEjC,2FAA2F;IAC3F,MAAMC,cAAcC,oBAAoBH,OAAOC,KAAKhB,WAAWe;IAC/D,IAAI,CAACE,aAAa;QAChB,0DAA0D;QAC1D,OAAO;IACT;IAEA,oFAAoF;IACpF,MAAME,UAAU,MAAMC,gBAAgBN,eA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C;AACnE;AAEA,eAAeyB,iBAAiBlC,aAA+B,EAAEwB,GAAW;IAC1E,IAAI,CAACxB,cAAcqC,MAAM,EAAE;QACzB,OAAO,EAAE;IACX;IAEA,MAAM,EAAEC,KAAK,EAAEC,GAAG,EAAE,GAAGvC,cAAcwC,SAAS,GAAG5C,iBAAiBI,cAAcwC,SAAS,IAAI,CAAC;IAC9F,MAAM,EAAEC,KAAK,EAAEC,cAAc,EAAE,GAAG1C;IAElC,MAAM2C,WAAW,MAAM3C,cAAcqC,MAAM,CAACoB,eAAe,CAAC;QAAEjC;QAAKc;QAAOC;QAAKE;QAAOC;IAAe;IACrG,MAAMvC,cAA4B,EAAE;IACpC,KAAK,MAAM,EAAEU,IAAI,EAAE6C,KAAK,EAAE,IAAIf,SAASgB,SAAS,CAAE;QAChD,OAAQ9C;YACN,KAAK;gBACHV,YAAY0B,IAAI,CAAC;oBAAEG,OAAO0B,SAAS;oBAAIE,cAAcF,SAAS;oBAAkBG,OAAOR;gBAAsB;gBAC7G;YAEF,KAAK;YACL,KAAK;gBACHlD,YAAY0B,IAAI,CAAC;oBAAEG,OAAO0B,SAAS;oBAAIE,cAAcF,SAAS;gBAAiB;gBAC/E;QACJ;IACF;IACA,OAAOvD;AACT"}
1
+ {"version":3,"sources":["../../../src/components/complete.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { 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 { getUnixTimeRange } from '../plugins/tempo-trace-query';\nimport { CompletionConfig } from './TraceQLExtension';\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\nconst quoteChars = ['\"', '`'];\nconst defaultQuoteChar = '\"';\n\nexport async function complete(\n completionCfg: CompletionConfig,\n { state, pos }: CompletionContext\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(completionCfg, completions.scopes);\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 = quoteChars.includes(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(completionCfg: CompletionConfig, completions: CompletionScope[]): 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 results.push(completeTagName(completionCfg, completion.scope));\n break;\n\n case 'TagValue':\n results.push(completeTagValue(completionCfg, completion.tag));\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(\n completionCfg: CompletionConfig,\n scope: 'resource' | 'span' | 'intrinsic'\n): Promise<Completion[]> {\n if (!completionCfg.client) {\n return [];\n }\n\n const { start, end } = completionCfg.timeRange ? getUnixTimeRange(completionCfg.timeRange) : {};\n const { limit, maxStaleValues } = completionCfg;\n\n const response = await completionCfg.client.searchTags({ scope, start, end, limit, maxStaleValues });\n return response.scopes.flatMap((scope) => scope.tags).map((tag) => ({ label: tag }));\n}\n\nfunction escapeString(input: string, quoteChar: string) {\n // do not escape raw strings (when using backticks)\n if (quoteChar === '`') {\n return input;\n }\n\n let escaped = input;\n // escape sequences: https://grafana.com/docs/tempo/v2.8.x/traceql/construct-traceql-queries/#quoted-attribute-names\n escaped = escaped.replaceAll('\\\\', '\\\\\\\\');\n escaped = escaped.replaceAll('\"', '\\\\\"');\n return escaped;\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 */\nexport function applyQuotedCompletion(view: EditorView, completion: Completion, from: number, to: number): void {\n let quoteChar = defaultQuoteChar;\n if (quoteChars.includes(view.state.sliceDoc(from - 1, from))) {\n quoteChar = view.state.sliceDoc(from - 1, from);\n from--;\n }\n if (quoteChars.includes(view.state.sliceDoc(to, to + 1))) {\n quoteChar = view.state.sliceDoc(to, to + 1);\n to++;\n }\n\n // When using raw strings (`), we cannot escape a backtick.\n // Therefore, switch the quote character.\n if (completion.label.includes('`')) {\n quoteChar = '\"';\n }\n\n const insertText = `${quoteChar}${escapeString(completion.label, quoteChar)}${quoteChar}`;\n view.dispatch(insertCompletionText(view.state, insertText, from, to));\n}\n\nasync function completeTagValue(completionCfg: CompletionConfig, tag: string): Promise<Completion[]> {\n if (!completionCfg.client) {\n return [];\n }\n\n const { start, end } = completionCfg.timeRange ? getUnixTimeRange(completionCfg.timeRange) : {};\n const { limit, maxStaleValues } = completionCfg;\n\n const response = await completionCfg.client.searchTagValues({ tag, start, end, limit, maxStaleValues });\n const completions: Completion[] = [];\n for (const { type, value } of response.tagValues) {\n switch (type) {\n case 'string':\n completions.push({ label: value ?? '', displayLabel: value ?? '(empty string)', apply: applyQuotedCompletion });\n break;\n\n case 'keyword':\n case 'int':\n completions.push({ label: value ?? '', displayLabel: value ?? '(empty string)' });\n break;\n }\n }\n return completions;\n}\n"],"names":["insertCompletionText","syntaxTree","String","StringType","FieldExpression","AttributeField","Resource","Identifier","Span","SpansetFilter","FieldOp","getUnixTimeRange","quoteChars","defaultQuoteChar","complete","completionCfg","state","pos","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","client","start","end","timeRange","limit","maxStaleValues","response","searchTags","flatMap","tags","map","escapeString","input","quoteChar","escaped","replaceAll","applyQuotedCompletion","view","insertText","dispatch","searchTagValues","value","tagValues","displayLabel","apply"],"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,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;AAEhC,SAASC,gBAAgB,QAAQ,+BAA+B;AAmBhE,MAAMC,aAAa;IAAC;IAAK;CAAI;AAC7B,MAAMC,mBAAmB;AAEzB,OAAO,eAAeC,SACpBC,aAA+B,EAC/B,EAAEC,KAAK,EAAEC,GAAG,EAAqB;IAEjC,2FAA2F;IAC3F,MAAMC,cAAcC,oBAAoBH,OAAOC,KAAKhB,WAAWe;IAC/D,IAAI,CAACE,aAAa;QAChB,0DAA0D;QAC1D,OAAO;IACT;IAEA,oFAAoF;IACpF,MAAME,UAAU,MAAMC,gBAAgBN,eAAeG,YAAYI,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,CAAC;CACd;AAED,8DAA8D;AAC9D,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,MAAM,YAclD"}
1
+ {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../../src/components/filter/filter.ts"],"names":[],"mappings":"AAaA,oJAAoJ;AACpJ,MAAM,WAAW,MAAM;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,EAAE,aAAa,CAAC;IAC5B,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,8DAA8D;AAC9D,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,MAAM,YAclD"}
@@ -1,3 +1,15 @@
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.
1
13
  /** A model of a filter bar for common tracing attributes. All attributes are combined with AND, the values of an attribute are combined with OR. */ /** split a string by whitespace, except when inside quotes */ export function splitByUnquotedWhitespace(x) {
2
14
  let quote = false;
3
15
  let from = 0;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/filter/filter.ts"],"sourcesContent":["/** A model of a filter bar for common tracing attributes. All attributes are combined with AND, the values of an attribute are combined with OR. */\nexport interface Filter {\n serviceName: string[];\n spanName: string[];\n namespace: string[];\n status: string[];\n spanDuration: DurationField;\n traceDuration: DurationField;\n customMatchers: string[];\n}\n\nexport interface DurationField {\n min?: string;\n max?: string;\n}\n\n/** split a string by whitespace, except when inside quotes */\nexport function splitByUnquotedWhitespace(x: string) {\n let quote = false;\n let from = 0;\n const chunks: string[] = [];\n for (let i = 0; i < x.length; i++) {\n if (x[i] == '\"' && x[i - 1] != '\\\\') {\n quote = !quote;\n } else if (x[i] == ' ' && !quote) {\n chunks.push(x.slice(from, i));\n from = i + 1;\n }\n }\n chunks.push(x.slice(from, x.length));\n return chunks.filter((x) => x);\n}\n"],"names":["splitByUnquotedWhitespace","x","quote","from","chunks","i","length","push","slice","filter"],"mappings":"AAAA,kJAAkJ,GAgBlJ,4DAA4D,GAC5D,OAAO,SAASA,0BAA0BC,CAAS;IACjD,IAAIC,QAAQ;IACZ,IAAIC,OAAO;IACX,MAAMC,SAAmB,EAAE;IAC3B,IAAK,IAAIC,IAAI,GAAGA,IAAIJ,EAAEK,MAAM,EAAED,IAAK;QACjC,IAAIJ,CAAC,CAACI,EAAE,IAAI,OAAOJ,CAAC,CAACI,IAAI,EAAE,IAAI,MAAM;YACnCH,QAAQ,CAACA;QACX,OAAO,IAAID,CAAC,CAACI,EAAE,IAAI,OAAO,CAACH,OAAO;YAChCE,OAAOG,IAAI,CAACN,EAAEO,KAAK,CAACL,MAAME;YAC1BF,OAAOE,IAAI;QACb;IACF;IACAD,OAAOG,IAAI,CAACN,EAAEO,KAAK,CAACL,MAAMF,EAAEK,MAAM;IAClC,OAAOF,OAAOK,MAAM,CAAC,CAACR,IAAMA;AAC9B"}
1
+ {"version":3,"sources":["../../../../src/components/filter/filter.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/** A model of a filter bar for common tracing attributes. All attributes are combined with AND, the values of an attribute are combined with OR. */\nexport interface Filter {\n serviceName: string[];\n spanName: string[];\n namespace: string[];\n status: string[];\n spanDuration: DurationField;\n traceDuration: DurationField;\n customMatchers: string[];\n}\n\nexport interface DurationField {\n min?: string;\n max?: string;\n}\n\n/** split a string by whitespace, except when inside quotes */\nexport function splitByUnquotedWhitespace(x: string) {\n let quote = false;\n let from = 0;\n const chunks: string[] = [];\n for (let i = 0; i < x.length; i++) {\n if (x[i] == '\"' && x[i - 1] != '\\\\') {\n quote = !quote;\n } else if (x[i] == ' ' && !quote) {\n chunks.push(x.slice(from, i));\n from = i + 1;\n }\n }\n chunks.push(x.slice(from, x.length));\n return chunks.filter((x) => x);\n}\n"],"names":["splitByUnquotedWhitespace","x","quote","from","chunks","i","length","push","slice","filter"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,kJAAkJ,GAgBlJ,4DAA4D,GAC5D,OAAO,SAASA,0BAA0BC,CAAS;IACjD,IAAIC,QAAQ;IACZ,IAAIC,OAAO;IACX,MAAMC,SAAmB,EAAE;IAC3B,IAAK,IAAIC,IAAI,GAAGA,IAAIJ,EAAEK,MAAM,EAAED,IAAK;QACjC,IAAIJ,CAAC,CAACI,EAAE,IAAI,OAAOJ,CAAC,CAACI,IAAI,EAAE,IAAI,MAAM;YACnCH,QAAQ,CAACA;QACX,OAAO,IAAID,CAAC,CAACI,EAAE,IAAI,OAAO,CAACH,OAAO;YAChCE,OAAOG,IAAI,CAACN,EAAEO,KAAK,CAACL,MAAME;YAC1BF,OAAOE,IAAI;QACb;IACF;IACAD,OAAOG,IAAI,CAACN,EAAEO,KAAK,CAACL,MAAMF,EAAEK,MAAM;IAClC,OAAOF,OAAOK,MAAM,CAAC,CAACR,IAAMA;AAC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"filter_to_traceql.d.ts","sourceRoot":"","sources":["../../../../src/components/filter/filter_to_traceql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,EAAE,MAAM,UAAU,CAAC;AAEjD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,UAe7C"}
1
+ {"version":3,"file":"filter_to_traceql.d.ts","sourceRoot":"","sources":["../../../../src/components/filter/filter_to_traceql.ts"],"names":[],"mappings":"AAaA,OAAO,EAAiB,MAAM,EAAE,MAAM,UAAU,CAAC;AAEjD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,UAe7C"}
@@ -1,3 +1,15 @@
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.
1
13
  /**
2
14
  * Construct a TraceQL query from a filter.
3
15
  * 1. Creates the matchers, for example 'resource.service.name = "some_value"' or 'resource.service.name =~ "some_value|other_value"'
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/filter/filter_to_traceql.ts"],"sourcesContent":["import { DurationField, Filter } from './filter';\n\n/**\n * Construct a TraceQL query from a filter.\n * 1. Creates the matchers, for example 'resource.service.name = \"some_value\"' or 'resource.service.name =~ \"some_value|other_value\"'\n * 2. Join all matchers with '&&'\n * 3. Return the full TraceQL query, for example '{ resource.service.name = \"some_value\" && name = \"span_name\" }'\n */\nexport function filterToTraceQL(filter: Filter) {\n const matchers: string[] = [\n ...stringMatcher('resource.service.name', filter.serviceName),\n ...stringMatcher('name', filter.spanName),\n ...stringMatcher('resource.k8s.namespace.name', filter.namespace),\n ...intrinsicMatcher('status', filter.status),\n ...durationMatcher('duration', filter.spanDuration),\n ...durationMatcher('traceDuration', filter.traceDuration),\n ...customMatcher(filter.customMatchers),\n ];\n\n if (matchers.length === 0) {\n return '{}';\n }\n return `{ ${matchers.join(' && ')} }`;\n}\n\nfunction escape(q: string) {\n return q.replaceAll('\\\\', '\\\\\\\\').replaceAll('\"', '\\\\\"');\n}\n\nfunction stringMatcher(attribute: string, values: string[]) {\n const escapedValues = values.map(escape);\n if (escapedValues.length > 1) {\n return [`${attribute} =~ \"${escapedValues.join('|')}\"`];\n } else if (escapedValues.length == 1) {\n return [`${attribute} = \"${escapedValues[0]}\"`];\n }\n return [];\n}\n\nfunction intrinsicMatcher(attribute: string, values: string[]) {\n const orConds = values.map((x) => `${attribute} = ${x}`);\n if (orConds.length > 1) {\n return ['(' + orConds.join(' || ') + ')'];\n } else if (orConds.length === 1) {\n return orConds;\n } else {\n return [];\n }\n}\n\nfunction durationMatcher(attribute: string, value: DurationField) {\n const matchers = [];\n if (value.min) {\n matchers.push(`${attribute} >= ${value.min}`);\n }\n if (value.max) {\n matchers.push(`${attribute} <= ${value.max}`);\n }\n return matchers;\n}\n\nfunction customMatcher(customMatchers: string[]) {\n return customMatchers;\n}\n"],"names":["filterToTraceQL","filter","matchers","stringMatcher","serviceName","spanName","namespace","intrinsicMatcher","status","durationMatcher","spanDuration","traceDuration","customMatcher","customMatchers","length","join","escape","q","replaceAll","attribute","values","escapedValues","map","orConds","x","value","min","push","max"],"mappings":"AAEA;;;;;CAKC,GACD,OAAO,SAASA,gBAAgBC,MAAc;IAC5C,MAAMC,WAAqB;WACtBC,cAAc,yBAAyBF,OAAOG,WAAW;WACzD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QACbxB,SAASyB,IAAI,CAAC,GAAGR,UAAU,IAAI,EAAEM,MAAMC,GAAG,EAAE;IAC9C;IACA,IAAID,MAAMG,GAAG,EAAE;QACb1B,SAASyB,IAAI,CAAC,GAAGR,UAAU,IAAI,EAAEM,MAAMG,GAAG,EAAE;IAC9C;IACA,OAAO1B;AACT;AAEA,SAASU,cAAcC,cAAwB;IAC7C,OAAOA;AACT"}
1
+ {"version":3,"sources":["../../../../src/components/filter/filter_to_traceql.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DurationField, Filter } from './filter';\n\n/**\n * Construct a TraceQL query from a filter.\n * 1. Creates the matchers, for example 'resource.service.name = \"some_value\"' or 'resource.service.name =~ \"some_value|other_value\"'\n * 2. Join all matchers with '&&'\n * 3. Return the full TraceQL query, for example '{ resource.service.name = \"some_value\" && name = \"span_name\" }'\n */\nexport function filterToTraceQL(filter: Filter) {\n const matchers: string[] = [\n ...stringMatcher('resource.service.name', filter.serviceName),\n ...stringMatcher('name', filter.spanName),\n ...stringMatcher('resource.k8s.namespace.name', filter.namespace),\n ...intrinsicMatcher('status', filter.status),\n ...durationMatcher('duration', filter.spanDuration),\n ...durationMatcher('traceDuration', filter.traceDuration),\n ...customMatcher(filter.customMatchers),\n ];\n\n if (matchers.length === 0) {\n return '{}';\n }\n return `{ ${matchers.join(' && ')} }`;\n}\n\nfunction escape(q: string) {\n return q.replaceAll('\\\\', '\\\\\\\\').replaceAll('\"', '\\\\\"');\n}\n\nfunction stringMatcher(attribute: string, values: string[]) {\n const escapedValues = values.map(escape);\n if (escapedValues.length > 1) {\n return [`${attribute} =~ \"${escapedValues.join('|')}\"`];\n } else if (escapedValues.length == 1) {\n return [`${attribute} = \"${escapedValues[0]}\"`];\n }\n return [];\n}\n\nfunction intrinsicMatcher(attribute: string, values: string[]) {\n const orConds = values.map((x) => `${attribute} = ${x}`);\n if (orConds.length > 1) {\n return ['(' + orConds.join(' || ') + ')'];\n } else if (orConds.length === 1) {\n return orConds;\n } else {\n return [];\n }\n}\n\nfunction durationMatcher(attribute: string, value: DurationField) {\n const matchers = [];\n if (value.min) {\n matchers.push(`${attribute} >= ${value.min}`);\n }\n if (value.max) {\n matchers.push(`${attribute} <= ${value.max}`);\n }\n return matchers;\n}\n\nfunction customMatcher(customMatchers: string[]) {\n return customMatchers;\n}\n"],"names":["filterToTraceQL","filter","matchers","stringMatcher","serviceName","spanName","namespace","intrinsicMatcher","status","durationMatcher","spanDuration","traceDuration","customMatcher","customMatchers","length","join","escape","q","replaceAll","attribute","values","escapedValues","map","orConds","x","value","min","push","max"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC;;;;;CAKC,GACD,OAAO,SAASA,gBAAgBC,MAAc;IAC5C,MAAMC,WAAqB;WACtBC,cAAc,yBAAyBF,OAAOG,WAAW;WACzDD,cAAc,QAAQF,OAAOI,QAAQ;WACrCF,cAAc,+BAA+BF,OAAOK,SAAS;WAC7DC,iBAAiB,UAAUN,OAAOO,MAAM;WACxCC,gBAAgB,YAAYR,OAAOS,YAAY;WAC/CD,gBAAgB,iBAAiBR,OAAOU,aAAa;WACrDC,cAAcX,OAAOY,cAAc;KACvC;IAED,IAAIX,SAASY,MAAM,KAAK,GAAG;QACzB,OAAO;IACT;IACA,OAAO,CAAC,EAAE,EAAEZ,SAASa,IAAI,CAAC,QAAQ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
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/filter/index.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './filter';\nexport * from './filter_to_traceql';\nexport * from './traceql_to_filter';\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,WAAW;AACzB,cAAc,sBAAsB;AACpC,cAAc,sBAAsB"}
1
+ {"version":3,"sources":["../../../../src/components/filter/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './filter';\nexport * from './filter_to_traceql';\nexport * from './traceql_to_filter';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,WAAW;AACzB,cAAc,sBAAsB;AACpC,cAAc,sBAAsB"}
@@ -1 +1 @@
1
- {"version":3,"file":"traceql_to_filter.d.ts","sourceRoot":"","sources":["../../../../src/components/filter/traceql_to_filter.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,MAAM,EAAE,MAAM,UAAU,CAAC;AAOjD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAcrD"}
1
+ {"version":3,"file":"traceql_to_filter.d.ts","sourceRoot":"","sources":["../../../../src/components/filter/traceql_to_filter.ts"],"names":[],"mappings":"AAcA,OAAO,EAAiB,MAAM,EAAE,MAAM,UAAU,CAAC;AAOjD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAcrD"}
@@ -1,3 +1,15 @@
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.
1
13
  import { AttributeField, FieldExpression, FieldOp, IntrinsicField, Static, parser } from '@grafana/lezer-traceql';
2
14
  /**
3
15
  * Construct a Filter from a TraceQL query.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/filter/traceql_to_filter.ts"],"sourcesContent":["import { AttributeField, FieldExpression, FieldOp, IntrinsicField, Static, parser } from '@grafana/lezer-traceql';\nimport { DurationField, Filter } from './filter';\n\ninterface Matcher {\n operator: string;\n value: string;\n}\n\n/**\n * Construct a Filter from a TraceQL query.\n * 1. Parse the query (using Lezer library) and extract all matchers, e.g. 'some_attribute = \"some_value\"'\n * 2. Create the filter attribute values, a string array with a single value (for 'x = \"y\"') or multiple values (for 'x =~ \"y|z\"')\n * 3. Add the remaining matchers to the set of custom matchers.\n */\nexport function traceQLToFilter(query: string): Filter {\n const matchers = parseQuery(query);\n return {\n serviceName: reverseStringMatcher(matchers['resource.service.name']),\n spanName: reverseStringMatcher(matchers['name']),\n namespace: reverseStringMatcher(matchers['resource.k8s.namespace.name']),\n status: reverseIntrinsicMatcher(matchers['status']),\n spanDuration: reverseDurationMatcher(matchers['duration']),\n traceDuration: reverseDurationMatcher(matchers['traceDuration']),\n customMatchers: reverseCustomMatcher(\n matchers,\n new Set(['resource.service.name', 'name', 'resource.k8s.namespace.name', 'status', 'duration', 'traceDuration'])\n ),\n };\n}\n\nfunction parseQuery(query: string) {\n const matchers: Record<string, Matcher[]> = {};\n let attribute = '';\n let operator = '';\n let value = '';\n\n const syntaxTree = parser.parse(query);\n syntaxTree.iterate({\n enter(node) {\n switch (node.type.id) {\n case AttributeField:\n attribute = query.slice(node.from, node.to);\n return false;\n case IntrinsicField:\n attribute = query.slice(node.from, node.to);\n return false;\n case FieldOp:\n operator = query.slice(node.from, node.to);\n return false;\n case Static:\n value = query.slice(node.from, node.to);\n return false;\n }\n },\n leave(node) {\n if (node.type.id === FieldExpression && node.node.getChild(FieldOp)) {\n const newMatchers = matchers[attribute] ?? [];\n newMatchers.push({ operator, value });\n matchers[attribute] = newMatchers;\n }\n },\n });\n\n return matchers;\n}\n\nfunction unescape(q: string) {\n return q.replaceAll('\\\\\"', '\"').replaceAll('\\\\\\\\', '\\\\');\n}\n\nfunction reverseStringMatcher(matches?: Matcher[]) {\n const values: string[] = [];\n for (const { operator, value } of matches ?? []) {\n const unescaped = unescape(value.slice(1, -1));\n if (operator == '=') {\n values.push(unescaped);\n } else if (operator == '=~') {\n values.push(...unescaped.split('|'));\n }\n }\n return values;\n}\n\nfunction reverseIntrinsicMatcher(matches?: Matcher[]) {\n const values: string[] = [];\n for (const { operator, value } of matches ?? []) {\n if (operator == '=') {\n values.push(value);\n }\n }\n return values;\n}\n\nfunction reverseDurationMatcher(matches?: Matcher[]) {\n const duration: DurationField = {};\n for (const { operator, value } of matches ?? []) {\n if (operator == '>=') {\n duration.min = value;\n } else if (operator == '<=') {\n duration.max = value;\n }\n }\n return duration;\n}\n\nfunction reverseCustomMatcher(matchers: Record<string, Matcher[]>, skipAttrs: Set<string>) {\n const customMatchers: string[] = [];\n for (const [attribute, matches] of Object.entries(matchers)) {\n if (skipAttrs.has(attribute)) {\n continue;\n }\n\n for (const { operator, value } of matches) {\n customMatchers.push(`${attribute}${operator}${value}`);\n }\n }\n return customMatchers;\n}\n"],"names":["AttributeField","FieldExpression","FieldOp","IntrinsicField","Static","parser","traceQLToFilter","query","matchers","parseQuery","serviceName","reverseStringMatcher","spanName","namespace","status","reverseIntrinsicMatcher","spanDuration","reverseDurationMatcher","traceDuration","customMatchers","reverseCustomMatcher","Set","attribute","operator","value","syntaxTree","parse","iterate","enter","node","type","id","slice","from","to","leave","getChild","newMatchers","push","unescape","q","replaceAll","matches","values","unescaped","split","duration","min","max","skipAttrs","Object","entries","has"],"mappings":"AAAA,SAASA,cAAc,EAAEC,eAAe,EAAEC,OAAO,EAAEC,cAAc,EAAEC,MAAM,EAAEC,MAAM,QAAQ,yBAAyB;AAQlH;;;;;CAKC,GACD,OAAO,SAASC,gBAAgBC,KAAa;IAC3C,MAAMC,WAAWC,WAAWF;IAC5B,OAAO;QACLG,aAAaC,qBAAqBH,QAAQ,CAAC,wBAAwB;QACnEI,UAAUD,qBAAqBH,QAAQ,CAAC,OAAO;QAC/CK,WAAWF,qBAAqBH,QAAQ,CAAC,8BAA8B;QACvEM,QAAQC,wBAAwBP,QAAQ,CAAC,SAAS;QAClDQ,cAAcC,uBAAuBT,QAAQ,CAAC,WAAW;QACzDU,eAAeD,uBAAuBT,QAAQ,CAAC,gBAAgB;QAC/DW,gBAAgBC,qBACdZ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AAE,IAAIkB,WAAW,EAAE,CAAE;QAC/C,MAAME,YAAYL,SAASf,MAAMQ,KAAK,CAAC,GAAG,CAAC;QAC3C,IAAIT,YAAY,KAAK;YACnBoB,OAAOL,IAAI,CAACM;QACd,OAAO,IAAIrB,YAAY,MAAM;YAC3BoB,OAAOL,IAAI,IAAIM,UAAUC,KAAK,CAAC;QACjC;IACF;IACA,OAAOF;AACT;AAEA,SAAS5B,wBAAwB2B,OAAmB;IAClD,MAAMC,SAAmB,EAAE;IAC3B,KAAK,MAAM,EAAEpB,QAAQ,EAAEC,KAAK,EAAE,IAAIkB,WAAW,EAAE,CAAE;QAC/C,IAAInB,YAAY,KAAK;YACnBoB,OAAOL,IAAI,CAACd;QACd;IACF;IACA,OAAOmB;AACT;AAEA,SAAS1B,uBAAuByB,OAAmB;IACjD,MAAMI,WAA0B,CAAC;IACjC,KAAK,MAAM,EAAEvB,QAAQ,EAAEC,KAAK,EAAE,IAAIkB,WAAW,EAAE,CAAE;QAC/C,IAAInB,YAAY,MAAM;YACpBuB,SAASC,GAAG,GAAGvB;QACjB,OAAO,IAAID,YAAY,MAAM;YAC3BuB,SAASE,GAAG,GAAGxB;QACjB;IACF;IACA,OAAOsB;AACT;AAEA,SAAS1B,qBAAqBZ,QAAmC,EAAEyC,SAAsB;IACvF,MAAM9B,iBAA2B,EAAE;IACnC,KAAK,MAAM,CAACG,WAAWoB,QAAQ,IAAIQ,OAAOC,OAAO,CAAC3C,UAAW;QAC3D,IAAIyC,UAAUG,GAAG,CAAC9B,YAAY;YAC5B;QACF;QAEA,KAAK,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,IAAIkB,QAAS;YACzCvB,eAAemB,IAAI,CAAC,GAAGhB,YAAYC,WAAWC,OAAO;QACvD;IACF;IACA,OAAOL;AACT"}
1
+ {"version":3,"sources":["../../../../src/components/filter/traceql_to_filter.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { AttributeField, FieldExpression, FieldOp, IntrinsicField, Static, parser } from '@grafana/lezer-traceql';\nimport { DurationField, Filter } from './filter';\n\ninterface Matcher {\n operator: string;\n value: string;\n}\n\n/**\n * Construct a Filter from a TraceQL query.\n * 1. Parse the query (using Lezer library) and extract all matchers, e.g. 'some_attribute = \"some_value\"'\n * 2. Create the filter attribute values, a string array with a single value (for 'x = \"y\"') or multiple values (for 'x =~ \"y|z\"')\n * 3. Add the remaining matchers to the set of custom matchers.\n */\nexport function traceQLToFilter(query: string): Filter {\n const matchers = parseQuery(query);\n return {\n serviceName: reverseStringMatcher(matchers['resource.service.name']),\n spanName: reverseStringMatcher(matchers['name']),\n namespace: reverseStringMatcher(matchers['resource.k8s.namespace.name']),\n status: reverseIntrinsicMatcher(matchers['status']),\n spanDuration: reverseDurationMatcher(matchers['duration']),\n traceDuration: reverseDurationMatcher(matchers['traceDuration']),\n customMatchers: reverseCustomMatcher(\n matchers,\n new Set(['resource.service.name', 'name', 'resource.k8s.namespace.name', 'status', 'duration', 'traceDuration'])\n ),\n };\n}\n\nfunction parseQuery(query: string) {\n const matchers: Record<string, Matcher[]> = {};\n let attribute = '';\n let operator = '';\n let value = '';\n\n const syntaxTree = parser.parse(query);\n syntaxTree.iterate({\n enter(node) {\n switch (node.type.id) {\n case AttributeField:\n attribute = query.slice(node.from, node.to);\n return false;\n case IntrinsicField:\n attribute = query.slice(node.from, node.to);\n return false;\n case FieldOp:\n operator = query.slice(node.from, node.to);\n return false;\n case Static:\n value = query.slice(node.from, node.to);\n return false;\n }\n },\n leave(node) {\n if (node.type.id === FieldExpression && node.node.getChild(FieldOp)) {\n const newMatchers = matchers[attribute] ?? [];\n newMatchers.push({ operator, value });\n matchers[attribute] = newMatchers;\n }\n },\n });\n\n return matchers;\n}\n\nfunction unescape(q: string) {\n return q.replaceAll('\\\\\"', '\"').replaceAll('\\\\\\\\', '\\\\');\n}\n\nfunction reverseStringMatcher(matches?: Matcher[]) {\n const values: string[] = [];\n for (const { operator, value } of matches ?? []) {\n const unescaped = unescape(value.slice(1, -1));\n if (operator == '=') {\n values.push(unescaped);\n } else if (operator == '=~') {\n values.push(...unescaped.split('|'));\n }\n }\n return values;\n}\n\nfunction reverseIntrinsicMatcher(matches?: Matcher[]) {\n const values: string[] = [];\n for (const { operator, value } of matches ?? []) {\n if (operator == '=') {\n values.push(value);\n }\n }\n return values;\n}\n\nfunction reverseDurationMatcher(matches?: Matcher[]) {\n const duration: DurationField = {};\n for (const { operator, value } of matches ?? []) {\n if (operator == '>=') {\n duration.min = value;\n } else if (operator == '<=') {\n duration.max = value;\n }\n }\n return duration;\n}\n\nfunction reverseCustomMatcher(matchers: Record<string, Matcher[]>, skipAttrs: Set<string>) {\n const customMatchers: string[] = [];\n for (const [attribute, matches] of Object.entries(matchers)) {\n if (skipAttrs.has(attribute)) {\n continue;\n }\n\n for (const { operator, value } of matches) {\n customMatchers.push(`${attribute}${operator}${value}`);\n }\n }\n return customMatchers;\n}\n"],"names":["AttributeField","FieldExpression","FieldOp","IntrinsicField","Static","parser","traceQLToFilter","query","matchers","parseQuery","serviceName","reverseStringMatcher","spanName","namespace","status","reverseIntrinsicMatcher","spanDuration","reverseDurationMatcher","traceDuration","customMatchers","reverseCustomMatcher","Set","attribute","operator","value","syntaxTree","parse","iterate","enter","node","type","id","slice","from","to","leave","getChild","newMatchers","push","unescape","q","replaceAll","matches","values","unescaped","split","duration","min","max","skipAttrs","Object","entries","has"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,s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IAAID,YAAY,MAAM;YAC3BuB,SAASE,GAAG,GAAGxB;QACjB;IACF;IACA,OAAOsB;AACT;AAEA,SAAS1B,qBAAqBZ,QAAmC,EAAEyC,SAAsB;IACvF,MAAM9B,iBAA2B,EAAE;IACnC,KAAK,MAAM,CAACG,WAAWoB,QAAQ,IAAIQ,OAAOC,OAAO,CAAC3C,UAAW;QAC3D,IAAIyC,UAAUG,GAAG,CAAC9B,YAAY;YAC5B;QACF;QAEA,KAAK,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,IAAIkB,QAAS;YACzCvB,eAAemB,IAAI,CAAC,GAAGhB,YAAYC,WAAWC,OAAO;QACvD;IACF;IACA,OAAOL;AACT"}
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +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"}
1
+ {"version":3,"sources":["../../../src/components/highlight.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { 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,+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,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"}
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +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 './filter';\nexport * from './TraceQLEditor';\nexport * from './TraceQLExtension';\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,WAAW;AACzB,cAAc,kBAAkB;AAChC,cAAc,qBAAqB"}
1
+ {"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './filter';\nexport * from './TraceQLEditor';\nexport * from './TraceQLExtension';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,WAAW;AACzB,cAAc,kBAAkB;AAChC,cAAc,qBAAqB"}
package/lib/env.d.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
package/lib/env.d.js.map CHANGED
@@ -1 +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"}
1
+ {"version":3,"sources":["../../src/env.d.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/// <reference types=\"@rsbuild/core/types\" />\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,6CAA6C"}
@@ -1 +1 @@
1
- {"version":3,"file":"TempoExplorer.d.ts","sourceRoot":"","sources":["../../../src/explore/TempoExplorer.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AA0H/C,wBAAgB,aAAa,IAAI,YAAY,CA2C5C"}
1
+ {"version":3,"file":"TempoExplorer.d.ts","sourceRoot":"","sources":["../../../src/explore/TempoExplorer.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AA2H/C,wBAAgB,aAAa,IAAI,YAAY,CA2C5C"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- // Copyright 2024 The Perses Authors
2
+ // Copyright The Perses Authors
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
5
5
  // You may obtain a copy of the License at
@@ -11,13 +11,14 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { Alert, Box, Stack } from '@mui/material';
14
+ import { Box, Stack } from '@mui/material';
15
15
  import { ErrorAlert, ErrorBoundary, LoadingOverlay, NoDataOverlay } from '@perses-dev/components';
16
16
  import { isValidTraceId } from '@perses-dev/core';
17
17
  import { Panel } from '@perses-dev/dashboards';
18
18
  import { useExplorerManagerContext } from '@perses-dev/explore';
19
19
  import { DataQueriesProvider, MultiQueryEditor, useDataQueries } from '@perses-dev/plugin-system';
20
20
  import { useState } from 'react';
21
+ import { ClosableAlert } from '../components/ClosableAlert';
21
22
  import { linkToSpan, linkToTrace } from './links';
22
23
  function SearchResultsPanel({ queries }) {
23
24
  const { isFetching, isLoading, queryResults } = useDataQueries('TraceQuery');
@@ -45,6 +46,10 @@ function SearchResultsPanel({ queries }) {
45
46
  },
46
47
  gap: 2,
47
48
  children: [
49
+ hasMoreResults && /*#__PURE__*/ _jsx(ClosableAlert, {
50
+ severity: "warning",
51
+ children: "Not all matching traces are currently visible. Increase the display limit to view more."
52
+ }),
48
53
  /*#__PURE__*/ _jsx(Box, {
49
54
  sx: {
50
55
  height: '35%',
@@ -95,10 +100,6 @@ function SearchResultsPanel({ queries }) {
95
100
  }
96
101
  }
97
102
  }
98
- }),
99
- hasMoreResults && /*#__PURE__*/ _jsx(Alert, {
100
- severity: "info",
101
- children: "Not all matching traces are currently displayed. Increase the result limit to view additional traces."
102
103
  })
103
104
  ]
104
105
  });
@@ -1 +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 { Alert, 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, useState } from 'react';\nimport { TempoTraceQuerySpec } from '../model';\nimport { linkToSpan, linkToTrace } from './links';\n\ninterface TracesExplorerQueryParams {\n queries?: QueryDefinition[];\n spanId?: string;\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 const hasMoreResults = queryResults.some((traceData) => traceData.data?.metadata?.hasMoreResults);\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: {\n queries,\n display: { name: '' },\n plugin: {\n kind: 'ScatterChart',\n spec: {\n link: linkToTrace,\n },\n },\n },\n }}\n />\n </Box>\n <Panel\n sx={{ flexGrow: 1 }}\n panelOptions={{\n hideHeader: true,\n }}\n definition={{\n kind: 'Panel',\n spec: {\n queries,\n display: { name: '' },\n plugin: {\n kind: 'TraceTable',\n spec: {\n links: {\n trace: linkToTrace,\n },\n },\n },\n },\n }}\n />\n {hasMoreResults && (\n <Alert severity=\"info\">\n Not all matching traces are currently displayed. Increase the result limit to view additional traces.\n </Alert>\n )}\n </Stack>\n );\n}\n\ninterface TracingGanttChartPanelProps {\n queries: QueryDefinition[];\n selectedSpanId?: string;\n}\n\nfunction TracingGanttChartPanel(props: TracingGanttChartPanelProps): ReactElement {\n const { queries, selectedSpanId } = props;\n const firstQuery = (queries[0]?.spec.plugin.spec as TempoTraceQuerySpec | undefined)?.query;\n\n return (\n <Panel\n panelOptions={{ showIcons: 'always' }}\n definition={{\n kind: 'Panel',\n spec: {\n queries,\n display: { name: `Trace ${firstQuery}` },\n plugin: {\n kind: 'TracingGanttChart',\n spec: {\n links: {\n trace: linkToTrace,\n span: linkToSpan,\n },\n selectedSpanId,\n },\n },\n },\n }}\n />\n );\n}\n\nexport function TempoExplorer(): ReactElement {\n const {\n data: { queries = [], spanId: selectedSpanId },\n setData,\n } = useExplorerManagerContext<TracesExplorerQueryParams>();\n\n const [queryDefinitions, setQueryDefinitions] = useState<QueryDefinition[]>(queries);\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 const firstQuery = (queries[0]?.spec.plugin.spec as TempoTraceQuerySpec | undefined)?.query;\n const isSingleTrace = isValidTraceId(firstQuery ?? '');\n\n return (\n <Stack gap={2} sx={{ width: '100%' }}>\n <MultiQueryEditor\n queryTypes={['TraceQuery']}\n onChange={(state) => setQueryDefinitions(state)}\n queries={queryDefinitions}\n onQueryRun={() => setData({ queries: queryDefinitions })}\n />\n\n <ErrorBoundary FallbackComponent={ErrorAlert} resetKeys={[queries]}>\n <DataQueriesProvider definitions={definitions}>\n <Box height={700}>\n {isSingleTrace ? (\n <TracingGanttChartPanel queries={queries} selectedSpanId={selectedSpanId} />\n ) : (\n <SearchResultsPanel queries={queries} />\n )}\n </Box>\n </DataQueriesProvider>\n </ErrorBoundary>\n </Stack>\n );\n}\n"],"names":["Alert","Box","Stack","ErrorAlert","ErrorBoundary","LoadingOverlay","NoDataOverlay","isValidTraceId","Panel","useExplorerManagerContext","DataQueriesProvider","MultiQueryEditor","useDataQueries","useState","linkToSpan","linkToTrace","SearchResultsPanel","queries","isFetching","isLoading","queryResults","length","queryError","find","d","error","tracesFound","some","traceData","data","searchResult","resource","hasMoreResults","metadata","sx","height","gap","flexShrink","panelOptions","hideHeader","definition","kind","spec","display","name","plugin","link","flexGrow","links","trace","severity","TracingGanttChartPanel","props","selectedSpanId","firstQuery","query","showIcons","span","TempoExplorer","spanId","setData","queryDefinitions","setQueryDefinitions","definitions","map","isSingleTrace","width","queryTypes","onChange","state","onQueryRun","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,KAAK,EAAEC,GAAG,EAAEC,KAAK,QAAQ,gBAAgB;AAClD,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;AAClG,SAAuBC,QAAQ,QAAQ,QAAQ;AAE/C,SAASC,UAAU,EAAEC,WAAW,QAAQ,UAAU;AAWlD,SAASC,mBAAmB,EAAEC,OAAO,EAA2B;IAC9D,MAAM,EAAEC,UAAU,EAAEC,SAAS,EAAEC,YAAY,EAAE,GAAGR,eAAe;IAE/D,sCAAsC;IACtC,IAAIQ,aAAaC,MAAM,KAAK,GAAG;QAC7B,qBAAO;IACT;IAEA,IAAIF,aAAaD,YAAY;QAC3B,qBAAO,KAACb;IACV;IAEA,MAAMiB,aAAaF,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BAAmBC,SAASA;;;;;;;AAO3C"}
1
+ {"version":3,"sources":["../../../src/explore/TempoExplorer.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 { 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, useState } from 'react';\nimport { TempoTraceQuerySpec } from '../model';\nimport { ClosableAlert } from '../components/ClosableAlert';\nimport { linkToSpan, linkToTrace } from './links';\n\ninterface TracesExplorerQueryParams {\n queries?: QueryDefinition[];\n spanId?: string;\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 const hasMoreResults = queryResults.some((traceData) => traceData.data?.metadata?.hasMoreResults);\n\n return (\n <Stack sx={{ height: '100%' }} gap={2}>\n {hasMoreResults && (\n <ClosableAlert severity=\"warning\">\n Not all matching traces are currently visible. Increase the display limit to view more.\n </ClosableAlert>\n )}\n <Box sx={{ height: '35%', flexShrink: 0 }}>\n <Panel\n panelOptions={{\n hideHeader: true,\n }}\n definition={{\n kind: 'Panel',\n spec: {\n queries,\n display: { name: '' },\n plugin: {\n kind: 'ScatterChart',\n spec: {\n link: linkToTrace,\n },\n },\n },\n }}\n />\n </Box>\n <Panel\n sx={{ flexGrow: 1 }}\n panelOptions={{\n hideHeader: true,\n }}\n definition={{\n kind: 'Panel',\n spec: {\n queries,\n display: { name: '' },\n plugin: {\n kind: 'TraceTable',\n spec: {\n links: {\n trace: linkToTrace,\n },\n },\n },\n },\n }}\n />\n </Stack>\n );\n}\n\ninterface TracingGanttChartPanelProps {\n queries: QueryDefinition[];\n selectedSpanId?: string;\n}\n\nfunction TracingGanttChartPanel(props: TracingGanttChartPanelProps): ReactElement {\n const { queries, selectedSpanId } = props;\n const firstQuery = (queries[0]?.spec.plugin.spec as TempoTraceQuerySpec | undefined)?.query;\n\n return (\n <Panel\n panelOptions={{ showIcons: 'always' }}\n definition={{\n kind: 'Panel',\n spec: {\n queries,\n display: { name: `Trace ${firstQuery}` },\n plugin: {\n kind: 'TracingGanttChart',\n spec: {\n links: {\n trace: linkToTrace,\n span: linkToSpan,\n },\n selectedSpanId,\n },\n },\n },\n }}\n />\n );\n}\n\nexport function TempoExplorer(): ReactElement {\n const {\n data: { queries = [], spanId: selectedSpanId },\n setData,\n } = useExplorerManagerContext<TracesExplorerQueryParams>();\n\n const [queryDefinitions, setQueryDefinitions] = useState<QueryDefinition[]>(queries);\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 const firstQuery = (queries[0]?.spec.plugin.spec as TempoTraceQuerySpec | undefined)?.query;\n const isSingleTrace = isValidTraceId(firstQuery ?? '');\n\n return (\n <Stack gap={2} sx={{ width: '100%' }}>\n <MultiQueryEditor\n queryTypes={['TraceQuery']}\n onChange={(state) => setQueryDefinitions(state)}\n queries={queryDefinitions}\n onQueryRun={() => setData({ queries: queryDefinitions })}\n />\n\n <ErrorBoundary FallbackComponent={ErrorAlert} resetKeys={[queries]}>\n <DataQueriesProvider definitions={definitions}>\n <Box height={700}>\n {isSingleTrace ? (\n <TracingGanttChartPanel queries={queries} selectedSpanId={selectedSpanId} />\n ) : (\n <SearchResultsPanel queries={queries} />\n )}\n </Box>\n </DataQueriesProvider>\n </ErrorBoundary>\n </Stack>\n );\n}\n"],"names":["Box","Stack","ErrorAlert","ErrorBoundary","LoadingOverlay","NoDataOverlay","isValidTraceId","Panel","useExplorerManagerContext","DataQueriesProvider","MultiQueryEditor","useDataQueries","useState","ClosableAlert","linkToSpan","linkToTrace","SearchResultsPanel","queries","isFetching","isLoading","queryResults","length","queryError","find","d","error","tracesFound","some","traceData","data","searchResult","resource","hasMoreResults","metadata","sx","height","gap","severity","flexShrink","panelOptions","hideHeader","definition","kind","spec","display","name","plugin","link","flexGrow","links","trace","TracingGanttChartPanel","props","selectedSpanId","firstQuery","query","showIcons","span","TempoExplorer","spanId","setData","queryDefinitions","setQueryDefinitions","definitions","map","isSingleTrace","width","queryTypes","onChange","state","onQueryRun","FallbackComponent","resetKeys"],"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,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,y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,gBAAgB3D,eAAegD,cAAc;IAEnD,qBACE,MAACrD;QAAMmC,KAAK;QAAGF,IAAI;YAAEgC,OAAO;QAAO;;0BACjC,KAACxD;gBACCyD,YAAY;oBAAC;iBAAa;gBAC1BC,UAAU,CAACC,QAAUP,oBAAoBO;gBACzCpD,SAAS4C;gBACTS,YAAY,IAAMV,QAAQ;wBAAE3C,SAAS4C;oBAAiB;;0BAGxD,KAAC1D;gBAAcoE,mBAAmBrE;gBAAYsE,WAAW;oBAACvD;iBAAQ;0BAChE,cAAA,KAACR;oBAAoBsD,aAAaA;8BAChC,cAAA,KAAC/D;wBAAImC,QAAQ;kCACV8B,8BACC,KAACd;4BAAuBlC,SAASA;4BAASoC,gBAAgBA;2CAE1D,KAACrC;4BAAmBC,SAASA;;;;;;;AAO3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/explore/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/explore/index.ts"],"names":[],"mappings":"AAaA,cAAc,iBAAiB,CAAC"}
@@ -1,3 +1,15 @@
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.
1
13
  export * from './TempoExplorer';
2
14
 
3
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/explore/index.ts"],"sourcesContent":["export * from './TempoExplorer';\n"],"names":[],"mappings":"AAAA,cAAc,kBAAkB"}
1
+ {"version":3,"sources":["../../../src/explore/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './TempoExplorer';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,kBAAkB"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/explore/links.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nconst linkToTraceParams = new URLSearchParams({\n explorer: 'Tempo-TempoExplorer',\n data: JSON.stringify({\n queries: [\n {\n kind: 'TraceQuery',\n spec: {\n plugin: {\n kind: 'TempoTraceQuery',\n spec: {\n query: 'TRACEID',\n datasource: {\n kind: 'TempoDatasource',\n name: 'DATASOURCENAME',\n },\n },\n },\n },\n },\n ],\n }),\n});\n\nconst linkToSpanParams = new URLSearchParams({\n explorer: 'Tempo-TempoExplorer',\n data: JSON.stringify({\n queries: [\n {\n kind: 'TraceQuery',\n spec: {\n plugin: {\n kind: 'TempoTraceQuery',\n spec: {\n query: 'TRACEID',\n datasource: {\n kind: 'TempoDatasource',\n name: 'DATASOURCENAME',\n },\n },\n },\n },\n },\n ],\n spanId: 'SPANID',\n }),\n});\n\n// add ${...} syntax after the URL is URL-encoded, because the characters ${} must not be URL-encoded\nexport const linkToTrace = `/explore?${linkToTraceParams}`\n .replace('DATASOURCENAME', '${datasourceName}')\n .replace('TRACEID', '${traceId}');\n\n// add ${...} syntax after the URL is URL-encoded, because the characters ${} must not be URL-encoded\nexport const linkToSpan = `/explore?${linkToSpanParams}`\n .replace('DATASOURCENAME', '${datasourceName}')\n .replace('TRACEID', '${traceId}')\n .replace('SPANID', '${spanId}');\n"],"names":["linkToTraceParams","URLSearchParams","explorer","data","JSON","stringify","queries","kind","spec","plugin","query","datasource","name","linkToSpanParams","spanId","linkToTrace","replace","linkToSpan"],"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,MAAMA,oBAAoB,IAAIC,gBAAgB;IAC5CC,UAAU;IACVC,MAAMC,KAAKC,SAAS,CAAC;QACnBC,SAAS;YACP;gBACEC,MAAM;gBACNC,MAAM;oBACJC,QAAQ;wBACNF,MAAM;wBACNC,MAAM;4BACJE,OAAO;4BACPC,YAAY;gCACVJ,MAAM;gCACNK,MAAM;4BACR;wBACF;oBACF;gBACF;YACF;SACD;IACH;AACF;AAEA,MAAMC,mBAAmB,IAAIZ,gBAAgB;IAC3CC,UAAU;IACVC,MAAMC,KAAKC,SAAS,CAAC;QACnBC,SAAS;YACP;gBACEC,MAAM;gBACNC,MAAM;oBACJC,QAAQ;wBACNF,MAAM;wBACNC,MAAM;4BACJE,OAAO;4BACPC,YAAY;gCACVJ,MAAM;gCACNK,MAAM;4BACR;wBACF;oBACF;gBACF;YACF;SACD;QACDE,QAAQ;IACV;AACF;AAEA,qGAAqG;AACrG,OAAO,MAAMC,cAAc,CAAC,SAAS,EAAEf,mBAAmB,CACvDgB,OAAO,CAAC,kBAAkB,qBAC1BA,OAAO,CAAC,WAAW,cAAc;AAEpC,qGAAqG;AACrG,OAAO,MAAMC,aAAa,CAAC,SAAS,EAAEJ,kBAAkB,CACrDG,OAAO,CAAC,kBAAkB,qBAC1BA,OAAO,CAAC,WAAW,cACnBA,OAAO,CAAC,UAAU,aAAa"}
1
+ {"version":3,"sources":["../../../src/explore/links.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nconst linkToTraceParams = new URLSearchParams({\n explorer: 'Tempo-TempoExplorer',\n data: JSON.stringify({\n queries: [\n {\n kind: 'TraceQuery',\n spec: {\n plugin: {\n kind: 'TempoTraceQuery',\n spec: {\n query: 'TRACEID',\n datasource: {\n kind: 'TempoDatasource',\n name: 'DATASOURCENAME',\n },\n },\n },\n },\n },\n ],\n }),\n});\n\nconst linkToSpanParams = new URLSearchParams({\n explorer: 'Tempo-TempoExplorer',\n data: JSON.stringify({\n queries: [\n {\n kind: 'TraceQuery',\n spec: {\n plugin: {\n kind: 'TempoTraceQuery',\n spec: {\n query: 'TRACEID',\n datasource: {\n kind: 'TempoDatasource',\n name: 'DATASOURCENAME',\n },\n },\n },\n },\n },\n ],\n spanId: 'SPANID',\n }),\n});\n\n// add ${...} syntax after the URL is URL-encoded, because the characters ${} must not be URL-encoded\nexport const linkToTrace = `/explore?${linkToTraceParams}`\n .replace('DATASOURCENAME', '${datasourceName}')\n .replace('TRACEID', '${traceId}');\n\n// add ${...} syntax after the URL is URL-encoded, because the characters ${} must not be URL-encoded\nexport const linkToSpan = `/explore?${linkToSpanParams}`\n .replace('DATASOURCENAME', '${datasourceName}')\n .replace('TRACEID', '${traceId}')\n .replace('SPANID', '${spanId}');\n"],"names":["linkToTraceParams","URLSearchParams","explorer","data","JSON","stringify","queries","kind","spec","plugin","query","datasource","name","linkToSpanParams","spanId","linkToTrace","replace","linkToSpan"],"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,MAAMA,oBAAoB,IAAIC,gBAAgB;IAC5CC,UAAU;IACVC,MAAMC,KAAKC,SAAS,CAAC;QACnBC,SAAS;YACP;gBACEC,MAAM;gBACNC,MAAM;oBACJC,QAAQ;wBACNF,MAAM;wBACNC,MAAM;4BACJE,OAAO;4BACPC,YAAY;gCACVJ,MAAM;gCACNK,MAAM;4BACR;wBACF;oBACF;gBACF;YACF;SACD;IACH;AACF;AAEA,MAAMC,mBAAmB,IAAIZ,gBAAgB;IAC3CC,UAAU;IACVC,MAAMC,KAAKC,SAAS,CAAC;QACnBC,SAAS;YACP;gBACEC,MAAM;gBACNC,MAAM;oBACJC,QAAQ;wBACNF,MAAM;wBACNC,MAAM;4BACJE,OAAO;4BACPC,YAAY;gCACVJ,MAAM;gCACNK,MAAM;4BACR;wBACF;oBACF;gBACF;YACF;SACD;QACDE,QAAQ;IACV;AACF;AAEA,qGAAqG;AACrG,OAAO,MAAMC,cAAc,CAAC,SAAS,EAAEf,mBAAmB,CACvDgB,OAAO,CAAC,kBAAkB,qBAC1BA,OAAO,CAAC,WAAW,cAAc;AAEpC,qGAAqG;AACrG,OAAO,MAAMC,aAAa,CAAC,SAAS,EAAEJ,kBAAkB,CACrDG,OAAO,CAAC,kBAAkB,qBAC1BA,OAAO,CAAC,WAAW,cACnBA,OAAO,CAAC,UAAU,aAAa"}
@@ -1 +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"}
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"}
@@ -1,3 +1,15 @@
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.
1
13
  import packageJson from '../package.json';
2
14
  /**
3
15
  * Returns the plugin module information from package.json
@@ -1 +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"}
1
+ {"version":3,"sources":["../../src/getPluginModule.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { 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":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,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"}
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
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"}
1
+ {"version":3,"sources":["../../src/index-federation.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport('./bootstrap');\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,MAAM,CAAC"}
@@ -1 +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"}
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 CHANGED
@@ -1,3 +1,15 @@
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.
1
13
  export { getPluginModule } from './getPluginModule';
2
14
  export * from './components';
3
15
  export * from './explore';
package/lib/index.js.map CHANGED
@@ -1 +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
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport { getPluginModule } from './getPluginModule';\nexport * from './components';\nexport * from './explore';\nexport * from './model';\nexport * from './plugins';\n"],"names":["getPluginModule"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,eAAe,QAAQ,oBAAoB;AACpD,cAAc,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,UAAU;AACxB,cAAc,YAAY"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at