@perses-dev/tempo-plugin 0.51.0-rc.3 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mf/js/{1096.553b6b51.js → 1096.c549c391.js} +1 -1
- package/__mf/js/{Tempo.14181426.js → Tempo.e7d268a6.js} +2 -2
- package/__mf/js/async/{5503.13c3d255.js → 5503.6e47fa95.js} +1 -1
- package/__mf/js/async/__federation_expose_TempoTraceQuery.4183e294.js +1 -0
- package/__mf/js/{main.12c3bab7.js → main.4498dd88.js} +1 -1
- package/lib/cjs/plugins/tempo-trace-query/TempoTraceQueryEditor.js +9 -16
- package/lib/cjs/plugins/tempo-trace-query/get-trace-data.js +29 -1
- package/lib/plugins/tempo-trace-query/TempoTraceQueryEditor.d.ts.map +1 -1
- package/lib/plugins/tempo-trace-query/TempoTraceQueryEditor.js +10 -17
- package/lib/plugins/tempo-trace-query/TempoTraceQueryEditor.js.map +1 -1
- package/lib/plugins/tempo-trace-query/get-trace-data.js +29 -1
- package/lib/plugins/tempo-trace-query/get-trace-data.js.map +1 -1
- package/mf-manifest.json +12 -12
- package/mf-stats.json +14 -14
- package/package.json +9 -1
- package/__mf/js/async/__federation_expose_TempoTraceQuery.b0a9313f.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkTempo=self.webpackChunkTempo||[]).push([["7969"],{50117:function(e,t,r){r.r(t),r.d(t,{TempoTraceQuery:()=>L});var a=r(58891),i=r(14267),o=r(20461);let n="TempoDatasource",s={kind:n},l=async(e,t)=>{if(void 0===e.query||null===e.query||""===e.query)return console.error("TempoTraceQuery is undefined, null, or an empty string."),{searchResult:[]};let r=await t.datasourceStore.listDatasourceSelectItems(n),s=(0,a.datasourceSelectValueToSelector)(e.datasource,t.variableState,r)??{kind:n},l=await t.datasourceStore.getDatasourceClient(s);return(0,i.j)(e.query)?{trace:function(e){let t={resourceSpans:e.batches};for(let e of t.resourceSpans)for(let t of e.scopeSpans)for(let e of t.spans)32!=e.traceId.length&&(e.traceId=c(e.traceId)),16!=e.spanId.length&&(e.spanId=c(e.spanId)),e.parentSpanId&&16!=e.parentSpanId.length&&(e.parentSpanId=c(e.parentSpanId));return t}(await l.query({traceId:e.query})),metadata:{executedQueryString:e.query}}:{searchResult:(await l.searchWithFallback((()=>{let r={q:e.query};if(t.absoluteTimeRange){let{start:e,end:a}=function(e){let{start:t,end:r}=e;return{start:Math.ceil((0,o.getUnixTime)(t)),end:Math.ceil((0,o.getUnixTime)(r))}}(t.absoluteTimeRange);r.start=e,r.end=a}return e.limit&&(r.limit=e.limit),r})())).traces.map(e=>({startTimeUnixMs:1e-6*parseInt(e.startTimeUnixNano),durationMs:e.durationMs??0,traceId:e.traceID,rootServiceName:e.rootServiceName,rootTraceName:e.rootTraceName,serviceStats:e.serviceStats||{}})),metadata:{executedQueryString:e.query}}};function c(e){try{return atob(e).split("").map(e=>e.charCodeAt(0).toString(16).padStart(2,"0").toUpperCase()).join("")}catch{return e}}var u=r(24246),d=r(25283),p=r(90192),m=r(8695),f=r(72629),g=r(75586),h=r(54538),v=r(94776),y=r(68808),b=r(46359),k=r(61262),T=r(70534),S=r(94197);let x=(0,S.Gv)({LineComment:S.pJ.comment,"Parent Resource Span Identifier":S.pJ.labelName,IntrinsicField:S.pJ.labelName,String:S.pJ.string,"Integer Float Duration":S.pJ.number,Static:S.pJ.literal,"Aggregate AggregateExpression":S.pJ.function(S.pJ.keyword),"And Or":S.pJ.logicOperator,"Gt Lt Desc Anc tilde ExperimentalOp":S.pJ.bitwiseOperator,ComparisonOp:S.pJ.compareOperator,Pipe:S.pJ.operator,ScalarOp:S.pJ.arithmeticOperator,"( )":S.pJ.paren,"[ ]":S.pJ.squareBracket,"{ }":S.pJ.brace,"⚠":S.pJ.invalid});var C=r(13018),I=r(29085);async function D(e,t){let{state:r,pos:a}=t,i=function(e,t,r){var a,i,o,n,s,l,c,u,d,p,m,f,g,h,v,y,b,k,S,x,C;let I=r.resolveInner(t,-1);switch(I.type.id){case T.Bu:if((null===I.firstChild||(null===(a=I.firstChild)||void 0===a?void 0:a.type.id)===0)&&!e.sliceDoc(I.from,t).includes("}"))return{scopes:[{kind:"Scopes"},{kind:"TagName",scope:"intrinsic"}],from:t};break;case T.Im:return{scopes:[{kind:"Scopes"},{kind:"TagName",scope:"intrinsic"}],from:t};case T.AW:if((null===(i=I.firstChild)||void 0===i?void 0:i.type.id)===T._z)return{scopes:[{kind:"TagName",scope:"resource"}],from:t};if((null===(o=I.firstChild)||void 0===o?void 0:o.type.id)===T.Dr)return{scopes:[{kind:"TagName",scope:"span"}],from:t};if("."===e.sliceDoc(I.from,I.to))return{scopes:[{kind:"TagName",scope:"resource"},{kind:"TagName",scope:"span"}],from:t};break;case T.xb:if((null===(n=I.parent)||void 0===n?void 0:n.type.id)===T.AW){if(e.sliceDoc(I.parent.from,I.parent.to).includes(":"))return{scopes:[{kind:"TagName",scope:"intrinsic"}],from:I.parent.from};if((null===(l=I.parent)||void 0===l?void 0:null===(s=l.firstChild)||void 0===s?void 0:s.type.id)===T._z)return{scopes:[{kind:"TagName",scope:"resource"}],from:I.from};if((null===(u=I.parent)||void 0===u?void 0:null===(c=u.firstChild)||void 0===c?void 0:c.type.id)===T.Dr)return{scopes:[{kind:"TagName",scope:"span"}],from:I.from};if((null===(p=I.parent)||void 0===p?void 0:null===(d=p.firstChild)||void 0===d?void 0:d.type.id)===T.xb)return{scopes:[{kind:"TagName",scope:"resource"},{kind:"TagName",scope:"span"}],from:I.from}}break;case T.Of:if((null===(f=I.parent)||void 0===f?void 0:null===(m=f.firstChild)||void 0===m?void 0:m.type.id)===T.Im){let r=I.parent.firstChild;return{scopes:[{kind:"TagValue",tag:e.sliceDoc(r.from,r.to)}],from:t}}break;case T.Ld:if((null===(y=I.parent)||void 0===y?void 0:null===(v=y.parent)||void 0===v?void 0:null===(h=v.parent)||void 0===h?void 0:null===(g=h.firstChild)||void 0===g?void 0:g.type.id)===T.Im&&!/^".*"$/.test(e.sliceDoc(I.from,t))){let t=I.parent.parent.parent.firstChild;return{scopes:[{kind:"TagValue",tag:e.sliceDoc(t.from,t.to)}],from:I.from+1}}break;case 0:if((null===(b=I.prevSibling)||void 0===b?void 0:b.type.id)===T.Of&&(null===(S=I.parent)||void 0===S?void 0:null===(k=S.firstChild)||void 0===k?void 0:k.type.id)===T.Im){let t=I.parent.firstChild;return{scopes:[{kind:"TagValue",tag:e.sliceDoc(t.from,t.to)}],from:'"'===e.sliceDoc(I.from,I.from+1)?I.from+1:I.from}}if((null===(x=I.parent)||void 0===x?void 0:x.type.id)===T.Bu||(null===(C=I.parent)||void 0===C?void 0:C.type.id)===T.Im)return{scopes:[{kind:"Scopes"},{kind:"TagName",scope:"intrinsic"}],from:I.from}}}(r,a,(0,k.qz)(r));return i?{options:await q(e,i.scopes),from:i.from,to:i.to}:null}async function q(e,t){let r=[];for(let a of t)switch(a.kind){case"Scopes":r.push(Promise.resolve([{label:"span"},{label:"resource"}]));break;case"TagName":r.push(w(e,a.scope));break;case"TagValue":r.push(O(e,a.tag))}return(await Promise.all(r)).flat()}function N(e){if(!e)return{};let t=(0,I.q0)(e)?e:(0,I.sG)(e);return{start:Math.round(t.start.getTime()/1e3),end:Math.round(t.end.getTime()/1e3)}}async function w(e,t){if(!e.client)return[];let{start:r,end:a}=N(e.timeRange),{limit:i,maxStaleValues:o}=e;return(await e.client.searchTags({scope:t,start:r,end:a,limit:i,maxStaleValues:o})).scopes.flatMap(e=>e.tags).map(e=>({label:e}))}function J(e,t,r,a){let i=t.label;'"'!==e.state.sliceDoc(r-1,r)&&(i='"'+i),'"'!==e.state.sliceDoc(a,a+1)&&(i+='"'),e.dispatch((0,C.$L)(e.state,i,r,a))}async function O(e,t){if(!e.client)return[];let{start:r,end:a}=N(e.timeRange),{limit:i,maxStaleValues:o}=e,n=await e.client.searchTagValues({tag:t,start:r,end:a,limit:i,maxStaleValues:o}),s=[];for(let{type:e,value:t}of n.tagValues)switch(e){case"string":s.push({label:t??"",displayLabel:t??"(empty string)",apply:J});break;case"keyword":case"int":s.push({label:t??"",displayLabel:t??"(empty string)"})}return s}function j(e){let{completionConfig:t,...r}=e,a=(0,v.Z)(),o="dark"===a.palette.mode,n=(0,h.useMemo)(()=>(function(e){let t=k.qp.define({parser:T.E2.configure({props:[x]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//"}}}),r=t.data.of({autocomplete:t=>D(e,t).catch(e=>console.error("error during TraceQL auto-complete",e))});return[t,r]})(t),[t]),s=(0,h.useMemo)(()=>{let e="light"===a.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return b.tk.theme({"&":{backgroundColor:"transparent !important",border:`1px solid ${e}`,borderRadius:`${a.shape.borderRadius}px`},"&.cm-focused.cm-editor":{outline:"none"},".cm-content":{padding:"8px"}})},[a]);return(0,u.jsxs)(d.Z,{position:"relative",sx:{flexGrow:1},children:[(0,u.jsx)(y.Z,{shrink:!0,sx:{position:"absolute",top:"-6px",left:"10px",padding:"0 4px",color:a.palette.text.primary,backgroundColor:a.palette.background.default,zIndex:1},children:"TraceQL Expression"}),(0,u.jsx)(b.ZP,{...r,theme:o?"dark":"light",basicSetup:{lineNumbers:!1,highlightActiveLine:!1,highlightActiveLineGutter:!1,foldGutter:!1,syntaxHighlighting:!(0,i.j)(r.value??"")},extensions:[b.tk.lineWrapping,n,s],placeholder:'Example: {span.http.method = "GET"}'})]})}let L={getTraceData:l,OptionsEditorComponent:function(e){let{onChange:t,value:r}=e,{datasource:i}=r,o=i??s,l=(0,a.useDatasourceSelectValueToSelector)(o,n),c=(0,f.useId)("tempo-datasource-label"),{data:v}=(0,a.useDatasourceClient)(l),{timeRange:y}=(0,a.useTimeRange)(),b=(0,h.useMemo)(()=>({client:v,timeRange:y}),[v,y]),{query:k,handleQueryChange:T,handleQueryBlur:S}=function(e){let{onChange:t,value:r}=e,[a,i]=(0,h.useState)(r.query),[o,n]=(0,h.useState)(r.query);return r.query!==o&&(i(r.query),n(r.query)),{query:a,handleQueryChange:e=>{i(e)},handleQueryBlur:()=>{n(a),t((0,g.Uy)(r,e=>{e.query=a}))}}}(e),{limit:x,handleLimitChange:C,handleLimitBlur:I,limitHasError:D}=function(e){let{onChange:t,value:r}=e,[a,i]=(0,h.useState)(r.limit?r.limit.toString():""),[o,n]=(0,h.useState)(r.limit);r.limit!==o&&(i(r.limit?r.limit.toString():""),n(r.limit));let s=!(""===a||/^[0-9]+$/.test(a)&&parseInt(a)>0);return{limit:a,handleLimitChange:e=>{i(e)},handleLimitBlur:()=>{if(s)return;let e=""===a?void 0:parseInt(a);n(e),t((0,g.Uy)(r,t=>{t.limit=e}))},limitHasError:s}}(e);return(0,u.jsxs)(d.Z,{spacing:2,children:[(0,u.jsx)(p.Z,{margin:"dense",fullWidth:!1,children:(0,u.jsx)(a.DatasourceSelect,{datasourcePluginKind:n,value:o,onChange:e=>{if((0,a.isVariableDatasource)(e)||e.kind===n){t((0,g.Uy)(r,t=>{let r=(0,a.isVariableDatasource)(e)||void 0!==e.name?e:void 0;t.datasource=r}));return}throw Error("Got unexpected non-Tempo datasource selector")},labelId:c,label:"Tempo Datasource",notched:!0})}),(0,u.jsxs)(d.Z,{direction:"row",spacing:2,children:[(0,u.jsx)(j,{completionConfig:b,value:k,onChange:T,onBlur:S}),(0,u.jsx)(m.Z,{size:"small",label:"Max Traces",value:x,error:D,onChange:e=>C(e.target.value),onBlur:I,sx:{width:"110px"}})]})]})},createInitialOptions:()=>({query:"",limit:20,datasource:void 0}),dependsOn:e=>({variables:[...(0,a.isVariableDatasource)(e.datasource)?(0,a.parseVariables)(e.datasource??""):[]]})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e={5311:function(e,r,t){Promise.all([t.e("9677"),t.e("2179"),t.e("1620")]).then(t.bind(t,29161))}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var a=r[o]={id:o,loaded:!1,exports:{}};return e[o].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}t.m=e,t.c=r,t.federation||(t.federation={chunkMatcher:function(e){return!/^(2([39]41|179)|9(157|46|494|677)|(16|38)09|(503|598|622|778|826)7|6316|7482)$/.test(e)}}),t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce((r,o)=>(t.f[o](e,r),r),[])),t.u=e=>"__mf/js/async/"+("2118"===e?"lib-router":e)+"."+({1465:"21c847e0",1540:"089c4f28",1620:"45989def",1964:"75933dd4",2118:"46460b13",2823:"df67fd4b",3044:"8b419ccf",3090:"90251187",3224:"8d499a63",3355:"8bd6f6bd",3960:"2228bf7e",3980:"c94e78cd",4075:"4c40db9f",4238:"db631f1f",4289:"5e2073e0",4421:"07335985",5207:"e63b049c",5214:"fb1215df",5220:"80e3b05e",528:"2759052c",5503:"13c3d255",5790:"949d8d1c",5913:"d10c6185",5924:"bfb4b2fd",5981:"4700ddf6",6292:"2481b399",6770:"4b9911ea",694:"91676c53",7127:"ccd78bd8",7376:"a69c2e5a",738:"2cdddba7",7740:"1ecb3732",7832:"9f2a70d0",8485:"434a672e",8488:"d3005164",8597:"07c3a890",8930:"ae855fbe",9173:"83562213",9478:"57f45cd9"})[e]+".js",t.miniCssF=e=>"__mf/css/async/"+e+"."+({2341:"c10cf504",5207:"c10cf504"})[e]+".css",t.h=()=>"549aa0135ccd5646",(()=>{t.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})()})(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={},r="Tempo:";t.l=function(o,n,a,s){if(e[o]){e[o].push(n);return}if(void 0!==a)for(var i,l,c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var f=c[d];if(f.getAttribute("src")==o||f.getAttribute("data-webpack")==r+a){i=f;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,t.nc&&i.setAttribute("nonce",t.nc),i.setAttribute("data-webpack",r+a),i.src=o),e[o]=[n];var u=function(r,t){i.onerror=i.onload=null,clearTimeout(h);var n=e[o];if(delete e[o],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(function(e){return e(t)}),r)return r(t)},h=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),l&&document.head.appendChild(i)}})(),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),t.nc=void 0,(()=>{var e=[];t.O=(r,o,n,a)=>{if(o){a=a||0;for(var s=e.length;s>0&&e[s-1][2]>a;s--)e[s]=e[s-1];e[s]=[o,n,a];return}for(var i=1/0,s=0;s<e.length;s++){for(var[o,n,a]=e[s],l=!0,c=0;c<o.length;c++)(!1&a||i>=a)&&Object.keys(t.O).every(e=>t.O[e](o[c]))?o.splice(c--,1):(l=!1,a<i&&(i=a));if(l){e.splice(s--,1);var d=n();void 0!==d&&(r=d)}}return r}})(),t.p="/plugins/Tempo/",t.rv=()=>"1.2.8",t.S={},t.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"@emotion/react",version:"11.14.0",factory:()=>Promise.all([t.e("3960"),t.e("9677"),t.e("8930")]).then(()=>()=>t(96434)),eager:0,singleton:1,requiredVersion:"^11.11.3"},{name:"@emotion/styled",version:"11.14.0",factory:()=>Promise.all([t.e("9677"),t.e("9157"),t.e("694")]).then(()=>()=>t(51958)),eager:0,singleton:1},{name:"@hookform/resolvers",version:"3.10.0",factory:()=>Promise.all([t.e("3809"),t.e("5214")]).then(()=>()=>t(81228)),eager:0,singleton:1},{name:"@perses-dev/components",version:"0.51.0-rc.1",factory:()=>Promise.all([t.e("3044"),t.e("8485"),t.e("4289"),t.e("7376"),t.e("1540"),t.e("5220"),t.e("7127"),t.e("4238"),t.e("3224"),t.e("3090"),t.e("8597"),t.e("7832"),t.e("9677"),t.e("2179"),t.e("5987"),t.e("9157"),t.e("946"),t.e("8267"),t.e("5037"),t.e("5207")]).then(()=>()=>t(16870)),eager:0,singleton:1},{name:"@perses-dev/dashboards",version:"0.51.0-rc.1",factory:()=>Promise.all([t.e("3044"),t.e("8485"),t.e("4289"),t.e("1540"),t.e("5220"),t.e("7127"),t.e("1465"),t.e("5913"),t.e("9677"),t.e("2179"),t.e("5987"),t.e("9157"),t.e("3809"),t.e("946"),t.e("6227"),t.e("2941"),t.e("7787"),t.e("2823")]).then(()=>()=>t(76803)),eager:0,singleton:1},{name:"@perses-dev/explore",version:"0.51.0-rc.1",factory:()=>Promise.all([t.e("4289"),t.e("7376"),t.e("1540"),t.e("5220"),t.e("1465"),t.e("4421"),t.e("9677"),t.e("9157"),t.e("946"),t.e("2941"),t.e("7787"),t.e("1609"),t.e("9478")]).then(()=>()=>t(73223)),eager:0,singleton:1},{name:"@perses-dev/plugin-system",version:"0.51.0-rc.1",factory:()=>Promise.all([t.e("2118"),t.e("3044"),t.e("8485"),t.e("4289"),t.e("7376"),t.e("1540"),t.e("5220"),t.e("1465"),t.e("528"),t.e("9677"),t.e("2179"),t.e("5987"),t.e("9157"),t.e("3809"),t.e("946"),t.e("6227"),t.e("8267"),t.e("2941"),t.e("7482"),t.e("6316"),t.e("5924")]).then(()=>()=>t(42625)),eager:0,singleton:1},{name:"@tanstack/react-query",version:"4.39.1",factory:()=>Promise.all([t.e("3980"),t.e("9677")]).then(()=>()=>t(27474)),eager:0,singleton:1},{name:"date-fns",version:"4.1.0",factory:()=>Promise.all([t.e("4238"),t.e("3224"),t.e("4075")]).then(()=>()=>t(99657)),eager:0,singleton:1},{name:"echarts",version:"5.5.0",factory:()=>Promise.all([t.e("3090"),t.e("5503")]).then(()=>()=>t(28919)),eager:0,singleton:1},{name:"lodash",version:"4.17.21",factory:()=>t.e("5981").then(()=>()=>t(98784)),eager:0,singleton:1},{name:"react-dom",version:"18.3.1",factory:()=>Promise.all([t.e("9173"),t.e("9677")]).then(()=>()=>t(31542)),eager:0,singleton:1,requiredVersion:"18.2.0"},{name:"react-hook-form",version:"7.54.2",factory:()=>Promise.all([t.e("6292"),t.e("9677")]).then(()=>()=>t(36679)),eager:0,singleton:1},{name:"react",version:"18.3.1",factory:()=>t.e("1964").then(()=>()=>t(27378)),eager:0,singleton:1,requiredVersion:"18.2.0"}]},uniqueName:"Tempo"},t.I=t.I||function(){throw Error("should have __webpack_require__.I")},t.consumesLoadingData={chunkMapping:{6227:["84275","64293","91909"],2941:["20370"],9157:["72116"],7787:["71141"],7482:["32600","90382"],1609:["76006"],9677:["54538"],6316:["55922","30156","57751","74614"],5037:["48137"],9494:["57871"],8267:["4665"],2179:["6085"],5987:["20461"],946:["45913"],3809:["57576"]},moduleIdToConsumeDataMapping:{57751:{shareScope:"default",shareKey:"@perses-dev/plugin-system",import:"@perses-dev/plugin-system",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>()=>t(42625)},30156:{shareScope:"default",shareKey:"echarts",import:"echarts",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("3090"),t.e("5503")]).then(()=>()=>t(28919))},72116:{shareScope:"default",shareKey:"@emotion/react",import:"@emotion/react",requiredVersion:"^11.11.3",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("3960").then(()=>()=>t(96434))},20370:{shareScope:"default",shareKey:"@perses-dev/components",import:"@perses-dev/components",requiredVersion:"0.51.0-rc.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("3044"),t.e("8485"),t.e("7376"),t.e("7127"),t.e("4238"),t.e("3224"),t.e("3090"),t.e("8597"),t.e("7832"),t.e("2179"),t.e("5987"),t.e("8267"),t.e("5037"),t.e("2341")]).then(()=>()=>t(16870))},84275:{shareScope:"default",shareKey:"@hookform/resolvers",import:"@hookform/resolvers",requiredVersion:"^2.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("738").then(()=>()=>t(81228))},90382:{shareScope:"default",shareKey:"@perses-dev/explore",import:"@perses-dev/explore",requiredVersion:"^0.51.0-rc.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("4289"),t.e("7376"),t.e("1540"),t.e("1465"),t.e("4421"),t.e("2941"),t.e("7787"),t.e("1609"),t.e("8488")]).then(()=>()=>t(73223))},4665:{shareScope:"default",shareKey:"date-fns-tz",import:"date-fns-tz",requiredVersion:"^3.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("3224"),t.e("7740"),t.e("9494")]).then(()=>()=>t(48872))},54538:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("1964").then(()=>()=>t(27378))},64293:{shareScope:"default",shareKey:"react-hook-form",import:"react-hook-form",requiredVersion:"^7.46.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("6292").then(()=>()=>t(36679))},55922:{shareScope:"default",shareKey:"@emotion/styled",import:"@emotion/styled",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("6770").then(()=>()=>t(51958))},71141:{shareScope:"default",shareKey:"@perses-dev/plugin-system",import:"@perses-dev/plugin-system",requiredVersion:"0.51.0-rc.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("2118"),t.e("3044"),t.e("8485"),t.e("7376"),t.e("528"),t.e("2179"),t.e("5987"),t.e("3809"),t.e("6227"),t.e("8267"),t.e("7482"),t.e("6316")]).then(()=>()=>t(42625))},48137:{shareScope:"default",shareKey:"react-hook-form",import:"react-hook-form",requiredVersion:"^7.51.3",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("6292").then(()=>()=>t(36679))},20461:{shareScope:"default",shareKey:"date-fns",import:"date-fns",requiredVersion:"^4.1.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("4238"),t.e("3224"),t.e("4075")]).then(()=>()=>t(99657))},74614:{shareScope:"default",shareKey:"lodash",import:"lodash",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("5981").then(()=>()=>t(98784))},6085:{shareScope:"default",shareKey:"react-dom",import:"react-dom",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("9173").then(()=>()=>t(31542))},57871:{shareScope:"default",shareKey:"date-fns",import:"date-fns",requiredVersion:"^3.0.0 || ^4.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("4238"),t.e("4075")]).then(()=>()=>t(99657))},91909:{shareScope:"default",shareKey:"@tanstack/react-query",import:"@tanstack/react-query",requiredVersion:"^4.39.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("3980").then(()=>()=>t(27474))},76006:{shareScope:"default",shareKey:"@perses-dev/dashboards",import:"@perses-dev/dashboards",requiredVersion:"0.51.0-rc.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("3044"),t.e("8485"),t.e("7127"),t.e("5913"),t.e("2179"),t.e("5987"),t.e("3809"),t.e("6227")]).then(()=>()=>t(76803))},57576:{shareScope:"default",shareKey:"react-hook-form",import:"react-hook-form",requiredVersion:"^7.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("6292"),t.e("9677")]).then(()=>()=>t(36679))},32600:{shareScope:"default",shareKey:"@perses-dev/dashboards",import:"@perses-dev/dashboards",requiredVersion:"^0.51.0-rc.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("3044"),t.e("8485"),t.e("4289"),t.e("1540"),t.e("7127"),t.e("1465"),t.e("5913"),t.e("2179"),t.e("5987"),t.e("3809"),t.e("6227"),t.e("2941"),t.e("7787"),t.e("3355")]).then(()=>()=>t(76803))},45913:{shareScope:"default",shareKey:"@emotion/styled",import:"@emotion/styled",requiredVersion:"^11.3.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("5790").then(()=>()=>t(51958))}},initialConsumes:[]},t.f.consumes=t.f.consumes||function(){throw Error("should have __webpack_require__.f.consumes")},(()=>{if("undefined"!=typeof document){var e=function(e,r,o,n,a){var s=document.createElement("link");return s.rel="stylesheet",s.type="text/css",t.nc&&(s.nonce=t.nc),s.onerror=s.onload=function(t){if(s.onerror=s.onload=null,"load"===t.type)n();else{var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.href||r,l=Error("Loading CSS chunk "+e+" failed.\\n("+i+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=o,l.request=i,s.parentNode&&s.parentNode.removeChild(s),a(l)}},s.href=r,o?o.parentNode.insertBefore(s,o.nextSibling):document.head.appendChild(s),s},r=function(e,r){for(var t=document.getElementsByTagName("link"),o=0;o<t.length;o++){var n=t[o],a=n.getAttribute("data-href")||n.getAttribute("href");if("stylesheet"===n.rel&&(a===e||a===r))return n}for(var s=document.getElementsByTagName("style"),o=0;o<s.length;o++){var n=s[o],a=n.getAttribute("data-href");if(a===e||a===r)return n}},o={6909:0};t.f.miniCss=function(n,a){if(o[n])a.push(o[n]);else if(0!==o[n]&&({2341:1,5207:1})[n])a.push(o[n]=new Promise(function(o,a){var s=t.miniCssF(n),i=t.p+s;if(r(s,i))return o();e(n,i,null,o,a)}).then(function(){o[n]=0},function(e){throw delete o[n],e}))}}})(),(()=>{var e={6909:0};t.f.j=function(r,o){var n=t.o(e,r)?e[r]:void 0;if(0!==n){if(n)o.push(n[2]);else if(/^(2([39]41|179)|9(157|46|494|677)|(16|38)09|(503|598|622|778|826)7|6316|7482)$/.test(r))e[r]=0;else{var a=new Promise((t,o)=>n=e[r]=[t,o]);o.push(n[2]=a);var s=t.p+t.u(r),i=Error();t.l(s,function(o){if(t.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var a=o&&("load"===o.type?"missing":o.type),s=o&&o.target&&o.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+s+")",i.name="ChunkLoadError",i.type=a,i.request=s,n[1](i)}},"chunk-"+r,r)}}},t.O.j=r=>0===e[r];var r=(r,o)=>{var n,a,[s,i,l]=o,c=0;if(s.some(r=>0!==e[r])){for(n in i)t.o(i,n)&&(t.m[n]=i[n]);if(l)var d=l(t)}for(r&&r(o);c<s.length;c++)a=s[c],t.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return t.O(d)},o=self.webpackChunkTempo=self.webpackChunkTempo||[];o.forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o))})(),t.ruid="bundler=rspack@1.2.8",t.O(void 0,["1096"],function(){return t(96985)});var o=t.O(void 0,["1096"],function(){return t(5311)});o=t.O(o)})();
|
|
1
|
+
(()=>{var e={5311:function(e,r,t){Promise.all([t.e("9677"),t.e("2179"),t.e("1620")]).then(t.bind(t,29161))}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var a=r[o]={id:o,loaded:!1,exports:{}};return e[o].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}t.m=e,t.c=r,t.federation||(t.federation={chunkMatcher:function(e){return!/^(2([39]41|179)|9(157|46|494|677)|(16|38)09|(503|598|622|778|826)7|6316|7482)$/.test(e)}}),t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce((r,o)=>(t.f[o](e,r),r),[])),t.u=e=>"__mf/js/async/"+("2118"===e?"lib-router":e)+"."+({1465:"21c847e0",1540:"089c4f28",1620:"45989def",1964:"75933dd4",2118:"46460b13",2823:"df67fd4b",3044:"8b419ccf",3090:"90251187",3224:"8d499a63",3355:"8bd6f6bd",3960:"2228bf7e",3980:"c94e78cd",4075:"4c40db9f",4238:"db631f1f",4289:"5e2073e0",4421:"07335985",5207:"e63b049c",5214:"fb1215df",5220:"80e3b05e",528:"2759052c",5503:"6e47fa95",5790:"949d8d1c",5913:"d10c6185",5924:"bfb4b2fd",5981:"4700ddf6",6292:"2481b399",6770:"4b9911ea",694:"91676c53",7127:"ccd78bd8",7376:"a69c2e5a",738:"2cdddba7",7740:"1ecb3732",7832:"9f2a70d0",8485:"434a672e",8488:"d3005164",8597:"07c3a890",8930:"ae855fbe",9173:"83562213",9478:"57f45cd9"})[e]+".js",t.miniCssF=e=>"__mf/css/async/"+e+"."+({2341:"c10cf504",5207:"c10cf504"})[e]+".css",t.h=()=>"540c66ebdffeb6e6",(()=>{t.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})()})(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={},r="Tempo:";t.l=function(o,n,a,s){if(e[o]){e[o].push(n);return}if(void 0!==a)for(var i,l,c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var f=c[d];if(f.getAttribute("src")==o||f.getAttribute("data-webpack")==r+a){i=f;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,t.nc&&i.setAttribute("nonce",t.nc),i.setAttribute("data-webpack",r+a),i.src=o),e[o]=[n];var u=function(r,t){i.onerror=i.onload=null,clearTimeout(h);var n=e[o];if(delete e[o],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(function(e){return e(t)}),r)return r(t)},h=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),l&&document.head.appendChild(i)}})(),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),t.nc=void 0,(()=>{var e=[];t.O=(r,o,n,a)=>{if(o){a=a||0;for(var s=e.length;s>0&&e[s-1][2]>a;s--)e[s]=e[s-1];e[s]=[o,n,a];return}for(var i=1/0,s=0;s<e.length;s++){for(var[o,n,a]=e[s],l=!0,c=0;c<o.length;c++)(!1&a||i>=a)&&Object.keys(t.O).every(e=>t.O[e](o[c]))?o.splice(c--,1):(l=!1,a<i&&(i=a));if(l){e.splice(s--,1);var d=n();void 0!==d&&(r=d)}}return r}})(),t.p="/plugins/Tempo/",t.rv=()=>"1.2.8",t.S={},t.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"@emotion/react",version:"11.14.0",factory:()=>Promise.all([t.e("3960"),t.e("9677"),t.e("8930")]).then(()=>()=>t(96434)),eager:0,singleton:1,requiredVersion:"^11.11.3"},{name:"@emotion/styled",version:"11.14.0",factory:()=>Promise.all([t.e("9677"),t.e("9157"),t.e("694")]).then(()=>()=>t(51958)),eager:0,singleton:1},{name:"@hookform/resolvers",version:"3.10.0",factory:()=>Promise.all([t.e("3809"),t.e("5214")]).then(()=>()=>t(81228)),eager:0,singleton:1},{name:"@perses-dev/components",version:"0.51.0-rc.1",factory:()=>Promise.all([t.e("3044"),t.e("8485"),t.e("4289"),t.e("7376"),t.e("1540"),t.e("5220"),t.e("7127"),t.e("4238"),t.e("3224"),t.e("3090"),t.e("8597"),t.e("7832"),t.e("9677"),t.e("2179"),t.e("5987"),t.e("9157"),t.e("946"),t.e("8267"),t.e("5037"),t.e("5207")]).then(()=>()=>t(16870)),eager:0,singleton:1},{name:"@perses-dev/dashboards",version:"0.51.0-rc.1",factory:()=>Promise.all([t.e("3044"),t.e("8485"),t.e("4289"),t.e("1540"),t.e("5220"),t.e("7127"),t.e("1465"),t.e("5913"),t.e("9677"),t.e("2179"),t.e("5987"),t.e("9157"),t.e("3809"),t.e("946"),t.e("6227"),t.e("2941"),t.e("7787"),t.e("2823")]).then(()=>()=>t(76803)),eager:0,singleton:1},{name:"@perses-dev/explore",version:"0.51.0-rc.1",factory:()=>Promise.all([t.e("4289"),t.e("7376"),t.e("1540"),t.e("5220"),t.e("1465"),t.e("4421"),t.e("9677"),t.e("9157"),t.e("946"),t.e("2941"),t.e("7787"),t.e("1609"),t.e("9478")]).then(()=>()=>t(73223)),eager:0,singleton:1},{name:"@perses-dev/plugin-system",version:"0.51.0-rc.1",factory:()=>Promise.all([t.e("2118"),t.e("3044"),t.e("8485"),t.e("4289"),t.e("7376"),t.e("1540"),t.e("5220"),t.e("1465"),t.e("528"),t.e("9677"),t.e("2179"),t.e("5987"),t.e("9157"),t.e("3809"),t.e("946"),t.e("6227"),t.e("8267"),t.e("2941"),t.e("7482"),t.e("6316"),t.e("5924")]).then(()=>()=>t(42625)),eager:0,singleton:1},{name:"@tanstack/react-query",version:"4.39.1",factory:()=>Promise.all([t.e("3980"),t.e("9677")]).then(()=>()=>t(27474)),eager:0,singleton:1},{name:"date-fns",version:"4.1.0",factory:()=>Promise.all([t.e("4238"),t.e("3224"),t.e("4075")]).then(()=>()=>t(99657)),eager:0,singleton:1},{name:"echarts",version:"5.5.0",factory:()=>Promise.all([t.e("3090"),t.e("5503")]).then(()=>()=>t(28919)),eager:0,singleton:1},{name:"lodash",version:"4.17.21",factory:()=>t.e("5981").then(()=>()=>t(98784)),eager:0,singleton:1},{name:"react-dom",version:"18.3.1",factory:()=>Promise.all([t.e("9173"),t.e("9677")]).then(()=>()=>t(31542)),eager:0,singleton:1,requiredVersion:"18.2.0"},{name:"react-hook-form",version:"7.54.2",factory:()=>Promise.all([t.e("6292"),t.e("9677")]).then(()=>()=>t(36679)),eager:0,singleton:1},{name:"react",version:"18.3.1",factory:()=>t.e("1964").then(()=>()=>t(27378)),eager:0,singleton:1,requiredVersion:"18.2.0"}]},uniqueName:"Tempo"},t.I=t.I||function(){throw Error("should have __webpack_require__.I")},t.consumesLoadingData={chunkMapping:{6227:["84275","64293","91909"],2941:["20370"],9157:["72116"],7787:["71141"],7482:["32600","90382"],1609:["76006"],9677:["54538"],6316:["55922","30156","57751","74614"],5037:["48137"],9494:["57871"],8267:["4665"],2179:["6085"],5987:["20461"],946:["45913"],3809:["57576"]},moduleIdToConsumeDataMapping:{57751:{shareScope:"default",shareKey:"@perses-dev/plugin-system",import:"@perses-dev/plugin-system",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>()=>t(42625)},30156:{shareScope:"default",shareKey:"echarts",import:"echarts",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("3090"),t.e("5503")]).then(()=>()=>t(28919))},72116:{shareScope:"default",shareKey:"@emotion/react",import:"@emotion/react",requiredVersion:"^11.11.3",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("3960").then(()=>()=>t(96434))},20370:{shareScope:"default",shareKey:"@perses-dev/components",import:"@perses-dev/components",requiredVersion:"0.51.0-rc.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("3044"),t.e("8485"),t.e("7376"),t.e("7127"),t.e("4238"),t.e("3224"),t.e("3090"),t.e("8597"),t.e("7832"),t.e("2179"),t.e("5987"),t.e("8267"),t.e("5037"),t.e("2341")]).then(()=>()=>t(16870))},84275:{shareScope:"default",shareKey:"@hookform/resolvers",import:"@hookform/resolvers",requiredVersion:"^2.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("738").then(()=>()=>t(81228))},90382:{shareScope:"default",shareKey:"@perses-dev/explore",import:"@perses-dev/explore",requiredVersion:"^0.51.0-rc.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("4289"),t.e("7376"),t.e("1540"),t.e("1465"),t.e("4421"),t.e("2941"),t.e("7787"),t.e("1609"),t.e("8488")]).then(()=>()=>t(73223))},4665:{shareScope:"default",shareKey:"date-fns-tz",import:"date-fns-tz",requiredVersion:"^3.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("3224"),t.e("7740"),t.e("9494")]).then(()=>()=>t(48872))},54538:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("1964").then(()=>()=>t(27378))},64293:{shareScope:"default",shareKey:"react-hook-form",import:"react-hook-form",requiredVersion:"^7.46.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("6292").then(()=>()=>t(36679))},55922:{shareScope:"default",shareKey:"@emotion/styled",import:"@emotion/styled",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("6770").then(()=>()=>t(51958))},71141:{shareScope:"default",shareKey:"@perses-dev/plugin-system",import:"@perses-dev/plugin-system",requiredVersion:"0.51.0-rc.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("2118"),t.e("3044"),t.e("8485"),t.e("7376"),t.e("528"),t.e("2179"),t.e("5987"),t.e("3809"),t.e("6227"),t.e("8267"),t.e("7482"),t.e("6316")]).then(()=>()=>t(42625))},48137:{shareScope:"default",shareKey:"react-hook-form",import:"react-hook-form",requiredVersion:"^7.51.3",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("6292").then(()=>()=>t(36679))},20461:{shareScope:"default",shareKey:"date-fns",import:"date-fns",requiredVersion:"^4.1.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("4238"),t.e("3224"),t.e("4075")]).then(()=>()=>t(99657))},74614:{shareScope:"default",shareKey:"lodash",import:"lodash",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("5981").then(()=>()=>t(98784))},6085:{shareScope:"default",shareKey:"react-dom",import:"react-dom",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("9173").then(()=>()=>t(31542))},57871:{shareScope:"default",shareKey:"date-fns",import:"date-fns",requiredVersion:"^3.0.0 || ^4.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("4238"),t.e("4075")]).then(()=>()=>t(99657))},91909:{shareScope:"default",shareKey:"@tanstack/react-query",import:"@tanstack/react-query",requiredVersion:"^4.39.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("3980").then(()=>()=>t(27474))},76006:{shareScope:"default",shareKey:"@perses-dev/dashboards",import:"@perses-dev/dashboards",requiredVersion:"0.51.0-rc.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("3044"),t.e("8485"),t.e("7127"),t.e("5913"),t.e("2179"),t.e("5987"),t.e("3809"),t.e("6227")]).then(()=>()=>t(76803))},57576:{shareScope:"default",shareKey:"react-hook-form",import:"react-hook-form",requiredVersion:"^7.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("6292"),t.e("9677")]).then(()=>()=>t(36679))},32600:{shareScope:"default",shareKey:"@perses-dev/dashboards",import:"@perses-dev/dashboards",requiredVersion:"^0.51.0-rc.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("3044"),t.e("8485"),t.e("4289"),t.e("1540"),t.e("7127"),t.e("1465"),t.e("5913"),t.e("2179"),t.e("5987"),t.e("3809"),t.e("6227"),t.e("2941"),t.e("7787"),t.e("3355")]).then(()=>()=>t(76803))},45913:{shareScope:"default",shareKey:"@emotion/styled",import:"@emotion/styled",requiredVersion:"^11.3.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("5790").then(()=>()=>t(51958))}},initialConsumes:[]},t.f.consumes=t.f.consumes||function(){throw Error("should have __webpack_require__.f.consumes")},(()=>{if("undefined"!=typeof document){var e=function(e,r,o,n,a){var s=document.createElement("link");return s.rel="stylesheet",s.type="text/css",t.nc&&(s.nonce=t.nc),s.onerror=s.onload=function(t){if(s.onerror=s.onload=null,"load"===t.type)n();else{var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.href||r,l=Error("Loading CSS chunk "+e+" failed.\\n("+i+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=o,l.request=i,s.parentNode&&s.parentNode.removeChild(s),a(l)}},s.href=r,o?o.parentNode.insertBefore(s,o.nextSibling):document.head.appendChild(s),s},r=function(e,r){for(var t=document.getElementsByTagName("link"),o=0;o<t.length;o++){var n=t[o],a=n.getAttribute("data-href")||n.getAttribute("href");if("stylesheet"===n.rel&&(a===e||a===r))return n}for(var s=document.getElementsByTagName("style"),o=0;o<s.length;o++){var n=s[o],a=n.getAttribute("data-href");if(a===e||a===r)return n}},o={6909:0};t.f.miniCss=function(n,a){if(o[n])a.push(o[n]);else if(0!==o[n]&&({2341:1,5207:1})[n])a.push(o[n]=new Promise(function(o,a){var s=t.miniCssF(n),i=t.p+s;if(r(s,i))return o();e(n,i,null,o,a)}).then(function(){o[n]=0},function(e){throw delete o[n],e}))}}})(),(()=>{var e={6909:0};t.f.j=function(r,o){var n=t.o(e,r)?e[r]:void 0;if(0!==n){if(n)o.push(n[2]);else if(/^(2([39]41|179)|9(157|46|494|677)|(16|38)09|(503|598|622|778|826)7|6316|7482)$/.test(r))e[r]=0;else{var a=new Promise((t,o)=>n=e[r]=[t,o]);o.push(n[2]=a);var s=t.p+t.u(r),i=Error();t.l(s,function(o){if(t.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var a=o&&("load"===o.type?"missing":o.type),s=o&&o.target&&o.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+s+")",i.name="ChunkLoadError",i.type=a,i.request=s,n[1](i)}},"chunk-"+r,r)}}},t.O.j=r=>0===e[r];var r=(r,o)=>{var n,a,[s,i,l]=o,c=0;if(s.some(r=>0!==e[r])){for(n in i)t.o(i,n)&&(t.m[n]=i[n]);if(l)var d=l(t)}for(r&&r(o);c<s.length;c++)a=s[c],t.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return t.O(d)},o=self.webpackChunkTempo=self.webpackChunkTempo||[];o.forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o))})(),t.ruid="bundler=rspack@1.2.8",t.O(void 0,["1096"],function(){return t(96985)});var o=t.O(void 0,["1096"],function(){return t(5311)});o=t.O(o)})();
|
|
@@ -62,24 +62,17 @@ function TempoTraceQueryEditor(props) {
|
|
|
62
62
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
63
63
|
spacing: 2,
|
|
64
64
|
children: [
|
|
65
|
-
/*#__PURE__*/ (0, _jsxruntime.
|
|
65
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControl, {
|
|
66
66
|
margin: "dense",
|
|
67
67
|
fullWidth: false,
|
|
68
|
-
children:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
value: datasourceSelectValue,
|
|
77
|
-
onChange: handleDatasourceChange,
|
|
78
|
-
labelId: datasourceSelectLabelID,
|
|
79
|
-
label: "Tempo Datasource",
|
|
80
|
-
notched: true
|
|
81
|
-
})
|
|
82
|
-
]
|
|
68
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceSelect, {
|
|
69
|
+
datasourcePluginKind: _temposelectors.TEMPO_DATASOURCE_KIND,
|
|
70
|
+
value: datasourceSelectValue,
|
|
71
|
+
onChange: handleDatasourceChange,
|
|
72
|
+
labelId: datasourceSelectLabelID,
|
|
73
|
+
label: "Tempo Datasource",
|
|
74
|
+
notched: true
|
|
75
|
+
})
|
|
83
76
|
}),
|
|
84
77
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
85
78
|
direction: "row",
|
|
@@ -93,9 +93,37 @@ const getTraceData = async (spec, context)=>{
|
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
function parseTraceResponse(response) {
|
|
96
|
-
|
|
96
|
+
const trace = {
|
|
97
97
|
resourceSpans: response.batches
|
|
98
98
|
};
|
|
99
|
+
// Tempo returns Trace ID and Span ID base64-encoded.
|
|
100
|
+
// The OTLP spec defines the encoding in the hex format:
|
|
101
|
+
// Spec: https://opentelemetry.io/docs/specs/otlp/#json-protobuf-encoding
|
|
102
|
+
// Example: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.7.0/examples/trace.json
|
|
103
|
+
// Therefore, let's convert it to hex encoding.
|
|
104
|
+
for (const resourceSpan of trace.resourceSpans){
|
|
105
|
+
for (const scopeSpan of resourceSpan.scopeSpans){
|
|
106
|
+
for (const span of scopeSpan.spans){
|
|
107
|
+
if (span.traceId.length != 32) {
|
|
108
|
+
span.traceId = base64ToHex(span.traceId);
|
|
109
|
+
}
|
|
110
|
+
if (span.spanId.length != 16) {
|
|
111
|
+
span.spanId = base64ToHex(span.spanId);
|
|
112
|
+
}
|
|
113
|
+
if (span.parentSpanId && span.parentSpanId.length != 16) {
|
|
114
|
+
span.parentSpanId = base64ToHex(span.parentSpanId);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return trace;
|
|
120
|
+
}
|
|
121
|
+
function base64ToHex(str) {
|
|
122
|
+
try {
|
|
123
|
+
return atob(str).split('').map((char)=>char.charCodeAt(0).toString(16).padStart(2, '0').toUpperCase()).join('');
|
|
124
|
+
} catch {
|
|
125
|
+
return str;
|
|
126
|
+
}
|
|
99
127
|
}
|
|
100
128
|
function parseSearchResponse(response) {
|
|
101
129
|
return response.traces.map((trace)=>({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TempoTraceQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tempo-trace-query/TempoTraceQueryEditor.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAS9C,OAAO,EAAE,qBAAqB,EAAgC,MAAM,sBAAsB,CAAC;AAE3F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,qBAAqB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"TempoTraceQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tempo-trace-query/TempoTraceQueryEditor.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAS9C,OAAO,EAAE,qBAAqB,EAAgC,MAAM,sBAAsB,CAAC;AAE3F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,qBAAqB,GAAG,YAAY,CA8DhF"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { FormControl,
|
|
14
|
+
import { FormControl, Stack, TextField } from '@mui/material';
|
|
15
15
|
import { useId } from '@perses-dev/components';
|
|
16
16
|
import { DatasourceSelect, useDatasourceClient, useDatasourceSelectValueToSelector, useTimeRange } from '@perses-dev/plugin-system';
|
|
17
17
|
import { produce } from 'immer';
|
|
@@ -52,24 +52,17 @@ export function TempoTraceQueryEditor(props) {
|
|
|
52
52
|
return /*#__PURE__*/ _jsxs(Stack, {
|
|
53
53
|
spacing: 2,
|
|
54
54
|
children: [
|
|
55
|
-
/*#__PURE__*/
|
|
55
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
56
56
|
margin: "dense",
|
|
57
57
|
fullWidth: false,
|
|
58
|
-
children:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
value: datasourceSelectValue,
|
|
67
|
-
onChange: handleDatasourceChange,
|
|
68
|
-
labelId: datasourceSelectLabelID,
|
|
69
|
-
label: "Tempo Datasource",
|
|
70
|
-
notched: true
|
|
71
|
-
})
|
|
72
|
-
]
|
|
58
|
+
children: /*#__PURE__*/ _jsx(DatasourceSelect, {
|
|
59
|
+
datasourcePluginKind: TEMPO_DATASOURCE_KIND,
|
|
60
|
+
value: datasourceSelectValue,
|
|
61
|
+
onChange: handleDatasourceChange,
|
|
62
|
+
labelId: datasourceSelectLabelID,
|
|
63
|
+
label: "Tempo Datasource",
|
|
64
|
+
notched: true
|
|
65
|
+
})
|
|
73
66
|
}),
|
|
74
67
|
/*#__PURE__*/ _jsxs(Stack, {
|
|
75
68
|
direction: "row",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/plugins/tempo-trace-query/TempoTraceQueryEditor.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { FormControl,
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/tempo-trace-query/TempoTraceQueryEditor.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { FormControl, Stack, TextField } from '@mui/material';\nimport { useId } from '@perses-dev/components';\nimport {\n DatasourceSelect,\n DatasourceSelectProps,\n useDatasourceClient,\n useDatasourceSelectValueToSelector,\n useTimeRange,\n} from '@perses-dev/plugin-system';\nimport { produce } from 'immer';\nimport { ReactElement, useMemo } from 'react';\nimport { TraceQLEditor } from '../../components';\nimport { TempoClient } from '../../model/tempo-client';\nimport {\n DEFAULT_TEMPO,\n isDefaultTempoSelector,\n isTempoDatasourceSelector,\n TEMPO_DATASOURCE_KIND,\n} from '../../model/tempo-selectors';\nimport { TraceQueryEditorProps, useLimitState, useQueryState } from './query-editor-model';\n\nexport function TempoTraceQueryEditor(props: TraceQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const datasourceSelectValue = datasource ?? DEFAULT_TEMPO;\n const selectedDatasource = useDatasourceSelectValueToSelector(datasourceSelectValue, TEMPO_DATASOURCE_KIND);\n const datasourceSelectLabelID = useId('tempo-datasource-label'); // for panels with multiple queries, this component is rendered multiple times on the same page\n\n const { data: client } = useDatasourceClient<TempoClient>(selectedDatasource);\n const { timeRange } = useTimeRange();\n const completionConfig = useMemo(() => {\n return { client, timeRange };\n }, [client, timeRange]);\n\n const { query, handleQueryChange, handleQueryBlur } = useQueryState(props);\n const { limit, handleLimitChange, handleLimitBlur, limitHasError } = useLimitState(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 <Stack spacing={2}>\n <FormControl margin=\"dense\" fullWidth={false}>\n <DatasourceSelect\n datasourcePluginKind={TEMPO_DATASOURCE_KIND}\n value={datasourceSelectValue}\n onChange={handleDatasourceChange}\n labelId={datasourceSelectLabelID}\n label=\"Tempo Datasource\"\n notched\n />\n </FormControl>\n <Stack direction=\"row\" spacing={2}>\n <TraceQLEditor\n completionConfig={completionConfig}\n value={query}\n onChange={handleQueryChange}\n onBlur={handleQueryBlur}\n />\n <TextField\n size=\"small\"\n label=\"Max Traces\"\n value={limit}\n error={limitHasError}\n onChange={(e) => handleLimitChange(e.target.value)}\n onBlur={handleLimitBlur}\n sx={{ width: '110px' }}\n />\n </Stack>\n </Stack>\n );\n}\n"],"names":["FormControl","Stack","TextField","useId","DatasourceSelect","useDatasourceClient","useDatasourceSelectValueToSelector","useTimeRange","produce","useMemo","TraceQLEditor","DEFAULT_TEMPO","isDefaultTempoSelector","isTempoDatasourceSelector","TEMPO_DATASOURCE_KIND","useLimitState","useQueryState","TempoTraceQueryEditor","props","onChange","value","datasource","datasourceSelectValue","selectedDatasource","datasourceSelectLabelID","data","client","timeRange","completionConfig","query","handleQueryChange","handleQueryBlur","limit","handleLimitChange","handleLimitBlur","limitHasError","handleDatasourceChange","next","draft","nextDatasource","undefined","Error","spacing","margin","fullWidth","datasourcePluginKind","labelId","label","notched","direction","onBlur","size","error","e","target","sx","width"],"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,WAAW,EAAEC,KAAK,EAAEC,SAAS,QAAQ,gBAAgB;AAC9D,SAASC,KAAK,QAAQ,yBAAyB;AAC/C,SACEC,gBAAgB,EAEhBC,mBAAmB,EACnBC,kCAAkC,EAClCC,YAAY,QACP,4BAA4B;AACnC,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAAuBC,OAAO,QAAQ,QAAQ;AAC9C,SAASC,aAAa,QAAQ,mBAAmB;AAEjD,SACEC,aAAa,EACbC,sBAAsB,EACtBC,yBAAyB,EACzBC,qBAAqB,QAChB,8BAA8B;AACrC,SAAgCC,aAAa,EAAEC,aAAa,QAAQ,uBAAuB;AAE3F,OAAO,SAASC,sBAAsBC,KAA4B;IAChE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,wBAAwBD,cAAcV;IAC5C,MAAMY,qBAAqBjB,mCAAmCgB,uBAAuBR;IACrF,MAAMU,0BAA0BrB,MAAM,2BAA2B,+FAA+F;IAEhK,MAAM,EAAEsB,MAAMC,MAAM,EAAE,GAAGrB,oBAAiCkB;IAC1D,MAAM,EAAEI,SAAS,EAAE,GAAGpB;IACtB,MAAMqB,mBAAmBnB,QAAQ;QAC/B,OAAO;YAAEiB;YAAQC;QAAU;IAC7B,GAAG;QAACD;QAAQC;KAAU;IAEtB,MAAM,EAAEE,KAAK,EAAEC,iBAAiB,EAAEC,eAAe,EAAE,GAAGf,cAAcE;IACpE,MAAM,EAAEc,KAAK,EAAEC,iBAAiB,EAAEC,eAAe,EAAEC,aAAa,EAAE,GAAGpB,cAAcG;IAEnF,MAAMkB,yBAA4D,CAACC;QACjE,IAAIxB,0BAA0BwB,OAAO;YACnClB,SACEX,QAAQY,OAAO,CAACkB;gBACd,sFAAsF;gBACtF,MAAMC,iBAAiB3B,uBAAuByB,QAAQG,YAAYH;gBAClEC,MAAMjB,UAAU,GAAGkB;YACrB;YAEF;QACF;QAEA,MAAM,IAAIE,MAAM;IAClB;IAEA,qBACE,MAACxC;QAAMyC,SAAS;;0BACd,KAAC1C;gBAAY2C,QAAO;gBAAQC,WAAW;0BACrC,cAAA,KAACxC;oBACCyC,sBAAsB/B;oBACtBM,OAAOE;oBACPH,UAAUiB;oBACVU,SAAStB;oBACTuB,OAAM;oBACNC,OAAO;;;0BAGX,MAAC/C;gBAAMgD,WAAU;gBAAMP,SAAS;;kCAC9B,KAAChC;wBACCkB,kBAAkBA;wBAClBR,OAAOS;wBACPV,UAAUW;wBACVoB,QAAQnB;;kCAEV,KAAC7B;wBACCiD,MAAK;wBACLJ,OAAM;wBACN3B,OAAOY;wBACPoB,OAAOjB;wBACPhB,UAAU,CAACkC,IAAMpB,kBAAkBoB,EAAEC,MAAM,CAAClC,KAAK;wBACjD8B,QAAQhB;wBACRqB,IAAI;4BAAEC,OAAO;wBAAQ;;;;;;AAK/B"}
|
|
@@ -75,9 +75,37 @@ export const getTraceData = async (spec, context)=>{
|
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
function parseTraceResponse(response) {
|
|
78
|
-
|
|
78
|
+
const trace = {
|
|
79
79
|
resourceSpans: response.batches
|
|
80
80
|
};
|
|
81
|
+
// Tempo returns Trace ID and Span ID base64-encoded.
|
|
82
|
+
// The OTLP spec defines the encoding in the hex format:
|
|
83
|
+
// Spec: https://opentelemetry.io/docs/specs/otlp/#json-protobuf-encoding
|
|
84
|
+
// Example: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.7.0/examples/trace.json
|
|
85
|
+
// Therefore, let's convert it to hex encoding.
|
|
86
|
+
for (const resourceSpan of trace.resourceSpans){
|
|
87
|
+
for (const scopeSpan of resourceSpan.scopeSpans){
|
|
88
|
+
for (const span of scopeSpan.spans){
|
|
89
|
+
if (span.traceId.length != 32) {
|
|
90
|
+
span.traceId = base64ToHex(span.traceId);
|
|
91
|
+
}
|
|
92
|
+
if (span.spanId.length != 16) {
|
|
93
|
+
span.spanId = base64ToHex(span.spanId);
|
|
94
|
+
}
|
|
95
|
+
if (span.parentSpanId && span.parentSpanId.length != 16) {
|
|
96
|
+
span.parentSpanId = base64ToHex(span.parentSpanId);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return trace;
|
|
102
|
+
}
|
|
103
|
+
function base64ToHex(str) {
|
|
104
|
+
try {
|
|
105
|
+
return atob(str).split('').map((char)=>char.charCodeAt(0).toString(16).padStart(2, '0').toUpperCase()).join('');
|
|
106
|
+
} catch {
|
|
107
|
+
return str;
|
|
108
|
+
}
|
|
81
109
|
}
|
|
82
110
|
function parseSearchResponse(response) {
|
|
83
111
|
return response.traces.map((trace)=>({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/plugins/tempo-trace-query/get-trace-data.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { AbsoluteTimeRange, isValidTraceId, otlptracev1, TraceSearchResult } from '@perses-dev/core';\nimport { datasourceSelectValueToSelector, TraceQueryPlugin } from '@perses-dev/plugin-system';\nimport { getUnixTime } from 'date-fns';\nimport { TEMPO_DATASOURCE_KIND, TempoDatasourceSelector, TempoTraceQuerySpec } from '../../model';\nimport { QueryResponse, SearchRequestParameters, SearchResponse } from '../../model/api-types';\nimport { TempoClient } from '../../model/tempo-client';\n\nexport function getUnixTimeRange(timeRange: AbsoluteTimeRange): { start: number; end: number } {\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 { searchResult: [] };\n }\n\n const defaultTempoDatasource: TempoDatasourceSelector = {\n kind: TEMPO_DATASOURCE_KIND,\n };\n\n const listDatasourceSelectItems = await context.datasourceStore.listDatasourceSelectItems(TEMPO_DATASOURCE_KIND);\n const datasourceSelector =\n datasourceSelectValueToSelector(spec.datasource, context.variableState, listDatasourceSelectItems) ??\n defaultTempoDatasource;\n\n const client = await context.datasourceStore.getDatasourceClient<TempoClient>(datasourceSelector);\n\n const getQuery = (): SearchRequestParameters => {\n const params: SearchRequestParameters = {\n q: spec.query,\n };\n\n // handle time range selection from UI drop down (e.g. last 5 minutes, last 1 hour )\n if (context.absoluteTimeRange) {\n const { start, end } = getUnixTimeRange(context.absoluteTimeRange);\n params.start = start;\n params.end = end;\n }\n\n if (spec.limit) {\n params.limit = spec.limit;\n }\n\n return params;\n };\n\n /**\n * determine type of query:\n * if the query is a valid traceId, fetch the trace by traceId\n * otherwise, execute a TraceQL query\n */\n if (isValidTraceId(spec.query)) {\n const response = await client.query({ traceId: spec.query });\n return {\n trace: parseTraceResponse(response),\n metadata: {\n executedQueryString: spec.query,\n },\n };\n } else {\n const response = await client.searchWithFallback(getQuery());\n return {\n searchResult: parseSearchResponse(response),\n metadata: {\n executedQueryString: spec.query,\n },\n };\n }\n};\n\nfunction parseTraceResponse(response: QueryResponse): otlptracev1.TracesData {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/tempo-trace-query/get-trace-data.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { AbsoluteTimeRange, isValidTraceId, otlptracev1, TraceSearchResult } from '@perses-dev/core';\nimport { datasourceSelectValueToSelector, TraceQueryPlugin } from '@perses-dev/plugin-system';\nimport { getUnixTime } from 'date-fns';\nimport { TEMPO_DATASOURCE_KIND, TempoDatasourceSelector, TempoTraceQuerySpec } from '../../model';\nimport { QueryResponse, SearchRequestParameters, SearchResponse } from '../../model/api-types';\nimport { TempoClient } from '../../model/tempo-client';\n\nexport function getUnixTimeRange(timeRange: AbsoluteTimeRange): { start: number; end: number } {\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 { searchResult: [] };\n }\n\n const defaultTempoDatasource: TempoDatasourceSelector = {\n kind: TEMPO_DATASOURCE_KIND,\n };\n\n const listDatasourceSelectItems = await context.datasourceStore.listDatasourceSelectItems(TEMPO_DATASOURCE_KIND);\n const datasourceSelector =\n datasourceSelectValueToSelector(spec.datasource, context.variableState, listDatasourceSelectItems) ??\n defaultTempoDatasource;\n\n const client = await context.datasourceStore.getDatasourceClient<TempoClient>(datasourceSelector);\n\n const getQuery = (): SearchRequestParameters => {\n const params: SearchRequestParameters = {\n q: spec.query,\n };\n\n // handle time range selection from UI drop down (e.g. last 5 minutes, last 1 hour )\n if (context.absoluteTimeRange) {\n const { start, end } = getUnixTimeRange(context.absoluteTimeRange);\n params.start = start;\n params.end = end;\n }\n\n if (spec.limit) {\n params.limit = spec.limit;\n }\n\n return params;\n };\n\n /**\n * determine type of query:\n * if the query is a valid traceId, fetch the trace by traceId\n * otherwise, execute a TraceQL query\n */\n if (isValidTraceId(spec.query)) {\n const response = await client.query({ traceId: spec.query });\n return {\n trace: parseTraceResponse(response),\n metadata: {\n executedQueryString: spec.query,\n },\n };\n } else {\n const response = await client.searchWithFallback(getQuery());\n return {\n searchResult: parseSearchResponse(response),\n metadata: {\n executedQueryString: spec.query,\n },\n };\n }\n};\n\nfunction parseTraceResponse(response: QueryResponse): otlptracev1.TracesData {\n const trace = {\n resourceSpans: response.batches,\n };\n\n // Tempo returns Trace ID and Span ID base64-encoded.\n // The OTLP spec defines the encoding in the hex format:\n // Spec: https://opentelemetry.io/docs/specs/otlp/#json-protobuf-encoding\n // Example: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.7.0/examples/trace.json\n // Therefore, let's convert it to hex encoding.\n for (const resourceSpan of trace.resourceSpans) {\n for (const scopeSpan of resourceSpan.scopeSpans) {\n for (const span of scopeSpan.spans) {\n if (span.traceId.length != 32) {\n span.traceId = base64ToHex(span.traceId);\n }\n\n if (span.spanId.length != 16) {\n span.spanId = base64ToHex(span.spanId);\n }\n\n if (span.parentSpanId && span.parentSpanId.length != 16) {\n span.parentSpanId = base64ToHex(span.parentSpanId);\n }\n }\n }\n }\n\n return trace;\n}\n\nfunction base64ToHex(str: string) {\n try {\n return atob(str)\n .split('')\n .map((char) => char.charCodeAt(0).toString(16).padStart(2, '0').toUpperCase())\n .join('');\n } catch {\n return str;\n }\n}\n\nfunction parseSearchResponse(response: SearchResponse): TraceSearchResult[] {\n return response.traces.map((trace) => ({\n startTimeUnixMs: parseInt(trace.startTimeUnixNano) * 1e-6, // convert to millisecond for eChart time format,\n durationMs: trace.durationMs ?? 0, // Tempo API doesn't return 0 values\n traceId: trace.traceID,\n rootServiceName: trace.rootServiceName,\n rootTraceName: trace.rootTraceName,\n serviceStats: trace.serviceStats || {},\n }));\n}\n"],"names":["isValidTraceId","datasourceSelectValueToSelector","getUnixTime","TEMPO_DATASOURCE_KIND","getUnixTimeRange","timeRange","start","end","Math","ceil","getTraceData","spec","context","query","undefined","console","error","searchResult","defaultTempoDatasource","kind","listDatasourceSelectItems","datasourceStore","datasourceSelector","datasource","variableState","client","getDatasourceClient","getQuery","params","q","absoluteTimeRange","limit","response","traceId","trace","parseTraceResponse","metadata","executedQueryString","searchWithFallback","parseSearchResponse","resourceSpans","batches","resourceSpan","scopeSpan","scopeSpans","span","spans","length","base64ToHex","spanId","parentSpanId","str","atob","split","map","char","charCodeAt","toString","padStart","toUpperCase","join","traces","startTimeUnixMs","parseInt","startTimeUnixNano","durationMs","traceID","rootServiceName","rootTraceName","serviceStats"],"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,SAA4BA,cAAc,QAAwC,mBAAmB;AACrG,SAASC,+BAA+B,QAA0B,4BAA4B;AAC9F,SAASC,WAAW,QAAQ,WAAW;AACvC,SAASC,qBAAqB,QAAsD,cAAc;AAIlG,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;IAC9F,IAAID,KAAKE,KAAK,KAAKC,aAAaH,KAAKE,KAAK,KAAK,QAAQF,KAAKE,KAAK,KAAK,IAAI;QACxE,0EAA0E;QAC1EE,QAAQC,KAAK,CAAC;QACd,OAAO;YAAEC,cAAc,EAAE;QAAC;IAC5B;IAEA,MAAMC,yBAAkD;QACtDC,MAAMhB;IACR;IAEA,MAAMiB,4BAA4B,MAAMR,QAAQS,eAAe,CAACD,yBAAyB,CAACjB;IAC1F,MAAMmB,qBACJrB,gCAAgCU,KAAKY,UAAU,EAAEX,QAAQY,aAAa,EAAEJ,8BACxEF;IAEF,MAAMO,SAAS,MAAMb,QAAQS,eAAe,CAACK,mBAAmB,CAAcJ;IAE9E,MAAMK,WAAW;QACf,MAAMC,SAAkC;YACtCC,GAAGlB,KAAKE,KAAK;QACf;QAEA,oFAAoF;QACpF,IAAID,QAAQkB,iBAAiB,EAAE;YAC7B,MAAM,EAAExB,KAAK,EAAEC,GAAG,EAAE,GAAGH,iBAAiBQ,QAAQkB,iBAAiB;YACjEF,OAAOtB,KAAK,GAAGA;YACfsB,OAAOrB,GAAG,GAAGA;QACf;QAEA,IAAII,KAAKoB,KAAK,EAAE;YACdH,OAAOG,KAAK,GAAGpB,KAAKoB,KAAK;QAC3B;QAEA,OAAOH;IACT;IAEA;;;;GAIC,GACD,IAAI5B,eAAeW,KAAKE,KAAK,GAAG;QAC9B,MAAMmB,WAAW,MAAMP,OAAOZ,KAAK,CAAC;YAAEoB,SAAStB,KAAKE,KAAK;QAAC;QAC1D,OAAO;YACLqB,OAAOC,mBAAmBH;YAC1BI,UAAU;gBACRC,qBAAqB1B,KAAKE,KAAK;YACjC;QACF;IACF,OAAO;QACL,MAAMmB,WAAW,MAAMP,OAAOa,kBAAkB,CAACX;QACjD,OAAO;YACLV,cAAcsB,oBAAoBP;YAClCI,UAAU;gBACRC,qBAAqB1B,KAAKE,KAAK;YACjC;QACF;IACF;AACF,EAAE;AAEF,SAASsB,mBAAmBH,QAAuB;IACjD,MAAME,QAAQ;QACZM,eAAeR,SAASS,OAAO;IACjC;IAEA,qDAAqD;IACrD,wDAAwD;IACxD,yEAAyE;IACzE,iGAAiG;IACjG,+CAA+C;IAC/C,KAAK,MAAMC,gBAAgBR,MAAMM,aAAa,CAAE;QAC9C,KAAK,MAAMG,aAAaD,aAAaE,UAAU,CAAE;YAC/C,KAAK,MAAMC,QAAQF,UAAUG,KAAK,CAAE;gBAClC,IAAID,KAAKZ,OAAO,CAACc,MAAM,IAAI,IAAI;oBAC7BF,KAAKZ,OAAO,GAAGe,YAAYH,KAAKZ,OAAO;gBACzC;gBAEA,IAAIY,KAAKI,MAAM,CAACF,MAAM,IAAI,IAAI;oBAC5BF,KAAKI,MAAM,GAAGD,YAAYH,KAAKI,MAAM;gBACvC;gBAEA,IAAIJ,KAAKK,YAAY,IAAIL,KAAKK,YAAY,CAACH,MAAM,IAAI,IAAI;oBACvDF,KAAKK,YAAY,GAAGF,YAAYH,KAAKK,YAAY;gBACnD;YACF;QACF;IACF;IAEA,OAAOhB;AACT;AAEA,SAASc,YAAYG,GAAW;IAC9B,IAAI;QACF,OAAOC,KAAKD,KACTE,KAAK,CAAC,IACNC,GAAG,CAAC,CAACC,OAASA,KAAKC,UAAU,CAAC,GAAGC,QAAQ,CAAC,IAAIC,QAAQ,CAAC,GAAG,KAAKC,WAAW,IAC1EC,IAAI,CAAC;IACV,EAAE,OAAM;QACN,OAAOT;IACT;AACF;AAEA,SAASZ,oBAAoBP,QAAwB;IACnD,OAAOA,SAAS6B,MAAM,CAACP,GAAG,CAAC,CAACpB,QAAW,CAAA;YACrC4B,iBAAiBC,SAAS7B,MAAM8B,iBAAiB,IAAI;YACrDC,YAAY/B,MAAM+B,UAAU,IAAI;YAChChC,SAASC,MAAMgC,OAAO;YACtBC,iBAAiBjC,MAAMiC,eAAe;YACtCC,eAAelC,MAAMkC,aAAa;YAClCC,cAAcnC,MAAMmC,YAAY,IAAI,CAAC;QACvC,CAAA;AACF"}
|
package/mf-manifest.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "Tempo",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.
|
|
8
|
+
"buildVersion": "0.52.0",
|
|
9
9
|
"buildName": "@perses-dev/tempo-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/Tempo.
|
|
12
|
+
"name": "__mf/js/Tempo.e7d268a6.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"__mf/js/async/528.2759052c.js",
|
|
147
147
|
"__mf/js/async/738.2cdddba7.js",
|
|
148
148
|
"__mf/js/async/3980.c94e78cd.js",
|
|
149
|
-
"__mf/js/async/5503.
|
|
149
|
+
"__mf/js/async/5503.6e47fa95.js",
|
|
150
150
|
"__mf/js/async/4289.5e2073e0.js",
|
|
151
151
|
"__mf/js/async/1540.089c4f28.js",
|
|
152
152
|
"__mf/js/async/1465.21c847e0.js",
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
"__mf/js/async/528.2759052c.js",
|
|
197
197
|
"__mf/js/async/738.2cdddba7.js",
|
|
198
198
|
"__mf/js/async/3980.c94e78cd.js",
|
|
199
|
-
"__mf/js/async/5503.
|
|
199
|
+
"__mf/js/async/5503.6e47fa95.js",
|
|
200
200
|
"__mf/js/async/8488.d3005164.js",
|
|
201
201
|
"__mf/js/async/5913.d10c6185.js",
|
|
202
202
|
"__mf/js/async/3355.8bd6f6bd.js",
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
"__mf/js/async/7832.9f2a70d0.js",
|
|
240
240
|
"__mf/js/async/738.2cdddba7.js",
|
|
241
241
|
"__mf/js/async/3980.c94e78cd.js",
|
|
242
|
-
"__mf/js/async/5503.
|
|
242
|
+
"__mf/js/async/5503.6e47fa95.js",
|
|
243
243
|
"__mf/js/async/4289.5e2073e0.js",
|
|
244
244
|
"__mf/js/async/1540.089c4f28.js",
|
|
245
245
|
"__mf/js/async/1465.21c847e0.js",
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
"js": {
|
|
313
313
|
"async": [],
|
|
314
314
|
"sync": [
|
|
315
|
-
"__mf/js/async/5503.
|
|
315
|
+
"__mf/js/async/5503.6e47fa95.js"
|
|
316
316
|
]
|
|
317
317
|
},
|
|
318
318
|
"css": {
|
|
@@ -442,7 +442,7 @@
|
|
|
442
442
|
"__mf/js/async/5220.80e3b05e.js",
|
|
443
443
|
"__mf/js/async/8597.07c3a890.js",
|
|
444
444
|
"__mf/js/async/3828.d981b319.js",
|
|
445
|
-
"__mf/js/async/__federation_expose_TempoTraceQuery.
|
|
445
|
+
"__mf/js/async/__federation_expose_TempoTraceQuery.4183e294.js",
|
|
446
446
|
"__mf/js/async/8485.434a672e.js",
|
|
447
447
|
"__mf/js/async/7376.a69c2e5a.js",
|
|
448
448
|
"__mf/js/async/1540.089c4f28.js",
|
|
@@ -463,7 +463,7 @@
|
|
|
463
463
|
"__mf/js/async/5790.949d8d1c.js",
|
|
464
464
|
"__mf/js/async/3960.2228bf7e.js",
|
|
465
465
|
"__mf/js/async/3980.c94e78cd.js",
|
|
466
|
-
"__mf/js/async/5503.
|
|
466
|
+
"__mf/js/async/5503.6e47fa95.js",
|
|
467
467
|
"__mf/js/async/4421.07335985.js",
|
|
468
468
|
"__mf/js/async/8488.d3005164.js",
|
|
469
469
|
"__mf/js/async/5913.d10c6185.js",
|
|
@@ -492,7 +492,7 @@
|
|
|
492
492
|
"__mf/js/async/5220.80e3b05e.js",
|
|
493
493
|
"__mf/js/async/8597.07c3a890.js",
|
|
494
494
|
"__mf/js/async/3828.d981b319.js",
|
|
495
|
-
"__mf/js/async/__federation_expose_TempoTraceQuery.
|
|
495
|
+
"__mf/js/async/__federation_expose_TempoTraceQuery.4183e294.js"
|
|
496
496
|
],
|
|
497
497
|
"async": [
|
|
498
498
|
"__mf/js/async/1964.75933dd4.js",
|
|
@@ -518,7 +518,7 @@
|
|
|
518
518
|
"__mf/js/async/6292.2481b399.js",
|
|
519
519
|
"__mf/js/async/738.2cdddba7.js",
|
|
520
520
|
"__mf/js/async/3980.c94e78cd.js",
|
|
521
|
-
"__mf/js/async/5503.
|
|
521
|
+
"__mf/js/async/5503.6e47fa95.js",
|
|
522
522
|
"__mf/js/async/4421.07335985.js",
|
|
523
523
|
"__mf/js/async/8488.d3005164.js",
|
|
524
524
|
"__mf/js/async/5913.d10c6185.js",
|
|
@@ -556,7 +556,7 @@
|
|
|
556
556
|
"__mf/js/async/5220.80e3b05e.js",
|
|
557
557
|
"__mf/js/async/8597.07c3a890.js",
|
|
558
558
|
"__mf/js/async/3828.d981b319.js",
|
|
559
|
-
"__mf/js/async/__federation_expose_TempoTraceQuery.
|
|
559
|
+
"__mf/js/async/__federation_expose_TempoTraceQuery.4183e294.js",
|
|
560
560
|
"__mf/js/async/7376.a69c2e5a.js",
|
|
561
561
|
"__mf/js/async/1540.089c4f28.js",
|
|
562
562
|
"__mf/js/async/1465.21c847e0.js",
|
|
@@ -573,7 +573,7 @@
|
|
|
573
573
|
"__mf/js/async/3224.8d499a63.js",
|
|
574
574
|
"__mf/js/async/4075.4c40db9f.js",
|
|
575
575
|
"__mf/js/async/3090.90251187.js",
|
|
576
|
-
"__mf/js/async/5503.
|
|
576
|
+
"__mf/js/async/5503.6e47fa95.js",
|
|
577
577
|
"__mf/js/async/7127.ccd78bd8.js",
|
|
578
578
|
"__mf/js/async/7832.9f2a70d0.js",
|
|
579
579
|
"__mf/js/async/7740.1ecb3732.js",
|
package/mf-stats.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "Tempo",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.
|
|
8
|
+
"buildVersion": "0.52.0",
|
|
9
9
|
"buildName": "@perses-dev/tempo-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/Tempo.
|
|
12
|
+
"name": "__mf/js/Tempo.e7d268a6.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"__mf/js/async/528.2759052c.js",
|
|
164
164
|
"__mf/js/async/738.2cdddba7.js",
|
|
165
165
|
"__mf/js/async/3980.c94e78cd.js",
|
|
166
|
-
"__mf/js/async/5503.
|
|
166
|
+
"__mf/js/async/5503.6e47fa95.js",
|
|
167
167
|
"__mf/js/async/4289.5e2073e0.js",
|
|
168
168
|
"__mf/js/async/1540.089c4f28.js",
|
|
169
169
|
"__mf/js/async/1465.21c847e0.js",
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
"__mf/js/async/528.2759052c.js",
|
|
219
219
|
"__mf/js/async/738.2cdddba7.js",
|
|
220
220
|
"__mf/js/async/3980.c94e78cd.js",
|
|
221
|
-
"__mf/js/async/5503.
|
|
221
|
+
"__mf/js/async/5503.6e47fa95.js",
|
|
222
222
|
"__mf/js/async/8488.d3005164.js",
|
|
223
223
|
"__mf/js/async/5913.d10c6185.js",
|
|
224
224
|
"__mf/js/async/3355.8bd6f6bd.js",
|
|
@@ -266,7 +266,7 @@
|
|
|
266
266
|
"__mf/js/async/7832.9f2a70d0.js",
|
|
267
267
|
"__mf/js/async/738.2cdddba7.js",
|
|
268
268
|
"__mf/js/async/3980.c94e78cd.js",
|
|
269
|
-
"__mf/js/async/5503.
|
|
269
|
+
"__mf/js/async/5503.6e47fa95.js",
|
|
270
270
|
"__mf/js/async/4289.5e2073e0.js",
|
|
271
271
|
"__mf/js/async/1540.089c4f28.js",
|
|
272
272
|
"__mf/js/async/1465.21c847e0.js",
|
|
@@ -289,9 +289,9 @@
|
|
|
289
289
|
}
|
|
290
290
|
},
|
|
291
291
|
"usedIn": [
|
|
292
|
+
"./TempoTraceQuery",
|
|
292
293
|
"./TempoExplorer",
|
|
293
|
-
"./TempoDatasource"
|
|
294
|
-
"./TempoTraceQuery"
|
|
294
|
+
"./TempoDatasource"
|
|
295
295
|
]
|
|
296
296
|
},
|
|
297
297
|
{
|
|
@@ -354,7 +354,7 @@
|
|
|
354
354
|
"js": {
|
|
355
355
|
"async": [],
|
|
356
356
|
"sync": [
|
|
357
|
-
"__mf/js/async/5503.
|
|
357
|
+
"__mf/js/async/5503.6e47fa95.js"
|
|
358
358
|
]
|
|
359
359
|
},
|
|
360
360
|
"css": {
|
|
@@ -509,7 +509,7 @@
|
|
|
509
509
|
"__mf/js/async/5220.80e3b05e.js",
|
|
510
510
|
"__mf/js/async/8597.07c3a890.js",
|
|
511
511
|
"__mf/js/async/3828.d981b319.js",
|
|
512
|
-
"__mf/js/async/__federation_expose_TempoTraceQuery.
|
|
512
|
+
"__mf/js/async/__federation_expose_TempoTraceQuery.4183e294.js",
|
|
513
513
|
"__mf/js/async/8485.434a672e.js",
|
|
514
514
|
"__mf/js/async/7376.a69c2e5a.js",
|
|
515
515
|
"__mf/js/async/1540.089c4f28.js",
|
|
@@ -530,7 +530,7 @@
|
|
|
530
530
|
"__mf/js/async/5790.949d8d1c.js",
|
|
531
531
|
"__mf/js/async/3960.2228bf7e.js",
|
|
532
532
|
"__mf/js/async/3980.c94e78cd.js",
|
|
533
|
-
"__mf/js/async/5503.
|
|
533
|
+
"__mf/js/async/5503.6e47fa95.js",
|
|
534
534
|
"__mf/js/async/4421.07335985.js",
|
|
535
535
|
"__mf/js/async/8488.d3005164.js",
|
|
536
536
|
"__mf/js/async/5913.d10c6185.js",
|
|
@@ -566,7 +566,7 @@
|
|
|
566
566
|
"__mf/js/async/5220.80e3b05e.js",
|
|
567
567
|
"__mf/js/async/8597.07c3a890.js",
|
|
568
568
|
"__mf/js/async/3828.d981b319.js",
|
|
569
|
-
"__mf/js/async/__federation_expose_TempoTraceQuery.
|
|
569
|
+
"__mf/js/async/__federation_expose_TempoTraceQuery.4183e294.js"
|
|
570
570
|
],
|
|
571
571
|
"async": [
|
|
572
572
|
"__mf/js/async/1964.75933dd4.js",
|
|
@@ -592,7 +592,7 @@
|
|
|
592
592
|
"__mf/js/async/6292.2481b399.js",
|
|
593
593
|
"__mf/js/async/738.2cdddba7.js",
|
|
594
594
|
"__mf/js/async/3980.c94e78cd.js",
|
|
595
|
-
"__mf/js/async/5503.
|
|
595
|
+
"__mf/js/async/5503.6e47fa95.js",
|
|
596
596
|
"__mf/js/async/4421.07335985.js",
|
|
597
597
|
"__mf/js/async/8488.d3005164.js",
|
|
598
598
|
"__mf/js/async/5913.d10c6185.js",
|
|
@@ -637,7 +637,7 @@
|
|
|
637
637
|
"__mf/js/async/5220.80e3b05e.js",
|
|
638
638
|
"__mf/js/async/8597.07c3a890.js",
|
|
639
639
|
"__mf/js/async/3828.d981b319.js",
|
|
640
|
-
"__mf/js/async/__federation_expose_TempoTraceQuery.
|
|
640
|
+
"__mf/js/async/__federation_expose_TempoTraceQuery.4183e294.js",
|
|
641
641
|
"__mf/js/async/7376.a69c2e5a.js",
|
|
642
642
|
"__mf/js/async/1540.089c4f28.js",
|
|
643
643
|
"__mf/js/async/1465.21c847e0.js",
|
|
@@ -654,7 +654,7 @@
|
|
|
654
654
|
"__mf/js/async/3224.8d499a63.js",
|
|
655
655
|
"__mf/js/async/4075.4c40db9f.js",
|
|
656
656
|
"__mf/js/async/3090.90251187.js",
|
|
657
|
-
"__mf/js/async/5503.
|
|
657
|
+
"__mf/js/async/5503.6e47fa95.js",
|
|
658
658
|
"__mf/js/async/7127.ccd78bd8.js",
|
|
659
659
|
"__mf/js/async/7832.9f2a70d0.js",
|
|
660
660
|
"__mf/js/async/7740.1ecb3732.js",
|
package/package.json
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/tempo-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
|
+
"homepage": "https://github.com/perses/plugins/blob/main/README.md",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/perses/plugins.git"
|
|
8
|
+
},
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/perses/plugins/issues"
|
|
11
|
+
},
|
|
4
12
|
"scripts": {
|
|
5
13
|
"dev": "rsbuild dev",
|
|
6
14
|
"build": "npm run build-mf && concurrently \"npm:build:*\"",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkTempo=self.webpackChunkTempo||[]).push([["7969"],{50117:function(e,t,r){r.r(t),r.d(t,{TempoTraceQuery:()=>j});var a=r(58891),i=r(14267),o=r(20461);let n="TempoDatasource",s={kind:n},l=async(e,t)=>{if(void 0===e.query||null===e.query||""===e.query)return console.error("TempoTraceQuery is undefined, null, or an empty string."),{searchResult:[]};let r=await t.datasourceStore.listDatasourceSelectItems(n),s=(0,a.datasourceSelectValueToSelector)(e.datasource,t.variableState,r)??{kind:n},l=await t.datasourceStore.getDatasourceClient(s);return(0,i.j)(e.query)?{trace:{resourceSpans:(await l.query({traceId:e.query})).batches},metadata:{executedQueryString:e.query}}:{searchResult:(await l.searchWithFallback((()=>{let r={q:e.query};if(t.absoluteTimeRange){let{start:e,end:a}=function(e){let{start:t,end:r}=e;return{start:Math.ceil((0,o.getUnixTime)(t)),end:Math.ceil((0,o.getUnixTime)(r))}}(t.absoluteTimeRange);r.start=e,r.end=a}return e.limit&&(r.limit=e.limit),r})())).traces.map(e=>({startTimeUnixMs:1e-6*parseInt(e.startTimeUnixNano),durationMs:e.durationMs??0,traceId:e.traceID,rootServiceName:e.rootServiceName,rootTraceName:e.rootTraceName,serviceStats:e.serviceStats||{}})),metadata:{executedQueryString:e.query}}};var c=r(24246),u=r(25283),d=r(90192),p=r(68808),m=r(8695),f=r(72629),g=r(75586),h=r(54538),v=r(94776),y=r(46359),b=r(61262),k=r(70534),T=r(94197);let x=(0,T.Gv)({LineComment:T.pJ.comment,"Parent Resource Span Identifier":T.pJ.labelName,IntrinsicField:T.pJ.labelName,String:T.pJ.string,"Integer Float Duration":T.pJ.number,Static:T.pJ.literal,"Aggregate AggregateExpression":T.pJ.function(T.pJ.keyword),"And Or":T.pJ.logicOperator,"Gt Lt Desc Anc tilde ExperimentalOp":T.pJ.bitwiseOperator,ComparisonOp:T.pJ.compareOperator,Pipe:T.pJ.operator,ScalarOp:T.pJ.arithmeticOperator,"( )":T.pJ.paren,"[ ]":T.pJ.squareBracket,"{ }":T.pJ.brace,"⚠":T.pJ.invalid});var S=r(13018),C=r(29085);async function D(e,t){let{state:r,pos:a}=t,i=function(e,t,r){var a,i,o,n,s,l,c,u,d,p,m,f,g,h,v,y,b,T,x,S,C;let D=r.resolveInner(t,-1);switch(D.type.id){case k.Bu:if((null===D.firstChild||(null===(a=D.firstChild)||void 0===a?void 0:a.type.id)===0)&&!e.sliceDoc(D.from,t).includes("}"))return{scopes:[{kind:"Scopes"},{kind:"TagName",scope:"intrinsic"}],from:t};break;case k.Im:return{scopes:[{kind:"Scopes"},{kind:"TagName",scope:"intrinsic"}],from:t};case k.AW:if((null===(i=D.firstChild)||void 0===i?void 0:i.type.id)===k._z)return{scopes:[{kind:"TagName",scope:"resource"}],from:t};if((null===(o=D.firstChild)||void 0===o?void 0:o.type.id)===k.Dr)return{scopes:[{kind:"TagName",scope:"span"}],from:t};if("."===e.sliceDoc(D.from,D.to))return{scopes:[{kind:"TagName",scope:"resource"},{kind:"TagName",scope:"span"}],from:t};break;case k.xb:if((null===(n=D.parent)||void 0===n?void 0:n.type.id)===k.AW){if(e.sliceDoc(D.parent.from,D.parent.to).includes(":"))return{scopes:[{kind:"TagName",scope:"intrinsic"}],from:D.parent.from};if((null===(l=D.parent)||void 0===l?void 0:null===(s=l.firstChild)||void 0===s?void 0:s.type.id)===k._z)return{scopes:[{kind:"TagName",scope:"resource"}],from:D.from};if((null===(u=D.parent)||void 0===u?void 0:null===(c=u.firstChild)||void 0===c?void 0:c.type.id)===k.Dr)return{scopes:[{kind:"TagName",scope:"span"}],from:D.from};if((null===(p=D.parent)||void 0===p?void 0:null===(d=p.firstChild)||void 0===d?void 0:d.type.id)===k.xb)return{scopes:[{kind:"TagName",scope:"resource"},{kind:"TagName",scope:"span"}],from:D.from}}break;case k.Of:if((null===(f=D.parent)||void 0===f?void 0:null===(m=f.firstChild)||void 0===m?void 0:m.type.id)===k.Im){let r=D.parent.firstChild;return{scopes:[{kind:"TagValue",tag:e.sliceDoc(r.from,r.to)}],from:t}}break;case k.Ld:if((null===(y=D.parent)||void 0===y?void 0:null===(v=y.parent)||void 0===v?void 0:null===(h=v.parent)||void 0===h?void 0:null===(g=h.firstChild)||void 0===g?void 0:g.type.id)===k.Im&&!/^".*"$/.test(e.sliceDoc(D.from,t))){let t=D.parent.parent.parent.firstChild;return{scopes:[{kind:"TagValue",tag:e.sliceDoc(t.from,t.to)}],from:D.from+1}}break;case 0:if((null===(b=D.prevSibling)||void 0===b?void 0:b.type.id)===k.Of&&(null===(x=D.parent)||void 0===x?void 0:null===(T=x.firstChild)||void 0===T?void 0:T.type.id)===k.Im){let t=D.parent.firstChild;return{scopes:[{kind:"TagValue",tag:e.sliceDoc(t.from,t.to)}],from:'"'===e.sliceDoc(D.from,D.from+1)?D.from+1:D.from}}if((null===(S=D.parent)||void 0===S?void 0:S.type.id)===k.Bu||(null===(C=D.parent)||void 0===C?void 0:C.type.id)===k.Im)return{scopes:[{kind:"Scopes"},{kind:"TagName",scope:"intrinsic"}],from:D.from}}}(r,a,(0,b.qz)(r));return i?{options:await q(e,i.scopes),from:i.from,to:i.to}:null}async function q(e,t){let r=[];for(let a of t)switch(a.kind){case"Scopes":r.push(Promise.resolve([{label:"span"},{label:"resource"}]));break;case"TagName":r.push(w(e,a.scope));break;case"TagValue":r.push(J(e,a.tag))}return(await Promise.all(r)).flat()}function N(e){if(!e)return{};let t=(0,C.q0)(e)?e:(0,C.sG)(e);return{start:Math.round(t.start.getTime()/1e3),end:Math.round(t.end.getTime()/1e3)}}async function w(e,t){if(!e.client)return[];let{start:r,end:a}=N(e.timeRange),{limit:i,maxStaleValues:o}=e;return(await e.client.searchTags({scope:t,start:r,end:a,limit:i,maxStaleValues:o})).scopes.flatMap(e=>e.tags).map(e=>({label:e}))}function I(e,t,r,a){let i=t.label;'"'!==e.state.sliceDoc(r-1,r)&&(i='"'+i),'"'!==e.state.sliceDoc(a,a+1)&&(i+='"'),e.dispatch((0,S.$L)(e.state,i,r,a))}async function J(e,t){if(!e.client)return[];let{start:r,end:a}=N(e.timeRange),{limit:i,maxStaleValues:o}=e,n=await e.client.searchTagValues({tag:t,start:r,end:a,limit:i,maxStaleValues:o}),s=[];for(let{type:e,value:t}of n.tagValues)switch(e){case"string":s.push({label:t??"",displayLabel:t??"(empty string)",apply:I});break;case"keyword":case"int":s.push({label:t??"",displayLabel:t??"(empty string)"})}return s}function O(e){let{completionConfig:t,...r}=e,a=(0,v.Z)(),o="dark"===a.palette.mode,n=(0,h.useMemo)(()=>(function(e){let t=b.qp.define({parser:k.E2.configure({props:[x]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//"}}}),r=t.data.of({autocomplete:t=>D(e,t).catch(e=>console.error("error during TraceQL auto-complete",e))});return[t,r]})(t),[t]),s=(0,h.useMemo)(()=>{let e="light"===a.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return y.tk.theme({"&":{backgroundColor:"transparent !important",border:`1px solid ${e}`,borderRadius:`${a.shape.borderRadius}px`},"&.cm-focused.cm-editor":{outline:"none"},".cm-content":{padding:"8px"}})},[a]);return(0,c.jsxs)(u.Z,{position:"relative",sx:{flexGrow:1},children:[(0,c.jsx)(p.Z,{shrink:!0,sx:{position:"absolute",top:"-6px",left:"10px",padding:"0 4px",color:a.palette.text.primary,backgroundColor:a.palette.background.default,zIndex:1},children:"TraceQL Expression"}),(0,c.jsx)(y.ZP,{...r,theme:o?"dark":"light",basicSetup:{lineNumbers:!1,highlightActiveLine:!1,highlightActiveLineGutter:!1,foldGutter:!1,syntaxHighlighting:!(0,i.j)(r.value??"")},extensions:[y.tk.lineWrapping,n,s],placeholder:'Example: {span.http.method = "GET"}'})]})}let j={getTraceData:l,OptionsEditorComponent:function(e){let{onChange:t,value:r}=e,{datasource:i}=r,o=i??s,l=(0,a.useDatasourceSelectValueToSelector)(o,n),v=(0,f.useId)("tempo-datasource-label"),{data:y}=(0,a.useDatasourceClient)(l),{timeRange:b}=(0,a.useTimeRange)(),k=(0,h.useMemo)(()=>({client:y,timeRange:b}),[y,b]),{query:T,handleQueryChange:x,handleQueryBlur:S}=function(e){let{onChange:t,value:r}=e,[a,i]=(0,h.useState)(r.query),[o,n]=(0,h.useState)(r.query);return r.query!==o&&(i(r.query),n(r.query)),{query:a,handleQueryChange:e=>{i(e)},handleQueryBlur:()=>{n(a),t((0,g.Uy)(r,e=>{e.query=a}))}}}(e),{limit:C,handleLimitChange:D,handleLimitBlur:q,limitHasError:N}=function(e){let{onChange:t,value:r}=e,[a,i]=(0,h.useState)(r.limit?r.limit.toString():""),[o,n]=(0,h.useState)(r.limit);r.limit!==o&&(i(r.limit?r.limit.toString():""),n(r.limit));let s=!(""===a||/^[0-9]+$/.test(a)&&parseInt(a)>0);return{limit:a,handleLimitChange:e=>{i(e)},handleLimitBlur:()=>{if(s)return;let e=""===a?void 0:parseInt(a);n(e),t((0,g.Uy)(r,t=>{t.limit=e}))},limitHasError:s}}(e);return(0,c.jsxs)(u.Z,{spacing:2,children:[(0,c.jsxs)(d.Z,{margin:"dense",fullWidth:!1,children:[(0,c.jsx)(p.Z,{id:v,shrink:!0,children:"Tempo Datasource"}),(0,c.jsx)(a.DatasourceSelect,{datasourcePluginKind:n,value:o,onChange:e=>{if((0,a.isVariableDatasource)(e)||e.kind===n){t((0,g.Uy)(r,t=>{let r=(0,a.isVariableDatasource)(e)||void 0!==e.name?e:void 0;t.datasource=r}));return}throw Error("Got unexpected non-Tempo datasource selector")},labelId:v,label:"Tempo Datasource",notched:!0})]}),(0,c.jsxs)(u.Z,{direction:"row",spacing:2,children:[(0,c.jsx)(O,{completionConfig:k,value:T,onChange:x,onBlur:S}),(0,c.jsx)(m.Z,{size:"small",label:"Max Traces",value:C,error:N,onChange:e=>D(e.target.value),onBlur:q,sx:{width:"110px"}})]})]})},createInitialOptions:()=>({query:"",limit:20,datasource:void 0}),dependsOn:e=>({variables:[...(0,a.isVariableDatasource)(e.datasource)?(0,a.parseVariables)(e.datasource??""):[]]})}}}]);
|