@perses-dev/tempo-plugin 0.0.0-snapshot-scatter-chart-embed-8efdfab → 0.0.0-snapshot-scatterplot-fix-imports-95e1b59

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 (36) hide show
  1. package/dist/cjs/index.js +3 -3
  2. package/dist/cjs/model/tempo-client.js +4 -4
  3. package/dist/cjs/model/tempo-selectors.js +3 -3
  4. package/dist/cjs/plugins/tempo-datasource.js +2 -2
  5. package/dist/cjs/plugins/tempo-trace-query/DashboardTempoTraceQueryEditor.js +1 -1
  6. package/dist/cjs/plugins/tempo-trace-query/TempoTraceQueryEditor.js +4 -4
  7. package/dist/cjs/plugins/tempo-trace-query/get-trace-data.js +5 -5
  8. package/dist/cjs/plugins/tempo-trace-query/query-editor-model.js +1 -1
  9. package/dist/model/api-types.js +5 -1
  10. package/dist/model/api-types.js.map +1 -1
  11. package/dist/model/tempo-client.js.map +1 -1
  12. package/dist/model/tempo-selectors.js.map +1 -1
  13. package/dist/model/trace-query-model.js +3 -1
  14. package/dist/model/trace-query-model.js.map +1 -1
  15. package/dist/plugins/get-trace-data.js.map +1 -1
  16. package/dist/plugins/tempo-datasource-types.js.map +1 -1
  17. package/dist/plugins/tempo-datasource.js +2 -2
  18. package/dist/plugins/tempo-datasource.js.map +1 -1
  19. package/dist/plugins/tempo-trace-query/DashboardTempoTraceQueryEditor.d.ts +1 -2
  20. package/dist/plugins/tempo-trace-query/DashboardTempoTraceQueryEditor.d.ts.map +1 -1
  21. package/dist/plugins/tempo-trace-query/DashboardTempoTraceQueryEditor.js +1 -1
  22. package/dist/plugins/tempo-trace-query/DashboardTempoTraceQueryEditor.js.map +1 -1
  23. package/dist/plugins/tempo-trace-query/TempoTraceQueryEditor.d.ts +1 -2
  24. package/dist/plugins/tempo-trace-query/TempoTraceQueryEditor.d.ts.map +1 -1
  25. package/dist/plugins/tempo-trace-query/TempoTraceQueryEditor.js +4 -4
  26. package/dist/plugins/tempo-trace-query/TempoTraceQueryEditor.js.map +1 -1
  27. package/dist/plugins/tempo-trace-query/TraceQLEditor.d.ts +1 -2
  28. package/dist/plugins/tempo-trace-query/TraceQLEditor.d.ts.map +1 -1
  29. package/dist/plugins/tempo-trace-query/TraceQLEditor.js.map +1 -1
  30. package/dist/plugins/tempo-trace-query/get-trace-data.js +2 -2
  31. package/dist/plugins/tempo-trace-query/get-trace-data.js.map +1 -1
  32. package/dist/plugins/tempo-trace-query/query-editor-model.d.ts +1 -1
  33. package/dist/plugins/tempo-trace-query/query-editor-model.d.ts.map +1 -1
  34. package/dist/plugins/tempo-trace-query/query-editor-model.js +1 -1
  35. package/dist/plugins/tempo-trace-query/query-editor-model.js.map +1 -1
  36. package/package.json +4 -4
package/dist/cjs/index.js CHANGED
@@ -21,11 +21,11 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- TempoTraceQuery: function() {
25
- return _TempoTraceQuery.TempoTraceQuery;
26
- },
27
24
  TempoDatasource: function() {
28
25
  return _tempodatasource.TempoDatasource;
26
+ },
27
+ TempoTraceQuery: function() {
28
+ return _TempoTraceQuery.TempoTraceQuery;
29
29
  }
30
30
  });
31
31
  const _tempodatasource = require("./plugins/tempo-datasource");
@@ -24,14 +24,14 @@ _export(exports, {
24
24
  executeRequest: function() {
25
25
  return executeRequest;
26
26
  },
27
- searchTraceQuery: function() {
28
- return searchTraceQuery;
27
+ getEnrichedTraceQuery: function() {
28
+ return getEnrichedTraceQuery;
29
29
  },
30
30
  searchTraceID: function() {
31
31
  return searchTraceID;
32
32
  },
33
- getEnrichedTraceQuery: function() {
34
- return getEnrichedTraceQuery;
33
+ searchTraceQuery: function() {
34
+ return searchTraceQuery;
35
35
  }
36
36
  });
37
37
  const _core = require("@perses-dev/core");
@@ -21,12 +21,12 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- TEMPO_DATASOURCE_KIND: function() {
25
- return TEMPO_DATASOURCE_KIND;
26
- },
27
24
  DEFAULT_TEMPO: function() {
28
25
  return DEFAULT_TEMPO;
29
26
  },
27
+ TEMPO_DATASOURCE_KIND: function() {
28
+ return TEMPO_DATASOURCE_KIND;
29
+ },
30
30
  isDefaultTempoSelector: function() {
31
31
  return isDefaultTempoSelector;
32
32
  },
@@ -24,8 +24,8 @@ const _tempoclient = require("../model/tempo-client");
24
24
  /**
25
25
  * Creates a TempoClient for a specific datasource spec.
26
26
  */ const createClient = (spec, options)=>{
27
- const { directUrl } = spec;
28
- const { proxyUrl } = options;
27
+ const { directUrl } = spec;
28
+ const { proxyUrl } = options;
29
29
  // Use the direct URL if specified, but fallback to the proxyUrl by default if not specified
30
30
  const datasourceUrl = directUrl !== null && directUrl !== void 0 ? directUrl : proxyUrl;
31
31
  if (datasourceUrl === undefined) {
@@ -26,7 +26,7 @@ const _pluginsystem = require("@perses-dev/plugin-system");
26
26
  const _temposelectors = require("../../model/tempo-selectors");
27
27
  const _TraceQLEditor = require("./TraceQLEditor");
28
28
  function DashboardTempoTraceQueryEditor(props) {
29
- const { selectedDatasource , handleDatasourceChange , datasourceURL , query , handleQueryChange , handleQueryBlur } = props;
29
+ const { selectedDatasource, handleDatasourceChange, datasourceURL, query, handleQueryChange, handleQueryBlur } = props;
30
30
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
31
31
  spacing: 2,
32
32
  children: [
@@ -27,12 +27,12 @@ const _temposelectors = require("../../model/tempo-selectors");
27
27
  const _queryeditormodel = require("./query-editor-model");
28
28
  const _DashboardTempoTraceQueryEditor = require("./DashboardTempoTraceQueryEditor");
29
29
  function TempoTraceQueryEditor(props) {
30
- const { onChange , value } = props;
31
- const { datasource } = value;
30
+ const { onChange, value } = props;
31
+ const { datasource } = value;
32
32
  const selectedDatasource = datasource !== null && datasource !== void 0 ? datasource : _temposelectors.DEFAULT_TEMPO;
33
- const { data: client } = (0, _pluginsystem.useDatasourceClient)(selectedDatasource);
33
+ const { data: client } = (0, _pluginsystem.useDatasourceClient)(selectedDatasource);
34
34
  const datasourceURL = client === null || client === void 0 ? void 0 : client.options.datasourceUrl;
35
- const { query , handleQueryChange , handleQueryBlur } = (0, _queryeditormodel.useQueryState)(props);
35
+ const { query, handleQueryChange, handleQueryBlur } = (0, _queryeditormodel.useQueryState)(props);
36
36
  const handleDatasourceChange = (next)=>{
37
37
  if ((0, _temposelectors.isTempoDatasourceSelector)(next)) {
38
38
  onChange((0, _immer.produce)(value, (draft)=>{
@@ -21,17 +21,17 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- getUnixTimeRange: function() {
25
- return getUnixTimeRange;
26
- },
27
24
  getTraceData: function() {
28
25
  return getTraceData;
26
+ },
27
+ getUnixTimeRange: function() {
28
+ return getUnixTimeRange;
29
29
  }
30
30
  });
31
31
  const _datefns = require("date-fns");
32
32
  const _temposelectors = require("../../model/tempo-selectors");
33
33
  function getUnixTimeRange(timeRange) {
34
- const { start , end } = timeRange;
34
+ const { start, end } = timeRange;
35
35
  return {
36
36
  start: Math.ceil((0, _datefns.getUnixTime)(start)),
37
37
  end: Math.ceil((0, _datefns.getUnixTime)(end))
@@ -68,7 +68,7 @@ const getTraceData = async (spec, context)=>{
68
68
  return spec.query;
69
69
  }
70
70
  // handle time range selection from UI drop down (e.g. last 5 minutes, last 1 hour )
71
- const { start , end } = getUnixTimeRange(context === null || context === void 0 ? void 0 : context.absoluteTimeRange);
71
+ const { start, end } = getUnixTimeRange(context === null || context === void 0 ? void 0 : context.absoluteTimeRange);
72
72
  const queryStartTime = '&start=' + start;
73
73
  const queryEndTime = '&end=' + end;
74
74
  const queryWithTimeRange = encodeURI(spec.query) + queryStartTime + queryEndTime;
@@ -23,7 +23,7 @@ Object.defineProperty(exports, "useQueryState", {
23
23
  const _react = require("react");
24
24
  const _immer = require("immer");
25
25
  function useQueryState(props) {
26
- const { onChange , value } = props;
26
+ const { onChange, value } = props;
27
27
  // Local copy of the query's value
28
28
  const [query, setQuery] = (0, _react.useState)(value.query);
29
29
  // This is basically "getDerivedStateFromProps" to make sure if spec's value changes external to this component,
@@ -10,6 +10,10 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export { };
13
+ /**
14
+ * Combined Response of Tempo HTTP API endpoint GET /api/search/<query>
15
+ * and GET /api/traces/<traceID>. For each trace returned from GET /api/search/<query>
16
+ * a detailed trace report is fetched from GET /api/traces/<traceID>.
17
+ */ export { };
14
18
 
15
19
  //# sourceMappingURL=api-types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/api-types.ts"],"sourcesContent":["// Copyright 2023 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 interface Span {\n startTimeUnixNano: string;\n spanId?: string; // Span from api/search/<query>\n spanID?: string; // Span from api/traces/<traceID>\n attributes?: Attribute[];\n durationNanos?: string;\n endTimeUnixNano?: string;\n kind?: string;\n name?: string;\n parentSpanId?: string;\n status?: {\n code?: string;\n };\n traceId?: string;\n}\n\nexport interface Trace {\n traceID: string;\n rootServiceName: string;\n rootTraceName: string;\n startTimeUnixNano: string;\n durationMs: number;\n spanSets?: Array<{\n spans: Span[];\n matched: number;\n }>;\n}\n\n/**\n * Response of Tempo HTTP API endpoint GET /api/search/<query>\n */\nexport interface SearchTraceQueryResponse {\n traces: Trace[];\n}\n\nexport interface Attribute {\n key: string;\n value: {\n stringValue?: string;\n intValue?: string;\n };\n}\n\nexport interface ScopeSpan {\n scope: {\n name: string;\n };\n spans: Span[];\n}\n\nexport interface Batch {\n resource: {\n attributes: Attribute[];\n };\n scopeSpans: ScopeSpan[];\n}\n\n/**\n * Response of Tempo HTTP API endpoint GET /api/traces/<traceID>\n */\nexport interface SearchTraceIDResponse {\n batches: Batch[];\n}\n\n/**\n * Combined Response of Tempo HTTP API endpoint GET /api/search/<query>\n * and GET /api/traces/<traceID>. For each trace returned from GET /api/search/<query>\n * a detailed trace report is fetched from GET /api/traces/<traceID>.\n */\nexport interface EnrichedTraceQueryResponse {\n query: string;\n traces: Array<{\n spanCount: number;\n errorCount: number;\n summary: Trace;\n traceDetails: SearchTraceIDResponse;\n }>;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WA6EC"}
1
+ {"version":3,"sources":["../../src/model/api-types.ts"],"sourcesContent":["// Copyright 2023 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 interface Span {\n startTimeUnixNano: string;\n spanId?: string; // Span from api/search/<query>\n spanID?: string; // Span from api/traces/<traceID>\n attributes?: Attribute[];\n durationNanos?: string;\n endTimeUnixNano?: string;\n kind?: string;\n name?: string;\n parentSpanId?: string;\n status?: {\n code?: string;\n };\n traceId?: string;\n}\n\nexport interface Trace {\n traceID: string;\n rootServiceName: string;\n rootTraceName: string;\n startTimeUnixNano: string;\n durationMs: number;\n spanSets?: Array<{\n spans: Span[];\n matched: number;\n }>;\n}\n\n/**\n * Response of Tempo HTTP API endpoint GET /api/search/<query>\n */\nexport interface SearchTraceQueryResponse {\n traces: Trace[];\n}\n\nexport interface Attribute {\n key: string;\n value: {\n stringValue?: string;\n intValue?: string;\n };\n}\n\nexport interface ScopeSpan {\n scope: {\n name: string;\n };\n spans: Span[];\n}\n\nexport interface Batch {\n resource: {\n attributes: Attribute[];\n };\n scopeSpans: ScopeSpan[];\n}\n\n/**\n * Response of Tempo HTTP API endpoint GET /api/traces/<traceID>\n */\nexport interface SearchTraceIDResponse {\n batches: Batch[];\n}\n\n/**\n * Combined Response of Tempo HTTP API endpoint GET /api/search/<query>\n * and GET /api/traces/<traceID>. For each trace returned from GET /api/search/<query>\n * a detailed trace report is fetched from GET /api/traces/<traceID>.\n */\nexport interface EnrichedTraceQueryResponse {\n query: string;\n traces: Array<{\n spanCount: number;\n errorCount: number;\n summary: Trace;\n traceDetails: SearchTraceIDResponse;\n }>;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAkEjC;;;;CAIC,GACD,WAQC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/tempo-client.ts"],"sourcesContent":["// Copyright 2023 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 { fetch, RequestHeaders } from '@perses-dev/core';\nimport { DatasourceClient } from '@perses-dev/plugin-system';\nimport { SearchTraceIDResponse, EnrichedTraceQueryResponse, SearchTraceQueryResponse } from './api-types';\n\ninterface TempoClientOptions {\n datasourceUrl: string;\n headers?: RequestHeaders;\n}\n\nexport interface TempoClient extends DatasourceClient {\n options: TempoClientOptions;\n getEnrichedTraceQuery(query: string, datasourceUrl: string): Promise<EnrichedTraceQueryResponse>;\n searchTraceQuery(query: string, datasourceUrl: string): Promise<SearchTraceQueryResponse>;\n searchTraceID(traceID: string, datasourceUrl: string): Promise<SearchTraceIDResponse>;\n}\n\nexport const executeRequest = async <T>(url: string): Promise<T> => {\n const response = await fetch(url);\n const jsonData = await response.json();\n return jsonData;\n};\n\nfunction fetchWithGet<TResponse>(apiURI: string, datasourceUrl: string) {\n const url = `${datasourceUrl}${apiURI}`;\n return executeRequest<TResponse>(url);\n}\n\n/**\n * Returns a summary report of traces that satisfy the query.\n */\nexport function searchTraceQuery(query: string, datasourceUrl: string) {\n return fetchWithGet<SearchTraceQueryResponse>(`/api/search?q=${query}`, datasourceUrl);\n}\n\n/**\n * Returns a detailed report, including all the spans, for a given trace.\n */\nexport function searchTraceID(traceID: string, datasourceUrl: string) {\n return fetchWithGet<SearchTraceIDResponse>(`/api/traces/${traceID}`, datasourceUrl);\n}\n\n/**\n * Combined response of Tempo HTTP API endpoints GET /api/search/<query>\n * and GET /api/traces/<traceID>. For each trace returned from GET /api/search/<query>\n * a detailed trace report is fetched from GET /api/traces/<traceID>. This is a\n * temporary workaround to obtain the total number of spans and total number\n * of errors for a trace.\n *\n * TODO: This workaround should be replaced once this issue,\n * https://github.com/grafana/tempo/issues/2940, is resolved upstream in\n * Tempo.\n */\nexport async function getEnrichedTraceQuery(query: string, datasourceUrl: string): Promise<EnrichedTraceQueryResponse> {\n // Get a list of traces that satisfy the query.\n const searchResponse = await searchTraceQuery(query, datasourceUrl);\n if (!searchResponse.traces) {\n return { query, traces: [] };\n }\n\n return {\n query,\n traces: await Promise.all(\n searchResponse.traces.map(async (trace) => {\n let spanCount = 0;\n let errorCount = 0;\n const searchTraceIDResponse = await searchTraceID(trace.traceID, datasourceUrl);\n\n // For every trace, get the full trace, and find the total number of spans and errors.\n for (const batch of searchTraceIDResponse.batches) {\n for (const scopeSpan of batch.scopeSpans) {\n spanCount += scopeSpan.spans.length;\n for (const span of scopeSpan.spans) {\n if (span.status?.code) {\n errorCount++;\n }\n }\n }\n }\n\n return {\n summary: trace,\n traceDetails: searchTraceIDResponse,\n spanCount,\n errorCount,\n };\n })\n ),\n };\n}\n"],"names":["fetch","executeRequest","url","response","jsonData","json","fetchWithGet","apiURI","datasourceUrl","searchTraceQuery","query","searchTraceID","traceID","getEnrichedTraceQuery","searchResponse","traces","Promise","all","map","trace","spanCount","errorCount","searchTraceIDResponse","batch","batches","scopeSpan","scopeSpans","spans","length","span","status","code","summary","traceDetails"],"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,QAAwB,mBAAmB;AAgBzD,OAAO,MAAMC,iBAAiB,OAAUC;IACtC,MAAMC,WAAW,MAAMH,MAAME;IAC7B,MAAME,WAAW,MAAMD,SAASE;IAChC,OAAOD;AACT,EAAE;AAEF,SAASE,aAAwBC,MAAc,EAAEC,aAAqB;IACpE,MAAMN,MAAM,CAAC,EAAEM,cAAc,EAAED,OAAO,CAAC;IACvC,OAAON,eAA0BC;AACnC;AAEA;;CAEC,GACD,OAAO,SAASO,iBAAiBC,KAAa,EAAEF,aAAqB;IACnE,OAAOF,aAAuC,CAAC,cAAc,EAAEI,MAAM,CAAC,EAAEF;AAC1E;AAEA;;CAEC,GACD,OAAO,SAASG,cAAcC,OAAe,EAAEJ,aAAqB;IAClE,OAAOF,aAAoC,CAAC,YAAY,EAAEM,QAAQ,CAAC,EAAEJ;AACvE;AAEA;;;;;;;;;;CAUC,GACD,OAAO,eAAeK,sBAAsBH,KAAa,EAAEF,aAAqB;IAC9E,+CAA+C;IAC/C,MAAMM,iBAAiB,MAAML,iBAAiBC,OAAOF;IACrD,IAAI,CAACM,eAAeC,QAAQ;QAC1B,OAAO;YAAEL;YAAOK,QAAQ,EAAE;QAAC;IAC7B;IAEA,OAAO;QACLL;QACAK,QAAQ,MAAMC,QAAQC,IACpBH,eAAeC,OAAOG,IAAI,OAAOC;YAC/B,IAAIC,YAAY;YAChB,IAAIC,aAAa;YACjB,MAAMC,wBAAwB,MAAMX,cAAcQ,MAAMP,SAASJ;YAEjE,sFAAsF;YACtF,KAAK,MAAMe,SAASD,sBAAsBE,QAAS;gBACjD,KAAK,MAAMC,aAAaF,MAAMG,WAAY;oBACxCN,aAAaK,UAAUE,MAAMC;oBAC7B,KAAK,MAAMC,QAAQJ,UAAUE,MAAO;4BAC9BE;wBAAJ,IAAIA,CAAAA,eAAAA,KAAKC,oBAALD,0BAAAA,KAAAA,IAAAA,aAAaE,MAAM;4BACrBV;wBACF;oBACF;gBACF;YACF;YAEA,OAAO;gBACLW,SAASb;gBACTc,cAAcX;gBACdF;gBACAC;YACF;QACF;IAEJ;AACF"}
1
+ {"version":3,"sources":["../../src/model/tempo-client.ts"],"sourcesContent":["// Copyright 2023 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 { fetch, RequestHeaders } from '@perses-dev/core';\nimport { DatasourceClient } from '@perses-dev/plugin-system';\nimport { SearchTraceIDResponse, EnrichedTraceQueryResponse, SearchTraceQueryResponse } from './api-types';\n\ninterface TempoClientOptions {\n datasourceUrl: string;\n headers?: RequestHeaders;\n}\n\nexport interface TempoClient extends DatasourceClient {\n options: TempoClientOptions;\n getEnrichedTraceQuery(query: string, datasourceUrl: string): Promise<EnrichedTraceQueryResponse>;\n searchTraceQuery(query: string, datasourceUrl: string): Promise<SearchTraceQueryResponse>;\n searchTraceID(traceID: string, datasourceUrl: string): Promise<SearchTraceIDResponse>;\n}\n\nexport const executeRequest = async <T>(url: string): Promise<T> => {\n const response = await fetch(url);\n const jsonData = await response.json();\n return jsonData;\n};\n\nfunction fetchWithGet<TResponse>(apiURI: string, datasourceUrl: string) {\n const url = `${datasourceUrl}${apiURI}`;\n return executeRequest<TResponse>(url);\n}\n\n/**\n * Returns a summary report of traces that satisfy the query.\n */\nexport function searchTraceQuery(query: string, datasourceUrl: string) {\n return fetchWithGet<SearchTraceQueryResponse>(`/api/search?q=${query}`, datasourceUrl);\n}\n\n/**\n * Returns a detailed report, including all the spans, for a given trace.\n */\nexport function searchTraceID(traceID: string, datasourceUrl: string) {\n return fetchWithGet<SearchTraceIDResponse>(`/api/traces/${traceID}`, datasourceUrl);\n}\n\n/**\n * Combined response of Tempo HTTP API endpoints GET /api/search/<query>\n * and GET /api/traces/<traceID>. For each trace returned from GET /api/search/<query>\n * a detailed trace report is fetched from GET /api/traces/<traceID>. This is a\n * temporary workaround to obtain the total number of spans and total number\n * of errors for a trace.\n *\n * TODO: This workaround should be replaced once this issue,\n * https://github.com/grafana/tempo/issues/2940, is resolved upstream in\n * Tempo.\n */\nexport async function getEnrichedTraceQuery(query: string, datasourceUrl: string): Promise<EnrichedTraceQueryResponse> {\n // Get a list of traces that satisfy the query.\n const searchResponse = await searchTraceQuery(query, datasourceUrl);\n if (!searchResponse.traces) {\n return { query, traces: [] };\n }\n\n return {\n query,\n traces: await Promise.all(\n searchResponse.traces.map(async (trace) => {\n let spanCount = 0;\n let errorCount = 0;\n const searchTraceIDResponse = await searchTraceID(trace.traceID, datasourceUrl);\n\n // For every trace, get the full trace, and find the total number of spans and errors.\n for (const batch of searchTraceIDResponse.batches) {\n for (const scopeSpan of batch.scopeSpans) {\n spanCount += scopeSpan.spans.length;\n for (const span of scopeSpan.spans) {\n if (span.status?.code) {\n errorCount++;\n }\n }\n }\n }\n\n return {\n summary: trace,\n traceDetails: searchTraceIDResponse,\n spanCount,\n errorCount,\n };\n })\n ),\n };\n}\n"],"names":["fetch","executeRequest","url","response","jsonData","json","fetchWithGet","apiURI","datasourceUrl","searchTraceQuery","query","searchTraceID","traceID","getEnrichedTraceQuery","searchResponse","traces","Promise","all","map","trace","spanCount","errorCount","searchTraceIDResponse","batch","batches","scopeSpan","scopeSpans","spans","length","span","status","code","summary","traceDetails"],"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,QAAwB,mBAAmB;AAgBzD,OAAO,MAAMC,iBAAiB,OAAUC;IACtC,MAAMC,WAAW,MAAMH,MAAME;IAC7B,MAAME,WAAW,MAAMD,SAASE,IAAI;IACpC,OAAOD;AACT,EAAE;AAEF,SAASE,aAAwBC,MAAc,EAAEC,aAAqB;IACpE,MAAMN,MAAM,CAAC,EAAEM,cAAc,EAAED,OAAO,CAAC;IACvC,OAAON,eAA0BC;AACnC;AAEA;;CAEC,GACD,OAAO,SAASO,iBAAiBC,KAAa,EAAEF,aAAqB;IACnE,OAAOF,aAAuC,CAAC,cAAc,EAAEI,MAAM,CAAC,EAAEF;AAC1E;AAEA;;CAEC,GACD,OAAO,SAASG,cAAcC,OAAe,EAAEJ,aAAqB;IAClE,OAAOF,aAAoC,CAAC,YAAY,EAAEM,QAAQ,CAAC,EAAEJ;AACvE;AAEA;;;;;;;;;;CAUC,GACD,OAAO,eAAeK,sBAAsBH,KAAa,EAAEF,aAAqB;IAC9E,+CAA+C;IAC/C,MAAMM,iBAAiB,MAAML,iBAAiBC,OAAOF;IACrD,IAAI,CAACM,eAAeC,MAAM,EAAE;QAC1B,OAAO;YAAEL;YAAOK,QAAQ,EAAE;QAAC;IAC7B;IAEA,OAAO;QACLL;QACAK,QAAQ,MAAMC,QAAQC,GAAG,CACvBH,eAAeC,MAAM,CAACG,GAAG,CAAC,OAAOC;YAC/B,IAAIC,YAAY;YAChB,IAAIC,aAAa;YACjB,MAAMC,wBAAwB,MAAMX,cAAcQ,MAAMP,OAAO,EAAEJ;YAEjE,sFAAsF;YACtF,KAAK,MAAMe,SAASD,sBAAsBE,OAAO,CAAE;gBACjD,KAAK,MAAMC,aAAaF,MAAMG,UAAU,CAAE;oBACxCN,aAAaK,UAAUE,KAAK,CAACC,MAAM;oBACnC,KAAK,MAAMC,QAAQJ,UAAUE,KAAK,CAAE;4BAC9BE;wBAAJ,KAAIA,eAAAA,KAAKC,MAAM,cAAXD,mCAAAA,aAAaE,IAAI,EAAE;4BACrBV;wBACF;oBACF;gBACF;YACF;YAEA,OAAO;gBACLW,SAASb;gBACTc,cAAcX;gBACdF;gBACAC;YACF;QACF;IAEJ;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/tempo-selectors.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DatasourceSelector } from '@perses-dev/core';\n\nexport const TEMPO_DATASOURCE_KIND = 'TempoDatasource' as const;\n\n/**\n * DatasourceSelector for Tempo Datasources.\n */\nexport interface TempoDatasourceSelector extends DatasourceSelector {\n kind: typeof TEMPO_DATASOURCE_KIND;\n}\n\n/**\n * A default selector that asks for the default Tempo Datasource.\n */\nexport const DEFAULT_TEMPO: TempoDatasourceSelector = { kind: TEMPO_DATASOURCE_KIND };\n\n/**\n * Returns true if the provided TempoDatasourceSelector is the default one.\n */\nexport function isDefaultTempoSelector(selector: TempoDatasourceSelector) {\n return selector.name === undefined;\n}\n\n/**\n * Type guard to make sure a DatasourceSelector is a Tempo one.\n */\nexport function isTempoDatasourceSelector(selector: DatasourceSelector): selector is TempoDatasourceSelector {\n return selector.kind === TEMPO_DATASOURCE_KIND;\n}\n"],"names":["TEMPO_DATASOURCE_KIND","DEFAULT_TEMPO","kind","isDefaultTempoSelector","selector","name","undefined","isTempoDatasourceSelector"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,OAAO,MAAMA,wBAAwB,kBAA2B;AAShE;;CAEC,GACD,OAAO,MAAMC,gBAAyC;IAAEC,MAAMF;AAAsB,EAAE;AAEtF;;CAEC,GACD,OAAO,SAASG,uBAAuBC,QAAiC;IACtE,OAAOA,SAASC,SAASC;AAC3B;AAEA;;CAEC,GACD,OAAO,SAASC,0BAA0BH,QAA4B;IACpE,OAAOA,SAASF,SAASF;AAC3B"}
1
+ {"version":3,"sources":["../../src/model/tempo-selectors.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DatasourceSelector } from '@perses-dev/core';\n\nexport const TEMPO_DATASOURCE_KIND = 'TempoDatasource' as const;\n\n/**\n * DatasourceSelector for Tempo Datasources.\n */\nexport interface TempoDatasourceSelector extends DatasourceSelector {\n kind: typeof TEMPO_DATASOURCE_KIND;\n}\n\n/**\n * A default selector that asks for the default Tempo Datasource.\n */\nexport const DEFAULT_TEMPO: TempoDatasourceSelector = { kind: TEMPO_DATASOURCE_KIND };\n\n/**\n * Returns true if the provided TempoDatasourceSelector is the default one.\n */\nexport function isDefaultTempoSelector(selector: TempoDatasourceSelector) {\n return selector.name === undefined;\n}\n\n/**\n * Type guard to make sure a DatasourceSelector is a Tempo one.\n */\nexport function isTempoDatasourceSelector(selector: DatasourceSelector): selector is TempoDatasourceSelector {\n return selector.kind === TEMPO_DATASOURCE_KIND;\n}\n"],"names":["TEMPO_DATASOURCE_KIND","DEFAULT_TEMPO","kind","isDefaultTempoSelector","selector","name","undefined","isTempoDatasourceSelector"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,OAAO,MAAMA,wBAAwB,kBAA2B;AAShE;;CAEC,GACD,OAAO,MAAMC,gBAAyC;IAAEC,MAAMF;AAAsB,EAAE;AAEtF;;CAEC,GACD,OAAO,SAASG,uBAAuBC,QAAiC;IACtE,OAAOA,SAASC,IAAI,KAAKC;AAC3B;AAEA;;CAEC,GACD,OAAO,SAASC,0BAA0BH,QAA4B;IACpE,OAAOA,SAASF,IAAI,KAAKF;AAC3B"}
@@ -10,6 +10,8 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export { };
13
+ /**
14
+ * The spec/options for the TempoTraceQuery plugin.
15
+ */ export { };
14
16
 
15
17
  //# sourceMappingURL=trace-query-model.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/trace-query-model.ts"],"sourcesContent":["// Copyright 2023 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 { TempoDatasourceSelector } from './tempo-selectors';\n/**\n * The spec/options for the TempoTraceQuery plugin.\n */\nexport interface TempoTraceQuerySpec {\n query: string;\n datasource?: TempoDatasourceSelector;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WAOC"}
1
+ {"version":3,"sources":["../../src/model/trace-query-model.ts"],"sourcesContent":["// Copyright 2023 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 { TempoDatasourceSelector } from './tempo-selectors';\n/**\n * The spec/options for the TempoTraceQuery plugin.\n */\nexport interface TempoTraceQuerySpec {\n query: string;\n datasource?: TempoDatasourceSelector;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC;;CAEC,GACD,WAGC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/plugins/get-trace-data.ts"],"sourcesContent":["// Copyright 2023 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 { TraceQueryPlugin } from '@perses-dev/plugin-system';\nimport { TraceData, TraceValue } from '@perses-dev/core';\nimport { TempoTraceQuerySpec } from '../model/trace-query-model';\nimport { TEMPO_DATASOURCE_KIND, TempoDatasourceSelector } from '../model/tempo-selectors';\nimport { TempoClient } from '../model/tempo-client';\n\nexport const getTraceData: TraceQueryPlugin<TempoTraceQuerySpec>['getTraceData'] = async (spec, context) => {\n if (spec.query === undefined || spec.query === null || spec.query === '') {\n // Do not make a request to the backend, instead return an empty TraceData\n console.error('TempoTraceQuery is undefined, null, or an empty string.');\n return { traces: [] };\n }\n\n const defaultTempoDatasource: TempoDatasourceSelector = {\n kind: TEMPO_DATASOURCE_KIND,\n };\n\n const client: TempoClient = await context.datasourceStore.getDatasourceClient(\n spec.datasource ?? defaultTempoDatasource\n );\n\n const datasourceUrl = client?.options?.datasourceUrl;\n if (datasourceUrl === undefined || datasourceUrl === null || datasourceUrl === '') {\n console.error('TempoDatasource is undefined, null, or an empty string.');\n return { traces: [] };\n }\n\n const enrichedTraceResponse = await client.getEnrichedTraceQuery(spec.query, datasourceUrl);\n\n const traces: TraceValue[] = enrichedTraceResponse.traces.map((traceValue) => {\n const startTimeUnixMs = parseInt(traceValue.summary.startTimeUnixNano) / 1000;\n const durationMs = traceValue.summary.durationMs;\n const spanCount = traceValue.spanCount;\n const errorCount = traceValue.errorCount;\n const traceId = traceValue.summary.traceID;\n const name = `rootServiceName=\"${traceValue.summary.rootServiceName.trim()}\", rootTraceName=\"${traceValue.summary.rootServiceName.trim()}\"`;\n\n return {\n startTimeUnixMs,\n durationMs,\n spanCount,\n errorCount,\n traceId,\n name,\n };\n });\n\n const traceData: TraceData = {\n traces,\n metadata: {\n executedQueryString: spec.query,\n },\n };\n\n return traceData;\n};\n"],"names":["TEMPO_DATASOURCE_KIND","getTraceData","spec","context","client","query","undefined","console","error","traces","defaultTempoDatasource","kind","datasourceStore","getDatasourceClient","datasource","datasourceUrl","options","enrichedTraceResponse","getEnrichedTraceQuery","map","traceValue","startTimeUnixMs","parseInt","summary","startTimeUnixNano","durationMs","spanCount","errorCount","traceId","traceID","name","rootServiceName","trim","traceData","metadata","executedQueryString"],"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;AAKjC,SAASA,qBAAqB,QAAiC,2BAA2B;AAG1F,OAAO,MAAMC,eAAsE,OAAOC,MAAMC;QAexEC;IAdtB,IAAIF,KAAKG,UAAUC,aAAaJ,KAAKG,UAAU,QAAQH,KAAKG,UAAU,IAAI;QACxE,0EAA0E;QAC1EE,QAAQC,MAAM;QACd,OAAO;YAAEC,QAAQ,EAAE;QAAC;IACtB;IAEA,MAAMC,yBAAkD;QACtDC,MAAMX;IACR;QAGEE;IADF,MAAME,SAAsB,MAAMD,QAAQS,gBAAgBC,oBACxDX,CAAAA,mBAAAA,KAAKY,wBAALZ,8BAAAA,mBAAmBQ;IAGrB,MAAMK,gBAAgBX,mBAAAA,oBAAAA,KAAAA,IAAAA,CAAAA,kBAAAA,OAAQY,qBAARZ,6BAAAA,KAAAA,IAAAA,gBAAiBW;IACvC,IAAIA,kBAAkBT,aAAaS,kBAAkB,QAAQA,kBAAkB,IAAI;QACjFR,QAAQC,MAAM;QACd,OAAO;YAAEC,QAAQ,EAAE;QAAC;IACtB;IAEA,MAAMQ,wBAAwB,MAAMb,OAAOc,sBAAsBhB,KAAKG,OAAOU;IAE7E,MAAMN,SAAuBQ,sBAAsBR,OAAOU,IAAI,CAACC;QAC7D,MAAMC,kBAAkBC,SAASF,WAAWG,QAAQC,qBAAqB;QACzE,MAAMC,aAAaL,WAAWG,QAAQE;QACtC,MAAMC,YAAYN,WAAWM;QAC7B,MAAMC,aAAaP,WAAWO;QAC9B,MAAMC,UAAUR,WAAWG,QAAQM;QACnC,MAAMC,OAAO,CAAC,iBAAiB,EAAEV,WAAWG,QAAQQ,gBAAgBC,OAAO,kBAAkB,EAAEZ,WAAWG,QAAQQ,gBAAgBC,OAAO,CAAC,CAAC;QAE3I,OAAO;YACLX;YACAI;YACAC;YACAC;YACAC;YACAE;QACF;IACF;IAEA,MAAMG,YAAuB;QAC3BxB;QACAyB,UAAU;YACRC,qBAAqBjC,KAAKG;QAC5B;IACF;IAEA,OAAO4B;AACT,EAAE"}
1
+ {"version":3,"sources":["../../src/plugins/get-trace-data.ts"],"sourcesContent":["// Copyright 2023 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 { TraceQueryPlugin } from '@perses-dev/plugin-system';\nimport { TraceData, TraceValue } from '@perses-dev/core';\nimport { TempoTraceQuerySpec } from '../model/trace-query-model';\nimport { TEMPO_DATASOURCE_KIND, TempoDatasourceSelector } from '../model/tempo-selectors';\nimport { TempoClient } from '../model/tempo-client';\n\nexport const getTraceData: TraceQueryPlugin<TempoTraceQuerySpec>['getTraceData'] = async (spec, context) => {\n if (spec.query === undefined || spec.query === null || spec.query === '') {\n // Do not make a request to the backend, instead return an empty TraceData\n console.error('TempoTraceQuery is undefined, null, or an empty string.');\n return { traces: [] };\n }\n\n const defaultTempoDatasource: TempoDatasourceSelector = {\n kind: TEMPO_DATASOURCE_KIND,\n };\n\n const client: TempoClient = await context.datasourceStore.getDatasourceClient(\n spec.datasource ?? defaultTempoDatasource\n );\n\n const datasourceUrl = client?.options?.datasourceUrl;\n if (datasourceUrl === undefined || datasourceUrl === null || datasourceUrl === '') {\n console.error('TempoDatasource is undefined, null, or an empty string.');\n return { traces: [] };\n }\n\n const enrichedTraceResponse = await client.getEnrichedTraceQuery(spec.query, datasourceUrl);\n\n const traces: TraceValue[] = enrichedTraceResponse.traces.map((traceValue) => {\n const startTimeUnixMs = parseInt(traceValue.summary.startTimeUnixNano) / 1000;\n const durationMs = traceValue.summary.durationMs;\n const spanCount = traceValue.spanCount;\n const errorCount = traceValue.errorCount;\n const traceId = traceValue.summary.traceID;\n const name = `rootServiceName=\"${traceValue.summary.rootServiceName.trim()}\", rootTraceName=\"${traceValue.summary.rootServiceName.trim()}\"`;\n\n return {\n startTimeUnixMs,\n durationMs,\n spanCount,\n errorCount,\n traceId,\n name,\n };\n });\n\n const traceData: TraceData = {\n traces,\n metadata: {\n executedQueryString: spec.query,\n },\n };\n\n return traceData;\n};\n"],"names":["TEMPO_DATASOURCE_KIND","getTraceData","spec","context","client","query","undefined","console","error","traces","defaultTempoDatasource","kind","datasourceStore","getDatasourceClient","datasource","datasourceUrl","options","enrichedTraceResponse","getEnrichedTraceQuery","map","traceValue","startTimeUnixMs","parseInt","summary","startTimeUnixNano","durationMs","spanCount","errorCount","traceId","traceID","name","rootServiceName","trim","traceData","metadata","executedQueryString"],"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;AAKjC,SAASA,qBAAqB,QAAiC,2BAA2B;AAG1F,OAAO,MAAMC,eAAsE,OAAOC,MAAMC;QAexEC;IAdtB,IAAIF,KAAKG,KAAK,KAAKC,aAAaJ,KAAKG,KAAK,KAAK,QAAQH,KAAKG,KAAK,KAAK,IAAI;QACxE,0EAA0E;QAC1EE,QAAQC,KAAK,CAAC;QACd,OAAO;YAAEC,QAAQ,EAAE;QAAC;IACtB;IAEA,MAAMC,yBAAkD;QACtDC,MAAMX;IACR;QAGEE;IADF,MAAME,SAAsB,MAAMD,QAAQS,eAAe,CAACC,mBAAmB,CAC3EX,CAAAA,mBAAAA,KAAKY,UAAU,cAAfZ,8BAAAA,mBAAmBQ;IAGrB,MAAMK,gBAAgBX,mBAAAA,8BAAAA,kBAAAA,OAAQY,OAAO,cAAfZ,sCAAAA,gBAAiBW,aAAa;IACpD,IAAIA,kBAAkBT,aAAaS,kBAAkB,QAAQA,kBAAkB,IAAI;QACjFR,QAAQC,KAAK,CAAC;QACd,OAAO;YAAEC,QAAQ,EAAE;QAAC;IACtB;IAEA,MAAMQ,wBAAwB,MAAMb,OAAOc,qBAAqB,CAAChB,KAAKG,KAAK,EAAEU;IAE7E,MAAMN,SAAuBQ,sBAAsBR,MAAM,CAACU,GAAG,CAAC,CAACC;QAC7D,MAAMC,kBAAkBC,SAASF,WAAWG,OAAO,CAACC,iBAAiB,IAAI;QACzE,MAAMC,aAAaL,WAAWG,OAAO,CAACE,UAAU;QAChD,MAAMC,YAAYN,WAAWM,SAAS;QACtC,MAAMC,aAAaP,WAAWO,UAAU;QACxC,MAAMC,UAAUR,WAAWG,OAAO,CAACM,OAAO;QAC1C,MAAMC,OAAO,CAAC,iBAAiB,EAAEV,WAAWG,OAAO,CAACQ,eAAe,CAACC,IAAI,GAAG,kBAAkB,EAAEZ,WAAWG,OAAO,CAACQ,eAAe,CAACC,IAAI,GAAG,CAAC,CAAC;QAE3I,OAAO;YACLX;YACAI;YACAC;YACAC;YACAC;YACAE;QACF;IACF;IAEA,MAAMG,YAAuB;QAC3BxB;QACAyB,UAAU;YACRC,qBAAqBjC,KAAKG,KAAK;QACjC;IACF;IAEA,OAAO4B;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/plugins/tempo-datasource-types.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { HTTPProxy } from '@perses-dev/core';\n\nexport interface TempoDatasourceSpec {\n directUrl?: string;\n proxy?: HTTPProxy;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WAKC"}
1
+ {"version":3,"sources":["../../src/plugins/tempo-datasource-types.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { HTTPProxy } from '@perses-dev/core';\n\nexport interface TempoDatasourceSpec {\n directUrl?: string;\n proxy?: HTTPProxy;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,WAGC"}
@@ -14,8 +14,8 @@ import { searchTraceQuery, searchTraceID, getEnrichedTraceQuery } from '../model
14
14
  /**
15
15
  * Creates a TempoClient for a specific datasource spec.
16
16
  */ const createClient = (spec, options)=>{
17
- const { directUrl } = spec;
18
- const { proxyUrl } = options;
17
+ const { directUrl } = spec;
18
+ const { proxyUrl } = options;
19
19
  // Use the direct URL if specified, but fallback to the proxyUrl by default if not specified
20
20
  const datasourceUrl = directUrl !== null && directUrl !== void 0 ? directUrl : proxyUrl;
21
21
  if (datasourceUrl === undefined) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/plugins/tempo-datasource.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DatasourcePlugin } from '@perses-dev/plugin-system';\nimport { searchTraceQuery, searchTraceID, getEnrichedTraceQuery, TempoClient } from '../model/tempo-client';\nimport { TempoDatasourceSpec } from './tempo-datasource-types';\n\n/**\n * Creates a TempoClient for a specific datasource spec.\n */\nconst createClient: DatasourcePlugin<TempoDatasourceSpec, TempoClient>['createClient'] = (spec, options) => {\n const { directUrl } = spec;\n const { proxyUrl } = options;\n\n // Use the direct URL if specified, but fallback to the proxyUrl by default if not specified\n const datasourceUrl = directUrl ?? proxyUrl;\n if (datasourceUrl === undefined) {\n throw new Error('No URL specified for Tempo client. You can use directUrl in the spec to configure it.');\n }\n\n return {\n options: {\n datasourceUrl,\n },\n searchTraceQuery: (query: string) => searchTraceQuery(query, datasourceUrl),\n searchTraceID: (traceID: string) => searchTraceID(traceID, datasourceUrl),\n getEnrichedTraceQuery: (query: string) => getEnrichedTraceQuery(query, datasourceUrl),\n };\n};\n\nexport const TempoDatasource: DatasourcePlugin<TempoDatasourceSpec, TempoClient> = {\n createClient,\n // TODO add a options editor component for tempo datasource\n // OptionsEditorComponent: TempoDatasourceEditor,\n createInitialOptions: () => ({ directUrl: '' }),\n};\n"],"names":["searchTraceQuery","searchTraceID","getEnrichedTraceQuery","createClient","spec","options","directUrl","proxyUrl","datasourceUrl","undefined","Error","query","traceID","TempoDatasource","createInitialOptions"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,gBAAgB,EAAEC,aAAa,EAAEC,qBAAqB,QAAqB,wBAAwB;AAG5G;;CAEC,GACD,MAAMC,eAAmF,CAACC,MAAMC;IAC9F,MAAM,EAAEC,UAAS,EAAE,GAAGF;IACtB,MAAM,EAAEG,SAAQ,EAAE,GAAGF;IAErB,4FAA4F;IAC5F,MAAMG,gBAAgBF,sBAAAA,uBAAAA,YAAaC;IACnC,IAAIC,kBAAkBC,WAAW;QAC/B,MAAM,IAAIC,MAAM;IAClB;IAEA,OAAO;QACLL,SAAS;YACPG;QACF;QACAR,kBAAkB,CAACW,QAAkBX,iBAAiBW,OAAOH;QAC7DP,eAAe,CAACW,UAAoBX,cAAcW,SAASJ;QAC3DN,uBAAuB,CAACS,QAAkBT,sBAAsBS,OAAOH;IACzE;AACF;AAEA,OAAO,MAAMK,kBAAsE;IACjFV;IACA,2DAA2D;IAC3D,iDAAiD;IACjDW,sBAAsB,IAAO,CAAA;YAAER,WAAW;QAAG,CAAA;AAC/C,EAAE"}
1
+ {"version":3,"sources":["../../src/plugins/tempo-datasource.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DatasourcePlugin } from '@perses-dev/plugin-system';\nimport { searchTraceQuery, searchTraceID, getEnrichedTraceQuery, TempoClient } from '../model/tempo-client';\nimport { TempoDatasourceSpec } from './tempo-datasource-types';\n\n/**\n * Creates a TempoClient for a specific datasource spec.\n */\nconst createClient: DatasourcePlugin<TempoDatasourceSpec, TempoClient>['createClient'] = (spec, options) => {\n const { directUrl } = spec;\n const { proxyUrl } = options;\n\n // Use the direct URL if specified, but fallback to the proxyUrl by default if not specified\n const datasourceUrl = directUrl ?? proxyUrl;\n if (datasourceUrl === undefined) {\n throw new Error('No URL specified for Tempo client. You can use directUrl in the spec to configure it.');\n }\n\n return {\n options: {\n datasourceUrl,\n },\n searchTraceQuery: (query: string) => searchTraceQuery(query, datasourceUrl),\n searchTraceID: (traceID: string) => searchTraceID(traceID, datasourceUrl),\n getEnrichedTraceQuery: (query: string) => getEnrichedTraceQuery(query, datasourceUrl),\n };\n};\n\nexport const TempoDatasource: DatasourcePlugin<TempoDatasourceSpec, TempoClient> = {\n createClient,\n // TODO add a options editor component for tempo datasource\n // OptionsEditorComponent: TempoDatasourceEditor,\n createInitialOptions: () => ({ directUrl: '' }),\n};\n"],"names":["searchTraceQuery","searchTraceID","getEnrichedTraceQuery","createClient","spec","options","directUrl","proxyUrl","datasourceUrl","undefined","Error","query","traceID","TempoDatasource","createInitialOptions"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,gBAAgB,EAAEC,aAAa,EAAEC,qBAAqB,QAAqB,wBAAwB;AAG5G;;CAEC,GACD,MAAMC,eAAmF,CAACC,MAAMC;IAC9F,MAAM,EAAEC,SAAS,EAAE,GAAGF;IACtB,MAAM,EAAEG,QAAQ,EAAE,GAAGF;IAErB,4FAA4F;IAC5F,MAAMG,gBAAgBF,sBAAAA,uBAAAA,YAAaC;IACnC,IAAIC,kBAAkBC,WAAW;QAC/B,MAAM,IAAIC,MAAM;IAClB;IAEA,OAAO;QACLL,SAAS;YACPG;QACF;QACAR,kBAAkB,CAACW,QAAkBX,iBAAiBW,OAAOH;QAC7DP,eAAe,CAACW,UAAoBX,cAAcW,SAASJ;QAC3DN,uBAAuB,CAACS,QAAkBT,sBAAsBS,OAAOH;IACzE;AACF;AAEA,OAAO,MAAMK,kBAAsE;IACjFV;IACA,2DAA2D;IAC3D,iDAAiD;IACjDW,sBAAsB,IAAO,CAAA;YAAER,WAAW;QAAG,CAAA;AAC/C,EAAE"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DatasourceSelector } from '@perses-dev/core/dist/model';
3
2
  import { TempoDatasourceSelector } from '../../model/tempo-selectors';
4
3
  interface DashboardTempoTraceQueryEditorProps {
@@ -9,6 +8,6 @@ interface DashboardTempoTraceQueryEditorProps {
9
8
  handleQueryChange: (e: string) => void;
10
9
  handleQueryBlur: () => void;
11
10
  }
12
- export declare function DashboardTempoTraceQueryEditor(props: DashboardTempoTraceQueryEditorProps): JSX.Element;
11
+ export declare function DashboardTempoTraceQueryEditor(props: DashboardTempoTraceQueryEditorProps): import("react/jsx-runtime").JSX.Element;
13
12
  export {};
14
13
  //# sourceMappingURL=DashboardTempoTraceQueryEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardTempoTraceQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/plugins/tempo-trace-query/DashboardTempoTraceQueryEditor.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAyB,MAAM,6BAA6B,CAAC;AAG7F,UAAU,mCAAmC;IAC3C,kBAAkB,EAAE,uBAAuB,CAAC;IAC5C,sBAAsB,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC3D,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,mCAAmC,eA0BxF"}
1
+ {"version":3,"file":"DashboardTempoTraceQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/plugins/tempo-trace-query/DashboardTempoTraceQueryEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAyB,MAAM,6BAA6B,CAAC;AAG7F,UAAU,mCAAmC;IAC3C,kBAAkB,EAAE,uBAAuB,CAAC;IAC5C,sBAAsB,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC3D,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,mCAAmC,2CA0BxF"}
@@ -16,7 +16,7 @@ import { DatasourceSelect } from '@perses-dev/plugin-system';
16
16
  import { TEMPO_DATASOURCE_KIND } from '../../model/tempo-selectors';
17
17
  import { TraceQLEditor } from './TraceQLEditor';
18
18
  export function DashboardTempoTraceQueryEditor(props) {
19
- const { selectedDatasource , handleDatasourceChange , datasourceURL , query , handleQueryChange , handleQueryBlur } = props;
19
+ const { selectedDatasource, handleDatasourceChange, datasourceURL, query, handleQueryChange, handleQueryBlur } = props;
20
20
  return /*#__PURE__*/ _jsxs(Stack, {
21
21
  spacing: 2,
22
22
  children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/plugins/tempo-trace-query/DashboardTempoTraceQueryEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Stack, FormControl, InputLabel } from '@mui/material';\nimport { DatasourceSelect } from '@perses-dev/plugin-system';\nimport { DatasourceSelector } from '@perses-dev/core/dist/model';\nimport { TempoDatasourceSelector, TEMPO_DATASOURCE_KIND } from '../../model/tempo-selectors';\nimport { TraceQLEditor } from './TraceQLEditor';\n\ninterface DashboardTempoTraceQueryEditorProps {\n selectedDatasource: TempoDatasourceSelector;\n handleDatasourceChange: (next: DatasourceSelector) => void;\n datasourceURL: string | undefined;\n query: string;\n handleQueryChange: (e: string) => void;\n handleQueryBlur: () => void;\n}\n\nexport function DashboardTempoTraceQueryEditor(props: DashboardTempoTraceQueryEditorProps) {\n const { selectedDatasource, handleDatasourceChange, datasourceURL, query, handleQueryChange, handleQueryBlur } =\n props;\n\n return (\n <Stack spacing={2}>\n <FormControl margin=\"dense\" fullWidth={false}>\n {/* TODO: How do we ensure unique ID values if there are multiple of these? Can we use React 18 useId and\n maintain 17 compatibility somehow with a polyfill/shim? */}\n <InputLabel id=\"tempo-datasource-label\">Tempo Datasource</InputLabel>\n <DatasourceSelect\n datasourcePluginKind={TEMPO_DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n labelId=\"tempo-datasource-label\"\n label=\"Tempo Datasource\"\n />\n </FormControl>\n <TraceQLEditor\n completeConfig={{ remote: { url: datasourceURL } }}\n value={query}\n onChange={handleQueryChange}\n onBlur={handleQueryBlur}\n />\n </Stack>\n );\n}\n"],"names":["Stack","FormControl","InputLabel","DatasourceSelect","TEMPO_DATASOURCE_KIND","TraceQLEditor","DashboardTempoTraceQueryEditor","props","selectedDatasource","handleDatasourceChange","datasourceURL","query","handleQueryChange","handleQueryBlur","spacing","margin","fullWidth","id","datasourcePluginKind","value","onChange","labelId","label","completeConfig","remote","url","onBlur"],"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,WAAW,EAAEC,UAAU,QAAQ,gBAAgB;AAC/D,SAASC,gBAAgB,QAAQ,4BAA4B;AAE7D,SAAkCC,qBAAqB,QAAQ,8BAA8B;AAC7F,SAASC,aAAa,QAAQ,kBAAkB;AAWhD,OAAO,SAASC,+BAA+BC,KAA0C;IACvF,MAAM,EAAEC,mBAAkB,EAAEC,uBAAsB,EAAEC,cAAa,EAAEC,MAAK,EAAEC,kBAAiB,EAAEC,gBAAe,EAAE,GAC5GN;IAEF,qBACE,MAACP;QAAMc,SAAS;;0BACd,MAACb;gBAAYc,QAAO;gBAAQC,WAAW;;kCAGrC,KAACd;wBAAWe,IAAG;kCAAyB;;kCACxC,KAACd;wBACCe,sBAAsBd;wBACtBe,OAAOX;wBACPY,UAAUX;wBACVY,SAAQ;wBACRC,OAAM;;;;0BAGV,KAACjB;gBACCkB,gBAAgB;oBAAEC,QAAQ;wBAAEC,KAAKf;oBAAc;gBAAE;gBACjDS,OAAOR;gBACPS,UAAUR;gBACVc,QAAQb;;;;AAIhB"}
1
+ {"version":3,"sources":["../../../src/plugins/tempo-trace-query/DashboardTempoTraceQueryEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Stack, FormControl, InputLabel } from '@mui/material';\nimport { DatasourceSelect } from '@perses-dev/plugin-system';\nimport { DatasourceSelector } from '@perses-dev/core/dist/model';\nimport { TempoDatasourceSelector, TEMPO_DATASOURCE_KIND } from '../../model/tempo-selectors';\nimport { TraceQLEditor } from './TraceQLEditor';\n\ninterface DashboardTempoTraceQueryEditorProps {\n selectedDatasource: TempoDatasourceSelector;\n handleDatasourceChange: (next: DatasourceSelector) => void;\n datasourceURL: string | undefined;\n query: string;\n handleQueryChange: (e: string) => void;\n handleQueryBlur: () => void;\n}\n\nexport function DashboardTempoTraceQueryEditor(props: DashboardTempoTraceQueryEditorProps) {\n const { selectedDatasource, handleDatasourceChange, datasourceURL, query, handleQueryChange, handleQueryBlur } =\n props;\n\n return (\n <Stack spacing={2}>\n <FormControl margin=\"dense\" fullWidth={false}>\n {/* TODO: How do we ensure unique ID values if there are multiple of these? Can we use React 18 useId and\n maintain 17 compatibility somehow with a polyfill/shim? */}\n <InputLabel id=\"tempo-datasource-label\">Tempo Datasource</InputLabel>\n <DatasourceSelect\n datasourcePluginKind={TEMPO_DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n labelId=\"tempo-datasource-label\"\n label=\"Tempo Datasource\"\n />\n </FormControl>\n <TraceQLEditor\n completeConfig={{ remote: { url: datasourceURL } }}\n value={query}\n onChange={handleQueryChange}\n onBlur={handleQueryBlur}\n />\n </Stack>\n );\n}\n"],"names":["Stack","FormControl","InputLabel","DatasourceSelect","TEMPO_DATASOURCE_KIND","TraceQLEditor","DashboardTempoTraceQueryEditor","props","selectedDatasource","handleDatasourceChange","datasourceURL","query","handleQueryChange","handleQueryBlur","spacing","margin","fullWidth","id","datasourcePluginKind","value","onChange","labelId","label","completeConfig","remote","url","onBlur"],"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,WAAW,EAAEC,UAAU,QAAQ,gBAAgB;AAC/D,SAASC,gBAAgB,QAAQ,4BAA4B;AAE7D,SAAkCC,qBAAqB,QAAQ,8BAA8B;AAC7F,SAASC,aAAa,QAAQ,kBAAkB;AAWhD,OAAO,SAASC,+BAA+BC,KAA0C;IACvF,MAAM,EAAEC,kBAAkB,EAAEC,sBAAsB,EAAEC,aAAa,EAAEC,KAAK,EAAEC,iBAAiB,EAAEC,eAAe,EAAE,GAC5GN;IAEF,qBACE,MAACP;QAAMc,SAAS;;0BACd,MAACb;gBAAYc,QAAO;gBAAQC,WAAW;;kCAGrC,KAACd;wBAAWe,IAAG;kCAAyB;;kCACxC,KAACd;wBACCe,sBAAsBd;wBACtBe,OAAOX;wBACPY,UAAUX;wBACVY,SAAQ;wBACRC,OAAM;;;;0BAGV,KAACjB;gBACCkB,gBAAgB;oBAAEC,QAAQ;wBAAEC,KAAKf;oBAAc;gBAAE;gBACjDS,OAAOR;gBACPS,UAAUR;gBACVc,QAAQb;;;;AAIhB"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { TraceQueryEditorProps } from './query-editor-model';
3
- export declare function TempoTraceQueryEditor(props: TraceQueryEditorProps): JSX.Element;
2
+ export declare function TempoTraceQueryEditor(props: TraceQueryEditorProps): import("react/jsx-runtime").JSX.Element;
4
3
  //# sourceMappingURL=TempoTraceQueryEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TempoTraceQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/plugins/tempo-trace-query/TempoTraceQueryEditor.tsx"],"names":[],"mappings":";AAiBA,OAAO,EAAE,qBAAqB,EAAiB,MAAM,sBAAsB,CAAC;AAG5E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,qBAAqB,eAmCjE"}
1
+ {"version":3,"file":"TempoTraceQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/plugins/tempo-trace-query/TempoTraceQueryEditor.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,qBAAqB,EAAiB,MAAM,sBAAsB,CAAC;AAG5E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,qBAAqB,2CAmCjE"}
@@ -17,12 +17,12 @@ import { DEFAULT_TEMPO, isDefaultTempoSelector, isTempoDatasourceSelector } from
17
17
  import { useQueryState } from './query-editor-model';
18
18
  import { DashboardTempoTraceQueryEditor } from './DashboardTempoTraceQueryEditor';
19
19
  export function TempoTraceQueryEditor(props) {
20
- const { onChange , value } = props;
21
- const { datasource } = value;
20
+ const { onChange, value } = props;
21
+ const { datasource } = value;
22
22
  const selectedDatasource = datasource !== null && datasource !== void 0 ? datasource : DEFAULT_TEMPO;
23
- const { data: client } = useDatasourceClient(selectedDatasource);
23
+ const { data: client } = useDatasourceClient(selectedDatasource);
24
24
  const datasourceURL = client === null || client === void 0 ? void 0 : client.options.datasourceUrl;
25
- const { query , handleQueryChange , handleQueryBlur } = useQueryState(props);
25
+ const { query, handleQueryChange, handleQueryBlur } = useQueryState(props);
26
26
  const handleDatasourceChange = (next)=>{
27
27
  if (isTempoDatasourceSelector(next)) {
28
28
  onChange(produce(value, (draft)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/plugins/tempo-trace-query/TempoTraceQueryEditor.tsx"],"sourcesContent":["// Copyright 2023 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 { DatasourceSelectProps, useDatasourceClient } from '@perses-dev/plugin-system';\nimport { produce } from 'immer';\nimport { DEFAULT_TEMPO, isDefaultTempoSelector, isTempoDatasourceSelector } from '../../model/tempo-selectors';\nimport { TempoClient } from '../../model/tempo-client';\nimport { TraceQueryEditorProps, useQueryState } from './query-editor-model';\nimport { DashboardTempoTraceQueryEditor } from './DashboardTempoTraceQueryEditor';\n\nexport function TempoTraceQueryEditor(props: TraceQueryEditorProps) {\n const { onChange, value } = props;\n const { datasource } = value;\n const selectedDatasource = datasource ?? DEFAULT_TEMPO;\n\n const { data: client } = useDatasourceClient<TempoClient>(selectedDatasource);\n const datasourceURL = client?.options.datasourceUrl;\n\n const { query, handleQueryChange, handleQueryBlur } = useQueryState(props);\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (next) => {\n if (isTempoDatasourceSelector(next)) {\n onChange(\n produce(value, (draft) => {\n // If they're using the default, just omit the datasource prop (i.e. set to undefined)\n const nextDatasource = isDefaultTempoSelector(next) ? undefined : next;\n draft.datasource = nextDatasource;\n })\n );\n return;\n }\n\n throw new Error('Got unexpected non-Tempo datasource selector');\n };\n\n return (\n <DashboardTempoTraceQueryEditor\n selectedDatasource={selectedDatasource}\n handleDatasourceChange={handleDatasourceChange}\n datasourceURL={datasourceURL}\n query={query}\n handleQueryChange={handleQueryChange}\n handleQueryBlur={handleQueryBlur}\n />\n );\n}\n"],"names":["useDatasourceClient","produce","DEFAULT_TEMPO","isDefaultTempoSelector","isTempoDatasourceSelector","useQueryState","DashboardTempoTraceQueryEditor","TempoTraceQueryEditor","props","onChange","value","datasource","selectedDatasource","data","client","datasourceURL","options","datasourceUrl","query","handleQueryChange","handleQueryBlur","handleDatasourceChange","next","draft","nextDatasource","undefined","Error"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAAgCA,mBAAmB,QAAQ,4BAA4B;AACvF,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,aAAa,EAAEC,sBAAsB,EAAEC,yBAAyB,QAAQ,8BAA8B;AAE/G,SAAgCC,aAAa,QAAQ,uBAAuB;AAC5E,SAASC,8BAA8B,QAAQ,mCAAmC;AAElF,OAAO,SAASC,sBAAsBC,KAA4B;IAChE,MAAM,EAAEC,SAAQ,EAAEC,MAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,WAAU,EAAE,GAAGD;IACvB,MAAME,qBAAqBD,uBAAAA,wBAAAA,aAAcT;IAEzC,MAAM,EAAEW,MAAMC,OAAM,EAAE,GAAGd,oBAAiCY;IAC1D,MAAMG,gBAAgBD,mBAAAA,oBAAAA,KAAAA,IAAAA,OAAQE,QAAQC;IAEtC,MAAM,EAAEC,MAAK,EAAEC,kBAAiB,EAAEC,gBAAe,EAAE,GAAGf,cAAcG;IAEpE,MAAMa,yBAA4D,CAACC;QACjE,IAAIlB,0BAA0BkB,OAAO;YACnCb,SACER,QAAQS,OAAO,CAACa;gBACd,sFAAsF;gBACtF,MAAMC,iBAAiBrB,uBAAuBmB,QAAQG,YAAYH;gBAClEC,MAAMZ,aAAaa;YACrB;YAEF;QACF;QAEA,MAAM,IAAIE,MAAM;IAClB;IAEA,qBACE,KAACpB;QACCM,oBAAoBA;QACpBS,wBAAwBA;QACxBN,eAAeA;QACfG,OAAOA;QACPC,mBAAmBA;QACnBC,iBAAiBA;;AAGvB"}
1
+ {"version":3,"sources":["../../../src/plugins/tempo-trace-query/TempoTraceQueryEditor.tsx"],"sourcesContent":["// Copyright 2023 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 { DatasourceSelectProps, useDatasourceClient } from '@perses-dev/plugin-system';\nimport { produce } from 'immer';\nimport { DEFAULT_TEMPO, isDefaultTempoSelector, isTempoDatasourceSelector } from '../../model/tempo-selectors';\nimport { TempoClient } from '../../model/tempo-client';\nimport { TraceQueryEditorProps, useQueryState } from './query-editor-model';\nimport { DashboardTempoTraceQueryEditor } from './DashboardTempoTraceQueryEditor';\n\nexport function TempoTraceQueryEditor(props: TraceQueryEditorProps) {\n const { onChange, value } = props;\n const { datasource } = value;\n const selectedDatasource = datasource ?? DEFAULT_TEMPO;\n\n const { data: client } = useDatasourceClient<TempoClient>(selectedDatasource);\n const datasourceURL = client?.options.datasourceUrl;\n\n const { query, handleQueryChange, handleQueryBlur } = useQueryState(props);\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (next) => {\n if (isTempoDatasourceSelector(next)) {\n onChange(\n produce(value, (draft) => {\n // If they're using the default, just omit the datasource prop (i.e. set to undefined)\n const nextDatasource = isDefaultTempoSelector(next) ? undefined : next;\n draft.datasource = nextDatasource;\n })\n );\n return;\n }\n\n throw new Error('Got unexpected non-Tempo datasource selector');\n };\n\n return (\n <DashboardTempoTraceQueryEditor\n selectedDatasource={selectedDatasource}\n handleDatasourceChange={handleDatasourceChange}\n datasourceURL={datasourceURL}\n query={query}\n handleQueryChange={handleQueryChange}\n handleQueryBlur={handleQueryBlur}\n />\n );\n}\n"],"names":["useDatasourceClient","produce","DEFAULT_TEMPO","isDefaultTempoSelector","isTempoDatasourceSelector","useQueryState","DashboardTempoTraceQueryEditor","TempoTraceQueryEditor","props","onChange","value","datasource","selectedDatasource","data","client","datasourceURL","options","datasourceUrl","query","handleQueryChange","handleQueryBlur","handleDatasourceChange","next","draft","nextDatasource","undefined","Error"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAAgCA,mBAAmB,QAAQ,4BAA4B;AACvF,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,aAAa,EAAEC,sBAAsB,EAAEC,yBAAyB,QAAQ,8BAA8B;AAE/G,SAAgCC,aAAa,QAAQ,uBAAuB;AAC5E,SAASC,8BAA8B,QAAQ,mCAAmC;AAElF,OAAO,SAASC,sBAAsBC,KAA4B;IAChE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,qBAAqBD,uBAAAA,wBAAAA,aAAcT;IAEzC,MAAM,EAAEW,MAAMC,MAAM,EAAE,GAAGd,oBAAiCY;IAC1D,MAAMG,gBAAgBD,mBAAAA,6BAAAA,OAAQE,OAAO,CAACC,aAAa;IAEnD,MAAM,EAAEC,KAAK,EAAEC,iBAAiB,EAAEC,eAAe,EAAE,GAAGf,cAAcG;IAEpE,MAAMa,yBAA4D,CAACC;QACjE,IAAIlB,0BAA0BkB,OAAO;YACnCb,SACER,QAAQS,OAAO,CAACa;gBACd,sFAAsF;gBACtF,MAAMC,iBAAiBrB,uBAAuBmB,QAAQG,YAAYH;gBAClEC,MAAMZ,UAAU,GAAGa;YACrB;YAEF;QACF;QAEA,MAAM,IAAIE,MAAM;IAClB;IAEA,qBACE,KAACpB;QACCM,oBAAoBA;QACpBS,wBAAwBA;QACxBN,eAAeA;QACfG,OAAOA;QACPC,mBAAmBA;QACnBC,iBAAiBA;;AAGvB"}
@@ -1,5 +1,4 @@
1
- /// <reference types="react" />
2
1
  export declare function TraceQLEditor({ ...rest }: {
3
2
  [x: string]: any;
4
- }): JSX.Element;
3
+ }): import("react/jsx-runtime").JSX.Element;
5
4
  //# sourceMappingURL=TraceQLEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TraceQLEditor.d.ts","sourceRoot":"","sources":["../../../src/plugins/tempo-trace-query/TraceQLEditor.tsx"],"names":[],"mappings":";AAgBA,wBAAgB,aAAa,CAAC,EAAE,GAAG,IAAI,EAAE;;CAAA,eAgBxC"}
1
+ {"version":3,"file":"TraceQLEditor.d.ts","sourceRoot":"","sources":["../../../src/plugins/tempo-trace-query/TraceQLEditor.tsx"],"names":[],"mappings":"AAgBA,wBAAgB,aAAa,CAAC,EAAE,GAAG,IAAI,EAAE;;CAAA,2CAgBxC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/plugins/tempo-trace-query/TraceQLEditor.tsx"],"sourcesContent":["// Copyright 2023 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 { useTheme } from '@mui/material';\nimport CodeMirror from '@uiw/react-codemirror';\n\nexport function TraceQLEditor({ ...rest }) {\n const theme = useTheme();\n const isDarkMode = theme.palette.mode === 'dark';\n\n return (\n <CodeMirror\n {...rest}\n style={{ border: `1px solid ${theme.palette.divider}` }}\n theme={isDarkMode ? 'dark' : 'light'}\n basicSetup={{\n highlightActiveLine: false,\n highlightActiveLineGutter: false,\n foldGutter: false,\n }}\n />\n );\n}\n"],"names":["useTheme","CodeMirror","TraceQLEditor","rest","theme","isDarkMode","palette","mode","style","border","divider","basicSetup","highlightActiveLine","highlightActiveLineGutter","foldGutter"],"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,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,gBAAgB,wBAAwB;AAE/C,OAAO,SAASC,cAAc,EAAE,GAAGC,MAAM;IACvC,MAAMC,QAAQJ;IACd,MAAMK,aAAaD,MAAME,QAAQC,SAAS;IAE1C,qBACE,KAACN;QACE,GAAGE,IAAI;QACRK,OAAO;YAAEC,QAAQ,CAAC,UAAU,EAAEL,MAAME,QAAQI,QAAQ,CAAC;QAAC;QACtDN,OAAOC,aAAa,SAAS;QAC7BM,YAAY;YACVC,qBAAqB;YACrBC,2BAA2B;YAC3BC,YAAY;QACd;;AAGN"}
1
+ {"version":3,"sources":["../../../src/plugins/tempo-trace-query/TraceQLEditor.tsx"],"sourcesContent":["// Copyright 2023 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 { useTheme } from '@mui/material';\nimport CodeMirror from '@uiw/react-codemirror';\n\nexport function TraceQLEditor({ ...rest }) {\n const theme = useTheme();\n const isDarkMode = theme.palette.mode === 'dark';\n\n return (\n <CodeMirror\n {...rest}\n style={{ border: `1px solid ${theme.palette.divider}` }}\n theme={isDarkMode ? 'dark' : 'light'}\n basicSetup={{\n highlightActiveLine: false,\n highlightActiveLineGutter: false,\n foldGutter: false,\n }}\n />\n );\n}\n"],"names":["useTheme","CodeMirror","TraceQLEditor","rest","theme","isDarkMode","palette","mode","style","border","divider","basicSetup","highlightActiveLine","highlightActiveLineGutter","foldGutter"],"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,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,gBAAgB,wBAAwB;AAE/C,OAAO,SAASC,cAAc,EAAE,GAAGC,MAAM;IACvC,MAAMC,QAAQJ;IACd,MAAMK,aAAaD,MAAME,OAAO,CAACC,IAAI,KAAK;IAE1C,qBACE,KAACN;QACE,GAAGE,IAAI;QACRK,OAAO;YAAEC,QAAQ,CAAC,UAAU,EAAEL,MAAME,OAAO,CAACI,OAAO,CAAC,CAAC;QAAC;QACtDN,OAAOC,aAAa,SAAS;QAC7BM,YAAY;YACVC,qBAAqB;YACrBC,2BAA2B;YAC3BC,YAAY;QACd;;AAGN"}
@@ -13,7 +13,7 @@
13
13
  import { getUnixTime } from 'date-fns';
14
14
  import { TEMPO_DATASOURCE_KIND } from '../../model/tempo-selectors';
15
15
  export function getUnixTimeRange(timeRange) {
16
- const { start , end } = timeRange;
16
+ const { start, end } = timeRange;
17
17
  return {
18
18
  start: Math.ceil(getUnixTime(start)),
19
19
  end: Math.ceil(getUnixTime(end))
@@ -50,7 +50,7 @@ export const getTraceData = async (spec, context)=>{
50
50
  return spec.query;
51
51
  }
52
52
  // handle time range selection from UI drop down (e.g. last 5 minutes, last 1 hour )
53
- const { start , end } = getUnixTimeRange(context === null || context === void 0 ? void 0 : context.absoluteTimeRange);
53
+ const { start, end } = getUnixTimeRange(context === null || context === void 0 ? void 0 : context.absoluteTimeRange);
54
54
  const queryStartTime = '&start=' + start;
55
55
  const queryEndTime = '&end=' + end;
56
56
  const queryWithTimeRange = encodeURI(spec.query) + queryStartTime + queryEndTime;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/plugins/tempo-trace-query/get-trace-data.ts"],"sourcesContent":["// Copyright 2023 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 { TraceQueryPlugin } from '@perses-dev/plugin-system';\nimport { TraceData, TraceValue, AbsoluteTimeRange } from '@perses-dev/core';\nimport { getUnixTime } from 'date-fns';\nimport { TempoTraceQuerySpec } from '../../model/trace-query-model';\nimport { TEMPO_DATASOURCE_KIND, TempoDatasourceSelector } from '../../model/tempo-selectors';\nimport { TempoClient } from '../../model/tempo-client';\n\nexport function getUnixTimeRange(timeRange: AbsoluteTimeRange) {\n const { start, end } = timeRange;\n return {\n start: Math.ceil(getUnixTime(start)),\n end: Math.ceil(getUnixTime(end)),\n };\n}\n\nexport const getTraceData: TraceQueryPlugin<TempoTraceQuerySpec>['getTraceData'] = async (spec, context) => {\n if (spec.query === undefined || spec.query === null || spec.query === '') {\n // Do not make a request to the backend, instead return an empty TraceData\n console.error('TempoTraceQuery is undefined, null, or an empty string.');\n return { traces: [] };\n }\n\n const defaultTempoDatasource: TempoDatasourceSelector = {\n kind: TEMPO_DATASOURCE_KIND,\n };\n\n const client: TempoClient = await context.datasourceStore.getDatasourceClient(\n spec.datasource ?? defaultTempoDatasource\n );\n\n const datasourceUrl = client?.options?.datasourceUrl;\n if (datasourceUrl === undefined || datasourceUrl === null || datasourceUrl === '') {\n console.error('TempoDatasource is undefined, null, or an empty string.');\n return { traces: [] };\n }\n\n const getQuery = () => {\n // if time range not defined -- only return the query from the spec\n if (context.absoluteTimeRange === undefined) {\n return spec.query;\n }\n // if the query already contains a time range (i.e.start and end times)\n if (spec.query.includes('start=') || spec.query.includes('end=')) {\n return spec.query;\n }\n // handle time range selection from UI drop down (e.g. last 5 minutes, last 1 hour )\n const { start, end } = getUnixTimeRange(context?.absoluteTimeRange);\n const queryStartTime = '&start=' + start;\n const queryEndTime = '&end=' + end;\n const queryWithTimeRange = encodeURI(spec.query) + queryStartTime + queryEndTime;\n return queryWithTimeRange;\n };\n\n const enrichedTraceResponse = await client.getEnrichedTraceQuery(getQuery(), datasourceUrl);\n\n const traces: TraceValue[] = enrichedTraceResponse.traces.map((traceValue) => {\n const startTimeUnixMs = parseInt(traceValue.summary.startTimeUnixNano) * 1e-6; // convert to millisecond for eChart time format\n const durationMs = traceValue.summary.durationMs;\n const spanCount = traceValue.spanCount;\n const errorCount = traceValue.errorCount;\n const traceId = traceValue.summary.traceID;\n const name = `rootServiceName=\"${traceValue.summary.rootServiceName.trim()}\", rootTraceName=\"${traceValue.summary.rootServiceName.trim()}\"`;\n\n return {\n startTimeUnixMs,\n durationMs,\n spanCount,\n errorCount,\n traceId,\n name,\n };\n });\n\n const traceData: TraceData = {\n traces,\n metadata: {\n executedQueryString: spec.query,\n },\n };\n\n return traceData;\n};\n"],"names":["getUnixTime","TEMPO_DATASOURCE_KIND","getUnixTimeRange","timeRange","start","end","Math","ceil","getTraceData","spec","context","client","query","undefined","console","error","traces","defaultTempoDatasource","kind","datasourceStore","getDatasourceClient","datasource","datasourceUrl","options","getQuery","absoluteTimeRange","includes","queryStartTime","queryEndTime","queryWithTimeRange","encodeURI","enrichedTraceResponse","getEnrichedTraceQuery","map","traceValue","startTimeUnixMs","parseInt","summary","startTimeUnixNano","durationMs","spanCount","errorCount","traceId","traceID","name","rootServiceName","trim","traceData","metadata","executedQueryString"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,SAASA,WAAW,QAAQ,WAAW;AAEvC,SAASC,qBAAqB,QAAiC,8BAA8B;AAG7F,OAAO,SAASC,iBAAiBC,SAA4B;IAC3D,MAAM,EAAEC,MAAK,EAAEC,IAAG,EAAE,GAAGF;IACvB,OAAO;QACLC,OAAOE,KAAKC,KAAKP,YAAYI;QAC7BC,KAAKC,KAAKC,KAAKP,YAAYK;IAC7B;AACF;AAEA,OAAO,MAAMG,eAAsE,OAAOC,MAAMC;QAexEC;IAdtB,IAAIF,KAAKG,UAAUC,aAAaJ,KAAKG,UAAU,QAAQH,KAAKG,UAAU,IAAI;QACxE,0EAA0E;QAC1EE,QAAQC,MAAM;QACd,OAAO;YAAEC,QAAQ,EAAE;QAAC;IACtB;IAEA,MAAMC,yBAAkD;QACtDC,MAAMjB;IACR;QAGEQ;IADF,MAAME,SAAsB,MAAMD,QAAQS,gBAAgBC,oBACxDX,CAAAA,mBAAAA,KAAKY,wBAALZ,8BAAAA,mBAAmBQ;IAGrB,MAAMK,gBAAgBX,mBAAAA,oBAAAA,KAAAA,IAAAA,CAAAA,kBAAAA,OAAQY,qBAARZ,6BAAAA,KAAAA,IAAAA,gBAAiBW;IACvC,IAAIA,kBAAkBT,aAAaS,kBAAkB,QAAQA,kBAAkB,IAAI;QACjFR,QAAQC,MAAM;QACd,OAAO;YAAEC,QAAQ,EAAE;QAAC;IACtB;IAEA,MAAMQ,WAAW;QACf,mEAAmE;QACnE,IAAId,QAAQe,sBAAsBZ,WAAW;YAC3C,OAAOJ,KAAKG;QACd;QACA,uEAAuE;QACvE,IAAIH,KAAKG,MAAMc,SAAS,aAAajB,KAAKG,MAAMc,SAAS,SAAS;YAChE,OAAOjB,KAAKG;QACd;QACA,oFAAoF;QACpF,MAAM,EAAER,MAAK,EAAEC,IAAG,EAAE,GAAGH,iBAAiBQ,oBAAAA,qBAAAA,KAAAA,IAAAA,QAASe;QACjD,MAAME,iBAAiB,YAAYvB;QACnC,MAAMwB,eAAe,UAAUvB;QAC/B,MAAMwB,qBAAqBC,UAAUrB,KAAKG,SAASe,iBAAiBC;QACpE,OAAOC;IACT;IAEA,MAAME,wBAAwB,MAAMpB,OAAOqB,sBAAsBR,YAAYF;IAE7E,MAAMN,SAAuBe,sBAAsBf,OAAOiB,IAAI,CAACC;QAC7D,MAAMC,kBAAkBC,SAASF,WAAWG,QAAQC,qBAAqB,MAAM,gDAAgD;QAC/H,MAAMC,aAAaL,WAAWG,QAAQE;QACtC,MAAMC,YAAYN,WAAWM;QAC7B,MAAMC,aAAaP,WAAWO;QAC9B,MAAMC,UAAUR,WAAWG,QAAQM;QACnC,MAAMC,OAAO,CAAC,iBAAiB,EAAEV,WAAWG,QAAQQ,gBAAgBC,OAAO,kBAAkB,EAAEZ,WAAWG,QAAQQ,gBAAgBC,OAAO,CAAC,CAAC;QAE3I,OAAO;YACLX;YACAI;YACAC;YACAC;YACAC;YACAE;QACF;IACF;IAEA,MAAMG,YAAuB;QAC3B/B;QACAgC,UAAU;YACRC,qBAAqBxC,KAAKG;QAC5B;IACF;IAEA,OAAOmC;AACT,EAAE"}
1
+ {"version":3,"sources":["../../../src/plugins/tempo-trace-query/get-trace-data.ts"],"sourcesContent":["// Copyright 2023 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 { TraceQueryPlugin } from '@perses-dev/plugin-system';\nimport { TraceData, TraceValue, AbsoluteTimeRange } from '@perses-dev/core';\nimport { getUnixTime } from 'date-fns';\nimport { TempoTraceQuerySpec } from '../../model/trace-query-model';\nimport { TEMPO_DATASOURCE_KIND, TempoDatasourceSelector } from '../../model/tempo-selectors';\nimport { TempoClient } from '../../model/tempo-client';\n\nexport function getUnixTimeRange(timeRange: AbsoluteTimeRange) {\n const { start, end } = timeRange;\n return {\n start: Math.ceil(getUnixTime(start)),\n end: Math.ceil(getUnixTime(end)),\n };\n}\n\nexport const getTraceData: TraceQueryPlugin<TempoTraceQuerySpec>['getTraceData'] = async (spec, context) => {\n if (spec.query === undefined || spec.query === null || spec.query === '') {\n // Do not make a request to the backend, instead return an empty TraceData\n console.error('TempoTraceQuery is undefined, null, or an empty string.');\n return { traces: [] };\n }\n\n const defaultTempoDatasource: TempoDatasourceSelector = {\n kind: TEMPO_DATASOURCE_KIND,\n };\n\n const client: TempoClient = await context.datasourceStore.getDatasourceClient(\n spec.datasource ?? defaultTempoDatasource\n );\n\n const datasourceUrl = client?.options?.datasourceUrl;\n if (datasourceUrl === undefined || datasourceUrl === null || datasourceUrl === '') {\n console.error('TempoDatasource is undefined, null, or an empty string.');\n return { traces: [] };\n }\n\n const getQuery = () => {\n // if time range not defined -- only return the query from the spec\n if (context.absoluteTimeRange === undefined) {\n return spec.query;\n }\n // if the query already contains a time range (i.e.start and end times)\n if (spec.query.includes('start=') || spec.query.includes('end=')) {\n return spec.query;\n }\n // handle time range selection from UI drop down (e.g. last 5 minutes, last 1 hour )\n const { start, end } = getUnixTimeRange(context?.absoluteTimeRange);\n const queryStartTime = '&start=' + start;\n const queryEndTime = '&end=' + end;\n const queryWithTimeRange = encodeURI(spec.query) + queryStartTime + queryEndTime;\n return queryWithTimeRange;\n };\n\n const enrichedTraceResponse = await client.getEnrichedTraceQuery(getQuery(), datasourceUrl);\n\n const traces: TraceValue[] = enrichedTraceResponse.traces.map((traceValue) => {\n const startTimeUnixMs = parseInt(traceValue.summary.startTimeUnixNano) * 1e-6; // convert to millisecond for eChart time format\n const durationMs = traceValue.summary.durationMs;\n const spanCount = traceValue.spanCount;\n const errorCount = traceValue.errorCount;\n const traceId = traceValue.summary.traceID;\n const name = `rootServiceName=\"${traceValue.summary.rootServiceName.trim()}\", rootTraceName=\"${traceValue.summary.rootServiceName.trim()}\"`;\n\n return {\n startTimeUnixMs,\n durationMs,\n spanCount,\n errorCount,\n traceId,\n name,\n };\n });\n\n const traceData: TraceData = {\n traces,\n metadata: {\n executedQueryString: spec.query,\n },\n };\n\n return traceData;\n};\n"],"names":["getUnixTime","TEMPO_DATASOURCE_KIND","getUnixTimeRange","timeRange","start","end","Math","ceil","getTraceData","spec","context","client","query","undefined","console","error","traces","defaultTempoDatasource","kind","datasourceStore","getDatasourceClient","datasource","datasourceUrl","options","getQuery","absoluteTimeRange","includes","queryStartTime","queryEndTime","queryWithTimeRange","encodeURI","enrichedTraceResponse","getEnrichedTraceQuery","map","traceValue","startTimeUnixMs","parseInt","summary","startTimeUnixNano","durationMs","spanCount","errorCount","traceId","traceID","name","rootServiceName","trim","traceData","metadata","executedQueryString"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,SAASA,WAAW,QAAQ,WAAW;AAEvC,SAASC,qBAAqB,QAAiC,8BAA8B;AAG7F,OAAO,SAASC,iBAAiBC,SAA4B;IAC3D,MAAM,EAAEC,KAAK,EAAEC,GAAG,EAAE,GAAGF;IACvB,OAAO;QACLC,OAAOE,KAAKC,IAAI,CAACP,YAAYI;QAC7BC,KAAKC,KAAKC,IAAI,CAACP,YAAYK;IAC7B;AACF;AAEA,OAAO,MAAMG,eAAsE,OAAOC,MAAMC;QAexEC;IAdtB,IAAIF,KAAKG,KAAK,KAAKC,aAAaJ,KAAKG,KAAK,KAAK,QAAQH,KAAKG,KAAK,KAAK,IAAI;QACxE,0EAA0E;QAC1EE,QAAQC,KAAK,CAAC;QACd,OAAO;YAAEC,QAAQ,EAAE;QAAC;IACtB;IAEA,MAAMC,yBAAkD;QACtDC,MAAMjB;IACR;QAGEQ;IADF,MAAME,SAAsB,MAAMD,QAAQS,eAAe,CAACC,mBAAmB,CAC3EX,CAAAA,mBAAAA,KAAKY,UAAU,cAAfZ,8BAAAA,mBAAmBQ;IAGrB,MAAMK,gBAAgBX,mBAAAA,8BAAAA,kBAAAA,OAAQY,OAAO,cAAfZ,sCAAAA,gBAAiBW,aAAa;IACpD,IAAIA,kBAAkBT,aAAaS,kBAAkB,QAAQA,kBAAkB,IAAI;QACjFR,QAAQC,KAAK,CAAC;QACd,OAAO;YAAEC,QAAQ,EAAE;QAAC;IACtB;IAEA,MAAMQ,WAAW;QACf,mEAAmE;QACnE,IAAId,QAAQe,iBAAiB,KAAKZ,WAAW;YAC3C,OAAOJ,KAAKG,KAAK;QACnB;QACA,uEAAuE;QACvE,IAAIH,KAAKG,KAAK,CAACc,QAAQ,CAAC,aAAajB,KAAKG,KAAK,CAACc,QAAQ,CAAC,SAAS;YAChE,OAAOjB,KAAKG,KAAK;QACnB;QACA,oFAAoF;QACpF,MAAM,EAAER,KAAK,EAAEC,GAAG,EAAE,GAAGH,iBAAiBQ,oBAAAA,8BAAAA,QAASe,iBAAiB;QAClE,MAAME,iBAAiB,YAAYvB;QACnC,MAAMwB,eAAe,UAAUvB;QAC/B,MAAMwB,qBAAqBC,UAAUrB,KAAKG,KAAK,IAAIe,iBAAiBC;QACpE,OAAOC;IACT;IAEA,MAAME,wBAAwB,MAAMpB,OAAOqB,qBAAqB,CAACR,YAAYF;IAE7E,MAAMN,SAAuBe,sBAAsBf,MAAM,CAACiB,GAAG,CAAC,CAACC;QAC7D,MAAMC,kBAAkBC,SAASF,WAAWG,OAAO,CAACC,iBAAiB,IAAI,MAAM,gDAAgD;QAC/H,MAAMC,aAAaL,WAAWG,OAAO,CAACE,UAAU;QAChD,MAAMC,YAAYN,WAAWM,SAAS;QACtC,MAAMC,aAAaP,WAAWO,UAAU;QACxC,MAAMC,UAAUR,WAAWG,OAAO,CAACM,OAAO;QAC1C,MAAMC,OAAO,CAAC,iBAAiB,EAAEV,WAAWG,OAAO,CAACQ,eAAe,CAACC,IAAI,GAAG,kBAAkB,EAAEZ,WAAWG,OAAO,CAACQ,eAAe,CAACC,IAAI,GAAG,CAAC,CAAC;QAE3I,OAAO;YACLX;YACAI;YACAC;YACAC;YACAC;YACAE;QACF;IACF;IAEA,MAAMG,YAAuB;QAC3B/B;QACAgC,UAAU;YACRC,qBAAqBxC,KAAKG,KAAK;QACjC;IACF;IAEA,OAAOmC;AACT,EAAE"}
@@ -1,6 +1,6 @@
1
1
  import { OptionsEditorProps } from '@perses-dev/plugin-system';
2
2
  import { TempoTraceQuerySpec } from '../../model/trace-query-model';
3
- export declare type TraceQueryEditorProps = OptionsEditorProps<TempoTraceQuerySpec>;
3
+ export type TraceQueryEditorProps = OptionsEditorProps<TempoTraceQuerySpec>;
4
4
  /**
5
5
  * A hook for managing the `query` state in PrometheusTimeSeriesQuerySpec. Returns the `query` value, along with
6
6
  * `onChange` and `onBlur` event handlers to the input. Keeps a local copy of the user's input and only syncs those
@@ -1 +1 @@
1
- {"version":3,"file":"query-editor-model.d.ts","sourceRoot":"","sources":["../../../src/plugins/tempo-trace-query/query-editor-model.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,oBAAY,qBAAqB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;AAE5E;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,qBAAqB;;2BAe1B,MAAM;;EAgBrC"}
1
+ {"version":3,"file":"query-editor-model.d.ts","sourceRoot":"","sources":["../../../src/plugins/tempo-trace-query/query-editor-model.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;AAE5E;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,qBAAqB;;2BAe1B,MAAM;;EAgBrC"}
@@ -18,7 +18,7 @@ import { produce } from 'immer';
18
18
  * changes with the overall spec value once the input is blurred to prevent re-running queries in the panel's preview
19
19
  * every time the user types.
20
20
  */ export function useQueryState(props) {
21
- const { onChange , value } = props;
21
+ const { onChange, value } = props;
22
22
  // Local copy of the query's value
23
23
  const [query, setQuery] = useState(value.query);
24
24
  // This is basically "getDerivedStateFromProps" to make sure if spec's value changes external to this component,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/plugins/tempo-trace-query/query-editor-model.ts"],"sourcesContent":["// Copyright 2023 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 { useState } from 'react';\nimport { produce } from 'immer';\nimport { OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { TempoTraceQuerySpec } from '../../model/trace-query-model';\n\nexport type TraceQueryEditorProps = OptionsEditorProps<TempoTraceQuerySpec>;\n\n/**\n * A hook for managing the `query` state in PrometheusTimeSeriesQuerySpec. Returns the `query` value, along with\n * `onChange` and `onBlur` event handlers to the input. Keeps a local copy of the user's input and only syncs those\n * changes with the overall spec value once the input is blurred to prevent re-running queries in the panel's preview\n * every time the user types.\n */\nexport function useQueryState(props: TraceQueryEditorProps) {\n const { onChange, value } = props;\n\n // Local copy of the query's value\n const [query, setQuery] = useState(value.query);\n\n // This is basically \"getDerivedStateFromProps\" to make sure if spec's value changes external to this component,\n // we render with the latest value\n const [lastSyncedQuery, setLastSyncedQuery] = useState(value.query);\n if (value.query !== lastSyncedQuery) {\n setQuery(value.query);\n setLastSyncedQuery(value.query);\n }\n\n // Update our local state's copy as the user types\n const handleQueryChange = (e: string) => {\n setQuery(e);\n };\n\n // Propagate changes to the query's value when the input is blurred to avoid constantly re-running queries in the\n // PanelPreview\n const handleQueryBlur = () => {\n setLastSyncedQuery(query);\n onChange(\n produce(value, (draft) => {\n draft.query = query;\n })\n );\n };\n\n return { query, handleQueryChange, handleQueryBlur };\n}\n"],"names":["useState","produce","useQueryState","props","onChange","value","query","setQuery","lastSyncedQuery","setLastSyncedQuery","handleQueryChange","e","handleQueryBlur","draft"],"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,QAAQ,QAAQ,QAAQ;AACjC,SAASC,OAAO,QAAQ,QAAQ;AAMhC;;;;;CAKC,GACD,OAAO,SAASC,cAAcC,KAA4B;IACxD,MAAM,EAAEC,SAAQ,EAAEC,MAAK,EAAE,GAAGF;IAE5B,kCAAkC;IAClC,MAAM,CAACG,OAAOC,SAAS,GAAGP,SAASK,MAAMC;IAEzC,gHAAgH;IAChH,kCAAkC;IAClC,MAAM,CAACE,iBAAiBC,mBAAmB,GAAGT,SAASK,MAAMC;IAC7D,IAAID,MAAMC,UAAUE,iBAAiB;QACnCD,SAASF,MAAMC;QACfG,mBAAmBJ,MAAMC;IAC3B;IAEA,kDAAkD;IAClD,MAAMI,oBAAoB,CAACC;QACzBJ,SAASI;IACX;IAEA,iHAAiH;IACjH,eAAe;IACf,MAAMC,kBAAkB;QACtBH,mBAAmBH;QACnBF,SACEH,QAAQI,OAAO,CAACQ;YACdA,MAAMP,QAAQA;QAChB;IAEJ;IAEA,OAAO;QAAEA;QAAOI;QAAmBE;IAAgB;AACrD"}
1
+ {"version":3,"sources":["../../../src/plugins/tempo-trace-query/query-editor-model.ts"],"sourcesContent":["// Copyright 2023 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 { useState } from 'react';\nimport { produce } from 'immer';\nimport { OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { TempoTraceQuerySpec } from '../../model/trace-query-model';\n\nexport type TraceQueryEditorProps = OptionsEditorProps<TempoTraceQuerySpec>;\n\n/**\n * A hook for managing the `query` state in PrometheusTimeSeriesQuerySpec. Returns the `query` value, along with\n * `onChange` and `onBlur` event handlers to the input. Keeps a local copy of the user's input and only syncs those\n * changes with the overall spec value once the input is blurred to prevent re-running queries in the panel's preview\n * every time the user types.\n */\nexport function useQueryState(props: TraceQueryEditorProps) {\n const { onChange, value } = props;\n\n // Local copy of the query's value\n const [query, setQuery] = useState(value.query);\n\n // This is basically \"getDerivedStateFromProps\" to make sure if spec's value changes external to this component,\n // we render with the latest value\n const [lastSyncedQuery, setLastSyncedQuery] = useState(value.query);\n if (value.query !== lastSyncedQuery) {\n setQuery(value.query);\n setLastSyncedQuery(value.query);\n }\n\n // Update our local state's copy as the user types\n const handleQueryChange = (e: string) => {\n setQuery(e);\n };\n\n // Propagate changes to the query's value when the input is blurred to avoid constantly re-running queries in the\n // PanelPreview\n const handleQueryBlur = () => {\n setLastSyncedQuery(query);\n onChange(\n produce(value, (draft) => {\n draft.query = query;\n })\n );\n };\n\n return { query, handleQueryChange, handleQueryBlur };\n}\n"],"names":["useState","produce","useQueryState","props","onChange","value","query","setQuery","lastSyncedQuery","setLastSyncedQuery","handleQueryChange","e","handleQueryBlur","draft"],"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,QAAQ,QAAQ,QAAQ;AACjC,SAASC,OAAO,QAAQ,QAAQ;AAMhC;;;;;CAKC,GACD,OAAO,SAASC,cAAcC,KAA4B;IACxD,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAE5B,kCAAkC;IAClC,MAAM,CAACG,OAAOC,SAAS,GAAGP,SAASK,MAAMC,KAAK;IAE9C,gHAAgH;IAChH,kCAAkC;IAClC,MAAM,CAACE,iBAAiBC,mBAAmB,GAAGT,SAASK,MAAMC,KAAK;IAClE,IAAID,MAAMC,KAAK,KAAKE,iBAAiB;QACnCD,SAASF,MAAMC,KAAK;QACpBG,mBAAmBJ,MAAMC,KAAK;IAChC;IAEA,kDAAkD;IAClD,MAAMI,oBAAoB,CAACC;QACzBJ,SAASI;IACX;IAEA,iHAAiH;IACjH,eAAe;IACf,MAAMC,kBAAkB;QACtBH,mBAAmBH;QACnBF,SACEH,QAAQI,OAAO,CAACQ;YACdA,MAAMP,KAAK,GAAGA;QAChB;IAEJ;IAEA,OAAO;QAAEA;QAAOI;QAAmBE;IAAgB;AACrD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/tempo-plugin",
3
- "version": "0.0.0-snapshot-scatter-chart-embed-8efdfab",
3
+ "version": "0.0.0-snapshot-scatterplot-fix-imports-95e1b59",
4
4
  "description": "A Perses plugin to interact with Tempo traces",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/perses/perses/blob/main/README.md",
@@ -29,9 +29,9 @@
29
29
  "lint:fix": "eslint --fix src --ext .ts,.tsx"
30
30
  },
31
31
  "dependencies": {
32
- "@perses-dev/components": "0.0.0-snapshot-scatter-chart-embed-8efdfab",
33
- "@perses-dev/core": "0.0.0-snapshot-scatter-chart-embed-8efdfab",
34
- "@perses-dev/plugin-system": "0.0.0-snapshot-scatter-chart-embed-8efdfab"
32
+ "@perses-dev/components": "0.0.0-snapshot-scatterplot-fix-imports-95e1b59",
33
+ "@perses-dev/core": "0.0.0-snapshot-scatterplot-fix-imports-95e1b59",
34
+ "@perses-dev/plugin-system": "0.0.0-snapshot-scatterplot-fix-imports-95e1b59"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "react": "^17.0.2 || ^18.0.0"