@odigos/ui-kit 0.0.230 → 0.0.231
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/CHANGELOG.md +15 -0
- package/lib/chunks/index-DAOWyONO.js +145 -0
- package/lib/chunks/{index-DJZLguZq.js → index-tFZXUKvO.js} +1 -1
- package/lib/chunks/{ui-components-B4xHrszQ.js → ui-components-CvK0mvVN.js} +378 -378
- package/lib/components/_v2/table/index.d.ts +8 -1
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/sampling/index.d.ts +7 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/_drawers/add-destination-drawer/form-column/index.d.ts +1 -1
- package/lib/containers/_v2/_drawers/add-destination-drawer/lists-column/index.d.ts +1 -1
- package/lib/containers/_v2/_drawers/add-source-drawer/namespaces-column/index.d.ts +1 -1
- package/lib/containers/_v2/_drawers/add-source-drawer/workloads-column/index.d.ts +1 -1
- package/lib/containers/source-drawer/profiling/flame-graph-canvas.d.ts +12 -0
- package/lib/containers/source-drawer/profiling/flamebearer.d.ts +21 -2
- package/lib/containers/source-drawer/profiling/index.d.ts +1 -9
- package/lib/containers/source-drawer/profiling/symbol-table.d.ts +13 -0
- package/lib/containers/v2.js +46 -42
- package/lib/containers.js +42 -44
- package/lib/contexts/sampling-rules-form-context.d.ts +3 -1
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/_v2/sampling-rule-form-sections/index.d.ts +1 -0
- package/lib/snippets/_v2/sampling-rule-form-sections/rule-type.d.ts +8 -0
- package/lib/snippets/_v2/sampling-rule-form-sections/sampling-preview.d.ts +3 -1
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-CGrd7Nq0.js +0 -149
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState as i,useEffect as o,Fragment as a,forwardRef as r,useRef as l,useImperativeHandle as s,useMemo as c,useCallback as d,useLayoutEffect as u,Children as p}from"react";import h,{css as m,useTheme as g}from"styled-components";import{af as f,cb as v,q as y,K as b,c as S,cc as x,cd as C,ce as w,cf as k,h as T,i as E,cg as $,ch as N,ci as D,cj as I,m as A,F as R,n as O,ck as M,cl as F,p as L,cm as P,ac as _,cn as z,co as K,cp as j,cq as V,cr as B,cs as W,
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState as i,useEffect as o,Fragment as a,forwardRef as r,useRef as l,useImperativeHandle as s,useMemo as c,useCallback as d,useLayoutEffect as u,Children as p}from"react";import h,{css as m,useTheme as g}from"styled-components";import{af as f,cb as v,q as y,K as b,c as S,cc as x,cd as C,ce as w,cf as k,h as T,i as E,cg as $,ch as N,ci as D,cj as I,m as A,F as R,n as O,ck as M,cl as F,p as L,cm as P,ac as _,cn as z,co as K,cp as j,cq as V,cr as B,cs as W,bc as U,aI as H,ct as q,cu as G,cv as Y,aC as J,ap as X,cw as Q,aG as Z,cx as ee,cy as te,cz as ne,aL as ie,cA as oe,ar as ae,cB as re,cC as le,cD as se,cE as ce,cF as de,E as ue,aT as pe,cG as he,cH as me,cI as ge,cJ as fe,cK as ve,cL as ye,O as be,cM as Se,cN as xe,cO as Ce,cP as we,cQ as ke,cR as Te,cS as Ee,cT as $e,cU as Ne,cV as De,cW as Ie,cX as Ae,b as Re,cY as Oe,cZ as Me,c_ as Fe,c$ as Le,d0 as Pe,d1 as _e,d2 as ze,d3 as Ke,d4 as je,d5 as Ve,d6 as Be,d7 as We,H as Ue,d8 as He,aV as qe,am as Ge,d9 as Ye,aA as Je,aD as Xe,da as Qe,aO as Ze,db as et,dc as tt,aP as nt,dd as it,de as ot,df as at,dg as rt,dh as lt,di as st,dj as ct,dk as dt,aR as ut,dl as pt,Z as ht,dm as mt,dn as gt,dp as ft,dq as vt,dr as yt,ds as bt,dt as St,du as xt,dv as Ct,aN as wt,x as kt,ao as Tt,G as Et,dw as $t,aQ as Nt,dx as Dt,J as It,ag as At,an as Rt,al as Ot,dy as Mt,dz as Ft,dA as Lt,dB as Pt,P as _t,U as zt,V as Kt,R as jt,M as Vt,Q as Bt,W as Wt,dC as Ut,_ as Ht,aS as qt,dD as Gt,aq as Yt,av as Jt,dE as Xt,dF as Qt,dG as Zt,dH as en,bd as tn,dI as nn,dJ as on,dK as an,aH as rn,dL as ln,dM as sn,at as cn,dN as dn,dO as un,T as pn,aw as hn,k as mn,o as gn,B as fn,a as vn,s as yn,t as bn,S as Sn,bB as xn,a9 as Cn,dP as wn,bk as kn,bl as Tn,ak as En,dQ as $n,N as Nn,Y as Dn,dR as In,dS as An,dT as Rn,dU as On,dV as Mn,dW as Fn,g as Ln,dX as Pn,dY as _n,dZ as zn,d_ as Kn,d$ as jn,e0 as Vn,e1 as Bn,e2 as Wn,be as Un,u as Hn,aM as qn,aj as Gn,e3 as Yn,e4 as Jn,e5 as Xn,e6 as Qn,e7 as Zn,e8 as ei}from"./chunks/ui-components-CvK0mvVN.js";import{TrashIcon as ti,VSquareIcon as ni,XSquareIcon as ii,EditIcon as oi,OdigosLogoText as ai,PlusIcon as ri,RefreshIcon as li,SearchIcon as si,FilterIcon as ci,DataStreamIcon as di,VIcon as ui,OdigosLogo as pi,ArrowIcon as hi,RefreshLeftArrowIcon as mi,NotificationIcon as gi,UserIcon as fi,ImageErrorIcon as vi,ChevronDownIcon as yi,ChevronRightIcon as bi,OverviewIcon as Si,SourceIcon as xi,DestinationIcon as Ci,InstrumentationRuleIcon as wi,ActionIcon as ki,SlackLogo as Ti,MinusIcon as Ei,XIcon as $i,ExpandIcon as Ni,CopyIcon as Di,DotIcon as Ii,DownloadIcon as Ai,KeyIcon as Ri,TerminalIcon as Oi,ExclamationTriangleIcon as Mi,TraceViewIcon as Fi}from"./icons.js";import{MarkerType as Li,useNodesState as Pi,useEdgesState as _i}from"@xyflow/react";import{E as zi}from"./chunks/vendor-C150cdxb.js";import{Y as Ki}from"./chunks/index-tFZXUKvO.js";import"zustand";import"javascript-time-ago";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const ji=e=>{const{type:t,name:n,notes:i,signals:o,disabled:a,fields:{collectContainerAttributes:r,collectReplicaSetAttributes:l,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:h,attributeNamesToDelete:m,renames:g,piiCategories:S,fallbackSamplingRatio:x,samplingPercentage:C,endpointsFilters:w,servicesNameFilters:k,attributeFilters:T,urlTemplatizationRulesGroups:E}}=e,$=[{title:f.TYPE,value:t},{type:v.ActiveStatus,title:f.STATUS,value:String(!a)},{type:v.Monitors,title:f.SIGNALS_FOR_PROCESSING,value:o?.join(", ")||""},{title:f.NAME,value:n||""},{title:f.NOTES,value:i||""},{type:v.Divider}];if(t===y.K8sAttributes&&($.push({title:"Collect Container Attributes",value:String(r)}),$.push({title:"Collect ReplicaSet Attributes",value:String(l)}),$.push({title:"Collect Workload ID",value:String(s)}),$.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&$.push({type:v.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:n,fromSources:i},o)=>{let a="";a+=`Label Key: ${e}\n`,a+=`Attribute Key: ${t}\n`;a+=`From: ${i?.length?i.join(", "):n||b.Pod}\n`,$.push({title:"Label"+(d.length>1?` #${o+1}`:""),value:a})}),u?.length&&$.push({type:v.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:n,fromSources:i},o)=>{let a="";a+=`Annotation Key: ${e}\n`,a+=`Attribute Key: ${t}\n`;a+=`From: ${i?.length?i.join(", "):n||b.Pod}\n`,$.push({title:"Annotation"+(u.length>1?` #${o+1}`:""),value:a})})),t===y.AddClusterInfo){$.push({title:"Overwrite Existing Values",value:String(h||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:n},i)=>{e+=`${t}: ${n}`,i<p.length-1&&(e+=", ")}),$.push({title:"Attributes",value:e})}if(t===y.DeleteAttributes){let e="";m?.forEach((t,n)=>{e+=t,n<m.length-1&&(e+=", ")}),$.push({title:"Attributes",value:e})}if(t===y.RenameAttributes){let e="";const t=Object.entries(g||{});t.forEach(([n,i],o)=>{e+=`${n}: ${i}`,o<t.length-1&&(e+=", ")}),$.push({title:"Attributes",value:e})}if(t===y.PiiMasking){let e="";S?.forEach((t,n)=>{e+=t,n<S.length-1&&(e+=", ")}),$.push({title:"Categories",value:e})}return t===y.ErrorSampler&&$.push({title:"Sampling Ratio",value:String(x)}),t===y.ProbabilisticSampler&&$.push({title:"Sampling Percentage",value:String(C)}),t===y.LatencySampler&&w?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i},o)=>{let a="";a+=`Service Name: ${e}\n`,a+=`HTTP Route: ${t}\n`,a+=`Min. Latency: ${n}\n`,a+=`Fallback Sampling Ratio: ${i}`,$.push({title:"Endpoint"+(w.length>1?` #${o+1}`:""),value:a})}),t===y.ServiceNameSampler&&k?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n},i)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Sampling Ratio: ${t}\n`,o+=`Fallback Sampling Ratio: ${n}`,$.push({title:"Filter"+(k.length>1?` #${i+1}`:""),value:o})}),t===y.SpanAttributeSampler&&T?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i},o)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`Fallback Sampling Ratio: ${n}\n`;const r=Object.keys(i)[0];a+=`Condition: ${r}\n`,a+=`Operation: ${i[r]?.operation}\n`,a+=`Expected Value: ${i[r]?.expectedValue}`,"jsonCondition"===r&&(a+=`\nJSON Path: ${i[r].jsonPath}`),$.push({title:"Filter"+(T.length>1?` #${o+1}`:""),value:a})}),t===y.URLTemplatization&&E?.forEach((e,t)=>{let n="";e.filterK8sNamespace&&(n+=`Namespace: ${e.filterK8sNamespace}\n`),e.workloadFilters?.length&&e.workloadFilters.forEach(e=>{const t=[e.kind,e.name].filter(Boolean).join("/");t&&(n+=`Workload: ${t}\n`)});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");n+=`Templates: ${i}`,e.notes&&(n+=`\nNotes: ${e.notes}`),$.push({title:"Group"+(E.length>1?` #${t+1}`:""),value:n})}),$},Vi=S.PiiCategories,Bi=h.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
gap: 32px;
|
|
@@ -381,7 +381,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
381
381
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
382
382
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
383
383
|
animation-name: ${Qt.in.center};
|
|
384
|
-
`,zr=({totalSourceCount:n,uninstrumentSources:o,restartWorkloads:r})=>{const l=g(),{selectedSources:s,setSelectedSources:d}=ze(),[u,p]=i(!1),[h,m]=i(!1),f=c(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),v=()=>{d({})};return f?e(a,{children:[e(_r,{"data-id":"multi-source-control",children:[t(B,{children:"Selected sources"}),t(Fe,{label:f,filled:!0}),t(A,{orientation:"vertical",length:"16px"}),t(_e,{variant:"tertiary",onClick:v,children:t(B,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(_e,{variant:"tertiary",onClick:()=>m(!0),children:[t(mi,{}),t(B,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(_e,{variant:"tertiary",onClick:()=>p(!0),children:[t(ti,{}),t(B,{family:"secondary",decoration:"underline",color:l.text.error,children:"Uninstrument"})]})]}),t(G,{isOpen:u,name:`${f} sources`,type:J.Source,isLastItem:f===n,onApprove:()=>{const e={};Object.entries(s).forEach(([t,n])=>{e[t]=n.map(e=>({...e,selected:!1}))}),o(e),p(!1),v()},onDeny:()=>p(!1)}),t(Xt,{isOpen:h,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",approveButton:{text:"Confirm",variant:ue.Warning,onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.
|
|
384
|
+
`,zr=({totalSourceCount:n,uninstrumentSources:o,restartWorkloads:r})=>{const l=g(),{selectedSources:s,setSelectedSources:d}=ze(),[u,p]=i(!1),[h,m]=i(!1),f=c(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),v=()=>{d({})};return f?e(a,{children:[e(_r,{"data-id":"multi-source-control",children:[t(B,{children:"Selected sources"}),t(Fe,{label:f,filled:!0}),t(A,{orientation:"vertical",length:"16px"}),t(_e,{variant:"tertiary",onClick:v,children:t(B,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(_e,{variant:"tertiary",onClick:()=>m(!0),children:[t(mi,{}),t(B,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(_e,{variant:"tertiary",onClick:()=>p(!0),children:[t(ti,{}),t(B,{family:"secondary",decoration:"underline",color:l.text.error,children:"Uninstrument"})]})]}),t(G,{isOpen:u,name:`${f} sources`,type:J.Source,isLastItem:f===n,onApprove:()=>{const e={};Object.entries(s).forEach(([t,n])=>{e[t]=n.map(e=>({...e,selected:!1}))}),o(e),p(!1),v()},onDeny:()=>p(!1)}),t(Xt,{isOpen:h,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",approveButton:{text:"Confirm",variant:ue.Warning,onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.filter(e=>e.kind!==Zt.StaticPod).map(e=>en(e)))}),r(e),m(!1),v()}},denyButton:{text:"Go Back",onClick:()=>m(!1)}})]}):null},Kr=h.div`
|
|
385
385
|
position: relative;
|
|
386
386
|
width: fit-content;
|
|
387
387
|
`,jr=h(O)`
|
|
@@ -436,7 +436,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
436
436
|
display: flex;
|
|
437
437
|
align-items: center;
|
|
438
438
|
gap: 6px;
|
|
439
|
-
`,Xr=({id:i,seen:o,type:a,title:r,message:l,time:s,crdType:c,target:d,onClick:u})=>{const p=g(),{formatTimeAgo:h}=
|
|
439
|
+
`,Xr=({id:i,seen:o,type:a,title:r,message:l,time:s,crdType:c,target:d,onClick:u})=>{const p=g(),{formatTimeAgo:h}=tn(),{onClickNotification:m}=nn(),f=!!c&&!!d,v=r?.toLowerCase().includes(oe.Delete.toLowerCase())||!1,y=Se(a,p);return e(Hr,{className:f?"click-enabled":"",onClick:()=>{f&&(u(),m({id:i,crdType:c,target:d}))},children:[t(qr,{$type:v?ue.Error:a,children:t(v?ti:y,{})}),e(Gr,{children:[t(Yr,{children:t(B,{size:14,children:l})}),e(Jr,{children:[t(B,{size:10,color:p.text.grey,children:h(s)}),!o&&e(n,{children:[t(B,{size:10,children:"·"}),t(B,{size:10,color:p.colors.orange_soft,children:"new"})]})]})]})]},`notification-${i}`)},Qr=e=>`${J.Source}-${e}-${on.MapItem}`,Zr=(e,t,n)=>{const i=e.isVirtual,o=n?[fi]:i?[an(e)]:t?Ye(t):[vi],{priorotizedStatus:a}=i?{priorotizedStatus:void 0}:ge(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:o,isVirtual:i,status:a,aggService:e}},el=e=>!(!e||"user"!==e.otelServiceName||e.namespace||e.name||e.kind),tl=({theme:e,nodes:t,aggregatedServiceMap:n})=>{const i=[],o=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=Qr(t.graphKey),a=o.get(n);if(!a)continue;const r=a.data?.status===ue.Error;for(const a of t.connections){const l=Qr(a.targetGraphKey);o.has(l)&&i.push({id:`${n}-to-${l}`,type:"smoothstep",source:n,target:l,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Li.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})}}return i},nl=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},il=new zi,ol=`${J.Source}-user-${on.MapItem}`,al={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},rl=h.div`
|
|
440
440
|
padding: 8px 0;
|
|
441
441
|
`,ll=h.div`
|
|
442
442
|
display: flex;
|
|
@@ -459,11 +459,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
459
459
|
}
|
|
460
460
|
`,cl=h.div`
|
|
461
461
|
padding: 4px 0 8px;
|
|
462
|
-
`,dl=({conn:n,onToggle:i,isExpanded:o})=>{const a=n.details.length>0;return t(rl,{children:e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(B,{size:14,weight:500,children:n.targetServiceName}),a&&e(sl,{onClick:i,children:[t(o?yi:bi,{size:12}),o?"hide attributes":`${n.details.length} attribute${n.details.length>1?"s":""}`]})]})})},ul=({conn:e})=>{const i=g();return t(n,{children:e.details.map(e=>t(ll,{children:t(B,{size:12,color:i.text.secondary,style:{flex:1},children:e.value})},e.value))})},pl=({connections:o,isVirtual:a,attributes:r})=>{const[l,s]=i(new Set),c=g();if(a){const i=Object.entries(r||{});return e(n,{children:[t(B,{size:12,color:c.text.info,children:"This service is not instrumented. It was detected from client-side spans of services that communicate with it."}),i.length>0&&e(n,{children:[t(cl,{style:{paddingTop:16},children:t(B,{size:11,color:c.text.info,children:"Attributes"})}),i.map(([n,i])=>e(ll,{children:[t(B,{size:12,color:c.text.secondary,children:n}),t(B,{size:12,children:i})]},n))]})]})}return o.length?e(n,{children:[t(cl,{children:t(B,{size:11,color:c.text.info,children:"Connected services"})}),o.map(n=>e("div",{children:[t(dl,{conn:n,isExpanded:l.has(n.targetGraphKey),onToggle:()=>{return e=n.targetGraphKey,void s(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});var e}}),l.has(n.targetGraphKey)&&t(ul,{conn:n}),t(A,{})]},n.targetGraphKey))]}):t(B,{size:12,color:c.text.info,children:"No outgoing connections"})},hl=({conn:i})=>{const o=g();return i?t(n,{children:i.details.length>0?e(n,{children:[t(cl,{children:t(B,{size:11,color:o.text.info,children:"Attribute breakdown"})}),i.details.map(e=>t(ll,{children:t(B,{size:12,style:{flex:1},children:e.value})},e.value))]}):t(B,{size:12,color:o.text.info,style:{padding:"8px 0"},children:"No attribute breakdown"})}):t(B,{size:12,color:o.text.info,children:"No data for this connection"})},ml=({drawerState:e,aggregatedData:n,onClose:i})=>{if(!e)return null;const o=new Map(n.map(e=>[e.graphKey,e]));let a="",r="",l=null;if("node"===e.type){const n=o.get(e.graphKey);a=n?.serviceName||e.graphKey,r=n?.isVirtual?"Virtual service (uninstrumented)":"Outgoing connections",l=t(pl,{connections:n?.connections||[],isVirtual:n?.isVirtual,attributes:n?.attributes})}else{const n=o.get(e.sourceKey),i=n?.connections.find(t=>t.targetGraphKey===e.targetKey);a=`${n?.serviceName||e.sourceKey} → ${i?.targetServiceName||e.targetKey}`,r="Connection details",l=t(hl,{conn:i})}return t(
|
|
462
|
+
`,dl=({conn:n,onToggle:i,isExpanded:o})=>{const a=n.details.length>0;return t(rl,{children:e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(B,{size:14,weight:500,children:n.targetServiceName}),a&&e(sl,{onClick:i,children:[t(o?yi:bi,{size:12}),o?"hide attributes":`${n.details.length} attribute${n.details.length>1?"s":""}`]})]})})},ul=({conn:e})=>{const i=g();return t(n,{children:e.details.map(e=>t(ll,{children:t(B,{size:12,color:i.text.secondary,style:{flex:1},children:e.value})},e.value))})},pl=({connections:o,isVirtual:a,attributes:r})=>{const[l,s]=i(new Set),c=g();if(a){const i=Object.entries(r||{});return e(n,{children:[t(B,{size:12,color:c.text.info,children:"This service is not instrumented. It was detected from client-side spans of services that communicate with it."}),i.length>0&&e(n,{children:[t(cl,{style:{paddingTop:16},children:t(B,{size:11,color:c.text.info,children:"Attributes"})}),i.map(([n,i])=>e(ll,{children:[t(B,{size:12,color:c.text.secondary,children:n}),t(B,{size:12,children:i})]},n))]})]})}return o.length?e(n,{children:[t(cl,{children:t(B,{size:11,color:c.text.info,children:"Connected services"})}),o.map(n=>e("div",{children:[t(dl,{conn:n,isExpanded:l.has(n.targetGraphKey),onToggle:()=>{return e=n.targetGraphKey,void s(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});var e}}),l.has(n.targetGraphKey)&&t(ul,{conn:n}),t(A,{})]},n.targetGraphKey))]}):t(B,{size:12,color:c.text.info,children:"No outgoing connections"})},hl=({conn:i})=>{const o=g();return i?t(n,{children:i.details.length>0?e(n,{children:[t(cl,{children:t(B,{size:11,color:o.text.info,children:"Attribute breakdown"})}),i.details.map(e=>t(ll,{children:t(B,{size:12,style:{flex:1},children:e.value})},e.value))]}):t(B,{size:12,color:o.text.info,style:{padding:"8px 0"},children:"No attribute breakdown"})}):t(B,{size:12,color:o.text.info,children:"No data for this connection"})},ml=({drawerState:e,aggregatedData:n,onClose:i})=>{if(!e)return null;const o=new Map(n.map(e=>[e.graphKey,e]));let a="",r="",l=null;if("node"===e.type){const n=o.get(e.graphKey);a=n?.serviceName||e.graphKey,r=n?.isVirtual?"Virtual service (uninstrumented)":"Outgoing connections",l=t(pl,{connections:n?.connections||[],isVirtual:n?.isVirtual,attributes:n?.attributes})}else{const n=o.get(e.sourceKey),i=n?.connections.find(t=>t.targetGraphKey===e.targetKey);a=`${n?.serviceName||e.sourceKey} → ${i?.targetServiceName||e.targetKey}`,r="Connection details",l=t(hl,{conn:i})}return t(rn,{isOpen:!0,width:"420px",position:"right",header:{title:a,subTitle:r,onClose:i},children:l})},gl=h.div`
|
|
463
463
|
width: 100%;
|
|
464
464
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
465
465
|
position: relative;
|
|
466
|
-
`,fl={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},vl=`${J.Source}-`,yl=`-${
|
|
466
|
+
`,fl={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},vl=`${J.Source}-`,yl=`-${on.MapItem}`,bl=.15,Sl=({heightToRemove:n,serviceMap:a,onRefresh:r})=>{const s=g(),c=X(e=>e.sources),[u,p,h]=Pi([]),[m,v,y]=_i([]),[b,S]=i(0),[x,C]=i(null),w=l([]);w.current=u;const k=l(s);k.current=s;const T=l([]),E=l([]),$=d(()=>S(e=>e+1),[]),{activeNodeId:N,setActiveNodeType:D,setActiveNodeId:I}=ln();o(()=>{if(!N)return;const e=(t=N).startsWith(vl)&&t.endsWith(yl)?t.slice(vl.length,-yl.length):null;var t;e&&C({type:"node",graphKey:e})},[N]);const A=d((e,t)=>{const{sourceGraphKey:n,targetGraphKey:i}=t.data||{};n&&i&&(D(null),I(null),C({type:"edge",sourceKey:n,targetKey:i}))},[D,I]),R=d(()=>{C(null),D(null),I(null)},[D,I]),O=d((e,t)=>{const n=t.id;v(e=>e.map(e=>e.source===n||e.target===n?{...e,animated:!0,style:{...e.style,strokeWidth:2.5},labelStyle:{...e.labelStyle,opacity:1},labelBgStyle:{...e.labelBgStyle,opacity:1}}:{...e,style:{...e.style,opacity:bl},labelStyle:{...e.labelStyle,opacity:bl},labelBgStyle:{...e.labelBgStyle,opacity:bl}}))},[v]),M=d(()=>{v(E.current)},[v]);return o(()=>{let e=!1;const t=(e=>{const t=new Map,n=new Set,i=(e,n,i=!1)=>{let o=t.get(e);return o||(o={serviceName:n,isVirtual:i,attributes:{},connectionMap:new Map},t.set(e,o)),o},o=(e,t)=>{if(t)for(const{key:n,value:i}of t)n in e||(e[n]=i)};for(const t of e){const{graphKey:e}=nl(t.nodeId),a=i(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:r}=nl(e.nodeId);e.isVirtual&&(n.add(t),o(i(t,e.serviceName,!0).attributes,e.nodeAttributes));let l=a.connectionMap.get(t);if(l||(l={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,l)),l.totalRequests+=e.requests,e.dateTime>l.lastDateTime&&(l.lastDateTime=e.dateTime),r){const t=l.details.find(e=>e.value===r);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):l.details.push({value:r,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[o,a]of e)t.has(o)||i(o,a.targetServiceName,n.has(o));const r=[];for(const[e,{serviceName:n,isVirtual:i,attributes:o,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),r.push({graphKey:e,serviceName:n,isVirtual:i,connections:t,attributes:o})}return r.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),r})(a);T.current=t;const n=(({sources:e,aggregatedServiceMap:t})=>{const n=[],i={x:0,y:0};if(t.length&&e.length)for(const o of t){const t=Qr(o.graphKey),a=e.find(e=>o.serviceName===e.otelServiceName||o.serviceName===e.name);n.push({id:t,type:on.MapItem,position:i,data:Zr(o,a,el(a)),measured:{width:80,height:80}})}else n.push({id:`${J.Source}-${on.NoData}`,type:on.NoData,position:i,data:{subTitle:f.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:t,sources:[fl].concat(c)});if(1===n.length&&n[0].id===`${J.Source}-${on.NoData}`)return p(n),v([]),void(E.current=[]);const i=new Set(w.current.map(e=>e.id)),o=new Set(n.map(e=>e.id)),r=n.some(e=>!i.has(e.id)),l=w.current.some(e=>!o.has(e.id));if(!(r||l)){const e=new Map(w.current.map(e=>[e.id,e.position]));p(n.map(t=>({...t,position:e.get(t.id)??t.position})));const i=tl({theme:k.current,nodes:n,aggregatedServiceMap:t});return E.current=i,void v(i)}return(async(e,t,n={})=>{const i={id:"root",layoutOptions:{...al,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===ol?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},o=await il.layout(i),a=new Map;return o.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(n,tl({theme:k.current,nodes:n,aggregatedServiceMap:t})).then(({nodes:t})=>{if(e)return;p(t);const n=tl({theme:k.current,nodes:t,aggregatedServiceMap:T.current});E.current=n,v(n),$()}),()=>{e=!0}},[a,c]),o(()=>{if(!w.current.length)return;const e=tl({theme:s,nodes:w.current,aggregatedServiceMap:T.current});E.current=e,v(e)},[s]),e(gl,{$heightToRemove:n,children:[t(sn,{nodes:u,edges:m,onNodesChange:h,onEdgesChange:y,onEdgeClick:A,onNodeMouseEnter:O,onNodeMouseLeave:M,onRefresh:r,fitViewTrigger:b,zoomOnScroll:!0}),t(ml,{drawerState:x,aggregatedData:T.current,onClose:R})]})},xl=h.div`
|
|
467
467
|
width: 100%;
|
|
468
468
|
padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
|
|
469
469
|
border-radius: 16px;
|
|
@@ -499,7 +499,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
499
499
|
align-items: center;
|
|
500
500
|
justify-content: flex-end;
|
|
501
501
|
text-align: right;
|
|
502
|
-
`,Nl=De(J.Namespace),Dl=({isModal:n=!1,withInstances:i=!0,loading:o,filteredNamespacesAndSources:a,selectedNamespace:r,onSelectNamespace:l,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const p=g(),{isVm:h}=ae(),{namespacesLoading:m}=X(),v=Object.entries(a||{});return v?.length?t(We,{height:n?"calc(100vh - 510px)":"calc(100vh - 310px)",gap:12,noAnimation:!0,elements:v.map(([n,a])=>{const g=s?.[n]||[],v=d?.[n]?.selected||!1,y=g.filter(({selected:e})=>e),b=g.length>0,S=r===n,x=y.length>0&&y.length===a.length,w=y.length>0&&y.length!==a.length,k=a.length>0,T=1===a.length;return l||k?e(xl,{"data-id":`namespace-${n}`,$selected:x,$isOpen:S,children:[e(Cl,{$selected:x,$withClick:!!l,onClick:()=>l?.(n),children:[e(O,{$gap:12,children:[l&&t(C,{partiallyChecked:w,value:x,onChange:e=>l(n,e)}),t(Nl,{}),t(B,{children:n})]}),e(O,{$gap:24,children:[!h&&u&&t(N,{title:f.FUTURE_APPS_TITLE,tooltip:f.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,n),flipHorizontally:!0}),t($l,{children:t(B,{size:10,color:p.text.grey,children:b?`${y.length}/${a.length}`:null})}),l&&t(St,{extend:S})]})]}),(S||!l)&&(k?e(kl,{$addPadding:!c,children:[t(Tl,{children:t(A,{orientation:"vertical",length:(T?24:34*a.length)+"px"})}),a.map(e=>{const o=y.some(({name:t})=>t===e.name);return t(Il,{withInstances:i,source:e,namespace:n,isSelected:o,onSelect:c},`source-${e.name}`)})]}):t(El,{$addPadding:!c,children:m||o?t(Pe,{}):t(Oe,{title:f.NO_SOURCES_NAMESPACE,subTitle:f.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${n}`):null})}):t(Re,{children:m||o?t(Pe,{}):t(Oe,{title:f.NO_SOURCES,subTitle:!h&&l?f.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:f.PLEASE_ADD_SOURCE})})},Il=({withInstances:n,source:i,namespace:o,isSelected:a,onSelect:r})=>{const{tier:l}=ae(),s=l!==Jt.Onprem&&!!i.kind&&
|
|
502
|
+
`,Nl=De(J.Namespace),Dl=({isModal:n=!1,withInstances:i=!0,loading:o,filteredNamespacesAndSources:a,selectedNamespace:r,onSelectNamespace:l,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const p=g(),{isVm:h}=ae(),{namespacesLoading:m}=X(),v=Object.entries(a||{});return v?.length?t(We,{height:n?"calc(100vh - 510px)":"calc(100vh - 310px)",gap:12,noAnimation:!0,elements:v.map(([n,a])=>{const g=s?.[n]||[],v=d?.[n]?.selected||!1,y=g.filter(({selected:e})=>e),b=g.length>0,S=r===n,x=y.length>0&&y.length===a.length,w=y.length>0&&y.length!==a.length,k=a.length>0,T=1===a.length;return l||k?e(xl,{"data-id":`namespace-${n}`,$selected:x,$isOpen:S,children:[e(Cl,{$selected:x,$withClick:!!l,onClick:()=>l?.(n),children:[e(O,{$gap:12,children:[l&&t(C,{partiallyChecked:w,value:x,onChange:e=>l(n,e)}),t(Nl,{}),t(B,{children:n})]}),e(O,{$gap:24,children:[!h&&u&&t(N,{title:f.FUTURE_APPS_TITLE,tooltip:f.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,n),flipHorizontally:!0}),t($l,{children:t(B,{size:10,color:p.text.grey,children:b?`${y.length}/${a.length}`:null})}),l&&t(St,{extend:S})]})]}),(S||!l)&&(k?e(kl,{$addPadding:!c,children:[t(Tl,{children:t(A,{orientation:"vertical",length:(T?24:34*a.length)+"px"})}),a.map(e=>{const o=y.some(({name:t})=>t===e.name);return t(Il,{withInstances:i,source:e,namespace:n,isSelected:o,onSelect:c},`source-${e.name}`)})]}):t(El,{$addPadding:!c,children:m||o?t(Pe,{}):t(Oe,{title:f.NO_SOURCES_NAMESPACE,subTitle:f.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${n}`):null})}):t(Re,{children:m||o?t(Pe,{}):t(Oe,{title:f.NO_SOURCES,subTitle:!h&&l?f.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:f.PLEASE_ADD_SOURCE})})},Il=({withInstances:n,source:i,namespace:o,isSelected:a,onSelect:r})=>{const{tier:l}=ae(),s=l!==Jt.Onprem&&!!i.kind&&cn.has(i.kind);return t(wl,{"data-id":`source-${i.name}`,$selected:!s&&a,$withClick:!s&&!!r,onClick:()=>!s&&r?.(i),style:s?{opacity:.5,cursor:"not-allowed"}:void 0,children:e(O,{$gap:12,children:[r&&t(C,{value:!s&&a,onChange:()=>!s&&r(i,o)}),e(O,{$gap:4,children:[t(B,{children:i.name}),e(B,{opacity:.8,size:10,children:[n?` • ${i.numberOfInstances||0} running instance${1!==i.numberOfInstances?"s":""}`:"",` • ${i.kind}`,s?" • Enterprise only":""]})]})]})})},Al=h.div`
|
|
503
503
|
display: flex;
|
|
504
504
|
flex-direction: column;
|
|
505
505
|
align-items: center;
|
|
@@ -508,7 +508,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
508
508
|
max-height: calc(100vh - 200px);
|
|
509
509
|
height: fit-content;
|
|
510
510
|
overflow-y: scroll;
|
|
511
|
-
`,Rl=({onEditStream:n,onEditSources:i,onEditDestinations:o,categories:a})=>{const{selectedStreamName:r}=Ze(),{configuredSources:l,configuredDestinations:s,configuredDestinationsUpdateOnly:d}=yt(),u=c(()=>Object.values(l).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[l]);return t(ce,{$isNotModal:!0,children:e(R,{$gap:12,children:[t(z,{title:f.SUMMARY,description:f.STREAM_CONFIRM}),e(Al,{children:[t(ne,{title:f.STREAM_NAME,action:()=>t(cn,{onClick:n}),data:[{title:"",value:r}]}),t(ne,{title:f.SELECTED_SOURCES,titleBadge:u,action:()=>t(cn,{onClick:i}),children:t(Dl,{filteredNamespacesAndSources:l,withInstances:!1})}),t(ne,{title:f.SELECTED_DESTINATIONS,titleBadge:s.length+d.length,action:()=>t(cn,{onClick:o}),children:t(dr,{categories:a})})]})]})})};var Ol;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(Ol||(Ol={}));const Ml=({onClickId:e,defaultSelectedId:n,extendedNavIcons:o})=>{const{isVm:a}=ae(),[r,l]=i(n||""),s=c(()=>[{id:Ol.Overview,icon:Si,selected:r===Ol.Overview,onClick:()=>{l(Ol.Overview),e(Ol.Overview)},tooltip:"Overview"},...(o||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{l(e.id),e.onClick()}}))],[r]),d=c(()=>{const t=[{id:Ol.Sources,icon:xi,selected:r===Ol.Sources,onClick:()=>{l(Ol.Sources),e(Ol.Sources)},tooltip:"Sources"},{id:Ol.Destinations,icon:Ci,selected:r===Ol.Destinations,onClick:()=>{l(Ol.Destinations),e(Ol.Destinations)},tooltip:"Destinations"}];return a||(t.push({id:Ol.InstrumentationRules,icon:wi,selected:r===Ol.InstrumentationRules,onClick:()=>{l(Ol.InstrumentationRules),e(Ol.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:Ol.Actions,icon:ki,selected:r===Ol.Actions,onClick:()=>{l(Ol.Actions),e(Ol.Actions)},tooltip:"Actions"})),t},[a,r]);return t(dn,{orientation:"vertical",mainIcons:s,subIcons:d})},Fl=({})=>t(M,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community",children:t(Ti,{})});function Ll(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function Pl(e){const t=Math.abs(e);return t>=1e9?`${_l(e/1e9)}s`:t>=1e6?`${_l(e/1e6)}ms`:t>=1e3?`${_l(e/1e3)}μs`:String(Math.round(e))}function _l(e){return e.toFixed(2).replace(/\.?0+$/,"")}function zl(e){const t=[];for(let n=0;n<e.levels.length;n++){const i=e.levels[n];let o=0;for(let e=0;e+3<i.length;e+=4){const a=i[e],r=i[e+1],l=i[e+2],s=i[e+3],c=o+a;t.push({level:n,offset:c,size:r,self:l,nameIndex:s}),o=c+r}}return t}function Kl(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function jl(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Vl(e,t,n,i,o,a=null){if(0===e.levels.length||t<2||n<2)return null;const r=zl(e),l=a?function(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),i=new Map;for(const t of e){const e=i.get(t.level);e?e.push(t):i.set(t.level,[t])}const o=[t];for(let e=t.level+1;e<=n;e++){const t=o.filter(t=>t.level===e-1);if(0===t.length)break;const n=i.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){o.push(e);break}}return o}(r,a):r;if(0===l.length)return null;const s=a?.level??0,c=a?.offset??0,d=a?.size??e.numTicks;if(d<=0)return null;const u=a?Math.max(...l.map(e=>e.level-s))+1:e.levels.length,p=i??Number.POSITIVE_INFINITY,h=Math.max(1,Math.min(n/u,p)),m=o.trim(),g=h>8?1:0;return l.map(n=>{const i=n.level-s,o=(n.offset-c)/d*t,r=Math.max(n.size/d*t,1),l=(a?i:n.level)*h,u=Math.max(h-g,1),p=Ll(e,n.nameIndex);return{...n,x:o,y:l,w:r,h:u,name:p,matchesSearch:jl(p,m)}})}function Bl(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const i=t.v2.colors.black[500],o=[{fill:t.v2.colors.purple[300],text:i},{fill:t.v2.colors.green[300],text:i},{fill:t.v2.colors.red[300],text:i},{fill:t.v2.colors.blue[300],text:i},{fill:t.v2.colors.yellow[300],text:i}];return o[n%o.length]}var Wl,Ul;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Wl||(Wl={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Ul||(Ul={}));const Hl=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;const ql={options:[{id:Ul.FilterOutVoid,label:"Filter out void symbols"},{id:Ul.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>{const n=e.cells.find(e=>e.key===Wl.Symbol)?.rawValue?.toString()??"",i=function(e){return e.split(" ")[0]??""}(n);if(t.includes(Ul.FilterOutVoid)&&"void"===i)return!1;if(t.includes(Ul.OnlyWithReturnValues)){if(!(n.includes(" ")&&"void"!==i&&Hl.test(i)))return!1}return!0}},Gl=({rows:e,languages:n})=>{const i=c(()=>[{key:Wl.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:n?.includes(un.Java)?ql:void 0,noFilter:!n?.includes(un.Java)},{key:Wl.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Wl.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[n]),o=c(()=>e.map(e=>({cells:[{key:Wl.Symbol,rawValue:e.name},{key:Wl.Self,rawValue:Pl(e.self)},{key:Wl.Total,rawValue:Pl(e.total)}]})),[e]);return t(pn,{variant:hn.Data,maxHeight:"calc(100vh - 340px)",columns:i,rows:o,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Ei,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var Yl;function Jl(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Xl(e,t,n){for(const i of n)if(e>=i.x&&e<i.x+i.w&&t>=i.y&&t<i.y+i.h)return i;return null}!function(e){e[e.Fit=1]="Fit",e[e.X2=2]="X2",e[e.X5=5]="X5",e[e.X10=10]="X10"}(Yl||(Yl={}));const Ql=({flamebearer:n,maxRowPx:a,searchQuery:r="",minHostHeight:s=200,onFullscreenChange:p})=>{const h=g(),m=l(null),f=l(null),v=l({x:0,y:0}),y=l(n.numTicks),[b,S]=i({w:0,h:0}),[x,C]=i(""),[w,k]=i(null),[T,E]=i([]),[$,N]=i(!1),[D,I]=i(Yl.Fit),A=Math.max(1,Math.floor(b.w*D)),R=T.length>0?T[T.length-1]:null,O=R?.size??n.numTicks;o(()=>{y.current!==n.numTicks&&(y.current=n.numTicks,E([]))},[n.numTicks]),u(()=>{const e=m.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();S({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),o(()=>{if(!$)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[$]),o(()=>(p?.($),()=>{$&&p?.(!1)}),[$,p]);const M=c(()=>Vl(n,A,b.h,a,r,R),[n,a,r,b.h,A,R]),F=c(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(M?.length?r.trim()?M.filter(e=>e.matchesSearch):M:[]),[M,r]),L=d(e=>{if(A<2||b.h<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const i=Xl((e.clientX-t.left)/t.width*A,(e.clientY-t.top)/t.height*b.h,F);if(i){const e=Kl(i);k(e);const t=O>0?(100*i.size/O).toFixed(1):"0",o=n.numTicks>0?(100*i.size/n.numTicks).toFixed(1):"0";C(`${i.name}\ntotal ${Pl(i.size)} (${t}% of view, ${o}% of profile) · self ${Pl(i.self)}`)}else k(null),C("")},[F,n.numTicks,b.h,A,O]),P=d(e=>{L(e)},[L]),_=d(()=>{k(null),C("")},[]),z=d(e=>{v.current={x:e.clientX,y:e.clientY}},[]),K=d(e=>{const{x:t,y:n}=v.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(A<2||b.h<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=Xl((e.clientX-i.left)/i.width*A,(e.clientY-i.top)/i.height*b.h,F);if(!o)return;const a=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(o);E(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(a,t)?e.slice(0,-1):[...e,a]})},[F,b.h,A]);u(()=>{const e=f.current;if(!e||A<2||b.h<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1;e.width=Math.floor(A*t),e.height=Math.floor(b.h*t),e.style.width=`${A}px`,e.style.height=`${b.h}px`;const i=e.getContext("2d");i&&(i.setTransform(t,0,0,t,0,0),i.clearRect(0,0,A,b.h),M?.length?function(e,t,n,i,o,a,r,l){const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=o.trim().length>0;for(const t of i){const{x:n,y:i,w:o,h:r,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Bl(s,a);e.fillStyle=p,e.fillRect(n,i,o,r),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,i+.5),e.lineTo(n+o-.5,i+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,i+.5,Math.max(o-1,0),Math.max(r-1,0));const m=Jl(d,l),g=`${s} (${Pl(d)}, ${m}%)`,f=a.v2.text.size.xxs,v=3,y=22,b=Math.min(f,Math.floor(r-2));if(o>=y&&b>=5){e.font=`${b}px ${a.font_family.code}, ui-monospace, monospace`,e.textBaseline="middle",e.textAlign="left",e.fillStyle=h;let t=g;for(;t.length>2&&e.measureText(t).width>o-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*v&&e.fillText(t,n+v,i+r/2)}}if(r)for(const t of i){if(Kl(t)!==r)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:i,w:o,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,i+1,Math.max(o-2,0),Math.max(a-2,0));break}}(i,A,b.h,M,r,h,w,n.numTicks):(i.fillStyle=h.v2.colors.silver[900],i.fillRect(0,0,A,b.h)))},[M,n.numTicks,w,r,b.h,A,h]);const j=d(()=>N(e=>!e),[]),V=n.numTicks>0?Math.max(0,Math.min(100,Math.round(O/n.numTicks*100))):100,B=c(()=>function(e,t){const n=zl(e),i=t?.offset??0,o=i+(t?.size??e.numTicks),a=(t?.level??-1)+1,r=t?.size??e.numTicks;let l=null;for(const e of n)e.level<a||e.offset<i||e.offset+e.size>o||e.size>=r||(!l||e.size>l.size||e.size===l.size&&e.level<l.level)&&(l=e);return l}(n,R),[n,R]),W=null!==B,U=T.length>0,H=R?Ll(n,R.nameIndex):"",q=d(()=>E([]),[]),G=d(()=>E(e=>e.slice(0,-1)),[]),Y=d(()=>{B&&E(e=>[...e,B])},[B]);return e("div",{style:$?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:h.v2.colors.silver[900]}:{flex:1,minHeight:s,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",minHeight:32,flexShrink:0,padding:"0 2px"},children:[t("div",{style:{flex:"1 1 120px",minWidth:0},children:t(mn,R?{size:gn.XXS,color:h.v2.colors.silver[200],nowrap:!0,children:`Zoomed: ${H} • ${Pl(O)} samples in view`}:{size:gn.XXS,color:h.v2.colors.silver[200],children:"Click a frame to zoom into its subtree (pprof-style)."})}),e("div",{style:{display:"flex",gap:8,flexShrink:0,alignItems:"center"},children:[T.length>0&&t(fn,{variant:yn.Secondary,size:vn.S,label:"Reset zoom",leftIcon:si,onClick:q}),t(fn,{variant:yn.Secondary,size:vn.S,iconSize:20,leftIcon:$i,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!U,onClick:G}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(mn,{size:gn.XXS,color:h.v2.colors.silver[200],nowrap:!0,align:"center",children:`${V}%`})}),t(fn,{variant:yn.Secondary,size:vn.S,iconSize:20,leftIcon:ri,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!W,onClick:Y}),t(bn,{size:xn.S,variant:Sn.Filled,options:[{value:Yl.Fit,label:"Fit"},{value:Yl.X2,label:"2x"},{value:Yl.X5,label:"5x"},{value:Yl.X10,label:"10x"}],selected:D,setSelected:I}),t(fn,{variant:yn.Secondary,size:vn.S,iconSize:24,leftIcon:$?Ni:Di,tooltip:$?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:j})]})]}),t(be,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:m,style:{flex:1,minWidth:0,width:"100%",height:$?"calc(100vh - 80px)":"calc(100vh - 370px)",position:"relative",overflowX:D>1?"auto":"hidden",overflowY:"hidden"},children:t("div",{style:{width:A||"100%",height:"100%",position:"relative"},children:t("canvas",{ref:f,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:w?"pointer":"default"},onPointerDown:z,onPointerMove:P,onPointerLeave:_,onClick:K})})})})]})};var Zl;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Zl||(Zl={}));const es=h(R)`
|
|
511
|
+
`,Rl=({onEditStream:n,onEditSources:i,onEditDestinations:o,categories:a})=>{const{selectedStreamName:r}=Ze(),{configuredSources:l,configuredDestinations:s,configuredDestinationsUpdateOnly:d}=yt(),u=c(()=>Object.values(l).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[l]);return t(ce,{$isNotModal:!0,children:e(R,{$gap:12,children:[t(z,{title:f.SUMMARY,description:f.STREAM_CONFIRM}),e(Al,{children:[t(ne,{title:f.STREAM_NAME,action:()=>t(dn,{onClick:n}),data:[{title:"",value:r}]}),t(ne,{title:f.SELECTED_SOURCES,titleBadge:u,action:()=>t(dn,{onClick:i}),children:t(Dl,{filteredNamespacesAndSources:l,withInstances:!1})}),t(ne,{title:f.SELECTED_DESTINATIONS,titleBadge:s.length+d.length,action:()=>t(dn,{onClick:o}),children:t(dr,{categories:a})})]})]})})};var Ol;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(Ol||(Ol={}));const Ml=({onClickId:e,defaultSelectedId:n,extendedNavIcons:o})=>{const{isVm:a}=ae(),[r,l]=i(n||""),s=c(()=>[{id:Ol.Overview,icon:Si,selected:r===Ol.Overview,onClick:()=>{l(Ol.Overview),e(Ol.Overview)},tooltip:"Overview"},...(o||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{l(e.id),e.onClick()}}))],[r]),d=c(()=>{const t=[{id:Ol.Sources,icon:xi,selected:r===Ol.Sources,onClick:()=>{l(Ol.Sources),e(Ol.Sources)},tooltip:"Sources"},{id:Ol.Destinations,icon:Ci,selected:r===Ol.Destinations,onClick:()=>{l(Ol.Destinations),e(Ol.Destinations)},tooltip:"Destinations"}];return a||(t.push({id:Ol.InstrumentationRules,icon:wi,selected:r===Ol.InstrumentationRules,onClick:()=>{l(Ol.InstrumentationRules),e(Ol.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:Ol.Actions,icon:ki,selected:r===Ol.Actions,onClick:()=>{l(Ol.Actions),e(Ol.Actions)},tooltip:"Actions"})),t},[a,r]);return t(un,{orientation:"vertical",mainIcons:s,subIcons:d})},Fl=({})=>t(M,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community",children:t(Ti,{})});function Ll(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function Pl(e){const t=Math.abs(e);return t>=1e9?`${_l(e/1e9)}s`:t>=1e6?`${_l(e/1e6)}ms`:t>=1e3?`${_l(e/1e3)}μs`:String(Math.round(e))}function _l(e){return e.toFixed(2).replace(/\.?0+$/,"")}function zl(e){const t=[];for(let n=0;n<e.levels.length;n++){const i=e.levels[n];let o=0;for(let e=0;e+3<i.length;e+=4){const a=i[e],r=i[e+1],l=i[e+2],s=i[e+3],c=o+a;t.push({level:n,offset:c,size:r,self:l,nameIndex:s}),o=c+r}}return t}function Kl(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function jl(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Vl(e,t,n,i,o,a={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:r=null,shouldKeepName:l,collapseRecursive:s=!1}=a,c=zl(e);let d=r?function(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),i=new Map;for(const t of e){const e=i.get(t.level);e?e.push(t):i.set(t.level,[t])}const o=[t];for(let e=t.level+1;e<=n;e++){const t=o.filter(t=>t.level===e-1);if(0===t.length)break;const n=i.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){o.push(e);break}}return o}(c,r):c;if(0===d.length)return null;if(l&&(d=d.filter(t=>l(Ll(e,t.nameIndex))),0===d.length))return null;if(s&&(d=function(e,t){if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),i=new Map;for(const e of n){const t=i.get(e.level);t?t.push(e):i.set(e.level,[e])}const o=new Set;for(const t of n){const n=i.get(t.level+1);if(!n)continue;const a=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const r=a[0];r.size===t.size&&Ll(e,r.nameIndex)===Ll(e,t.nameIndex)&&o.add(Kl(r))}if(0===o.size)return n;const a=[];for(const e of n){if(o.has(Kl(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=i.get(n);if(!a)continue;const r=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);r&&o.has(Kl(r))&&t++}a.push({...e,level:e.level-t})}return a}(e,d),0===d.length))return null;const u=r?.level??0,p=r?.offset??0,h=r?.size??e.numTicks;if(h<=0)return null;const m=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,g=i??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(n/m,g)),v=o.trim(),y=f>8?1:0;return d.map(n=>{const i=n.level-u,o=(n.offset-p)/h*t,a=Math.max(n.size/h*t,1),r=i*f,l=Math.max(f-y,1),s=Ll(e,n.nameIndex);return{...n,x:o,y:r,w:a,h:l,name:s,matchesSearch:jl(s,v)}})}function Bl(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const i=t.v2.colors.black[500],o=[{fill:t.v2.colors.purple[300],text:i},{fill:t.v2.colors.green[300],text:i},{fill:t.v2.colors.red[300],text:i},{fill:t.v2.colors.blue[300],text:i},{fill:t.v2.colors.yellow[300],text:i}];return o[n%o.length]}var Wl,Ul;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Wl||(Wl={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Ul||(Ul={}));function Hl(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function ql(e,t,n){for(const i of n)if(e>=i.x&&e<i.x+i.w&&t>=i.y&&t<i.y+i.h)return i;return null}function Gl(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Yl=({flamebearer:n,maxRowPx:a,searchQuery:r="",shouldKeepName:s,minHostHeight:p=200,onFullscreenChange:h,profilingSlots:m})=>{const f=g(),v=l(null),y=l(null),b=l({x:0,y:0}),S=l(n.numTicks),[x,C]=i({w:0,h:0}),[w,k]=i(""),[T,E]=i(null),[$,N]=i([]),[D,I]=i(!1),[A,R]=i(Wl.Fit),[M,F]=i(Ul.Fit),[L,P]=i(!1),_=Math.max(1,Math.min(Math.floor(x.w*A),8192)),z=Math.max(1,Math.min(Math.floor(x.h*M),8192)),K=$.length>0?$[$.length-1]:null,j=K?.size??n.numTicks;o(()=>{S.current!==n.numTicks&&(S.current=n.numTicks,N([]))},[n.numTicks]),u(()=>{const e=v.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();C({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),o(()=>{if(!D)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[D]),o(()=>(h?.(D),()=>{D&&h?.(!1)}),[D,h]);const V=c(()=>Vl(n,_,z,a,r,{zoomRoot:K,shouldKeepName:s,collapseRecursive:L}),[n,a,r,z,_,K,s,L]),B=c(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(V?.length?r.trim()?V.filter(e=>e.matchesSearch):V:[]),[V,r]),W=d(e=>{if(_<2||z<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const i=ql((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*z,B);if(i){const e=Kl(i);E(e);const t=j>0?(100*i.size/j).toFixed(1):"0",o=n.numTicks>0?(100*i.size/n.numTicks).toFixed(1):"0";k(`${i.name}\ntotal ${Pl(i.size)} (${t}% of view, ${o}% of profile) · self ${Pl(i.self)}`)}else E(null),k("")},[B,n.numTicks,z,_,j]),U=d(e=>{W(e)},[W]),H=d(()=>{E(null),k("")},[]),q=d(e=>{b.current={x:e.clientX,y:e.clientY}},[]),G=d(e=>{const{x:t,y:n}=b.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(_<2||z<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=ql((e.clientX-i.left)/i.width*_,(e.clientY-i.top)/i.height*z,B);if(!o)return;const a=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(o);N(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(a,t)?e.slice(0,-1):[...e,a]})},[B,z,_]);u(()=>{const e=y.current;if(!e||_<2||z<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,i=Math.max(_,z),o=Math.min(t,16384/i);e.width=Math.floor(_*o),e.height=Math.floor(z*o),e.style.width=`${_}px`,e.style.height=`${z}px`;const a=e.getContext("2d");a&&(a.setTransform(o,0,0,o,0,0),a.clearRect(0,0,_,z),V?.length?function(e,t,n,i,o,a,r,l){const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=o.trim().length>0;e.textRendering="optimizeLegibility";for(const t of i){const{x:n,y:i,w:o,h:r,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Bl(s,a);e.fillStyle=p,e.fillRect(n,i,o,r),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,i+.5),e.lineTo(n+o-.5,i+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,i+.5,Math.max(o-1,0),Math.max(r-1,0));const m=Hl(d,l),g=`${s} (${Pl(d)}, ${m}%)`,f=a.v2.text.size.xs,v=8,y=5,b=26,S=Math.min(f,Math.floor(r-2));if(o>=b&&S>=v){e.font=`${S}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>o-2*y;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*y&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+y,i+r/2),e.fillStyle=h,e.fillText(t,n+y,i+r/2))}}if(r)for(const t of i){if(Kl(t)!==r)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:i,w:o,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,i+1,Math.max(o-2,0),Math.max(a-2,0));break}}(a,_,z,V,r,f,T,n.numTicks):(a.fillStyle=f.v2.colors.silver[900],a.fillRect(0,0,_,z)))},[V,n.numTicks,T,r,z,_,f]);const Y=d(()=>I(e=>!e),[]),J=n.numTicks>0?Math.max(0,Math.min(100,Math.round(j/n.numTicks*100))):100,X=c(()=>function(e,t){const n=zl(e),i=t?.offset??0,o=i+(t?.size??e.numTicks),a=(t?.level??-1)+1,r=t?.size??e.numTicks;let l=null;for(const e of n)e.level<a||e.offset<i||e.offset+e.size>o||e.size>=r||(!l||e.size>l.size||e.size===l.size&&e.level<l.level)&&(l=e);return l}(n,K),[n,K]),Q=null!==X,Z=$.length>0,ee=K?Ll(n,K.nameIndex):"",te=d(()=>N([]),[]),ne=d(()=>N(e=>e.slice(0,-1)),[]),ie=d(()=>{X&&N(e=>[...e,X])},[X]);return e("div",{style:D?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:f.v2.colors.silver[900]}:{flex:1,minHeight:p,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(O,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(pn,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:mn.Left,size:hn.S,value:L,onChange:P}),e(O,{$gap:8,children:[e(O,{children:[t(gn,{variant:vn.Secondary,size:fn.S,label:"Reset zoom",leftIcon:si,onClick:te,disabled:!$.length}),t(gn,{variant:vn.Secondary,size:fn.S,iconSize:20,leftIcon:Ei,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!Z,onClick:ne}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(yn,{size:bn.XXS,color:f.v2.colors.silver[200],nowrap:!0,align:"center",children:`${J}%`})}),t(gn,{variant:vn.Secondary,size:fn.S,iconSize:20,leftIcon:ri,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!Q,onClick:ie})]}),e(O,{children:[t(be,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(Sn,{size:Cn.S,variant:xn.Filled,options:[{value:Wl.Fit,label:"W: Fit"},{value:Wl.X10,label:"10x"}],selected:A,setSelected:R})}),t(be,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(Sn,{size:Cn.S,variant:xn.Filled,options:[{value:Ul.Fit,label:"H: Fit"},{value:Ul.X10,label:"10x"}],selected:M,setSelected:F})})]}),t(gn,{variant:vn.Secondary,size:fn.S,iconSize:24,leftIcon:D?$i:Ni,tooltip:D?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Y})]})]}),t(be,{fullWidth:!0,keepAlive:!0,text:w,children:t("div",{ref:v,style:{flex:1,minWidth:0,width:"100%",height:D?"calc(100vh - 80px)":"calc(100vh - 370px)",position:"relative",overflowX:A>1?"auto":"hidden",overflowY:M>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:z||"100%",position:"relative"},children:t("canvas",{ref:y,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:T?"pointer":"default"},onPointerDown:q,onPointerMove:U,onPointerLeave:H,onClick:G})})})}),e(O,{$justifyContent:"space-between",children:[t(yn,K?{size:bn.XXXS,color:f.v2.colors.silver[300],children:`Zoomed: ${ee} • ${Pl(j)} samples in view`}:{size:bn.XXXS,color:f.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),m&&t(yn,{size:bn.XXXS,color:f.v2.colors.silver[300],children:`${m.activeKeys.length} / ${m.maxSlots} profiling slots · ${Gl(m.totalBytesUsed)} / ${Gl(m.maxTotalBytesBudget)} budget · TTL ${m.slotTtlSeconds}s`})]})]})};var Jl,Xl;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Jl||(Jl={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Xl||(Xl={}));const Ql=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Zl(e,t){const n=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Xl.FilterOutVoid)&&"void"===n)return!1;if(t.includes(Xl.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==n&&Ql.test(n)))return!1}return!0}const es={options:[{id:Xl.FilterOutVoid,label:"Filter out void symbols"},{id:Xl.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>Zl(e.cells.find(e=>e.key===Jl.Symbol)?.rawValue?.toString()??"",t)},ts=({rows:e,languages:n,filters:i,onFiltersChange:o})=>{const a=c(()=>[{key:Jl.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:n?.includes(wn.Java)?es:void 0,noFilter:!n?.includes(wn.Java)},{key:Jl.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Jl.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[n]),r=c(()=>e.map(e=>({cells:[{key:Jl.Symbol,rawValue:e.name},{key:Jl.Self,rawValue:Pl(e.self)},{key:Jl.Total,rawValue:Pl(e.total)}]})),[e]);return t(kn,{variant:Tn.Data,maxHeight:"calc(100vh - 306px)",columns:a,rows:r,filters:i,onFiltersChange:o,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Di,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var ns;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(ns||(ns={}));const is=h(R)`
|
|
512
512
|
width: 100%;
|
|
513
513
|
min-height: 0;
|
|
514
514
|
flex: 1;
|
|
@@ -516,7 +516,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
516
516
|
overflow: hidden;
|
|
517
517
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
518
518
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
519
|
-
`,
|
|
519
|
+
`,os=h.div`
|
|
520
520
|
display: flex;
|
|
521
521
|
align-items: center;
|
|
522
522
|
gap: 10px;
|
|
@@ -524,11 +524,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
524
524
|
padding: 12px 12px 8px;
|
|
525
525
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
526
526
|
border-radius: 16px 16px 0 0;
|
|
527
|
-
`,
|
|
527
|
+
`,as=h(O)`
|
|
528
528
|
flex-shrink: 0;
|
|
529
529
|
align-items: center;
|
|
530
530
|
gap: 4px;
|
|
531
|
-
`,
|
|
531
|
+
`,rs=h.div`
|
|
532
532
|
display: flex;
|
|
533
533
|
flex: 1;
|
|
534
534
|
align-items: stretch;
|
|
@@ -537,65 +537,63 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
537
537
|
min-height: 0;
|
|
538
538
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
539
539
|
border-radius: 0 0 16px 16px;
|
|
540
|
-
`,
|
|
540
|
+
`,ls=h(R)`
|
|
541
541
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
542
542
|
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
543
543
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
544
544
|
min-width: 0;
|
|
545
545
|
min-height: 0;
|
|
546
546
|
gap: 10px;
|
|
547
|
-
`,
|
|
547
|
+
`,ss=h(R)`
|
|
548
548
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
549
549
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
550
550
|
min-width: 0;
|
|
551
551
|
min-height: 0;
|
|
552
552
|
gap: 10px;
|
|
553
|
-
`,
|
|
553
|
+
`,cs=h(O)`
|
|
554
554
|
width: 100%;
|
|
555
555
|
min-height: 32px;
|
|
556
556
|
flex-shrink: 0;
|
|
557
|
-
`,ls=h.div`
|
|
558
|
-
padding: 12px;
|
|
559
|
-
`;function ss(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const cs=({source:n,fetchProfilingSlots:r,enableProfiling:s,fetchSourceProfiling:u,onFlameFullscreenChange:p})=>{const h=g(),m=c(()=>({namespace:n.namespace,kind:n.kind,name:n.name}),[n.namespace,n.kind,n.name]),[f,v]=i(!0),[y,b]=i(null),[S,x]=i(null),[C,w]=i(0),[k,T]=i(Zl.Both),[E,$]=i(""),N=l(null),D=d(async()=>{try{const e=[r()];f&&e.push(u(m));const[t,n]=await Promise.all(e);t&&b(t),n?.profileJson&&x(n.profileJson)}finally{w(e=>e+1)}},[r,u,m]);o(()=>{let e=!1;return(async()=>{await s(m),e||(await D(),e||(N.current=setInterval(D,3e3)))})(),()=>{e=!0,N.current&&clearInterval(N.current)}},[s,D,m]);const I=c(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),n=t.flamebearer;return!n?.names?.length||!Array.isArray(n.levels)||"number"!=typeof n.numTicks||n.numTicks<=0?null:{flamebearer:n,units:t.metadata?.units}}catch{return null}}(S),[S]),A=c(()=>I?function(e){const t=new Map;for(let n=0;n<e.levels.length;n++){const i=e.levels[n];for(let n=0;n+3<i.length;n+=4){const o=i[n+1],a=i[n+2],r=Ll(e,i[n+3]);if(!r)continue;const l=t.get(r);(!l||o>l.total)&&t.set(r,{self:a,total:o})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(I.flamebearer):[],[I]),R=c(()=>{const e=E.trim().toLowerCase();return e?A.filter(t=>t.name.toLowerCase().includes(e)):A},[A,E]),M=k===Zl.Table||k===Zl.Both,F=k===Zl.Flame||k===Zl.Both,L=M&&F;return C<2?t(Re,{$height:"70vh",children:t(Cn,{withSpinner:!0})}):e(es,{$gap:0,$width:"100%",children:[e(ts,{children:[t(be,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(ns,{children:t(mn,{size:gn.S,weight:500,color:h.v2.colors.white[500],nowrap:!0,children:"CPU Profiling"})})}),e(O,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(wn,{value:E,onChange:$,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:h.v2.colors.silver[900],emphasizeBackgroundColor:h.v2.colors.silver[800]})}),t(bn,{size:xn.S,variant:Sn.Filled,options:[{value:Zl.Table,label:"Top table"},{value:Zl.Flame,label:"Flame graph"},{value:Zl.Both,label:"Both"}],selected:k,setSelected:T}),t(fn,f?{variant:yn.Secondary,size:vn.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(Ii,{...e,size:8,fill:h.v2.colors.green[500]})}:{variant:yn.Secondary,size:vn.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Ii,{...e,size:8,fill:h.v2.colors.red[500]})})]})]}),t(is,{$gap:M&&F?16:0,children:I?e(a,{children:[M&&e(os,{$splitWithFlame:L,children:[t(rs,{$justifyContent:"flex-end",children:t(fn,{variant:yn.Secondary,size:vn.S,label:"Download snapshot",rightIcon:Ai,onClick:()=>{if(!S)return;const e=new Blob([S],{type:"application/json"}),t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download=`cpu-profile-${n.namespace}-${n.kind}-${n.name}.json`,i.click(),URL.revokeObjectURL(t)},disabled:!S})}),t(Gl,{rows:R,languages:n.detectedLanguages||n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"")})]}),F&&e(as,{$splitWithTable:L,children:[e(rs,{$justifyContent:"space-between",children:[t(Tn,{label:I?`Total in view ${Pl(I.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:h.v2.colors.silver[750],textColor:h.v2.colors.silver[200],textSize:gn.XXS}),e(O,{$gap:12,children:[!f&&t(fn,{variant:yn.Secondary,size:vn.S,label:"Refresh",leftIcon:li,onClick:D}),t(En,{label:"Auto refresh",labelAlign:Nn.Left,size:$n.S,value:f,onChange:v})]})]}),t(Ql,{flamebearer:I.flamebearer,maxRowPx:24,searchQuery:E,minHostHeight:280,onFullscreenChange:p},k)]})]}):t(Re,{children:t(kn,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),y&&t(ls,{children:t(mn,{size:gn.XXXS,color:h.v2.colors.silver[300],children:`${y.activeKeys.length} / ${y.maxSlots} profiling slots · ${ss(y.totalBytesUsed)} / ${ss(y.maxTotalBytesBudget)} budget · TTL ${y.slotTtlSeconds}s`})})]})},ds=(e,t)=>{const{name:n,kind:i,namespace:o}=e,a=[{title:f.KIND,value:i},{title:f.NAME,value:n,tooltip:"Resource name"}];return t||(a.unshift({title:f.NAMESPACE,value:o}),a.push({type:v.Divider}),a.push({type:v.CopyText,value:`kubectl get ${i} ${n} -n ${o}`.toLowerCase()})),a},us=h.div`
|
|
557
|
+
`,ds=({source:n,fetchProfilingSlots:r,enableProfiling:s,fetchSourceProfiling:u,onFlameFullscreenChange:p})=>{const h=g(),m=c(()=>({namespace:n.namespace,kind:n.kind,name:n.name}),[n.namespace,n.kind,n.name]),[f,v]=i(!0),[y,b]=i(null),[S,x]=i(null),[C,w]=i(0),[k,T]=i(ns.Both),[E,$]=i(""),[N,D]=i({}),I=l(null),A=d(async()=>{try{const e=[r()];f&&e.push(u(m));const[t,n]=await Promise.all(e);t&&b(t),n?.profileJson&&x(n.profileJson)}finally{w(e=>e+1)}},[r,u,m]);o(()=>{let e=!1;return(async()=>{await s(m),e||(await A(),e||(I.current=setInterval(A,3e3)))})(),()=>{e=!0,I.current&&clearInterval(I.current)}},[s,A,m]);const R=c(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),n=t.flamebearer;return!n?.names?.length||!Array.isArray(n.levels)||"number"!=typeof n.numTicks||n.numTicks<=0?null:{flamebearer:n,units:t.metadata?.units}}catch{return null}}(S),[S]),M=c(()=>R?function(e){const t=new Map;for(let n=0;n<e.levels.length;n++){const i=e.levels[n];for(let n=0;n+3<i.length;n+=4){const o=i[n+1],a=i[n+2],r=Ll(e,i[n+3]);if(!r)continue;const l=t.get(r);(!l||o>l.total)&&t.set(r,{self:a,total:o})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(R.flamebearer):[],[R]),F=c(()=>{const e=E.trim().toLowerCase();return e?M.filter(t=>t.name.toLowerCase().includes(e)):M},[M,E]),L=k===ns.Table||k===ns.Both,P=k===ns.Flame||k===ns.Both,_=L&&P,z=n.detectedLanguages||n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),K=c(()=>function(e,t){if(!t?.includes(wn.Java))return;const n=e?.[Jl.Symbol]?.filter(Boolean)??[];return 0!==n.length?e=>Zl(e,n):void 0}(N,z),[N,z]);return C<2?t(Re,{$height:"70vh",children:t(En,{withSpinner:!0})}):e(is,{$gap:0,$width:"100%",children:[e(os,{children:[t(be,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(as,{children:t(yn,{size:bn.S,weight:500,color:h.v2.colors.white[500],nowrap:!0,children:"CPU Profiling"})})}),e(O,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t($n,{value:E,onChange:$,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:h.v2.colors.silver[900],emphasizeBackgroundColor:h.v2.colors.silver[800]})}),t(Sn,{size:Cn.S,variant:xn.Filled,options:[{value:ns.Table,label:"Top table"},{value:ns.Flame,label:"Flame graph"},{value:ns.Both,label:"Both"}],selected:k,setSelected:T}),t(gn,f?{variant:vn.Secondary,size:fn.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(Ii,{...e,size:8,fill:h.v2.colors.green[500]})}:{variant:vn.Secondary,size:fn.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Ii,{...e,size:8,fill:h.v2.colors.red[500]})})]})]}),t(rs,{$gap:L&&P?16:0,children:R?e(a,{children:[L&&e(ls,{$splitWithFlame:_,children:[t(cs,{$justifyContent:"flex-end",children:t(gn,{variant:vn.Secondary,size:fn.S,label:"Download snapshot",rightIcon:Ai,onClick:()=>{if(!S)return;const e=new Blob([S],{type:"application/json"}),t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download=`cpu-profile-${n.namespace}-${n.kind}-${n.name}.json`,i.click(),URL.revokeObjectURL(t)},disabled:!S})}),t(ts,{rows:F,languages:z,filters:N,onFiltersChange:D})]}),P&&e(ss,{$splitWithTable:_,children:[e(cs,{$justifyContent:"space-between",children:[t(Dn,{label:R?`Total in view ${Pl(R.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:h.v2.colors.silver[750],textColor:h.v2.colors.silver[200],textSize:bn.XXS}),e(O,{$gap:12,children:[!f&&t(gn,{variant:vn.Secondary,size:fn.S,label:"Refresh",leftIcon:li,onClick:A}),t(pn,{label:"Auto refresh",labelAlign:mn.Left,size:hn.S,value:f,onChange:v})]})]}),t(Yl,{flamebearer:R.flamebearer,maxRowPx:24,searchQuery:E,shouldKeepName:K,minHostHeight:280,onFullscreenChange:p,profilingSlots:y},k)]})]}):t(Re,{children:t(Nn,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},us=(e,t)=>{const{name:n,kind:i,namespace:o}=e,a=[{title:f.KIND,value:i},{title:f.NAME,value:n,tooltip:"Resource name"}];return t||(a.unshift({title:f.NAMESPACE,value:o}),a.push({type:v.Divider}),a.push({type:v.CopyText,value:`kubectl get ${i} ${n} -n ${o}`.toLowerCase()})),a},ps=h.div`
|
|
560
558
|
display: flex;
|
|
561
559
|
flex-direction: column;
|
|
562
560
|
gap: 24px;
|
|
563
561
|
padding: 4px;
|
|
564
|
-
`,
|
|
562
|
+
`,hs=({formData:e,handleFormChange:n})=>t(ps,{children:t(k,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:e.otelServiceName,onChange:({target:{value:e}})=>n("otelServiceName",e)})}),ms=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const n=In(e?.status),i=ut(e?.reasonEnum),o=e?.message;return t(O,{$alignItems:"center",$justifyContent:"center",children:t(fe,{status:n,title:i,subtitle:o,withBackground:n!==ve.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},gs=({source:n,fetchSourceDescribe:a,onClickRestartPod:r})=>{const[l,s]=i(!1),[c,d]=i(null);return o(()=>{n&&a({namespace:n.namespace,name:n.name,kind:n.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):s(!0)})},[n.namespace,n.name,n.kind]),c||l?t(R,{$gap:12,children:l?t(Re,{$height:"70vh",children:t(Oe,{subTitle:"Could not fetch describe for this source"})}):c?.pods?.length?c.pods.map(({podName:i,nodeName:o,phase:a,agentInjected:l,runningLatestWorkloadRevision:s,containers:d,manifestYAML:u})=>{const h=a.status!==ue.Success||An(d)?ue.Error:ue.Success,m=[];return m.push(t(Rn,{value:`kubectl get pod ${i.value} -n ${c?.namespace?.value||n.namespace}`.toLowerCase()},"copy-text")),m.push(t(A,{length:"100%",margin:"0"},"divider-1")),m.push(t(On,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-1")),m.push(t(A,{length:"100%",margin:"0"},"divider-2")),m.push(t(On,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-2")),m.push(t(A,{length:"100%",margin:"0"},"divider-3")),m.push(t(On,{title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}},"describe-row-3")),m.push(t(A,{length:"100%",margin:"0"},"divider-4")),s?.name&&(m.push(t(On,{title:s.name,tooltip:s.explain||void 0,value:{status:s.status||void 0,text:s.value}},"describe-row-4")),m.push(t(A,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{m.push(t(Mn,{...e},`pod-container-${e.containerName.value}`))}),u&&(m.push(t(A,{length:"100%",margin:"0"},"divider-6")),m.push(t(Ki,{yaml:u},"yaml-section-card"))),t(ne,{title:`Pod: ${i.value}`,withExtend:!0,action:({hovered:o})=>e("div",{style:{position:"relative"},children:[t(fe,{status:h,title:h,withIcon:!0,withBorder:!0},"status"),o&&t(Fn,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:Ln(),label:"Restart",rightIcon:li,onClick:()=>r(c?.namespace?.value||n.namespace,i.value)}]:[]},"hover-actions")]}),children:p.toArray(m)},`pod-${i.value}`)}):t(Re,{$height:"70vh",children:t(Oe,{subTitle:"Check if you have any running pods and try again"})})}):t(Re,{$height:"70vh",children:t(Pe,{})})},fs=h(O)`
|
|
565
563
|
width: 100%;
|
|
566
564
|
align-items: center;
|
|
567
565
|
justify-content: space-between;
|
|
568
|
-
`,
|
|
566
|
+
`,vs=({source:n,fetchSourceLibraries:r})=>{const l=g(),[s,c]=i(!1),[d,u]=i(null);return o(()=>{n&&r({namespace:n.namespace,name:n.name,kind:n.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?u(Rt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):c(!0)})},[n.namespace,n.name,n.kind]),d||s?t(R,{$gap:12,children:s?t(Re,{$height:"70vh",children:t(Oe,{subTitle:"Could not fetch libraries for this source"})}):d?.length?t(ne,{title:"Instrumented Libraries",children:d.map(({name:n,healthy:i,message:o,nonIdentifyingAttributes:r},s)=>e(a,{children:[e(R,{$gap:4,$width:"100%",children:[e(fs,{$width:"100%",children:[t(B,{size:12,color:l.text.grey,children:n}),e(O,{$gap:4,children:[r.map(({key:e,value:i})=>Pn(i)&&_n(i)&&"is_standard_lib"===e?t(fe,{status:ue.Default,title:"STANDARD",withBorder:!0},`${n}-${e}`):null),"boolean"==typeof i&&t(fe,{status:i?ue.Success:ue.Error,title:i?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),o&&t(B,{size:10,color:l.text.error,align:"right",children:o})]}),s!==d.length-1&&t(A,{length:"100%",margin:"0"})]},`library-${n}`))}):e(Re,{$height:"70vh",$gap:12,children:[t(Oe,{title:"No libraries found",subTitle:""}),t(de,{type:ue.Warning,message:"This feature is in early development, and has very limited support"})]})}):t(Re,{$height:"70vh",children:t(Pe,{})})},ys="70vh",bs=(e,t)=>e.serviceName.localeCompare(t.serviceName),Ss=h(B)`
|
|
569
567
|
cursor: ${({$clickable:e})=>e?"pointer":"default"};
|
|
570
568
|
text-decoration: ${({$clickable:e})=>e?"underline":"none"};
|
|
571
569
|
&:hover {
|
|
572
570
|
opacity: ${({$clickable:e})=>e?.7:1};
|
|
573
571
|
}
|
|
574
|
-
`,
|
|
572
|
+
`,xs=h(O)`
|
|
575
573
|
justify-content: flex-end;
|
|
576
574
|
align-items: center;
|
|
577
575
|
gap: 6px;
|
|
578
576
|
cursor: pointer;
|
|
579
|
-
`,
|
|
577
|
+
`,Cs=({items:i,emptyMessage:o,keyPrefix:r,findSource:l,onNavigate:s})=>{const c=g();return i.length?t(n,{children:i.map(({serviceName:n},o)=>{const d=!!l(n);return e(a,{children:[t(Ss,{size:13,color:d?c.text.secondary:c.text.grey,$clickable:d,onClick:()=>s(n),children:n}),o!==i.length-1&&t(A,{length:"100%",margin:"0"})]},`${r}-${n}`)})}):t(B,{size:13,color:c.text.grey,children:o})},ws=({source:n,fetchPeerSources:a})=>{const r=g(),{setDrawerType:l,setDrawerEntityId:s}=W(),c=X(e=>e.sources),[u,p]=i(!1),[h,m]=i(!1),[f,v]=i(null),y=n.otelServiceName||n.name,b=d(()=>{y&&(m(!0),p(!1),a(y).then(({data:e})=>{e?.peerSources?v(e.peerSources):p(!0)}).finally(()=>m(!1)))},[y]);o(()=>{b()},[b]);const S=d(e=>c.find(t=>t.otelServiceName===e||t.name===e),[c]),x=d(e=>{const t=S(e);t&&(l(J.Source),s({namespace:t.namespace,name:t.name,kind:t.kind}))},[S,l,s]);if(!f&&!u&&h)return t(Re,{$height:ys,children:t(Pe,{})});if(u)return t(Re,{$height:ys,children:t(Oe,{subTitle:"Could not fetch peer sources"})});const C=f?.inbound?[...f.inbound].sort(bs):[],w=f?.outbound?[...f.outbound].sort(bs):[];return e(R,{$gap:12,children:[t(ne,{title:"Inbound",titleBadge:C.length,description:`Services that send requests to ${y}`,children:t(Cs,{items:C,emptyMessage:"No inbound connections",keyPrefix:"inbound",findSource:S,onNavigate:x})}),t(ne,{title:"Outbound",titleBadge:w.length,description:`Services that ${y} sends requests to`,children:t(Cs,{items:w,emptyMessage:"No outbound connections",keyPrefix:"outbound",findSource:S,onNavigate:x})}),e(xs,{onClick:b,children:[t(li,{size:14}),t(B,{size:12,color:r.text.grey,decoration:"underline",children:"Refresh"})]})]})};var ks;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries",e.PeerSources="Peer Sources",e.Profiling="Profiling"}(ks||(ks={}));const Ts=[Zt.Deployment,Zt.StatefulSet,Zt.DaemonSet,Zt.DeploymentConfig,Zt.Rollout,Zt.StaticPod],Es=[Zt.Deployment,Zt.StatefulSet,Zt.DaemonSet,Zt.DeploymentConfig,Zt.Rollout,Zt.Pod],$s=[wn.Python,wn.Go,wn.Java],Ns=h.div`
|
|
580
578
|
width: 100%;
|
|
581
579
|
height: 100%;
|
|
582
580
|
max-height: calc(100vh - 220px);
|
|
583
581
|
overflow: overlay;
|
|
584
582
|
overflow-y: auto;
|
|
585
|
-
`,
|
|
583
|
+
`,Ds=h.div`
|
|
586
584
|
display: flex;
|
|
587
585
|
flex-direction: column;
|
|
588
586
|
gap: 12px;
|
|
589
|
-
`;var
|
|
587
|
+
`;var Is;!function(e){e.Workload="Workload",e.Pod="Pod"}(Is||(Is={}));const As=({persistSources:a,updateSource:r,restartWorkloads:s,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,fetchPeerSources:h,restartPod:m,recoverFromRollback:g,profilingEnabled:v,fetchProfilingSlots:y,enableProfiling:b,fetchSourceProfiling:S})=>{const{isVm:x}=ae(),C=X(e=>e.sources),{selectedStreamName:w}=Ze(),{drawerType:k,drawerEntityId:T}=W(),E=c(()=>tt(C,w),[C,w]),$=l(null),N=k===J.Source,[D,I]=i(!1),[A,R]=i(!1),[O,M]=i(ks.Overview),[F,L]=i(null),[P,_]=i(!1);o(()=>{N&&T&&d(T).then(e=>L(e||null))},[N,T]);const{formData:z,handleFormChange:K,resetFormData:j,loadFormWithDrawerItem:V}=zn(),U=c(()=>{if(T)return F&&JSON.stringify(en(F))===JSON.stringify(en(T))?F:E?.find(e=>JSON.stringify(en(e))===JSON.stringify(en(T)))},[T,E,F]);o(()=>{N&&U?V(U):j()},[N,U]);const H=c(()=>{const e=U?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ve.Loading,containers:U?.containers||[]}},[U]),q=c(()=>!!U?.rollbackOccurred,[U?.rollbackOccurred]),G=c(()=>{const e=[{label:ks.Overview,onClick:()=>M(ks.Overview),selected:O===ks.Overview}];return x||(Ts.includes(U?.kind)&&e.push({label:ks.Pods,onClick:()=>M(ks.Pods),selected:O===ks.Pods}),U?.containers?.some(e=>$s.includes(e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language))&&e.push({label:ks.Libraries,onClick:()=>M(ks.Libraries),selected:O===ks.Libraries}),e.push({label:ks.PeerSources,onClick:()=>M(ks.PeerSources),selected:O===ks.PeerSources}),v&&y&&b&&S&&e.push({label:ks.Profiling,onClick:()=>M(ks.Profiling),selected:O===ks.Profiling})),e},[O,U,x,v,y,b,S]),Y=Es.includes(U?.kind),[Q,Z]=i({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});if(!U)return null;return e(po,{ref:$,width:P?"95vw":O===ks.Profiling?"80vw":void 0,onClose:()=>{M(ks.Overview),L(null),_(!1)},title:U.otelServiceName||U.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:jn(U.containers),isEdit:D,isFormDirty:A,onEdit:O===ks.Overview?e=>{I("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=z.otelServiceName!==U.name?z.otelServiceName:"";K("otelServiceName",e),await r(T,{...z,otelServiceName:e}),L(null),R(!1),I(!1)},onDelete:O===ks.Overview?async()=>{const{namespace:e}=U;a({[e]:[{...U,selected:!1,currentStreamName:w}]},{}),L(null),R(!1),I(!1),$.current?.closeDrawer()}:void 0,onCancel:()=>{R(!1),I(!1),K("otelServiceName",U.otelServiceName||U.name||"")},isLastItem:1===E.length,tabs:G,headerActionButtons:x?[]:Y?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>Z({openFor:Is.Workload,workloadId:T}),children:e(n,{children:[t(mi,{}),t(B,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[O===ks.Overview?D?t(Ns,{children:t(hs,{formData:z,handleFormChange:(...e)=>{R(!0),K(...e),K("currentStreamName",w)}})}):e(Ds,{children:[t(ms,{workloadOdigosHealthStatus:U.workloadOdigosHealthStatus}),q&&t(de,{type:ue.Warning,message:f.ROLLBACK_OCCURRED_MESSAGE,action:{label:f.ROLLBACK_RECOVER,onClick:async()=>{await g(T);const e=await d(T);e&&L(e)}}}),t(te,{conditions:U.conditions||[]}),t(ne,{title:f.SOURCE_DETAILS,data:U?us(U,x):[]}),t(ne,{title:x?f.DETECTED_PROCESSES:f.DETECTED_CONTAINERS,titleBadge:H.isLoading?ve.Loading:H.containers.length,description:H.description||(x?f.DETECTED_PROCESSES_DESCRIPTION:f.DETECTED_CONTAINERS_DESCRIPTION),children:H.containers.map(e=>t(Kn,{...e,callbackRuntimeOverride:e=>r(T,e)},`source-container-${e.containerName}`))}),U.manifestYAML&&t(Ki,{title:`${U.kind} YAML`,yaml:U.manifestYAML,defaultOpen:!U.instrumentationConfigYAML}),U.instrumentationConfigYAML&&t(Ki,{title:"Instrumentation Config YAML",yaml:U.instrumentationConfigYAML,defaultOpen:!U.manifestYAML})]}):O===ks.Pods?t(gs,{source:U,fetchSourceDescribe:u,onClickRestartPod:Y?(e,t)=>Z({openFor:Is.Pod,podNamespace:e,podName:t}):void 0}):O===ks.Libraries?t(vs,{source:U,fetchSourceLibraries:p}):O===ks.PeerSources?t(ws,{source:U,fetchPeerSources:h}):O===ks.Profiling&&v&&y&&b&&S?t(ds,{source:U,fetchProfilingSlots:y,enableProfiling:b,fetchSourceProfiling:S,onFlameFullscreenChange:_}):null,t(Xt,{isOpen:!!Q.openFor,title:`Rollout Restart ${Q.openFor}`,description:`Are you sure you want to rollout restart this ${Q.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:ue.Warning,onClick:()=>{Q.openFor===Is.Workload&&Q.workloadId?s([Q.workloadId]):Q.openFor===Is.Pod&&Q.podNamespace&&Q.podName&&m(Q.podNamespace,Q.podName),Z({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{Z({openFor:null})}}})]})},Rs=h.div`
|
|
590
588
|
max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
|
|
591
589
|
width: 100%;
|
|
592
|
-
`,
|
|
590
|
+
`,Os=r(({isModal:n,fetchNamespacesWithWorkloads:i,onClickSummary:o},a)=>{const r=g(),{isVm:l}=ae(),c=Vn({fetchNamespacesWithWorkloads:i}),{selectedSources:d,loading:u,selectedAllNamespaces:p,onSelectAllNamespaces:h,getApiSourcesPayload:m,getApiFutureAppsPayload:v,searchText:y,setSearchText:b,searchBy:S,setSearchBy:x,showSelectedOnly:C,setShowSelectedOnly:w,showRunningOnly:T,setShowRunningOnly:E}=c;s(a,()=>({getFormValues:()=>({apps:m(),futureApps:v()})}));const $=Object.values(d).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return t(ce,{$isNotModal:!n,children:e(R,{$gap:12,children:[e(R,{$gap:24,children:[o&&t(xt,{onClick:o}),t(z,{title:f.SELECT_SOURCES,badgeLabel:$,description:f.SELECT_SOURCES_DESCRIPTION}),e(O,{$justifyContent:"space-between",children:[t(Rs,{$fullWidth:l,children:t(k,{placeholder:S===J.Source?f.SEARCH_SOURCES:f.SEARCH_NAMESPACES,icon:si,value:y,onChange:e=>b(e.target.value.toLowerCase())})}),!l&&t(P,{options:[{label:f.SOURCE,value:J.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:f.NAMESPACE,value:J.Namespace,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary}],selected:S,setSelected:x})]}),e(O,{$gap:36,children:[t(N,{title:f.SELECT_ALL,initialValue:p,onChange:h,disabled:u}),t(N,{title:f.ONLY_SELECTED,initialValue:C,onChange:w}),t(N,{title:f.ONLY_RUNNING_INSTANCES,initialValue:T,onChange:E})]})]}),t(A,{}),t(Dl,{isModal:n,...c})]})})});Os.displayName=Os.name;const Ms=({fetchNamespacesWithWorkloads:e,persistSources:n})=>{const{currentModal:i,setCurrentModal:o}=re(),a=i===J.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();n(e,t),r()}},c=l(null);return U({key:"Enter",active:a},s),a?t(se,{isOpen:a,onClose:r,header:{title:"Add Source"},actionComponent:t(me,{buttons:[{label:"DONE",variant:"primary",onClick:s}]}),children:t(Os,{ref:c,isModal:!0,fetchNamespacesWithWorkloads:e})}):null},Fs=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:f.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:f.NAMESPACE,sortable:!0}),t.push({key:"containers",title:f.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Ls=({metrics:n,maxHeight:i,maxWidth:o})=>{const a=g(),{isVm:r}=ae(),l=xe(),{selectedStreamName:s}=Ze(),u=X(e=>e.sources),p=X(e=>e.sourcesLoading),{setDrawerType:h,setDrawerEntityId:m}=W(),{selectedSources:v,setSelectedSources:y}=ze(),{progress:b}=Je(),S=c(()=>b[Xe.Instrumenting]||b[Xe.Uninstrumenting]?b[Xe.Instrumenting]?.percentage||b[Xe.Uninstrumenting]?.percentage||0:void 0,[b[Xe.Instrumenting],b[Xe.Uninstrumenting]]),x=c(()=>tt(u,s),[u,s]),w=c(()=>Co({instrumentationRules:[],sources:it(x,l),actions:[],destinations:[],searchText:l.searchText,selectedCategory:J.Source}).searchResults.find(({category:e})=>e===J.Source)?.entities||[],[x,l]),[k,T]=c(()=>{let e=0;return Object.values(v).forEach(t=>{e+=t.length}),[0!==e,e]},[v]),E=d(e=>{if(e){const e={};w.forEach(t=>{const{namespace:n}=t;e[n]?e[n].push(t):e[n]=[t]}),y(e)}else y({})},[w]),$=d(e=>{const{namespace:t,name:n,kind:i}=e,o={...v};o[t]||(o[t]=[]);const a=o[t].findIndex(e=>e.name===n&&e.kind===i);-1===a?o[t].push(e):o[t].splice(a,1),y(o)},[v]),N=c(()=>w.map(i=>{const o=en(i),r=Be(o),{hasErrors:l,hasWarnings:s,hasDisableds:c}=ge(i.conditions||[]),d=!!v[o.namespace]?.find(e=>e.namespace===o.namespace&&e.name===o.name&&e.kind===o.kind);return{status:l?ue.Error:s?ue.Warning:void 0,faded:c,onClick:()=>{h(J.Source),m(o)},cells:[{columnKey:"checkbox-and-icon",component:()=>e(O,{$gap:16,children:[t(C,{value:d,onChange:()=>$(i)}),t(Bn,{icons:Ye(i),id:r})]})},{columnKey:"name",value:ke(i,J.Source,{extended:!0})},{columnKey:"kind",value:i.kind,textColor:a.text.info},{columnKey:"namespace",value:i.namespace,textColor:a.text.info},{columnKey:"throughput",value:He(Pt(n,J.Source,o).throughput),textColor:a.text.info},{columnKey:"conditions",component:()=>t(So,{conditions:i.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(fe,{status:ue.Info,title:Wn(i.containers),withBorder:!0})})}]}}),[w,v,n,$]),{badge:D,badgeTooltip:I}=c(()=>w.length!==x.length?{badge:`${w.length}/${x.length}`,badgeTooltip:f.FILTERED_COUNT_TOOLTIP}:{badge:x.length,badgeTooltip:void 0},[w,x]);return e(Ee,{$maxWidth:o,children:[e($e,{children:[t(C,{partiallyChecked:k&&w?.length!==T,value:k&&w?.length===T,onChange:E,disabled:!w?.length}),t(Ne,{icon:De(J.Source),title:f.SOURCES,badge:D,badgeTooltip:I,loading:p||"number"==typeof S})]}),t(Ie,{$maxHeight:i,children:t(Ae,{columns:Fs(r),rows:N})}),"number"!=typeof S||N.length?N.length?null:t(Re,{style:{marginTop:"2rem"},children:t(Oe,{})}):e(Re,{style:{marginTop:"2rem",gap:"24px"},children:[t(Me,{width:420}),e(O,{$gap:16,children:[e(B,{color:a.text.info,children:[b[Xe.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Fe,{label:`${S}%`})]})]})]})},Ps=({expiresAt:t})=>{const n=g(),{formatTimeAgo:i}=tn(),o=i(t),a=new Date(t).toDateString().split(" ").slice(1).join(" "),r=Un(t,0)?n.text.error:Un(t,6048e5)?n.text.warning:n.text.success;return e(B,{size:14,color:r,children:[o," (",a,")"]})},_s=h.div`
|
|
593
591
|
position: relative;
|
|
594
|
-
`,
|
|
592
|
+
`,zs=({token:n,saveToken:o})=>{const{CopyButton:a}=Hn(),{formData:r,handleFormChange:l,resetFormData:s}=qn({token:n}),[c,d]=i(!1),u=()=>{d(!1),s()};return e(O,{$gap:0,children:[t(a,{value:n,size:Gn.L}),t(A,{orientation:"vertical",length:"12px"}),e(_s,{children:[t(M,{size:32,onClick:()=>{d(!0)},children:t(oi,{})}),c&&t(Yn,{flipX:!0,clientX:36,isOpen:c,onClose:u,onSave:()=>{o(r.token).then(u)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one",children:t(k,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>l("token",e.target.value)})})]})]})},Ks=({tokens:e,saveToken:n})=>t(ne,{title:"Authorization Tokens",titleBadge:e.length,data:[{type:v.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:e.map(({name:e,token:i,expiresAt:o})=>({cells:[{columnKey:"icon",icon:Ri},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(Ps,{expiresAt:o})},{columnKey:"actions",component:()=>t(zs,{token:i,saveToken:n})}]}))}}]}),js=({fetchDescribeOdigos:a})=>{const[r,l]=i(null);if(o(()=>{a().then(({data:e})=>l(e?.describeOdigos||null))},[]),!r)return t(Re,{children:t(Pe,{})});const s=e=>e?.name?[t(A,{},`divider-${e.name}`),t(On,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(Pn(e.value)?_n(e.value)?ue.Success:ue.Error:ue.Default),text:e.value}},`describe-row-${e.name}`)]:[];return e(n,{children:[t(ne,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:r?.odigosVersion?.name,value:r?.odigosVersion?.value},{title:r?.kubernetesVersion?.name,value:r?.kubernetesVersion?.value},{title:r?.installationMethod?.name,value:r?.installationMethod?.value},{title:r?.tier?.name,value:r?.tier?.value},{title:"# of sources",value:r?.numberOfSources?.toString()},{title:"# of destinations",value:r?.numberOfDestinations?.toString()}]}),t(ne,{title:"Cluster Collector",withExtend:!0,children:Object.values(r?.clusterCollector||{}).map(s)}),t(ne,{title:"Node Collector",withExtend:!0,children:Object.values(r?.nodeCollector||{}).map(s)})]})},Vs=h.div`
|
|
595
593
|
display: flex;
|
|
596
594
|
flex-direction: column;
|
|
597
595
|
gap: 12px;
|
|
598
|
-
`,
|
|
596
|
+
`,Bs="System Overview",Ws=({tokens:o,saveToken:a,fetchDescribeOdigos:r})=>{const[l,s]=i(!1),c=()=>s(e=>!e);return e(n,{children:[t(M,{onClick:c,tooltip:Bs,children:t(Oi,{size:18})},Bs),t(q,{width:"750px",isOpen:l,onClose:c,header:{icons:[Oi],title:Bs},footer:{isOpen:!1},children:e(Vs,{children:[!!o?.length&&t(Ks,{tokens:o,saveToken:a}),t(js,{fetchDescribeOdigos:r})]})})]})},Us=h.div`
|
|
599
597
|
position: fixed;
|
|
600
598
|
bottom: 12px;
|
|
601
599
|
left: 12px;
|
|
@@ -604,7 +602,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
604
602
|
flex-direction: column-reverse;
|
|
605
603
|
gap: 6px;
|
|
606
604
|
max-width: 600px;
|
|
607
|
-
`,
|
|
605
|
+
`,Hs=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:i}=qt(),{onClickNotification:o}=nn();return t(Us,{children:e.filter(({dismissed:e})=>!e).map(({id:e,type:a,title:r,message:l,crdType:s,target:c})=>t(de,{id:e,type:a,title:r,message:l,action:s&&c?{label:"go to details",onClick:()=>o({id:e,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{n(e),i(e)})({id:e,asSeen:!0})},`toast-${e}`))})},qs=h.div`
|
|
608
606
|
position: relative;
|
|
609
607
|
display: flex;
|
|
610
608
|
align-items: center;
|
|
@@ -623,7 +621,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
623
621
|
stroke: ${({theme:e})=>e.text.secondary};
|
|
624
622
|
}
|
|
625
623
|
}
|
|
626
|
-
`,
|
|
624
|
+
`,Gs=h.div`
|
|
627
625
|
position: absolute;
|
|
628
626
|
top: 2px;
|
|
629
627
|
left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
|
|
@@ -633,50 +631,50 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
633
631
|
background-color: ${({theme:e})=>e.colors.border};
|
|
634
632
|
border-radius: 100%;
|
|
635
633
|
transition: all 0.3s;
|
|
636
|
-
`,
|
|
634
|
+
`,Ys=({path:e})=>t("svg",{width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),Js=()=>{const{darkMode:n,setDarkMode:i}=Jn();return e(qs,{onClick:()=>i(!n),children:[t(Ys,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),t(Ys,{path:"M8 15.333v-.666m-5.185-1.482.471-.471M.666 8h.667m1.482-5.185.471.47M8 1.334V.667m4.714 2.619.471-.471M14.667 8h.666m-2.619 4.714.471.471M12 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}),t(Gs,{$darkMode:n})]})},Xs=e=>{const{spans:t}=e,n=new Map;t.forEach(e=>{n.set(e.spanID,{...e,spans:[]})});const i=[];return t.forEach(e=>{const t=n.get(e.spanID);let o=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&n.has(t.spanID)||(o=!0)}else o=!0;if(o)i.push(t);else{const i=e.references.find(e=>"CHILD_OF"===e.refType);if(i){const e=n.get(i.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),i.sort((e,t)=>e.startTime-t.startTime)},Qs=(e,t)=>{const{tags:n}=e,i={},o=[];return n.forEach(e=>{i[e.key]=e.value}),o.push({type:v.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),o},Zs=e=>{const{logs:t}=e,n=[];return t.forEach((e,i)=>{e.fields.forEach(e=>{n.push({title:e.key,value:e.value})}),i!==t.length-1&&n.push({type:v.Divider})}),n},ec=e=>{const{traceID:t,spanID:n,processID:i,operationName:o,duration:a,startTime:r,warnings:l}=e,s=[];return s.push({type:v.CopyText,title:"Trace ID",value:t}),s.push({type:v.CopyText,title:"Span ID",value:n}),s.push({type:v.Divider}),s.push({title:"Service",value:i}),s.push({title:"Operation",value:o}),s.push({title:"Duration",value:Xn(a)}),s.push({title:"Start time",value:new Date(r/1e3).toLocaleString()}),l.length&&(s.push({type:v.Divider}),s.push({title:"Warnings",titleIcon:Mi,value:l})),s},tc=(e,t)=>{const{tags:n}=e,i={},o=[];return n.forEach(e=>{i[e.key]=e.value}),o.push({type:v.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),o},nc=h.div`
|
|
637
635
|
display: flex;
|
|
638
636
|
flex-direction: column;
|
|
639
637
|
gap: 12px;
|
|
640
638
|
max-height: 100vh;
|
|
641
639
|
overflow-y: auto;
|
|
642
|
-
`,
|
|
640
|
+
`,ic=({span:n,process:o,onClose:a})=>{const[r,l]=i(!0),[s,c]=i(!0);return t(q,{width:"750px",isOpen:!0,onClose:a,header:{icons:[Fi],title:n.operationName},footer:{isOpen:!1},children:e(nc,{children:[t(ne,{title:"Details",data:ec(n)}),n.logs.length>0&&t(ne,{title:"Errors",titleBadge:n.logs.length,titleIcon:Mi,data:Zs(n)}),t(ne,{title:"Tags",data:Qs(n,r),action:t(Qn,{isPrettyMode:r,setIsPrettyMode:l})}),o&&t(ne,{title:`Process (${o.serviceName})`,data:tc(o,s),action:t(Qn,{isPrettyMode:s,setIsPrettyMode:c})})]})})},oc=370,ac=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),rc=h.div`
|
|
643
641
|
display: flex;
|
|
644
642
|
align-items: center;
|
|
645
|
-
width: ${
|
|
643
|
+
width: ${oc}px;
|
|
646
644
|
background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+_["042"]:t.colors.dark_grey};
|
|
647
645
|
&:hover {
|
|
648
646
|
${({$withErrors:e,$preventHover:t,theme:n})=>!t&&`background-color: ${e?n.colors.error:n.colors.secondary+_["010"]};`}
|
|
649
647
|
cursor: ${({$preventHover:e})=>e?"default":"pointer"};
|
|
650
648
|
}
|
|
651
|
-
`,
|
|
649
|
+
`,lc=h(O)`
|
|
652
650
|
align-items: center;
|
|
653
651
|
justify-content: space-between;
|
|
654
652
|
gap: 4px;
|
|
655
653
|
padding: 12px;
|
|
656
654
|
padding-left: ${({$depth:e})=>12*e||12}px;
|
|
657
|
-
width: calc(${
|
|
658
|
-
`,
|
|
655
|
+
width: calc(${oc}px - ${({$depth:e})=>12*e}px);
|
|
656
|
+
`,sc=h(O)`
|
|
659
657
|
align-items: center;
|
|
660
658
|
gap: 4px;
|
|
661
659
|
position: absolute;
|
|
662
660
|
right: 56px;
|
|
663
661
|
width: calc(100% - ${434}px);
|
|
664
|
-
`,
|
|
662
|
+
`,cc=h.div`
|
|
665
663
|
position: absolute;
|
|
666
664
|
left: ${({$startTime:e,$minStartTime:t,$maxEndTime:n})=>(e-t)/(n-t)*100+"%"};
|
|
667
665
|
width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
|
|
668
666
|
height: 12px;
|
|
669
667
|
border-radius: 32px;
|
|
670
|
-
background-color: ${({$indexInMatrix:e})=>
|
|
671
|
-
`,
|
|
668
|
+
background-color: ${({$indexInMatrix:e})=>ac[e%ac.length]};
|
|
669
|
+
`,dc=h(B)`
|
|
672
670
|
padding-left: calc(100% + 8px);
|
|
673
671
|
font-size: 10px;
|
|
674
672
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
675
673
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
676
674
|
white-space: nowrap;
|
|
677
|
-
`,
|
|
675
|
+
`,uc=({span:n,depth:o,indexInMatrix:a,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:c,errorTooltip:d,isOpen:u,withToggle:p,onToggleOpen:h,onSelect:m})=>{const f=g(),[v,y]=i(!1),b=oc-12*o-20-(c?12:0),S=c&&(1===o||n.logs.length>0);return e(rc,{className:"span-container",$withErrors:c,$preventHover:v,onClick:m,children:[e(lc,{$depth:o,className:"span-left",children:[e(O,{$gap:4,$alignItems:"center",children:[t("div",p?{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:t(M,{onClick:e=>{e.stopPropagation(),h?.()},size:24,children:t(St,{extend:u??!1})})}:{style:{width:"24px"}}),t(ei,{maxWidth:b/2,text:n.processID,textSize:14}),t(B,{size:12,color:f.text.darker_grey,children:"•"}),t(ei,{maxWidth:b/2,text:n.operationName,textSize:12,textColor:f.text.darker_grey})]}),c&&(S?t(be,{...d,children:t(Mi,{fill:f.text.error})}):t("div",{style:{position:"relative"},children:t("div",{style:{position:"absolute",top:"-24px",right:"8px"},children:t(A,{type:ue.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5})})}))]}),t(sc,{className:"span-right",children:t(cc,{$indexInMatrix:a,$duration:n.duration,$maxDuration:r,$startTime:n.startTime,$minStartTime:l,$maxEndTime:s,children:t(dc,{children:Xn(n.duration)})})})]})},pc=({spans:n,logs:i,depth:o,indexInMatrix:a,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d})=>{const u=g();return n.map((n,p)=>{const h=n.spanID,m=c.value.includes(h),g=!!n.spans?.length,f=i.length?i:Zn(n,"spans","logs"),v=f.length>0,y=v?f.length>1?`(${f.length}) errors`:f[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,b=v?f.length>1?void 0:f[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e("div",{style:{borderBottom:1===o?`1px dotted ${u.colors.border}`:"none"},children:[t(uc,{span:n,depth:o,indexInMatrix:a+p+o,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:v,errorTooltip:{titleIcon:Mi,title:y,text:b},isOpen:m,withToggle:g,onToggleOpen:()=>c.set(e=>e.some(e=>e===h)?e.filter(e=>e!=h):[...e,h,...Zn(n,"spans","spanID")]),onSelect:()=>d.set(e=>e?.spanID===h?null:n)}),m&&g?t(pc,{spans:n.spans||[],logs:f,depth:o+1,indexInMatrix:a+p,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d}):null]},`span-${h}`)})},hc=h.div`
|
|
678
676
|
width: 100%;
|
|
679
|
-
`,
|
|
677
|
+
`,mc=h.div`
|
|
680
678
|
max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
681
679
|
overflow: auto;
|
|
682
680
|
|
|
@@ -686,22 +684,22 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
686
684
|
border-radius: 24px;
|
|
687
685
|
border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
688
686
|
position: relative;
|
|
689
|
-
`,
|
|
687
|
+
`,gc=h.div`
|
|
690
688
|
padding: 12px 12px 12px 24px;
|
|
691
|
-
width: calc(${
|
|
689
|
+
width: calc(${oc}px - 36px);
|
|
692
690
|
background-color: ${({theme:e})=>e.colors.dark_grey};
|
|
693
|
-
`,
|
|
691
|
+
`,fc=h.div`
|
|
694
692
|
width: 1px;
|
|
695
693
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
696
694
|
background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
|
|
697
695
|
|
|
698
696
|
position: absolute;
|
|
699
|
-
left: calc(${
|
|
700
|
-
`,
|
|
697
|
+
left: calc(${oc}px + ((100% - ${oc}px) / ${5}) * ${({index:e})=>e});
|
|
698
|
+
`,vc=h(B)`
|
|
701
699
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
702
700
|
font-size: 12px;
|
|
703
701
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
704
702
|
padding-top: 12px;
|
|
705
703
|
padding-left: 12px;
|
|
706
704
|
white-space: nowrap;
|
|
707
|
-
`,
|
|
705
|
+
`,yc=({heightToRemove:o,traces:a,isLoading:r})=>{const[l,s]=i([]),[d,u]=i(null),p=c(()=>Rt(a).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:Xs(e)})),[a]),h=c(()=>p.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[p]),m=c(()=>{const e=p.find(e=>e.spans.some(e=>e.spanID===d?.spanID)),t=e?.processes.find(e=>e.serviceName===d?.processID);return t},[p,d]);return e(n,{children:[t(hc,{$heightToRemove:o,children:r?t(Re,{$height:"50vh",children:t(Pe,{scale:1.5})}):p.length?e(mc,{$heightToRemove:o,children:[t(gc,{children:t(B,{children:"Service & operation"})}),new Array(5).fill(null).map((e,n)=>t(fc,{$heightToRemove:o,index:n,children:t(vc,{children:Xn(h/5*n)})},`${n}-divider`)),p.map((e,n)=>{const{spans:i}=e,o=i.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),a=i.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return t(pc,{spans:i,logs:[],depth:1,indexInMatrix:n,maxDuration:h,minStartTime:o,maxEndTime:a,openSpanIdsState:{value:l,set:s},selectedSpanState:{value:d,set:u}},`recursive-spans-${e.traceID}`)})]}):t(Re,{$height:"50vh",children:t(Oe,{title:f.NO_TRACES_FOUND,subTitle:f.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC})})}),d&&t(ic,{span:d,process:m,onClose:()=>u(null)})]})};export{fo as ActionDrawer,uo as ActionForm,yo as ActionModal,ko as ActionTable,Do as AwaitPipeline,la as ConditionDropdown,na as DataFlow,Oa as DataFlowActionsMenu,wa as DataStreamDrawer,xa as DataStreamForm,Fa as DataStreamModal,Ma as DataStreamSelectionForm,qa as DestinationDrawer,Wa as DestinationForm,sr as DestinationModal,hr as DestinationSelectionForm,gr as DestinationTable,sa as ErrorDropdown,Ar as InstrumentationRuleDrawer,Nr as InstrumentationRuleForm,Mr as InstrumentationRuleModal,Pr as InstrumentationRuleTable,pa as KindDropdown,ca as LanguageDropdown,da as MonitorDropdown,zr as MultiSourceControl,ua as NamespaceDropdown,Ol as NavIconIds,Ur as NotificationManager,po as OverviewDrawer,ha as PodsAgentInjectionStatusDropdown,Sl as ServiceMap,Rl as SetupSummary,Ml as SideNav,Fl as SlackInvite,As as SourceDrawer,hs as SourceForm,Ms as SourceModal,Os as SourceSelectionForm,Ls as SourceTable,Ws as SystemOverview,So as TableCellConditions,Hs as ToastList,Js as ToggleDarkMode,yc as TraceView};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type FC, type ReactNode } from 'react';
|
|
2
2
|
import type { ColoredSpanPart } from '@/snippets/_v2/colored-span';
|
|
3
|
-
import type { SamplingRuleCategory, SamplingRuleFormState, DuplicateValidationResult, ViewRuleData, SamplingRulesSelectOption, PercentagePreset } from '@/types';
|
|
3
|
+
import type { SamplingRuleCategory, SamplingRuleFormState, DuplicateValidationResult, ViewRuleData, SamplingRulesSelectOption, PercentagePreset, PercentageMode } from '@/types';
|
|
4
4
|
export declare enum SamplingRuleFormType {
|
|
5
5
|
Create = "create",
|
|
6
6
|
View = "view",
|
|
@@ -31,6 +31,8 @@ export interface ViewFormContextValue extends ManualFormBaseValue {
|
|
|
31
31
|
interface AutoRulePercentageBaseValue {
|
|
32
32
|
localEnabled: boolean;
|
|
33
33
|
setLocalEnabled: (value: boolean) => void;
|
|
34
|
+
percentageMode: PercentageMode;
|
|
35
|
+
setPercentageMode: (value: PercentageMode) => void;
|
|
34
36
|
percentagePreset: PercentagePreset;
|
|
35
37
|
setPercentagePreset: (value: PercentagePreset) => void;
|
|
36
38
|
customPercentage: string;
|
package/lib/contexts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{bo as ActionFormContextProvider,bn as DestinationFormContextProvider,g2 as OdigosProvider,bp as RuleFormContextProvider,a0 as SamplingRuleFormType,a_ as SamplingRulesFormProvider,bm as SourceInstrumentFormContextProvider,g3 as StorybookProvider,bi as checkVersionSupport,r as useActionFormContext,y as useDestinationFormContext,ar as useOdigos,X as useRuleFormContext,$ as useSamplingRulesFormContext,aB as useSourceInstrumentFormContext,g4 as useStorybook}from"./chunks/ui-components-CvK0mvVN.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|