@odigos/ui-kit 0.0.285 → 0.0.286
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/lib/containers.js
CHANGED
|
@@ -614,7 +614,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
614
614
|
gap: 8px;
|
|
615
615
|
`,Ku=b.div`
|
|
616
616
|
flex: 1;
|
|
617
|
-
`,Yu=({width:n,onClose:i,onSave:o,saveTooltip:a,onDelete:r,deleteTooltip:s,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(Vu),[y,C]=l(null);return On(b??{current:null},i),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?ys(e(Gu,{$coords:y,$width:n,"data-ignore-outside-click":"true",children:[e(ae,{$gap:4,children:[t(ee,{size:te.XXS,children:c}),t(ee,{size:te.XXXS,color:ne.Secondary,children:d})]}),e(Wu,{children:[t(Ku,{children:u}),e(ie,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(Te,{variant:Ie.Secondary,onClick:r,leftIcon:ml,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ke.S,textColor:f.v2.colors.red[500]}),t(Te,{variant:Ie.Primary,onClick:o,leftIcon:El,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:ke.S})]})]}),t("div",{children:t(De,{status:Pe.Warning,message:p})})]}),document.body):null},Ju=({language:n,overridden:i,onOverride:a,defaultValues:r})=>{const{tier:s}=S(),{formData:c,handleFormChange:d,resetFormData:p}=qt(r),u=o(()=>{if(!n)return[];const e=An[n].community,t=s===Rn.Onprem?An[n].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[n,s]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(ie,{$gap:4,$alignItems:"center",children:[i?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(ju,{children:[t(Be,{text:nt.OVERRIDE_OTEL_DISTRO_NAME,children:t(yt,{icon:yl,onClick:b})}),g&&t(Yu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},saveTooltip:nt.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},deleteTooltip:nt.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:nt.OVERRIDE_OTEL_DISTRO_NAME,subTitle:nt.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:nt.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(vt,{label:nt.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},qu=({overridden:n,onOverride:i,defaultValues:a,originalValues:r})=>{const{addNotification:s}=nn(),{formData:c,handleFormChange:d,resetFormData:p}=qt(a),u=o(()=>Dn.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(ie,{children:[n?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(ju,{children:[t(Be,{text:nt.OVERRIDE_RUNTIME_DETAILS,children:t(yt,{icon:yl,onClick:b})}),g&&t(Yu,{width:"500px",onClose:b,onSave:async()=>{!c.version||Pn(c.version)?(m(!0),await i(c),m(!1),b()):s({type:Pe.Warning,message:Ke.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:nt.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({language:null,version:""}),m(!1),b()},deleteTooltip:nt.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:nt.OVERRIDE_RUNTIME_DETAILS,subTitle:nt.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:nt.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(ie,{$gap:8,children:[t(vt,{label:nt.LANGUAGE,options:u,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${r.language||"none"}`}),t(Ne,{label:nt.RUNTIME_VERSION,placeholder:nt.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${r.version||"none"}`})]})})]})]})},Zu=b.div`
|
|
617
|
+
`,Yu=({width:n,onClose:i,onSave:o,saveTooltip:a,onDelete:r,deleteTooltip:s,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(Vu),[y,C]=l(null);return On(b??{current:null},i),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?ys(e(Gu,{$coords:y,$width:n,"data-ignore-outside-click":"true",children:[e(ae,{$gap:4,children:[t(ee,{size:te.XXS,children:c}),t(ee,{size:te.XXXS,color:ne.Secondary,children:d})]}),e(Wu,{children:[t(Ku,{children:u}),e(ie,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(Te,{variant:Ie.Secondary,onClick:r,leftIcon:ml,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ke.S,textColor:f.v2.colors.red[500]}),t(Te,{variant:Ie.Primary,onClick:o,leftIcon:El,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:ke.S})]})]}),t("div",{children:t(De,{status:Pe.Warning,message:p})})]}),document.body):null},Ju=({language:n,overridden:i,onOverride:a,defaultValues:r})=>{const{tier:s}=S(),{formData:c,handleFormChange:d,resetFormData:p}=qt(r),u=o(()=>{if(!n)return[];const e=An[n].community,t=s===Rn.Onprem?An[n].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[n,s]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(ie,{$gap:4,$alignItems:"center",children:[i?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(ju,{children:[t(Be,{text:nt.OVERRIDE_OTEL_DISTRO_NAME,children:t(yt,{icon:yl,onClick:b})}),g&&t(Yu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},saveTooltip:nt.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},deleteTooltip:nt.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:nt.OVERRIDE_OTEL_DISTRO_NAME,subTitle:nt.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:nt.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(vt,{label:nt.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},qu=({overridden:n,onOverride:i,defaultValues:a,originalValues:r})=>{const{addNotification:s}=nn(),{formData:c,handleFormChange:d,resetFormData:p}=qt(a),u=o(()=>Dn.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(ie,{children:[n?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(ju,{children:[t(Be,{text:nt.OVERRIDE_RUNTIME_DETAILS,children:t(yt,{icon:yl,onClick:b})}),g&&t(Yu,{width:"500px",onClose:b,onSave:async()=>{!c.version||Pn(c.version)?(m(!0),await i(c),m(!1),b()):s({type:Pe.Warning,message:Ke.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:nt.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({language:null,version:""}),m(!1),b()},deleteTooltip:nt.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:nt.OVERRIDE_RUNTIME_DETAILS,subTitle:nt.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:nt.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(ie,{$gap:8,children:[t(vt,{label:nt.LANGUAGE,options:u,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${r.language||"none"}`}),t(Ne,{label:nt.RUNTIME_VERSION,placeholder:nt.VERSION_PLACEHOLDER,value:c.version??"",onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${r.version||"none"}`})]})})]})]})},Zu=b.div`
|
|
618
618
|
display: flex;
|
|
619
619
|
flex-direction: column;
|
|
620
620
|
gap: 10px;
|
|
@@ -653,7 +653,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
653
653
|
padding: 2px 6px;
|
|
654
654
|
border-radius: 8px;
|
|
655
655
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
656
|
-
`,dh=({overview:n,status:i})=>{const o=v(),a=n?[{id:"applied",count:n.totalAgentAppliedPods,ok:n.agentAppliedOk,label:"Agent applied"},{id:"out-of-date",count:n.totalAgentOutOfDatePods,ok:n.agentOutOfDateOk,label:"Agent out of date"},{id:"not-applied",count:n.totalAgentNotAppliedPods,ok:n.agentNotAppliedOk,label:"No agent applied"}].filter(({count:e})=>e>0):[];return a.length?t(ch,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Pe.Success:i,d=Fn(c,o);return e(ie,{$gap:2,children:[t(d,{size:16,fill:Ln(o,c,"300")}),t(ee,{size:te.XXXS,color:ne.Secondary,children:`${l}/${n?.totalPods??0} ${s}`})]},a)})}):null},ph=({changedTime:e})=>{const{formatTimeAgo:n}=ln();return t(ee,{size:te.XXXS,color:ne.Disable,nowrap:!0,children:`Agent Assignment Updated · ${n(e)}`})},uh=({source:n,onClickRollout:i,onClickRollback:a})=>{const l=n.rollout?.podsManifestInjectionStatus??n.conditions?.rollout,r=o(()=>{const{status:e,reasonEnum:o,message:a,actionItems:r}=l||{},s=pn(e);if(!s)return null;const c=sh(o,nt.ROLLOUT),d=a,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:ql,onClick:i}]);return{status:s,title:c,subTitle:d,details:t(dh,{overview:n.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:n.rollout?.agentsMetaHashChangedTime?t(ph,{changedTime:n.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[n.rollout,l,i]),s=o(()=>{const{status:e,reasonEnum:t,message:i,actionItems:o}=n.autoRollback?.autoRollbackStatus||{},l=pn(e);if(!l)return null;const r=sh(t,nt.ROLLBACK),s=i,c=(o??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:Bl,onClick:a}]);return c.length||l===Pe.Success||c.push({"data-id":"rollback-action",label:nt.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:Bl,onClick:a}),{status:l,title:r,subTitle:s,actionButtons:c}},[n,a]);return r||s?e(rh,{$gap:12,$alignItems:"stretch",children:[r&&t(Vt,{invertColors:!0,slim:!0,width:s?"calc(60% - 6px)":lh,...r}),s&&t(Vt,{invertColors:!0,slim:!0,width:r?"calc(40% - 6px)":lh,...s})]}):null},hh=({source:e})=>{const{isK8s:n}=S(),{containers:i,containersRichTitle:a}=o(()=>{const t=e?.conditions?.runtimeDetection
|
|
656
|
+
`,dh=({overview:n,status:i})=>{const o=v(),a=n?[{id:"applied",count:n.totalAgentAppliedPods,ok:n.agentAppliedOk,label:"Agent applied"},{id:"out-of-date",count:n.totalAgentOutOfDatePods,ok:n.agentOutOfDateOk,label:"Agent out of date"},{id:"not-applied",count:n.totalAgentNotAppliedPods,ok:n.agentNotAppliedOk,label:"No agent applied"}].filter(({count:e})=>e>0):[];return a.length?t(ch,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Pe.Success:i,d=Fn(c,o);return e(ie,{$gap:2,children:[t(d,{size:16,fill:Ln(o,c,"300")}),t(ee,{size:te.XXXS,color:ne.Secondary,children:`${l}/${n?.totalPods??0} ${s}`})]},a)})}):null},ph=({changedTime:e})=>{const{formatTimeAgo:n}=ln();return t(ee,{size:te.XXXS,color:ne.Disable,nowrap:!0,children:`Agent Assignment Updated · ${n(e)}`})},uh=({source:n,onClickRollout:i,onClickRollback:a})=>{const l=n.rollout?.podsManifestInjectionStatus??n.conditions?.rollout,r=o(()=>{const{status:e,reasonEnum:o,message:a,actionItems:r}=l||{},s=pn(e);if(!s)return null;const c=sh(o,nt.ROLLOUT),d=a,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:ql,onClick:i}]);return{status:s,title:c,subTitle:d,details:t(dh,{overview:n.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:n.rollout?.agentsMetaHashChangedTime?t(ph,{changedTime:n.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[n.rollout,l,i]),s=o(()=>{const{status:e,reasonEnum:t,message:i,actionItems:o}=n.autoRollback?.autoRollbackStatus||{},l=pn(e);if(!l)return null;const r=sh(t,nt.ROLLBACK),s=i,c=(o??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:Bl,onClick:a}]);return c.length||l===Pe.Success||c.push({"data-id":"rollback-action",label:nt.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:Bl,onClick:a}),{status:l,title:r,subTitle:s,actionButtons:c}},[n,a]);return r||s?e(rh,{$gap:12,$alignItems:"stretch",children:[r&&t(Vt,{invertColors:!0,slim:!0,width:s?"calc(60% - 6px)":lh,...r}),s&&t(Vt,{invertColors:!0,slim:!0,width:r?"calc(40% - 6px)":lh,...s})]}):null},hh="Instrumented",mh=({source:e})=>{const{isK8s:n}=S(),{containers:i,containersRichTitle:a}=o(()=>{const t=e?.conditions?.runtimeDetection,i=n?`${e.id.kind} ${nt.CONTAINERS}`:nt.CONTAINERS;return{containers:e?.containers??[],containersRichTitle:{title:i,tooltip:t?.message||nt.DETECTED_CONTAINERS_DESCRIPTION,badge:pn(t?.status)===Pe.Loading?{status:Pe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return i.length?t(Gt,{bgTint:"1000",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:i.map(n=>n&&t(vh,{...n,sourceId:e.id},`source-container-${n.containerName}`))})}):null},gh=b.div`
|
|
657
657
|
display: flex;
|
|
658
658
|
flex-direction: column;
|
|
659
659
|
align-self: stretch;
|
|
@@ -661,26 +661,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
661
661
|
padding: 8px 12px;
|
|
662
662
|
border-radius: 8px;
|
|
663
663
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
664
|
-
`,
|
|
664
|
+
`,fh=b.div`
|
|
665
665
|
display: flex;
|
|
666
666
|
align-items: center;
|
|
667
667
|
justify-content: center;
|
|
668
668
|
padding: 8px;
|
|
669
669
|
border-radius: 10px;
|
|
670
670
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
671
|
-
`,
|
|
671
|
+
`,bh=b.div`
|
|
672
672
|
display: flex;
|
|
673
673
|
flex-direction: column;
|
|
674
674
|
gap: 12px;
|
|
675
675
|
padding: 8px 12px;
|
|
676
676
|
border-radius: 8px;
|
|
677
677
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
678
|
-
`,
|
|
678
|
+
`,vh=({sourceId:n,...i})=>{const{containerName:a,runtimeInfo:r,agentEnabled:s,overrides:c}=i,d=v(),{isK8s:p}=S(),{sourcesApi:u}=qr(),[h,m]=l(!1),g=o(()=>!!c?.runtimeInfo?.language||!!c?.runtimeInfo?.runtimeVersion,[c]),f=o(()=>({language:hn(i),version:zn(i)||""}),[i]),b=o(()=>!!c?.otelDistroName,[c]),y=o(()=>({otelDistroName:c?.otelDistroName||i.agentEnabled?.otelDistroName}),[c,i]),C=o(()=>!r&&!g,[r,g]),x=o(()=>C?Gl:mn(f.language),[C,f]),w=o(()=>{if(C)return"";const{language:e,version:t}=f;return`${e}${t?` • ${t}`:""}`},[C,f]),T=o(()=>{if(C)return{status:Pe.Loading,label:nt.WAITING_FOR_RUNTIME_DETECTION};const e=s?.otelDistroName?.trim(),t=p?!!e:!!s?.agentEnabled;return{status:t?Pe.Success:Pe.Disabled,leftIcon:t?wl:Tl,label:t?e?`${hh} | ${e}`:hh:"Uninstrumented",tooltip:s?.agentEnabledStatus?.message}},[C,s,p]),k=e=>u.update(n,{containerName:a,...b?y:{},...g?f:{},...null!=c?.allowConcurrentAgents?{allowConcurrentAgents:c.allowConcurrentAgents}:{},...e}),I=(s?.agentEnabledStatus?.actionItems??[]).flatMap(e=>{let t;if(e.type===Mn.AllowConcurrentAgentsForContainer)t=!0;else{if(e.type!==Mn.DisallowConcurrentAgentsForContainer)return[];t=!1}return[{type:e.type,label:e.buttonText,onClick:t?()=>m(!0):()=>k({allowConcurrentAgents:!1})}]}),N=o(()=>{const e=[];return i.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(nt.HEAD_SAMPLING),(i.collectorConfig?.tailSampling?.noisyOperations?.length||i.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||i.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(nt.TAIL_SAMPLING),e},[i]);return e(gh,{children:[e(ie,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ie,{$gap:8,$alignItems:"center",children:[t(fh,{children:t(x,{size:24,fill:r?void 0:d.v2.colors.grey[400]})}),t(ee,{children:a}),t(on,w?{variant:gn.Blue,label:w}:{variant:gn.Loader,label:nt.DETECTING_RUNTIME_INFO}),t(qu,{overridden:g,onOverride:k,defaultValues:f,originalValues:{language:i.runtimeInfo?.language,version:i.runtimeInfo?.runtimeVersion||""}})]}),e(ie,{$gap:8,$alignItems:"center",children:[t(ce,{...T,textSize:te.XXXS}),t(Ju,{language:f.language,overridden:b,onOverride:k,defaultValues:y})]})]}),s&&(!s.agentEnabled||I.length>0)&&!C?t(bh,{children:e(ie,{$gap:10,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ie,{$gap:10,$alignItems:"center",children:[t(on,{variant:gn.Pink,label:Ut(s.agentEnabledStatus?.reasonEnum)||nt.NO_AVAILABLE_AGENT}),t(ee,{size:te.XXXS,color:ne.Secondary,children:s?.agentEnabledStatus?.message})]}),I.map(e=>t(Te,{"data-id":`container-action-${e.type}`,label:e.label,variant:Ie.Secondary,size:ke.S,onClick:e.onClick},e.type))]})}):null,N.length>0&&t(bh,{children:t(ie,{$gap:16,$wrap:"wrap",children:N.map((e,n)=>t(ce,{label:e,leftIcon:wl,status:Pe.Success,invertColors:!0,useSecondaryTone:!0},`${a}-rule-${n}`))})}),t(tt,{isOpen:h,title:"Run Odigos with other agents?",description:"Running multiple instrumentation agents in the same container is not recommended and may affect performance or reliability.",onClose:()=>m(!1),denyButton:{label:"Cancel",variant:Ie.Secondary,onClick:()=>m(!1)},approveButton:{label:"Run Odigos With Other Agents",variant:Ie.Primary,onClick:async()=>{await k({allowConcurrentAgents:!0}),m(!1)}}})]})},yh=({source:n,onClickRollout:i,onClickRollback:a})=>{const{isK8s:l,platformType:r,version:s}=S(),c=o(()=>Xn(r,s)?Bt(Bn(n.conditions)):[],[r,s,n.conditions]);return e(ae,{$gap:12,children:[t(Xu,{source:n}),t(Uu,{source:n}),l&&t(uh,{source:n,onClickRollout:i,onClickRollback:a}),!!c.length&&t(Yt,{conditions:c,title:nt.INSTRUMENTATION_LIFECYCLE}),t(mh,{source:n}),!l&&!n.containers?.length&&t(ah,{source:n}),l&&t(Bu,{source:n})]})},Ch=({source:e})=>{const n=e.containers||[];return t(Gt,{bgTint:"1000",richTitle:{title:nt.INSTRUMENTED_LIBRARIES},children:n.length?n.map(e=>{const n=e.instrumentations||[];return t(Gt,{bgTint:"800",richTitle:{title:e.containerName,badge:{label:n.length}},withCollapse:!0,collapseIsDefaultOpen:!!n?.length,children:n?.length?t(ae,{children:n.map((e,n)=>t(bu,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))}):t(Oe,{title:"No libraries found"})},e.containerName)}):t(Oe,{title:"No containers found"})})},Sh=b(ae)`
|
|
679
679
|
width: 100%;
|
|
680
680
|
max-height: 320px;
|
|
681
681
|
overflow-y: auto;
|
|
682
682
|
gap: 8px;
|
|
683
|
-
`,
|
|
683
|
+
`,xh=b(ie)`
|
|
684
684
|
width: 100%;
|
|
685
685
|
align-items: center;
|
|
686
686
|
gap: 8px;
|
|
@@ -690,14 +690,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
690
690
|
& > * {
|
|
691
691
|
font-family: monospace !important;
|
|
692
692
|
}
|
|
693
|
-
`,xh=({pendingModify:n,onClose:i,onConfirm:o})=>{const a=v();return t(tt,{isOpen:!!n,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:i,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:i},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:o},children:n&&e(Ch,{children:[n.add.map(n=>e(Sh,{children:[t(ce,{leftIcon:gl,status:Pe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(Sh,{children:[t(ce,{leftIcon:Zl,status:Pe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`remove-${n}`))]})})};function wh(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 Th(e){const t=Math.abs(e);return t>=1e9?`${kh(e/1e9)}s`:t>=1e6?`${kh(e/1e6)}ms`:t>=1e3?`${kh(e/1e3)}μs`:String(Math.round(e))}function kh(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Ih(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],l=i[e+1],r=i[e+2],s=i[e+3],c=o+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),o=c+l}}return t}function Nh(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Eh(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function $h(e,t,n){return((e,t)=>{const n=[];for(let i=0;i<=t.level;i++){let o;for(const n of e)if(n.level===i&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){o=n;break}if(!o)return n;n.push(o)}return n})(t,n).map(t=>wh(e,t.nameIndex))}function Oh(e,t,n){if(0===n.length)return null;let i=null,o=null;for(let a=0;a<n.length;a++){const l=n[a];let r=null;for(const n of t)n.level===a&&wh(e,n.nameIndex)===l&&(i&&(n.offset<i.offset||n.offset+n.size>i.offset+i.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;i=r,o=r}return o}function Ah(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}function Rh(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Dh(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 Ph,_h;function Lh(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Fh(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 zh(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`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Ph||(Ph={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(_h||(_h={}));const Mh=({flamebearer:n,maxRowPx:i,searchQuery:r="",shouldKeepName:s,minHostHeight:c=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=p(null),S=p(null),x=p({x:0,y:0}),[w,T]=l({w:0,h:0}),[k,I]=l(""),[N,E]=l(null),[$,O]=l([]),[A,R]=l(!1),[D,P]=l(Ph.Fit),[_,L]=l(_h.Fit),[F,z]=l(!1),M=Math.max(1,Math.min(Math.floor(w.w*D),8192)),X=Math.max(1,Math.min(Math.floor(w.h*_),8192)),B=$.length>0?$[$.length-1]:null,U=B?.size??n.numTicks,V=o(()=>Ih(n),[n]),H=p({fb:n,rects:V});a(()=>{const e=H.current;e.fb!==n&&(H.current={fb:n,rects:V},O(t=>{if(0===t.length)return t;const i=((e,t,n,i,o)=>{const a=[];for(const l of o){const o=$h(e,t,l);if(0===o.length)break;const r=Oh(n,i,o);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return i.length===t.length&&i.every((e,n)=>Eh(e,t[n]))?t:i}))},[n,V]),a(()=>{if(!f)return;if(!B)return void f(null);const e=Ah(V,B),t=new Set;for(const i of e){const e=wh(n,i.nameIndex);e&&t.add(e)}f([...t])},[B,n,V,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),a(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),a(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=o(()=>function(e,t,n,i,o,a={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Ih(e);let p=l?Ah(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(wh(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((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 l=a[0];l.size===t.size&&wh(e,l.nameIndex)===wh(e,t.nameIndex)&&o.add(Nh(l))}if(0===o.size)return n;const a=[];for(const e of n){if(o.has(Nh(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=i.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&o.has(Nh(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=i??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=o.trim(),y=b>8?1:0;return p.map(n=>{const i=n.level-u,o=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=i*b,r=Math.max(b-y,1),s=wh(e,n.nameIndex);return{...n,x:o,y:l,w:a,h:r,name:s,matchesSearch:Rh(s,v)}})}(n,M,X,i,r,{zoomRoot:B,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,i,r,X,M,B,s,F,V]),G=o(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?r.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,r]),W=d(e=>{if(M<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const i=Fh((e.clientX-t.left)/t.width*M,(e.clientY-t.top)/t.height*X,G);if(i){const e=Nh(i);E(e);const t=U>0?(100*i.size/U).toFixed(1):"0",o=n.numTicks>0?(100*i.size/n.numTicks).toFixed(1):"0";I(`${i.name}\ntotal ${Th(i.size)} (${t}% of view, ${o}% of profile) · self ${Th(i.self)}`)}else E(null),I("")},[G,n.numTicks,X,M,U]),K=d(e=>{W(e)},[W]),Y=d(()=>{E(null),I("")},[]),J=d(e=>{x.current={x:e.clientX,y:e.clientY}},[]),q=d(e=>{const{x:t,y:n}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(M<2||X<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=Fh((e.clientX-i.left)/i.width*M,(e.clientY-i.top)/i.height*X,G);if(!o)return;m?.(o.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(o);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&Eh(a,t)?e.slice(0,-1):[...e,a]})},[G,X,M,m]);g(()=>{const e=S.current;if(!e||M<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,i=Math.max(M,X),o=Math.min(t,16384/i);e.width=Math.floor(M*o),e.height=Math.floor(X*o),e.style.width=`${M}px`,e.style.height=`${X}px`;const a=e.getContext("2d");a&&(a.setTransform(o,0,0,o,0,0),a.clearRect(0,0,M,X),j?.length?((e,t,n,i,o,a,l,r)=>{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:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=Dh(s,a);e.fillStyle=u,e.fillRect(n,i,o,l),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(l-1,0));const m=Lh(d,r),g=`${s} (${Th(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(o>=y&&C>=b){e.font=`${C}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*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,i+l/2),e.fillStyle=h,e.fillText(t,n+v,i+l/2))}}if(l)for(const t of i){if(Nh(t)!==l)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,M,X,j,r,y,N,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,M,X)))},[j,n.numTicks,N,r,X,M,y]);const Z=d(()=>R(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,oe=o(()=>((e,t,n)=>{const i=n??Ih(e),o=t?.offset??0,a=o+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of i)e.level<l||e.offset<o||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(n,B,V),[n,B,V]),ae=null!==oe,le=$.length>0,re=B?wh(n,B.nameIndex):"",se=d(()=>{O([]),b?.()},[b]),ce=d(()=>O(e=>e.slice(0,-1)),[]),de=d(()=>{oe&&O(e=>[...e,oe])},[oe]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:c,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(ie,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(ge,{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:fe.Left,size:Et.S,value:F,onChange:z}),e(ie,{$gap:8,children:[e(ie,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,label:"Reset zoom",leftIcon:Ql,onClick:se,disabled:!$.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:Zl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!le,onClick:ce}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:gl,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ae,onClick:de})]}),e(ie,{children:[t(Be,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Un.Filled,options:[{value:Ph.Fit,label:"W: Fit"},{value:Ph.X10,label:"10x"}],selected:D,setSelected:P})}),t(Be,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Un.Filled,options:[{value:_h.Fit,label:"H: Fit"},{value:_h.X10,label:"10x"}],selected:_,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?$l:er,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Be,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:D>1?"auto":"hidden",overflowY:_>1?"auto":"hidden"},children:t("div",{style:{width:M||"100%",height:X||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:N?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(ie,{$justifyContent:"space-between",children:[t(ee,B?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${re} • ${Th(U)} samples in view`}:{size:te.XXXS,color:y.v2.colors.silver[300],children:m?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ee,{size:te.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${zh(h.totalBytesUsed)} / ${zh(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},Xh=[_n.Go,_n.Java],Bh="Profiling Symbols";function Uh(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?_n.Go:e.includes(" ")||e.includes("(")?_n.Java:_n.Go)(e);if(n===_n.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),i=t.indexOf(".",n+1);if(-1===i)return null;const o=t.slice(0,i),a=t.slice(i+1);if(!o||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new He(o,"",l[1],l[2]);return e.Verify()?e:null}const r=new He(o,a);return r.Verify()?r:null})(e);return t?{language:n,golang:t}:null}if(n===_n.Java){const t=(e=>{let t=e.trim();if(!t)return null;const n=t.indexOf("(");-1!==n&&(t=t.slice(0,n).trim());const i=t.split(/\s+/);t=i[i.length-1]??"";const o=t.lastIndexOf(".");if(-1===o)return null;const a=t.slice(0,o),l=t.slice(o+1),r=new je(a,l);return r.Verify()?r:null})(e);return t?{language:n,java:t}:null}return null}function Vh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function Hh(e,t,n){if(!e)return!0;const{sources:i=[],namespaces:o=[],languages:a=[]}=e,l=!i.length||i.some(e=>Vh(e,t.id)),r=!o.length||o.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function jh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function Gh(e,t){return e.className===t.className&&e.methodName===t.methodName}function Wh(e,t,n,i){const o=Uh(e,n);if(!o)return[];const a=[];for(const e of i){const n=e.customInstrumentations;if(!n)continue;if(!Hh(e.sourceScopes,t,o.language))continue;const i=!!o.golang&&!!n[We.Golang]?.some(e=>jh(e,o.golang)),l=!!o.java&&!!n[We.Java]?.some(e=>Gh(e,o.java));(i||l)&&a.push({rule:e,resolved:o})}return a}var Kh,Yh,Jh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(Kh||(Kh={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(Yh||(Yh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(Jh||(Jh={}));const qh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Zh(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(Jh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(Jh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&qh.test(n))}const Qh=({rows:e,languages:n,instrumentation:i,searchQuery:a,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!n?.includes(_n.Java),h=o(()=>{const t=s?new Set(s):null,n=a?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,a,s]),m=o(()=>{const e=[];if(i.selectionEnabled&&e.push({id:Yh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:Jh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:Jh.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const n=e.cells.find(e=>e.key===Kh.Symbol)?.rawValue?.toString()??"";return!(t.includes(Yh.OnlyInstrumentable)&&!i.getSymbolState(n).showCheckbox)&&Zh(n,t)}}},[i,u]),g=o(()=>[{key:Kh.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:Kh.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Kh.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=o(()=>h.map(e=>{const t=i.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:Kh.Symbol,rawValue:e.name},{key:Kh.Self,rawValue:Th(e.self)},{key:Kh.Total,rawValue:Th(e.total)}],isSelected:n?i.isSelected(e.name):void 0,onSelect:n?()=>i.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>i.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,i]),b=d(e=>{const t=e.cells[0].rawValue,n=i.getSymbolState(t),o=[];return n.inManagedRule?o.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:ml,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>i.onRemove(t)}):o.push({id:`add-instrumentation-${t}`,label:"",leftIcon:gl,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>i.onAdd(t)}),o.push({id:`copy-${t}`,label:"",leftIcon:tr,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),o},[i]);return t(Vn,{variant:Hn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:i.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:b})};var em;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(em||(em={}));const tm=b(ae)`
|
|
693
|
+
`,wh=({pendingModify:n,onClose:i,onConfirm:o})=>{const a=v();return t(tt,{isOpen:!!n,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:i,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:i},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:o},children:n&&e(Sh,{children:[n.add.map(n=>e(xh,{children:[t(ce,{leftIcon:gl,status:Pe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(xh,{children:[t(ce,{leftIcon:Zl,status:Pe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`remove-${n}`))]})})};function Th(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 kh(e){const t=Math.abs(e);return t>=1e9?`${Ih(e/1e9)}s`:t>=1e6?`${Ih(e/1e6)}ms`:t>=1e3?`${Ih(e/1e3)}μs`:String(Math.round(e))}function Ih(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Nh(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],l=i[e+1],r=i[e+2],s=i[e+3],c=o+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),o=c+l}}return t}function Eh(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function $h(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Oh(e,t,n){return((e,t)=>{const n=[];for(let i=0;i<=t.level;i++){let o;for(const n of e)if(n.level===i&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){o=n;break}if(!o)return n;n.push(o)}return n})(t,n).map(t=>Th(e,t.nameIndex))}function Ah(e,t,n){if(0===n.length)return null;let i=null,o=null;for(let a=0;a<n.length;a++){const l=n[a];let r=null;for(const n of t)n.level===a&&Th(e,n.nameIndex)===l&&(i&&(n.offset<i.offset||n.offset+n.size>i.offset+i.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;i=r,o=r}return o}function Rh(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}function Dh(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Ph(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 _h,Lh;function Fh(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function zh(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 Mh(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`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(_h||(_h={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Lh||(Lh={}));const Xh=({flamebearer:n,maxRowPx:i,searchQuery:r="",shouldKeepName:s,minHostHeight:c=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=p(null),S=p(null),x=p({x:0,y:0}),[w,T]=l({w:0,h:0}),[k,I]=l(""),[N,E]=l(null),[$,O]=l([]),[A,R]=l(!1),[D,P]=l(_h.Fit),[_,L]=l(Lh.Fit),[F,z]=l(!1),M=Math.max(1,Math.min(Math.floor(w.w*D),8192)),X=Math.max(1,Math.min(Math.floor(w.h*_),8192)),B=$.length>0?$[$.length-1]:null,U=B?.size??n.numTicks,V=o(()=>Nh(n),[n]),H=p({fb:n,rects:V});a(()=>{const e=H.current;e.fb!==n&&(H.current={fb:n,rects:V},O(t=>{if(0===t.length)return t;const i=((e,t,n,i,o)=>{const a=[];for(const l of o){const o=Oh(e,t,l);if(0===o.length)break;const r=Ah(n,i,o);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return i.length===t.length&&i.every((e,n)=>$h(e,t[n]))?t:i}))},[n,V]),a(()=>{if(!f)return;if(!B)return void f(null);const e=Rh(V,B),t=new Set;for(const i of e){const e=Th(n,i.nameIndex);e&&t.add(e)}f([...t])},[B,n,V,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),a(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),a(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=o(()=>function(e,t,n,i,o,a={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Nh(e);let p=l?Rh(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(Th(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((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 l=a[0];l.size===t.size&&Th(e,l.nameIndex)===Th(e,t.nameIndex)&&o.add(Eh(l))}if(0===o.size)return n;const a=[];for(const e of n){if(o.has(Eh(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=i.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&o.has(Eh(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=i??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=o.trim(),y=b>8?1:0;return p.map(n=>{const i=n.level-u,o=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=i*b,r=Math.max(b-y,1),s=Th(e,n.nameIndex);return{...n,x:o,y:l,w:a,h:r,name:s,matchesSearch:Dh(s,v)}})}(n,M,X,i,r,{zoomRoot:B,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,i,r,X,M,B,s,F,V]),G=o(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?r.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,r]),W=d(e=>{if(M<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const i=zh((e.clientX-t.left)/t.width*M,(e.clientY-t.top)/t.height*X,G);if(i){const e=Eh(i);E(e);const t=U>0?(100*i.size/U).toFixed(1):"0",o=n.numTicks>0?(100*i.size/n.numTicks).toFixed(1):"0";I(`${i.name}\ntotal ${kh(i.size)} (${t}% of view, ${o}% of profile) · self ${kh(i.self)}`)}else E(null),I("")},[G,n.numTicks,X,M,U]),K=d(e=>{W(e)},[W]),Y=d(()=>{E(null),I("")},[]),J=d(e=>{x.current={x:e.clientX,y:e.clientY}},[]),q=d(e=>{const{x:t,y:n}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(M<2||X<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=zh((e.clientX-i.left)/i.width*M,(e.clientY-i.top)/i.height*X,G);if(!o)return;m?.(o.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(o);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&$h(a,t)?e.slice(0,-1):[...e,a]})},[G,X,M,m]);g(()=>{const e=S.current;if(!e||M<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,i=Math.max(M,X),o=Math.min(t,16384/i);e.width=Math.floor(M*o),e.height=Math.floor(X*o),e.style.width=`${M}px`,e.style.height=`${X}px`;const a=e.getContext("2d");a&&(a.setTransform(o,0,0,o,0,0),a.clearRect(0,0,M,X),j?.length?((e,t,n,i,o,a,l,r)=>{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:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=Ph(s,a);e.fillStyle=u,e.fillRect(n,i,o,l),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(l-1,0));const m=Fh(d,r),g=`${s} (${kh(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(o>=y&&C>=b){e.font=`${C}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*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,i+l/2),e.fillStyle=h,e.fillText(t,n+v,i+l/2))}}if(l)for(const t of i){if(Eh(t)!==l)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,M,X,j,r,y,N,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,M,X)))},[j,n.numTicks,N,r,X,M,y]);const Z=d(()=>R(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,oe=o(()=>((e,t,n)=>{const i=n??Nh(e),o=t?.offset??0,a=o+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of i)e.level<l||e.offset<o||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(n,B,V),[n,B,V]),ae=null!==oe,le=$.length>0,re=B?Th(n,B.nameIndex):"",se=d(()=>{O([]),b?.()},[b]),ce=d(()=>O(e=>e.slice(0,-1)),[]),de=d(()=>{oe&&O(e=>[...e,oe])},[oe]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:c,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(ie,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(ge,{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:fe.Left,size:Et.S,value:F,onChange:z}),e(ie,{$gap:8,children:[e(ie,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,label:"Reset zoom",leftIcon:Ql,onClick:se,disabled:!$.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:Zl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!le,onClick:ce}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:gl,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ae,onClick:de})]}),e(ie,{children:[t(Be,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Un.Filled,options:[{value:_h.Fit,label:"W: Fit"},{value:_h.X10,label:"10x"}],selected:D,setSelected:P})}),t(Be,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Un.Filled,options:[{value:Lh.Fit,label:"H: Fit"},{value:Lh.X10,label:"10x"}],selected:_,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?$l:er,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Be,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:D>1?"auto":"hidden",overflowY:_>1?"auto":"hidden"},children:t("div",{style:{width:M||"100%",height:X||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:N?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(ie,{$justifyContent:"space-between",children:[t(ee,B?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${re} • ${kh(U)} samples in view`}:{size:te.XXXS,color:y.v2.colors.silver[300],children:m?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ee,{size:te.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Mh(h.totalBytesUsed)} / ${Mh(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},Bh=[_n.Go,_n.Java],Uh="Profiling Symbols";function Vh(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?_n.Go:e.includes(" ")||e.includes("(")?_n.Java:_n.Go)(e);if(n===_n.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),i=t.indexOf(".",n+1);if(-1===i)return null;const o=t.slice(0,i),a=t.slice(i+1);if(!o||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new He(o,"",l[1],l[2]);return e.Verify()?e:null}const r=new He(o,a);return r.Verify()?r:null})(e);return t?{language:n,golang:t}:null}if(n===_n.Java){const t=(e=>{let t=e.trim();if(!t)return null;const n=t.indexOf("(");-1!==n&&(t=t.slice(0,n).trim());const i=t.split(/\s+/);t=i[i.length-1]??"";const o=t.lastIndexOf(".");if(-1===o)return null;const a=t.slice(0,o),l=t.slice(o+1),r=new je(a,l);return r.Verify()?r:null})(e);return t?{language:n,java:t}:null}return null}function Hh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function jh(e,t,n){if(!e)return!0;const{sources:i=[],namespaces:o=[],languages:a=[]}=e,l=!i.length||i.some(e=>Hh(e,t.id)),r=!o.length||o.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function Gh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function Wh(e,t){return e.className===t.className&&e.methodName===t.methodName}function Kh(e,t,n,i){const o=Vh(e,n);if(!o)return[];const a=[];for(const e of i){const n=e.customInstrumentations;if(!n)continue;if(!jh(e.sourceScopes,t,o.language))continue;const i=!!o.golang&&!!n[We.Golang]?.some(e=>Gh(e,o.golang)),l=!!o.java&&!!n[We.Java]?.some(e=>Wh(e,o.java));(i||l)&&a.push({rule:e,resolved:o})}return a}var Yh,Jh,qh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(Yh||(Yh={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(Jh||(Jh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(qh||(qh={}));const Zh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Qh(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(qh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(qh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&Zh.test(n))}const em=({rows:e,languages:n,instrumentation:i,searchQuery:a,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!n?.includes(_n.Java),h=o(()=>{const t=s?new Set(s):null,n=a?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,a,s]),m=o(()=>{const e=[];if(i.selectionEnabled&&e.push({id:Jh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:qh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:qh.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const n=e.cells.find(e=>e.key===Yh.Symbol)?.rawValue?.toString()??"";return!(t.includes(Jh.OnlyInstrumentable)&&!i.getSymbolState(n).showCheckbox)&&Qh(n,t)}}},[i,u]),g=o(()=>[{key:Yh.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:Yh.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Yh.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=o(()=>h.map(e=>{const t=i.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:Yh.Symbol,rawValue:e.name},{key:Yh.Self,rawValue:kh(e.self)},{key:Yh.Total,rawValue:kh(e.total)}],isSelected:n?i.isSelected(e.name):void 0,onSelect:n?()=>i.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>i.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,i]),b=d(e=>{const t=e.cells[0].rawValue,n=i.getSymbolState(t),o=[];return n.inManagedRule?o.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:ml,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>i.onRemove(t)}):o.push({id:`add-instrumentation-${t}`,label:"",leftIcon:gl,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>i.onAdd(t)}),o.push({id:`copy-${t}`,label:"",leftIcon:tr,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),o},[i]);return t(Vn,{variant:Hn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:i.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:b})};var tm;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(tm||(tm={}));const nm=b(ae)`
|
|
694
694
|
width: 100%;
|
|
695
695
|
flex: 1;
|
|
696
696
|
border-radius: 16px;
|
|
697
697
|
overflow: hidden;
|
|
698
698
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
699
699
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
700
|
-
`,
|
|
700
|
+
`,im=b.div`
|
|
701
701
|
display: flex;
|
|
702
702
|
align-items: center;
|
|
703
703
|
gap: 10px;
|
|
@@ -705,11 +705,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
705
705
|
padding: 12px 12px 8px;
|
|
706
706
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
707
707
|
border-radius: 16px 16px 0 0;
|
|
708
|
-
`,
|
|
708
|
+
`,om=b(ie)`
|
|
709
709
|
flex-shrink: 0;
|
|
710
710
|
align-items: center;
|
|
711
711
|
gap: 4px;
|
|
712
|
-
`,
|
|
712
|
+
`,am=b.div`
|
|
713
713
|
flex: 1;
|
|
714
714
|
display: flex;
|
|
715
715
|
align-items: stretch;
|
|
@@ -717,20 +717,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
717
717
|
padding: 16px;
|
|
718
718
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
719
719
|
border-radius: 0 0 16px 16px;
|
|
720
|
-
`,
|
|
720
|
+
`,lm=b(ae)`
|
|
721
721
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
722
722
|
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
723
723
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
724
724
|
gap: 10px;
|
|
725
|
-
`,
|
|
725
|
+
`,rm=b(ae)`
|
|
726
726
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
727
727
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
728
728
|
gap: 10px;
|
|
729
|
-
`,
|
|
729
|
+
`,sm=b(ie)`
|
|
730
730
|
width: 100%;
|
|
731
731
|
min-height: 32px;
|
|
732
732
|
flex-shrink: 0;
|
|
733
|
-
`,sm=({source:n,onFlameFullscreenChange:i})=>{const s=v(),{profilingApi:c}=qr(),u=o(()=>({namespace:n.id.namespace,name:n.id.name,kind:n.id.kind,region:n.id.region,serviceName:n.serviceName}),[n.id.namespace,n.id.name,n.id.kind,n.id.region,n.serviceName]),[h,m]=l(!0),[g,f]=l(em.Both),[b,y]=l(""),[C,S]=l({}),[x,w]=l(!1),T=p(!1);a(()=>{T.current||(T.current=!0,c.enableProfiling?.(u),w(!0))},[c,u]);const{data:k}=c.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:I,loading:N,refetch:E}=c.useSourceProfiling(u,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),$=I?.profileJson??null,O=o(()=>(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}})($),[$]),A=o(()=>O?(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],l=wh(e,i[n+3]);if(!l)continue;const r=t.get(l);(!r||o>r.total)&&t.set(l,{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)})(O.flamebearer):[],[O]),R=g===em.Table||g===em.Both,D=g===em.Flame||g===em.Both,P=R&&D,_=n.runtimeInfo?.detectedLanguages?.join("\0")??"",L=n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=o(()=>_?_.split("\0"):L?L.split("\0"):void 0,[_,L]),z=o(()=>((e,t)=>{if(!t?.includes(_n.Java))return;const n=(e?.[Kh.Symbol]?.filter(Boolean)??[]).filter(e=>e===Jh.FilterOutVoid||e===Jh.OnlyWithReturnValues);return 0!==n.length?e=>Zh(e,n):void 0})(C,F),[C,F]),{instrumentation:M,pendingCount:X,pendingModify:B,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:n}){const{instrumentationRulesApi:i,capabilities:a}=qr(),{items:r}=i.useRules(),[s,c]=l(new Set),[p,u]=l(new Set),[h,m]=l(null),g=o(()=>(e=>{const t=new Set(e??[]);return Xh.filter(e=>t.has(e))})(t),[t]),f=a.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=o(()=>((e,t)=>{const n=e.filter(e=>e.type===Ye.CustomInstrumentation&&e.ruleName===Bh&&Hh(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>Vh(e,t.id)))??n[0]??null})(r,e),[r,b]),y=f&&g.length>0,C=o(()=>{const t=new Map;for(const i of n){const n=!!Uh(i.name,g),o=Wh(i.name,e,g,r),a=!!v&&o.some(e=>e.rule.ruleId===v.ruleId),l=o.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&l.length>0,c=y&&n,d=s;let p;if(s){const e=[...new Set(l.map(e=>e.rule.ruleName))];p=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let u=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=p??"Managed by another rule":0===o.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?u=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(i.name,{parsable:n,inManagedRule:a,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[n,r,b,g,f,y,v]),S=o(()=>{const e=new Set;return C.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[C]),x=o(()=>[...s].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[s,C,S]),w=o(()=>[...p].filter(e=>S.has(e)),[p,S]),T=x.length+w.length,k=d(e=>{const t=C.get(e);return t?.inManagedRule?!p.has(e):!!(t&&t.otherRules.length>0)||s.has(e)},[C,p,s]),I=d((e,t)=>{const n=C.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?u(n=>{const i=new Set(n);return t?i.delete(e):i.add(e),i}):c(n=>{const i=new Set(n);return t?i.add(e):i.delete(e),i}))},[C]),N=d(()=>{c(new Set),u(new Set)},[]),E=d(t=>{(async()=>{const n=t.add.map(e=>Uh(e,g)).filter(e=>!!e),o=t.remove.map(e=>Uh(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,n)=>{const i=e.customInstrumentations??{};let o=[...i[We.Golang]??[]],a=[...i[We.Java]??[]];for(const e of n)e.golang&&(o=o.filter(t=>!jh(t,e.golang))),e.java&&(a=a.filter(t=>!Gh(t,e.java)));for(const e of t)e.golang&&!o.some(t=>jh(t,e.golang))&&o.push(e.golang),e.java&&!a.some(t=>Gh(t,e.java))&&a.push(e.java);return{customInstrumentations:{[We.Golang]:o,[We.Java]:a},isEmpty:0===o.length&&0===a.length}})(v,n,o);t?await i.remove(v.ruleId,Ye.CustomInstrumentation):await i.update(v.ruleId,((e,t)=>({ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}))(v,e),Ye.CustomInstrumentation)}else n.length>0&&await i.create(((e,t)=>{const n=e.map(e=>e.golang).filter(e=>!!e),i=e.map(e=>e.java).filter(e=>!!e),o={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:Bh,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:o,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[We.Golang]:n,[We.Java]:i}}})(n,e),Ye.CustomInstrumentation)})()},[v,g,e,i]),$=d(()=>{T&&m({add:x,remove:w})},[T,x,w]),O=d(e=>m({add:[e],remove:[]}),[]),A=d(e=>m({add:[],remove:[e]}),[]),R=d(()=>m(null),[]),D=d(()=>{h&&(E(h),m(null),N())},[h,E,N]),P=d(e=>C.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[C]);return{instrumentation:o(()=>({getSymbolState:P,onAdd:O,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[P,O,A,y,k,I]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:$,resetSelection:N,confirmModify:D}}({source:n,languages:F,rows:A}),[G,W]=l(null),[K,Y]=l(0),[J,q]=l(null),Z=d(e=>{W(e),Y(e=>e+1),f(e=>e===em.Flame?em.Both:e)},[]),Q=d(e=>{q(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const n=new Set(t);if(e.every(e=>n.has(e)))return t}return e})},[]),oe=d(()=>W(null),[]);return!$&&N?t(ft,{$height:"70vh",children:t(St,{withSpinner:!0})}):e(tm,{$gap:0,$width:"100%",children:[e(nm,{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(im,{children:t(ee,{size:te.S,weight:500,color:ne.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(ie,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(vn,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:s.v2.colors.silver[900],emphasizeBackgroundColor:s.v2.colors.silver[800]})}),t(ve,{variant:Un.Filled,options:[{value:em.Table,label:"Top table"},{value:em.Flame,label:"Flame graph"},{value:em.Both,label:"Both"}],selected:g,setSelected:f}),t(Te,h?{variant:Ie.Secondary,size:ke.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(nr,{...e,size:8,fill:s.v2.colors.green[500]})}:{variant:Ie.Secondary,size:ke.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(nr,{...e,size:8,fill:s.v2.colors.red[500]})})]})]}),t(om,{$gap:R&&D?16:0,children:O?e(r,{children:[R&&e(am,{$splitWithFlame:P,children:[e(rm,{$justifyContent:"space-between",children:[e(ae,{$margin:"0 0 0 20px",children:[t(ee,{size:te.XXXS,nowrap:!0,children:"Please select symbols to"}),e(ie,{$gap:8,children:[e(ie,{children:[t(ir,{size:24}),t(ee,{size:te.S,color:ne.Success,nowrap:!0,children:"Custom Instrument"})]}),t(Te,{leftIcon:bl,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${_e}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(ie,{$gap:8,children:[J&&t(Be,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(ce,{label:`Zoomed: ${J.length} symbols`,backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS})}),t(Te,{variant:Ie.Secondary,size:ke.S,label:"Download snapshot",rightIcon:or,onClick:()=>{if(!$)return;const e=new Blob([$],{type:"application/json"}),t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,i.click(),URL.revokeObjectURL(t)},disabled:!$})]})]}),t(Qh,{rows:A,languages:F,instrumentation:M,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),D&&e(lm,{$splitWithTable:P,children:[e(rm,{$justifyContent:"space-between",children:[t(ce,{label:O?`Total in view ${Th(O.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS}),e(ie,{$gap:12,children:[!h&&t(Te,{variant:Ie.Secondary,size:ke.S,label:"Refresh",leftIcon:Bl,onClick:E}),t(ge,{label:"Auto refresh",labelAlign:fe.Left,size:Et.S,value:h,onChange:m})]})]}),t(Mh,{flamebearer:O.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:z,minHostHeight:280,onFullscreenChange:i,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:oe})]})]}):t(ft,{children:t(Oe,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(xh,{pendingModify:B,onClose:U,onConfirm:j}),t(jn,{isOpen:X>0,richTitle:{icon:Ol,title:"Profiling Symbols",badge:{label:X}},actions:[{id:"profiling-bulk-cancel",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Modify Rule",leftIcon:yl,onClick:V}}]})]})},cm=b.div`
|
|
733
|
+
`,cm=({source:n,onFlameFullscreenChange:i})=>{const s=v(),{profilingApi:c}=qr(),u=o(()=>({namespace:n.id.namespace,name:n.id.name,kind:n.id.kind,region:n.id.region,serviceName:n.serviceName}),[n.id.namespace,n.id.name,n.id.kind,n.id.region,n.serviceName]),[h,m]=l(!0),[g,f]=l(tm.Both),[b,y]=l(""),[C,S]=l({}),[x,w]=l(!1),T=p(!1);a(()=>{T.current||(T.current=!0,c.enableProfiling?.(u),w(!0))},[c,u]);const{data:k}=c.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:I,loading:N,refetch:E}=c.useSourceProfiling(u,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),$=I?.profileJson??null,O=o(()=>(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}})($),[$]),A=o(()=>O?(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],l=Th(e,i[n+3]);if(!l)continue;const r=t.get(l);(!r||o>r.total)&&t.set(l,{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)})(O.flamebearer):[],[O]),R=g===tm.Table||g===tm.Both,D=g===tm.Flame||g===tm.Both,P=R&&D,_=n.runtimeInfo?.detectedLanguages?.join("\0")??"",L=n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=o(()=>_?_.split("\0"):L?L.split("\0"):void 0,[_,L]),z=o(()=>((e,t)=>{if(!t?.includes(_n.Java))return;const n=(e?.[Yh.Symbol]?.filter(Boolean)??[]).filter(e=>e===qh.FilterOutVoid||e===qh.OnlyWithReturnValues);return 0!==n.length?e=>Qh(e,n):void 0})(C,F),[C,F]),{instrumentation:M,pendingCount:X,pendingModify:B,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:n}){const{instrumentationRulesApi:i,capabilities:a}=qr(),{items:r}=i.useRules(),[s,c]=l(new Set),[p,u]=l(new Set),[h,m]=l(null),g=o(()=>(e=>{const t=new Set(e??[]);return Bh.filter(e=>t.has(e))})(t),[t]),f=a.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=o(()=>((e,t)=>{const n=e.filter(e=>e.type===Ye.CustomInstrumentation&&e.ruleName===Uh&&jh(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>Hh(e,t.id)))??n[0]??null})(r,e),[r,b]),y=f&&g.length>0,C=o(()=>{const t=new Map;for(const i of n){const n=!!Vh(i.name,g),o=Kh(i.name,e,g,r),a=!!v&&o.some(e=>e.rule.ruleId===v.ruleId),l=o.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&l.length>0,c=y&&n,d=s;let p;if(s){const e=[...new Set(l.map(e=>e.rule.ruleName))];p=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let u=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=p??"Managed by another rule":0===o.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?u=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(i.name,{parsable:n,inManagedRule:a,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[n,r,b,g,f,y,v]),S=o(()=>{const e=new Set;return C.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[C]),x=o(()=>[...s].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[s,C,S]),w=o(()=>[...p].filter(e=>S.has(e)),[p,S]),T=x.length+w.length,k=d(e=>{const t=C.get(e);return t?.inManagedRule?!p.has(e):!!(t&&t.otherRules.length>0)||s.has(e)},[C,p,s]),I=d((e,t)=>{const n=C.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?u(n=>{const i=new Set(n);return t?i.delete(e):i.add(e),i}):c(n=>{const i=new Set(n);return t?i.add(e):i.delete(e),i}))},[C]),N=d(()=>{c(new Set),u(new Set)},[]),E=d(t=>{(async()=>{const n=t.add.map(e=>Vh(e,g)).filter(e=>!!e),o=t.remove.map(e=>Vh(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,n)=>{const i=e.customInstrumentations??{};let o=[...i[We.Golang]??[]],a=[...i[We.Java]??[]];for(const e of n)e.golang&&(o=o.filter(t=>!Gh(t,e.golang))),e.java&&(a=a.filter(t=>!Wh(t,e.java)));for(const e of t)e.golang&&!o.some(t=>Gh(t,e.golang))&&o.push(e.golang),e.java&&!a.some(t=>Wh(t,e.java))&&a.push(e.java);return{customInstrumentations:{[We.Golang]:o,[We.Java]:a},isEmpty:0===o.length&&0===a.length}})(v,n,o);t?await i.remove(v.ruleId,Ye.CustomInstrumentation):await i.update(v.ruleId,((e,t)=>({ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}))(v,e),Ye.CustomInstrumentation)}else n.length>0&&await i.create(((e,t)=>{const n=e.map(e=>e.golang).filter(e=>!!e),i=e.map(e=>e.java).filter(e=>!!e),o={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:Uh,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:o,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[We.Golang]:n,[We.Java]:i}}})(n,e),Ye.CustomInstrumentation)})()},[v,g,e,i]),$=d(()=>{T&&m({add:x,remove:w})},[T,x,w]),O=d(e=>m({add:[e],remove:[]}),[]),A=d(e=>m({add:[],remove:[e]}),[]),R=d(()=>m(null),[]),D=d(()=>{h&&(E(h),m(null),N())},[h,E,N]),P=d(e=>C.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[C]);return{instrumentation:o(()=>({getSymbolState:P,onAdd:O,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[P,O,A,y,k,I]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:$,resetSelection:N,confirmModify:D}}({source:n,languages:F,rows:A}),[G,W]=l(null),[K,Y]=l(0),[J,q]=l(null),Z=d(e=>{W(e),Y(e=>e+1),f(e=>e===tm.Flame?tm.Both:e)},[]),Q=d(e=>{q(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const n=new Set(t);if(e.every(e=>n.has(e)))return t}return e})},[]),oe=d(()=>W(null),[]);return!$&&N?t(ft,{$height:"70vh",children:t(St,{withSpinner:!0})}):e(nm,{$gap:0,$width:"100%",children:[e(im,{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(om,{children:t(ee,{size:te.S,weight:500,color:ne.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(ie,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(vn,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:s.v2.colors.silver[900],emphasizeBackgroundColor:s.v2.colors.silver[800]})}),t(ve,{variant:Un.Filled,options:[{value:tm.Table,label:"Top table"},{value:tm.Flame,label:"Flame graph"},{value:tm.Both,label:"Both"}],selected:g,setSelected:f}),t(Te,h?{variant:Ie.Secondary,size:ke.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(nr,{...e,size:8,fill:s.v2.colors.green[500]})}:{variant:Ie.Secondary,size:ke.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(nr,{...e,size:8,fill:s.v2.colors.red[500]})})]})]}),t(am,{$gap:R&&D?16:0,children:O?e(r,{children:[R&&e(lm,{$splitWithFlame:P,children:[e(sm,{$justifyContent:"space-between",children:[e(ae,{$margin:"0 0 0 20px",children:[t(ee,{size:te.XXXS,nowrap:!0,children:"Please select symbols to"}),e(ie,{$gap:8,children:[e(ie,{children:[t(ir,{size:24}),t(ee,{size:te.S,color:ne.Success,nowrap:!0,children:"Custom Instrument"})]}),t(Te,{leftIcon:bl,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${_e}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(ie,{$gap:8,children:[J&&t(Be,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(ce,{label:`Zoomed: ${J.length} symbols`,backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS})}),t(Te,{variant:Ie.Secondary,size:ke.S,label:"Download snapshot",rightIcon:or,onClick:()=>{if(!$)return;const e=new Blob([$],{type:"application/json"}),t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,i.click(),URL.revokeObjectURL(t)},disabled:!$})]})]}),t(em,{rows:A,languages:F,instrumentation:M,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),D&&e(rm,{$splitWithTable:P,children:[e(sm,{$justifyContent:"space-between",children:[t(ce,{label:O?`Total in view ${kh(O.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS}),e(ie,{$gap:12,children:[!h&&t(Te,{variant:Ie.Secondary,size:ke.S,label:"Refresh",leftIcon:Bl,onClick:E}),t(ge,{label:"Auto refresh",labelAlign:fe.Left,size:Et.S,value:h,onChange:m})]})]}),t(Xh,{flamebearer:O.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:z,minHostHeight:280,onFullscreenChange:i,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:oe})]})]}):t(ft,{children:t(Oe,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(wh,{pendingModify:B,onClose:U,onConfirm:j}),t(jn,{isOpen:X>0,richTitle:{icon:Ol,title:"Profiling Symbols",badge:{label:X}},actions:[{id:"profiling-bulk-cancel",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Modify Rule",leftIcon:yl,onClick:V}}]})]})},dm=b.div`
|
|
734
734
|
position: relative;
|
|
735
735
|
display: flex;
|
|
736
736
|
align-items: center;
|
|
@@ -738,23 +738,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
738
738
|
padding: 8px 16px;
|
|
739
739
|
border-radius: 12px;
|
|
740
740
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
741
|
-
`,
|
|
741
|
+
`,pm=b.div`
|
|
742
742
|
display: flex;
|
|
743
743
|
flex-direction: column;
|
|
744
744
|
gap: 4px;
|
|
745
745
|
flex: 1;
|
|
746
746
|
min-width: 0;
|
|
747
747
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
748
|
-
`,
|
|
748
|
+
`,um=b.div`
|
|
749
749
|
flex-shrink: 0;
|
|
750
750
|
display: flex;
|
|
751
751
|
align-items: center;
|
|
752
752
|
margin-right: ${({$reserveJumpSpace:e})=>e?"32px":"0"};
|
|
753
|
-
`,
|
|
753
|
+
`,hm=b.div`
|
|
754
754
|
min-width: 0;
|
|
755
755
|
white-space: pre;
|
|
756
756
|
overflow-x: auto;
|
|
757
|
-
`,
|
|
757
|
+
`,mm=b.div`
|
|
758
758
|
position: absolute;
|
|
759
759
|
top: 50%;
|
|
760
760
|
right: 8px;
|
|
@@ -763,41 +763,41 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
763
763
|
pointer-events: none;
|
|
764
764
|
transition: opacity 0.15s ease;
|
|
765
765
|
|
|
766
|
-
${
|
|
766
|
+
${dm}:hover & {
|
|
767
767
|
opacity: 1;
|
|
768
768
|
pointer-events: auto;
|
|
769
769
|
}
|
|
770
|
-
`,
|
|
770
|
+
`,gm=({name:n,summary:i,disabled:o=!1,onJumpToRule:a})=>{const l=v();return e(dm,{children:[e(pm,{$disabled:o,children:[n&&t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:n}),t(hm,{children:t(w,{parts:i})})]}),o&&t(um,{$reserveJumpSpace:!!a,children:t(ce,{label:Gn,textSize:te.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(mm,{children:t(Be,{text:nt.OPEN_IN_SAMPLING_PAGE,children:t(Te,{"data-id":"sampling-rule-jump",variant:Ie.Primary,size:ke.S,leftIcon:er,onClick:a})})})]})},fm=b.div`
|
|
771
771
|
opacity: 0;
|
|
772
772
|
pointer-events: none;
|
|
773
773
|
transition: opacity 0.15s ease;
|
|
774
|
-
`,
|
|
775
|
-
&:hover ${
|
|
774
|
+
`,bm=b.div`
|
|
775
|
+
&:hover ${fm} {
|
|
776
776
|
opacity: 1;
|
|
777
777
|
pointer-events: auto;
|
|
778
778
|
}
|
|
779
|
-
`,
|
|
779
|
+
`,vm=b.div`
|
|
780
780
|
display: flex;
|
|
781
781
|
align-items: center;
|
|
782
782
|
padding: 4px 12px;
|
|
783
|
-
`,vm=({source:e,onRedirectToSampling:n})=>t(Gt,{bgTint:"1000",richTitle:{title:nt.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(Sm,{container:e,onRedirectToSampling:n},e.containerName))});var ym;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(ym||(ym={}));const Cm=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],Sm=({container:n,onRedirectToSampling:i})=>{const[a,r]=l(ym.All),s=Cn(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=o(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),p=o(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=o(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=o(()=>a===ym.Noisy?d:a===ym.HighlyRelevant?p:a===ym.CostReduction?u:[...d,...p,...u],[a,p,u]),m=d.length+p.length+u.length,g=o(()=>(e,t)=>{s({ruleId:e,category:t}),i()},[i,s]),f=t(gm,{children:t(Te,{"data-id":"sampling-container-create-rule",variant:Ie.Secondary,size:ke.S,label:Wn,rightIcon:gl,onClick:e=>{e.stopPropagation(),i()}})});return t(fm,{children:e(Gt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Gt,{bgTint:"800",richTitle:{title:nt.HEAD_SAMPLING,badge:{label:c.length}},children:[t(ee,{size:te.XXS,children:nt.NOISY_OPERATIONS}),t(ae,{$gap:4,children:c.map(e=>t(mm,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(bm,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.HEAD_SAMPLING})}),m?e(Gt,{bgTint:"800",richTitle:{title:nt.TAIL_SAMPLING,badge:{label:m}},children:[t(ve,{options:(b=d.length,v=p.length,y=u.length,[{value:ym.All,label:"All",badge:{label:b+v+y,textSize:te.XXXS}},{value:ym.Noisy,label:nt.NOISY_OPERATIONS,badge:{label:b,textSize:te.XXXS}},{value:ym.HighlyRelevant,label:nt.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:te.XXXS}},{value:ym.CostReduction,label:nt.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:te.XXXS}}]),selected:a,setSelected:r}),t(ae,{$gap:4,children:h.length?h.map(e=>t(mm,{name:e.rule.name,summary:Cm(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Oe,{title:`No ${a===ym.All?`${ym.Noisy}, ${ym.HighlyRelevant} and ${ym.CostReduction}`:a} operations`})})]}):t(bm,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.TAIL_SAMPLING})})]})});var b,v,y},xm=[In.Deployment,In.StatefulSet,In.DaemonSet,In.DeploymentConfig,In.Rollout,In.Pod];var wm;(e=>{e.Workload="Workload",e.Pod="Pod"})(wm||(wm={}));const Tm=e=>!!e&&pn(e.status)===Pe.Error,km=e=>Tm(e.healthStatus),Im=e=>Tm(e.odigosHealthStatus)||(e.processes??[]).some(km),Nm=e=>Tm(e.agentInjectedStatus)||Tm(e.odigosHealthStatus)||(e.containers??[]).some(Im),Em=({onClose:n,sourceId:i,onRedirectToSampling:r})=>{const s=v(),{isK8s:c,isVm:u,platformType:h}=S(),{selectedStreamName:m}=it(),{sourcesApi:g,configApi:f,capabilities:b}=qr(),{genericForm:y,loadSource:C,validateFormData:x}=ts(),{data:w}=f.useEffectiveConfig(),[T,k]=l(!1),[I,N]=l(!1),[E,$]=l(!1),[O,A]=l(ou.Overview),[R,D]=l(null),[P,_]=l({openFor:null}),L=(()=>{const[e,t]=l(null),n=d(e=>{t({tab:ou.Pods,podName:e.podName})},[]),i=d((e,n)=>{t({tab:ou.Pods,podName:e.podName,containerName:n.containerName})},[]),a=d((e,n,i)=>{const o=du({identifyingAttributes:i.identifyingAttributes});t({tab:ou.Pods,podName:e.podName,containerName:n.containerName,processPid:o})},[]),r=d(()=>t(null),[]);return o(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:i,jumpToProcess:a,clearJumpToTarget:r}),[e,n,i,a,r])})();a(()=>{L.jumpToTarget&&A(L.jumpToTarget.tab)},[L.jumpToTarget]),a(()=>{R&&JSON.stringify(Sn(i))!==JSON.stringify(Sn(R))&&D(null)},[i,R]);const F=p(!1),z=d(async()=>D(await g.fetchById(i)||null),[i,g]);a(()=>{if(F.current||(z(),F.current=!0),!T){const e=setInterval(()=>z(),3e3);return()=>clearInterval(e)}},[z,T]),a(()=>{R&&C(R)},[R]);const M=R&&xm.includes(R.id.kind),X=o(()=>{const e=[],n=(R?.pods??[]).some(Nm),i=(o=R,(o?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var o;const a=e=>t(jl,{...e,fill:s.v2.colors.red[500]});return e.push({value:ou.Overview,label:nt.OVERVIEW}),c?(e.push({value:ou.Pods,label:nt.PODS,icon:n?a:void 0}),e.push({value:ou.Libraries,label:nt.LIBRARIES,icon:i?a:void 0}),e.push({value:ou.PeerSources,label:nt.PEER_SOURCES}),w?.profiling?.enabled&&e.push({value:ou.Profiling,label:nt.PROFILING}),e.push({value:ou.Sampling,label:nt.SAMPLING}),e.push({value:ou.Debug,label:nt.DEBUG}),e):(u&&b.canFetchProfiling&&e.push({value:ou.Profiling,label:nt.PROFILING}),e)},[c,u,b.canFetchProfiling,w,R?.pods,s]),B=d(()=>k(!0),[]),U=o(()=>()=>{n(),r()},[n,r]),V=d(()=>{R&&C(R),k(!1)},[R]),H=d(async()=>{if(!R||!y)return;const{errorMessage:e,preparedFormData:t}=x();if(e)return;const n=t.otelServiceName!==R.id.name?t.otelServiceName:"";await g.update(i,{...t,otelServiceName:n}),k(!1)},[R,y,x,i,g]),j=!1===R?.markedForInstrumentation?.markedForInstrumentation,G=d(()=>N(!0),[]),W=d(async()=>{if(!R)return;const e=!1===R.markedForInstrumentation?.markedForInstrumentation;await g.persistV2({[Rt]:[{namespace:R.id.namespace,name:R.id.name,kind:R.id.kind,...R.id.region?{region:R.id.region}:{},selected:e,currentStreamName:m}]}),N(!1),e||n()},[R,g,m,n]),K=d(()=>{_({openFor:wm.Workload})},[]),Y=d(e=>{A(e),L.clearJumpToTarget()},[L]),J=d(async()=>{await g.recoverFromRollback(i)},[g,i]),q=d(()=>_({openFor:null}),[]),Z=d(async()=>{P.openFor===wm.Workload?await g.restartWorkloads([i]):P.openFor===wm.Pod&&P.podNamespace&&P.podName&&await g.restartPod(P.podNamespace,P.podName),q()},[P,g,i,q]),Q=o(()=>{const{kind:e,name:t}=i;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[i]),ee=o(()=>{const e=[];return T||O===ou.Overview&&(e.push({id:"edit-source-btn-edit",label:Ft.EDIT,icon:yl,active:T,onClick:B}),c&&M&&e.push({id:"edit-source-btn-restart",label:nt.ROLLOUT_RESTART,icon:ql,onClick:K}),e.push(j?{id:"edit-source-btn-instrument",label:Ft.INSTRUMENT,icon:gl,color:s.v2.colors.green[500],active:I,onClick:G}:{id:"edit-source-btn-delete",label:Ft.UNINSTRUMENT,icon:ml,color:s.v2.colors.red[500],active:I,onClick:G})),e},[O,T,I,j,c,M,B,K,G,s]),ne=o(()=>{if(!R)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:R.id.name,leftIcon:c?Hl:void 0}),R.serviceName&&R.serviceName!==R.id.name&&e.push({...t,label:R.serviceName,leftIcon:zl,textColor:s.v2.colors.silver[200]}),e},[R,s,c]);if(!R)return t(Xt,{isOpen:!0,children:t(ft,{$height:"80vh",children:t(St,{withSpinner:!0})})});const ie=O===ou.Profiling?E?"95vw":"fit-content":T?void 0:"60vw",oe=c?Yn(R.containers)[0]:Kn(h);return e(yu,{value:L,children:[t(Xt,{isOpen:!0,width:ie,minWidth:"min(1100px, 100vw)",header:{icon:oe,titleBadges:ne,onClose:()=>{Y(ou.Overview),D(null),$(!1),n()},actions:ee},footer:{actions:T?[{"data-id":"edit-source-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:V},{"data-id":"edit-source-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:H}]:[]},children:t(le,{$padding:"4px 12px 12px",children:e(ae,{$gap:16,children:[!T&&X.length>1&&t(ve,{options:X,selected:O,setSelected:Y}),(()=>{switch(O){case ou.Overview:return T?t(wc,{}):t(vh,{source:R,onClickRollout:K,onClickRollback:J});case ou.Pods:return t(Tu,{source:R,onClickRestartPod:M?(e,t)=>_({openFor:wm.Pod,podNamespace:e,podName:t}):void 0});case ou.Libraries:return t(yh,{source:R});case ou.PeerSources:return t(Iu,{source:R});case ou.Profiling:return t(sm,{source:R,onFlameFullscreenChange:$});case ou.Sampling:return t(vm,{source:R,onRedirectToSampling:U});case ou.Debug:return t(Au,{source:R});default:return null}})()]})})}),t(Vr,{target:"source",action:j?"instrument":"uninstrument",isOpen:I,onClose:()=>N(!1),onApprove:W}),t(tt,{isOpen:P.openFor===wm.Workload,title:Q.title,description:Q.description,onClose:q,denyButton:{label:"Go back",variant:Ie.Secondary,onClick:q},approveButton:{label:Ft.CONFIRM,variant:Ie.Primary,onClick:Z}}),t(Vr,{target:"pod",action:"restart",description:nt.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:P.openFor===wm.Pod,onClose:q,onApprove:Z,overrideApproveButtonLabel:nt.DELETE_POD_TO_RESTART})]})},$m={"Cost Optimization":{icon:sr,status:Pe.Warning},Normalization:{icon:rr,status:Pe.Default},Enrichment:{icon:lr,status:Pe.Info},Maintenance:{icon:Bl,status:Pe.Warning},Reliability:{icon:Ol,status:Pe.Success},Usability:{icon:ar,status:Pe.Info}},Om={icon:cr,status:Pe.Unknown},Am={[Jn.Recommended]:Pe.Info,[Jn.Applied]:Pe.Success,[Jn.Dismissed]:Pe.Disabled,[Jn.NotApplicable]:Pe.Unknown},Rm="Created from recommendation",Dm={[Zn.EnableUrlTemplatization]:()=>({type:$e.URLTemplatization,name:"URL Templatization",notes:Rm,disabled:!1,signals:[Le.Traces],fields:{}}),[Zn.EnableInferDbAttributes]:()=>({type:$e.InferDbAttributes,name:"Infer DB Attributes",notes:Rm,disabled:!1,signals:[Le.Traces],fields:{}})},Pm=e=>e.applyExamples.some(({type:e})=>e===qn.OdigosAction),_m=e=>Pm(e)?Dm[e.type]?.():void 0,Lm=e=>e.applied?Jn.Applied:e.conditionsMet?e.dismissed?Jn.Dismissed:Jn.Recommended:Jn.NotApplicable,Fm=e=>{const t={[Jn.Recommended]:[],[Jn.Applied]:[],[Jn.Dismissed]:[],[Jn.NotApplicable]:[]};for(const n of e)t[Lm(n)].push(n);return t},zm=e=>{let t=0;for(const n of e)Lm(n)===Jn.Recommended&&(t+=1);return t},Mm=[Jn.Recommended,Jn.Applied,Jn.Dismissed,Jn.NotApplicable],Xm={[qn.HelmValues]:"Helm values",[qn.OdigosAction]:"Odigos Action"},Bm=({remediations:n})=>{const i=n.flatMap(e=>e.applyExamples.map((t,i)=>({key:`${e.type}-${t.type}-${i}`,title:n.length>1?`${Xm[t.type]||t.type} — ${e.buttonText}`:Xm[t.type]||t.type,content:t.content})));return i.length?e(ae,{$gap:8,children:[e(ae,{$gap:2,children:[t(ee,{size:te.XS,color:ne.Primary,weight:500,children:Qn}),t(ee,{size:te.XXS,color:ne.Secondary,children:ei})]}),i.map(e=>t(Hr,{title:e.title,yaml:e.content,compact:!0},e.key))]}):null},Um=({recommendation:n,onApplyServerRemediation:i,onCreateAction:o,onApplied:a})=>{const[r,s]=l(),c=n.remediations.filter(e=>Pm(e)?!!_m(e)&&!!o:!!i);return c.length?e(ae,{$gap:8,children:[e(ae,{$gap:2,children:[t(ee,{size:te.XS,color:ne.Primary,weight:500,children:ti}),t(ee,{size:te.XXS,color:ne.Secondary,children:ni})]}),t(De,{status:Pe.Default,message:ii,fullWidth:!0,smallIcon:!0}),t(ie,{$gap:8,$wrap:"wrap",children:c.map(e=>t(Te,{"data-id":`apply-recommendation-${e.type}`,label:e.buttonText,tooltip:e.tooltip,size:ke.S,variant:Ie.Primary,loading:r===e.type,disabled:!!r,onClick:()=>(async e=>{if(!r){s(e.type);try{(Pm(e)?await(o?.(e)):await(i?.(e.type)))&&a?.()}finally{s(void 0)}}})(e)},e.type))})]}):null};var Vm;(e=>{e.Ui="ui",e.GitOps="gitops"})(Vm||(Vm={}));const Hm=({recommendation:n,onDismiss:i,onAcceptedChange:o,onApplyServerRemediation:r,onCreateAction:s,onApplied:c})=>{const p=!n.requireOdigosDeployment&&n.remediations.some(e=>Pm(e)?!!_m(e)&&!!s:!!r),u=n.remediations.some(({applyExamples:e})=>e.length>0),[h,m]=l(!1),[g,f]=l(!1),[b,v]=l(()=>p?Vm.Ui:Vm.GitOps),y=[...p?[{value:Vm.Ui,label:ci}]:[],...u?[{value:Vm.GitOps,label:di}]:[]],C=y.length>1;a(()=>()=>o?.(!1),[o]);const S=d(()=>{m(!0),o?.(!0)},[o]),x=d(async()=>{if(i&&!g){f(!0);try{await i(n.name,!0)}finally{f(!1)}}},[g,i,n.name]);return p||u?e(ae,{$gap:0,children:[t(jr,{open:!h,gapCancelPx:0,children:e(ae,{$gap:12,children:[e(ae,{$gap:4,children:[t(ee,{size:te.XS,color:ne.Primary,weight:500,children:oi}),t(ee,{size:te.XXS,color:ne.Secondary,children:ai})]}),e(ie,{$gap:8,children:[t(Te,{"data-id":"recommendation-accept",label:li,size:ke.S,variant:Ie.Primary,onClick:S}),i&&t(Te,{"data-id":"recommendation-dismiss",label:ri,size:ke.S,variant:Ie.Secondary,disabled:g,onClick:x})]})]})}),t(jr,{open:h,delayInMs:40,children:e(ae,{$gap:20,children:[C&&e(ae,{$gap:4,children:[t(ee,{size:te.XS,color:ne.Primary,weight:500,children:oi}),t(ee,{size:te.XXS,color:ne.Secondary,children:si}),t(ve,{"data-id":"recommendation-installation-method",size:zt.S,fullWidth:!0,selected:b,setSelected:v,options:y})]}),b===Vm.Ui&&p?t(Um,{recommendation:n,onApplyServerRemediation:r,onCreateAction:s,onApplied:c}):t(Bm,{remediations:n.remediations})]})})]}):null},jm=b.ul`
|
|
783
|
+
`,ym=({source:e,onRedirectToSampling:n})=>t(Gt,{bgTint:"1000",richTitle:{title:nt.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(xm,{container:e,onRedirectToSampling:n},e.containerName))});var Cm;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(Cm||(Cm={}));const Sm=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],xm=({container:n,onRedirectToSampling:i})=>{const[a,r]=l(Cm.All),s=Cn(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=o(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),p=o(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=o(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=o(()=>a===Cm.Noisy?d:a===Cm.HighlyRelevant?p:a===Cm.CostReduction?u:[...d,...p,...u],[a,p,u]),m=d.length+p.length+u.length,g=o(()=>(e,t)=>{s({ruleId:e,category:t}),i()},[i,s]),f=t(fm,{children:t(Te,{"data-id":"sampling-container-create-rule",variant:Ie.Secondary,size:ke.S,label:Wn,rightIcon:gl,onClick:e=>{e.stopPropagation(),i()}})});return t(bm,{children:e(Gt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Gt,{bgTint:"800",richTitle:{title:nt.HEAD_SAMPLING,badge:{label:c.length}},children:[t(ee,{size:te.XXS,children:nt.NOISY_OPERATIONS}),t(ae,{$gap:4,children:c.map(e=>t(gm,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(vm,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.HEAD_SAMPLING})}),m?e(Gt,{bgTint:"800",richTitle:{title:nt.TAIL_SAMPLING,badge:{label:m}},children:[t(ve,{options:(b=d.length,v=p.length,y=u.length,[{value:Cm.All,label:"All",badge:{label:b+v+y,textSize:te.XXXS}},{value:Cm.Noisy,label:nt.NOISY_OPERATIONS,badge:{label:b,textSize:te.XXXS}},{value:Cm.HighlyRelevant,label:nt.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:te.XXXS}},{value:Cm.CostReduction,label:nt.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:te.XXXS}}]),selected:a,setSelected:r}),t(ae,{$gap:4,children:h.length?h.map(e=>t(gm,{name:e.rule.name,summary:Sm(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Oe,{title:`No ${a===Cm.All?`${Cm.Noisy}, ${Cm.HighlyRelevant} and ${Cm.CostReduction}`:a} operations`})})]}):t(vm,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.TAIL_SAMPLING})})]})});var b,v,y},wm=[In.Deployment,In.StatefulSet,In.DaemonSet,In.DeploymentConfig,In.Rollout,In.Pod];var Tm;(e=>{e.Workload="Workload",e.Pod="Pod"})(Tm||(Tm={}));const km=e=>!!e&&pn(e.status)===Pe.Error,Im=e=>km(e.healthStatus),Nm=e=>km(e.odigosHealthStatus)||(e.processes??[]).some(Im),Em=e=>km(e.agentInjectedStatus)||km(e.odigosHealthStatus)||(e.containers??[]).some(Nm),$m=({onClose:n,sourceId:i,onRedirectToSampling:r})=>{const s=v(),{isK8s:c,isVm:u,platformType:h}=S(),{selectedStreamName:m}=it(),{sourcesApi:g,configApi:f,capabilities:b}=qr(),{genericForm:y,loadSource:C,validateFormData:x}=ts(),{data:w}=f.useEffectiveConfig(),[T,k]=l(!1),[I,N]=l(!1),[E,$]=l(!1),[O,A]=l(ou.Overview),[R,D]=l(null),[P,_]=l({openFor:null}),L=(()=>{const[e,t]=l(null),n=d(e=>{t({tab:ou.Pods,podName:e.podName})},[]),i=d((e,n)=>{t({tab:ou.Pods,podName:e.podName,containerName:n.containerName})},[]),a=d((e,n,i)=>{const o=du({identifyingAttributes:i.identifyingAttributes});t({tab:ou.Pods,podName:e.podName,containerName:n.containerName,processPid:o})},[]),r=d(()=>t(null),[]);return o(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:i,jumpToProcess:a,clearJumpToTarget:r}),[e,n,i,a,r])})();a(()=>{L.jumpToTarget&&A(L.jumpToTarget.tab)},[L.jumpToTarget]),a(()=>{R&&JSON.stringify(Sn(i))!==JSON.stringify(Sn(R))&&D(null)},[i,R]);const F=p(!1),z=d(async()=>D(await g.fetchById(i)||null),[i,g]);a(()=>{if(F.current||(z(),F.current=!0),!T){const e=setInterval(()=>z(),3e3);return()=>clearInterval(e)}},[z,T]),a(()=>{R&&C(R)},[R]);const M=R&&wm.includes(R.id.kind),X=o(()=>{const e=[],n=(R?.pods??[]).some(Em),i=(o=R,(o?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var o;const a=e=>t(jl,{...e,fill:s.v2.colors.red[500]});return e.push({value:ou.Overview,label:nt.OVERVIEW}),c?(e.push({value:ou.Pods,label:nt.PODS,icon:n?a:void 0}),e.push({value:ou.Libraries,label:nt.LIBRARIES,icon:i?a:void 0}),e.push({value:ou.PeerSources,label:nt.PEER_SOURCES}),w?.profiling?.enabled&&e.push({value:ou.Profiling,label:nt.PROFILING}),e.push({value:ou.Sampling,label:nt.SAMPLING}),e.push({value:ou.Debug,label:nt.DEBUG}),e):(u&&b.canFetchProfiling&&e.push({value:ou.Profiling,label:nt.PROFILING}),e)},[c,u,b.canFetchProfiling,w,R?.pods,s]),B=d(()=>k(!0),[]),U=o(()=>()=>{n(),r()},[n,r]),V=d(()=>{R&&C(R),k(!1)},[R]),H=d(async()=>{if(!R||!y)return;const{errorMessage:e,preparedFormData:t}=x();if(e)return;const n=t.otelServiceName!==R.id.name?t.otelServiceName:"";await g.update(i,{...t,otelServiceName:n}),k(!1)},[R,y,x,i,g]),j=!1===R?.markedForInstrumentation?.markedForInstrumentation,G=d(()=>N(!0),[]),W=d(async()=>{if(!R)return;const e=!1===R.markedForInstrumentation?.markedForInstrumentation;await g.persistV2({[Rt]:[{namespace:R.id.namespace,name:R.id.name,kind:R.id.kind,...R.id.region?{region:R.id.region}:{},selected:e,currentStreamName:m}]}),N(!1),e||n()},[R,g,m,n]),K=d(()=>{_({openFor:Tm.Workload})},[]),Y=d(e=>{A(e),L.clearJumpToTarget()},[L]),J=d(async()=>{await g.recoverFromRollback(i)},[g,i]),q=d(()=>_({openFor:null}),[]),Z=d(async()=>{P.openFor===Tm.Workload?await g.restartWorkloads([i]):P.openFor===Tm.Pod&&P.podNamespace&&P.podName&&await g.restartPod(P.podNamespace,P.podName),q()},[P,g,i,q]),Q=o(()=>{const{kind:e,name:t}=i;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[i]),ee=o(()=>{const e=[];return T||O===ou.Overview&&(e.push({id:"edit-source-btn-edit",label:Ft.EDIT,icon:yl,active:T,onClick:B}),c&&M&&e.push({id:"edit-source-btn-restart",label:nt.ROLLOUT_RESTART,icon:ql,onClick:K}),e.push(j?{id:"edit-source-btn-instrument",label:Ft.INSTRUMENT,icon:gl,color:s.v2.colors.green[500],active:I,onClick:G}:{id:"edit-source-btn-delete",label:Ft.UNINSTRUMENT,icon:ml,color:s.v2.colors.red[500],active:I,onClick:G})),e},[O,T,I,j,c,M,B,K,G,s]),ne=o(()=>{if(!R)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:R.id.name,leftIcon:c?Hl:void 0}),R.serviceName&&R.serviceName!==R.id.name&&e.push({...t,label:R.serviceName,leftIcon:zl,textColor:s.v2.colors.silver[200]}),e},[R,s,c]);if(!R)return t(Xt,{isOpen:!0,children:t(ft,{$height:"80vh",children:t(St,{withSpinner:!0})})});const ie=O===ou.Profiling?E?"95vw":"fit-content":T?void 0:"60vw",oe=c?Yn(R.containers)[0]:Kn(h);return e(yu,{value:L,children:[t(Xt,{isOpen:!0,width:ie,minWidth:"min(1100px, 100vw)",header:{icon:oe,titleBadges:ne,onClose:()=>{Y(ou.Overview),D(null),$(!1),n()},actions:ee},footer:{actions:T?[{"data-id":"edit-source-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:V},{"data-id":"edit-source-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:H}]:[]},children:t(le,{$padding:"4px 12px 12px",children:e(ae,{$gap:16,children:[!T&&X.length>1&&t(ve,{options:X,selected:O,setSelected:Y}),(()=>{switch(O){case ou.Overview:return T?t(wc,{}):t(yh,{source:R,onClickRollout:K,onClickRollback:J});case ou.Pods:return t(Tu,{source:R,onClickRestartPod:M?(e,t)=>_({openFor:Tm.Pod,podNamespace:e,podName:t}):void 0});case ou.Libraries:return t(Ch,{source:R});case ou.PeerSources:return t(Iu,{source:R});case ou.Profiling:return t(cm,{source:R,onFlameFullscreenChange:$});case ou.Sampling:return t(ym,{source:R,onRedirectToSampling:U});case ou.Debug:return t(Au,{source:R});default:return null}})()]})})}),t(Vr,{target:"source",action:j?"instrument":"uninstrument",isOpen:I,onClose:()=>N(!1),onApprove:W}),t(tt,{isOpen:P.openFor===Tm.Workload,title:Q.title,description:Q.description,onClose:q,denyButton:{label:"Go back",variant:Ie.Secondary,onClick:q},approveButton:{label:Ft.CONFIRM,variant:Ie.Primary,onClick:Z}}),t(Vr,{target:"pod",action:"restart",description:nt.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:P.openFor===Tm.Pod,onClose:q,onApprove:Z,overrideApproveButtonLabel:nt.DELETE_POD_TO_RESTART})]})},Om={"Cost Optimization":{icon:sr,status:Pe.Warning},Normalization:{icon:rr,status:Pe.Default},Enrichment:{icon:lr,status:Pe.Info},Maintenance:{icon:Bl,status:Pe.Warning},Reliability:{icon:Ol,status:Pe.Success},Usability:{icon:ar,status:Pe.Info}},Am={icon:cr,status:Pe.Unknown},Rm={[Jn.Recommended]:Pe.Info,[Jn.Applied]:Pe.Success,[Jn.Dismissed]:Pe.Disabled,[Jn.NotApplicable]:Pe.Unknown},Dm="Created from recommendation",Pm={[Zn.EnableUrlTemplatization]:()=>({type:$e.URLTemplatization,name:"URL Templatization",notes:Dm,disabled:!1,signals:[Le.Traces],fields:{}}),[Zn.EnableInferDbAttributes]:()=>({type:$e.InferDbAttributes,name:"Infer DB Attributes",notes:Dm,disabled:!1,signals:[Le.Traces],fields:{}})},_m=e=>e.applyExamples.some(({type:e})=>e===qn.OdigosAction),Lm=e=>_m(e)?Pm[e.type]?.():void 0,Fm=e=>e.applied?Jn.Applied:e.conditionsMet?e.dismissed?Jn.Dismissed:Jn.Recommended:Jn.NotApplicable,zm=e=>{const t={[Jn.Recommended]:[],[Jn.Applied]:[],[Jn.Dismissed]:[],[Jn.NotApplicable]:[]};for(const n of e)t[Fm(n)].push(n);return t},Mm=e=>{let t=0;for(const n of e)Fm(n)===Jn.Recommended&&(t+=1);return t},Xm=[Jn.Recommended,Jn.Applied,Jn.Dismissed,Jn.NotApplicable],Bm={[qn.HelmValues]:"Helm values",[qn.OdigosAction]:"Odigos Action"},Um=({remediations:n})=>{const i=n.flatMap(e=>e.applyExamples.map((t,i)=>({key:`${e.type}-${t.type}-${i}`,title:n.length>1?`${Bm[t.type]||t.type} — ${e.buttonText}`:Bm[t.type]||t.type,content:t.content})));return i.length?e(ae,{$gap:8,children:[e(ae,{$gap:2,children:[t(ee,{size:te.XS,color:ne.Primary,weight:500,children:Qn}),t(ee,{size:te.XXS,color:ne.Secondary,children:ei})]}),i.map(e=>t(Hr,{title:e.title,yaml:e.content,compact:!0},e.key))]}):null},Vm=({recommendation:n,onApplyServerRemediation:i,onCreateAction:o,onApplied:a})=>{const[r,s]=l(),c=n.remediations.filter(e=>_m(e)?!!Lm(e)&&!!o:!!i);return c.length?e(ae,{$gap:8,children:[e(ae,{$gap:2,children:[t(ee,{size:te.XS,color:ne.Primary,weight:500,children:ti}),t(ee,{size:te.XXS,color:ne.Secondary,children:ni})]}),t(De,{status:Pe.Default,message:ii,fullWidth:!0,smallIcon:!0}),t(ie,{$gap:8,$wrap:"wrap",children:c.map(e=>t(Te,{"data-id":`apply-recommendation-${e.type}`,label:e.buttonText,tooltip:e.tooltip,size:ke.S,variant:Ie.Primary,loading:r===e.type,disabled:!!r,onClick:()=>(async e=>{if(!r){s(e.type);try{(_m(e)?await(o?.(e)):await(i?.(e.type)))&&a?.()}finally{s(void 0)}}})(e)},e.type))})]}):null};var Hm;(e=>{e.Ui="ui",e.GitOps="gitops"})(Hm||(Hm={}));const jm=({recommendation:n,onDismiss:i,onAcceptedChange:o,onApplyServerRemediation:r,onCreateAction:s,onApplied:c})=>{const p=!n.requireOdigosDeployment&&n.remediations.some(e=>_m(e)?!!Lm(e)&&!!s:!!r),u=n.remediations.some(({applyExamples:e})=>e.length>0),[h,m]=l(!1),[g,f]=l(!1),[b,v]=l(()=>p?Hm.Ui:Hm.GitOps),y=[...p?[{value:Hm.Ui,label:ci}]:[],...u?[{value:Hm.GitOps,label:di}]:[]],C=y.length>1;a(()=>()=>o?.(!1),[o]);const S=d(()=>{m(!0),o?.(!0)},[o]),x=d(async()=>{if(i&&!g){f(!0);try{await i(n.name,!0)}finally{f(!1)}}},[g,i,n.name]);return p||u?e(ae,{$gap:0,children:[t(jr,{open:!h,gapCancelPx:0,children:e(ae,{$gap:12,children:[e(ae,{$gap:4,children:[t(ee,{size:te.XS,color:ne.Primary,weight:500,children:oi}),t(ee,{size:te.XXS,color:ne.Secondary,children:ai})]}),e(ie,{$gap:8,children:[t(Te,{"data-id":"recommendation-accept",label:li,size:ke.S,variant:Ie.Primary,onClick:S}),i&&t(Te,{"data-id":"recommendation-dismiss",label:ri,size:ke.S,variant:Ie.Secondary,disabled:g,onClick:x})]})]})}),t(jr,{open:h,delayInMs:40,children:e(ae,{$gap:20,children:[C&&e(ae,{$gap:4,children:[t(ee,{size:te.XS,color:ne.Primary,weight:500,children:oi}),t(ee,{size:te.XXS,color:ne.Secondary,children:si}),t(ve,{"data-id":"recommendation-installation-method",size:zt.S,fullWidth:!0,selected:b,setSelected:v,options:y})]}),b===Hm.Ui&&p?t(Vm,{recommendation:n,onApplyServerRemediation:r,onCreateAction:s,onApplied:c}):t(Um,{remediations:n.remediations})]})})]}):null},Gm=b.ul`
|
|
784
784
|
margin: 0;
|
|
785
785
|
padding-left: 18px;
|
|
786
786
|
display: flex;
|
|
787
787
|
flex-direction: column;
|
|
788
788
|
gap: 4px;
|
|
789
|
-
`,
|
|
789
|
+
`,Wm=b.li`
|
|
790
790
|
color: ${({theme:e})=>e.v2.colors.grey[300]};
|
|
791
|
-
`,
|
|
791
|
+
`,Km=b.div`
|
|
792
792
|
display: grid;
|
|
793
793
|
grid-template-columns: 1fr;
|
|
794
794
|
gap: 16px;
|
|
795
795
|
width: 100%;
|
|
796
796
|
padding-top: 16px;
|
|
797
797
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
798
|
-
`,
|
|
798
|
+
`,Ym=b(ae)`
|
|
799
799
|
min-width: 0;
|
|
800
|
-
`,
|
|
800
|
+
`,Jm=b.div`
|
|
801
801
|
display: flex;
|
|
802
802
|
align-items: center;
|
|
803
803
|
justify-content: center;
|
|
@@ -806,7 +806,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
806
806
|
flex-shrink: 0;
|
|
807
807
|
border: 1px solid ${({theme:e})=>e.v2.colors.green[600]};
|
|
808
808
|
border-radius: 50%;
|
|
809
|
-
`,
|
|
809
|
+
`,qm=b.div`
|
|
810
810
|
width: 100%;
|
|
811
811
|
min-width: 0;
|
|
812
812
|
|
|
@@ -823,28 +823,28 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
823
823
|
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
|
|
824
824
|
transform: translateY(-1px);
|
|
825
825
|
}
|
|
826
|
-
`,
|
|
826
|
+
`,Zm=b(ie)`
|
|
827
827
|
width: 100%;
|
|
828
828
|
padding-top: 4px;
|
|
829
|
-
`,
|
|
829
|
+
`,Qm=({recommendation:n,state:i,onDismiss:o,onApplyServerRemediation:a,onCreateAction:r,onRemediationApplied:s})=>{const c=v(),[p,u]=l(!1),[h,m]=l(!1),g=i===Jn.NotApplicable?pi:n.summary,f=n.description.trim().split(/\n\s*\n/).map(e=>e.replace(/\s+/g," ").trim()).filter(Boolean),b=(y=n.categories[0])&&Om[y]||Am;var y;const C=i===Jn.Recommended&&n.conditionsMet,S=C&&!h,x=i===Jn.Recommended&&!!o&&!S,w=i===Jn.Dismissed&&!!o,T=i===Jn.Recommended?void 0:{key:i,label:ui[i],status:Rm[i],useSecondaryTone:!0,textSize:te.XXXS},k=d(async()=>{if(o&&!p){u(!0);try{await o(n.name,i!==Jn.Dismissed)}finally{u(!1)}}},[o,p,n.name,i]);return t(qm,{children:t(Gt,{bgTint:"900",moreSpacing:!0,withCollapse:!0,badges:T?[T]:[],richTitle:{icon:b.icon,title:n.title,titleSize:te.S,titleWrap:!0,titleMeta:n.categories.join(" · "),subTitle:g,subTitleSize:te.XXS,subTitleWrap:!0,textGap:6,alignItems:"flex-start"},children:e(ae,{$gap:16,children:[t(jr,{open:!h,gapCancelPx:16,children:e(ae,{$gap:16,children:[f.length>0&&t(ae,{$gap:8,children:f.map(e=>t(ee,{size:te.XS,color:ne.Secondary,lineHeight:"20px",children:e},e))}),(n.pros.length>0||n.cons.length>0)&&e(Km,{children:[n.pros.length>0&&e(Ym,{$gap:8,children:[e(ie,{$gap:8,children:[t(Jm,{children:t(El,{size:10,fill:c.v2.colors.green[600]})}),t(ee,{size:te.XS,weight:400,color:ne.Primary,children:hi})]}),t(Gm,{children:n.pros.slice(0,3).map(e=>t(Wm,{children:t(ee,{size:te.XXS,color:ne.Secondary,variant:$t.Span,children:e})},e))})]}),n.cons.length>0&&e(Ym,{$gap:8,children:[e(ie,{$gap:8,children:[t(jl,{size:18,fill:c.v2.colors.orange[600]}),t(ee,{size:te.XS,weight:400,color:ne.Primary,children:mi})]}),t(Gm,{children:n.cons.slice(0,3).map(e=>t(Wm,{children:t(ee,{size:te.XXS,color:ne.Secondary,variant:$t.Span,children:e})},e))})]})]})]})}),C&&t(jm,{recommendation:n,onDismiss:o,onAcceptedChange:m,onApplyServerRemediation:a,onCreateAction:r,onApplied:s}),e(Zm,{$gap:8,$justifyContent:"flex-end",children:[n.docsUrl&&t(Te,{label:gi,leftIcon:bl,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n.docsUrl,"_blank","noopener noreferrer")}),x&&t(Te,{label:ri,size:ke.S,variant:Ie.Secondary,disabled:p,onClick:k}),w&&t(Te,{label:fi,size:ke.S,variant:Ie.Secondary,disabled:p,onClick:k})]})]})})})},eg=b.div`
|
|
830
830
|
width: 100%;
|
|
831
831
|
min-width: 0;
|
|
832
832
|
max-width: 100%;
|
|
833
833
|
padding: 8px 16px 20px;
|
|
834
|
-
`,
|
|
834
|
+
`,tg=b(ae)`
|
|
835
835
|
opacity: ${({$state:e})=>e===Jn.Applied?.78:1};
|
|
836
836
|
transition: opacity 0.15s ease;
|
|
837
837
|
|
|
838
838
|
&:hover {
|
|
839
839
|
opacity: 1;
|
|
840
840
|
}
|
|
841
|
-
`,
|
|
841
|
+
`,ng=b(ie)`
|
|
842
842
|
width: 100%;
|
|
843
843
|
min-height: 28px;
|
|
844
844
|
padding-left: 10px;
|
|
845
845
|
border-left: 2px solid
|
|
846
846
|
${({theme:e,$state:t})=>t===Jn.Recommended?e.v2.colors.purple[500]:t===Jn.Applied?e.v2.colors.green[500]:e.v2.colors.grey[500]};
|
|
847
|
-
`,
|
|
847
|
+
`,ig=({isOpen:n,onClose:i})=>{const{actionsApi:l,capabilities:r,recommendationsApi:s}=qr(),{items:c,loading:u,refetch:h}=s.useRecommendations(),m=p([]),g=p(h);g.current=h,a(()=>{n&&g.current()},[n]),a(()=>()=>{m.current.forEach(clearTimeout)},[]);const f=d(()=>{m.current.forEach(clearTimeout),m.current=[2e3,5e3,1e4].map(e=>setTimeout(()=>{g.current()},e))},[]),b=d(async(e,t)=>{if(!s.applyRemediation)return!1;const n=await s.applyRemediation(e,t);return!n?.error},[s]),v=d(async e=>{const t=Lm(e);if(!t)return!1;const n=await l.create(t);return!n?.error},[l]),y=o(()=>zm(c),[c]),C=c.length>0;return t(Xt,{isOpen:n,width:"min(700px, 100vw)",header:{icon:cr,title:vi,subTitle:bi,onClose:i},children:t(eg,{children:u&&!C?t(re,{size:3}):C?t(ae,{$gap:28,$width:"100%",children:Xm.map(n=>{const i=y[n];return 0===i.length?null:e(tg,{$state:n,$gap:12,$width:"100%",children:[e(ng,{$state:n,$gap:8,$justifyContent:"space-between",children:[t(ee,{size:te.XS,weight:600,color:n===Jn.Recommended?ne.Primary:ne.Secondary,children:ui[n]}),t(ce,{label:i.length,status:Rm[n],useSecondaryTone:!0,textSize:te.XXXS})]}),t(ae,{$gap:12,$width:"100%",children:i.map(e=>t(Qm,{recommendation:e,state:n,onDismiss:s.setDismissed,onApplyServerRemediation:s.applyRemediation?t=>b(e.type,t):void 0,onCreateAction:r.canCreateAction?v:void 0,onRemediationApplied:f},e.name))})]},n)})}):t(Oe,{icon:cr,title:Ci,subTitle:yi})})})},og=b.div`
|
|
848
848
|
display: flex;
|
|
849
849
|
align-items: center;
|
|
850
850
|
gap: 8px;
|
|
@@ -854,9 +854,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
854
854
|
&:hover {
|
|
855
855
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
856
856
|
}
|
|
857
|
-
`,
|
|
857
|
+
`,ag=b.div`
|
|
858
858
|
flex: 1;
|
|
859
|
-
`,
|
|
859
|
+
`,lg=({onClick:n})=>{const i=v().v2.colors.red[500];return e(og,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(ee,{size:te.XS,weight:500,color:i,children:Ti}),t(ml,{size:16,fill:i})]})};const rg={[is.EditAutoNoisy]:{title:zi,subTitle:Fi,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[is.EditAutoCostReduction]:{title:Li,subTitle:_i,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[is.EditAutoHighlyRelevant]:{title:Pi,subTitle:Di,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},sg=({isOpen:e,title:n,subTitle:i,onClose:o,footer:a,renderBody:l})=>t(Xt,{isOpen:e,width:Xi,header:{icon:sr,title:n,subTitle:i,onClose:o},footer:a,children:l?l():t(le,{$padding:"12px",children:t($c,{})})}),cg=({isOpen:i,onClose:r,onSubmit:s,validateForm:c,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=ns(is.Create),[b,v]=l(!1);a(()=>{i&&(m(),v(!1))},[i]);const y=d(()=>{v(!1),s(h)},[h,s]),C=d(()=>{if(c){const e=c(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(N(t)))(h,u)?v(!0):y()},[h,u,c,f,y]),S=o(()=>b?((e,t)=>{switch(e){case"noisy":return T(O(t));case"highlyRelevant":return k($(t));case"costReduction":return I(E(t))}})(u,h):[],[b,u,h]),x={note:g?{status:Pe.Warning,message:g.message,action:p?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>p(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:Si,variant:Ie.Secondary,size:ke.S,onClick:r},{"data-id":"sampling-create-btn-submit",label:Wn,variant:Ie.Primary,size:ke.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(sg,{isOpen:i,title:Ei[u],subTitle:ki[u],onClose:r,footer:x}),t(tt,{isOpen:b,title:Ai,description:Oi,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:$i,variant:Ie.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Wn,variant:Ie.Primary,onClick:y},children:e(ae,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(ee,{size:te.XS,weight:500,color:ne.Secondary,children:Ri}),t("div",{style:{width:"100%"},children:t(Ar,{summary:S})})]})})]})},dg=({onClose:i,onDelete:a,onSaveEdit:l,validateForm:r,onNavigateToDuplicate:s})=>{const{data:c,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=ns(is.View),b=c?.rule.name||Ni,v=p&&c?Ii[c.category]:`${b} preview`,y=d(()=>{if(c&&p){if(r){const e=r(u);if(e)return void f(e)}l(u,c.rule.ruleId,c.samplingId),m()}},[c,p,u,l,r,f,m]),C=d(()=>{c&&a(c.rule.ruleId,c.samplingId)},[c,a]),S=o(()=>{if(!c)return;const o=g?{message:g.message,onViewRule:s?()=>s(g.ruleId):void 0}:null;return function(i){if(i.isEditing){const{onCancelEdit:o,onSave:a,onDelete:l,duplicateWarning:r}=i;return{children:e(n,{children:[t(lg,{onClick:l}),r&&t(De,{status:Pe.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(ag,{}),t(Te,{"data-id":"sampling-view-edit-btn-cancel",label:Si,variant:Ie.Secondary,size:ke.S,onClick:o}),t(Te,{"data-id":"sampling-view-edit-btn-save",label:xi,variant:Ie.Primary,size:ke.S,onClick:a,disabled:!!r})]})}}const{onDelete:o,onCancel:a,onEdit:l}=i;return{children:e(n,{children:[t(lg,{onClick:o}),t(ag,{}),t(Te,{"data-id":"sampling-view-btn-cancel",label:Si,variant:Ie.Secondary,size:ke.S,onClick:a}),t(Te,{"data-id":"sampling-view-btn-edit",label:wi,variant:Ie.Primary,size:ke.S,onClick:l})]})}}(p?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:o}:{isEditing:!1,onDelete:C,onCancel:i,onEdit:h})},[c,p,g,m,y,C,h,i,s]);return t(sg,{isOpen:!!c,title:v,subTitle:c?ki[c.category]:"",onClose:i,footer:S})},pg=({isOpen:e,onClose:n,onSave:i})=>{const{localEnabled:o,resolvedPercentage:a}=ns(is.EditAutoNoisy),l=d(()=>i(o,a),[i,o,a]);return t(mg,{formType:is.EditAutoNoisy,isOpen:e,onClose:n,onSave:l})},ug=({isOpen:e,onClose:n,onSave:i})=>{const{localEnabled:o,resolvedPercentage:a}=ns(is.EditAutoCostReduction),l=d(()=>i(o,a),[i,o,a]);return t(mg,{formType:is.EditAutoCostReduction,isOpen:e,onClose:n,onSave:l})},hg=({isOpen:e,onClose:n,onSave:i})=>{const{localEnabled:o}=ns(is.EditAutoHighlyRelevant),a=d(()=>i(o),[i,o]);return t(mg,{formType:is.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:a})},mg=({formType:e,isOpen:n,onClose:i,onSave:o})=>{const a=rg[e];return t(sg,{isOpen:n,title:a.title,subTitle:a.subTitle,onClose:i,footer:{actions:[{"data-id":a.cancelId,label:Si,variant:Ie.Secondary,size:ke.S,onClick:i},{"data-id":a.saveId,label:Mi,variant:Ie.Primary,size:ke.S,onClick:o}]}})},gg=e=>{switch(e.formType){case is.Create:return t(ds,{formType:is.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(cg,{...e})});case is.View:return t(ds,{formType:is.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(dg,{...e})});case is.EditAutoNoisy:return t(ds,{formType:is.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(pg,{...e})});case is.EditAutoCostReduction:return t(ds,{formType:is.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(ug,{...e})});case is.EditAutoHighlyRelevant:return t(ds,{formType:is.EditAutoHighlyRelevant,enabled:e.enabled,children:t(hg,{...e})})}},fg=({token:i,isLoading:o,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=_t(),m=!a||o||!c.newToken;return Bi({key:"Enter",active:!m},s),e(ie,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Ne,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(ie,{$margin:o?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:o?t(St,{title:"Saving...",withGradient:!0}):e(n,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,leftIcon:$l,onClick:r,disabled:o}),t(Te,{variant:Ie.Primary,size:ke.S,leftIcon:El,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ee,{size:te.XS,children:new Array(55).fill("•").join("")}),e(ie,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:i}),t(yt,{icon:yl,onClick:l})]})]})},bg=({expiresAt:e,callbackValid:n,callbackExpired:i})=>{const{formatTimeAgo:l}=ln(),r=o(()=>l(e),[e,l]),s=o(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=o(()=>Ui(e,0)?Pe.Error:Ui(e,2592e6)?Pe.Warning:Pe.Success,[e]),d=o(()=>c===Pe.Success?El:c===Pe.Warning?dr:jl,[c]);return a(()=>{c===Pe.Success?n():c===Pe.Error&&i()},[c]),t(Be,{text:s,children:t(ce,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},vg=b.div`
|
|
860
860
|
display: flex;
|
|
861
861
|
flex-direction: column;
|
|
862
862
|
gap: 12px;
|
|
@@ -864,7 +864,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
864
864
|
border-radius: 12px;
|
|
865
865
|
border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
|
|
866
866
|
background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
|
|
867
|
-
`,
|
|
867
|
+
`,yg=({children:e})=>{const n=v();return t(ee,{size:te.XXXS,color:n.v2.colors.grey[150],children:e})},Cg=({token:n})=>{const{tokensApi:i}=qr(),[o,a]=l(!1),[r,s]=l(!1),[c,d]=l(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:m,resetFormData:g}=qt({newToken:""});return t(ut,{richTitle:{icon:pr,title:"Odigos Pro Token"},children:e(vg,{$isExpired:c,children:[e(ie,{$justifyContent:"space-between",children:[e(ae,{$gap:4,children:[t(yg,{children:"Issued for"}),t(ee,{size:te.XS,children:n.name||"N/A"})]}),e(ae,{$gap:4,children:[t(yg,{children:"Expiration"}),t(bg,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ae,{})]}),t(ie,{children:e(ae,{children:[t(yg,{children:"Token"}),t(fg,{token:n.token,newToken:p.newToken,isLoading:o,isEditing:r,onEdit:()=>s(!0),onCancel:()=>(s(!1),void u("newToken","")),onSave:()=>(async()=>{if(!i.updateToken)return;a(!0);const e=await i.updateToken(p.newToken.trim());a(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:p,handleFormChange:u,handleErrorChange:m,formErrors:h})]})})]})})},Sg=b.div`
|
|
868
868
|
display: flex;
|
|
869
869
|
flex-direction: column;
|
|
870
870
|
align-items: center;
|
|
@@ -873,23 +873,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
873
873
|
padding: 12px 24px;
|
|
874
874
|
border-radius: 8px;
|
|
875
875
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
876
|
-
`,Sg=()=>{const{progress:n}=Ot(),{describeApi:i,namespacesApi:o}=qr(),{items:a}=o.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=qt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ut,{richTitle:{icon:ur,title:"Diagnose"},children:r?e(Cg,{children:[t(St,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[Dt.DownloadingDiagnose]?.percentage,percentage:n[Dt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[Dt.DownloadingDiagnose]?.percentage,visualIcon:or,startedAt:r}),n[Dt.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[Dt.DownloadingDiagnose].list.map((n,i)=>e(ie,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(El,{size:16}):n.status===Pe.Error?t($l,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ee,{size:te.XXXS,color:ne.Secondary,children:n.label})]},`diagnose-item-${i}-${n.label}`))})]}):e(ae,{$gap:24,children:[t(ee,{size:te.XXS,color:ne.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(ae,{$gap:16,children:[e(ie,{$gap:8,children:[t(Q,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include pprof profiles"})]}),e(ie,{$gap:8,children:[t(Q,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include Prometheus metrics"})]}),e(ie,{$gap:8,children:[t(Q,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>d("includeSourceWorkloads",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Vi,{alignX:ji.Left,alignY:Hi.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:Ie.Secondary,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(ce,{label:c.sourceWorkloadNamespaces.length,status:Pe.Default}):void 0}}),t(ie,{$justifyContent:"flex-end",children:t(Te,{label:"Download Diagnose",rightIcon:or,variant:Ie.Primary,onClick:async()=>{i.downloadDiagnose&&(s(Date.now()),await i.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},xg=()=>{const{platformType:e,version:n,tier:i}=S(),{describeApi:o}=qr(),[r,s]=l(null);return a(()=>{o.fetchDescribeOdigos&&o.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ut,{richTitle:{icon:Jl,title:"General Information"},children:t(Gt,{cellsPerRow:2,items:[{id:Gi(),title:"Odigos Version",label:n},{id:Gi(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:Gi(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:Gi(),title:"Tier",label:i}]})})},wg=({isOpen:n,onClose:i})=>{const{describeApi:o,tokensApi:a}=qr(),l=a.useTokens().items[0];return e(Xt,{isOpen:n,header:{icon:Jl,title:"System Overview",onClose:i},children:[o.fetchDescribeOdigos&&t(xg,{}),a.updateToken&&l&&t(yg,{token:l}),o.downloadDiagnose&&t(Sg,{})]})},Tg=({isOpen:i,onClose:o,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=it(),{dataStreamsApi:s}=qr(),{requestSubmit:c}=es(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),o()},[s,l,r,o]),u=d(()=>c(p),[c,p]);return Bi({key:"Enter",active:i},u),e(n,{children:[t(tt,{isOpen:i,onClose:o,onCloseEnd:a,title:nt.NAME_YOUR_STREAM,description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:Ie.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:o},children:t(xc,{autoFocus:!0})}),t(Sc,{})]})},kg=({isOpen:i,onClose:o,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=qr(),{genericForm:c,loadDataStream:p,requestSubmit:u}=es();a(()=>{i&&r&&p(r)},[i,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),o()},[s,r,o]),g=d(()=>u(m),[u,m]);return Bi({key:"Enter",active:i},g),e(n,{children:[t(tt,{isOpen:i,onClose:o,onCloseEnd:l,title:nt.RENAME_STREAM(r),description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:o},children:t(xc,{autoFocus:!0})}),t(Sc,{})]})},Ig=({scale:n=1})=>e("svg",{width:742*n,height:533*n,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),Ng=b.div`
|
|
876
|
+
`,xg=()=>{const{progress:n}=Ot(),{describeApi:i,namespacesApi:o}=qr(),{items:a}=o.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=qt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ut,{richTitle:{icon:ur,title:"Diagnose"},children:r?e(Sg,{children:[t(St,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[Dt.DownloadingDiagnose]?.percentage,percentage:n[Dt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[Dt.DownloadingDiagnose]?.percentage,visualIcon:or,startedAt:r}),n[Dt.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[Dt.DownloadingDiagnose].list.map((n,i)=>e(ie,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(El,{size:16}):n.status===Pe.Error?t($l,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ee,{size:te.XXXS,color:ne.Secondary,children:n.label})]},`diagnose-item-${i}-${n.label}`))})]}):e(ae,{$gap:24,children:[t(ee,{size:te.XXS,color:ne.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(ae,{$gap:16,children:[e(ie,{$gap:8,children:[t(Q,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include pprof profiles"})]}),e(ie,{$gap:8,children:[t(Q,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include Prometheus metrics"})]}),e(ie,{$gap:8,children:[t(Q,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>d("includeSourceWorkloads",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Vi,{alignX:ji.Left,alignY:Hi.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:Ie.Secondary,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(ce,{label:c.sourceWorkloadNamespaces.length,status:Pe.Default}):void 0}}),t(ie,{$justifyContent:"flex-end",children:t(Te,{label:"Download Diagnose",rightIcon:or,variant:Ie.Primary,onClick:async()=>{i.downloadDiagnose&&(s(Date.now()),await i.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},wg=()=>{const{platformType:e,version:n,tier:i}=S(),{describeApi:o}=qr(),[r,s]=l(null);return a(()=>{o.fetchDescribeOdigos&&o.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ut,{richTitle:{icon:Jl,title:"General Information"},children:t(Gt,{cellsPerRow:2,items:[{id:Gi(),title:"Odigos Version",label:n},{id:Gi(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:Gi(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:Gi(),title:"Tier",label:i}]})})},Tg=({isOpen:n,onClose:i})=>{const{describeApi:o,tokensApi:a}=qr(),l=a.useTokens().items[0];return e(Xt,{isOpen:n,header:{icon:Jl,title:"System Overview",onClose:i},children:[o.fetchDescribeOdigos&&t(wg,{}),a.updateToken&&l&&t(Cg,{token:l}),o.downloadDiagnose&&t(xg,{})]})},kg=({isOpen:i,onClose:o,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=it(),{dataStreamsApi:s}=qr(),{requestSubmit:c}=es(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),o()},[s,l,r,o]),u=d(()=>c(p),[c,p]);return Bi({key:"Enter",active:i},u),e(n,{children:[t(tt,{isOpen:i,onClose:o,onCloseEnd:a,title:nt.NAME_YOUR_STREAM,description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:Ie.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:o},children:t(xc,{autoFocus:!0})}),t(Sc,{})]})},Ig=({isOpen:i,onClose:o,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=qr(),{genericForm:c,loadDataStream:p,requestSubmit:u}=es();a(()=>{i&&r&&p(r)},[i,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),o()},[s,r,o]),g=d(()=>u(m),[u,m]);return Bi({key:"Enter",active:i},g),e(n,{children:[t(tt,{isOpen:i,onClose:o,onCloseEnd:l,title:nt.RENAME_STREAM(r),description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:o},children:t(xc,{autoFocus:!0})}),t(Sc,{})]})},Ng=({scale:n=1})=>e("svg",{width:742*n,height:533*n,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),Eg=b.div`
|
|
877
877
|
position: absolute;
|
|
878
878
|
top: 50%;
|
|
879
879
|
left: 50%;
|
|
880
880
|
transform: translate(-50%, -50%);
|
|
881
881
|
z-index: ${({theme:e})=>e.v2.zIndex.modal};
|
|
882
|
-
|
|
882
|
+
`,$g=()=>{const{drawerType:n,setDrawerType:i}=Cn(),o=n===Ki.OnboardingDone,a=()=>i(null);return e(Wi,{isOpen:o,onClose:a,children:[t(Ng,{}),t(Eg,{children:e(ae,{$gap:32,$alignItems:"center",children:[e(ae,{$gap:24,$alignItems:"center",children:[t(ee,{size:te.L,weight:500,children:"Welcome to"}),t(Gr,{size:260}),t(ee,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(Te,{label:"Get Started",rightIcon:fl,onClick:a})]})})]})},Og=b.div`
|
|
883
883
|
display: flex;
|
|
884
884
|
flex-direction: column;
|
|
885
885
|
gap: 8px;
|
|
886
886
|
padding: 4px 8px;
|
|
887
887
|
border-radius: 8px;
|
|
888
888
|
width: 100%;
|
|
889
|
-
`,
|
|
889
|
+
`,Ag=b.div`
|
|
890
890
|
white-space: pre;
|
|
891
891
|
overflow-x: auto;
|
|
892
|
-
`,
|
|
892
|
+
`,Rg=({name:n,recommended:i,toggleLabel:o,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(Og,{children:[e(ie,{$gap:8,$justifyContent:"space-between",children:[e(ie,{$gap:4,children:[t(ee,{size:te.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),i&&t(ce,{label:Yi,leftIcon:hr,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:te.XXXS})]}),t(ge,{name:s??`sampling-onboarding-toggle-${n}`,label:o,labelAlign:fe.Left,value:a,onChange:l,size:Et.S})]}),t(Ag,{children:t(w,{parts:r})})]})},Dg=b.div`
|
|
893
893
|
position: relative;
|
|
894
894
|
display: flex;
|
|
895
895
|
align-items: center;
|
|
@@ -899,18 +899,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
899
899
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
900
900
|
border-top-left-radius: 18px;
|
|
901
901
|
border-top-right-radius: 18px;
|
|
902
|
-
`,
|
|
902
|
+
`,Pg=b.div`
|
|
903
903
|
position: absolute;
|
|
904
904
|
left: 16px;
|
|
905
905
|
top: 50%;
|
|
906
906
|
transform: translateY(-50%);
|
|
907
|
-
`,
|
|
907
|
+
`,_g=b.div`
|
|
908
908
|
height: 16px;
|
|
909
909
|
width: 100%;
|
|
910
910
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
911
911
|
border-top-left-radius: 18px;
|
|
912
912
|
border-top-right-radius: 18px;
|
|
913
|
-
`,
|
|
913
|
+
`,Lg=b.div`
|
|
914
914
|
width: ${({$width:e})=>e}px;
|
|
915
915
|
display: flex;
|
|
916
916
|
flex-direction: column;
|
|
@@ -918,7 +918,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
918
918
|
gap: 22px;
|
|
919
919
|
padding: 8px 32px 32px 32px;
|
|
920
920
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
921
|
-
`,
|
|
921
|
+
`,Fg=e=>t(mr,{rotate:90,...e}),zg=({children:n,center:i,onNext:o,nextLabel:a=Ji,nextLoading:l})=>e(ie,{$gap:8,$justifyContent:i?"center":"flex-end",$padding:"0 16px 16px 16px",children:[n,o&&t(Te,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:Fg,variant:Ie.Primary,size:ke.M,onClick:o,loading:l})]}),Mg=e=>t(mr,{rotate:-90,...e}),Xg=({title:n,onBack:i})=>{const o=v();return e(Dg,{$hasBack:!!i,children:[i&&t(Pg,{children:t(yt,{"data-id":"sampling-onboarding-back",icon:Mg,size:Ct.M,onClick:i})}),t(ee,{size:te.M,weight:500,color:o.v2.colors.white[500],align:"center",children:n})]})},Bg=b.div`
|
|
922
922
|
box-sizing: border-box;
|
|
923
923
|
width: ${({$width:e})=>e??"100%"};
|
|
924
924
|
${({$fillHeight:e})=>e&&y`
|
|
@@ -931,16 +931,16 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
931
931
|
padding: 16px;
|
|
932
932
|
border-radius: 16px;
|
|
933
933
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
934
|
-
`,
|
|
934
|
+
`,Ug=({children:e,fillHeight:n,width:i})=>t(Bg,{$fillHeight:n,$width:i,children:e}),Vg=b.ul`
|
|
935
935
|
margin: 0;
|
|
936
936
|
padding: 0;
|
|
937
937
|
list-style: disc;
|
|
938
|
-
`,
|
|
938
|
+
`,Hg=b.li`
|
|
939
939
|
margin-left: 18px;
|
|
940
940
|
& + & {
|
|
941
941
|
margin-top: 6px;
|
|
942
942
|
}
|
|
943
|
-
`,
|
|
943
|
+
`,jg=({items:e,color:n})=>{const i=v(),o=n||i.v2.colors.silver[200];return t(Vg,{children:e.map((e,n)=>t(Hg,{style:{color:o},children:t(ee,{size:te.XXS,color:o,children:e})},n))})},Gg=({items:n})=>{const i=v();return t(ae,{$gap:16,children:n.map((n,o)=>e(ie,{$gap:8,$alignItems:"flex-start",children:[e(ee,{size:te.XS,color:i.v2.colors.silver[200],weight:400,children:[o+1,"."]}),e(ae,{$gap:2,children:[t(ee,{size:te.XS,color:i.v2.colors.white[500],weight:500,children:n.title}),t(ee,{size:te.XS,color:i.v2.colors.silver[200],children:n.description})]})]},o))})},Wg=({message:e})=>t(De,{status:Pe.Default,message:e,fullWidth:!0,smallIcon:!0}),Kg=b.div`
|
|
944
944
|
width: 100%;
|
|
945
945
|
padding: 8px;
|
|
946
946
|
display: flex;
|
|
@@ -948,12 +948,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
948
948
|
gap: 4px;
|
|
949
949
|
border-radius: 16px;
|
|
950
950
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
951
|
-
`,
|
|
951
|
+
`,Yg=b.div`
|
|
952
952
|
display: flex;
|
|
953
953
|
align-items: center;
|
|
954
954
|
gap: 8px;
|
|
955
955
|
padding: 4px 8px 12px 8px;
|
|
956
|
-
`,
|
|
956
|
+
`,Jg=b.div`
|
|
957
957
|
width: 100%;
|
|
958
958
|
display: flex;
|
|
959
959
|
flex-direction: column;
|
|
@@ -961,20 +961,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
961
961
|
padding: 8px;
|
|
962
962
|
border-radius: 12px;
|
|
963
963
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
964
|
-
`,
|
|
964
|
+
`,qg=({children:e})=>{const n=v();return t(ee,{size:te.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},Zg=b.div`
|
|
965
965
|
white-space: pre-line;
|
|
966
|
-
`,
|
|
966
|
+
`,Qg=({enabled:i,onEnabledChange:a,onBack:l,onNext:r})=>{const s=v(),c=o(()=>A({enabled:i,keepPercentage:0}),[i]);return e(n,{children:[t(Xg,{title:qi,onBack:l}),e(Lg,{$width:854,children:[t(qg,{children:Zi}),e(ae,{$gap:8,$width:"100%",children:[t(Ug,{children:t(Zg,{children:t(ee,{size:te.XXS,color:s.v2.colors.silver[200],children:Qi})})}),e(ae,{$gap:8,$width:"100%",children:[e(Kg,{children:[t(Yg,{children:t(ee,{size:te.S,weight:500,color:s.v2.colors.white[500],children:eo})}),t(Jg,{children:t(Rg,{name:no,recommended:!0,toggleLabel:to,enabled:i,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Wg,{message:io})]})]})]}),t(zg,{onNext:r})]})},ef=e=>t(mr,{rotate:90,...e}),tf=({onClose:i})=>{const o=v();return e(n,{children:[t(_g,{}),e(Lg,{$width:732,children:[t(oo,{icon:sr}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ee,{size:te.M,weight:500,color:o.v2.colors.white[500],children:ao}),lo.split("\n").map((e,n)=>t(qg,{children:e},`subtitle-${n}-${e}`)),e(Ug,{children:[t(ee,{size:te.XS,color:o.v2.colors.silver[200],children:ro}),t(jg,{color:o.v2.colors.white[500],items:[so,co,po]})]})]})]}),t(zg,{center:!0,children:t(Te,{"data-id":"sampling-onboarding-btn-go-to",label:uo,rightIcon:ef,variant:Ie.Primary,size:ke.M,onClick:i})})]})},nf=e=>t(mr,{rotate:90,...e}),of=b.div`
|
|
967
967
|
display: flex;
|
|
968
968
|
flex-direction: column;
|
|
969
969
|
align-items: center;
|
|
970
970
|
gap: 8px;
|
|
971
971
|
width: 100%;
|
|
972
|
-
`,
|
|
972
|
+
`,af=({onSkip:i,onNext:o})=>{const a=v();return e(n,{children:[t(_g,{}),e(Lg,{$width:732,children:[t(oo,{icon:sr}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[e(of,{children:[t(ee,{size:te.M,weight:500,color:a.v2.colors.white[500],children:ho}),t(qg,{children:mo})]}),e(Ug,{children:[t(ee,{size:te.XS,color:a.v2.colors.silver[200],children:go}),t(Gg,{items:[{title:bo,description:fo},{title:yo,description:vo},{title:So,description:Co}]}),t(Wg,{message:xo})]})]})]}),e(zg,{center:!0,children:[t(Te,{"data-id":"sampling-onboarding-btn-skip",label:wo,variant:Ie.Secondary,onClick:i}),t(Te,{"data-id":"sampling-onboarding-btn-start",label:To,rightIcon:nf,variant:Ie.Primary,onClick:o})]})]})},lf=b.div`
|
|
973
973
|
display: flex;
|
|
974
974
|
align-items: stretch;
|
|
975
975
|
gap: 16px;
|
|
976
976
|
width: 100%;
|
|
977
|
-
`,
|
|
977
|
+
`,rf=b.div`
|
|
978
978
|
flex: 1;
|
|
979
979
|
display: flex;
|
|
980
980
|
flex-direction: column;
|
|
@@ -994,18 +994,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
994
994
|
background-color: ${t.v2.colors.silver[700]};
|
|
995
995
|
}
|
|
996
996
|
`}
|
|
997
|
-
`,
|
|
997
|
+
`,sf=b.div`
|
|
998
998
|
display: flex;
|
|
999
999
|
align-items: center;
|
|
1000
1000
|
gap: 8px;
|
|
1001
1001
|
padding: 12px 16px;
|
|
1002
|
-
`,
|
|
1002
|
+
`,cf=b.div`
|
|
1003
1003
|
flex: 1;
|
|
1004
1004
|
padding: 8px;
|
|
1005
1005
|
display: flex;
|
|
1006
1006
|
flex-direction: column;
|
|
1007
1007
|
gap: 8px;
|
|
1008
|
-
`,
|
|
1008
|
+
`,df=b.div`
|
|
1009
1009
|
flex: 1;
|
|
1010
1010
|
display: flex;
|
|
1011
1011
|
flex-direction: column;
|
|
@@ -1013,17 +1013,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1013
1013
|
padding: 12px;
|
|
1014
1014
|
border-radius: 12px;
|
|
1015
1015
|
background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
1016
|
-
`,
|
|
1016
|
+
`,pf=b.div`
|
|
1017
1017
|
display: flex;
|
|
1018
1018
|
justify-content: flex-end;
|
|
1019
|
-
`,
|
|
1019
|
+
`,uf=b.div`
|
|
1020
1020
|
display: flex;
|
|
1021
1021
|
align-items: center;
|
|
1022
1022
|
gap: 8px;
|
|
1023
1023
|
padding: 4px 12px 4px 4px;
|
|
1024
1024
|
border-radius: 8px;
|
|
1025
1025
|
background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
|
|
1026
|
-
`,
|
|
1026
|
+
`,hf=b.div`
|
|
1027
1027
|
display: flex;
|
|
1028
1028
|
align-items: center;
|
|
1029
1029
|
justify-content: center;
|
|
@@ -1031,13 +1031,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1031
1031
|
height: 24px;
|
|
1032
1032
|
border-radius: 6px;
|
|
1033
1033
|
background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
|
|
1034
|
-
`,
|
|
1034
|
+
`,mf=({selected:n,onSelect:i,name:o,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=v(),p=n?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(rf,{$selected:n,onClick:i,children:[e(sf,{children:[t(Se,{"data-id":`sampling-onboarding-radio-${o}`,value:n,onChange:i,size:we.L}),t(sr,{size:24,fill:d.v2.colors.white[500]}),t(ee,{size:te.S,weight:500,color:d.v2.colors.white[500],children:o})]}),e(cf,{children:[e(df,{$selected:n,children:[e(ae,{$gap:8,children:[t(ce,{...l,textSize:te.XXXS}),t(ee,{size:te.XXS,color:p,children:a})]}),r&&r.length>0&&t(jg,{color:p,items:r}),s&&e(uf,{children:[t(hf,{children:t(dr,{size:18,fill:d.v2.colors.yellow[500]})}),t(ee,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(pf,{children:t(Te,{"data-id":`sampling-onboarding-btn-read-more-${o}`,label:Bo,rightIcon:bl,variant:Ie.Text,size:ke.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},gf=({strategy:i,onStrategyChange:o,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(n,{children:[t(Xg,{title:ko,onBack:a}),e(Lg,{$width:854,children:[t(qg,{children:Io}),e(lf,{children:[t(mf,{selected:"keep-list"===i,onSelect:()=>o("keep-list"),name:Ro,description:Ao,badgeProps:{label:Oo,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Eo,$o],warning:No,onReadMore:c}),t(mf,{selected:"drop-list"===i,onSelect:()=>o("drop-list"),name:Fo,description:Lo,badgeProps:{label:_o,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Do,Po],onReadMore:c}),t(mf,{selected:"advanced"===i,onSelect:()=>o("advanced"),name:Xo,description:Mo,badgeProps:{label:zo,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(zg,{onNext:l})]})},ff=({onBack:i,onNext:a,submitting:l})=>{const r=v(),s=o(()=>[{title:jo,bullets:[Uo,Vo,Ho]},{title:qo,bullets:[Go,Wo,Ko,Yo,Jo]}],[]);return e(n,{children:[t(Xg,{title:Zo,onBack:i}),e(Lg,{$width:854,children:[t(qg,{children:Qo}),t(ie,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((n,i)=>e(Ug,{fillHeight:!0,width:"50%",children:[t(ee,{size:te.XS,color:r.v2.colors.white[500],children:n.title}),t(jg,{items:n.bullets})]},i))}),t(Wg,{message:ea})]}),t(zg,{onNext:a,nextLoading:l})]})},bf=b.div`
|
|
1035
1035
|
white-space: pre-line;
|
|
1036
|
-
`,
|
|
1036
|
+
`,vf=({errorPresetEnabled:i,onErrorPresetChange:a,onBack:l,onNext:r,submitting:s})=>{const c=v(),d=o(()=>R(i?{disabled:!1}:null),[i]);return e(n,{children:[t(Xg,{title:ta,onBack:l}),e(Lg,{$width:854,children:[t(qg,{children:na}),e(ae,{$gap:8,$width:"100%",children:[e(Ug,{children:[t(bf,{children:t(ee,{size:te.XXS,color:c.v2.colors.silver[200],children:ia})}),t(Wg,{message:ea})]}),e(Kg,{children:[e(Yg,{children:[t(ee,{size:te.S,weight:500,color:c.v2.colors.white[500],children:oa}),t(Gl,{size:16,fill:c.v2.colors.silver[200]})]}),t(Jg,{children:t(Rg,{name:la,recommended:!0,toggleLabel:aa,enabled:i,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(zg,{onNext:r,nextLoading:s})]})},yf=b.div`
|
|
1037
1037
|
white-space: pre-line;
|
|
1038
|
-
`,
|
|
1038
|
+
`,Cf=b.div`
|
|
1039
1039
|
width: fit-content;
|
|
1040
|
-
`,
|
|
1040
|
+
`,Sf=["50","25","10","1","0.1"],xf=({value:n,onChange:i,label:a})=>{const l=v(),r=o(()=>Sf.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ae,{$gap:8,children:[t(ee,{size:te.XS,color:l.v2.colors.white[500],children:a}),t(Cf,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:i})})]})},wf=({errorPresetEnabled:i,onErrorPresetChange:a,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=o(()=>R(i?{disabled:!1}:null),[i]);return e(n,{children:[t(Xg,{title:ra,onBack:s}),e(Lg,{$width:854,children:[t(qg,{children:sa}),e(ae,{$gap:8,$width:"100%",children:[e(Ug,{children:[t(yf,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:ca})}),t(jg,{items:[da,pa,ua,ha,ma]}),t(Wg,{message:ea})]}),e(Kg,{children:[e(Yg,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:ga}),t(Gl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Jg,{children:t(Rg,{name:la,recommended:!0,toggleLabel:aa,enabled:i,onEnabledChange:a,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Jg,{children:t(xf,{value:l,onChange:r,label:fa})})]})]})]}),t(zg,{onNext:c,nextLoading:d})]})},Tf=({isOpen:e,onClose:n,k8sHealthProbesConfig:i,samplingId:o,docsUrl:r})=>{const{samplingApi:s}=qr(),[c,p]=l("welcome"),[u,h]=l(!0),[m,g]=l("keep-list"),[f,b]=l(!0),[v,y]=l("25"),[C,S]=l(!1);a(()=>{e&&(p("welcome"),h(i?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,i?.enabled]);const x=d(async()=>{const e=o??"default",t=[];if(u!==(i?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:i?.keepPercentage??0}))}if("advanced"!==m&&f){const n=s.createHighlyRelevant;n&&t.push(n({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const n=s.createCostReduction;n&&t.push(n({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),p("success")}catch{}finally{S(!1)}},[o,s,u,i?.enabled,i?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(af,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(Qg,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(gf,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":w=t(wf,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(vf,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(ff,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(tf,{onClose:n})}return t(Wi,{isOpen:e,onClose:n,children:w})};var kf,If;(e=>{e.BulkConfig="bulk-config",e.Delete="delete"})(kf||(kf={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(If||(If={}));const Nf=[{id:If.CloudConnector,label:"Cloud Connector"}];var Ef;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(Ef||(Ef={}));const $f=[{key:Ef.Name,label:"Name"},{key:Ef.Type,label:"Type"},{key:Ef.Status,label:"Status"},{key:Ef.OdigosVersion,label:"Odigos Version"},{key:Ef.ConnectedSince,label:"Connected Since"},{key:Ef.LastActivity,label:"Last Activity"}],Of=(e,t)=>{const n=e.find(e=>e.key===Ef.Id)?.rawValue;return t(n?.toString()||"")},Af={[Pe.Success]:"Connected",[Pe.Warning]:"Degraded",[Pe.Error]:"Error",[Pe.Disabled]:"Disabled",[Pe.Info]:"Pending"},Rf={[ba.K8s]:gn.Purple,[ba.Vm]:gn.Blue,[ba.Connector]:gn.Green,[ba.AwsEcs]:gn.Yellow},Df=({connections:n,getConnections:i,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0})=>{const m=v(),{formatTimeAgo:g}=ln(),[f,b]=l(!n?.length),[y,C]=l(n||[]),S=d(async()=>{try{b(!0),C(await i()??[])}catch(e){}finally{b(!1)}},[]);a(()=>{y.length||S()},[]);const[x,w]=l(""),[T,k]=l(null),[I,N]=l([]),[E,$]=l(!1),[O,A]=l(!1),R=d(()=>{$(!1),A(!0),S()},[S]),_=d(e=>{e===If.CloudConnector?$(!0):c?.(e)},[c]),{supportedConnections:L,supportedConnectionIds:F}=o(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,i=D(e.odigosVersion,t,e.type);return n&&i}))(y,h);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[y,h]),z=o(()=>I.map(e=>y.find(t=>t.id===e)).filter(e=>!!e),[y,I]);a(()=>{if(!T||T===kf.Delete)return;const e=I.filter(e=>!F.includes(e));e.length&&N(t=>t.filter(t=>!e.includes(t)))},[T,I.length,F.length]);const M=o(()=>y.filter(e=>!x||e.name.toLowerCase().includes(x.toLowerCase())).map(e=>({cells:[{key:Ef.Id,rawValue:e.id},{key:Ef.Name,rawValue:e.name},{key:Ef.Type,rawValue:e.type,component:()=>t(on,{variant:Rf[e.type]??gn.Default,label:va(e.type),leftIcon:Kn(e.type)})},{key:Ef.Status,rawValue:e.status,component:()=>(e=>{if(e.type===ba.Connector){const n=Af[e.status]??"Pending",i=e.status===Pe.Success?El:e.status===Pe.Error?$l:void 0;return t(ce,{status:e.status,label:n,leftIcon:i})}const n=e.status===Pe.Success?"Connection live":"Connection lost",i=e.status===Pe.Success?El:$l;return t(ce,{status:e.status,label:n,leftIcon:i})})(e)},{key:Ef.OdigosVersion,rawValue:e.odigosVersion},{key:Ef.ConnectedSince,rawValue:e.connectedAt?g(e.connectedAt):"-"},{key:Ef.LastActivity,rawValue:e.lastSeenAt?g(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||T?void 0:()=>r(e),isSelected:I.includes(e.id),onSelect:()=>N(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>N(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.type!==ba.K8s||e.status!==Pe.Success||!D(e.odigosVersion,h,e.type)})),[y,I,x,T,h,g,r]),X=o(()=>M.some(e=>!e.hideCheckbox),[M]),B=o(()=>{const e=(e,t)=>{N([e]),k(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,onDelete:i,onEditConfiguration:o}=e;return({cells:e})=>{const a=Of(e,e=>t.find(t=>t.id===e)),l={id:Gi(),label:"Delete Connection",rightIcon:vl,onClick:()=>Of(e,i)};if(!(e=>e.find(e=>e.key===Ef.Status)?.rawValue===Pe.Success)(e)||a?.type===ba.Connector)return[l];if(a?.type!==ba.K8s)return[];const r=!!a&&D(a.odigosVersion,n,a.type),s=P(n,a?.type),c=[];return o&&c.push({id:Gi(),tooltip:r?"Edit Configuration":`To use this feature, please upgrade to Odigos v${s} or later.`,rightIcon:Ul,disabled:!r,onClick:()=>Of(e,o)}),c}})({connections:y,configMinSupportedVersion:h,onDelete:t=>e(t,kf.Delete),onEditConfiguration:t=>e(t,kf.BulkConfig)})},[y,h]),U=o(()=>(e=>{const{onCancel:t,onManageConfigurations:n}=e,i=[];return n&&i.push({id:kf.BulkConfig,type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:Ul,label:"Manage Configurations",onClick:n}}),i.push({id:Gi(),type:bn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:Ft.CANCEL,onClick:t}}),i})({onCancel:()=>N([]),onManageConfigurations:()=>k(kf.BulkConfig)}),[]),V=o(()=>t(Vi,{items:Nf,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>_(e[0]),buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW}}),[_]),H=o(()=>x.trim()&&y.length>0?{hideIcon:!0,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(x)}:{icon:gr,title:nt.NO_CONNECTIONS,action:V},[x,y.length,V]);return t(ya,{children:e(ut,{fullHeight:!0,richTitle:{icon:gr,title:nt.CONNECTIONS,badge:{label:y.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:x,onChange:e=>w(e),width:"300px"},actions:[{id:"connections-refresh",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:Bl,onClick:S,disabled:f}},{id:"connections-create-new",type:bn.ButtonDropData,buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW,onClick:e=>_(e)},dropDataProps:{alignX:ji.Right,items:Nf}}],children:[t(Vn,{variant:Hn.Pretty,headerBackgroundColor:m.v2.colors.silver[1e3],isLoading:f,withCheckboxes:X,columns:$f,rows:M,noDataProps:H,rowActionsPushRightPosition:T?`calc(${Br} - 24px)`:void 0,getRowActions:B}),E&&t(ps,{providers:p,children:t(Kp,{onClose:()=>$(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:R})}),t(Wr,{isOpen:O,onClose:()=>A(!1)}),t(jn,{isOpen:!!I.length&&!T,richTitle:{icon:wl,title:"Selected Clusters",badge:{label:I.length}},actions:U}),T===kf.BulkConfig&&t(us,{connections:z,children:t(Qp,{onClose:()=>k(null),connections:L,selectedConnectionIds:I,setSelectedConnectionIds:N})}),t(Vr,{target:"connection",isOpen:T===kf.Delete,onClose:()=>{N([]),k(null)},onApprove:async()=>{const e=I[0];e&&(await s(e),await S())}})]})})},Pf=b.div`
|
|
1041
1041
|
display: flex;
|
|
1042
1042
|
align-items: center;
|
|
1043
1043
|
justify-content: space-between;
|
|
@@ -1046,26 +1046,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1046
1046
|
width: 100%;
|
|
1047
1047
|
border-radius: 16px;
|
|
1048
1048
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1049
|
-
`,
|
|
1049
|
+
`,_f=b.div`
|
|
1050
1050
|
display: flex;
|
|
1051
1051
|
align-items: center;
|
|
1052
1052
|
justify-content: center;
|
|
1053
1053
|
padding: 8px;
|
|
1054
1054
|
border-radius: 8px;
|
|
1055
1055
|
background-color: ${({theme:e})=>e.v2.colors.white[500]+oe["004"]};
|
|
1056
|
-
`,
|
|
1056
|
+
`,Lf=({setStep:n,onSave:i,sourcesPayload:a,destinationsPayload:l,disableAnimation:r})=>{const s=v(),c=()=>n(2),d=()=>n(3),p=o(()=>Object.values(a||{}).flatMap((n,i)=>n.map((n,o)=>{if(!n.selected)return null;const a=n.kind||Nt.Namespace,l=a===Nt.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(Pf,{children:[t(ee,{nowrap:!0,children:l}),t(ce,{label:a,status:Pe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${i}-${o}`)})).filter(Boolean),[a]),u=o(()=>l?.map((n,i)=>{const o=wt(n.option.type).icon;return e(Pf,{children:[e(ie,{$gap:8,children:[o&&t(_f,{children:t(o,{size:24})}),t(ee,{nowrap:!0,children:n.formData.name||n.option.displayName})]}),void 0!==n.testResult&&t(ce,{status:n.testResult.succeeded?Pe.Success:Pe.Error,leftIcon:n.testResult.succeeded?El:$l})]},`destination-${i}`)})||[],[l]);return t(Xr,{isOpen:!0,disableAnimation:r,onBack:()=>n(3),onSave:i,header:{icon:zl,title:nt.SUMMARY,subTitle:nt.REVIEW_SETUP},leftColumn:{width:"50%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(Al,{size:24}),t(ee,{nowrap:!0,children:nt.SELECTED_SOURCES}),t(ce,{label:p.length})]}),t(Te,{"data-id":"summary-edit-sources",leftIcon:yl,variant:Ie.Secondary,size:ke.S,onClick:c})]}),list:p.length?p:[t(ft,{$height:"100%",children:t(Oe,{icon:Al,title:nt.NO_SOURCES_SELECTED,subTitle:nt.ADD_SOURCE_PROMPT,button:{leftIcon:gl,label:nt.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(kl,{size:24}),t(ee,{nowrap:!0,children:nt.SELECTED_DESTINATIONS}),t(ce,{label:u.length})]}),t(Te,{"data-id":"summary-edit-destinations",leftIcon:yl,variant:Ie.Secondary,size:ke.S,onClick:d})]}),list:u.length?u:[t(ft,{"data-id":"summary-no-destinations",$height:"100%",children:t(Oe,{icon:kl,title:nt.NO_DESTINATIONS_SELECTED,subTitle:nt.ADD_DESTINATION_PROMPT,button:{leftIcon:gl,label:nt.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Ff=b.div`
|
|
1057
1057
|
position: relative;
|
|
1058
1058
|
overflow: hidden;
|
|
1059
1059
|
width: 100vw;
|
|
1060
1060
|
height: 100vh;
|
|
1061
1061
|
box-sizing: border-box;
|
|
1062
|
-
`,
|
|
1062
|
+
`,zf=b.svg`
|
|
1063
1063
|
position: absolute;
|
|
1064
1064
|
top: 50%;
|
|
1065
1065
|
left: 50%;
|
|
1066
1066
|
transform: translate(-50%, -50%);
|
|
1067
1067
|
z-index: -1;
|
|
1068
|
-
`,
|
|
1068
|
+
`,Mf=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],Xf=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Mf},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Mf},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:Mf}],Bf=({paddingXAxis:n="0px",paddingYAxis:i="0px",children:r})=>{const[s,c]=l(window.innerWidth),d=o(()=>s/Xf[0].width,[s]);return a(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Ff,{$paddingXAxis:n,$paddingYAxis:i,children:[Xf.map(({width:n,height:i,pathOpacity:o,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(zf,{width:n*d,height:"100%",viewBox:`0 0 ${n} ${i}`,fill:"none",children:[t("path",{opacity:o,d:a,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:n},i)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:n},i))})})]},c)}),r]})},Uf=b.div`
|
|
1069
1069
|
display: flex;
|
|
1070
1070
|
flex-direction: column;
|
|
1071
1071
|
align-items: center;
|
|
@@ -1076,7 +1076,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1076
1076
|
width: 50vw;
|
|
1077
1077
|
border-radius: 16px;
|
|
1078
1078
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1079
|
-
`,
|
|
1079
|
+
`,Vf=b.div`
|
|
1080
1080
|
display: flex;
|
|
1081
1081
|
flex-direction: column;
|
|
1082
1082
|
align-items: center;
|
|
@@ -1086,15 +1086,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1086
1086
|
& * {
|
|
1087
1087
|
text-align: center;
|
|
1088
1088
|
}
|
|
1089
|
-
`,
|
|
1089
|
+
`,Hf=({onStart:n})=>t(Xt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(ft,{$height:"100%",children:e(Uf,{children:[e(Vf,{children:[t(ee,{size:te.L,weight:500,children:nt.GET_STARTED_WITH}),t(Gr,{size:260}),t(ee,{size:te.S,weight:400,children:nt.GET_STARTED_DESCRIPTION})]}),t(Te,{"data-id":"onboarding-get-started",label:Ft.GET_STARTED,rightIcon:fl,size:ke.L,onClick:n})]})})}),jf=[{step:1,label:nt.INSTALLATION,forceDoneBadge:!0},{step:2,label:nt.SOURCES_SETUP},{step:3,label:nt.DESTINATIONS_SETUP},{step:4,label:nt.SUMMARY}],Gf=b.div`
|
|
1090
1090
|
display: flex;
|
|
1091
1091
|
flex-direction: column;
|
|
1092
1092
|
gap: 32px;
|
|
1093
1093
|
padding: 64px;
|
|
1094
|
-
`,
|
|
1094
|
+
`,Wf=({pagePaddingXAxis:n,pagePaddingYAxis:i,onDone:o})=>{const{setDrawerType:a}=Cn(),{sourcesApi:r,destinationsApi:s}=qr(),[c,d]=l(1),[p,u]=l(!1),[h,m]=l(null),[g,f]=l(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(Bf,{paddingXAxis:n,paddingYAxis:i,children:[e(Gf,{children:[t(Gr,{useInline:!0}),t(Ca,{currentStep:c,data:jf,gap:32})]}),t(hs,{initialInputs:h,children:e(ms,{children:[1===c&&t(Hf,{onStart:b}),2===c&&t(ld,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(Vc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(Lf,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!p){u(!0);try{const e=[];h&&e.push(r.persistV2(h)),g&&e.push(...g.map(e=>s.create(e.formData)));const t=await Promise.allSettled(e),n=[];for(const e of t)"rejected"===e.status?n.push(e.reason?.message||String(e.reason)):e.value&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&n.push(e.value.error);if(n.length)return{error:n.join("\n")};a(Ki.OnboardingDone),o()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},Kf=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Yf=e=>e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),Jf=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},qf=b.div`
|
|
1095
1095
|
position: relative;
|
|
1096
1096
|
display: inline-flex;
|
|
1097
|
-
`,
|
|
1097
|
+
`,Zf=b.button`
|
|
1098
1098
|
display: inline-flex;
|
|
1099
1099
|
align-items: center;
|
|
1100
1100
|
gap: 8px;
|
|
@@ -1107,7 +1107,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1107
1107
|
&:hover {
|
|
1108
1108
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1109
1109
|
}
|
|
1110
|
-
`,
|
|
1110
|
+
`,Qf=b.div`
|
|
1111
1111
|
position: absolute;
|
|
1112
1112
|
top: calc(100% + 8px);
|
|
1113
1113
|
right: 0;
|
|
@@ -1120,25 +1120,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1120
1120
|
border-radius: 12px;
|
|
1121
1121
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1122
1122
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
1123
|
-
`,
|
|
1123
|
+
`,eb=b.div`
|
|
1124
1124
|
display: flex;
|
|
1125
1125
|
flex-direction: column;
|
|
1126
1126
|
gap: 12px;
|
|
1127
1127
|
padding: 16px;
|
|
1128
1128
|
max-height: 60vh;
|
|
1129
1129
|
overflow-y: auto;
|
|
1130
|
-
`,
|
|
1130
|
+
`,tb=b.div`
|
|
1131
1131
|
display: flex;
|
|
1132
1132
|
align-items: center;
|
|
1133
1133
|
gap: 8px;
|
|
1134
1134
|
padding: 12px 16px;
|
|
1135
1135
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1136
|
-
`,
|
|
1136
|
+
`,nb=b.div`
|
|
1137
1137
|
display: flex;
|
|
1138
1138
|
align-items: center;
|
|
1139
1139
|
gap: 8px;
|
|
1140
1140
|
margin-left: auto;
|
|
1141
|
-
`,
|
|
1141
|
+
`,ib=()=>{const n=v(),{platformType:i,isK8s:r,isConnector:s}=S(),{sourcesApi:c,namespacesApi:d}=qr(),u=c.useSources().items,h=d.useNamespaces().items,{selectedStreamName:m}=it(),{getItemSS:g,setItemSS:f,removeItemSS:b}=Ia(),{statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N,enabledStatuses:E,setAll:$,clearFilters:O,getEmptyState:A}=Sa(),R=o(()=>xa(u,m),[u,m]);a(()=>{const e=g(wa.OVERVIEW_FILTERS,A());$(e)},[]);const[D,P]=l({statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N,enabledStatuses:E}),[_,L]=l(Jf(D)),[F,z]=l(!1),M=p(i);a(()=>{if(!F){const e={statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N,enabledStatuses:E};P(e),L(Jf(e))}},[F,y,C,x,w,T,k,I,N,E]),a(()=>{M.current!==i&&(M.current=i,b(wa.OVERVIEW_FILTERS),O(),P(A()),L(0),z(!1))},[i]);const X=p(null);On(X,()=>z(!1)),Bi({key:"Escape",active:F},()=>z(!1));const B=o(()=>{const e=new Set,t=[];return h.forEach(({name:n})=>{e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[h]),U=o(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const{kind:i}=n;e.has(i)||(e.add(i),t.push({id:i,label:Nn(i),withCheckbox:!0}))}),t},[R]),V=o(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const i=n.region?.trim();i&&!e.has(i)&&(e.add(i),t.push({id:i,label:i,withCheckbox:!0}))}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),H=o(()=>{const e=new Set,t=[];return R.forEach(({runtimeInfo:n})=>{n?.detectedLanguages?.forEach(n=>{e.has(n)||(e.add(n),t.push({id:n,label:Ta[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),j=o(()=>ka.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),G=o(()=>{const e=new Set,t=[];return R.forEach(({instrumentationReport:n})=>{const i=n?.state||n?.progressStage;i&&!e.has(i)&&(e.add(i),t.push({id:i,label:Yf(i),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[R]),W=o(()=>{const e=new Set,t=[];return R.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:i,message:o}=n||{};if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:Ut(i),withCheckbox:!0})}else if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:o,withCheckbox:!0})}}),t},[R]),K=o(()=>[{id:"enabled",label:nt.ENABLED,withCheckbox:!0},{id:"disabled",label:nt.DISABLED,withCheckbox:!0}],[]),Y=(e,t,n)=>{const i=t.filter(e=>n.includes(e.id));P(t=>{return{...t,[e]:(n=i,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},J=F?Il:Nl,q=o(()=>Kf(D.languages),[D.languages]);return e(qf,{ref:X,children:[e(Zf,{"data-id":"filters-trigger",$isOpen:F,type:"button",onClick:()=>z(e=>!e),children:[t(fr,{size:16,fill:n.v2.colors.white[500]}),t(ee,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),_>0&&t(ce,{label:_,status:Pe.Unknown,textSize:te.XXXS}),t(J,{size:16,fill:n.v2.colors.silver[200]})]}),F&&e(Qf,{children:[e(eb,{children:[r&&t(vt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!B.length,options:B,values:Kf(D.namespaces),setValues:e=>Y("namespaces",B,e)}),s&&t(vt,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!V.length,options:V,values:Kf(D.regions),setValues:e=>Y("regions",V,e)}),t(vt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!U.length,options:U,values:Kf(D.kinds),setValues:e=>Y("kinds",U,e)}),t(vt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!H.length,options:H,values:q,setValues:e=>Y("languages",H,e)}),t(vt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!j.length,options:j,values:Kf(D.monitors),setValues:e=>Y("monitors",j,e)}),t(vt,r?{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!W.length,options:W,values:Kf(D.podsAgentInjectionStatus),setValues:e=>Y("podsAgentInjectionStatus",W,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:Kf(D.statuses),setValues:e=>Y("statuses",G,e)}),t(vt,{label:"Enabled Status",placeholder:"All",withMultiSelect:!0,options:K,values:Kf(D.enabledStatuses),setValues:e=>Y("enabledStatuses",K,e)}),t(ge,{label:"Show only sources with errors",size:Et.L,value:!!D.onlyErrors,onChange:e=>P(t=>({...t,onlyErrors:e}))})]}),e(tb,{children:[t(Te,{"data-id":"filters-reset",size:ke.S,variant:Ie.Text,label:"Reset",onClick:()=>{b(wa.OVERVIEW_FILTERS),O(),P(A()),L(0),z(!1)},textColor:n.v2.colors.red[500]}),e(nb,{children:[t(Te,{"data-id":"filters-cancel",size:ke.S,variant:Ie.Secondary,label:"Cancel",onClick:()=>z(!1)}),t(Te,{"data-id":"filters-apply",size:ke.S,variant:Ie.Primary,label:"Apply",onClick:()=>{f(wa.OVERVIEW_FILTERS,D),$(D),L(Jf(D)),z(!1)}})]})]})]})]})},ob=b.div`
|
|
1142
1142
|
position: relative;
|
|
1143
1143
|
display: flex;
|
|
1144
1144
|
align-items: center;
|
|
@@ -1149,7 +1149,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1149
1149
|
box-sizing: border-box;
|
|
1150
1150
|
border-radius: 16px 16px 0 0;
|
|
1151
1151
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1152
|
-
`,
|
|
1152
|
+
`,ab=b.div`
|
|
1153
1153
|
position: absolute;
|
|
1154
1154
|
bottom: 0;
|
|
1155
1155
|
left: 0;
|
|
@@ -1158,7 +1158,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1158
1158
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
1159
1159
|
border-radius: 32px;
|
|
1160
1160
|
transition: width 0.3s;
|
|
1161
|
-
`,
|
|
1161
|
+
`,lb=({entityType:n,badge:i,badgeTooltip:o,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=Cn();return e(ob,{children:[e(ie,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Q,{size:Na.S,partiallyChecked:r,value:!!s,onChange:c}),t(ee,{size:te.S,nowrap:!0,children:`${Ut(n)}s`}),t(ce,{label:i,tooltip:o,status:Pe.Unknown,textSize:te.XXXS})]}),e(ie,{children:[t(yt,{"data-id":`add-${n}`,icon:gl,onClick:()=>p(Ea(n))}),t(yt,{"data-id":`refresh-${n}`,icon:Bl,onClick:l,disabled:a})]}),"number"==typeof d&&t(ab,{$percent:d})]})},rb=b(ae)`
|
|
1162
1162
|
align-items: center !important;
|
|
1163
1163
|
justify-content: center !important;
|
|
1164
1164
|
align-self: stretch;
|
|
@@ -1173,7 +1173,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1173
1173
|
&:hover {
|
|
1174
1174
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1175
1175
|
}
|
|
1176
|
-
`,
|
|
1176
|
+
`,sb=({entityType:n,description:i})=>{const{setDrawerType:o}=Cn();return e(rb,{onClick:()=>o(Ea(n)),children:[e(ie,{$gap:4,children:[t(gl,{size:16}),t(ee,{size:te.S,children:`Add ${Ut(n)}`})]}),t(ee,{size:te.XXS,align:"center",children:i})]})},cb=b.div`
|
|
1177
1177
|
display: flex;
|
|
1178
1178
|
align-items: center;
|
|
1179
1179
|
gap: 12px;
|
|
@@ -1188,10 +1188,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1188
1188
|
&:hover {
|
|
1189
1189
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1190
1190
|
}
|
|
1191
|
-
`,
|
|
1191
|
+
`,db=b(ie)`
|
|
1192
1192
|
flex: 1;
|
|
1193
1193
|
min-width: 0;
|
|
1194
|
-
`,
|
|
1194
|
+
`,pb=({entityId:n,entityType:i,title:a,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:m})=>{const g=v(),f=i===Nt.Source,b="boolean"==typeof h,y=r||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=Cn(),{selectedSources:x,setSelectedSources:w}=$a(),T=m,k=f?T.id.namespace:"",I=o(()=>{if(!f)return-1;const e=x[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind&&(e.id.region??"")===(T.id.region??"")):-1},[f,x,k,T.id]),N=b&&!h?Fn(Pe.Info,g):l?Fn(l,g):void 0,E=f&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}${n.region?`-${n.region}`:""}`:n;return e(cb,{"data-id":E,$faded:y,onClick:()=>{C(kn(i)),S(n)},children:[f&&t(Q,{size:Na.S,value:-1!==I,onChange:()=>{const e={...x};e[k]||(e[k]=[]),-1===I?e[k].push(T):e[k].splice(I,1),w(e)}}),t(Tn,{icons:p,icon:d,iconSrc:u}),e(db,{$gap:4,children:[t(Ae,{size:te.XS,nowrap:!0,children:a}),t(ie,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:(c||b&&!h)&&t(Be,{text:s||(b&&!h?nt.DISABLED:"Heads up! The data-flow metrics you see are calculated over 10-second intervals."),children:t(ce,{label:c||nt.DISABLED,status:l&&[Pe.Error,Pe.Warning].includes(l)?l:Pe.Unknown,leftIcon:N,textSize:te.XXXS})})})]})]})};function ub(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Pe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:dn.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function hb(e){const t=Object.values(e.conditions??{}).filter(Boolean),n=t.filter(({status:e})=>e!==Pe.Loading);return n?.length===t?.length?e:{...e,conditions:n?.length?n.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const mb=b.div`
|
|
1195
1195
|
position: absolute;
|
|
1196
1196
|
top: 0;
|
|
1197
1197
|
left: 0;
|
|
@@ -1202,21 +1202,21 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1202
1202
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1203
1203
|
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1204
1204
|
pointer-events: none;
|
|
1205
|
-
`,
|
|
1205
|
+
`,gb=b.div`
|
|
1206
1206
|
display: flex;
|
|
1207
1207
|
align-items: center;
|
|
1208
1208
|
gap: 8px;
|
|
1209
1209
|
padding: 4px 8px 0;
|
|
1210
|
-
`,
|
|
1210
|
+
`,fb=b.div`
|
|
1211
1211
|
flex: 1;
|
|
1212
1212
|
height: 1px;
|
|
1213
1213
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1214
|
-
`,
|
|
1214
|
+
`,bb=({namespace:e})=>{const n=v();return t(mb,{children:t(ee,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},vb=({namespace:n})=>{const i=v();return e(gb,{children:[t(fb,{}),t(ee,{size:te.XXS,nowrap:!0,color:i.v2.colors.grey[300],children:n}),t(fb,{})]})},yb={[Nt.InstrumentationRule]:nt.NO_DATA_INSTRUMENTATION_RULES,[Nt.Source]:nt.NO_DATA_SOURCES,[Nt.Action]:nt.NO_DATA_ACTIONS,[Nt.Destination]:nt.NO_DATA_DESTINATIONS},Cb=b.div`
|
|
1215
1215
|
display: flex;
|
|
1216
1216
|
flex-direction: column;
|
|
1217
1217
|
flex: 1 0 0;
|
|
1218
1218
|
min-width: 0;
|
|
1219
|
-
`,
|
|
1219
|
+
`,Sb=b.div`
|
|
1220
1220
|
display: flex;
|
|
1221
1221
|
flex-direction: column;
|
|
1222
1222
|
align-items: stretch;
|
|
@@ -1226,7 +1226,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1226
1226
|
border-radius: 0 0 16px 16px;
|
|
1227
1227
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1228
1228
|
overflow: hidden;
|
|
1229
|
-
`,
|
|
1229
|
+
`,xb=b.div`
|
|
1230
1230
|
position: relative;
|
|
1231
1231
|
display: flex;
|
|
1232
1232
|
flex-direction: column;
|
|
@@ -1238,7 +1238,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1238
1238
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1239
1239
|
height: ${({$height:e})=>e}px;
|
|
1240
1240
|
overflow: hidden;
|
|
1241
|
-
`,
|
|
1241
|
+
`,wb=({entityType:n,entities:i,unfilteredCount:r,metrics:s,loading:c,maxHeight:p,refetch:u})=>{const h=n===Nt.Source,m=i.length!==r,g=Ot(e=>h?e.progress[Dt.Instrumenting]?.percentage:void 0),f=Ot(e=>h?e.progress[Dt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=$a(),C=o(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=o(()=>{if(!s)return;const e=new Map,t=n===Nt.Source?s.sources:n===Nt.Destination?s.destinations:void 0;if(t)for(const n of t)e.set(Oa(n),n.throughput);return e},[s,n]),x=o(()=>i.map(e=>((e,t,n)=>{const i=Wt(e);if(!i)return null;const o=t===Nt.Source;let a,l,r=!1,s=e;if(o){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status,n=!1===e.markedForInstrumentation?.markedForInstrumentation;switch(t){case dn.Failure:return{status:Pe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case dn.Notice:return{status:Pe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case dn.Pending:case dn.Waiting:return{status:void 0,faded:!1,displaySource:ub(e)};case dn.Unsupported:case dn.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return n?{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e}:{status:void 0,faded:!1,displaySource:hb(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const n=t===Nt.Action?Aa(e):e.conditions,{priorotizedStatus:i,hasDisableds:o}=Ra(n);a=i,r=o}const c=Da(e,t,{extended:o,prioritizeDisplayName:!o});let d,p,u,h,m;switch(t){case Nt.Source:{d=wn(e),p=_a(Nt.Source);const t=n?.get(Pa(i));h=En(t);const o=e.markedForInstrumentation?.markedForInstrumentation;"boolean"==typeof o&&(m=o);break}case Nt.Destination:{const t=wt(e.destinationType.type);p=t.icon,u=t.iconSrc;const o=n?.get(Pa(i));h=En(o),m=!e.disabled;break}case Nt.Action:p=Jt(e.type),m=!e.disabled;break;case Nt.InstrumentationRule:p=an(e.type),m=!e.disabled}return{key:Pa(i),entityId:i,namespace:o?e.id.namespace:void 0,raw:s,itemProps:{entityId:i,entityType:t,title:c,status:a,faded:r,tooltip:l,throughput:h,icon:p,icons:d,iconSrc:u,isActive:m,raw:s}}})(e,n,S)).filter(Boolean),[i,n,S]),[w,T]=l(""),{elements:k,indexToNamespace:I,multipleNs:N,dividerCount:E}=o(()=>{const e=[],n=[],i=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;i&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let o=0,a="";for(const i of x)h&&i.namespace&&i.namespace!==a&&(""!==a&&(n.push(i.namespace),e.push(t(vb,{namespace:i.namespace},`ns-divider-${i.namespace}`)),o+=1),a=i.namespace),n.push(i.namespace||""),e.push(t(pb,{...i.itemProps},i.key));return{elements:e,indexToNamespace:n,multipleNs:i,dividerCount:o}},[x,h]);a(()=>{if(h&&I.length&&!w){const e=I.find(Boolean);e&&T(e)}},[h,I]);const $=d(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==w&&T(t)},[I,w]),O=58*x.length+(N?28:0)+32*E,A=Math.max(0,p-52-16),R=Math.min(A,O)+8,D="number"==typeof b?`${b}%`:m?`${i.length}/${r}`:r;return e(Cb,{children:[t(lb,{entityType:n,badge:D,badgeTooltip:m?nt.FILTERED_COUNT_TOOLTIP:void 0,isLoading:c,refetch:u,partiallySelected:C>0&&i?.length!==C,allSelected:C>0&&i?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};i?.forEach(t=>{const{namespace:n}=t.id;e[n]?e[n].push(t):e[n]=[t]}),y(e)}else y({})}:void 0,progressPercent:b}),t(Sb,{children:i.length?e(xb,{$height:R,children:[N&&w&&t(bb,{namespace:w}),t(yn,{gap:4,elements:k,onTopIndexChange:N?$:void 0})]}):c?t(re,{size:3}):t(sb,{entityType:n,description:yb[n]??nt.TO_COLLECT_OTEL_DATA})})]})},Tb=b.div`
|
|
1242
1242
|
width: 100%;
|
|
1243
1243
|
flex: 1;
|
|
1244
1244
|
min-height: 0;
|
|
@@ -1246,10 +1246,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1246
1246
|
display: flex;
|
|
1247
1247
|
align-items: stretch;
|
|
1248
1248
|
gap: 16px;
|
|
1249
|
-
`,
|
|
1249
|
+
`,kb={sources:[],destinations:[]},Ib=()=>{const n=Sa(),{selectedStreamName:i}=it(),{containerRef:a,containerHeight:l}=La(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p,capabilities:u}=qr(),{items:h,loading:m}=r.useSources(),{items:g,loading:f}=s.useDestinations(),{items:b,loading:v}=c.useActions(),{items:y,loading:C}=d.useRules(),S=Cn(e=>e.drawerType),{data:x}=p.useMetrics({skip:!h.length||!g.length||!!S,pollInterval:1e4,fetchPolicy:"network-only"}),w=x?.getOverviewMetrics??kb,T=o(()=>xa(h,i),[h,i]),k=o(()=>en(g,i),[g,i]),I=o(()=>Fa(T,n),[T,n]),N=o(()=>za(k,n),[k,n]),E=o(()=>Ma(b,n),[b,n]);return e(Tb,{ref:a,children:[u.canManageInstrumentationRules&&t(wb,{entityType:Nt.InstrumentationRule,entities:y,unfilteredCount:y.length,loading:C,maxHeight:l,refetch:d.fetchAll}),t(wb,{entityType:Nt.Source,entities:I,unfilteredCount:T.length,metrics:w,loading:m,maxHeight:l,refetch:r.fetchAll}),u.canManageActions&&t(wb,{entityType:Nt.Action,entities:E,unfilteredCount:b.length,loading:v,maxHeight:l,refetch:c.fetchAll}),t(wb,{entityType:Nt.Destination,entities:N,unfilteredCount:k.length,metrics:w,loading:f,maxHeight:l,refetch:s.fetchAll})]})},Nb="40vw",Eb=b.div`
|
|
1250
1250
|
position: relative;
|
|
1251
|
-
width: ${
|
|
1252
|
-
|
|
1251
|
+
width: ${Nb};
|
|
1252
|
+
`,$b=b.div`
|
|
1253
1253
|
position: absolute;
|
|
1254
1254
|
top: calc(100% + 8px);
|
|
1255
1255
|
left: 0;
|
|
@@ -1258,23 +1258,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1258
1258
|
flex-direction: column;
|
|
1259
1259
|
gap: 8px;
|
|
1260
1260
|
padding: 8px;
|
|
1261
|
-
width: calc(${
|
|
1261
|
+
width: calc(${Nb} - 16px);
|
|
1262
1262
|
border-radius: 12px;
|
|
1263
1263
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1264
1264
|
box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
|
|
1265
|
-
|
|
1265
|
+
`,Ob=b.div`
|
|
1266
1266
|
display: flex;
|
|
1267
1267
|
align-items: center;
|
|
1268
1268
|
overflow-x: auto;
|
|
1269
|
-
`,
|
|
1269
|
+
`,Ab=b.div`
|
|
1270
1270
|
display: flex;
|
|
1271
1271
|
flex-direction: column;
|
|
1272
1272
|
gap: 0;
|
|
1273
1273
|
max-height: 60vh;
|
|
1274
1274
|
overflow-y: auto;
|
|
1275
|
-
`,Ab=b.div`
|
|
1276
|
-
padding: 8px 12px 4px 12px;
|
|
1277
1275
|
`,Rb=b.div`
|
|
1276
|
+
padding: 8px 12px 4px 12px;
|
|
1277
|
+
`,Db=b.div`
|
|
1278
1278
|
display: flex;
|
|
1279
1279
|
align-items: center;
|
|
1280
1280
|
gap: 8px;
|
|
@@ -1284,12 +1284,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1284
1284
|
&:hover {
|
|
1285
1285
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1286
1286
|
}
|
|
1287
|
-
`,
|
|
1287
|
+
`,Pb=b.div`
|
|
1288
1288
|
padding: 16px 8px;
|
|
1289
|
-
`,
|
|
1289
|
+
`,_b=({preventPopup:n=!1})=>{const i=v(),{selectedStreamName:a}=it(),{searchText:s,setSearchText:c}=Sa(),{setDrawerType:d,setDrawerEntityId:u}=Cn(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f,capabilities:b}=qr(),y=h.useSources().items,C=m.useDestinations().items,S=g.useActions().items,x=f.useRules().items,w=p(null),[T,k]=l(!1),[I,N]=l("all"),E=!n&&(!!s||T),$=()=>{c(""),k(!1),N("all")};On(w,()=>$()),Bi({key:"Escape",active:E},$);const{categories:O,searchResults:A}=o(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:i,searchText:o,selectedCategory:a,includeActions:l=!0,includeInstrumentationRules:r=!0})=>{const s=r?o?e.filter(e=>e.type?.toLowerCase().includes(o)||e.ruleName?.toLowerCase().includes(o)):e:[],c=o?t.filter(e=>e.id.name?.toLowerCase().includes(o)||e.serviceName?.toLowerCase().includes(o)||e.id.namespace?.toLowerCase().includes(o)):t,d=l?o?n.filter(e=>e.type?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):n:[],p=o?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):i,u=[{category:Nt.Source,label:"Sources",count:c.length,entities:[]},...l?[{category:Nt.Action,label:"Actions",count:d.length,entities:[]}]:[],{category:Nt.Destination,label:"Destinations",count:p.length,entities:[]},...r?[{category:Nt.InstrumentationRule,label:"Instrumentation Rules",count:s.length,entities:[]}]:[]];u.unshift({category:"all",label:"All",count:s.length+c.length+d.length+p.length,entities:[]});const h=u.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===Nt.InstrumentationRule?s:e.category===Nt.Source?c:e.category===Nt.Action?d:e.category===Nt.Destination?p:[]}));return{categories:u,searchResults:h}})({instrumentationRules:x,sources:xa(y,a),actions:S,destinations:en(C,a),searchText:s,selectedCategory:I,includeActions:b.canManageActions,includeInstrumentationRules:b.canManageInstrumentationRules}),[x,y,S,C,a,s,I,b.canManageActions,b.canManageInstrumentationRules]),R=o(()=>O.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:n})=>({value:e,label:n?`${t} (${n})`:t})),[O]),D=A.some(({entities:e})=>e.length>0);return e(Eb,{ref:w,children:[t(vn,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>k(!0),width:Nb}),E&&e($b,{children:[R.length>1&&t(Ob,{children:t(ve,{options:R,selected:I,setSelected:N})}),D?t(Ab,{children:A.map(({category:n,label:o,entities:a},l)=>{if(!a.length)return null;const s=_a(n);return e(r,{children:[t(Rb,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:o})}),a.map((o,a)=>e(Db,{onClick:()=>{const e=Wt(o);e&&(d(kn(n)),u(e),$())},children:[s&&t(s,{size:16,fill:i.v2.colors.white[500]}),t(ee,{size:te.XS,nowrap:!0,children:Da(o,n,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${n}`)})}):t(Pb,{children:t(Oe,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},Lb=({onRedirectToSampling:i})=>{const{sourcesApi:a}=qr(),{items:l}=a.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=Cn(),p=()=>{c(null),d(null)},u=o(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),h=o(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(n,{children:[t($g,{}),r===Ki.AddSource&&t(hs,{children:t(ld,{onClose:p,withOverlay:!0})}),r===Ki.AddDestination&&t(ms,{children:t(Vc,{onClose:p,withOverlay:!0})}),r===Ki.AddInstrumentationRule&&t(gs,{sourceOptions:u,namespaceOptions:h,children:t(Hc,{onClose:p,withOverlay:!0})}),r===Ki.AddAction&&t(fs,{sourceOptions:u,namespaceOptions:h,children:t(Dc,{onClose:p,withOverlay:!0})}),r===Ki.EditSource&&t(bs,{children:t($m,{onClose:p,sourceId:s,onRedirectToSampling:i})}),r===Ki.EditDestination&&t(ms,{children:t(tu,{onClose:p,destinationId:s})}),r===Ki.EditInstrumentationRule&&t(gs,{sourceOptions:u,namespaceOptions:h,children:t(iu,{onClose:p,ruleId:s})}),r===Ki.EditAction&&t(fs,{sourceOptions:u,namespaceOptions:h,children:t(Zp,{onClose:p,actionId:s})})]})},Fb=b.div`
|
|
1290
1290
|
position: relative;
|
|
1291
1291
|
display: inline-flex;
|
|
1292
|
-
`,
|
|
1292
|
+
`,zb=b.div`
|
|
1293
1293
|
display: inline-flex;
|
|
1294
1294
|
align-items: center;
|
|
1295
1295
|
gap: 6px;
|
|
@@ -1300,7 +1300,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1300
1300
|
&:hover {
|
|
1301
1301
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1302
1302
|
}
|
|
1303
|
-
`,
|
|
1303
|
+
`,Mb=b.div`
|
|
1304
1304
|
position: absolute;
|
|
1305
1305
|
top: calc(100% + 8px);
|
|
1306
1306
|
left: 0;
|
|
@@ -1314,18 +1314,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1314
1314
|
border-radius: 12px;
|
|
1315
1315
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1316
1316
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
1317
|
-
`,
|
|
1317
|
+
`,Xb=b.div`
|
|
1318
1318
|
display: flex;
|
|
1319
1319
|
align-items: center;
|
|
1320
1320
|
gap: 8px;
|
|
1321
1321
|
width: 100%;
|
|
1322
|
-
`,
|
|
1322
|
+
`,Bb=b.div`
|
|
1323
1323
|
display: flex;
|
|
1324
1324
|
flex-direction: column;
|
|
1325
1325
|
gap: 0;
|
|
1326
1326
|
max-height: 240px;
|
|
1327
1327
|
overflow-y: auto;
|
|
1328
|
-
`,
|
|
1328
|
+
`,Ub=b.div`
|
|
1329
1329
|
display: flex;
|
|
1330
1330
|
align-items: center;
|
|
1331
1331
|
gap: 8px;
|
|
@@ -1336,41 +1336,41 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1336
1336
|
&:hover {
|
|
1337
1337
|
background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
|
|
1338
1338
|
}
|
|
1339
|
-
`,
|
|
1339
|
+
`,Vb=b.div`
|
|
1340
1340
|
flex: 1;
|
|
1341
1341
|
min-width: 0;
|
|
1342
1342
|
overflow: hidden;
|
|
1343
1343
|
text-overflow: ellipsis;
|
|
1344
1344
|
white-space: nowrap;
|
|
1345
|
-
`,
|
|
1345
|
+
`,Hb=b.div`
|
|
1346
1346
|
display: flex;
|
|
1347
1347
|
align-items: center;
|
|
1348
1348
|
gap: 2px;
|
|
1349
1349
|
flex-shrink: 0;
|
|
1350
|
-
`,
|
|
1350
|
+
`,jb=b.div`
|
|
1351
1351
|
display: flex;
|
|
1352
1352
|
padding-top: 4px;
|
|
1353
1353
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1354
|
-
`,
|
|
1354
|
+
`,Gb=()=>{const i=v(),{isK8s:r}=S(),{clearStore:s}=Xa(),{dataStreamsApi:c}=qr();c.useDataStreams();const{dataStreams:d,selectedStreamName:u,setSelectedStreamName:h}=it(),m=p(null),[g,f]=l(!1),[b,y]=l(""),[C,x]=l(""),[w,T]=l(!1),[k,I]=l(!1),[N,E]=l(!1),[$,O]=l(""),[A,R]=l(!1);On(m,()=>f(!1)),a(()=>{g||y("")},[g]);const D=o(()=>{if(!b)return d;const e=b.toLowerCase();return d.filter(({name:t})=>t.toLowerCase().includes(e))},[d,b]),P=g?Il:Nl;return r?e(n,{children:[e(Fb,{ref:m,children:[e(zb,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(br,{size:24}),t(ee,{size:te.S,weight:500,nowrap:!0,children:(_=u,`Data Stream: ${_}`)}),t(ce,{label:d.length,status:Pe.Unknown,textSize:te.XXXS}),t(P,{size:20,fill:i.v2.colors.silver[200]})]}),g&&e(Mb,{children:[t(Xb,{children:t(vn,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(Bb,{children:0===D.length?t(Ub,{children:t(ee,{size:te.XS,color:ne.Secondary,children:"No streams match"})}):D.map(({name:n})=>{const i=n===Ba;return e(Ub,{"data-id":`stream-row-${n}`,$selected:n===u,onClick:()=>(e=>{e!==u&&(s(),h(e)),f(!1)})(n),children:[t(Vb,{children:t(ee,{size:te.XS,nowrap:!0,children:n})}),e(Hb,{children:[t(yt,{"data-id":`stream-edit-${n}`,icon:yl,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),x(n),T(!0)}}),!i&&t(yt,{"data-id":`stream-delete-${n}`,icon:ml,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),O(n),R(!0)}})]})]},`stream-${n}`)})}),t(jb,{children:t(Te,{"data-id":"add-stream-trigger",variant:Ie.Secondary,size:ke.S,leftIcon:gl,label:`${Ft.NEW} ${nt.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),s(),E(!0),I(!0)}})})]})]}),N&&t(vs,{defaultExcludeName:u,children:t(kg,{isOpen:k,onClose:()=>I(!1),onCloseEnd:()=>E(!1)})}),C&&t(vs,{children:t(Ig,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(Vr,{target:`${nt.STREAM_NAME.toLowerCase()} "${$}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{$&&await c.remove($)}})]}):null;var _},Wb=b(ae)`
|
|
1355
1355
|
width: 100%;
|
|
1356
1356
|
max-height: 320px;
|
|
1357
1357
|
overflow-y: auto;
|
|
1358
1358
|
gap: 8px;
|
|
1359
|
-
`,
|
|
1359
|
+
`,Kb=b(ie)`
|
|
1360
1360
|
width: 100%;
|
|
1361
1361
|
align-items: center;
|
|
1362
1362
|
gap: 8px;
|
|
1363
1363
|
padding: 8px 12px;
|
|
1364
1364
|
border-radius: 8px;
|
|
1365
1365
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1366
|
-
`,
|
|
1366
|
+
`,Yb=()=>{const i=v(),{selectedStreamName:r}=it(),{selectedSources:s,setSelectedSources:c}=$a(),{sourcesApi:p}=qr(),[u,h]=l(!1),[m,g]=l(!1),[f,b]=l(!1),[y,C]=l(!1),{toInstrument:S,toUninstrument:x,totalSelected:w}=o(()=>{const e=[],t=[];return Object.values(s).forEach(n=>{n.forEach(n=>{(e=>!1===e.markedForInstrumentation?.markedForInstrumentation)(n)?e.push(n):t.push(n)})}),{toInstrument:e,toUninstrument:t,totalSelected:e.length+t.length}},[s]),T=d(()=>{c({})},[c]),k=d(()=>h(!1),[]),I=d(()=>g(!1),[]),N=d(()=>b(!1),[]),E=d(()=>C(!1),[]);a(()=>{T()},[r,T]);const $=d((e,t)=>{if(!e.length)return;const n=new Map;e.forEach(e=>{const t=e.id.namespace,i=n.get(t)??[];i.push(e),n.set(t,i)}),p.persistV2(Object.fromEntries([...n.entries()].map(([e,n])=>[e,n.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,...e.region?{region:e.region}:{},selected:t,currentStreamName:r}))])))},[p,r]),O=d(()=>{p.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==In.StaticPod).map(Sn)),T()},[p,s,T]),A=d(()=>{$(S,!0),T()},[$,S,T]),R=d(()=>{$(x,!1),T()},[$,x,T]),D=d(()=>{$(S,!0),$(x,!1),T()},[$,S,x,T]),P=S.length>0,_=x.length>0,L=P&&_,F=o(()=>{const e=[{id:"multi-source-deselect",type:bn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:"Deselect",onClick:T}},{id:"multi-source-restart",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Restart",leftIcon:ql,onClick:()=>h(!0)}}];return L?e.push({id:"multi-source-apply",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Apply Changes",leftIcon:gl,onClick:()=>C(!0)}}):P?e.push({id:"multi-source-instrument",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Instrument",leftIcon:gl,onClick:()=>b(!0)}}):_&&e.push({id:"multi-source-uninstrument",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Uninstrument",leftIcon:ml,onClick:()=>g(!0)}}),e},[T,L,P,_]),z=e=>Da(e,Nt.Source,{extended:!0})||e.id.name;return e(n,{children:[t(jn,{isOpen:w>0,richTitle:{icon:Al,title:"Selected sources",badge:{label:w}},actions:F}),t(tt,{isOpen:u,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:k,denyButton:{label:"Go Back",variant:Ie.Secondary,onClick:k},approveButton:{label:"Confirm",variant:Ie.Primary,onClick:()=>{O(),k()}}}),t(Vr,{isOpen:f,action:"instrument",target:`${S.length} source${1===S.length?"":"s"}`,onClose:N,onDeny:N,onApprove:A}),t(Vr,{isOpen:m,action:"uninstrument",target:`${x.length} source${1===x.length?"":"s"}`,onClose:I,onDeny:I,onApprove:R}),t(tt,{isOpen:y,title:"Modify selected sources",description:"These changes are applied immediately. Disabled sources are re-instrumented; enabled sources are uninstrumented.",onClose:E,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:E},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:()=>{D(),E()}},children:e(Wb,{children:[S.map(n=>e(Kb,{children:[t(ce,{leftIcon:gl,status:Pe.Success,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:z(n)})]},`instrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`)),x.map(n=>e(Kb,{children:[t(ce,{leftIcon:Zl,status:Pe.Error,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:z(n)})]},`uninstrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`))]})})]})},Jb=C`
|
|
1367
1367
|
0% {
|
|
1368
1368
|
background-position: 200% 50%;
|
|
1369
1369
|
}
|
|
1370
1370
|
100% {
|
|
1371
1371
|
background-position: 0% 50%;
|
|
1372
1372
|
}
|
|
1373
|
-
`,
|
|
1373
|
+
`,qb=b.div`
|
|
1374
1374
|
display: flex;
|
|
1375
1375
|
align-items: center;
|
|
1376
1376
|
justify-content: space-evenly;
|
|
@@ -1381,43 +1381,43 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1381
1381
|
|
|
1382
1382
|
background: ${({theme:e})=>`linear-gradient(90deg, ${e.v2.colors.pink[500]} 0%, ${e.v2.colors.purple[400]} 25%, ${e.v2.colors.green[500]} 50%, ${e.v2.colors.purple[400]} 75%, ${e.v2.colors.pink[500]} 100%)`};
|
|
1383
1383
|
background-size: 200% 100%;
|
|
1384
|
-
animation: ${
|
|
1385
|
-
`,
|
|
1384
|
+
animation: ${Jb} 15s linear infinite;
|
|
1385
|
+
`,Zb=({onRedirectToSampling:n})=>{const i=v(),{capabilities:a}=qr(),l=o(()=>{const e=[];return a.canManageInstrumentationRules&&e.push(Ol),e.push(Al),a.canManageActions&&e.push(hl),e.push(kl),e},[a.canManageActions,a.canManageInstrumentationRules]);return e(ya,{children:[e(ut,{fullHeight:!0,customTitle:t(Gb,{}),customSearch:t(_b,{}),filters:t(ib,{}),children:[t(qb,{children:l.map((n,o)=>e(r,{children:[t(n,{size:24}),o<l.length-1&&t(ul,{fill:i.v2.colors.white[500]+oe["020"],size:24})]},n.name))}),t(Ib,{})]}),t(Lb,{onRedirectToSampling:n}),t(Yb,{})]})};var Qb;(e=>{e.Gateway="gateway",e.Node="node"})(Qb||(Qb={}));const ev=({onClickDownloadDiagnose:n,onClickRefresh:i,loading:a,disabled:l})=>{const r=o(()=>{const e=[];return n&&e.push({id:Gi(),type:bn.Button,buttonProps:{label:"Download Diagnose",leftIcon:or,size:ke.S,variant:Ie.Text,onClick:n,disabled:l}}),i&&e.push({id:Gi(),type:bn.Button,buttonProps:{label:"Refresh",leftIcon:Bl,size:ke.S,variant:Ie.Text,onClick:i,disabled:l,loading:a}}),e},[n,i,l,a]);return e(ie,{$alignItems:"center",$justifyContent:"space-between",children:[t(Ua,{icon:vr,title:"Collectors Pipeline"}),t(Va,{actions:r})]})},tv=({pod:n,onClose:i})=>{const{formatTimeAgo:a}=ln(),{collectorsApi:l}=qr(),{data:r}=l.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),s=o(()=>[{id:Gi(),title:"Node",label:r?.node??"-",withCopy:!0},{id:Gi(),title:"Status",badge:{status:Ha(r?.status),label:r?.status??"-"}}],[r]),c=o(()=>r?.containers?.map(e=>({id:Gi(),items:[{id:Gi(),title:"Container",label:e.name??"-"},{id:Gi(),title:"Status",label:e.startedAt?`${e.status} (since ${a(e.startedAt)})`:e.status},{id:Gi(),title:"Ready",badge:{status:e.ready?Pe.Success:Pe.Error,leftIcon:e.ready?wl:Tl,label:e.ready?"True":"False",invertColors:!0}},{id:Gi(),title:"Started",badge:{status:e.started?Pe.Success:Pe.Error,leftIcon:e.started?wl:Tl,label:e.started?"True":"False",invertColors:!0}},{id:Gi(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Gi(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Gi(),title:nt.RESTARTS,label:e.restarts.toString()},{id:Gi(),title:"State Reason",label:e.stateReason??"-"},{id:Gi(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Gi(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(Xt,{isOpen:!!n,header:{icon:Vl,title:"Pod Information",onClose:i},children:r?e(Gt,{bgTint:"1000",richTitle:{icon:Vl,title:r.name,withCopy:!0},children:[t(Gt,{bgTint:"900",cellsPerRow:2,items:s}),e(Gt,{bgTint:"900",richTitle:{icon:Jl,title:nt.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(fn,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(fn,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(fn,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Gt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:n})=>t(Gt,{bgTint:"800",cellsPerRow:2,items:n},e)):t(Oe,{title:"No containers",subTitle:"Pod has no containers"})}),t(Hr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})})})};var nv;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(nv||(nv={}));const iv=e=>{const t=[{key:nv.PodName,label:"Pod Name"},{key:nv.Status,label:"Status"},{key:nv.Restarts,label:nt.RESTARTS},{key:nv.NodeName,label:"Node Name"},{key:nv.Age,label:"Age"},{key:nv.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:nv.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},ov=({isLoading:n,pods:i,withSpanDropRate:a})=>{const r=v(),{formatTimeAgo:s}=ln(),[c,d]=l(null),p=o(()=>i.map(n=>({onClick:()=>d(n),cells:[{key:nv.PodName,rawValue:n.name},{key:nv.Status,rawValue:n.status,component:()=>{return e=n.status,t(ce,{status:Ha(e),label:e});var e}},{key:nv.Restarts,rawValue:n.restartsCount.toString()},{key:nv.NodeName,rawValue:n.nodeName},{key:nv.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:i}=n;if(!i)return t(ee,{children:"-"});const o=(i?.metricsAcceptedRps??0)+(i?.metricsDroppedRps??0),a=o>0?Math.round((i?.metricsDroppedRps??0)/o*100):0,l=a>0?Pe.Error:Pe.Success,r=(i?.exporterSuccessRps??0)+(i?.exporterFailedRps??0),s=r>0?Math.round((i?.exporterFailedRps??0)/r*100):0,c=s>0?Pe.Error:Pe.Success;return e(ie,{$gap:4,children:[t(Be,{text:`Accepted: ${i.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${i.metricsDroppedRps.toLocaleString()} spans/s`,children:t(ce,{status:l,label:`Receiver ${a}%`,leftIcon:l===Pe.Error?yr:Cr,useSecondaryTone:!0,invertColors:!0})}),t(Be,{text:`Success: ${i.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${i.exporterFailedRps.toLocaleString()} spans/s`,children:t(ce,{status:c,label:`Exporter ${s}%`,leftIcon:c===Pe.Error?yr:Cr,useSecondaryTone:!0,invertColors:!0})})]})}},{key:nv.Age,rawValue:s(n.creationTimestamp)},{key:nv.DockerImage,rawValue:n.image}]})),[i,r]);return e(Gt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:Vl,title:"Pods"},children:[t(Vn,{variant:Hn.Data,isLoading:n,columns:iv(a),rows:p}),t(tv,{pod:c,onClose:()=>d(null)})]})},av=({isOpen:e,onClose:n,title:i,yaml:o})=>t(Xt,{isOpen:e,header:{icon:Sr,title:i,onClose:n},children:t(Hr,{yaml:o,defaultOpen:!0})}),lv=e=>{switch(e){case ja.Healthy:return"All desired replicas are updated, available, and ready";case ja.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case ja.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case ja.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case ja.Down:return"No available replicas";case ja.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var rv;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(rv||(rv={}));const sv=b.div`
|
|
1386
1386
|
flex: 0.5;
|
|
1387
1387
|
padding: 12px;
|
|
1388
1388
|
border-radius: 12px;
|
|
1389
1389
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1390
|
-
`,
|
|
1390
|
+
`,cv=({selectedTab:n,gatewayInfo:i,nodeCollectorInfo:a,isLoading:r})=>{const{formatTimeAgo:s}=ln(),[c,d]=l(null),p=o(()=>(e=>{switch(e){case Qb.Gateway:return"Deployment";case Qb.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),u=o(()=>((e,t,n,i)=>{const o={status:Pe.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Qb.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Qb.Node:a=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return o}return a?{status:Pe.Info,label:"Rollout in progress",rightIcon:Bl,useSecondaryTone:!0}:l?{status:Pe.Disabled,label:`Last Rollout: ${i(l)}`}:o})(n,i,a,s),[i,a,n,s]),h=o(()=>((e,t,n,i)=>{let o=i?Pe.Info:Pe.Unknown,a=i?"Loading":ja.Unknown,l=i?"Fetching data...":lv(ja.Unknown);switch(e){case Qb.Gateway:o=t?.status?Ha(t?.status):o,a=t?.status??a,l=t?.status?lv(t.status):l;break;case Qb.Node:o=n?.status?Ha(n?.status):o,a=n?.status??a,l=n?.status?lv(n.status):l}return{status:o,title:a,description:l}})(n,i,a,r),[i,a,n,r]),m=o(()=>((e,t,n)=>{switch(e){case Qb.Gateway:return[{gaugeWidth:128,min:0,max:t?.hpa?.max??0,current:t?.hpa?.current??0,title:"HPA Spec",primaryLabel:"Current replicas",secondaryLabel:"Max replicas"}];case Qb.Node:return[{gaugeWidth:128,min:0,max:n?.nodes?.desired??0,current:n?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(n,i,a),[i,a,n]),g=o(()=>((e,t,n,i)=>{switch(e){case Qb.Gateway:return[{title:"Data throughput",cells:[{label:"Traces data",value:En(t?.throughputTracesBytesPerSec??0),isLoading:i},{label:"Metrics data",value:En(t?.throughputMetricsBytesPerSec??0),isLoading:i},{label:"Logs data",value:En(t?.throughputLogsBytesPerSec??0),isLoading:i}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:i},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:i}]}];case Qb.Node:return[{title:"Data Throughput",cells:[{label:"Traces data",value:En(n?.throughputTracesBytesPerSec??0),isLoading:i},{label:"Metrics data",value:En(n?.throughputMetricsBytesPerSec??0),isLoading:i},{label:"Logs data",value:En(n?.throughputLogsBytesPerSec??0),isLoading:i}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${n?.resources?.requests.cpu}/${n?.resources?.limits.cpu}`,isLoading:i},{label:"Memory",value:`${n?.resources?.requests.memory}/${n?.resources?.limits.memory}`,isLoading:i}]}];default:return[]}})(n,i,a,r),[i,a,n,r]),f=o(()=>(n===Qb.Gateway?i?.manifestYAML:a?.manifestYAML)??"",[i,a,n]),b=o(()=>(n===Qb.Gateway?i?.configMapYAML:a?.configMapYAML)??"",[i,a,n]);return e(Gt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Sr,title:p,badge:u},actions:[{id:Gi(),type:bn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:rv.ManifestYaml,label:p,icon:xr},{id:rv.ConfigMapYaml,label:"ConfigMap",icon:xr}]}}],children:[e(ie,{$gap:16,children:[t("div",{children:t(Ga,{...h})}),m.map(e=>t(sv,{children:t("div",{children:t(Wa,{...e})})},e.title)),g.map(e=>t(Ka,{...e},e.title))]}),t(av,{isOpen:c===rv.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(av,{isOpen:c===rv.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},dv=[{value:Qb.Gateway,label:"Gateway"},{value:Qb.Node,label:"Node Collector"}],pv=({minSupportedVersion:n})=>{const{isVersionSupported:i,version:a,minSupportedVersion:r}=S(n),[s,c]=l(Qb.Gateway),p=s===Qb.Gateway,u=s===Qb.Node,{collectorsApi:h,configApi:m}=qr(),{data:g}=m.useEffectiveConfig(),{data:f,loading:b,refetch:v}=h.useGatewayInfo({skip:!p}),{data:y=[],loading:C,refetch:x}=h.useGatewayPods({skip:!p}),{data:w,loading:T,refetch:k}=h.useNodeCollectorInfo({skip:!u}),{data:I=[],loading:N,refetch:E}=h.useNodeCollectorPods({skip:!u}),$=p&&(b||C)||u&&(T||N),O=d(()=>{p?(v(),x()):u&&(k(),E())},[p,u,v,x,k,E]),A=o(()=>p?y:I,[y,I,p]);return e(ya,{children:[t(ev,{disabled:!i,loading:$,onClickDownloadDiagnose:void 0,onClickRefresh:O}),e(Ya,{children:[e(ae,{children:[t(ve,{variant:Un.Underline,size:zt.L,options:dv,selected:s,setSelected:c}),t(cv,{selectedTab:s,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:$})]}),t(ov,{isLoading:$,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!i&&t(Kr,{minSupportedVersion:r,currentVersion:a||""})]})]})},uv=b.div`
|
|
1391
1391
|
display: inline-flex;
|
|
1392
1392
|
align-items: center;
|
|
1393
1393
|
min-width: 0;
|
|
1394
1394
|
overflow: hidden;
|
|
1395
1395
|
white-space: pre;
|
|
1396
1396
|
text-overflow: ellipsis;
|
|
1397
|
-
`,
|
|
1397
|
+
`,hv=b.div`
|
|
1398
1398
|
display: flex;
|
|
1399
1399
|
flex-direction: column;
|
|
1400
1400
|
gap: 4px;
|
|
1401
1401
|
min-width: 0;
|
|
1402
1402
|
flex: 1;
|
|
1403
1403
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
1404
|
-
`,
|
|
1404
|
+
`,mv=b(ie)`
|
|
1405
1405
|
flex-shrink: 0;
|
|
1406
1406
|
gap: 6px;
|
|
1407
1407
|
align-items: center;
|
|
1408
1408
|
min-height: 22px;
|
|
1409
|
-
`,
|
|
1409
|
+
`,gv=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],fv=[{value:"all",label:Ja},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],bv=({title:n,items:i,isLoading:a,showTypeFilter:r,onRuleClick:s,onCreateRule:c,onEditRule:p,onDeleteRule:u})=>{const h=v(),[m,g]=l(""),[f,b]=l("all"),y=o(()=>{let e=((e,t,n)=>n&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(i,f,r);return e=((e,t)=>{if(!t.trim())return e;const n=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(n),i=e.summary.map(e=>e.text).join("").toLowerCase();return t||i.includes(n)})})(e,m),e},[i,f,r,m]),C=o(()=>y.map(n=>{const i=n.typeBadge?((e,t)=>{const n=e.v2.colors;switch(t){case"Relevance":return{bg:n.blue[700],text:n.white[500]};case"Duration":return{bg:n.purple[700],text:n.white[500]};case"Error":return{bg:n.red[500],text:n.black[500]}}})(h,n.typeBadge):void 0;return{cells:[{key:"content",rawValue:n.summary.map(e=>e.text).join(""),component:()=>e(hv,{$disabled:n.disabled,children:[t(uv,{children:t(w,{parts:n.summary})}),n.name&&t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,children:n.name})]})},{key:"badges",rawValue:n.typeBadge||"",component:()=>e(mv,{children:[n.disabled&&t(ce,{label:Gn,textSize:te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&i&&t(ce,{label:n.typeBadge,textSize:te.XXXS,backgroundColor:i.bg,textColor:i.text})]})}],onClick:()=>s(n)}}),[y,h,s]),S=o(()=>{const e=e=>t(vl,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=d(e=>{const t=C.indexOf(e);if(t<0)return[];const n=y[t];return n?[{id:"edit","data-id":"sampling-rule-action-edit",label:wi,leftIcon:yl,onClick:()=>p(n.ruleId,n.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:S,onClick:()=>u(n.ruleId,n.samplingId)}]:[]},[C,y,p,u,S]);return t(ut,{fullHeight:!0,richTitle:{icon:sr,title:n,badge:{label:i.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:g,placeholder:"Search..",width:"500px",...r?{segment:{"data-id":"sampling-segment-type-filter",options:fv,selected:f,setSelected:b}}:{}},children:t(Vn,{variant:Hn.Pretty,hideHeader:!0,isLoading:a,noDataProps:m.trim()?{hideIcon:!0,title:qa,subTitle:el(m)}:{hideIcon:!0,title:Qa,button:{label:Za,onClick:c}},columns:gv,rows:C,getRowActions:x})})},vv=({docsUrl:n})=>{const{samplingApi:i,sourcesApi:r}=qr(),{items:s}=r.useSources(),c=o(()=>s.map(e=>({id:e.id})),[s]),{items:u,loading:h,k8sHealthProbesConfig:m,refetch:g}=i.useSamplingRules(),f=d((e,t)=>i.createNoisy?.({samplingId:e,rule:t}),[i]),b=d((e,t,n)=>i.updateNoisy?.(t,{samplingId:e,rule:n}),[i]),v=d((e,t)=>i.createHighlyRelevant?.({samplingId:e,rule:t}),[i]),y=d((e,t,n)=>i.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[i]),C=d((e,t)=>i.createCostReduction?.({samplingId:e,rule:t}),[i]),S=d((e,t,n)=>i.updateCostReduction?.(t,{samplingId:e,rule:n}),[i]),x=d((e,t,n)=>"noisy"===n?i.deleteNoisy?.(t,e):"highlyRelevant"===n?i.deleteHighlyRelevant?.(t,e):"costReduction"===n?i.deleteCostReduction?.(t,e):void 0,[i]),w=d((e,t)=>i.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[i]),T=o(()=>c.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[c]),k=o(()=>Array.from(new Set(c.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[c]),[I,N]=l(_.Noisy),[E,$]=l(null),[O,D]=l(!1),[P,Q]=l(!1),[ee,te]=l(null),[ne,oe]=l(!1),[le,re]=l(!1),[se,ce]=l(!1),[de,pe]=l(!1);p(!1),a(()=>{},[h,u]);const{pendingViewSamplingRule:ue,setPendingViewSamplingRule:he}=Cn();a(()=>{if(!ue)return;if(h||0===u.length)return;he(null);const e=L(u,ue.ruleId,ue.category);e&&(N(F[ue.category]),D(!1),$(e))},[h,u,ue,he]);const me=o(()=>A(m),[m]),ge=o(()=>z(u),[u]),fe=o(()=>R(ge?.rule??null),[ge]),be=o(()=>M(u),[u]),ye=o(()=>X(be?.rule??null),[be]),Ce=p(E);Ce.current=E,a(()=>{const e=Ce.current;if(!e)return;const t=B(u,e);t?$(t):($(null),D(!1))},[u]);const Se=o(()=>{const e=new Set;return ge&&e.add(ge.rule.ruleId),be&&e.add(be.rule.ruleId),e},[ge,be]),xe=o(()=>U(u,I,Se),[u,I,Se]),we=d(()=>Q(!0),[]),Ne=d(()=>Q(!1),[]);d(()=>pe(!1),[]);const Ee=d(async e=>{const t=u[0]?.id??"default";switch(K[I]){case"noisy":await f(t,j(e));break;case"highlyRelevant":await v(t,H(e));break;case"costReduction":await C(t,V(e))}Q(!1)},[u,I,f,v,C]),$e=d(e=>{const t=G(u,e);t&&(D(!1),$(t))},[u]),Oe=d(()=>{$(null),D(!1)},[]),Ae=d((e,t)=>{const n=E;if(n&&n.rule.ruleId===e&&n.samplingId===t)D(!0),$({...n});else for(const n of u){if(n.id!==t)continue;const i=[...n.noisyOperations.map(e=>({category:"noisy",rule:e})),...n.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...n.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(i)return D(!0),void $({category:i.category,rule:i.rule,samplingId:t,summary:W(i.category,i.rule)})}},[E,u]),Re=d(async(e,t,n)=>{const i=E?.category;if(i){switch(i){case"noisy":await b(n,t,j(e));break;case"highlyRelevant":await y(n,t,H(e));break;case"costReduction":await S(n,t,V(e))}D(!1)}},[E,b,y,S]),_e=d((e,t)=>{te({ruleId:e,samplingId:t})},[]),Le=d(async()=>{if(!ee)return;const{ruleId:e,samplingId:t}=ee,n=E?.category||K[I];await x(t,e,n),$(null),D(!1),te(null)},[ee,E,I,x]),Fe=d(()=>te(null),[]),ze=d(async(e,t)=>{await w(e,t),oe(!1)},[w]),Me=d(async e=>{const t=u[0]?.id??"default",n=ge;n?await y(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:n.rule.notes}):e&&await v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),re(!1)},[u,ge,v,y]),Xe=d(async(e,t)=>{const n=u[0]?.id??"default",i=be;i?await S(i.samplingId,i.rule.ruleId,{name:i.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:i.rule.notes}):e&&await C(n,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),ce(!1)},[u,be,C,S]),Be=d(e=>{const t=K[I];let n=null;switch(t){case"noisy":{const i=j(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation});break}case"highlyRelevant":{const i=H(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs});break}case"costReduction":{const i=V(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation});break}}return n?{message:tl,ruleId:n}:null},[u,I]),Ue=d(e=>{const t=E?.category,n=E?.rule.ruleId;if(!t)return null;let i=null;switch(t){case"noisy":{const o=j(e);i=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation},n);break}case"highlyRelevant":{const o=H(e);i=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs},n);break}case"costReduction":{const o=V(e);i=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation},n);break}}return i?{message:tl,ruleId:i}:null},[u,E]),Ve=d(e=>{Q(!1);for(const t of u){const n=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return D(!0),void $({category:n.category,rule:n.rule,samplingId:t.id,summary:W(n.category,n.rule)})}},[u]),He=o(()=>{const e=[];return n&&e.push({id:Gi(),type:bn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:nl,leftIcon:bl,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:Gi(),type:bn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:il,leftIcon:Bl,size:ke.S,variant:Ie.Text,onClick:g,loading:h}}),e.push({id:Gi(),type:bn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:ol,rightIcon:gl,size:ke.S,variant:Ie.Primary,onClick:we}}),e},[n,g,h,we]);return e(ya,{children:[e(ie,{$gap:12,$justifyContent:"space-between",children:[t(Ua,{icon:sr,title:ll,subTitle:al}),t(Va,{actions:He})]}),e(ae,{$gap:12,$fullHeight:!0,children:[t(ve,{variant:Un.Underline,size:zt.L,options:J,selected:I,setSelected:N}),e(ie,{$justifyContent:"space-between",children:[t(De,{status:Pe.Default,message:q[I]}),n&&t(Te,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:bl,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")})]}),I===_.Noisy?t(Ar,{title:ct,summary:me,onEdit:()=>oe(!0)}):I===_.HighlyRelevant?t(Ar,{title:ot,summary:fe,onEdit:()=>re(!0)}):I===_.CostReduction?t(Ar,{title:rt,summary:ye,onEdit:()=>ce(!0)}):null,t(bv,{title:Z[I],items:xe,isLoading:h,showTypeFilter:I===_.HighlyRelevant,onRuleClick:$e,onCreateRule:we,onEditRule:Ae,onDeleteRule:_e})]}),t(gg,{formType:is.View,data:E,defaultEditMode:O,onClose:Oe,onDelete:_e,onSaveEdit:Re,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:Ve}),t(gg,{formType:is.Create,isOpen:P,category:K[I],onClose:Ne,onSubmit:Ee,sourceOptions:T,namespaceOptions:k,validateForm:Be,onNavigateToDuplicate:Ve}),t(gg,{formType:is.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>oe(!1),onSave:ze}),t(gg,{formType:is.EditAutoHighlyRelevant,isOpen:le,enabled:!!ge&&!ge.rule.disabled,onClose:()=>re(!1),onSave:Me}),t(gg,{formType:is.EditAutoCostReduction,isOpen:se,enabled:!!be&&!be.rule.disabled,dropPercentage:be?.rule.percentageAtMost??25,onClose:()=>ce(!1),onSave:Xe}),t(tt,{title:dl,description:cl,isOpen:!!ee,onClose:Fe,denyButton:{label:sl,variant:Ie.Secondary,onClick:Fe},approveButton:{label:rl,variant:Ie.Primary,onClick:()=>{Le(),Fe()}}}),!1]})},yv=b.div`
|
|
1410
1410
|
padding: 12px;
|
|
1411
1411
|
border-radius: 12px;
|
|
1412
1412
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
1413
|
-
`,
|
|
1413
|
+
`,Cv=f(({id:e,data:n})=>t(yv,{"data-id":e,children:t(Oe,{...n})}));var Sv,xv;Cv.displayName=Cv.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(Sv||(Sv={})),(e=>{e.AnimatedTraffic="animated-traffic"})(xv||(xv={}));const wv=(e,t,n)=>{if(n)return{icons:[Yl],aggService:e,selected:!0};const i=e.isVirtual,o=i?[xn(e)]:t?wn(t):[wr],{priorotizedStatus:a}=i?{priorotizedStatus:void 0}:Ra(t?.conditions||[]);return{icons:o,status:a,isVirtual:i,aggService:e,selected:!0}},Tv=e=>!(!e||e.serviceName!==ku||e.id.namespace||e.id.name||e.id.kind),kv=new Ps,Iv={"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"},Nv=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},Ev={id:{namespace:"",name:"",kind:""},serviceName:ku,markedForInstrumentation:{markedForInstrumentation:!0}},$v=h(null),Ov=()=>{const e=m($v);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},Av=({serviceMap:e,children:n})=>{const i=v(),{sourcesApi:r}=qr(),{items:s}=r.useSources(),[c,p,u]=Ss([]),[h,m,g]=xs([]),[f,b]=l(0),y=d(()=>b(e=>e+1),[]),[C,S]=l(""),[x,w]=l(null),[T,k]=l(null),I=d(e=>k(t=>t===e?null:e),[]),N=d(()=>k(null),[]),E=d((e,t)=>{const n=new Set(e);p(e=>e.map(e=>e.type===Sv.MapItem&&n.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[p]);a(()=>{let t=!1;const n=(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}=Nv(t.nodeId),a=i(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=Nv(e?.nodeId??"");e.isVirtual&&(n.add(t),o(i(t,e.serviceName,!0).attributes,e.nodeAttributes));let r=a.connectionMap.get(t);if(r||(r={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,r)),r.totalRequests+=e.requests,e.dateTime>r.lastDateTime&&(r.lastDateTime=e.dateTime),l){const t=r.details.find(e=>e.value===l);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):r.details.push({value:l,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 l=[];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)),l.push({graphKey:e,serviceName:n,isVirtual:i,connections:t,attributes:o})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),o=(({sources:e,aggregatedServiceMap:t})=>{const n=[],i={x:0,y:0};if(t.length&&e.length)for(const o of t){const t=e.find(e=>o.serviceName===e.serviceName||o.serviceName===e.id.name),a=Tv(t);n.push({id:o.graphKey,type:Sv.MapItem,position:i,data:wv(o,t,a),measured:{width:80,height:80}})}else n.push({id:Sv.NoData,type:Sv.NoData,position:i,data:{subTitle:nt.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:n,sources:[Ev].concat(s)});if(1===o.length&&o[0].id===Sv.NoData)return p(o),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:n})=>{const i=[],o=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=t.graphKey,a=o.get(n);if(!a)continue;const l=a.data?.status===Pe.Error;for(const a of t.connections){const r=a.targetGraphKey;o.has(r)&&i.push({id:`${n}-to-${r}`,type:"smoothstep",source:n,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Cs.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return i})({theme:i,nodes:o,aggregatedServiceMap:n});m(a);const l=o.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,n={})=>{const i={id:"root",layoutOptions:{...Iv,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===ku?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},o=await kv.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}})(o,a).then(({nodes:e})=>{t||(p(e),S(l),y())}),()=>{t=!0};p(e=>{const t=new Map(e.map(e=>[e.id,e]));return o.map(e=>{const n=t.get(e.id);return n?e.type===Sv.MapItem&&n.type===Sv.MapItem?{...e,position:n.position,data:{...e.data,selected:n.data.selected}}:{...e,position:n.position}:e})})},[i,e,s,C]);const $=o(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:xv.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),O=o(()=>({nodes:c,edges:$,onNodesChange:u,onEdgesChange:g,setNodesSelected:E,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:I,resetActiveNode:N}),[c,$,u,g,E,f,x,T,I,N]);return t($v.Provider,{value:O,children:n})},Rv=b.div`
|
|
1414
1414
|
border: 1px ${({theme:e,$isSelected:t,$isVirtual:n})=>t?`solid ${e.v2.colors.blue[300]}`:n?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
|
|
1415
1415
|
border-radius: 8px;
|
|
1416
1416
|
cursor: pointer;
|
|
1417
1417
|
opacity: ${({$isVirtual:e})=>e?.8:1};
|
|
1418
|
-
`,Rv=b.div`
|
|
1419
|
-
position: relative;
|
|
1420
1418
|
`,Dv=b.div`
|
|
1419
|
+
position: relative;
|
|
1420
|
+
`,Pv=b.div`
|
|
1421
1421
|
position: absolute;
|
|
1422
1422
|
top: 100%;
|
|
1423
1423
|
left: 50%;
|
|
@@ -1426,7 +1426,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1426
1426
|
align-items: center;
|
|
1427
1427
|
gap: 4px;
|
|
1428
1428
|
margin-top: 4px;
|
|
1429
|
-
`,
|
|
1429
|
+
`,_v=f(({id:i,data:a})=>{const{icons:l,status:r,isVirtual:s}=a,c=v(),{activeNodeId:d,hoveredNodeId:p}=Ov(),{isUserSource:u,isNodeSelected:h,isHovered:m}=o(()=>({isUserSource:i===ku,isNodeSelected:d===i,isHovered:p===i}),[i,d,p,i]),{isSelected:g,isHighlighted:f}=o(()=>({isSelected:h||u,isHighlighted:h||m||u}),[h,m,u]),b=r?Fn(r,c):null;return e(n,{children:[t(ws,{type:"source",position:Ts.Right,style:{visibility:"hidden"}}),t(ws,{type:"target",position:Ts.Left,style:{visibility:"hidden"}}),e(Dv,{"data-id":i,children:[t(Rv,{$isSelected:g,$isVirtual:s,children:t(Tn,{padding:12,icons:l,status:f?Pe.Info:r})}),e(Pv,{children:[b&&t(b,{}),t(ee,{size:te.XXS,nowrap:!0,children:i})]})]})]})});_v.displayName=_v.name;const Lv=b.div`
|
|
1430
1430
|
display: flex;
|
|
1431
1431
|
flex-direction: column;
|
|
1432
1432
|
gap: 12px;
|
|
@@ -1439,10 +1439,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1439
1439
|
top: 16px;
|
|
1440
1440
|
left: 8px;
|
|
1441
1441
|
z-index: ${({theme:e})=>e.v2.zIndex.drawer};
|
|
1442
|
-
`,
|
|
1442
|
+
`,Fv=({children:e})=>t(Lv,{children:e});var zv,Mv;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(zv||(zv={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(Mv||(Mv={}));const Xv=b.div`
|
|
1443
1443
|
flex: 1 1 auto;
|
|
1444
1444
|
min-height: 0;
|
|
1445
|
-
`,
|
|
1445
|
+
`,Bv=()=>{const{nodes:n,activeNodeId:i,resetActiveNode:a}=Ov(),[r,s]=l(zv.All),c=o(()=>{const e=new Map;for(const t of n)t.type===Sv.MapItem&&e.set(t.id,t);return e},[n]),d=o(()=>c.get(i??""),[c,i]),{inbound:p,outbound:u}=o(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:Mv.Outbound,totalRequests:e.totalRequests});for(const t of c.values())if(t.id!==d.id)for(const n of t.data.aggService?.connections??[])n.targetGraphKey===d.id&&e.push({peerId:t.id,direction:Mv.Inbound,totalRequests:n.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,c]);if(!d)return null;const h=[zv.All,zv.Inbound].includes(r)&&p.length>0,m=[zv.All,zv.Outbound].includes(r)&&u.length>0;return e(Fv,{children:[e(ie,{$width:"100%",$gap:8,children:[t(Te,{variant:Ie.Text,size:ke.S,leftIcon:Ml,onClick:a}),t(Tn,{icons:d.data.icons}),t(ee,{size:te.XS,children:d.id})]}),t(ve,{fullWidth:!0,options:[{label:`${zv.All}`,value:zv.All,badge:{label:`${p.length+u.length}`}},{label:`${zv.Inbound}`,value:zv.Inbound,badge:{label:`${p.length}`}},{label:`${zv.Outbound}`,value:zv.Outbound,badge:{label:`${u.length}`}}],selected:r,setSelected:s}),h&&t(Vv,{halfHeight:m,title:"Inbound",icon:Wl,connections:p,mapNodesById:c}),m&&t(Vv,{halfHeight:h,title:"Outbound",icon:Kl,connections:u,mapNodesById:c})]})},Uv=b.div`
|
|
1446
1446
|
display: flex;
|
|
1447
1447
|
flex-direction: column;
|
|
1448
1448
|
gap: 8px;
|
|
@@ -1450,17 +1450,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1450
1450
|
border-radius: 12px;
|
|
1451
1451
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1452
1452
|
height: ${({$halfHeight:e})=>e?"48%":"100%"};
|
|
1453
|
-
`,
|
|
1453
|
+
`,Vv=({halfHeight:n,title:i,icon:o,connections:a,mapNodesById:l})=>{const r=v();return e(Uv,{$halfHeight:n,children:[e(ie,{children:[t(o,{size:16,fill:r.v2.colors.grey[300]}),t(ee,{size:te.XXS,color:ne.Secondary,children:i})]}),t(Xv,{children:t(yn,{gap:4,elements:a.map(e=>t(jv,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},Hv=b.div`
|
|
1454
1454
|
display: flex;
|
|
1455
1455
|
align-items: center;
|
|
1456
1456
|
gap: 8px;
|
|
1457
1457
|
padding: 8px;
|
|
1458
1458
|
border-radius: 8px;
|
|
1459
1459
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1460
|
-
`,
|
|
1460
|
+
`,jv=({connection:n,peerNode:i})=>e(Hv,{children:[i&&t(Tn,{icons:i.data.icons}),e(ie,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(ee,{size:te.XXS,children:n.peerId}),t(ce,{label:n.totalRequests,tooltip:"Total requests"})]})]}),Gv="0;0.5;1",Wv=f(({id:i,sourceX:o,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=ks({sourceX:o,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${i}__animated-traffic-motion`,m=p.v2.colors.blue[700],g=p.v2.colors.blue[900],f=p.v2.colors.blue[500],b="4s";return e(n,{children:[t(Is,{id:i,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(Ns,{children:e("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[t("path",{id:h,d:u,fill:"none",stroke:"none"}),Array.from({length:5}).map((n,i)=>{const o=`-${(.8*i).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:o,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:o,repeatCount:"indefinite",keyTimes:Gv,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:o,repeatCount:"indefinite",keyTimes:Gv,values:`${g};${f};${f}`})]},i)})]})})]})});Wv.displayName=Wv.name;const Kv=b.div`
|
|
1461
1461
|
flex: 1 1 auto;
|
|
1462
1462
|
min-height: 0;
|
|
1463
|
-
`,
|
|
1463
|
+
`,Yv=({})=>{const{nodes:n,setNodesSelected:i,resetActiveNode:a}=Ov(),[r,s]=l(""),c=o(()=>n.filter(e=>e.type===Sv.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[n]),p=o(()=>c.filter(e=>e.data.selected),[c]),u=o(()=>c.filter(e=>e.id.toLowerCase().includes(r.toLowerCase())),[c,r]),h=o(()=>u.every(e=>e.data.selected),[u]),m=d(()=>{const e=!h;i(u.map(e=>e.id),e),e||a()},[u,h,i,a]);return c.length?e(Fv,{children:[e(ie,{$width:"100%",$gap:8,children:[t(ee,{size:te.XS,children:"Services"}),t(ce,{label:c.length})]}),t(vn,{width:"100%",value:r,onChange:s}),e(ie,{$width:"100%",$justifyContent:"space-between",children:[t(ee,{size:te.XXXS,children:`Showing ${p.length} out of ${c.length}`}),t(ee,{"data-id":"namespaces-select-all",onClick:m,disabled:!u.length,size:te.XS,children:h?nt.UNSELECT_ALL:nt.SELECT_ALL})]}),t(Kv,{children:t(yn,{gap:4,elements:u.map(e=>t(qv,{node:e},e.id))})})]}):null},Jv=b.div`
|
|
1464
1464
|
display: flex;
|
|
1465
1465
|
align-items: center;
|
|
1466
1466
|
gap: 8px;
|
|
@@ -1468,7 +1468,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1468
1468
|
border-radius: 8px;
|
|
1469
1469
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1470
1470
|
cursor: pointer;
|
|
1471
|
-
`,
|
|
1471
|
+
`,qv=({node:n})=>{const{setNodesSelected:i,activeNodeId:o,resetActiveNode:a}=Ov(),l=d(()=>{const e=!n.data.selected,t=o===n.id;i([n.id],e),!e&&t&&a()},[n,o,i,a]);return e(Jv,{onClick:l,children:[t(Q,{value:n.data.selected||!1,onChange:l}),t(Tn,{icons:n.data.icons}),t(ee,{size:te.XXS,children:n.id})]},n.id)},Zv=b.div`
|
|
1472
1472
|
position: relative;
|
|
1473
1473
|
height: 100%;
|
|
1474
1474
|
.react-flow__attribution {
|
|
@@ -1477,7 +1477,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1477
1477
|
* {
|
|
1478
1478
|
transition: none;
|
|
1479
1479
|
}
|
|
1480
|
-
`,
|
|
1480
|
+
`,Qv=b.div`
|
|
1481
1481
|
.react-flow__controls {
|
|
1482
1482
|
display: flex;
|
|
1483
1483
|
align-items: center;
|
|
@@ -1503,33 +1503,33 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1503
1503
|
}
|
|
1504
1504
|
}
|
|
1505
1505
|
}
|
|
1506
|
-
`,
|
|
1506
|
+
`,ey={[Sv.MapItem]:_v,[Sv.NoData]:Cv},ty={[xv.AnimatedTraffic]:Wv},ny={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},iy=({trigger:e})=>{const{fitView:t}=Ds(),n=p(!0);return a(()=>{n.current?n.current=!1:e>0&&requestAnimationFrame(()=>t(ny))},[e,t]),null},oy=({onRefresh:n})=>{const{nodes:i,edges:a,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=Ov(),p=o(()=>{const e=new Set(i.filter(e=>e.type===Sv.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const n of a)e.has(n.source)&&t.add(n.target),e.has(n.target)&&t.add(n.source);return i.filter(e=>e.type!==Sv.MapItem||e.data.selected||t.has(e.id))},[i,a]);return e($s,{zoomOnScroll:!0,nodes:p,nodeTypes:ey,edges:a,edgeTypes:ty,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(Os,{}),t(iy,{trigger:l}),t(Qv,{children:t(As,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:ny,children:t(Rs,{onClick:n,children:t(Bl,{})})})})]})},ay=n=>t(Es,{children:e(Zv,{children:[t(oy,{...n}),t(Yv,{}),t(Bv,{})]})}),ly=b.div`
|
|
1507
1507
|
width: 100%;
|
|
1508
1508
|
flex: 1;
|
|
1509
1509
|
align-self: stretch;
|
|
1510
1510
|
min-height: 0;
|
|
1511
1511
|
height: 100%;
|
|
1512
1512
|
position: relative;
|
|
1513
|
-
`,
|
|
1513
|
+
`,ry=()=>{const{serviceMapApi:e}=qr(),{data:n,refetch:i}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(Av,{serviceMap:n?.serviceMap??[],children:t(ly,{children:t(ay,{onRefresh:i})})})},sy=b.div`
|
|
1514
1514
|
display: flex;
|
|
1515
1515
|
align-items: center;
|
|
1516
1516
|
justify-content: space-between;
|
|
1517
1517
|
padding: 0 12px;
|
|
1518
|
-
`,
|
|
1518
|
+
`,cy=b.div`
|
|
1519
1519
|
display: flex;
|
|
1520
1520
|
align-items: center;
|
|
1521
1521
|
gap: 8px;
|
|
1522
|
-
`,
|
|
1522
|
+
`,dy=b.div`
|
|
1523
1523
|
width: 1px;
|
|
1524
1524
|
height: 20px;
|
|
1525
1525
|
background-color: ${({theme:e})=>e.v2.colors.silver[500]};
|
|
1526
|
-
`,
|
|
1526
|
+
`,py=({disabled:n,loading:i,onClickShowYaml:a,onClickReset:r,onClickRefresh:s})=>{const c=v(),[d,p]=l(!1),u=o(()=>a?[{id:Gi(),type:bn.Button,buttonProps:{label:"Show Config YAML",leftIcon:xr,size:ke.S,variant:Ie.Secondary,onClick:a,disabled:n}}]:[],[a,n]),h=o(()=>{const e=[];return s&&e.push({id:Gi(),type:bn.Button,buttonProps:{leftIcon:Bl,tooltip:"Refresh",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,onClick:s,disabled:n,loading:i}}),r&&e.push({id:Gi(),type:bn.Button,buttonProps:{leftIcon:ml,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,textColor:c.v2.colors.red[500],onClick:()=>p(!0),disabled:n}}),e},[n,i,r,s,c]),m=u.length>0,g=h.length>0;return e(sy,{children:[t(Ua,{icon:Ul,title:"Odigos Settings"}),e(cy,{children:[m&&t(Va,{actions:u}),m&&g&&t(dy,{}),g&&t(Va,{actions:h})]}),t(tt,{isOpen:d,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:Ie.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:Ie.Primary,onClick:()=>{r?.(),p(!1)}}})]})},uy=b(ae)`
|
|
1527
1527
|
width: 220px;
|
|
1528
1528
|
flex-shrink: 0;
|
|
1529
1529
|
height: 100%;
|
|
1530
1530
|
gap: 4px;
|
|
1531
1531
|
overflow-y: auto;
|
|
1532
|
-
`,
|
|
1532
|
+
`,hy=({options:e,selected:n,setSelected:i,disabled:o})=>t(uy,{children:e.map(e=>t(Xs,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:n===e.id,disabled:o,onClick:()=>i(e.id)},e.id))}),my=b(ae)`
|
|
1533
1533
|
width: 100%;
|
|
1534
1534
|
/* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
|
|
1535
1535
|
max-width: 844px;
|
|
@@ -1539,25 +1539,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1539
1539
|
gap: 24px;
|
|
1540
1540
|
flex: 1;
|
|
1541
1541
|
min-height: 0;
|
|
1542
|
-
`,
|
|
1542
|
+
`,gy=b(ie)`
|
|
1543
1543
|
flex: 1;
|
|
1544
1544
|
min-height: 0;
|
|
1545
1545
|
width: 100%;
|
|
1546
1546
|
align-self: stretch;
|
|
1547
|
-
`,
|
|
1547
|
+
`,fy=b(ae)`
|
|
1548
1548
|
flex: 1;
|
|
1549
1549
|
min-height: 0;
|
|
1550
1550
|
height: 100%;
|
|
1551
1551
|
max-width: 600px;
|
|
1552
1552
|
overflow-y: auto;
|
|
1553
|
-
`,
|
|
1553
|
+
`,by=b(ie)`
|
|
1554
1554
|
gap: 8px;
|
|
1555
1555
|
width: 100%;
|
|
1556
1556
|
align-items: center;
|
|
1557
|
-
`,
|
|
1557
|
+
`,vy=b.div`
|
|
1558
1558
|
flex: 1;
|
|
1559
1559
|
min-width: 0;
|
|
1560
|
-
`,
|
|
1560
|
+
`,yy=e=>"general"===e.name?0:"advanced"===e.name?2:1,Cy=({minSupportedVersion:i})=>{const{isVersionSupported:r,version:s,isEnterprise:c,minSupportedVersion:d}=S(i),{configApi:p}=qr(),{data:u,loading:h}=p.useConfigYamls(),{data:m,loading:g,refetch:f}=p.useEffectiveConfig(),b=u?.configYamls??[],[v,y]=l(!1),C=o(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...n}=m;return n},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:I}=qt(C);a(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const N=o(()=>[...b].sort((e,t)=>yy(e)-yy(t)),[b]),E=o(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(m?.provenance),[m?.provenance]),$=o(()=>{const e=new Set;for(const t of b)for(const n of t.fields)n.componentType===jt.Dropdown&&e.add(n.helmValuePath);return e},[b]),O=o(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,R]=l(!1),[D,P]=l(!1),_=o(()=>[{id:Gi(),type:bn.Button,buttonProps:{"data-id":"settings-save",variant:Ie.Primary,size:ke.S,label:"Save Changes",leftIcon:El,loading:v,onClick:()=>R(!0)}},{id:Gi(),type:bn.Button,buttonProps:{"data-id":"settings-cancel",variant:Ie.Secondary,size:ke.S,label:"Cancel",leftIcon:$l,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=o(()=>N.map(e=>({id:e.name,label:e.displayName})),[N]),F=o(()=>N.map(e=>e.name),[N]),{selectedSection:z,setSelectedSection:M,setSectionRef:X,setScrollContainerRef:B}=pl({sectionNames:F});return t(ya,{$gap:24,children:e(my,{children:[t(py,{disabled:!r,loading:h||g,onClickShowYaml:()=>P(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(Ya,{children:[!r&&t(Kr,{minSupportedVersion:d,currentVersion:s||""}),t(jn,{isOpen:I,richTitle:{icon:Ul,title:"Config Settings"},actions:_}),t(tt,{isOpen:A,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>R(!1),denyButton:{label:"Keep editing",variant:Ie.Secondary,onClick:()=>R(!1)},approveButton:{label:"Save changes",variant:Ie.Primary,onClick:()=>{(async()=>{const e=((e,t)=>{const n=(e,t,n)=>{for(let n=0;n<t.length-1;n++){const i=t[n];i in e&&"object"==typeof e[i]&&null!==e[i]||(e[i]={}),e=e[i]}e[t[t.length-1]]=n},i=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let o=i;for(const e of t){if(null==o||"object"!=typeof o){o=void 0;break}o=o[e]}"string"==typeof o&&n(i,t,o.replaceAll("-","_"))}return i})(k(C,x),$);await(async e=>{p.updateLocalUiConfig&&(y(!0),await p.updateLocalUiConfig(e),y(!1),await f())})(e),w(void 0,void 0,{})})(),R(!1)}}}),e(gy,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(hy,{options:L,selected:z,setSelected:M,disabled:!r}),t(fy,{ref:B,$gap:24,$width:"100%",children:b.length?N.map(i=>t(ut,{id:i.name,bordered:!0,ref:e=>X(i.name,e),customTitle:t(ee,{size:te.M,weight:500,color:ne.Primary,children:i.displayName}),children:t(ae,{$gap:24,children:i.fields.map(i=>{if(i.isEnterpriseOnly&&!c)return null;if(i.renderCondition&&!Qt(i.renderCondition,[],O))return null;const o=kt(i.componentProps||"{}",{}),a=E[i.helmValuePath],l=i.componentType===jt.Toggle,r=t(ee,{size:te.XS,weight:500,color:ne.Primary,children:i.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Pe.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Pe.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Pe.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=s?t(ce,{...s}):null,p=i.description?t(ee,{size:te.XXS,color:ne.Secondary,children:i.description}):null,u=e(ae,{$gap:4,children:[e(ie,{$gap:8,$alignItems:"center",children:[r,d]}),p]}),h=t(Yr,{componentType:i.componentType,inputType:o.type,name:i.helmValuePath,disabled:i.isHelmOnly||v,value:T("formData",i.helmValuePath),setValue:e=>w(i.helmValuePath,e),dropdownOptions:o.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Et.S},i.helmValuePath),m=i.isHelmOnly?t(Be,{text:"This field can only be updated via the Helm values.yaml file",children:t(Tr,{})}):null;return t(ae,{$gap:8,children:l?e(ie,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(ie,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(n,{children:[u,e(by,{children:[t(vy,{children:h}),m]})]})},i.helmValuePath)})})},i.name)):h?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(ut,{richTitle:{icon:Ul,title:"Config Settings"},children:t(Oe,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(Xt,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:xr,title:"Effective Config YAML",onClose:()=>P(!1)},children:g&&!m?.manifestYAML?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(Hr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},Sy=b.div`
|
|
1561
1561
|
position: fixed;
|
|
1562
1562
|
bottom: 12px;
|
|
1563
1563
|
left: 12px;
|
|
@@ -1566,4 +1566,4 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1566
1566
|
flex-direction: column-reverse;
|
|
1567
1567
|
gap: 6px;
|
|
1568
1568
|
max-width: 600px;
|
|
1569
|
-
`,
|
|
1569
|
+
`,xy=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:i}=nn(),o=e.filter(({dismissed:e})=>!e);return t(Sy,{children:o.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=o.length-s;return t(De,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{n(e),t&&i(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{Dc as AddActionDrawer,dc as AddActionForm,kg as AddDataStreamModal,Vc as AddDestinationDrawer,uc as AddDestinationForm,Hc as AddRuleDrawer,Cc as AddRuleForm,ld as AddSourceDrawer,Df as CentralConnections,jp as CloudConnectorStep,Kp as CreateCloudConnectorDrawer,If as CreateNewType,xc as DataStreamForm,Sc as DataStreamMergeWarning,Zp as EditActionDrawer,Qp as EditConfigDrawer,Ig as EditDataStreamModal,tu as EditDestinationDrawer,iu as EditRuleDrawer,$m as EditSourceDrawer,wc as EditSourceForm,Wf as Onboarding,$g as OnboardingDone,Zb as Overview,pv as PipelineCollectors,ig as RecommendationsDrawer,kr as RegexTesterDrawer,Xm as SECTION_ORDER,Tf as SamplingOnboardingModal,gg as SamplingRuleDrawer,$c as SamplingRuleForm,vv as SamplingRules,ry as ServiceMap,Cy as Settings,Tg as SystemDrawer,dv as TABS,xy as ToastList,Mm as countRecommended,Fm as getRecommendationState,zm as groupRecommendations};
|