@odigos/ui-kit 0.0.275 → 0.0.276
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/lib/chunks/{helpers-BkaWRtR9.js → helpers-DifX1XM0.js} +1 -1
- package/lib/chunks/{index-D3cEk2g_.js → index-BxDn2YI2.js} +1 -1
- package/lib/chunks/source-instrument-form-context-M5A5jkXP.js +5 -0
- package/lib/chunks/{ui-components-BUMZXMZ4.js → ui-components-B2sd5xH7.js} +230 -230
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers.js +88 -76
- package/lib/contexts/odigos-api/hooks/use-sources-api.d.ts +1 -1
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store/useFilterStore.d.ts +4 -0
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/source-instrument-form-context-B40tRNcP.js +0 -5
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMemo as i,useEffect as a,useState as l,Fragment as r,forwardRef as s,useImperativeHandle as c,useCallback as d,useRef as p,Children as u,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,g as T,f as k,e as I,q as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMemo as i,useEffect as a,useState as l,Fragment as r,forwardRef as s,useImperativeHandle as c,useCallback as d,useRef as p,Children as u,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,g as T,f as k,e as I,q as E,h as N,j as O,k as $,p as A,l as R,c as D,r as _,S as P,s as L,R as F,t as M,w as z,o as B,x as X,y as U,z as V,A as H,B as j,D as G,E as W,F as K,G as Y,H as J,I as q,J as Z}from"./chunks/helpers-DifX1XM0.js";import{C as Q,e as ee,g as te,f as ne,h as oe,bx as ie,F as ae,by as le,bz as re,bA as se,bB as ce,bn as de,d as pe,k as ue,I as he,bC as me,o as ge,p as fe,w as be,Y as ve,bD as ye,bE as Ce,ar as Se,bF as xe,bG as we,B as Te,i as ke,j as Ie,x as Ee,a4 as Ne,bo as Oe,b0 as $e,bH as Ae,bI as Re,u as De,N as _e,S as Pe,bJ as Le,bt as Fe,bu as Me,bs as ze,bK as Be,af as Xe,T as Ue,ad as Ve,ae as He,ab as je,aa as Ge,ac as We,a9 as Ke,b7 as Ye,a8 as Je,bL as qe,bM as Ze,bN as Qe,bO as et,W as tt,m as nt,bb as ot,bP as it,bQ as at,bR as lt,bS as rt,bT as st,bU as ct,bV as dt,bW as pt,Q as ut,bX as ht,bY as mt,bZ as gt,a$ as ft,br as bt,s as vt,b_ as yt,b$ as Ct,b1 as St,c0 as xt,c1 as wt,aY as Tt,v as kt,bv as It,ba as Et,q as Nt,c2 as Ot,bc as $t,c3 as At,c4 as Rt,be as Dt,c5 as _t,b3 as Pt,c6 as Lt,l as Ft,y as Mt,D as zt,c7 as Bt,ag as Xt,c8 as Ut,c9 as Vt,n as Ht,bh as jt,bm as Gt,z as Wt,ca as Kt,cb as Yt,bl as Jt,cc as qt,a3 as Zt,cd as Qt,ce as en,b6 as tn,H as nn,cf as on,cg as an,ch as ln,ci as rn,cj as sn,ck as cn,cl as dn,cm as pn,O as un,cn as hn,co as mn,A as gn,b2 as fn,a_ as bn,cp as vn,cq as yn,cr as Cn,cs as Sn,ct as xn,cu as wn,bw as Tn,cv as kn,cw as In,cx as En,cy as Nn,cz as On,b as $n,cA as An,cB as Rn,M as Dn,cC as _n,cD as Pn,cE as Ln,cF as Fn,cG as Mn,cH as zn,cI as Bn,cJ as Xn,cK as Un,cL as Vn,cM as Hn,cN as jn,cO as Gn,cP as Wn,cQ as Kn,cR as Yn,cS as Jn,aO as qn,cT as Zn,cU as Qn,cV as eo,cW as to,cX as no,cY as oo,cZ as io,c_ as ao,c$ as lo,d0 as ro,d1 as so,d2 as co,d3 as po,d4 as uo,d5 as ho,ax as mo,d6 as go,d7 as fo,b4 as bo,d8 as vo,d9 as yo,da as Co,db as So,dc as xo,dd as wo,de as To,df as ko,dg as Io,dh as Eo,di as No,dj as Oo,dk as $o,dl as Ao,dm as Ro,dn as Do,dp as _o,dq as Po,dr as Lo,ds as Fo,dt as Mo,du as zo,dv as Bo,dw as Xo,dx as Uo,dy as Vo,dz as Ho,dA as jo,dB as Go,dC as Wo,dD as Ko,dE as Yo,dF as Jo,dG as qo,dH as Zo,dI as Qo,dJ as ei,dK as ti,dL as ni,dM as oi,dN as ii,dO as ai,dP as li,dQ as ri,dR as si,dS as ci,dT as di,dU as pi,dV as ui,dW as hi,dX as mi,dY as gi,dZ as fi,d_ as bi,d$ as vi,e0 as yi,e1 as Ci,e2 as Si,e3 as xi,e4 as wi,e5 as Ti,e6 as ki,e7 as Ii,e8 as Ei,e9 as Ni,ea as Oi,eb as $i,ec as Ai,ed as Ri,ee as Di,ef as _i,eg as Pi,eh as Li,ei as Fi,ej as Mi,ek as zi,el as Bi,P as Xi,em as Ui,en as Vi,eo as Hi,ep as ji,eq as Gi,er as Wi,es as Ki,aZ as Yi,et as Ji,$ as qi,eu as Zi,ev as Qi,ew as ea,ex as ta,ey as na,ez as oa,eA as ia,eB as aa,eC as la,eD as ra,eE as sa,eF as ca,bd as da,eG as pa,R as ua,a as ha,eH as ma,eI as ga,eJ as fa,eK as ba,eL as va,eM as ya,eN as Ca,eO as Sa,eP as xa,eQ as wa,eR as Ta,eS as ka,eT as Ia,eU as Ea,eV as Na,eW as Oa,eX as $a,eY as Aa,eZ as Ra,e_ as Da,e$ as _a,f0 as Pa}from"./chunks/ui-components-B2sd5xH7.js";import{ChevronRightIcon as La,ActionIcon as Fa,TrashIcon as Ma,PlusIcon as za,ArrowRightIcon as Ba,VSquareIcon as Xa,XSquareIcon as Ua,BookIcon as Va,DeleteIcon as Ha,EditIcon as ja,GoLogo as Ga,JavaLogo as Wa,PhpLogo as Ka,DestinationIcon as Ya,ChevronUpIcon as Ja,ChevronDownIcon as qa,VIcon as Za,XIcon as Qa,InstrumentationRuleIcon as el,SourceIcon as tl,NamespacesIcon as nl,AzureIcon as ol,GoogleCloudPlatformLogo as il,AwsLogo as al,CloudConnectorIcon as ll,EyeOpenIcon as rl,OdigosLogo as sl,ArrowLeftIcon as cl,ISquareIcon as dl,RefreshIcon as pl,SettingsIcon as ul,PodIcon as hl,K8sLogo as ml,ExclamationCircleIcon as gl,QuestionCircleIcon as fl,InboundIcon as bl,OutboundIcon as vl,UserIcon as yl,TerminalIcon as Cl,RefreshLeftArrowIcon as Sl,MinusIcon as xl,SearchIcon as wl,ExpandIcon as Tl,CopyIcon as kl,DotIcon as Il,ArrowDownIcon as El,DownloadIcon as Nl,SamplingIcon as Ol,ExclamationTriangleIcon as $l,KeyIcon as Al,DiagnoseIcon as Rl,StarIcon as Dl,ArrowIcon as _l,ConnectionsIcon as Pl,FilterIcon as Ll,DataStreamIcon as Fl,PipelineCollectorIcon as Ml,ArrowDownSquareIcon as zl,ArrowUpSquareIcon as Bl,GatewayIcon as Xl,YamlIcon as Ul,ImageErrorIcon as Vl,LockIcon as Hl}from"./icons.js";import{h as jl,o as Gl,n as Wl,q as Kl,m as Yl,t as Jl,s as ql,S as Zl,w as Ql,E as er,x as tr,y as nr,v as or,l as ir,d as ar,O as lr,f as rr,b as sr,A as cr,R as dr,C as pr,e as ur,D as hr}from"./chunks/source-instrument-form-context-M5A5jkXP.js";import{n as mr,f as gr,k as fr,I as br,l as vr,A as yr,i as Cr,P as Sr,S as xr,R as wr,g as Tr,j as kr,c as Ir,h as Er,m as Nr,W as Or,C as $r,b as Ar,Y as Rr,O as Dr,a as _r,U as Pr,e as Lr}from"./chunks/index-BxDn2YI2.js";import{createPortal as Fr}from"react-dom";import{MarkerType as Mr,useNodesState as zr,useEdgesState as Br,Handle as Xr,Position as Ur,getSmoothStepPath as Vr,BaseEdge as Hr,EdgeLabelRenderer as jr,ReactFlowProvider as Gr,ReactFlow as Wr,Background as Kr,Controls as Yr,ControlButton as Jr,useReactFlow as qr}from"@xyflow/react";import Zr from"elkjs/lib/elk.bundled.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";const Qr=b.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -42,7 +42,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
42
42
|
`,Ss=b.div`
|
|
43
43
|
/* Pushes the arrow down to sit next to the inputs rather than the field titles. */
|
|
44
44
|
padding-top: 24px;
|
|
45
|
-
`,xs=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),ws=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},Ts=de.UrlTemplatizationRulesGroups,ks=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],Is={[Oe.K8sAttributes]:({value:o,setValue:i,formErrors:l})=>(a(()=>{o[de.CollectContainerAttributes]||o[de.CollectReplicaSetAttributes]||o[de.CollectWorkloadId]||o[de.CollectClusterId]||o[de.LabelsAttributes]?.length||o[de.AnnotationsAttributes]?.length||(i(de.CollectContainerAttributes,!0),i(de.CollectReplicaSetAttributes,!0),i(de.CollectWorkloadId,!0),i(de.CollectClusterId,!0),i(de.LabelsAttributes,[]),i(de.AnnotationsAttributes,[]))},[]),e(n,{children:[t(ae,{$gap:6,children:ds.map(({id:n,label:a})=>e(ae,{children:[t(Q,{label:a,value:o[n]||!1,onChange:e=>i(n,e)}),t(ue,{errorMessage:l[n]})]},n))}),t(he,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:us,values:o[de.LabelsAttributes]||[],setValues:e=>i(de.LabelsAttributes,e),errorMessage:l[de.LabelsAttributes]}),t(he,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:hs,values:o[de.AnnotationsAttributes]||[],setValues:e=>i(de.AnnotationsAttributes,e),errorMessage:l[de.AnnotationsAttributes]})]})),[Oe.AddClusterInfo]:({value:o,setValue:i,formErrors:a})=>{const l=v();return e(n,{children:[t(ge,{label:"Overwrite existing values",labelAlign:fe.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[de.OverwriteExistingValues]||!1,onChange:e=>i(de.OverwriteExistingValues,e)}),t(he,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:o[de.ClusterAttributes]||[],setValues:e=>i(de.ClusterAttributes,e),errorMessage:a[de.ClusterAttributes]})]})},[Oe.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(be,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[de.AttributeNamesToDelete]||[],setValues:e=>n(de.AttributeNamesToDelete,e),errorMessage:o[de.AttributeNamesToDelete]}),[Oe.RenameAttributes]:({value:e,setValue:n,formErrors:o})=>{const i=e[de.Renames],[r,s]=l(()=>xs(i));return a(()=>{((e,t)=>{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(ws(r),i||{})||s(xs(i))},[i]),t(he,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:r,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),n(de.Renames,ws(t))},errorMessage:o[de.Renames]})},[Oe.PiiMasking]:({value:n,setValue:o,formErrors:i})=>(a(()=>{n[de.PiiCategories]?.length||o(de.PiiCategories,cs.map(({id:e})=>e))},[]),e(ae,{$gap:12,children:[t(pe,{label:"Attributes to mask"}),t(ae,{$gap:6,children:cs.map(({id:e,label:i})=>t(Q,{label:i,value:n[de.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=n[de.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);o(de.PiiCategories,a)}},e))}),t(ue,{errorMessage:i[de.PiiCategories]})]})),[Oe.URLTemplatization]:({value:o,setValue:i,formErrors:a})=>{const l=v(),s=o[Ts]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Ts,e),d=(e,t)=>c(s.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[s.map((n,o)=>e(r,{children:[t(Ee,{}),e(ae,{$gap:12,children:[e(oe,{$justifyContent:"space-between",$alignItems:"center",children:[t(pe,{label:`Rule Group ${o+1}`}),t(Te,{leftIcon:()=>t(Ma,{fill:l.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>{return e=o,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(Ne,{name:`urlGroup-${o}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(o,{filterK8sNamespace:e.target.value})}),t(he,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:ks,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(be,{name:`urlGroup-${o}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(o,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ue,{errorMessage:a[Ts]})]},`url-templatization-group-${o}`)),t(Te,{variant:Ie.Secondary,label:"Add rule group",leftIcon:za,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ee,{})]})},[Oe.ExtractAttribute]:({value:n,setValue:o,formErrors:i})=>{const r=v(),s=i[ms],c=n[ms]?.extractions||[],[d,p]=l(()=>(e=>e.length&&e.some(vs)?gs.Regex:gs.Preset)(c)),[u,h]=l(null),m=e=>o(ms,{extractions:e});a(()=>{0===c.length&&m([d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},f=()=>{m([...c,d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===gs.Preset,y=c.length?c:[b?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ae,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:gs.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:gs.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ae,{$gap:8,$width:"100%",children:[y.map((n,o)=>{const i=o===y.length-1,a=n.dataFormat||Ce.JSON,l=xe[a];return e(ys,{"data-id":`extract-row-${o}`,children:[e(oe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ae,{$gap:10,children:[t(pe,{label:b?ye.PRESET_ROW_TITLE(o):ye.REGEX_ROW_TITLE(o)}),b&&t(oe,{$gap:24,children:fs.map(e=>t(Se,{"data-id":`extract-row-${o}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(oe,{$gap:4,$alignItems:"center",children:[!b&&t(Te,{"data-id":`extract-row-${o}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:Ie.Secondary,size:ke.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(Te,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(Ma,{fill:r.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),i&&t(Te,{"data-id":`extract-row-${o}-add`,leftIcon:za,variant:Ie.Secondary,size:ke.S,onClick:f})]})]}),b?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Cs,{children:t(Ne,{name:`extract-row-${o}-lookupKey`,label:l.keyLabel,placeholder:l.placeholder,helpMessage:l.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(Ss,{children:t(Ba,{size:24,fill:r.v2.colors.silver[200]})}),t(Cs,{children:t(Ne,{name:`extract-row-${o}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(ae,{$gap:12,$width:"100%",children:[t(Ne,{name:`extract-row-${o}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(Ne,{name:`extract-row-${o}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(ue,{errorMessage:s})]}),t(mr,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[Oe.DbQueryTemplatization]:null,[Oe.InferDbAttributes]:null},Ns=({actionType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,signals:l,sourceOptions:r,namespaceOptions:s})=>{if(!e)return null;if(a?.length)return t(gr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=Is[e];return c?t(c,{value:n,setValue:o,formErrors:i}):null},Es=()=>{const n=v(),{selectedOption:o,genericForm:i,sourceOptions:a,namespaceOptions:l}=jl();if(!i||!o)return t($e,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=i;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:o.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Re.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(Te,{leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(fr,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:r.signals||[],setSelectedSignals:e=>s("signals",e),errorMessage:c.signals}),t(Ne,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:r.name||"",onChange:({target:{value:e}})=>s("name",e),errorMessage:c.name}),t(Ns,{actionType:o.type,dynamicFields:o.fields,signals:r.signals||[],value:r.fields,setValue:(e,t)=>s(`fields.${e}`,t),formErrors:c,sourceOptions:a,namespaceOptions:l}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes||"",onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},Os=b(oe)`
|
|
45
|
+
`,xs=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),ws=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},Ts=de.UrlTemplatizationRulesGroups,ks=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],Is={[Oe.K8sAttributes]:({value:o,setValue:i,formErrors:l})=>(a(()=>{o[de.CollectContainerAttributes]||o[de.CollectReplicaSetAttributes]||o[de.CollectWorkloadId]||o[de.CollectClusterId]||o[de.LabelsAttributes]?.length||o[de.AnnotationsAttributes]?.length||(i(de.CollectContainerAttributes,!0),i(de.CollectReplicaSetAttributes,!0),i(de.CollectWorkloadId,!0),i(de.CollectClusterId,!0),i(de.LabelsAttributes,[]),i(de.AnnotationsAttributes,[]))},[]),e(n,{children:[t(ae,{$gap:6,children:ds.map(({id:n,label:a})=>e(ae,{children:[t(Q,{label:a,value:o[n]||!1,onChange:e=>i(n,e)}),t(ue,{errorMessage:l[n]})]},n))}),t(he,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:us,values:o[de.LabelsAttributes]||[],setValues:e=>i(de.LabelsAttributes,e),errorMessage:l[de.LabelsAttributes]}),t(he,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:hs,values:o[de.AnnotationsAttributes]||[],setValues:e=>i(de.AnnotationsAttributes,e),errorMessage:l[de.AnnotationsAttributes]})]})),[Oe.AddClusterInfo]:({value:o,setValue:i,formErrors:a})=>{const l=v();return e(n,{children:[t(ge,{label:"Overwrite existing values",labelAlign:fe.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[de.OverwriteExistingValues]||!1,onChange:e=>i(de.OverwriteExistingValues,e)}),t(he,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:o[de.ClusterAttributes]||[],setValues:e=>i(de.ClusterAttributes,e),errorMessage:a[de.ClusterAttributes]})]})},[Oe.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(be,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[de.AttributeNamesToDelete]||[],setValues:e=>n(de.AttributeNamesToDelete,e),errorMessage:o[de.AttributeNamesToDelete]}),[Oe.RenameAttributes]:({value:e,setValue:n,formErrors:o})=>{const i=e[de.Renames],[r,s]=l(()=>xs(i));return a(()=>{((e,t)=>{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(ws(r),i||{})||s(xs(i))},[i]),t(he,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:r,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),n(de.Renames,ws(t))},errorMessage:o[de.Renames]})},[Oe.PiiMasking]:({value:n,setValue:o,formErrors:i})=>(a(()=>{n[de.PiiCategories]?.length||o(de.PiiCategories,cs.map(({id:e})=>e))},[]),e(ae,{$gap:12,children:[t(pe,{label:"Attributes to mask"}),t(ae,{$gap:6,children:cs.map(({id:e,label:i})=>t(Q,{label:i,value:n[de.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=n[de.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);o(de.PiiCategories,a)}},e))}),t(ue,{errorMessage:i[de.PiiCategories]})]})),[Oe.URLTemplatization]:({value:o,setValue:i,formErrors:a})=>{const l=v(),s=o[Ts]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Ts,e),d=(e,t)=>c(s.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[s.map((n,o)=>e(r,{children:[t(Ne,{}),e(ae,{$gap:12,children:[e(oe,{$justifyContent:"space-between",$alignItems:"center",children:[t(pe,{label:`Rule Group ${o+1}`}),t(Te,{leftIcon:()=>t(Ma,{fill:l.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>{return e=o,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(Ee,{name:`urlGroup-${o}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(o,{filterK8sNamespace:e.target.value})}),t(he,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:ks,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(be,{name:`urlGroup-${o}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(o,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ue,{errorMessage:a[Ts]})]},`url-templatization-group-${o}`)),t(Te,{variant:Ie.Secondary,label:"Add rule group",leftIcon:za,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ne,{})]})},[Oe.ExtractAttribute]:({value:n,setValue:o,formErrors:i})=>{const r=v(),s=i[ms],c=n[ms]?.extractions||[],[d,p]=l(()=>(e=>e.length&&e.some(vs)?gs.Regex:gs.Preset)(c)),[u,h]=l(null),m=e=>o(ms,{extractions:e});a(()=>{0===c.length&&m([d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},f=()=>{m([...c,d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===gs.Preset,y=c.length?c:[b?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ae,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:gs.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:gs.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ae,{$gap:8,$width:"100%",children:[y.map((n,o)=>{const i=o===y.length-1,a=n.dataFormat||Ce.JSON,l=xe[a];return e(ys,{"data-id":`extract-row-${o}`,children:[e(oe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ae,{$gap:10,children:[t(pe,{label:b?ye.PRESET_ROW_TITLE(o):ye.REGEX_ROW_TITLE(o)}),b&&t(oe,{$gap:24,children:fs.map(e=>t(Se,{"data-id":`extract-row-${o}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(oe,{$gap:4,$alignItems:"center",children:[!b&&t(Te,{"data-id":`extract-row-${o}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:Ie.Secondary,size:ke.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(Te,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(Ma,{fill:r.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),i&&t(Te,{"data-id":`extract-row-${o}-add`,leftIcon:za,variant:Ie.Secondary,size:ke.S,onClick:f})]})]}),b?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Cs,{children:t(Ee,{name:`extract-row-${o}-lookupKey`,label:l.keyLabel,placeholder:l.placeholder,helpMessage:l.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(Ss,{children:t(Ba,{size:24,fill:r.v2.colors.silver[200]})}),t(Cs,{children:t(Ee,{name:`extract-row-${o}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(ae,{$gap:12,$width:"100%",children:[t(Ee,{name:`extract-row-${o}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(Ee,{name:`extract-row-${o}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(ue,{errorMessage:s})]}),t(mr,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[Oe.DbQueryTemplatization]:null,[Oe.InferDbAttributes]:null},Es=({actionType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,signals:l,sourceOptions:r,namespaceOptions:s})=>{if(!e)return null;if(a?.length)return t(gr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=Is[e];return c?t(c,{value:n,setValue:o,formErrors:i}):null},Ns=()=>{const n=v(),{selectedOption:o,genericForm:i,sourceOptions:a,namespaceOptions:l}=jl();if(!i||!o)return t($e,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=i;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:o.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Re.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(Te,{leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(fr,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:r.signals||[],setSelectedSignals:e=>s("signals",e),errorMessage:c.signals}),t(Ee,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:r.name||"",onChange:({target:{value:e}})=>s("name",e),errorMessage:c.name}),t(Es,{actionType:o.type,dynamicFields:o.fields,signals:r.signals||[],value:r.fields,setValue:(e,t)=>s(`fields.${e}`,t),formErrors:c,sourceOptions:a,namespaceOptions:l}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes||"",onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},Os=b(oe)`
|
|
46
46
|
position: sticky;
|
|
47
47
|
bottom: 4px;
|
|
48
48
|
align-self: center;
|
|
@@ -53,7 +53,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
53
53
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
54
54
|
box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
|
|
55
55
|
z-index: 1;
|
|
56
|
-
`,$s=s(({isEdit:n},o)=>{const i=v(),{isK8s:r}=S(),{destinationsApi:s}=Gl(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Wl(),[b,y]=l(h?.testResult),[C,x]=l(!!h);a(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!d?.option.testConnectionSupported||!p||!r)return;const e=await s.testConnection(Be(p.formData));return y(e),e};return c(o,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,s]),p&&d?e(ae,{$gap:24,style:{minHeight:"100%"},children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(_e,{status:Pe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(_e,{status:Pe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(oe,{$gap:12,children:[r&&t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:Re.S,selected:p.formData.disabled,setSelected:e=>p.handleFormChange("disabled",e),disabled:C}),t(Te,{"data-id":"dest-form-docs",leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${Le}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(fr,{title:"This connection will monitor:",allowedSignals:ze(d.option.supportedSignals),selectedSignals:Me(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes(Fe.Logs),metrics:e.includes(Fe.Metrics),traces:e.includes(Fe.Traces),profiles:e.includes(Fe.Profiles)}),disabled:C,errorMessage:p.formErrors.exportedSignals}),t(Ne,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:p.formData.name,onChange:({target:{value:e}})=>p.handleFormChange("name",e),disabled:C,errorMessage:p.formErrors.name}),t(gr,{signals:Me(p.formData.exportedSignals),fields:d.option.fields,disabled:C,value:Object.fromEntries(p.formData.fields.map(e=>[e.key,e.value])),setValue:(e,t)=>{const n=p.formData.fields.some(t=>t.key===e);p.handleFormChange("fields",n?p.formData.fields.map(n=>n.key===e?{...n,value:t}:n):[...p.formData.fields,{key:e,value:t}]),e&&p.formErrors[e]&&p.handleErrorChange(e,void 0)},formErrors:p.formErrors,keyValuePersistAs:"array"}),!n&&e(Os,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Ha,variant:Ie.Secondary,textColor:i.v2.colors.red[500],onClick:()=>f(d.unsavedIdx)})}),r&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:Ie.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:ja,variant:Ie.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;g(d.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t($e,{title:"No active form"})});$s.displayName="AddDestinationForm";const As=[{id:Xe.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Xe.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Xe.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Rs=[{id:Xe.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Xe.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Xe.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ds=["*"],_s=[{id:He.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:He.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:He.DbQuery,label:"Collect DB query",tooltip:""},{id:He.Messaging,label:"Collect messaging",tooltip:""}],Ps={[Ke.Java]:[new Ge("","")],[Ke.Golang]:[new je("")],[Ke.Php]:[new We("","")]},Ls={[Je.CodeAttributes]:({value:o,setValue:l,formErrors:r,disabled:s})=>{const c=r.codeAttributes,d=i(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);a(()=>{if(!d.length&&!c){const e={[Xe.FilePath]:!0,[Xe.Function]:!0,[Xe.LineNumber]:!0,[Xe.Column]:null,[Xe.Namespace]:null,[Xe.StackTrace]:null};l("codeAttributes",e)}},[]);const p=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),o=Object.values(Xe).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",o)};return e(n,{children:[e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ae,{$gap:6,children:As.map(({id:e,label:n,tooltip:o})=>t(Ue,{text:o,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]}),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ae,{$gap:6,children:Rs.map(({id:e,label:n,tooltip:o})=>t(Ue,{text:o,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]})]})},[Je.CustomInstrumentation]:({value:o,setValue:l,formErrors:r,disabled:s})=>{const c=r.customInstrumentations,d=i(()=>(o?.customInstrumentations?.[Ke.Golang]||[]).map(e=>new je(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[o]),p=i(()=>(o?.customInstrumentations?.[Ke.Java]||[]).map(e=>new Ge(e.className,e.methodName)),[o]),u=i(()=>(o?.customInstrumentations?.[Ke.Php]||[]).map(e=>new We(e.className,e.functionName)),[o]);return a(()=>{o?.customInstrumentations||c||l("customInstrumentations",{[Ke.Golang]:Ps[Ke.Golang],[Ke.Java]:Ps[Ke.Java],[Ke.Php]:Ps[Ke.Php]})},[]),e(n,{children:[e(ae,{children:[e(oe,{$gap:8,children:[t(Ga,{}),t(pe,{label:"Golang custom probes"})]}),t(he,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:d,setValues:e=>{const t={};t[Ke.Golang]=e.map(e=>new je(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ke.Java]=p,t[Ke.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(oe,{$gap:8,children:[t(Wa,{}),t(pe,{label:"Java custom probes"})]}),t(he,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:p,setValues:e=>{const t={};t[Ke.Golang]=d,t[Ke.Java]=e.map(e=>new Ge(e.className,e.methodName)),t[Ke.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(oe,{$gap:8,children:[t(Ka,{}),t(pe,{label:"PHP custom probes"})]}),t(_e,{status:Pe.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),t(he,{name:"phpProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. App\\Service\\OrderService",tooltip:"The fully qualified class name to instrument. Leave empty for a global function."},{keyName:"functionName",label:"Function name",placeholder:"e.g. processOrder",tooltip:"The name of the function or method to instrument."}],values:u,setValues:e=>{const t={};t[Ke.Golang]=d,t[Ke.Java]=p,t[Ke.Php]=e.map(e=>new We(e.className,e.functionName)),l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2})]})]})},[Je.HeadersCollection]:({value:e,setValue:n,formErrors:o,disabled:l})=>{const r=o.headersCollection,s=i(()=>e?.headersCollection?.[Ve.HeaderKeys]||[],[e]),c=e=>{const t={[Ve.HeaderKeys]:e};n("headersCollection",t)};return a(()=>{s.length||r||c(Ds)},[]),t(be,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:s,setValues:c,errorMessage:r,disabled:l})},[Je.PayloadCollection]:({value:n,setValue:o,formErrors:l,disabled:r})=>{const s=l.payloadCollection,c=i(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);return a(()=>{if(!c.length&&!s){const e={[He.HttpRequest]:{},[He.HttpResponse]:{},[He.DbQuery]:{},[He.Messaging]:{}};o("payloadCollection",e)}},[]),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ae,{$gap:6,children:_s.map(({id:e,label:n,tooltip:i})=>t(Ue,{text:i,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>((e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),i={[He.HttpRequest]:n.includes(He.HttpRequest)?{}:null,[He.HttpResponse]:n.includes(He.HttpResponse)?{}:null,[He.DbQuery]:n.includes(He.DbQuery)?{}:null,[He.Messaging]:n.includes(He.Messaging)?{}:null};o("payloadCollection",i)})(e,t),disabled:r})},e))}),t(ue,{errorMessage:s})]})},[Je.UnknownType]:null},Fs=({ruleType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(gr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=Ls[e];return r?t(r,{value:n,setValue:o,formErrors:i,disabled:l}):null},Ms=()=>{const n=v(),{isEnterprise:o,isK8s:a}=S(),{selectedOption:l,genericForm:r,sourceOptions:s,namespaceOptions:c}=Kl(),d=i(()=>qe(l?.supportedLanguages),[l?.supportedLanguages]),p=i(()=>{if(l)return l.type===Je.CustomInstrumentation?[]:Ze(l.supportedLanguages)},[l]);if(!r||!l)return t($e,{title:"No active form"});const{formData:u,handleFormChange:h,formErrors:m}=r;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:l.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Re.S,selected:u.disabled,setSelected:e=>h("disabled",e),disabled:!o}),t(Te,{leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>l.docsUrl&&window.open(l.docsUrl,"_blank","noopener noreferrer")})]})]}),t(br,{option:l,formState:u}),!!d.length&&e(oe,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Supported Languages:"}),d.map(e=>t(ce,{label:et(e),leftIcon:Qe(e),backgroundColor:n.v2.colors.purple[900]},e))]}),a&&t(vr,{scopes:u.sourceScopes,onChange:e=>h("sourceScopes",e),sourceOptions:s,namespaceOptions:c,supportedLanguages:p,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!o}),t(Ne,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:u.ruleName,onChange:({target:{value:e}})=>h("ruleName",e),errorMessage:m.ruleName,disabled:!o}),t(Fs,{ruleType:l.type,dynamicFields:l.fields,value:u,setValue:(e,t)=>h(e,t),formErrors:m,disabled:!o}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:u.notes,onChange:({target:{value:e}})=>h("notes",e),errorMessage:m.notes,disabled:!o})]})},zs=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Yl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(tt,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:nt.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:Ie.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:Ie.Secondary,onClick:o}})},Bs=({autoFocus:n})=>{const{dataStreams:o}=ot(),{genericForm:a,excludeName:l,editingName:r}=Yl(),{formData:s,formErrors:c,handleFormChange:d}=a,p=s.name,u=i(()=>o.find(e=>e.name===p&&e.name!==l),[o,p,l]);return e(ae,{$width:"100%",$gap:12,children:[t(Ne,{name:"data-stream-name",label:nt.STREAM_NAME,placeholder:nt.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:nt.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(_e,{status:Pe.Warning,message:nt.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},Xs=()=>{const{selectedStreamName:e}=ot(),{genericForm:n}=Jl();if(!n)return t($e,{title:"No active form"});const{formData:o,handleFormChange:i,formErrors:a}=n;return t(Ne,{name:"sourceName",label:nt.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:o.otelServiceName,onChange:({target:{value:t}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Us=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Vs=b.div`
|
|
56
|
+
`,$s=s(({isEdit:n},o)=>{const i=v(),{isK8s:r}=S(),{destinationsApi:s}=Gl(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Wl(),[b,y]=l(h?.testResult),[C,x]=l(!!h);a(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!d?.option.testConnectionSupported||!p||!r)return;const e=await s.testConnection(Be(p.formData));return y(e),e};return c(o,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,s]),p&&d?e(ae,{$gap:24,style:{minHeight:"100%"},children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(_e,{status:Pe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(_e,{status:Pe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(oe,{$gap:12,children:[r&&t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:Re.S,selected:p.formData.disabled,setSelected:e=>p.handleFormChange("disabled",e),disabled:C}),t(Te,{"data-id":"dest-form-docs",leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${Le}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(fr,{title:"This connection will monitor:",allowedSignals:ze(d.option.supportedSignals),selectedSignals:Me(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes(Fe.Logs),metrics:e.includes(Fe.Metrics),traces:e.includes(Fe.Traces),profiles:e.includes(Fe.Profiles)}),disabled:C,errorMessage:p.formErrors.exportedSignals}),t(Ee,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:p.formData.name,onChange:({target:{value:e}})=>p.handleFormChange("name",e),disabled:C,errorMessage:p.formErrors.name}),t(gr,{signals:Me(p.formData.exportedSignals),fields:d.option.fields,disabled:C,value:Object.fromEntries(p.formData.fields.map(e=>[e.key,e.value])),setValue:(e,t)=>{const n=p.formData.fields.some(t=>t.key===e);p.handleFormChange("fields",n?p.formData.fields.map(n=>n.key===e?{...n,value:t}:n):[...p.formData.fields,{key:e,value:t}]),e&&p.formErrors[e]&&p.handleErrorChange(e,void 0)},formErrors:p.formErrors,keyValuePersistAs:"array"}),!n&&e(Os,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Ha,variant:Ie.Secondary,textColor:i.v2.colors.red[500],onClick:()=>f(d.unsavedIdx)})}),r&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:Ie.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:ja,variant:Ie.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;g(d.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t($e,{title:"No active form"})});$s.displayName="AddDestinationForm";const As=[{id:Xe.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Xe.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Xe.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Rs=[{id:Xe.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Xe.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Xe.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ds=["*"],_s=[{id:He.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:He.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:He.DbQuery,label:"Collect DB query",tooltip:""},{id:He.Messaging,label:"Collect messaging",tooltip:""}],Ps={[Ke.Java]:[new Ge("","")],[Ke.Golang]:[new je("")],[Ke.Php]:[new We("","")]},Ls={[Je.CodeAttributes]:({value:o,setValue:l,formErrors:r,disabled:s})=>{const c=r.codeAttributes,d=i(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);a(()=>{if(!d.length&&!c){const e={[Xe.FilePath]:!0,[Xe.Function]:!0,[Xe.LineNumber]:!0,[Xe.Column]:null,[Xe.Namespace]:null,[Xe.StackTrace]:null};l("codeAttributes",e)}},[]);const p=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),o=Object.values(Xe).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",o)};return e(n,{children:[e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ae,{$gap:6,children:As.map(({id:e,label:n,tooltip:o})=>t(Ue,{text:o,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]}),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ae,{$gap:6,children:Rs.map(({id:e,label:n,tooltip:o})=>t(Ue,{text:o,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]})]})},[Je.CustomInstrumentation]:({value:o,setValue:l,formErrors:r,disabled:s})=>{const c=r.customInstrumentations,d=i(()=>(o?.customInstrumentations?.[Ke.Golang]||[]).map(e=>new je(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[o]),p=i(()=>(o?.customInstrumentations?.[Ke.Java]||[]).map(e=>new Ge(e.className,e.methodName)),[o]),u=i(()=>(o?.customInstrumentations?.[Ke.Php]||[]).map(e=>new We(e.className,e.functionName)),[o]);return a(()=>{o?.customInstrumentations||c||l("customInstrumentations",{[Ke.Golang]:Ps[Ke.Golang],[Ke.Java]:Ps[Ke.Java],[Ke.Php]:Ps[Ke.Php]})},[]),e(n,{children:[e(ae,{children:[e(oe,{$gap:8,children:[t(Ga,{}),t(pe,{label:"Golang custom probes"})]}),t(he,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:d,setValues:e=>{const t={};t[Ke.Golang]=e.map(e=>new je(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ke.Java]=p,t[Ke.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(oe,{$gap:8,children:[t(Wa,{}),t(pe,{label:"Java custom probes"})]}),t(he,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:p,setValues:e=>{const t={};t[Ke.Golang]=d,t[Ke.Java]=e.map(e=>new Ge(e.className,e.methodName)),t[Ke.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(oe,{$gap:8,children:[t(Ka,{}),t(pe,{label:"PHP custom probes"})]}),t(_e,{status:Pe.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),t(he,{name:"phpProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. App\\Service\\OrderService",tooltip:"The fully qualified class name to instrument. Leave empty for a global function."},{keyName:"functionName",label:"Function name",placeholder:"e.g. processOrder",tooltip:"The name of the function or method to instrument."}],values:u,setValues:e=>{const t={};t[Ke.Golang]=d,t[Ke.Java]=p,t[Ke.Php]=e.map(e=>new We(e.className,e.functionName)),l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2})]})]})},[Je.HeadersCollection]:({value:e,setValue:n,formErrors:o,disabled:l})=>{const r=o.headersCollection,s=i(()=>e?.headersCollection?.[Ve.HeaderKeys]||[],[e]),c=e=>{const t={[Ve.HeaderKeys]:e};n("headersCollection",t)};return a(()=>{s.length||r||c(Ds)},[]),t(be,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:s,setValues:c,errorMessage:r,disabled:l})},[Je.PayloadCollection]:({value:n,setValue:o,formErrors:l,disabled:r})=>{const s=l.payloadCollection,c=i(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);return a(()=>{if(!c.length&&!s){const e={[He.HttpRequest]:{},[He.HttpResponse]:{},[He.DbQuery]:{},[He.Messaging]:{}};o("payloadCollection",e)}},[]),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ae,{$gap:6,children:_s.map(({id:e,label:n,tooltip:i})=>t(Ue,{text:i,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>((e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),i={[He.HttpRequest]:n.includes(He.HttpRequest)?{}:null,[He.HttpResponse]:n.includes(He.HttpResponse)?{}:null,[He.DbQuery]:n.includes(He.DbQuery)?{}:null,[He.Messaging]:n.includes(He.Messaging)?{}:null};o("payloadCollection",i)})(e,t),disabled:r})},e))}),t(ue,{errorMessage:s})]})},[Je.UnknownType]:null},Fs=({ruleType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(gr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=Ls[e];return r?t(r,{value:n,setValue:o,formErrors:i,disabled:l}):null},Ms=()=>{const n=v(),{isEnterprise:o,isK8s:a}=S(),{selectedOption:l,genericForm:r,sourceOptions:s,namespaceOptions:c}=Kl(),d=i(()=>qe(l?.supportedLanguages),[l?.supportedLanguages]),p=i(()=>{if(l)return l.type===Je.CustomInstrumentation?[]:Ze(l.supportedLanguages)},[l]);if(!r||!l)return t($e,{title:"No active form"});const{formData:u,handleFormChange:h,formErrors:m}=r;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:l.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Re.S,selected:u.disabled,setSelected:e=>h("disabled",e),disabled:!o}),t(Te,{leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>l.docsUrl&&window.open(l.docsUrl,"_blank","noopener noreferrer")})]})]}),t(br,{option:l,formState:u}),!!d.length&&e(oe,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Supported Languages:"}),d.map(e=>t(ce,{label:et(e),leftIcon:Qe(e),backgroundColor:n.v2.colors.purple[900]},e))]}),a&&t(vr,{scopes:u.sourceScopes,onChange:e=>h("sourceScopes",e),sourceOptions:s,namespaceOptions:c,supportedLanguages:p,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!o}),t(Ee,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:u.ruleName,onChange:({target:{value:e}})=>h("ruleName",e),errorMessage:m.ruleName,disabled:!o}),t(Fs,{ruleType:l.type,dynamicFields:l.fields,value:u,setValue:(e,t)=>h(e,t),formErrors:m,disabled:!o}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:u.notes,onChange:({target:{value:e}})=>h("notes",e),errorMessage:m.notes,disabled:!o})]})},zs=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Yl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(tt,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:nt.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:Ie.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:Ie.Secondary,onClick:o}})},Bs=({autoFocus:n})=>{const{dataStreams:o}=ot(),{genericForm:a,excludeName:l,editingName:r}=Yl(),{formData:s,formErrors:c,handleFormChange:d}=a,p=s.name,u=i(()=>o.find(e=>e.name===p&&e.name!==l),[o,p,l]);return e(ae,{$width:"100%",$gap:12,children:[t(Ee,{name:"data-stream-name",label:nt.STREAM_NAME,placeholder:nt.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:nt.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(_e,{status:Pe.Warning,message:nt.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},Xs=()=>{const{selectedStreamName:e}=ot(),{genericForm:n}=Jl();if(!n)return t($e,{title:"No active form"});const{formData:o,handleFormChange:i,formErrors:a}=n;return t(Ee,{name:"sourceName",label:nt.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:o.otelServiceName,onChange:({target:{value:t}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Us=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Vs=b.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
flex-direction: column;
|
|
59
59
|
gap: 24px;
|
|
@@ -63,7 +63,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
63
63
|
opacity: ${({$faded:e})=>e?.4:1};
|
|
64
64
|
transition: opacity 0.2s ease;
|
|
65
65
|
}
|
|
66
|
-
`,js=({value:e})=>{const n=v();return t(ce,e?{status:Pe.Success,label:dt,leftIcon:Xa}:{label:pt,leftIcon:Ua,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},Gs=({value:e,onChange:n})=>{const o=v(),a=i(()=>[{icon:Xa,label:dt,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:Ua,label:pt,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ve,{options:a,selected:e,setSelected:n??(()=>{}),disabled:!n})},Ws=()=>{const e=ql();switch(e.formType){case Zl.Create:return t(Ks,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Gs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Zl.View:return e.data?e.isEditing?t(Ks,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Gs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Ys,{data:e.data,renderAction:()=>t(js,{value:!e.data?.rule.disabled})}):null;case Zl.EditAutoNoisy:return t(Js,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ct,sectionTitle:lt,sectionSubTitle:st,presetLabel:at,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Gs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Zl.EditAutoCostReduction:return t(Js,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:rt,sectionTitle:lt,presetLabel:at,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Gs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Zl.EditAutoHighlyRelevant:return t(Vs,{children:t(yr,{title:e.localEnabled?void 0:it,summary:e.summary,renderAction:()=>t(Gs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Ks=({category:n,formData:o,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(Vs,{children:[t(xr,{category:n,formState:o,renderAction:r}),e(Hs,{$faded:!!o.disabled,children:[t(wr,{category:n,formState:o,onChange:i}),t(vr,{scopes:o.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(Tr,{category:n,formState:o,onChange:i}),"highlyRelevant"===n&&t(kr,{formState:o,onChange:i}),"highlyRelevant"===n&&t(Ir,{ruleType:o.ruleType,formState:o,onChange:i}),t(
|
|
66
|
+
`,js=({value:e})=>{const n=v();return t(ce,e?{status:Pe.Success,label:dt,leftIcon:Xa}:{label:pt,leftIcon:Ua,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},Gs=({value:e,onChange:n})=>{const o=v(),a=i(()=>[{icon:Xa,label:dt,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:Ua,label:pt,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ve,{options:a,selected:e,setSelected:n??(()=>{}),disabled:!n})},Ws=()=>{const e=ql();switch(e.formType){case Zl.Create:return t(Ks,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Gs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Zl.View:return e.data?e.isEditing?t(Ks,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Gs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Ys,{data:e.data,renderAction:()=>t(js,{value:!e.data?.rule.disabled})}):null;case Zl.EditAutoNoisy:return t(Js,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ct,sectionTitle:lt,sectionSubTitle:st,presetLabel:at,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Gs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Zl.EditAutoCostReduction:return t(Js,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:rt,sectionTitle:lt,presetLabel:at,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Gs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Zl.EditAutoHighlyRelevant:return t(Vs,{children:t(yr,{title:e.localEnabled?void 0:it,summary:e.summary,renderAction:()=>t(Gs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Ks=({category:n,formData:o,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(Vs,{children:[t(xr,{category:n,formState:o,renderAction:r}),e(Hs,{$faded:!!o.disabled,children:[t(wr,{category:n,formState:o,onChange:i}),t(vr,{scopes:o.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(Tr,{category:n,formState:o,onChange:i}),"highlyRelevant"===n&&t(kr,{formState:o,onChange:i}),"highlyRelevant"===n&&t(Ir,{ruleType:o.ruleType,formState:o,onChange:i}),t(Er,{category:n,formState:o,onChange:i})]})]}),Ys=({data:n,renderAction:o})=>e(Vs,{children:[t(xr,{readOnly:!0,summary:n.summary,renderAction:o}),t(wr,{readOnly:!0,data:n}),t(vr,{readOnly:!0,scopes:x(n.rule.sourceScopes)}),t(Tr,{readOnly:!0,data:n}),t(Er,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(Ir,{readOnly:!0,rule:n.rule})]}),Js=({enabled:n,summary:o,inactiveTitle:i,sectionTitle:a,sectionSubTitle:l,presetLabel:r,customInputName:s,showModeToggle:c=!0,percentageMode:p,setPercentageMode:u,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=d(e=>u(e),[u]),y=d(e=>m(e),[m]),C=d(e=>f(e.target.value),[f]),S=!c||"sample"===p;return e(Vs,{children:[t(yr,{title:n?void 0:i,summary:o,renderAction:b}),t(Hs,{$faded:!n,children:e(ut,{richTitle:{title:a,subTitle:l},children:[c&&t(ae,{$alignItems:"flex-start",children:t(ve,{options:Us,selected:p,setSelected:v})}),S&&t(Cr,{description:r,options:Sr,selected:h,onSelect:y,customName:s,customLabel:ht,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},qs=({onClose:n,selectedConnectionIds:o,setSelectedConnectionIds:a,withOverlay:r})=>{const{actionsApi:s}=Gl(),{platformType:c,version:u}=S(),[h,m]=l(""),[g,f]=l(null),b=p(null),{selectedOption:v,onSelectOption:y,genericForm:C,validateFormData:x}=jl(),{options:w,loading:T}=s.useActionTypes(),k=i(()=>w.length?w:mt(c,u),[w,c,u]),I=i(()=>(h?k.filter(e=>e?.label?.toLowerCase().includes(h.toLowerCase())):k).filter(e=>!!e),[k,h]),E=d(e=>{b.current?.clearErrors(),y(e)},[y]),N=(({isLoading:e,options:n,selectedCategory:o,selectedType:a,onSelectOption:l})=>({width:"40%",list:i(()=>{if(e)return[t(le,{$padding:"8px 12px",children:t(re,{size:6})},"loading")];const i=n.reduce((e,t)=>{const n=t.category&&t.category in ls?t.category:as;return(e[n]||=[]).push(t),e},{});return Object.keys(ls).filter(e=>i[e]?.length&&(!o||o===e)).map(e=>t(ss,{bucket:e,options:i[e],selectedType:a,onSelectOption:l},e))},[e,n,o,a,l])}))({isLoading:T,options:I,selectedCategory:g,selectedType:v?.type,onSelectOption:E}),O=i(()=>{const e=new Set(k.map(e=>e.category));return[{value:null,label:"All Actions"},...Object.values(gt).filter(t=>e.has(t)).map(e=>({value:e,label:se[e].TITLE}))]},[k]),$=i(()=>T?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:v?[t(Ns,{},v.type)]:[t(ft,{$height:"100%",children:t($e,{icon:Fa,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[T,v]);return t(Nr,{ref:b,isOpen:!0,withOverlay:r,onClose:n,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=x();if(e)return!1;await s.create(t)},disableSave:!v||!C?.isFormDirty,isFormDirty:C?.isFormDirty,hideDirtyNote:!0,progress:{title:nt.CREATING_ACTION,subTitle:nt.CREATING_ACTION_SUBTITLE},header:{icon:Fa,title:nt.ADD_ACTION,subTitle:nt.ADD_ACTION_DESCRIPTION},connectionIds:o&&a?{value:o,setValue:a}:void 0,search:{value:h,onChange:m,placeholder:"Search by action name",width:"370px"},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,children:"Show"}),t(ve,{options:O,selected:g,setSelected:f})]}),leftColumn:N,rightColumn:{width:"60%",list:$}})},Zs=({destinationsByCategory:o,filters:a,setFilters:l})=>{const r=i(()=>Object.values(bt).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>o[e.id]?.length),[o]),s=i(()=>{const e=Object.values(Fe).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(n,{children:[t(vt,{placeholder:"Select category",options:r,values:a.categoryType?[a.categoryType]:[],setValues:e=>l({...a,categoryType:a.categoryType===e[0]?null:e[0]})}),t(ve,{options:s,selected:a.signalType,setSelected:e=>l({...a,signalType:e})})]})},Qs=b.div`
|
|
67
67
|
display: flex;
|
|
68
68
|
flex-direction: column;
|
|
69
69
|
padding: 8px;
|
|
@@ -76,7 +76,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
76
76
|
justify-content: space-between;
|
|
77
77
|
gap: 12px;
|
|
78
78
|
padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
|
|
79
|
-
`,tc=({title:n,tooltip:o,list:i,noBgColor:a,purpleColors:r})=>{const[s,c]=l(!0);return e(Qs,{"data-id":`collapse-${n}`,$noBgColor:a,$purpleColors:r,children:[e(ec,{$isOpen:s,children:[e(oe,{$gap:10,children:[t(ee,{size:te.XS,children:n}),o&&t(Ue,{text:o,withIcon:!0}),t(ce,{label:i.length,status:r?Pe.Default:void 0})]}),t(yt,{icon:s?Ja:qa,size:Ct.M,onClick:()=>c(e=>!e)})]}),s?t(ae,{children:i.length?u.toArray(i):t(ft,{$padding:"12px 0",children:t($e,{})})}):null]})},nc=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||ze(e.supportedSignals).includes(n.signalType))):e,oc=({option:e,formData:n,testResult:o,isSelected:i,onSelect:a})=>t(is,{icon:wt(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:i,onClick:()=>a(),children:o&&t(ce,{status:o.succeeded?Pe.Success:Pe.Error,leftIcon:o.succeeded?Za:Qa})}),ic=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:i,onChangeActiveForm:a}=Wl();return n?.length?t(tc,{title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:n.map((n,o)=>t(oc,{option:n,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=n.id&&""!==n.id?i?.option.id===n.id:i?.option.type===n.type),onSelect:()=>a({listType:e,option:n})},`${e}-${n.id??n.type}-${o}`))}):o?.length?t(tc,{purpleColors:!0,title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},r)=>t(oc,{option:n,formData:o,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:n,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var ac;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(ac||(ac={}));const lc=(e,t)=>{const n=[],o=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===ac.SELF_HOSTED?o.push(...e.items):e.name===ac.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=Tt(o),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const o=kt(t.fields,{});Object.keys(o).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:o[e.name]})),n.push(e.items[i]))}}}),{[bt.DETECTED]:n,[bt.SELF_HOSTED]:o,[bt.MANAGED]:i}},rc=({onClose:e,onBack:n,onNext:o,selectedConnectionIds:r,setSelectedConnectionIds:s,initialInputs:c,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=Gl(),[m,g]=l(""),[f,b]=l({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:I}=Wl();a(()=>{c&&I(c)},[c]);const
|
|
79
|
+
`,tc=({title:n,tooltip:o,list:i,noBgColor:a,purpleColors:r})=>{const[s,c]=l(!0);return e(Qs,{"data-id":`collapse-${n}`,$noBgColor:a,$purpleColors:r,children:[e(ec,{$isOpen:s,children:[e(oe,{$gap:10,children:[t(ee,{size:te.XS,children:n}),o&&t(Ue,{text:o,withIcon:!0}),t(ce,{label:i.length,status:r?Pe.Default:void 0})]}),t(yt,{icon:s?Ja:qa,size:Ct.M,onClick:()=>c(e=>!e)})]}),s?t(ae,{children:i.length?u.toArray(i):t(ft,{$padding:"12px 0",children:t($e,{})})}):null]})},nc=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||ze(e.supportedSignals).includes(n.signalType))):e,oc=({option:e,formData:n,testResult:o,isSelected:i,onSelect:a})=>t(is,{icon:wt(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:i,onClick:()=>a(),children:o&&t(ce,{status:o.succeeded?Pe.Success:Pe.Error,leftIcon:o.succeeded?Za:Qa})}),ic=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:i,onChangeActiveForm:a}=Wl();return n?.length?t(tc,{title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:n.map((n,o)=>t(oc,{option:n,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=n.id&&""!==n.id?i?.option.id===n.id:i?.option.type===n.type),onSelect:()=>a({listType:e,option:n})},`${e}-${n.id??n.type}-${o}`))}):o?.length?t(tc,{purpleColors:!0,title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},r)=>t(oc,{option:n,formData:o,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:n,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var ac;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(ac||(ac={}));const lc=(e,t)=>{const n=[],o=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===ac.SELF_HOSTED?o.push(...e.items):e.name===ac.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=Tt(o),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const o=kt(t.fields,{});Object.keys(o).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:o[e.name]})),n.push(e.items[i]))}}}),{[bt.DETECTED]:n,[bt.SELF_HOSTED]:o,[bt.MANAGED]:i}},rc=({onClose:e,onBack:n,onNext:o,selectedConnectionIds:r,setSelectedConnectionIds:s,initialInputs:c,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=Gl(),[m,g]=l(""),[f,b]=l({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:I}=Wl();a(()=>{c&&I(c)},[c]);const E=C||x,N=i(()=>y?.destinationCategories?.categories??[],[y]),[O,$]=l({[bt.ALL]:[],[bt.UNSAVED]:[],[bt.EXISTS]:[],[bt.DETECTED]:[],[bt.SELF_HOSTED]:[],[bt.MANAGED]:[]});a(()=>{const e=v.map(e=>{let t;for(const n of N){const o=n.items.find(t=>t.type===e.destinationType.type);if(o){t=o;break}}const n=kt(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:n[e.name]??e.initialValue})):[]}});$(t=>({...t,[bt.EXISTS]:e}))},[v,N]),a(()=>{(y||S)&&$(e=>({...e,...lc(y,S)}))},[y,S]);const A=d(async()=>{for(const{option:e,formData:t}of k){const n=Be(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),o=Object.fromEntries(n.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==o[e])){await h.update(e.id,n);continue}}await h.create(n)}},[k,h]),R=(({isFetching:e,destinationsByCategory:n,searchText:o,filters:a})=>{const{unsavedDestinations:l}=Wl();return{width:"40%",list:i(()=>{const i=[];l.length&&i.push(t(ic,{listType:bt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(bt)){if(a.categoryType&&a.categoryType!==e)continue;const l=nc(n[e],o,a);l.length&&i.push(t(ic,{listType:e,destinationOptions:l},e))}return e&&i.push(t(ft,{$height:"100%",children:t(St,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),i},[l,n,o,a,e])}})({isFetching:E,destinationsByCategory:O,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Wl();return{width:"60%",list:e?[t($s,{},e.option.type)]:[t(ft,{$height:"100%",children:t($e,{icon:Ya,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Nr,{isOpen:!0,withOverlay:p,disableAnimation:u,onClose:e,onBack:n?()=>n(k):void 0,onNext:o?()=>o(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:E,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:nt.CREATING_DESTINATION,subTitle:nt.CREATING_DESTINATION_SUBTITLE},header:{icon:Ya,title:nt.ADD_DESTINATIONS,subTitle:nt.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:r&&s?{value:r,setValue:s}:void 0,search:{value:m,onChange:g},filters:t(Zs,{destinationsByCategory:O,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},sc=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:a})=>{const{isEnterprise:r}=S(),{instrumentationRulesApi:s}=Gl(),[c,d]=l(""),u=p(null),{selectedOption:h,onSelectOption:m,genericForm:g,validateFormData:f}=Kl(),{options:b,loading:v}=s.useRuleTypes(),y=i(()=>b.length?b:It,[b]),C=i(()=>c?y.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):y,[y,c]),x=i(()=>v?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:C.map(e=>{const n=h?.type===e.type;return t(is,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{u.current?.clearErrors(),m(e)}},e.type)}),[v,h?.type,C,m]),w=i(()=>v?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:h?[t(Ms,{},h.type)]:[t(ft,{$height:"100%",children:t($e,{icon:el,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[v,h]);return t(Nr,{ref:u,isOpen:!0,withOverlay:a,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=f();if(e)return!1;await s.create(t,h?.type)},disableSave:!h||!g?.isFormDirty||!r,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,forcedNote:{fullWidth:!0,status:Pe.Warning,message:"This feature is only supported for OnPrem (Enterprise) installations"},progress:{title:nt.CREATING_INSTRUMENTATION_RULE,subTitle:nt.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:el,title:nt.ADD_INSTRUMENTATION_RULE,subTitle:nt.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:x},rightColumn:{width:"60%",list:w}})},cc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:nt.FETCHING_NAMESPACES,subTitle:nt.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:nt.SELECT_NAMESPACE,subTitle:nt.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},dc={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Et.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},pc=e=>e?dc:cc,uc="No matches",hc=e=>(e?"Unselect":"Select")+" all",mc="Selected",gc=b.div``,fc=b.div`
|
|
80
80
|
visibility: hidden;
|
|
81
81
|
|
|
82
82
|
transition: visibility 0s;
|
|
@@ -119,7 +119,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
119
119
|
justify-content: flex-end;
|
|
120
120
|
align-items: center;
|
|
121
121
|
min-width: 0;
|
|
122
|
-
`,xc=({clusterId:n,namespaceName:o,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=Gl(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(vc,{children:t(is,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(yc,{$withAuto:p,children:[p&&t(Cc,{$visible:r||a,children:t(Ue,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(ge,{label:"Auto",labelAlign:fe.Left,size:
|
|
122
|
+
`,xc=({clusterId:n,namespaceName:o,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=Gl(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(vc,{children:t(is,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(yc,{$withAuto:p,children:[p&&t(Cc,{$visible:r||a,children:t(Ue,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(ge,{label:"Auto",labelAlign:fe.Left,size:Nt.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(Sc,{children:[t(ee,{variant:Ot.Span,size:te.XXXS,color:ne.Secondary,align:"right",nowrap:!0,children:mc}),t(ce,{label:`${l.sourced}/${l.total}`,status:r?Pe.Default:Pe.Unknown,minWidth:"42px"})]})]})})})},wc=({withCollapse:e,clusterId:n,clusterName:o,namespaces:a,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=i(()=>a.map(({name:e,totalWorkloads:i,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(xc,{clusterId:n,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:a,total:i},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>r({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:s},`${n}#${e}`)),[n,o,a,l]);return e?t(tc,{title:o,list:c,noBgColor:!0}):c},Tc=({onClose:n,onBack:o,onNext:r,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isK8s:u}=S(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=Gl(),{data:f,loading:b,pending:v,refetch:y}=m.useSnapshots(),{items:C,loading:x}=g.useNamespaces({skip:v||!!f}),w=pc(!u),{selectedStreamName:T}=ot(),{progress:k,resetProgress:I}=$t(),{isFetching:E,setIsFetching:N,setSnapshots:O,formData:$,handleSourceChange:A,handleSelectAll:R,formDiff:D,isFormDirty:_}=or();a(()=>{y()},[]);const P=i(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:Rt,clusterName:At,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(T),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(T)??!1)}))||[]}))}]}:null},[f,C,T]);a(()=>{N(b||x),P&&O(P)},[P,b,x,N,O]);const[L,F]=l(""),[M,z]=l(Et.Namespace),[B,X]=l({showOnlySelected:!1}),[U,V]=l({clusterId:"",clusterName:"",namespaceName:""}),H=(({isFetching:n,formData:o,handleSourceChange:a,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:p})=>{const{isK8s:u}=S(),h=pc(!u),m=i(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>tr(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...nr(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,c,p]),g=i(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:n,selectedCount:o}of t)if(e=!0,o!==n)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:y}=i(()=>{const e=m.map(({clusterId:e,clusterName:n,visibleNamespaces:o})=>o.length?t(wc,{withCollapse:m.length>1,clusterId:e,clusterName:n,namespaces:o,selectedArea:r,setSelectedArea:s,handleSourceChange:a},e):null).filter(e=>null!==e),n=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),i=o.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==i,filteredCount:n,totalCount:i}},[m,o,r]);return{width:"60%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:h.groupColumnHeader}),t(Ue,{text:b?nt.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ee,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:p}),disabled:!f.length,size:te.XS,children:hc(g)})]}),list:f.length?f:n?[t(ft,{$height:"100%",children:t(St,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(ft,{$height:"100%",children:t($e,c?{icon:nl,title:uc,subTitle:h.noGroupMatchedFilter(c)}:{icon:nl,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:E,formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:U,setSelectedArea:V,searchText:M===Et.Namespace?L:"",searchBy:M,filters:B}),j=(({formData:n,handleSourceChange:o,handleSelectAll:a,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{isK8s:d,isEnterprise:p}=S(),u=pc(!d),h=i(()=>l.value.namespaceName?n.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[n,l.value.clusterId,l.value.namespaceName]),m=i(()=>h?[...h.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ql(e,r,c)):[],[h,r,c]),g=i(()=>!!m.length&&m.every(({selected:e})=>e),[m]),f=i(()=>{if(!h)return[];const{clusterId:e}=l.value,{name:n}=h;return m.map(({name:i,selected:a,kind:l,region:r})=>{const s=d&&!p&&er.has(l);return t(bc,{workloadName:i,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:n,name:i,kind:l,region:r}}),disabled:s},`${e}#${n}#${i}#${l}#${r??""}`)})},[m,h,l.value.clusterId,o,d,p]),{withFilterCount:b,filteredCount:v,totalCount:y}=i(()=>{const e=h?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,h]);return{width:"40%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${u.itemColumnHeader}`:u.itemColumnHeader}),t(Ue,{text:b?nt.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ee,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!g,searchText:r,searchBy:s,filters:c}),disabled:!f.length,size:te.XS,children:hc(g)})]}),list:f.length?f:[t(ft,{$height:"100%",children:t($e,h?r?{icon:tl,title:uc,subTitle:(C=r,`No sources matched the filter '${C}'`)}:{icon:tl,title:"No sources",subTitle:u.noItemsInGroupSubTitle}:{icon:tl,title:u.selectGroupPrompt.title,subTitle:u.selectGroupPrompt.subTitle})},"no-data")]};var C})({formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:{value:U},searchText:M===Et.Source?L:"",searchBy:M,filters:B});return t(Nr,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:n?()=>{I(Dt.BulkInstrumenting),n()}:void 0,onBack:o?()=>o(D):void 0,onNext:r?()=>r(D):void 0,nextIsSkip:!_,onSave:()=>h.persistV2(D),header:{icon:tl,title:nt.ADD_SOURCE,subTitle:nt.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:L,onChange:e=>{F(e),M===Et.Namespace&&V({clusterId:"",clusterName:"",namespaceName:""})},placeholder:w.searchPlaceholder(M),segment:{options:[{label:w.groupSegmentLabel,value:Et.Namespace},{label:w.itemSegmentLabel,value:Et.Source}],selected:M,setSelected:z}},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{name:"filter-selected",size:Nt.S,label:mc,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:_,isFetching:E,progress:{title:nt.CREATING_SOURCES,subTitle:nt.CREATING_SOURCES_SUBTITLE,percentage:k[Dt.BulkInstrumenting]?.percentage||0},leftColumn:H,rightColumn:j})},kc={aws:al,gcp:il,azure:ol},Ic={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Ec=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Nc=e=>e.provider.toUpperCase(),Oc=b.div`
|
|
123
123
|
display: flex;
|
|
124
124
|
flex-direction: column;
|
|
125
125
|
gap: 8px;
|
|
@@ -158,7 +158,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
158
158
|
gap: 2px;
|
|
159
159
|
flex: 1;
|
|
160
160
|
min-width: 0;
|
|
161
|
-
`,Dc=({providers:n,selectedProvider:o,onSelect:i})=>{const a=v();return n.length?t(Oc,{children:n.map(n=>{const l=(e=>kc[e.provider]??ll)(n),r=n.provider===o,s=(e=>{const t=e.features.find(e=>e.key===_t.Discovery);if(!t)return"";const n=[],o=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,i=Ic[t]??
|
|
161
|
+
`,Dc=({providers:n,selectedProvider:o,onSelect:i})=>{const a=v();return n.length?t(Oc,{children:n.map(n=>{const l=(e=>kc[e.provider]??ll)(n),r=n.provider===o,s=(e=>{const t=e.features.find(e=>e.key===_t.Discovery);if(!t)return"";const n=[],o=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,i=Ic[t]??Ec(t);o.has(i)||(o.add(i),n.push(i))}return n.join(", ")})(n);return e($c,{type:"button",$selected:r,onClick:()=>i(n.provider),"data-id":`cloud-connector-provider-${n.provider}`,children:[t(Ac,{children:t(l,{size:24})}),e(Rc,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ne.Primary,children:Nc(n)}),s&&t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:s})]}),t(La,{size:18,fill:a.v2.colors.silver[300]})]},n.provider)})}):t(ee,{size:te.XS,color:ne.Secondary,children:"No providers available."})},_c=b.div`
|
|
162
162
|
display: flex;
|
|
163
163
|
flex-direction: column;
|
|
164
164
|
gap: 8px;
|
|
@@ -230,7 +230,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
230
230
|
min-width: 0;
|
|
231
231
|
`,Yc=b(Kc)`
|
|
232
232
|
justify-content: center;
|
|
233
|
-
`,Jc={discovery:!1,instrumentation:!1},qc=({provider:n,capabilities:i,onCapabilitiesChange:a})=>{const l=Vc(n),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(Gc,{children:e(Wc,{children:[t(Kc,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(Yc,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(Yc,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(n=>{const a=i[n.typeName]??Jc,l=void 0!==n.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(o.Fragment,{children:[t(Kc,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.displayName})}),t(Yc,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-discovery`,size:
|
|
233
|
+
`,Jc={discovery:!1,instrumentation:!1},qc=({provider:n,capabilities:i,onCapabilitiesChange:a})=>{const l=Vc(n),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(Gc,{children:e(Wc,{children:[t(Kc,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(Yc,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(Yc,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(n=>{const a=i[n.typeName]??Jc,l=void 0!==n.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(o.Fragment,{children:[t(Kc,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.displayName})}),t(Yc,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-discovery`,size:Nt.S,value:s,disabled:a.instrumentation,onChange:e=>r(n.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(Yc,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-instrumentation`,size:Nt.S,value:a.instrumentation,disabled:!l,onChange:e=>r(n.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},n.typeName)})]})}):null},Zc=b.div`
|
|
234
234
|
display: flex;
|
|
235
235
|
flex-direction: column;
|
|
236
236
|
gap: 8px;
|
|
@@ -358,12 +358,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
358
358
|
border-radius: 12px;
|
|
359
359
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
360
360
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
361
|
-
`,
|
|
361
|
+
`,Ed=b.div`
|
|
362
362
|
display: flex;
|
|
363
363
|
align-items: center;
|
|
364
364
|
justify-content: flex-end;
|
|
365
365
|
width: 100%;
|
|
366
|
-
`,
|
|
366
|
+
`,Nd=b.div`
|
|
367
367
|
flex: 1;
|
|
368
368
|
width: 100%;
|
|
369
369
|
min-height: 200px;
|
|
@@ -377,7 +377,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
377
377
|
line-height: 20px;
|
|
378
378
|
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
379
379
|
white-space: pre;
|
|
380
|
-
`,$d=({step:n,setupMethod:o})=>{const i=v(),{CopyButton:a}=Pt(),{description:l,steps:r,code:s}=(e=>Cd[e]??Cd[bd.CloudFormation])(o);return t(gd,{"data-id":"cloud-connector-create-role",step:n,title:nt.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e(Sd,{children:[e(xd,{children:[t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(wd,{children:r.map((n,a)=>e(Td,{children:[t(kd,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:i.v2.colors.purple[200],children:a+1})}),t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:n})]},`${o}-step-${a}`))})]}),e(Id,{children:[t(
|
|
380
|
+
`,$d=({step:n,setupMethod:o})=>{const i=v(),{CopyButton:a}=Pt(),{description:l,steps:r,code:s}=(e=>Cd[e]??Cd[bd.CloudFormation])(o);return t(gd,{"data-id":"cloud-connector-create-role",step:n,title:nt.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e(Sd,{children:[e(xd,{children:[t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(wd,{children:r.map((n,a)=>e(Td,{children:[t(kd,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:i.v2.colors.purple[200],children:a+1})}),t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:n})]},`${o}-step-${a}`))})]}),e(Id,{children:[t(Ed,{children:t(a,{value:s,size:Ct.XS})}),t(Nd,{children:t(Od,{children:s})})]})]})})},Ad=b.div`
|
|
381
381
|
display: flex;
|
|
382
382
|
flex-direction: column;
|
|
383
383
|
gap: 16px;
|
|
@@ -395,7 +395,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
395
395
|
display: flex;
|
|
396
396
|
width: 100%;
|
|
397
397
|
max-width: 479px;
|
|
398
|
-
`,Pd=({step:n})=>{const{genericForm:o,providers:a}=ir(),{provider:l,authMethod:r,awsAccountId:s,credentials:c}=o.formData,d=i(()=>a.find(e=>e.provider===l),[a,l]),p=i(()=>((e,t)=>{const n=e?.auth?.methods?.find(e=>e.id===t);if(!n)return[];const o=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return n.baseMethods?.forEach(e=>l(o.get(e)?.fields)),l(n.fields),a})(d,r),[d,r]);return t(gd,{"data-id":"cloud-connector-enter-arn",step:n,title:nt.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:nt.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e(Ad,{children:[t(_d,{children:t(
|
|
398
|
+
`,Pd=({step:n})=>{const{genericForm:o,providers:a}=ir(),{provider:l,authMethod:r,awsAccountId:s,credentials:c}=o.formData,d=i(()=>a.find(e=>e.provider===l),[a,l]),p=i(()=>((e,t)=>{const n=e?.auth?.methods?.find(e=>e.id===t);if(!n)return[];const o=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return n.baseMethods?.forEach(e=>l(o.get(e)?.fields)),l(n.fields),a})(d,r),[d,r]);return t(gd,{"data-id":"cloud-connector-enter-arn",step:n,title:nt.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:nt.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e(Ad,{children:[t(_d,{children:t(Ee,{name:"cloud-connector-aws-account-id",width:"100%",label:nt.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:nt.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:nt.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:s,onChange:e=>o.handleFormChange("awsAccountId",e.target.value)})}),p.length>0&&t(Rd,{children:p.map(e=>t(Dd,{children:t(Ee,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?Mt.Password:Mt.Text,label:e.displayName||e.name,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:e.displayName||e.name,value:c[e.name]??"",onChange:t=>{return n=e.name,i=t.target.value,void o.handleFormChange("credentials",{...c,[n]:i});var n,i}})},e.name))})]})})},Ld=b.div`
|
|
399
399
|
display: flex;
|
|
400
400
|
flex-direction: column;
|
|
401
401
|
padding: 16px;
|
|
@@ -533,7 +533,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
533
533
|
border-radius: 12px;
|
|
534
534
|
border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
|
|
535
535
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
536
|
-
`,np=({isTesting:n,error:o,result:a})=>{const l=v(),{CopyButton:r}=Pt(),s=i(()=>a?.checks.filter(e=>!e.passed)??[],[a]),c=!(n||!o&&(!a||a.success)),d=o?nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=o||s.map(e=>e.message).filter(Boolean).join("\n");return t(Vd,{children:t(Hd,{children:n?t(jd,{children:t(Gd,{children:t(St,{withVisual:!0,withGradient:!0,title:nt.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:te.XS})})}):c?t(jd,{children:e(Wd,{children:[t(Kd,{children:t(Qa,{size:20,fill:l.v2.colors.black[500]})}),t(ee,{size:te.XS,weight:400,lineHeight:"20px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(ee,{align:"center",size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:d}),p&&e(Yd,{children:[t(Jd,{children:p}),t(r,{value:p,size:Ct.XS})]})]})}):a?e(qd,{children:[t(ce,{status:Pe.Success,label:nt.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Za,fullWidth:!0}),(a.accountId||a.identity)&&e(Zd,{children:[a.accountId&&e(Qd,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.accountId})]}),a.identity&&e(Qd,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.identity})]})]}),a.checks.length>0&&t(ep,{children:a.checks.map(n=>e(tp,{$passed:n.passed,children:[t(ce,{status:n.passed?Pe.Success:Pe.Error,label:n.displayName,leftIcon:n.passed?Za:Qa}),n.message&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:n.message}),!n.passed&&n.remediation&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.remediation})]},n.name))})]}):t(jd,{children:t(ee,{size:te.XXS,weight:400,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var op;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(op||(op={}));const ip=op.SelectProvider,ap=op.Validate,lp=({onClose:n,withOverlay:o,onCreateCloudConnector:a,onCreated:r})=>{const{providers:s,genericForm:c}=ir(),[p,u]=l(ip),[h,m]=l(!1),[g,f]=l(!1),[b,v]=l(void 0),[y,C]=l(void 0),[S,x]=l(void 0),w=c.isFormDirty,T=p===ip,k=p===ap,I=d(()=>{w&&!h?m(!0):(m(!1),n?.())},[w,h,n]),N=d(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>ip?e-1:e)},[]),E=d(()=>{if(x(void 0),p===op.SelectProvider){if(!c.formData.provider)return void x("Please select a cloud provider");if(!c.formData.permission)return void x("Please select a permission level")}u(e=>e<ap?e+1:e)},[p,c.formData.provider,c.formData.permission]),O=d(async()=>{if(x(void 0),C(void 0),v(void 0),u(op.Validate),!a)return;const{provider:e,permission:t,customCapabilities:n,awsAccountId:o,credentials:i,name:l}=c.formData,d=((e,t,n)=>{const o=Vc(e),i=[];return o.forEach(e=>{const o=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Bc.DiscoveryOnly:a=!0;break;case Bc.DiscoveryInstrumentation:a=!0,l=o;break;case Bc.Custom:{const t=n[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(s.find(t=>t.provider===e),t,n);f(!0);try{const t=await a({provider:e,displayName:l,credentials:i,expectedAccountId:o,capabilities:d});if(t.created)return void r?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[a,r,c.formData,s]),$=g,A=k&&!g&&(!!y||!!b&&!b.success),R=i(()=>S?{status:Pe.Error,message:S}:void 0,[S]),D=i(()=>T?{"data-id":"cloud-connector-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:I,disabled:$}:{"data-id":"cloud-connector-back",label:Ft.BACK,variant:Ie.Text,leftIcon:cl,onClick:N,disabled:$},[T,I,N,$]),_=i(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Ft.RETRY,variant:Ie.Primary,rightIcon:pl,onClick:O}:void 0}return p===op.Config?{"data-id":"cloud-connector-verify",label:Ft.VERIFY_AND_CREATE_CONNECTOR,variant:Ie.Primary,onClick:O,disabled:$}:{"data-id":"cloud-connector-next",label:Ft.NEXT,variant:Ie.Primary,onClick:E,disabled:$}},[k,g,A,p,O,E,$]),P=i(()=>[D,_].filter(Boolean),[D,_]);return e(zt,{width:Or,isOpen:!0,hideOverlay:!$&&!o,header:{icon:ll,title:nt.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:R,actions:P},children:[p===op.SelectProvider&&t(cd,{}),p===op.Config&&t(Ud,{onBack:N}),p===op.Validate&&t(np,{isTesting:g,error:y,result:b}),t($r,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},rp=({statuses:e})=>{const n=i(()=>Bt(e).map(({status:e,type:t,reason:n,message:o})=>({status:e,title:Xt(n||t),subTitle:o??void 0})),[e]);return n.length?t(ae,{$gap:12,children:n.map(e=>t(Ut,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},sp=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}],o=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&n.push({id:"signals",title:nt.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:nt.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},cp=({onClose:o,actionId:r})=>{const s=v(),{isK8s:c}=S(),{actionsApi:u}=Gl(),{items:h,refetch:m}=u.useActions(),{options:g}=u.useActionTypes(),{selectedOption:f,loadAction:b,validateFormData:y,genericForm:C}=jl(),x=p(m);x.current=m,a(()=>{x.current()},[]);const[w,T]=l(!1),[k,I]=l(!1),[N,E]=l(null),O=w&&!!C?.isFormDirty;a(()=>{if(w)return;const e=setInterval(()=>x.current(),3e3);return()=>clearInterval(e)},[w]);const $=i(()=>h?.find(e=>jt(e)===r),[r,h]),A=i(()=>g.find(({type:e})=>e===$?.type)??Gt.find(({type:e})=>e===$?.type)??null,[g,$?.type]),R=$?.statuses&&Array.isArray($.statuses)?$.statuses:null;a(()=>{$&&b($,A)},[$,A]);const D=d(()=>{$&&T(!0)},[$]),_=d(()=>{$&&(b($,A),T(!1))},[$,A,b]),P=d(()=>{O?E("close"):o()},[O,o]),L=d(()=>{O?E("cancel"):_()},[O,_]),F=d(()=>{const e=N;E(null),"close"===e?(_(),o()):_()},[N,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=y();e||(await u.update($.id,t),T(!1))}},[$,y,u]),z=d(()=>{$&&I(!0)},[$]),B=d(async()=>{$&&(await u.remove($.id,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?Vt(U.fields||{},V.fields,{signals:U.signals||[],skipComponentTypes:[Ht.SourceScopes]}):[]);var U,V;const H=A.fields?.find(e=>e.componentType===Ht.SourceScopes),j=H?.name||de.Scopes,G=$.fields?.[j]??null,W=c&&(!!H||void 0!==$.fields?.scopes);return e(n,{children:[t(zt,{isOpen:!0,header:{icon:Yt($.type),title:A.label,onClose:P,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:ja,active:w,onClick:D},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:k,onClick:z}]},footer:{actions:w?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:L},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:M}]:[]},children:t(le,{$padding:"4px 12px 12px",children:w&&f?t(Es,{}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[c&&(R?t(rp,{statuses:R}):t(Kt,{conditions:$.conditions||[]})),t(Wt,{bgTint:"800",cellsPerRow:2,items:sp($,A)})]}),W&&t(vr,{readOnly:!0,scopes:G}),!!X?.length&&t(Wt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",cellsPerRow:2,items:X})})]})})})}),t(Ar,{target:"action",isOpen:k,onClose:()=>I(!1),onApprove:B}),t($r,{isOpen:null!==N,onClose:()=>E(null),onApprove:F})]})},dp=({onClose:n,connections:o,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=Gl(),[d,u]=l(""),[h,m]=l({showOnlySelected:!1}),g=i(()=>o.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&n}),[o.length,r.length,d,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=c.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=i(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Jt(C||{rollout:{automaticRolloutDisabled:!1}}),k=p(T);k.current=T,a(()=>{C&&k.current(C)},[C]);const I=i(()=>r.length>1||void 0!==C&&!w(C,S),[r.length,C,S]);return t(Er,{isOpen:!0,onClose:n,onSave:async()=>await(c.applyConfigurations?.(S,r))??void 0,header:{icon:ul,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:u},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{size:Et.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:y,leftColumn:{width:"35%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,children:"Clusters"}),t(ce,{label:g.length,status:Pe.Unknown})]}),e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,align:"right",children:"Selected clusters"}),t(ce,{label:`${r.length}/${g.length}`,status:Pe.Unknown})]})]}),list:g.map(e=>t(is,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ee,{size:te.XS,children:"Configurations"}),list:[t(ge,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},pp=e=>{const t=[{id:"type",title:nt.TYPE,label:e.destinationType.displayName},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}],n=Me(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&t.push({id:"monitors",title:nt.MONITORS,label:n}),e.name&&t.push({id:"name",title:nt.NAME,label:e.name}),t},up=({onClose:o,destinationId:r})=>{const s=v(),{isK8s:c}=S(),{destinationsApi:u}=Gl(),{selectedStreamName:h}=ot(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Wl();a(()=>{g()},[]);const T=p(null),[k,I]=l(!1),[N,E]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty,R=i(()=>Qt(m,h),[m,h]),D=i(()=>R?.find(e=>jt(e)===r),[r,R]),_=f?.destinationCategories?.categories??null;a(()=>{D&&_&&C(D,_)},[D,_]);const P=i(()=>D&&_?en(_,D):[],[D,_]),L=d(()=>{D&&I(!0)},[D]),F=d(()=>{D&&_&&(C(D,_),I(!1))},[D,_,C]),M=d(()=>{A?$("close"):o()},[A,o]),z=d(()=>{A?$("cancel"):F()},[A,F]),B=d(()=>{const e=O;$(null),"close"===e?(F(),o()):F()},[O,F,o]),X=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,Be(t)),I(!1))}},[D,x,u]),U=d(()=>{D&&E(!0)},[D]),V=d(async()=>{D&&(await u.remove(D.id),o())},[D,u,o]);if(!D)return null;const{icon:H,iconSrc:j}=wt(D.destinationType.type),G=((e,t)=>{const n=[],o=qt(e,t),i=o.map(e=>({name:e.key,value:e.value})),a=Me(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Zt(h,a,i))return;const{type:g}=kt(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==s&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(p===Ht.MultiInput){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(p===Ht.KeyValuePair){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"pairs",id:e,title:o,items:t.map((t,n)=>{const o=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=o.key?String(o.key):"",label:null!=o.value?String(o.value):""}})})}l.push({id:e,title:o,label:s})}else l.push({id:e,title:o,label:"-"})}),r(),n})(D,P);return e(n,{children:[t(zt,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:ja,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:N,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:z},...y?.option.testConnectionSupported&&c?[{"data-id":"edit-destination-btn-test-connection",label:Ft.TEST_CONNECTION,variant:Ie.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:X}]:[]},children:t(le,{$padding:"4px 12px 12px",children:b?t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})}):k&&y?t($s,{ref:T,isEdit:!0}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[c&&t(Kt,{conditions:D.conditions||[]}),t(Wt,{bgTint:"800",cellsPerRow:2,items:pp(D)})]}),!!G.length&&t(Wt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Wt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Wt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Ar,{target:"destination",isOpen:N,onClose:()=>E(!1),onApprove:V}),t($r,{isOpen:null!==O,onClose:()=>$(null),onApprove:B})]})},hp=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}];return e.ruleName&&n.push({id:"name",title:nt.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:nt.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},mp=({onClose:o,ruleId:r})=>{const s=v(),{addNotification:c}=tn(),{isK8s:p}=S(),{instrumentationRulesApi:u}=Gl(),{items:h,refetch:m}=u.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=Kl();a(()=>{m()},[]);const[C,x]=l(!1),[w,T]=l(!1),[k,I]=l(null),N=C&&!!y?.isFormDirty,{options:E}=u.useRuleTypes(),O=i(()=>E.length?E:It,[E]),$=i(()=>h?.find(e=>jt(e)===r),[r,h]),A=i(()=>O.find(({type:e})=>e===$?.type)??null,[O,$?.type]),R=i(()=>qe(A?.supportedLanguages),[A?.supportedLanguages]);a(()=>{$&&A&&f($,A)},[$,A]);const D=d(()=>{if($){if(!$.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_EDIT_RULE,crdType:Nt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});x(!0)}},[$,c]),_=d(()=>{$&&A&&(f($,A),x(!1))},[$,A,f]),P=d(()=>{N?I("close"):o()},[N,o]),L=d(()=>{N?I("cancel"):_()},[N,_]),F=d(()=>{const e=k;I(null),"close"===e?(_(),o()):_()},[k,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update($.ruleId,t,$.type),x(!1))}},[$,b,u]),z=d(()=>{if($){if(!$.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_DELETE_RULE,crdType:Nt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});T(!0)}},[$,c]),B=d(async()=>{$&&(await u.remove($.ruleId,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?Vt(U,V.fields,{skipComponentTypes:[Ht.SourceScopes]}):[]);var U,V;return e(n,{children:[t(zt,{isOpen:!0,header:{icon:on($.type),title:A.label,onClose:P,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:ja,active:C,onClick:D},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:w,onClick:z}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:L},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:M}]:[]},children:t(le,{$padding:"4px 12px 12px",children:C&&g?t(Ms,{}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[p&&t(Kt,{conditions:$.conditions||[]}),t(Wt,{bgTint:"800",cellsPerRow:2,items:hp($,A)})]}),p&&t(vr,{readOnly:!0,scopes:$.sourceScopes??null}),A.type===Je.CustomInstrumentation&&!!$.customInstrumentations?.[Ke.Php]?.length&&t(_e,{status:Pe.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!X?.length&&t(Wt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",cellsPerRow:2,items:X})}),!!R.length&&t(Wt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",children:t(oe,{$gap:12,$wrap:"wrap",children:R.map(e=>t(nn,{label:et(e),leftIcon:Qe(e),flex:R.length>1?"0.5":"1"},e))})})})]})})})}),t(Ar,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:B}),t($r,{isOpen:null!==k,onClose:()=>I(null),onApprove:F})]})};var gp;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(gp||(gp={}));const fp=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:a,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=an(),m=ln(!!n),g=i(()=>({title:l,icon:hl,withCopy:!0}),[l]),f=i(()=>{const e=[],t=rn(c);t&&e.push(t);const n=rn(d,sl,"health");n&&e.push(n);const o=rn(p,ml,"health");return o&&e.push(o),e},[c,d,p]),b=i(()=>o?[{id:`restart-pod-${l}`,icon:pl,label:Ft.RESTART_POD,onClick:()=>o(a,l)}]:void 0,[o,a,l]),v=i(()=>[{id:"nodeName",title:nt.NODE,label:r,withCopy:!0},{id:"age",title:nt.AGE,label:s?h(s,{style:"short"}):nt.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Wt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},bp=b.div`
|
|
536
|
+
`,np=({isTesting:n,error:o,result:a})=>{const l=v(),{CopyButton:r}=Pt(),s=i(()=>a?.checks.filter(e=>!e.passed)??[],[a]),c=!(n||!o&&(!a||a.success)),d=o?nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=o||s.map(e=>e.message).filter(Boolean).join("\n");return t(Vd,{children:t(Hd,{children:n?t(jd,{children:t(Gd,{children:t(St,{withVisual:!0,withGradient:!0,title:nt.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:te.XS})})}):c?t(jd,{children:e(Wd,{children:[t(Kd,{children:t(Qa,{size:20,fill:l.v2.colors.black[500]})}),t(ee,{size:te.XS,weight:400,lineHeight:"20px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(ee,{align:"center",size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:d}),p&&e(Yd,{children:[t(Jd,{children:p}),t(r,{value:p,size:Ct.XS})]})]})}):a?e(qd,{children:[t(ce,{status:Pe.Success,label:nt.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Za,fullWidth:!0}),(a.accountId||a.identity)&&e(Zd,{children:[a.accountId&&e(Qd,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.accountId})]}),a.identity&&e(Qd,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.identity})]})]}),a.checks.length>0&&t(ep,{children:a.checks.map(n=>e(tp,{$passed:n.passed,children:[t(ce,{status:n.passed?Pe.Success:Pe.Error,label:n.displayName,leftIcon:n.passed?Za:Qa}),n.message&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:n.message}),!n.passed&&n.remediation&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.remediation})]},n.name))})]}):t(jd,{children:t(ee,{size:te.XXS,weight:400,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var op;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(op||(op={}));const ip=op.SelectProvider,ap=op.Validate,lp=({onClose:n,withOverlay:o,onCreateCloudConnector:a,onCreated:r})=>{const{providers:s,genericForm:c}=ir(),[p,u]=l(ip),[h,m]=l(!1),[g,f]=l(!1),[b,v]=l(void 0),[y,C]=l(void 0),[S,x]=l(void 0),w=c.isFormDirty,T=p===ip,k=p===ap,I=d(()=>{w&&!h?m(!0):(m(!1),n?.())},[w,h,n]),E=d(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>ip?e-1:e)},[]),N=d(()=>{if(x(void 0),p===op.SelectProvider){if(!c.formData.provider)return void x("Please select a cloud provider");if(!c.formData.permission)return void x("Please select a permission level")}u(e=>e<ap?e+1:e)},[p,c.formData.provider,c.formData.permission]),O=d(async()=>{if(x(void 0),C(void 0),v(void 0),u(op.Validate),!a)return;const{provider:e,permission:t,customCapabilities:n,awsAccountId:o,credentials:i,name:l}=c.formData,d=((e,t,n)=>{const o=Vc(e),i=[];return o.forEach(e=>{const o=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Bc.DiscoveryOnly:a=!0;break;case Bc.DiscoveryInstrumentation:a=!0,l=o;break;case Bc.Custom:{const t=n[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(s.find(t=>t.provider===e),t,n);f(!0);try{const t=await a({provider:e,displayName:l,credentials:i,expectedAccountId:o,capabilities:d});if(t.created)return void r?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[a,r,c.formData,s]),$=g,A=k&&!g&&(!!y||!!b&&!b.success),R=i(()=>S?{status:Pe.Error,message:S}:void 0,[S]),D=i(()=>T?{"data-id":"cloud-connector-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:I,disabled:$}:{"data-id":"cloud-connector-back",label:Ft.BACK,variant:Ie.Text,leftIcon:cl,onClick:E,disabled:$},[T,I,E,$]),_=i(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Ft.RETRY,variant:Ie.Primary,rightIcon:pl,onClick:O}:void 0}return p===op.Config?{"data-id":"cloud-connector-verify",label:Ft.VERIFY_AND_CREATE_CONNECTOR,variant:Ie.Primary,onClick:O,disabled:$}:{"data-id":"cloud-connector-next",label:Ft.NEXT,variant:Ie.Primary,onClick:N,disabled:$}},[k,g,A,p,O,N,$]),P=i(()=>[D,_].filter(Boolean),[D,_]);return e(zt,{width:Or,isOpen:!0,hideOverlay:!$&&!o,header:{icon:ll,title:nt.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:R,actions:P},children:[p===op.SelectProvider&&t(cd,{}),p===op.Config&&t(Ud,{onBack:E}),p===op.Validate&&t(np,{isTesting:g,error:y,result:b}),t($r,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},rp=({statuses:e})=>{const n=i(()=>Bt(e).map(({status:e,type:t,reason:n,message:o})=>({status:e,title:Xt(n||t),subTitle:o??void 0})),[e]);return n.length?t(ae,{$gap:12,children:n.map(e=>t(Ut,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},sp=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}],o=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&n.push({id:"signals",title:nt.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:nt.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},cp=({onClose:o,actionId:r})=>{const s=v(),{isK8s:c}=S(),{actionsApi:u}=Gl(),{items:h,refetch:m}=u.useActions(),{options:g}=u.useActionTypes(),{selectedOption:f,loadAction:b,validateFormData:y,genericForm:C}=jl(),x=p(m);x.current=m,a(()=>{x.current()},[]);const[w,T]=l(!1),[k,I]=l(!1),[E,N]=l(null),O=w&&!!C?.isFormDirty;a(()=>{if(w)return;const e=setInterval(()=>x.current(),3e3);return()=>clearInterval(e)},[w]);const $=i(()=>h?.find(e=>jt(e)===r),[r,h]),A=i(()=>g.find(({type:e})=>e===$?.type)??Gt.find(({type:e})=>e===$?.type)??null,[g,$?.type]),R=$?.statuses&&Array.isArray($.statuses)?$.statuses:null;a(()=>{$&&b($,A)},[$,A]);const D=d(()=>{$&&T(!0)},[$]),_=d(()=>{$&&(b($,A),T(!1))},[$,A,b]),P=d(()=>{O?N("close"):o()},[O,o]),L=d(()=>{O?N("cancel"):_()},[O,_]),F=d(()=>{const e=E;N(null),"close"===e?(_(),o()):_()},[E,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=y();e||(await u.update($.id,t),T(!1))}},[$,y,u]),z=d(()=>{$&&I(!0)},[$]),B=d(async()=>{$&&(await u.remove($.id,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?Vt(U.fields||{},V.fields,{signals:U.signals||[],skipComponentTypes:[Ht.SourceScopes]}):[]);var U,V;const H=A.fields?.find(e=>e.componentType===Ht.SourceScopes),j=H?.name||de.Scopes,G=$.fields?.[j]??null,W=c&&(!!H||void 0!==$.fields?.scopes);return e(n,{children:[t(zt,{isOpen:!0,header:{icon:Yt($.type),title:A.label,onClose:P,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:ja,active:w,onClick:D},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:k,onClick:z}]},footer:{actions:w?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:L},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:M}]:[]},children:t(le,{$padding:"4px 12px 12px",children:w&&f?t(Ns,{}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[c&&(R?t(rp,{statuses:R}):t(Kt,{conditions:$.conditions||[]})),t(Wt,{bgTint:"800",cellsPerRow:2,items:sp($,A)})]}),W&&t(vr,{readOnly:!0,scopes:G}),!!X?.length&&t(Wt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",cellsPerRow:2,items:X})})]})})})}),t(Ar,{target:"action",isOpen:k,onClose:()=>I(!1),onApprove:B}),t($r,{isOpen:null!==E,onClose:()=>N(null),onApprove:F})]})},dp=({onClose:n,connections:o,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=Gl(),[d,u]=l(""),[h,m]=l({showOnlySelected:!1}),g=i(()=>o.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&n}),[o.length,r.length,d,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=c.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=i(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Jt(C||{rollout:{automaticRolloutDisabled:!1}}),k=p(T);k.current=T,a(()=>{C&&k.current(C)},[C]);const I=i(()=>r.length>1||void 0!==C&&!w(C,S),[r.length,C,S]);return t(Nr,{isOpen:!0,onClose:n,onSave:async()=>await(c.applyConfigurations?.(S,r))??void 0,header:{icon:ul,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:u},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{size:Nt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:y,leftColumn:{width:"35%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,children:"Clusters"}),t(ce,{label:g.length,status:Pe.Unknown})]}),e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,align:"right",children:"Selected clusters"}),t(ce,{label:`${r.length}/${g.length}`,status:Pe.Unknown})]})]}),list:g.map(e=>t(is,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ee,{size:te.XS,children:"Configurations"}),list:[t(ge,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},pp=e=>{const t=[{id:"type",title:nt.TYPE,label:e.destinationType.displayName},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}],n=Me(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&t.push({id:"monitors",title:nt.MONITORS,label:n}),e.name&&t.push({id:"name",title:nt.NAME,label:e.name}),t},up=({onClose:o,destinationId:r})=>{const s=v(),{isK8s:c}=S(),{destinationsApi:u}=Gl(),{selectedStreamName:h}=ot(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Wl();a(()=>{g()},[]);const T=p(null),[k,I]=l(!1),[E,N]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty,R=i(()=>Qt(m,h),[m,h]),D=i(()=>R?.find(e=>jt(e)===r),[r,R]),_=f?.destinationCategories?.categories??null;a(()=>{D&&_&&C(D,_)},[D,_]);const P=i(()=>D&&_?en(_,D):[],[D,_]),L=d(()=>{D&&I(!0)},[D]),F=d(()=>{D&&_&&(C(D,_),I(!1))},[D,_,C]),M=d(()=>{A?$("close"):o()},[A,o]),z=d(()=>{A?$("cancel"):F()},[A,F]),B=d(()=>{const e=O;$(null),"close"===e?(F(),o()):F()},[O,F,o]),X=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,Be(t)),I(!1))}},[D,x,u]),U=d(()=>{D&&N(!0)},[D]),V=d(async()=>{D&&(await u.remove(D.id),o())},[D,u,o]);if(!D)return null;const{icon:H,iconSrc:j}=wt(D.destinationType.type),G=((e,t)=>{const n=[],o=qt(e,t),i=o.map(e=>({name:e.key,value:e.value})),a=Me(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Zt(h,a,i))return;const{type:g}=kt(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==s&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(p===Ht.MultiInput){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(p===Ht.KeyValuePair){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"pairs",id:e,title:o,items:t.map((t,n)=>{const o=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=o.key?String(o.key):"",label:null!=o.value?String(o.value):""}})})}l.push({id:e,title:o,label:s})}else l.push({id:e,title:o,label:"-"})}),r(),n})(D,P);return e(n,{children:[t(zt,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:ja,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:E,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:z},...y?.option.testConnectionSupported&&c?[{"data-id":"edit-destination-btn-test-connection",label:Ft.TEST_CONNECTION,variant:Ie.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:X}]:[]},children:t(le,{$padding:"4px 12px 12px",children:b?t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})}):k&&y?t($s,{ref:T,isEdit:!0}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[c&&t(Kt,{conditions:D.conditions||[]}),t(Wt,{bgTint:"800",cellsPerRow:2,items:pp(D)})]}),!!G.length&&t(Wt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Wt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Wt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Ar,{target:"destination",isOpen:E,onClose:()=>N(!1),onApprove:V}),t($r,{isOpen:null!==O,onClose:()=>$(null),onApprove:B})]})},hp=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}];return e.ruleName&&n.push({id:"name",title:nt.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:nt.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},mp=({onClose:o,ruleId:r})=>{const s=v(),{addNotification:c}=tn(),{isK8s:p}=S(),{instrumentationRulesApi:u}=Gl(),{items:h,refetch:m}=u.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=Kl();a(()=>{m()},[]);const[C,x]=l(!1),[w,T]=l(!1),[k,I]=l(null),E=C&&!!y?.isFormDirty,{options:N}=u.useRuleTypes(),O=i(()=>N.length?N:It,[N]),$=i(()=>h?.find(e=>jt(e)===r),[r,h]),A=i(()=>O.find(({type:e})=>e===$?.type)??null,[O,$?.type]),R=i(()=>qe(A?.supportedLanguages),[A?.supportedLanguages]);a(()=>{$&&A&&f($,A)},[$,A]);const D=d(()=>{if($){if(!$.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_EDIT_RULE,crdType:Et.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});x(!0)}},[$,c]),_=d(()=>{$&&A&&(f($,A),x(!1))},[$,A,f]),P=d(()=>{E?I("close"):o()},[E,o]),L=d(()=>{E?I("cancel"):_()},[E,_]),F=d(()=>{const e=k;I(null),"close"===e?(_(),o()):_()},[k,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update($.ruleId,t,$.type),x(!1))}},[$,b,u]),z=d(()=>{if($){if(!$.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_DELETE_RULE,crdType:Et.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});T(!0)}},[$,c]),B=d(async()=>{$&&(await u.remove($.ruleId,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?Vt(U,V.fields,{skipComponentTypes:[Ht.SourceScopes]}):[]);var U,V;return e(n,{children:[t(zt,{isOpen:!0,header:{icon:on($.type),title:A.label,onClose:P,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:ja,active:C,onClick:D},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:w,onClick:z}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:L},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:M}]:[]},children:t(le,{$padding:"4px 12px 12px",children:C&&g?t(Ms,{}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[p&&t(Kt,{conditions:$.conditions||[]}),t(Wt,{bgTint:"800",cellsPerRow:2,items:hp($,A)})]}),p&&t(vr,{readOnly:!0,scopes:$.sourceScopes??null}),A.type===Je.CustomInstrumentation&&!!$.customInstrumentations?.[Ke.Php]?.length&&t(_e,{status:Pe.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!X?.length&&t(Wt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",cellsPerRow:2,items:X})}),!!R.length&&t(Wt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",children:t(oe,{$gap:12,$wrap:"wrap",children:R.map(e=>t(nn,{label:et(e),leftIcon:Qe(e),flex:R.length>1?"0.5":"1"},e))})})})]})})})}),t(Ar,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:B}),t($r,{isOpen:null!==k,onClose:()=>I(null),onApprove:F})]})};var gp;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(gp||(gp={}));const fp=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:a,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=an(),m=ln(!!n),g=i(()=>({title:l,icon:hl,withCopy:!0}),[l]),f=i(()=>{const e=[],t=rn(c);t&&e.push(t);const n=rn(d,sl,"health");n&&e.push(n);const o=rn(p,ml,"health");return o&&e.push(o),e},[c,d,p]),b=i(()=>o?[{id:`restart-pod-${l}`,icon:pl,label:Ft.RESTART_POD,onClick:()=>o(a,l)}]:void 0,[o,a,l]),v=i(()=>[{id:"nodeName",title:nt.NODE,label:r,withCopy:!0},{id:"age",title:nt.AGE,label:s?h(s,{style:"short"}):nt.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Wt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},bp=b.div`
|
|
537
537
|
display: flex;
|
|
538
538
|
align-items: center;
|
|
539
539
|
justify-content: space-between;
|
|
@@ -552,7 +552,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
552
552
|
width: fit-content;
|
|
553
553
|
border-radius: 8px;
|
|
554
554
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
555
|
-
`,Cp=({count:n,total:o,label:i,icon:a})=>{const l=v(),r=void 0===o?void 0:n===o?l.v2.colors.green[500]:l.v2.colors.red[500];return e(yp,{children:[e(oe,{$gap:0,$alignItems:"flex-end",children:[t(ee,{size:te.L,color:r,weight:500,nowrap:!0,children:n}),void 0!==o&&t(ee,{size:te.S,color:r,weight:500,nowrap:!0,children:`/${o}`})]}),e(oe,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(ee,{size:te.XXXS,nowrap:!0,children:i})]})]})},Sp=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===dn.PID)??e.identifyingAttributes?.find(({name:e})=>e===dn.VPID);return t?.value??null};var xp;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(xp||(xp={}));const wp=({overrideProcessNum:n,healthy:o,healthStatus:r,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const p=v(),[u,h]=l(xp.IdentifyingAttributes),m=ln(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=i(()=>{const e=c?.some(e=>!1===e.healthy),n=[{value:xp.IdentifyingAttributes,label:nt.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:p.v2.colors.purple[500]},{value:xp.InstrumentationLibraries,label:nt.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(gl,{...e,fill:p.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:p.v2.colors.purple[500]}];return{tabOptions:n,firstTabValue:n.find(e=>!e.disabled)?.value||n[0].value,bothTabsDisabled:n.every(e=>e.disabled)}},[s,c]);a(()=>{f&&h(f)},[f]);const y=i(()=>{switch(u){case xp.IdentifyingAttributes:return t(ae,{children:s?.map((e,n)=>t(
|
|
555
|
+
`,Cp=({count:n,total:o,label:i,icon:a})=>{const l=v(),r=void 0===o?void 0:n===o?l.v2.colors.green[500]:l.v2.colors.red[500];return e(yp,{children:[e(oe,{$gap:0,$alignItems:"flex-end",children:[t(ee,{size:te.L,color:r,weight:500,nowrap:!0,children:n}),void 0!==o&&t(ee,{size:te.S,color:r,weight:500,nowrap:!0,children:`/${o}`})]}),e(oe,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(ee,{size:te.XXXS,nowrap:!0,children:i})]})]})},Sp=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===dn.PID)??e.identifyingAttributes?.find(({name:e})=>e===dn.VPID);return t?.value??null};var xp;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(xp||(xp={}));const wp=({overrideProcessNum:n,healthy:o,healthStatus:r,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const p=v(),[u,h]=l(xp.IdentifyingAttributes),m=ln(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=i(()=>{const e=c?.some(e=>!1===e.healthy),n=[{value:xp.IdentifyingAttributes,label:nt.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:p.v2.colors.purple[500]},{value:xp.InstrumentationLibraries,label:nt.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(gl,{...e,fill:p.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:p.v2.colors.purple[500]}];return{tabOptions:n,firstTabValue:n.find(e=>!e.disabled)?.value||n[0].value,bothTabsDisabled:n.every(e=>e.disabled)}},[s,c]);a(()=>{f&&h(f)},[f]);const y=i(()=>{switch(u){case xp.IdentifyingAttributes:return t(ae,{children:s?.map((e,n)=>t(Np,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case xp.InstrumentationLibraries:return t(ae,{children:c?.map((e,n)=>t(Np,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[u,s,c]),C=i(()=>Sp({overrideProcessNum:n,identifyingAttributes:s}),[n,s]);return t("div",{ref:m,children:e(Wt,{bgTint:"800",richTitle:{title:C?`${nt.PROCESS} ${nt.PID(C)}`:nt.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ee,{color:o?ne.Success:ne.Error,size:te.XXXS,children:r?.message}),badges:[{key:"odigos-healthy",status:o?Pe.Success:Pe.Error,leftIcon:sl,label:o?nt.HEALTHY:nt.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!b,collapseIsDefaultOpen:d,children:[!b&&t(ve,{options:g,selected:u,setSelected:h}),!b&&y]})})},Tp=b.div`
|
|
556
556
|
display: flex;
|
|
557
557
|
align-items: ${({$withHealthBadge:e})=>e?"center":"flex-start"};
|
|
558
558
|
gap: 8px;
|
|
@@ -566,11 +566,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
566
566
|
`,Ip=b(ee)`
|
|
567
567
|
flex: 1 1 auto;
|
|
568
568
|
min-width: 0;
|
|
569
|
-
`,
|
|
569
|
+
`,Ep=b(oe)`
|
|
570
570
|
flex: 1 1 auto;
|
|
571
571
|
justify-content: flex-end;
|
|
572
572
|
min-width: 0;
|
|
573
|
-
`,
|
|
573
|
+
`,Np=({label:n,value:o,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(Tp,{$withHealthBadge:r,children:[t(kp,{size:te.XXS,color:ne.Secondary,$withHealthBadge:r,children:n}),o&&t(Ip,{size:te.XXS,color:ne.Primary,align:"right",children:o}),(i||r)&&e(Ep,{children:[i&&t(ce,{status:Pe.Info,label:nt.STANDARD,textSize:te.XXXS,invertColors:!0}),r&&e(oe,{$gap:4,children:[l&&t(Ip,{size:te.XXXS,color:ne.Error,align:"right",children:l}),t(ce,{status:a?Pe.Success:Pe.Error,label:a?nt.HEALTHY:nt.NOT_HEALTHY,leftIcon:sl,textSize:te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},Op=h(null),$p=({value:e,children:n})=>t(Op.Provider,{value:e,children:n}),Ap=({podContainers:e,sourceContainers:n,jumpToTarget:o})=>{const a=e??[],l=i(()=>({title:nt.CONTAINERS,titleSize:te.XS,badge:{label:a.length}}),[a.length]),r=i(()=>{const e=new Map;return n?.forEach(t=>e.set(t.containerName,t)),e},[n]);return t(Wt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:a.map(e=>{const n=o?.containerName===e.containerName;return t(Dp,{...e,language:pn(r.get(e.containerName)),jumpToTarget:n?o:null},`pod-container-${e.containerName}`)})})})},Rp=b.div`
|
|
574
574
|
display: flex;
|
|
575
575
|
flex-direction: column;
|
|
576
576
|
gap: 12px;
|
|
@@ -591,7 +591,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
591
591
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
592
592
|
}
|
|
593
593
|
`}
|
|
594
|
-
`,Bp=({serviceName:n,isVirtual:o,nodeAttributes:a})=>{const l=vn(e=>e.drawerEntityId),{items:r}=Gl().sourcesApi.useSources(),s=i(()=>r.find(e=>e.id.name===n||e.serviceName===n),[r,n]),c=i(()=>s&&JSON.stringify(yn(s))!==JSON.stringify(yn(l)),[s,l]),d=i(()=>{if(o){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[Cn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===Lp)return[yl];const e=s?Sn(s):void 0;return e?.length?e:[fl]},[o,a,n,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=vn.getState();e(wn(
|
|
594
|
+
`,Bp=({serviceName:n,isVirtual:o,nodeAttributes:a})=>{const l=vn(e=>e.drawerEntityId),{items:r}=Gl().sourcesApi.useSources(),s=i(()=>r.find(e=>e.id.name===n||e.serviceName===n),[r,n]),c=i(()=>s&&JSON.stringify(yn(s))!==JSON.stringify(yn(l)),[s,l]),d=i(()=>{if(o){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[Cn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===Lp)return[yl];const e=s?Sn(s):void 0;return e?.length?e:[fl]},[o,a,n,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=vn.getState();e(wn(Et.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??"",region:s?.id.region??""})}:void 0;return e(zp,{onClick:p,$withClick:!!p,children:[e(oe,{$gap:8,children:[t(xn,{icons:d}),t(ee,{size:te.XXS,children:n})]}),o&&t(ce,{status:Pe.Info,label:nt.VIRTUAL,textSize:te.XXXS,invertColors:!0,tooltip:nt.VIRTUAL_TOOLTIP})]})},Xp=e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){const t=e;if("string"==typeof t.k8sActualManifest)return t.k8sActualManifest;if("string"==typeof t.manifest)return t.manifest}},Up=({source:n})=>{const o=v(),{k8sManifestApi:r}=Gl(),[s,c]=l(!0),[d,p]=l(void 0),[u,h]=l(!0),[m,g]=l(void 0),[f,b]=l(!0),[y,C]=l({}),S=n.pods??[],x=S.map(e=>e.podName).join(",");a(()=>{r.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>p(Xp(e))).finally(()=>c(!1)),r.fetch({namespace:n.id.namespace,kind:Tn.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>g(Xp(e))).finally(()=>h(!1))},[r,n.id.namespace,n.id.kind,n.id.name]),a(()=>{const e=x?x.split(","):[];if(0===e.length)return C({}),void b(!1);let t=!1;return b(!0),Promise.all(e.map(async e=>{const{data:t}=await r.fetch({namespace:n.id.namespace,kind:Tn.Pod,name:e});return[e,Xp(t)]})).then(e=>{t||C(Object.fromEntries(e))}).finally(()=>{t||b(!1)}),()=>{t=!0}},[r,n.id.namespace,x]);const w=i(()=>[{label:nt.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:nt.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:nt.GET_POD_YAML,value:`kubectl get ${Tn.InstrumentationConfig} ${n.id.kind}-${n.id.name} -n ${n.id.namespace} -o yaml`}],[n.id.kind,n.id.name,n.id.namespace]);return e(Wt,{bgTint:"1000",children:[t(Wt,{bgTint:"900",richTitle:{icon:Cl,title:nt.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:w.map(({label:e,value:n},o)=>t(mn,{label:e,value:n},`debug-cmd-${o}-${e}`))}),s?t(re,{size:1}):t(Rr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),u?t(re,{size:1}):t(Rr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m}),S.map(e=>f?t(re,{size:1},e.podName):t(Rr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`Pod ${e.podName} YAML`,yaml:y[e.podName]},e.podName))]})},Vp=({title:n,children:o})=>e(ae,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),o]}),Hp=({source:n})=>{const o=i(()=>{const[e,t]=In(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(Vp,{title:nt.THROUGHPUT_LAST_10_SECONDS,children:e(oe,{$alignItems:"flex-end",$gap:4,children:[t(ee,{size:te.L,children:o.value}),t(ee,{size:te.XS,variant:Ot.Span,children:o.units})]})})},jp=({source:n})=>{const{CopyButton:o}=Pt();return t(Vp,{title:nt.NAMESPACE,children:e(oe,{children:[t(nn,{variant:hn.Blue,label:n.id.namespace}),t(o,{value:n.id.namespace,size:Ct.XS})]})})},Gp=({source:n})=>{const{CopyButton:o}=Pt(),i=n.id.region;return i?t(Vp,{title:nt.REGION,children:e(oe,{children:[t(nn,{variant:hn.Blue,label:i}),t(o,{value:i,size:Ct.XS})]})}):null},Wp=({source:e})=>{const n=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(Vp,{title:nt.ENABLED,children:t(oe,{children:t(nn,{variant:n?hn.Green:hn.Default,label:n?nt.ENABLED:nt.DISABLED})})})},Kp=({source:e,label:n})=>t(Vp,{title:nt.KIND,children:t(oe,{children:t(nn,{variant:hn.Blue,label:n||e.id.kind})})}),Yp=({source:n})=>{const{CopyButton:o}=Pt();return t(Vp,{title:nt.NAME,children:e(oe,{children:[t(nn,{variant:hn.Blue,label:n.id.name}),t(o,{value:n.id.name,size:Ct.XS})]})})},Jp=({source:n})=>{const{CopyButton:o}=Pt(),i=n.serviceName||n.id.name;return t(Vp,{title:nt.SERVICE_NAME,children:e(oe,{children:[t(nn,{variant:hn.Blue,label:i}),t(o,{value:i,size:Ct.XS})]})})},qp=({source:n})=>{const{isK8s:o,isConnector:a}=S(),l=i(()=>kn(n.id.kind),[n.id.kind]);return t(Wt,{children:e(oe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[o&&t(Hp,{source:n}),t(Wp,{source:n}),a&&t(Gp,{source:n}),o&&t(jp,{source:n}),t(Kp,{source:n,label:l}),t(Yp,{source:n}),!o&&t(Jp,{source:n})]})})},Zp=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Wt,{bgTint:"900",children:t(vp,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,Qp=({source:e})=>{const n=i(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?En(e.workloadOdigosHealthStatus.status):Pe.Unknown,title:Xt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(Ut,{...n,width:"100%"}):null},eu=h(null),tu=b.div`
|
|
595
595
|
position: relative;
|
|
596
596
|
`,nu=({children:e})=>{const n=p(null);return t(tu,{ref:n,children:t(eu.Provider,{value:n,children:e})})},ou=b.div`
|
|
597
597
|
position: fixed;
|
|
@@ -614,7 +614,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
614
614
|
gap: 8px;
|
|
615
615
|
`,au=b.div`
|
|
616
616
|
flex: 1;
|
|
617
|
-
`,lu=({width:n,onClose:o,onSave:i,saveTooltip:a,onDelete:r,deleteTooltip:s,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(eu),[y,C]=l(null);return
|
|
617
|
+
`,lu=({width:n,onClose:o,onSave:i,saveTooltip:a,onDelete:r,deleteTooltip:s,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(eu),[y,C]=l(null);return Nn(b??{current:null},o),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?Fr(e(ou,{$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(iu,{children:[t(au,{children:u}),e(oe,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(Te,{variant:Ie.Secondary,onClick:r,leftIcon:Ma,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ke.S,textColor:f.v2.colors.red[500]}),t(Te,{variant:Ie.Primary,onClick:i,leftIcon:Za,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:ke.S})]})]}),t("div",{children:t(_e,{status:Pe.Warning,message:p})})]}),document.body):null},ru=({language:n,overridden:o,onOverride:a,defaultValues:r})=>{const{tier:s}=S(),{formData:c,handleFormChange:d,resetFormData:p}=Jt(r),u=i(()=>{if(!n)return[];const e=On[n].community,t=s===$n.Onprem?On[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(oe,{$gap:4,$alignItems:"center",children:[o?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(nu,{children:[t(Ue,{text:nt.OVERRIDE_OTEL_DISTRO_NAME,children:t(yt,{icon:ja,onClick:b})}),g&&t(lu,{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])})})]})]})},su=({overridden:n,onOverride:o,defaultValues:a,originalValues:r})=>{const{addNotification:s}=tn(),{formData:c,handleFormChange:d,resetFormData:p}=Jt(a),u=i(()=>An.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(oe,{children:[n?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(nu,{children:[t(Ue,{text:nt.OVERRIDE_RUNTIME_DETAILS,children:t(yt,{icon:ja,onClick:b})}),g&&t(lu,{width:"500px",onClose:b,onSave:async()=>{!c.version||Rn(c.version)?(m(!0),await o(c),m(!1),b()):s({type:Pe.Warning,message:Ye.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:nt.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await o({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(oe,{$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(Ee,{label:nt.RUNTIME_VERSION,placeholder:nt.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${r.version||"none"}`})]})})]})]})},cu=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 o,{useMem
|
|
|
653
653
|
padding: 2px 6px;
|
|
654
654
|
border-radius: 8px;
|
|
655
655
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
656
|
-
`,Su=({overview:n,status:o})=>{const i=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(Cu,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Pe.Success:o,d=Pn(c,i);return e(oe,{$gap:2,children:[t(d,{size:16,fill:_n(i,c,"300")}),t(ee,{size:te.XXXS,color:ne.Secondary,children:`${l}/${n?.totalPods??0} ${s}`})]},a)})}):null},xu=({changedTime:e})=>{const{formatTimeAgo:n}=an();return t(ee,{size:te.XXXS,color:ne.Disable,nowrap:!0,children:`Agent Assignment Updated · ${n(e)}`})},wu=({source:n,onClickRollout:o,onClickRollback:a})=>{const l=n.rollout?.podsManifestInjectionStatus??n.conditions?.rollout,r=i(()=>{const{status:e,reasonEnum:i,message:a,actionItems:r}=l||{},s=cn(e);if(!s)return null;const c=yu(i,nt.ROLLOUT),d=a,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:Sl,onClick:o}]);return{status:s,title:c,subTitle:d,details:t(Su,{overview:n.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:n.rollout?.agentsMetaHashChangedTime?t(xu,{changedTime:n.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[n.rollout,l,o]),s=i(()=>{const{status:e,reasonEnum:t,message:o,actionItems:i}=n.autoRollback?.autoRollbackStatus||{},l=cn(e);if(!l)return null;const r=yu(t,nt.ROLLBACK),s=o,c=(i??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:pl,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:pl,onClick:a}),{status:l,title:r,subTitle:s,actionButtons:c}},[n,a]);return r||s?e(vu,{$gap:12,$alignItems:"stretch",children:[r&&t(Ut,{invertColors:!0,slim:!0,width:s?"calc(60% - 6px)":bu,...r}),s&&t(Ut,{invertColors:!0,slim:!0,width:r?"calc(40% - 6px)":bu,...s})]}):null},Tu=({source:e})=>{const{isK8s:n}=S(),{containers:o,containersRichTitle:a}=i(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?`${e.id.kind} ${nt.CONTAINERS}`:nt.DETECTED_PROCESSES,tooltip:t?.message||(n?nt.DETECTED_CONTAINERS_DESCRIPTION:nt.DETECTED_PROCESSES_DESCRIPTION),badge:cn(t?.status)===Pe.Loading?{status:Pe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(Wt,{bgTint:"1000",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:o.map(n=>n&&t(
|
|
656
|
+
`,Su=({overview:n,status:o})=>{const i=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(Cu,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Pe.Success:o,d=Pn(c,i);return e(oe,{$gap:2,children:[t(d,{size:16,fill:_n(i,c,"300")}),t(ee,{size:te.XXXS,color:ne.Secondary,children:`${l}/${n?.totalPods??0} ${s}`})]},a)})}):null},xu=({changedTime:e})=>{const{formatTimeAgo:n}=an();return t(ee,{size:te.XXXS,color:ne.Disable,nowrap:!0,children:`Agent Assignment Updated · ${n(e)}`})},wu=({source:n,onClickRollout:o,onClickRollback:a})=>{const l=n.rollout?.podsManifestInjectionStatus??n.conditions?.rollout,r=i(()=>{const{status:e,reasonEnum:i,message:a,actionItems:r}=l||{},s=cn(e);if(!s)return null;const c=yu(i,nt.ROLLOUT),d=a,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:Sl,onClick:o}]);return{status:s,title:c,subTitle:d,details:t(Su,{overview:n.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:n.rollout?.agentsMetaHashChangedTime?t(xu,{changedTime:n.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[n.rollout,l,o]),s=i(()=>{const{status:e,reasonEnum:t,message:o,actionItems:i}=n.autoRollback?.autoRollbackStatus||{},l=cn(e);if(!l)return null;const r=yu(t,nt.ROLLBACK),s=o,c=(i??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:pl,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:pl,onClick:a}),{status:l,title:r,subTitle:s,actionButtons:c}},[n,a]);return r||s?e(vu,{$gap:12,$alignItems:"stretch",children:[r&&t(Ut,{invertColors:!0,slim:!0,width:s?"calc(60% - 6px)":bu,...r}),s&&t(Ut,{invertColors:!0,slim:!0,width:r?"calc(40% - 6px)":bu,...s})]}):null},Tu=({source:e})=>{const{isK8s:n}=S(),{containers:o,containersRichTitle:a}=i(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?`${e.id.kind} ${nt.CONTAINERS}`:nt.DETECTED_PROCESSES,tooltip:t?.message||(n?nt.DETECTED_CONTAINERS_DESCRIPTION:nt.DETECTED_PROCESSES_DESCRIPTION),badge:cn(t?.status)===Pe.Loading?{status:Pe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return o.length?t(Wt,{bgTint:"1000",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:o.map(n=>n&&t(Nu,{...n,sourceId:e.id},`source-container-${n.containerName}`))})}):null},ku=b.div`
|
|
657
657
|
display: flex;
|
|
658
658
|
flex-direction: column;
|
|
659
659
|
align-self: stretch;
|
|
@@ -668,14 +668,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
668
668
|
padding: 8px;
|
|
669
669
|
border-radius: 10px;
|
|
670
670
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
671
|
-
`,
|
|
671
|
+
`,Eu=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
|
+
`,Nu=({sourceId:n,...o})=>{const{containerName:a,runtimeInfo:l,agentEnabled:r,overrides:s}=o,c=v(),{sourcesApi:d}=Gl(),p=i(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=i(()=>({language:pn(o),version:Ln(o)||void 0}),[o]),h=i(()=>!!s?.otelDistroName,[s]),m=i(()=>({otelDistroName:s?.otelDistroName||o.agentEnabled?.otelDistroName}),[s,o]),g=i(()=>!l&&!p,[l,p]),f=i(()=>g?fl:un(u.language),[g,u]),b=i(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),y=i(()=>g?{status:Pe.Loading,label:nt.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Pe.Success:Pe.Disabled,leftIcon:r?.otelDistroName?Xa:Ua,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),C=e=>d.update(n,{containerName:a,...h?m:{},...p?u:{},...e}),S=i(()=>{const e=[];return o.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(nt.HEAD_SAMPLING),(o.collectorConfig?.tailSampling?.noisyOperations?.length||o.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||o.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(nt.TAIL_SAMPLING),e},[o]);return e(ku,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(Iu,{children:t(f,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ee,{children:a}),t(nn,b?{variant:hn.Blue,label:b}:{variant:hn.Loader,label:nt.DETECTING_RUNTIME_INFO}),t(su,{overridden:p,onOverride:C,defaultValues:u,originalValues:{language:o.runtimeInfo?.language,version:o.runtimeInfo?.runtimeVersion||""}})]}),e(oe,{$gap:8,$alignItems:"center",children:[t(ce,{...y,textSize:te.XXXS}),t(ru,{language:u.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(Eu,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(nn,{variant:hn.Pink,label:Xt(r.agentEnabledStatus?.reasonEnum)||nt.NO_AVAILABLE_AGENT}),t(ee,{size:te.XXXS,color:ne.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(Eu,{children:t(oe,{$gap:16,$wrap:"wrap",children:S.map((e,n)=>t(ce,{label:e,leftIcon:Xa,status:Pe.Success,invertColors:!0,useSecondaryTone:!0},`${a}-rule-${n}`))})})]})},Ou=({source:n,onClickRollout:o,onClickRollback:i})=>{const{isK8s:a}=S();return e(ae,{$gap:12,children:[t(qp,{source:n}),t(Qp,{source:n}),a&&t(wu,{source:n,onClickRollout:o,onClickRollback:i}),a&&t(Tu,{source:n}),!a&&t(fu,{source:n}),a&&t(Zp,{source:n})]})},$u=({source:e})=>{const n=e.containers||[];return t(Wt,{bgTint:"1000",richTitle:{title:nt.INSTRUMENTED_LIBRARIES},children:n.length?n.map(e=>{const n=e.instrumentations||[];return t(Wt,{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(Np,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))}):t($e,{title:"No libraries found"})},e.containerName)}):t($e,{title:"No containers found"})})},Au=b(ae)`
|
|
679
679
|
width: 100%;
|
|
680
680
|
max-height: 320px;
|
|
681
681
|
overflow-y: auto;
|
|
@@ -690,7 +690,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
690
690
|
& > * {
|
|
691
691
|
font-family: monospace !important;
|
|
692
692
|
}
|
|
693
|
-
`,Du=({pendingModify:n,onClose:o,onConfirm:i})=>{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:o,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:o},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:i},children:n&&e(Au,{children:[n.add.map(n=>e(Ru,{children:[t(ce,{leftIcon:za,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(Ru,{children:[t(ce,{leftIcon:xl,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 _u(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 Pu(e){const t=Math.abs(e);return t>=1e9?`${Lu(e/1e9)}s`:t>=1e6?`${Lu(e/1e6)}ms`:t>=1e3?`${Lu(e/1e3)}μs`:String(Math.round(e))}function Lu(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Fu(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let i=0;for(let e=0;e+3<o.length;e+=4){const a=o[e],l=o[e+1],r=o[e+2],s=o[e+3],c=i+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function Mu(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function zu(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Bu(e,t,n){return((e,t)=>{const n=[];for(let o=0;o<=t.level;o++){let i;for(const n of e)if(n.level===o&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){i=n;break}if(!i)return n;n.push(i)}return n})(t,n).map(t=>_u(e,t.nameIndex))}function Xu(e,t,n){if(0===n.length)return null;let o=null,i=null;for(let a=0;a<n.length;a++){const l=n[a];let r=null;for(const n of t)n.level===a&&_u(e,n.nameIndex)===l&&(o&&(n.offset<o.offset||n.offset+n.size>o.offset+o.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;o=r,i=r}return i}function Uu(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),o=new Map;for(const t of e){const e=o.get(t.level);e?e.push(t):o.set(t.level,[t])}const i=[t];for(let e=t.level+1;e<=n;e++){const t=i.filter(t=>t.level===e-1);if(0===t.length)break;const n=o.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){i.push(e);break}}return i}function Vu(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Hu(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const o=t.v2.colors.black[500],i=[{fill:t.v2.colors.purple[300],text:o},{fill:t.v2.colors.green[300],text:o},{fill:t.v2.colors.red[300],text:o},{fill:t.v2.colors.blue[300],text:o},{fill:t.v2.colors.yellow[300],text:o}];return i[n%i.length]}var ju,Gu;function Wu(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Ku(e,t,n){for(const o of n)if(e>=o.x&&e<o.x+o.w&&t>=o.y&&t<o.y+o.h)return o;return null}function Yu(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"})(ju||(ju={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Gu||(Gu={}));const Ju=({flamebearer:n,maxRowPx:o,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,_]=l(ju.Fit),[P,L]=l(Gu.Fit),[F,M]=l(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=O.length>0?O[O.length-1]:null,U=X?.size??n.numTicks,V=i(()=>Fu(n),[n]),H=p({fb:n,rects:V});a(()=>{const e=H.current;e.fb!==n&&(H.current={fb:n,rects:V},$(t=>{if(0===t.length)return t;const o=((e,t,n,o,i)=>{const a=[];for(const l of i){const i=Bu(e,t,l);if(0===i.length)break;const r=Xu(n,o,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return o.length===t.length&&o.every((e,n)=>zu(e,t[n]))?t:o}))},[n,V]),a(()=>{if(!f)return;if(!X)return void f(null);const e=Uu(V,X),t=new Set;for(const o of e){const e=_u(n,o.nameIndex);e&&t.add(e)}f([...t])},[X,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=i(()=>function(e,t,n,o,i,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??Fu(e);let p=l?Uu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(_u(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),o=new Map;for(const e of n){const t=o.get(e.level);t?t.push(e):o.set(e.level,[e])}const i=new Set;for(const t of n){const n=o.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&&_u(e,l.nameIndex)===_u(e,t.nameIndex)&&i.add(Mu(l))}if(0===i.size)return n;const a=[];for(const e of n){if(i.has(Mu(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=o.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(Mu(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=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=i.trim(),y=b>8?1:0;return p.map(n=>{const o=n.level-u,i=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=o*b,r=Math.max(b-y,1),s=_u(e,n.nameIndex);return{...n,x:i,y:l,w:a,h:r,name:s,matchesSearch:Vu(s,v)}})}(n,z,B,o,r,{zoomRoot:X,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,o,r,B,z,X,s,F,V]),G=i(()=>(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(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=Ku((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(o){const e=Mu(o);E(e);const t=U>0?(100*o.size/U).toFixed(1):"0",i=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${Pu(o.size)} (${t}% of view, ${i}% of profile) · self ${Pu(o.self)}`)}else E(null),I("")},[G,n.numTicks,B,z,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(z<2||B<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const i=Ku((e.clientX-o.left)/o.width*z,(e.clientY-o.top)/o.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&zu(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(z,B),i=Math.min(t,16384/o);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,n,o,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:i,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=Hu(s,a);e.fillStyle=u,e.fillRect(n,o,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+i-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(i-1,0),Math.max(l-1,0));const m=Wu(d,r),g=`${s} (${Pu(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=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>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,o+l/2),e.fillStyle=h,e.fillText(t,n+v,o+l/2))}}if(l)for(const t of o){if(Mu(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,r,y,N,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,n.numTicks,N,r,B,z,y]);const Z=d(()=>R(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,ie=i(()=>((e,t,n)=>{const o=n??Fu(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of o)e.level<l||e.offset<i||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,X,V),[n,X,V]),ae=null!==ie,le=O.length>0,re=X?_u(n,X.nameIndex):"",se=d(()=>{$([]),b?.()},[b]),ce=d(()=>$(e=>e.slice(0,-1)),[]),de=d(()=>{ie&&$(e=>[...e,ie])},[ie]);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(oe,{$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:M}),e(oe,{$gap:8,children:[e(oe,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,label:"Reset zoom",leftIcon:wl,onClick:se,disabled:!O.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:xl,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:za,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ae,onClick:de})]}),e(oe,{children:[t(Ue,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Fn.Filled,options:[{value:ju.Fit,label:"W: Fit"},{value:ju.X10,label:"10x"}],selected:D,setSelected:_})}),t(Ue,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Fn.Filled,options:[{value:Gu.Fit,label:"H: Fit"},{value:Gu.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?Qa:Tl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Ue,{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:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"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(oe,{$justifyContent:"space-between",children:[t(ee,X?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${re} • ${Pu(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 · ${Yu(h.totalBytesUsed)} / ${Yu(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},qu=[Dn.Go,Dn.Java],Zu="Profiling Symbols";function Qu(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Dn.Go:e.includes(" ")||e.includes("(")?Dn.Java:Dn.Go)(e);if(n===Dn.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),o=t.indexOf(".",n+1);if(-1===o)return null;const i=t.slice(0,o),a=t.slice(o+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new je(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new je(i,a);return r.Verify()?r:null})(e);return t?{language:n,golang:t}:null}if(n===Dn.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 o=t.split(/\s+/);t=o[o.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new Ge(a,l);return r.Verify()?r:null})(e);return t?{language:n,java:t}:null}return null}function eh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function th(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:i=[],languages:a=[]}=e,l=!o.length||o.some(e=>eh(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function nh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function oh(e,t){return e.className===t.className&&e.methodName===t.methodName}function ih(e,t,n,o){const i=Qu(e,n);if(!i)return[];const a=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!th(e.sourceScopes,t,i.language))continue;const o=!!i.golang&&!!n[Ke.Golang]?.some(e=>nh(e,i.golang)),l=!!i.java&&!!n[Ke.Java]?.some(e=>oh(e,i.java));(o||l)&&a.push({rule:e,resolved:i})}return a}var ah,lh,rh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(ah||(ah={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(lh||(lh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(rh||(rh={}));const sh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function ch(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(rh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(rh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&sh.test(n))}const dh=({rows:e,languages:n,instrumentation:o,searchQuery:a,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!n?.includes(Dn.Java),h=i(()=>{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=i(()=>{const e=[];if(o.selectionEnabled&&e.push({id:lh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:rh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:rh.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===ah.Symbol)?.rawValue?.toString()??"";return!(t.includes(lh.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&ch(n,t)}}},[o,u]),g=i(()=>[{key:ah.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:ah.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:ah.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=i(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:ah.Symbol,rawValue:e.name},{key:ah.Self,rawValue:Pu(e.self)},{key:ah.Total,rawValue:Pu(e.total)}],isSelected:n?o.isSelected(e.name):void 0,onSelect:n?()=>o.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>o.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,o]),b=d(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),i=[];return n.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Ma,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:za,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:kl,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[o]);return t(Mn,{variant:zn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:b})};var ph;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(ph||(ph={}));const uh=b(ae)`
|
|
693
|
+
`,Du=({pendingModify:n,onClose:o,onConfirm:i})=>{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:o,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:o},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:i},children:n&&e(Au,{children:[n.add.map(n=>e(Ru,{children:[t(ce,{leftIcon:za,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(Ru,{children:[t(ce,{leftIcon:xl,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 _u(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 Pu(e){const t=Math.abs(e);return t>=1e9?`${Lu(e/1e9)}s`:t>=1e6?`${Lu(e/1e6)}ms`:t>=1e3?`${Lu(e/1e3)}μs`:String(Math.round(e))}function Lu(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Fu(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let i=0;for(let e=0;e+3<o.length;e+=4){const a=o[e],l=o[e+1],r=o[e+2],s=o[e+3],c=i+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function Mu(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function zu(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Bu(e,t,n){return((e,t)=>{const n=[];for(let o=0;o<=t.level;o++){let i;for(const n of e)if(n.level===o&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){i=n;break}if(!i)return n;n.push(i)}return n})(t,n).map(t=>_u(e,t.nameIndex))}function Xu(e,t,n){if(0===n.length)return null;let o=null,i=null;for(let a=0;a<n.length;a++){const l=n[a];let r=null;for(const n of t)n.level===a&&_u(e,n.nameIndex)===l&&(o&&(n.offset<o.offset||n.offset+n.size>o.offset+o.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;o=r,i=r}return i}function Uu(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),o=new Map;for(const t of e){const e=o.get(t.level);e?e.push(t):o.set(t.level,[t])}const i=[t];for(let e=t.level+1;e<=n;e++){const t=i.filter(t=>t.level===e-1);if(0===t.length)break;const n=o.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){i.push(e);break}}return i}function Vu(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Hu(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const o=t.v2.colors.black[500],i=[{fill:t.v2.colors.purple[300],text:o},{fill:t.v2.colors.green[300],text:o},{fill:t.v2.colors.red[300],text:o},{fill:t.v2.colors.blue[300],text:o},{fill:t.v2.colors.yellow[300],text:o}];return i[n%i.length]}var ju,Gu;function Wu(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Ku(e,t,n){for(const o of n)if(e>=o.x&&e<o.x+o.w&&t>=o.y&&t<o.y+o.h)return o;return null}function Yu(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"})(ju||(ju={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Gu||(Gu={}));const Ju=({flamebearer:n,maxRowPx:o,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(""),[E,N]=l(null),[O,$]=l([]),[A,R]=l(!1),[D,_]=l(ju.Fit),[P,L]=l(Gu.Fit),[F,M]=l(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=O.length>0?O[O.length-1]:null,U=X?.size??n.numTicks,V=i(()=>Fu(n),[n]),H=p({fb:n,rects:V});a(()=>{const e=H.current;e.fb!==n&&(H.current={fb:n,rects:V},$(t=>{if(0===t.length)return t;const o=((e,t,n,o,i)=>{const a=[];for(const l of i){const i=Bu(e,t,l);if(0===i.length)break;const r=Xu(n,o,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return o.length===t.length&&o.every((e,n)=>zu(e,t[n]))?t:o}))},[n,V]),a(()=>{if(!f)return;if(!X)return void f(null);const e=Uu(V,X),t=new Set;for(const o of e){const e=_u(n,o.nameIndex);e&&t.add(e)}f([...t])},[X,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=i(()=>function(e,t,n,o,i,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??Fu(e);let p=l?Uu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(_u(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),o=new Map;for(const e of n){const t=o.get(e.level);t?t.push(e):o.set(e.level,[e])}const i=new Set;for(const t of n){const n=o.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&&_u(e,l.nameIndex)===_u(e,t.nameIndex)&&i.add(Mu(l))}if(0===i.size)return n;const a=[];for(const e of n){if(i.has(Mu(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=o.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(Mu(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=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=i.trim(),y=b>8?1:0;return p.map(n=>{const o=n.level-u,i=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=o*b,r=Math.max(b-y,1),s=_u(e,n.nameIndex);return{...n,x:i,y:l,w:a,h:r,name:s,matchesSearch:Vu(s,v)}})}(n,z,B,o,r,{zoomRoot:X,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,o,r,B,z,X,s,F,V]),G=i(()=>(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(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=Ku((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(o){const e=Mu(o);N(e);const t=U>0?(100*o.size/U).toFixed(1):"0",i=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${Pu(o.size)} (${t}% of view, ${i}% of profile) · self ${Pu(o.self)}`)}else N(null),I("")},[G,n.numTicks,B,z,U]),K=d(e=>{W(e)},[W]),Y=d(()=>{N(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(z<2||B<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const i=Ku((e.clientX-o.left)/o.width*z,(e.clientY-o.top)/o.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&zu(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(z,B),i=Math.min(t,16384/o);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,n,o,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:i,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=Hu(s,a);e.fillStyle=u,e.fillRect(n,o,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+i-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(i-1,0),Math.max(l-1,0));const m=Wu(d,r),g=`${s} (${Pu(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=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>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,o+l/2),e.fillStyle=h,e.fillText(t,n+v,o+l/2))}}if(l)for(const t of o){if(Mu(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,r,y,E,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,n.numTicks,E,r,B,z,y]);const Z=d(()=>R(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,ie=i(()=>((e,t,n)=>{const o=n??Fu(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of o)e.level<l||e.offset<i||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,X,V),[n,X,V]),ae=null!==ie,le=O.length>0,re=X?_u(n,X.nameIndex):"",se=d(()=>{$([]),b?.()},[b]),ce=d(()=>$(e=>e.slice(0,-1)),[]),de=d(()=>{ie&&$(e=>[...e,ie])},[ie]);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(oe,{$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:Nt.S,value:F,onChange:M}),e(oe,{$gap:8,children:[e(oe,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,label:"Reset zoom",leftIcon:wl,onClick:se,disabled:!O.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:xl,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:za,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ae,onClick:de})]}),e(oe,{children:[t(Ue,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Fn.Filled,options:[{value:ju.Fit,label:"W: Fit"},{value:ju.X10,label:"10x"}],selected:D,setSelected:_})}),t(Ue,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Fn.Filled,options:[{value:Gu.Fit,label:"H: Fit"},{value:Gu.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?Qa:Tl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Ue,{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:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(oe,{$justifyContent:"space-between",children:[t(ee,X?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${re} • ${Pu(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 · ${Yu(h.totalBytesUsed)} / ${Yu(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},qu=[Dn.Go,Dn.Java],Zu="Profiling Symbols";function Qu(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Dn.Go:e.includes(" ")||e.includes("(")?Dn.Java:Dn.Go)(e);if(n===Dn.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),o=t.indexOf(".",n+1);if(-1===o)return null;const i=t.slice(0,o),a=t.slice(o+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new je(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new je(i,a);return r.Verify()?r:null})(e);return t?{language:n,golang:t}:null}if(n===Dn.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 o=t.split(/\s+/);t=o[o.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new Ge(a,l);return r.Verify()?r:null})(e);return t?{language:n,java:t}:null}return null}function eh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function th(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:i=[],languages:a=[]}=e,l=!o.length||o.some(e=>eh(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function nh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function oh(e,t){return e.className===t.className&&e.methodName===t.methodName}function ih(e,t,n,o){const i=Qu(e,n);if(!i)return[];const a=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!th(e.sourceScopes,t,i.language))continue;const o=!!i.golang&&!!n[Ke.Golang]?.some(e=>nh(e,i.golang)),l=!!i.java&&!!n[Ke.Java]?.some(e=>oh(e,i.java));(o||l)&&a.push({rule:e,resolved:i})}return a}var ah,lh,rh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(ah||(ah={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(lh||(lh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(rh||(rh={}));const sh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function ch(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(rh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(rh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&sh.test(n))}const dh=({rows:e,languages:n,instrumentation:o,searchQuery:a,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!n?.includes(Dn.Java),h=i(()=>{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=i(()=>{const e=[];if(o.selectionEnabled&&e.push({id:lh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:rh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:rh.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===ah.Symbol)?.rawValue?.toString()??"";return!(t.includes(lh.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&ch(n,t)}}},[o,u]),g=i(()=>[{key:ah.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:ah.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:ah.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=i(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:ah.Symbol,rawValue:e.name},{key:ah.Self,rawValue:Pu(e.self)},{key:ah.Total,rawValue:Pu(e.total)}],isSelected:n?o.isSelected(e.name):void 0,onSelect:n?()=>o.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>o.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,o]),b=d(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),i=[];return n.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Ma,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:za,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:kl,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[o]);return t(Mn,{variant:zn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:b})};var ph;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(ph||(ph={}));const uh=b(ae)`
|
|
694
694
|
width: 100%;
|
|
695
695
|
flex: 1;
|
|
696
696
|
border-radius: 16px;
|
|
@@ -730,7 +730,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
730
730
|
width: 100%;
|
|
731
731
|
min-height: 32px;
|
|
732
732
|
flex-shrink: 0;
|
|
733
|
-
`,yh=({source:n,onFlameFullscreenChange:o})=>{const s=v(),c=n.id,{profilingApi:u}=Gl(),[h,m]=l(!0),[g,f]=l(ph.Both),[b,y]=l(""),[C,S]=l({}),[x,w]=l(!1),T=p(!1);a(()=>{T.current||(T.current=!0,u.enableProfiling?.(c),w(!0))},[u,c]);const{data:k}=u.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:I,loading:
|
|
733
|
+
`,yh=({source:n,onFlameFullscreenChange:o})=>{const s=v(),c=n.id,{profilingApi:u}=Gl(),[h,m]=l(!0),[g,f]=l(ph.Both),[b,y]=l(""),[C,S]=l({}),[x,w]=l(!1),T=p(!1);a(()=>{T.current||(T.current=!0,u.enableProfiling?.(c),w(!0))},[u,c]);const{data:k}=u.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:I,loading:E,refetch:N}=u.useSourceProfiling(c,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),O=I?.profileJson??null,$=i(()=>(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}})(O),[O]),A=i(()=>$?(e=>{const t=new Map;for(let n=0;n<e.levels.length;n++){const o=e.levels[n];for(let n=0;n+3<o.length;n+=4){const i=o[n+1],a=o[n+2],l=_u(e,o[n+3]);if(!l)continue;const r=t.get(l);(!r||i>r.total)&&t.set(l,{self:a,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})($.flamebearer):[],[$]),R=g===ph.Table||g===ph.Both,D=g===ph.Flame||g===ph.Both,_=R&&D,P=n.runtimeInfo?.detectedLanguages?.join("\0")??"",L=n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=i(()=>P?P.split("\0"):L?L.split("\0"):void 0,[P,L]),M=i(()=>((e,t)=>{if(!t?.includes(Dn.Java))return;const n=(e?.[ah.Symbol]?.filter(Boolean)??[]).filter(e=>e===rh.FilterOutVoid||e===rh.OnlyWithReturnValues);return 0!==n.length?e=>ch(e,n):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:B,pendingModify:X,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:a}=Gl(),{items:r}=o.useRules(),[s,c]=l(new Set),[p,u]=l(new Set),[h,m]=l(null),g=i(()=>(e=>{const t=new Set(e??[]);return qu.filter(e=>t.has(e))})(t),[t]),f=a.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=i(()=>((e,t)=>{const n=e.filter(e=>e.type===Je.CustomInstrumentation&&e.ruleName===Zu&&th(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>eh(e,t.id)))??n[0]??null})(r,e),[r,b]),y=f&&g.length>0,C=i(()=>{const t=new Map;for(const o of n){const n=!!Qu(o.name,g),i=ih(o.name,e,g,r),a=!!v&&i.some(e=>e.rule.ruleId===v.ruleId),l=i.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===i.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(o.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=i(()=>{const e=new Set;return C.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[C]),x=i(()=>[...s].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[s,C,S]),w=i(()=>[...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 o=new Set(n);return t?o.delete(e):o.add(e),o}):c(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o}))},[C]),E=d(()=>{c(new Set),u(new Set)},[]),N=d(t=>{(async()=>{const n=t.add.map(e=>Qu(e,g)).filter(e=>!!e),i=t.remove.map(e=>Qu(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,n)=>{const o=e.customInstrumentations??{};let i=[...o[Ke.Golang]??[]],a=[...o[Ke.Java]??[]];for(const e of n)e.golang&&(i=i.filter(t=>!nh(t,e.golang))),e.java&&(a=a.filter(t=>!oh(t,e.java)));for(const e of t)e.golang&&!i.some(t=>nh(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>oh(t,e.java))&&a.push(e.java);return{customInstrumentations:{[Ke.Golang]:i,[Ke.Java]:a},isEmpty:0===i.length&&0===a.length}})(v,n,i);t?await o.remove(v.ruleId,Je.CustomInstrumentation):await o.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),Je.CustomInstrumentation)}else n.length>0&&await o.create(((e,t)=>{const n=e.map(e=>e.golang).filter(e=>!!e),o=e.map(e=>e.java).filter(e=>!!e),i={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:Zu,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ke.Golang]:n,[Ke.Java]:o}}})(n,e),Je.CustomInstrumentation)})()},[v,g,e,o]),O=d(()=>{T&&m({add:x,remove:w})},[T,x,w]),$=d(e=>m({add:[e],remove:[]}),[]),A=d(e=>m({add:[],remove:[e]}),[]),R=d(()=>m(null),[]),D=d(()=>{h&&(N(h),m(null),E())},[h,N,E]),_=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:i(()=>({getSymbolState:_,onAdd:$,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[_,$,A,y,k,I]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:O,resetSelection:E,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===ph.Flame?ph.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})},[]),ie=d(()=>W(null),[]);return!O&&E?t(ft,{$height:"70vh",children:t(St,{withSpinner:!0})}):e(uh,{$gap:0,$width:"100%",children:[e(hh,{children:[t(Ue,{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(mh,{children:t(ee,{size:te.S,weight:500,color:ne.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(oe,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(fn,{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:Fn.Filled,options:[{value:ph.Table,label:"Top table"},{value:ph.Flame,label:"Flame graph"},{value:ph.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(Il,{...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(Il,{...e,size:8,fill:s.v2.colors.red[500]})})]})]}),t(gh,{$gap:R&&D?16:0,children:$?e(r,{children:[R&&e(fh,{$splitWithFlame:_,children:[e(vh,{$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(oe,{$gap:8,children:[e(oe,{children:[t(El,{size:24}),t(ee,{size:te.S,color:ne.Success,nowrap:!0,children:"Custom Instrument"})]}),t(Te,{leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${Le}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(oe,{$gap:8,children:[J&&t(Ue,{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:Nl,onClick:()=>{if(!O)return;const e=new Blob([O],{type:"application/json"}),t=URL.createObjectURL(e),o=document.createElement("a");o.href=t,o.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,o.click(),URL.revokeObjectURL(t)},disabled:!O})]})]}),t(dh,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),D&&e(bh,{$splitWithTable:_,children:[e(vh,{$justifyContent:"space-between",children:[t(ce,{label:$?`Total in view ${Pu($.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS}),e(oe,{$gap:12,children:[!h&&t(Te,{variant:Ie.Secondary,size:ke.S,label:"Refresh",leftIcon:pl,onClick:N}),t(ge,{label:"Auto refresh",labelAlign:fe.Left,size:Nt.S,value:h,onChange:m})]})]}),t(Ju,{flamebearer:$.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:o,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:ie})]})]}):t(ft,{children:t($e,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Du,{pendingModify:X,onClose:U,onConfirm:j}),t(Bn,{isOpen:B>0,richTitle:{icon:el,title:"Profiling Symbols",badge:{label:B}},actions:[{id:"profiling-bulk-cancel",type:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Modify Rule",leftIcon:ja,onClick:V}}]})]})},Ch=b.div`
|
|
734
734
|
position: relative;
|
|
735
735
|
display: flex;
|
|
736
736
|
align-items: center;
|
|
@@ -771,16 +771,16 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
771
771
|
opacity: 0;
|
|
772
772
|
pointer-events: none;
|
|
773
773
|
transition: opacity 0.15s ease;
|
|
774
|
-
`,
|
|
774
|
+
`,Eh=b.div`
|
|
775
775
|
&:hover ${Ih} {
|
|
776
776
|
opacity: 1;
|
|
777
777
|
pointer-events: auto;
|
|
778
778
|
}
|
|
779
|
-
`,
|
|
779
|
+
`,Nh=b.div`
|
|
780
780
|
display: flex;
|
|
781
781
|
align-items: center;
|
|
782
782
|
padding: 4px 12px;
|
|
783
|
-
`,Oh=({source:e,onRedirectToSampling:n})=>t(Wt,{bgTint:"1000",richTitle:{title:nt.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(Rh,{container:e,onRedirectToSampling:n},e.containerName))});var $h;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})($h||($h={}));const Ah=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],Rh=({container:n,onRedirectToSampling:o})=>{const[a,r]=l($h.All),s=vn(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=i(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),p=i(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=i(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=i(()=>a===$h.Noisy?d:a===$h.HighlyRelevant?p:a===$h.CostReduction?u:[...d,...p,...u],[a,p,u]),m=d.length+p.length+u.length,g=i(()=>(e,t)=>{s({ruleId:e,category:t}),o()},[o,s]),f=t(Ih,{children:t(Te,{"data-id":"sampling-container-create-rule",variant:Ie.Secondary,size:ke.S,label:Un,rightIcon:za,onClick:e=>{e.stopPropagation(),o()}})});return t(
|
|
783
|
+
`,Oh=({source:e,onRedirectToSampling:n})=>t(Wt,{bgTint:"1000",richTitle:{title:nt.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(Rh,{container:e,onRedirectToSampling:n},e.containerName))});var $h;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})($h||($h={}));const Ah=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],Rh=({container:n,onRedirectToSampling:o})=>{const[a,r]=l($h.All),s=vn(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=i(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),p=i(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=i(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=i(()=>a===$h.Noisy?d:a===$h.HighlyRelevant?p:a===$h.CostReduction?u:[...d,...p,...u],[a,p,u]),m=d.length+p.length+u.length,g=i(()=>(e,t)=>{s({ruleId:e,category:t}),o()},[o,s]),f=t(Ih,{children:t(Te,{"data-id":"sampling-container-create-rule",variant:Ie.Secondary,size:ke.S,label:Un,rightIcon:za,onClick:e=>{e.stopPropagation(),o()}})});return t(Eh,{children:e(Wt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Wt,{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(kh,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(Nh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.HEAD_SAMPLING})}),m?e(Wt,{bgTint:"800",richTitle:{title:nt.TAIL_SAMPLING,badge:{label:m}},children:[t(ve,{options:(b=d.length,v=p.length,y=u.length,[{value:$h.All,label:"All",badge:{label:b+v+y,textSize:te.XXXS}},{value:$h.Noisy,label:nt.NOISY_OPERATIONS,badge:{label:b,textSize:te.XXXS}},{value:$h.HighlyRelevant,label:nt.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:te.XXXS}},{value:$h.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(kh,{name:e.rule.name,summary:Ah(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t($e,{title:`No ${a===$h.All?`${$h.Noisy}, ${$h.HighlyRelevant} and ${$h.CostReduction}`:a} operations`})})]}):t(Nh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.TAIL_SAMPLING})})]})});var b,v,y},Dh=[Tn.Deployment,Tn.StatefulSet,Tn.DaemonSet,Tn.DeploymentConfig,Tn.Rollout,Tn.Pod];var _h;(e=>{e.Workload="Workload",e.Pod="Pod"})(_h||(_h={}));const Ph=e=>!!e&&cn(e.status)===Pe.Error,Lh=e=>Ph(e.healthStatus),Fh=e=>Ph(e.odigosHealthStatus)||(e.processes??[]).some(Lh),Mh=e=>Ph(e.agentInjectedStatus)||Ph(e.odigosHealthStatus)||(e.containers??[]).some(Fh),zh=({onClose:n,sourceId:o,onRedirectToSampling:r})=>{const s=v(),{isK8s:c,platformType:u}=S(),{sourcesApi:h,configApi:m}=Gl(),{selectedStreamName:g}=ot(),{genericForm:f,loadSource:b,validateFormData:y}=Jl(),{data:C}=m.useEffectiveConfig(),[x,w]=l(!1),[T,k]=l(!1),[I,E]=l(!1),[N,O]=l(gp.Overview),[$,A]=l(null),[R,D]=l({openFor:null}),_=(()=>{const[e,t]=l(null),n=d(e=>{t({tab:gp.Pods,podName:e.podName})},[]),o=d((e,n)=>{t({tab:gp.Pods,podName:e.podName,containerName:n.containerName})},[]),a=d((e,n,o)=>{const i=Sp({identifyingAttributes:o.identifyingAttributes});t({tab:gp.Pods,podName:e.podName,containerName:n.containerName,processPid:i})},[]),r=d(()=>t(null),[]);return i(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:o,jumpToProcess:a,clearJumpToTarget:r}),[e,n,o,a,r])})();a(()=>{_.jumpToTarget&&O(_.jumpToTarget.tab)},[_.jumpToTarget]),a(()=>{$&&JSON.stringify(yn(o))!==JSON.stringify(yn($))&&A(null)},[o,$]);const P=p(!1),L=d(async()=>A(await h.fetchById(o)||null),[o,h]);a(()=>{if(P.current||(L(),P.current=!0),!x){const e=setInterval(()=>L(),3e3);return()=>clearInterval(e)}},[L,x]),a(()=>{$&&b($)},[$]);const F=$&&Dh.includes($.id.kind),M=i(()=>{const e=[],n=($?.pods??[]).some(Mh),o=(i=$,(i?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var i;const a=e=>t(gl,{...e,fill:s.v2.colors.red[500]});return e.push({value:gp.Overview,label:nt.OVERVIEW}),c?(e.push({value:gp.Pods,label:nt.PODS,icon:n?a:void 0}),e.push({value:gp.Libraries,label:nt.LIBRARIES,icon:o?a:void 0}),e.push({value:gp.PeerSources,label:nt.PEER_SOURCES}),C?.profiling?.enabled&&e.push({value:gp.Profiling,label:nt.PROFILING}),e.push({value:gp.Sampling,label:nt.SAMPLING}),e.push({value:gp.Debug,label:nt.DEBUG}),e):e},[c,C,$?.pods,s]),z=d(()=>w(!0),[]),B=i(()=>()=>{n(),r()},[n,r]),X=d(()=>{$&&b($),w(!1)},[$]),U=d(async()=>{if(!$||!f)return;const{errorMessage:e,preparedFormData:t}=y();if(e)return;const n=t.otelServiceName!==$.id.name?t.otelServiceName:"";await h.update(o,{...t,otelServiceName:n}),w(!1)},[$,f,y,o,h]),V=!1===$?.markedForInstrumentation?.markedForInstrumentation,H=d(()=>k(!0),[]),j=d(async()=>{if(!$)return;const e=!1===$.markedForInstrumentation?.markedForInstrumentation;await h.persistV2({[Rt]:[{namespace:$.id.namespace,name:$.id.name,kind:$.id.kind,...$.id.region?{region:$.id.region}:{},selected:e,currentStreamName:g}]}),k(!1),e||n()},[$,h,g,n]),G=d(()=>{D({openFor:_h.Workload})},[]),W=d(e=>{O(e),_.clearJumpToTarget()},[_]),K=d(async()=>{await h.recoverFromRollback(o)},[h,o]),Y=d(()=>D({openFor:null}),[]),J=d(async()=>{R.openFor===_h.Workload?await h.restartWorkloads([o]):R.openFor===_h.Pod&&R.podNamespace&&R.podName&&await h.restartPod(R.podNamespace,R.podName),Y()},[R,h,o,Y]),q=i(()=>{const{kind:e,name:t}=o;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[o]),Z=i(()=>{const e=[];return x||N===gp.Overview&&(e.push({id:"edit-source-btn-edit",label:Ft.EDIT,icon:ja,active:x,onClick:z}),c&&F&&e.push({id:"edit-source-btn-restart",label:nt.ROLLOUT_RESTART,icon:Sl,onClick:G}),e.push(V?{id:"edit-source-btn-instrument",label:Ft.INSTRUMENT,icon:za,color:s.v2.colors.green[500],active:T,onClick:H}:{id:"edit-source-btn-delete",label:Ft.UNINSTRUMENT,icon:Ma,color:s.v2.colors.red[500],active:T,onClick:H})),e},[N,x,T,V,c,F,z,G,H,s]),Q=i(()=>{if(!$)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:$.id.name,leftIcon:c?ml:void 0}),$.serviceName&&$.serviceName!==$.id.name&&e.push({...t,label:$.serviceName,leftIcon:sl,textColor:s.v2.colors.silver[200]}),e},[$,s,c]);if(!$)return t(zt,{isOpen:!0,children:t(ft,{$height:"80vh",children:t(St,{withSpinner:!0})})});const ee=N===gp.Profiling?I?"95vw":"fit-content":x?void 0:"60vw",ne=c?Hn($.containers)[0]:Vn(u);return e($p,{value:_,children:[t(zt,{isOpen:!0,width:ee,minWidth:"min(1100px, 100vw)",header:{icon:ne,titleBadges:Q,onClose:()=>{W(gp.Overview),A(null),E(!1),n()},actions:Z},footer:{actions:x?[{"data-id":"edit-source-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:X},{"data-id":"edit-source-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:U}]:[]},children:t(le,{$padding:"4px 12px 12px",children:e(ae,{$gap:16,children:[!x&&M.length>1&&t(ve,{options:M,selected:N,setSelected:W}),(()=>{switch(N){case gp.Overview:return x?t(Xs,{}):t(Ou,{source:$,onClickRollout:G,onClickRollback:K});case gp.Pods:return t(Pp,{source:$,onClickRestartPod:F?(e,t)=>D({openFor:_h.Pod,podNamespace:e,podName:t}):void 0});case gp.Libraries:return t($u,{source:$});case gp.PeerSources:return t(Fp,{source:$});case gp.Profiling:return t(yh,{source:$,onFlameFullscreenChange:E});case gp.Sampling:return t(Oh,{source:$,onRedirectToSampling:B});case gp.Debug:return t(Up,{source:$});default:return null}})()]})})}),t(Ar,{target:"source",action:V?"instrument":"uninstrument",isOpen:T,onClose:()=>k(!1),onApprove:j}),t(tt,{isOpen:R.openFor===_h.Workload,title:q.title,description:q.description,onClose:Y,denyButton:{label:"Go back",variant:Ie.Secondary,onClick:Y},approveButton:{label:Ft.CONFIRM,variant:Ie.Primary,onClick:J}}),t(Ar,{target:"pod",action:"restart",description:nt.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:R.openFor===_h.Pod,onClose:Y,onApprove:J,overrideApproveButtonLabel:nt.DELETE_POD_TO_RESTART})]})},Bh=b.div`
|
|
784
784
|
display: flex;
|
|
785
785
|
align-items: center;
|
|
786
786
|
gap: 8px;
|
|
@@ -792,7 +792,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
792
792
|
}
|
|
793
793
|
`,Xh=b.div`
|
|
794
794
|
flex: 1;
|
|
795
|
-
`,Uh=({onClick:n})=>{const o=v().v2.colors.red[500];return e(Bh,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(ee,{size:te.XS,weight:500,color:o,children:Kn}),t(Ma,{size:16,fill:o})]})};const Vh={[Zl.EditAutoNoisy]:{title:so,subTitle:ro,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Zl.EditAutoCostReduction]:{title:lo,subTitle:ao,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Zl.EditAutoHighlyRelevant]:{title:io,subTitle:oo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Hh=({isOpen:e,title:n,subTitle:o,onClose:i,footer:a,renderBody:l})=>t(zt,{isOpen:e,width:po,header:{icon:Ol,title:n,subTitle:o,onClose:i},footer:a,children:l?l():t(le,{$padding:"12px",children:t(Ws,{})})}),jh=({isOpen:o,onClose:r,onSubmit:s,validateForm:c,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=ql(Zl.Create),[b,v]=l(!1);a(()=>{o&&(m(),v(!1))},[o]);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(
|
|
795
|
+
`,Uh=({onClick:n})=>{const o=v().v2.colors.red[500];return e(Bh,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(ee,{size:te.XS,weight:500,color:o,children:Kn}),t(Ma,{size:16,fill:o})]})};const Vh={[Zl.EditAutoNoisy]:{title:so,subTitle:ro,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Zl.EditAutoCostReduction]:{title:lo,subTitle:ao,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Zl.EditAutoHighlyRelevant]:{title:io,subTitle:oo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Hh=({isOpen:e,title:n,subTitle:o,onClose:i,footer:a,renderBody:l})=>t(zt,{isOpen:e,width:po,header:{icon:Ol,title:n,subTitle:o,onClose:i},footer:a,children:l?l():t(le,{$padding:"12px",children:t(Ws,{})})}),jh=({isOpen:o,onClose:r,onSubmit:s,validateForm:c,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=ql(Zl.Create),[b,v]=l(!1);a(()=>{o&&(m(),v(!1))},[o]);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(E(t)))(h,u)?v(!0):y()},[h,u,c,f,y]),S=i(()=>b?((e,t)=>{switch(e){case"noisy":return T($(t));case"highlyRelevant":return k(O(t));case"costReduction":return I(N(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:jn,variant:Ie.Secondary,size:ke.S,onClick:r},{"data-id":"sampling-create-btn-submit",label:Un,variant:Ie.Primary,size:ke.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(Hh,{isOpen:o,title:Zn[u],subTitle:Yn[u],onClose:r,footer:x}),t(tt,{isOpen:b,title:to,description:eo,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:Qn,variant:Ie.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Un,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:no}),t("div",{style:{width:"100%"},children:t(yr,{summary:S})})]})})]})},Gh=({onClose:o,onDelete:a,onSaveEdit:l,validateForm:r,onNavigateToDuplicate:s})=>{const{data:c,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=ql(Zl.View),b=c?.rule.name||qn,v=p&&c?Jn[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=i(()=>{if(!c)return;const i=g?{message:g.message,onViewRule:s?()=>s(g.ruleId):void 0}:null;return function(o){if(o.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=o;return{children:e(n,{children:[t(Uh,{onClick:l}),r&&t(_e,{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(Xh,{}),t(Te,{"data-id":"sampling-view-edit-btn-cancel",label:jn,variant:Ie.Secondary,size:ke.S,onClick:i}),t(Te,{"data-id":"sampling-view-edit-btn-save",label:Gn,variant:Ie.Primary,size:ke.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=o;return{children:e(n,{children:[t(Uh,{onClick:i}),t(Xh,{}),t(Te,{"data-id":"sampling-view-btn-cancel",label:jn,variant:Ie.Secondary,size:ke.S,onClick:a}),t(Te,{"data-id":"sampling-view-btn-edit",label:Wn,variant:Ie.Primary,size:ke.S,onClick:l})]})}}(p?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:i}:{isEditing:!1,onDelete:C,onCancel:o,onEdit:h})},[c,p,g,m,y,C,h,o,s]);return t(Hh,{isOpen:!!c,title:v,subTitle:c?Yn[c.category]:"",onClose:o,footer:S})},Wh=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=ql(Zl.EditAutoNoisy),l=d(()=>o(i,a),[o,i,a]);return t(Jh,{formType:Zl.EditAutoNoisy,isOpen:e,onClose:n,onSave:l})},Kh=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=ql(Zl.EditAutoCostReduction),l=d(()=>o(i,a),[o,i,a]);return t(Jh,{formType:Zl.EditAutoCostReduction,isOpen:e,onClose:n,onSave:l})},Yh=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i}=ql(Zl.EditAutoHighlyRelevant),a=d(()=>o(i),[o,i]);return t(Jh,{formType:Zl.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:a})},Jh=({formType:e,isOpen:n,onClose:o,onSave:i})=>{const a=Vh[e];return t(Hh,{isOpen:n,title:a.title,subTitle:a.subTitle,onClose:o,footer:{actions:[{"data-id":a.cancelId,label:jn,variant:Ie.Secondary,size:ke.S,onClick:o},{"data-id":a.saveId,label:co,variant:Ie.Primary,size:ke.S,onClick:i}]}})},qh=e=>{switch(e.formType){case Zl.Create:return t(ar,{formType:Zl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(jh,{...e})});case Zl.View:return t(ar,{formType:Zl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Gh,{...e})});case Zl.EditAutoNoisy:return t(ar,{formType:Zl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Wh,{...e})});case Zl.EditAutoCostReduction:return t(ar,{formType:Zl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Kh,{...e})});case Zl.EditAutoHighlyRelevant:return t(ar,{formType:Zl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Yh,{...e})})}},Zh=({token:o,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=Pt(),m=!a||i||!c.newToken;return uo({key:"Enter",active:!m},s),e(oe,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Ee,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(oe,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(St,{title:"Saving...",withGradient:!0}):e(n,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,leftIcon:Qa,onClick:r,disabled:i}),t(Te,{variant:Ie.Primary,size:ke.S,leftIcon:Za,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ee,{size:te.XS,children:new Array(55).fill("•").join("")}),e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:o}),t(yt,{icon:ja,onClick:l})]})]})},Qh=({expiresAt:e,callbackValid:n,callbackExpired:o})=>{const{formatTimeAgo:l}=an(),r=i(()=>l(e),[e,l]),s=i(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=i(()=>ho(e,0)?Pe.Error:ho(e,2592e6)?Pe.Warning:Pe.Success,[e]),d=i(()=>c===Pe.Success?Za:c===Pe.Warning?$l:gl,[c]);return a(()=>{c===Pe.Success?n():c===Pe.Error&&o()},[c]),t(Ue,{text:s,children:t(ce,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},em=b.div`
|
|
796
796
|
display: flex;
|
|
797
797
|
flex-direction: column;
|
|
798
798
|
gap: 12px;
|
|
@@ -809,7 +809,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
809
809
|
padding: 12px 24px;
|
|
810
810
|
border-radius: 8px;
|
|
811
811
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
812
|
-
`,im=()=>{const{progress:n}=$t(),{describeApi:o,namespacesApi:i}=Gl(),{items:a}=i.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=Jt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ut,{richTitle:{icon:Rl,title:"Diagnose"},children:r?e(om,{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:El,startedAt:r}),n[Dt.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[Dt.DownloadingDiagnose].list.map((n,o)=>e(oe,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(Za,{size:16}):n.status===Pe.Error?t(Qa,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ee,{size:te.XXXS,color:ne.Secondary,children:n.label})]},`diagnose-item-${o}-${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(oe,{$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(oe,{$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(oe,{$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(mo,{alignX:fo.Left,alignY:go.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(oe,{$justifyContent:"flex-end",children:t(Te,{label:"Download Diagnose",rightIcon:El,variant:Ie.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},am=()=>{const{platformType:e,version:n,tier:o}=S(),{describeApi:i}=Gl(),[r,s]=l(null);return a(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ut,{richTitle:{icon:Cl,title:"General Information"},children:t(Wt,{cellsPerRow:2,items:[{id:bo(),title:"Odigos Version",label:n},{id:bo(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:bo(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:bo(),title:"Tier",label:o}]})})},lm=({isOpen:n,onClose:o})=>{const{describeApi:i,tokensApi:a}=Gl(),l=a.useTokens().items[0];return e(zt,{isOpen:n,header:{icon:Cl,title:"System Overview",onClose:o},children:[i.fetchDescribeOdigos&&t(am,{}),a.updateToken&&l&&t(nm,{token:l}),i.downloadDiagnose&&t(im,{})]})},rm=({isOpen:o,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=ot(),{dataStreamsApi:s}=Gl(),{requestSubmit:c}=Yl(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),i()},[s,l,r,i]),u=d(()=>c(p),[c,p]);return uo({key:"Enter",active:o},u),e(n,{children:[t(tt,{isOpen:o,onClose:i,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:i},children:t(Bs,{autoFocus:!0})}),t(zs,{})]})},sm=({isOpen:o,onClose:i,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=Gl(),{genericForm:c,loadDataStream:p,requestSubmit:u}=Yl();a(()=>{o&&r&&p(r)},[o,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),i()},[s,r,i]),g=d(()=>u(m),[u,m]);return uo({key:"Enter",active:o},g),e(n,{children:[t(tt,{isOpen:o,onClose:i,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:i},children:t(Bs,{autoFocus:!0})}),t(zs,{})]})},cm=({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)"})})]})]}),dm=b.div`
|
|
812
|
+
`,im=()=>{const{progress:n}=$t(),{describeApi:o,namespacesApi:i}=Gl(),{items:a}=i.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=Jt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ut,{richTitle:{icon:Rl,title:"Diagnose"},children:r?e(om,{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:Nl,startedAt:r}),n[Dt.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[Dt.DownloadingDiagnose].list.map((n,o)=>e(oe,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(Za,{size:16}):n.status===Pe.Error?t(Qa,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ee,{size:te.XXXS,color:ne.Secondary,children:n.label})]},`diagnose-item-${o}-${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(oe,{$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(oe,{$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(oe,{$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(mo,{alignX:fo.Left,alignY:go.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(oe,{$justifyContent:"flex-end",children:t(Te,{label:"Download Diagnose",rightIcon:Nl,variant:Ie.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},am=()=>{const{platformType:e,version:n,tier:o}=S(),{describeApi:i}=Gl(),[r,s]=l(null);return a(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ut,{richTitle:{icon:Cl,title:"General Information"},children:t(Wt,{cellsPerRow:2,items:[{id:bo(),title:"Odigos Version",label:n},{id:bo(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:bo(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:bo(),title:"Tier",label:o}]})})},lm=({isOpen:n,onClose:o})=>{const{describeApi:i,tokensApi:a}=Gl(),l=a.useTokens().items[0];return e(zt,{isOpen:n,header:{icon:Cl,title:"System Overview",onClose:o},children:[i.fetchDescribeOdigos&&t(am,{}),a.updateToken&&l&&t(nm,{token:l}),i.downloadDiagnose&&t(im,{})]})},rm=({isOpen:o,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=ot(),{dataStreamsApi:s}=Gl(),{requestSubmit:c}=Yl(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),i()},[s,l,r,i]),u=d(()=>c(p),[c,p]);return uo({key:"Enter",active:o},u),e(n,{children:[t(tt,{isOpen:o,onClose:i,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:i},children:t(Bs,{autoFocus:!0})}),t(zs,{})]})},sm=({isOpen:o,onClose:i,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=Gl(),{genericForm:c,loadDataStream:p,requestSubmit:u}=Yl();a(()=>{o&&r&&p(r)},[o,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),i()},[s,r,i]),g=d(()=>u(m),[u,m]);return uo({key:"Enter",active:o},g),e(n,{children:[t(tt,{isOpen:o,onClose:i,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:i},children:t(Bs,{autoFocus:!0})}),t(zs,{})]})},cm=({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)"})})]})]}),dm=b.div`
|
|
813
813
|
position: absolute;
|
|
814
814
|
top: 50%;
|
|
815
815
|
left: 50%;
|
|
@@ -825,7 +825,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
825
825
|
`,hm=b.div`
|
|
826
826
|
white-space: pre;
|
|
827
827
|
overflow-x: auto;
|
|
828
|
-
`,mm=({name:n,recommended:o,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(um,{children:[e(oe,{$gap:8,$justifyContent:"space-between",children:[e(oe,{$gap:4,children:[t(ee,{size:te.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),o&&t(ce,{label:Co,leftIcon:Dl,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:te.XXXS})]}),t(ge,{name:s??`sampling-onboarding-toggle-${n}`,label:i,labelAlign:fe.Left,value:a,onChange:l,size:
|
|
828
|
+
`,mm=({name:n,recommended:o,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(um,{children:[e(oe,{$gap:8,$justifyContent:"space-between",children:[e(oe,{$gap:4,children:[t(ee,{size:te.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),o&&t(ce,{label:Co,leftIcon:Dl,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:te.XXXS})]}),t(ge,{name:s??`sampling-onboarding-toggle-${n}`,label:i,labelAlign:fe.Left,value:a,onChange:l,size:Nt.S})]}),t(hm,{children:t(w,{parts:r})})]})},gm=b.div`
|
|
829
829
|
position: relative;
|
|
830
830
|
display: flex;
|
|
831
831
|
align-items: center;
|
|
@@ -876,7 +876,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
876
876
|
& + & {
|
|
877
877
|
margin-top: 6px;
|
|
878
878
|
}
|
|
879
|
-
`,
|
|
879
|
+
`,Em=({items:e,color:n})=>{const o=v(),i=n||o.v2.colors.silver[200];return t(km,{children:e.map((e,n)=>t(Im,{style:{color:i},children:t(ee,{size:te.XXS,color:i,children:e})},n))})},Nm=({items:n})=>{const o=v();return t(ae,{$gap:16,children:n.map((n,i)=>e(oe,{$gap:8,$alignItems:"flex-start",children:[e(ee,{size:te.XS,color:o.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(ae,{$gap:2,children:[t(ee,{size:te.XS,color:o.v2.colors.white[500],weight:500,children:n.title}),t(ee,{size:te.XS,color:o.v2.colors.silver[200],children:n.description})]})]},i))})},Om=({message:e})=>t(_e,{status:Pe.Default,message:e,fullWidth:!0,smallIcon:!0}),$m=b.div`
|
|
880
880
|
width: 100%;
|
|
881
881
|
padding: 8px;
|
|
882
882
|
display: flex;
|
|
@@ -899,13 +899,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
899
899
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
900
900
|
`,Dm=({children:e})=>{const n=v();return t(ee,{size:te.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},_m=b.div`
|
|
901
901
|
white-space: pre-line;
|
|
902
|
-
`,Pm=({enabled:o,onEnabledChange:a,onBack:l,onNext:r})=>{const s=v(),c=i(()=>A({enabled:o,keepPercentage:0}),[o]);return e(n,{children:[t(xm,{title:xo,onBack:l}),e(vm,{$width:854,children:[t(Dm,{children:wo}),e(ae,{$gap:8,$width:"100%",children:[t(Tm,{children:t(_m,{children:t(ee,{size:te.XXS,color:s.v2.colors.silver[200],children:To})})}),e(ae,{$gap:8,$width:"100%",children:[e($m,{children:[t(Am,{children:t(ee,{size:te.S,weight:500,color:s.v2.colors.white[500],children:ko})}),t(Rm,{children:t(mm,{name:
|
|
902
|
+
`,Pm=({enabled:o,onEnabledChange:a,onBack:l,onNext:r})=>{const s=v(),c=i(()=>A({enabled:o,keepPercentage:0}),[o]);return e(n,{children:[t(xm,{title:xo,onBack:l}),e(vm,{$width:854,children:[t(Dm,{children:wo}),e(ae,{$gap:8,$width:"100%",children:[t(Tm,{children:t(_m,{children:t(ee,{size:te.XXS,color:s.v2.colors.silver[200],children:To})})}),e(ae,{$gap:8,$width:"100%",children:[e($m,{children:[t(Am,{children:t(ee,{size:te.S,weight:500,color:s.v2.colors.white[500],children:ko})}),t(Rm,{children:t(mm,{name:Eo,recommended:!0,toggleLabel:Io,enabled:o,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Om,{message:No})]})]})]}),t(Cm,{onNext:r})]})},Lm=e=>t(_l,{rotate:90,...e}),Fm=({onClose:o})=>{const i=v();return e(n,{children:[t(bm,{}),e(vm,{$width:732,children:[t(Oo,{icon:Ol}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ee,{size:te.M,weight:500,color:i.v2.colors.white[500],children:$o}),Ao.split("\n").map((e,n)=>t(Dm,{children:e},`subtitle-${n}-${e}`)),e(Tm,{children:[t(ee,{size:te.XS,color:i.v2.colors.silver[200],children:Ro}),t(Em,{color:i.v2.colors.white[500],items:[Do,_o,Po]})]})]})]}),t(Cm,{center:!0,children:t(Te,{"data-id":"sampling-onboarding-btn-go-to",label:Lo,rightIcon:Lm,variant:Ie.Primary,size:ke.M,onClick:o})})]})},Mm=e=>t(_l,{rotate:90,...e}),zm=b.div`
|
|
903
903
|
display: flex;
|
|
904
904
|
flex-direction: column;
|
|
905
905
|
align-items: center;
|
|
906
906
|
gap: 8px;
|
|
907
907
|
width: 100%;
|
|
908
|
-
`,Bm=({onSkip:o,onNext:i})=>{const a=v();return e(n,{children:[t(bm,{}),e(vm,{$width:732,children:[t(Oo,{icon:Ol}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[e(zm,{children:[t(ee,{size:te.M,weight:500,color:a.v2.colors.white[500],children:Fo}),t(Dm,{children:Mo})]}),e(Tm,{children:[t(ee,{size:te.XS,color:a.v2.colors.silver[200],children:zo}),t(
|
|
908
|
+
`,Bm=({onSkip:o,onNext:i})=>{const a=v();return e(n,{children:[t(bm,{}),e(vm,{$width:732,children:[t(Oo,{icon:Ol}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[e(zm,{children:[t(ee,{size:te.M,weight:500,color:a.v2.colors.white[500],children:Fo}),t(Dm,{children:Mo})]}),e(Tm,{children:[t(ee,{size:te.XS,color:a.v2.colors.silver[200],children:zo}),t(Nm,{items:[{title:Xo,description:Bo},{title:Vo,description:Uo},{title:jo,description:Ho}]}),t(Om,{message:Go})]})]})]}),e(Cm,{center:!0,children:[t(Te,{"data-id":"sampling-onboarding-btn-skip",label:Wo,variant:Ie.Secondary,onClick:o}),t(Te,{"data-id":"sampling-onboarding-btn-start",label:Ko,rightIcon:Mm,variant:Ie.Primary,onClick:i})]})]})},Xm=b.div`
|
|
909
909
|
display: flex;
|
|
910
910
|
align-items: stretch;
|
|
911
911
|
gap: 16px;
|
|
@@ -967,13 +967,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
967
967
|
height: 24px;
|
|
968
968
|
border-radius: 6px;
|
|
969
969
|
background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
|
|
970
|
-
`,Ym=({selected:n,onSelect:o,name:i,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(Um,{$selected:n,onClick:o,children:[e(Vm,{children:[t(Se,{"data-id":`sampling-onboarding-radio-${i}`,value:n,onChange:o,size:we.L}),t(Ol,{size:24,fill:d.v2.colors.white[500]}),t(ee,{size:te.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(Hm,{children:[e(jm,{$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(
|
|
970
|
+
`,Ym=({selected:n,onSelect:o,name:i,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(Um,{$selected:n,onClick:o,children:[e(Vm,{children:[t(Se,{"data-id":`sampling-onboarding-radio-${i}`,value:n,onChange:o,size:we.L}),t(Ol,{size:24,fill:d.v2.colors.white[500]}),t(ee,{size:te.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(Hm,{children:[e(jm,{$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(Em,{color:p,items:r}),s&&e(Wm,{children:[t(Km,{children:t($l,{size:18,fill:d.v2.colors.yellow[500]})}),t(ee,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Gm,{children:t(Te,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:pi,rightIcon:Va,variant:Ie.Text,size:ke.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Jm=({strategy:o,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(n,{children:[t(xm,{title:Yo,onBack:a}),e(vm,{$width:854,children:[t(Dm,{children:Jo}),e(Xm,{children:[t(Ym,{selected:"keep-list"===o,onSelect:()=>i("keep-list"),name:ni,description:ti,badgeProps:{label:ei,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Zo,Qo],warning:qo,onReadMore:c}),t(Ym,{selected:"drop-list"===o,onSelect:()=>i("drop-list"),name:ri,description:li,badgeProps:{label:ai,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[oi,ii],onReadMore:c}),t(Ym,{selected:"advanced"===o,onSelect:()=>i("advanced"),name:di,description:ci,badgeProps:{label:si,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(Cm,{onNext:l})]})},qm=({onBack:o,onNext:a,submitting:l})=>{const r=v(),s=i(()=>[{title:gi,bullets:[ui,hi,mi]},{title:Si,bullets:[fi,bi,vi,yi,Ci]}],[]);return e(n,{children:[t(xm,{title:xi,onBack:o}),e(vm,{$width:854,children:[t(Dm,{children:wi}),t(oe,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((n,o)=>e(Tm,{fillHeight:!0,width:"50%",children:[t(ee,{size:te.XS,color:r.v2.colors.white[500],children:n.title}),t(Em,{items:n.bullets})]},o))}),t(Om,{message:Ti})]}),t(Cm,{onNext:a,nextLoading:l})]})},Zm=b.div`
|
|
971
971
|
white-space: pre-line;
|
|
972
|
-
`,Qm=({errorPresetEnabled:o,onErrorPresetChange:a,onBack:l,onNext:r,submitting:s})=>{const c=v(),d=i(()=>R(o?{disabled:!1}:null),[o]);return e(n,{children:[t(xm,{title:ki,onBack:l}),e(vm,{$width:854,children:[t(Dm,{children:Ii}),e(ae,{$gap:8,$width:"100%",children:[e(Tm,{children:[t(Zm,{children:t(ee,{size:te.XXS,color:c.v2.colors.silver[200],children:
|
|
972
|
+
`,Qm=({errorPresetEnabled:o,onErrorPresetChange:a,onBack:l,onNext:r,submitting:s})=>{const c=v(),d=i(()=>R(o?{disabled:!1}:null),[o]);return e(n,{children:[t(xm,{title:ki,onBack:l}),e(vm,{$width:854,children:[t(Dm,{children:Ii}),e(ae,{$gap:8,$width:"100%",children:[e(Tm,{children:[t(Zm,{children:t(ee,{size:te.XXS,color:c.v2.colors.silver[200],children:Ei})}),t(Om,{message:Ti})]}),e($m,{children:[e(Am,{children:[t(ee,{size:te.S,weight:500,color:c.v2.colors.white[500],children:Ni}),t(fl,{size:16,fill:c.v2.colors.silver[200]})]}),t(Rm,{children:t(mm,{name:$i,recommended:!0,toggleLabel:Oi,enabled:o,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Cm,{onNext:r,nextLoading:s})]})},eg=b.div`
|
|
973
973
|
white-space: pre-line;
|
|
974
974
|
`,tg=b.div`
|
|
975
975
|
width: fit-content;
|
|
976
|
-
`,ng=["50","25","10","1","0.1"],og=({value:n,onChange:o,label:a})=>{const l=v(),r=i(()=>ng.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(tg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:o})})]})},ig=({errorPresetEnabled:o,onErrorPresetChange:a,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=i(()=>R(o?{disabled:!1}:null),[o]);return e(n,{children:[t(xm,{title:Ai,onBack:s}),e(vm,{$width:854,children:[t(Dm,{children:Ri}),e(ae,{$gap:8,$width:"100%",children:[e(Tm,{children:[t(eg,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:Di})}),t(Nm,{items:[_i,Pi,Li,Fi,Mi]}),t(Om,{message:Ti})]}),e($m,{children:[e(Am,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:zi}),t(fl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Rm,{children:t(mm,{name:$i,recommended:!0,toggleLabel:Oi,enabled:o,onEnabledChange:a,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Rm,{children:t(og,{value:l,onChange:r,label:Bi})})]})]})]}),t(Cm,{onNext:c,nextLoading:d})]})},ag=({isOpen:e,onClose:n,k8sHealthProbesConfig:o,samplingId:i,docsUrl:r})=>{const{samplingApi:s}=Gl(),[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(o?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,o?.enabled]);const x=d(async()=>{const e=i??"default",t=[];if(u!==(o?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:o?.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)}},[i,s,u,o?.enabled,o?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(Bm,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(Pm,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(Jm,{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(ig,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(Qm,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(qm,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Fm,{onClose:n})}return t(vo,{isOpen:e,onClose:n,children:w})};var lg,rg;(e=>{e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"})(lg||(lg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(rg||(rg={}));const sg=[{id:rg.CloudConnector,label:"Cloud Connector"}];var cg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(cg||(cg={}));const dg=[{key:cg.Name,label:"Name"},{key:cg.Type,label:"Type"},{key:cg.Status,label:"Status"},{key:cg.OdigosVersion,label:"Odigos Version"},{key:cg.ConnectedSince,label:"Connected Since"},{key:cg.LastActivity,label:"Last Activity"}],pg=(e,t)=>{const n=e.find(e=>e.key===cg.Id)?.rawValue;return t(n?.toString()||"")},ug={[Pe.Success]:"Connected",[Pe.Warning]:"Degraded",[Pe.Error]:"Error",[Pe.Disabled]:"Disabled",[Pe.Info]:"Pending"},hg={[Xi.K8s]:hn.Purple,[Xi.Vm]:hn.Blue,[Xi.Connector]:hn.Green,[Xi.AwsEcs]:hn.Yellow},mg=({connections:n,getConnections:o,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=an(),{capabilities:b}=Gl(),[y,C]=l(!n?.length),[S,x]=l(n||[]),w=d(async()=>{try{C(!0),x(await o()??[])}catch(e){}finally{C(!1)}},[]);a(()=>{S.length||w()},[]);const[T,k]=l(""),[I,N]=l(null),[E,O]=l([]),[$,A]=l(!1),[R,P]=l(!1),L=d(()=>{A(!1),P(!0),w()},[w]),F=d(e=>{e===rg.CloudConnector?A(!0):c?.(e)},[c]),M=i(()=>I===lg.BulkConfig?h:I===lg.BulkSource?m:0,[I,h,m]),{supportedConnections:z,supportedConnectionIds:B}=i(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,o=D(e.odigosVersion,t,e.type);return n&&o}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);a(()=>{if(!I||I===lg.Delete)return;const e=E.filter(e=>!B.includes(e));e.length&&O(t=>t.filter(t=>!e.includes(t)))},[I,E.length,B.length]);const X=i(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:cg.Id,rawValue:e.id},{key:cg.Name,rawValue:e.name},{key:cg.Type,rawValue:e.type,component:()=>t(nn,{variant:hg[e.type]??hn.Default,label:Ui(e.type),leftIcon:Vn(e.type)})},{key:cg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Xi.Connector){const n=ug[e.status]??"Pending",o=e.status===Pe.Success?Za:e.status===Pe.Error?Qa:void 0;return t(ce,{status:e.status,label:n,leftIcon:o})}const n=e.status===Pe.Success?"Connection live":"Connection lost",o=e.status===Pe.Success?Za:Qa;return t(ce,{status:e.status,label:n,leftIcon:o})})(e)},{key:cg.OdigosVersion,rawValue:e.odigosVersion},{key:cg.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:cg.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||I?void 0:()=>r(e),isSelected:E.includes(e.id),onSelect:()=>O(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>O(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Pe.Success||I===lg.BulkConfig&&!D(e.odigosVersion,h,e.type)||I===lg.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,E,T,I,h,m,f,r]),U=i(()=>S.length>0&&S.every(e=>e.type===Xi.K8s),[S]),V=i(()=>{const e=(e,t)=>{O([e]),N(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===cg.Status)?.rawValue===Pe.Success)(e))return[{id:bo(),label:"Delete Connection",rightIcon:Ha,onClick:()=>pg(e,i)}];const d=pg(e,e=>t.find(t=>t.id===e));if(d?.type!==Xi.K8s)return[];const p=!!d&&D(d.odigosVersion,n,d.type),u=!!d&&D(d.odigosVersion,o,d.type),h=_(n,d?.type),m=_(o,d?.type),g=[];return a&&g.push({id:bo(),tooltip:u?nt.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:tl,disabled:!u,onClick:()=>pg(e,a)}),l&&g.push({id:bo(),tooltip:nt.ADD_DESTINATION,rightIcon:Ya,onClick:()=>pg(e,l)}),r&&g.push({id:bo(),tooltip:nt.ADD_ACTION,rightIcon:Fa,onClick:()=>pg(e,r)}),s&&g.push({id:bo(),tooltip:nt.ADD_INSTRUMENTATION_RULE,rightIcon:el,onClick:()=>pg(e,s)}),c&&g.push({id:bo(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:ul,disabled:!p,onClick:()=>pg(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,lg.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,lg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,lg.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,lg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,lg.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,lg.BulkConfig):void 0})},[S,h,m,b]),H=i(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];n&&r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Add Sources",rightIcon:tl,onClick:n}});const s=[o?{id:lg.BulkDestination,label:nt.ADD_DESTINATION,icon:Ya}:null,i?{id:lg.BulkAction,label:nt.ADD_ACTION,icon:Fa}:null,a?{id:lg.BulkInstrumentationRule,label:nt.ADD_INSTRUMENTATION_RULE,icon:el}:null,l?{id:lg.BulkConfig,label:"Manage Configurations",icon:ul}:null];return s.some(Boolean)&&r.push({id:bo(),type:gn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Bulk Operations",onClick:e=>{e===lg.BulkSource?n?.():e===lg.BulkDestination?o?.():e===lg.BulkAction?i?.():e===lg.BulkInstrumentationRule?a?.():e===lg.BulkConfig&&l?.()}},dropDataProps:{alignX:fo.Left,items:s}}),r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:Ft.CANCEL,onClick:t}}),r})({onCancel:()=>O([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>N(lg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>N(lg.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>N(lg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>N(lg.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>N(lg.BulkConfig):void 0}),[b]),j=i(()=>t(mo,{items:sg,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>F(e[0]),buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW}}),[F]),G=i(()=>T.trim()&&S.length>0?{hideIcon:!0,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(T)}:{icon:Pl,title:nt.NO_CONNECTIONS,action:j},[T,S.length,j]);return t(Vi,{children:e(ut,{fullHeight:!0,richTitle:{icon:Pl,title:nt.CONNECTIONS,badge:{label:S.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:pl,onClick:w,disabled:y}},{id:"connections-create-new",type:gn.ButtonDropData,buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:fo.Right,items:sg}}],children:[t(Mn,{variant:zn.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:dg,rows:X,noDataProps:G,rowActionsPushRightPosition:I?`calc(${Or} - 24px)`:void 0,getRowActions:V}),I===lg.BulkConfig&&b.canApplyEffectiveConfig&&t(lr,{connectionIds:E,children:t(dp,{onClose:()=>N(null),connections:z,selectedConnectionIds:E,setSelectedConnectionIds:O})}),I===lg.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(lr,{connectionIds:E,children:t(rr,{selectedConnectionIds:E,children:t(Tc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===lg.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(lr,{connectionIds:E,children:t(sr,{children:t(rc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===lg.BulkAction&&b.canCreateAction&&t(lr,{connectionIds:E,children:t(cr,{children:t(qs,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===lg.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(lr,{connectionIds:E,children:t(dr,{children:t(sc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),$&&t(pr,{providers:p,children:t(lp,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(_r,{isOpen:R,onClose:()=>P(!1)}),t(Ar,{target:"connection",isOpen:I===lg.Delete,onClose:()=>{O([]),N(null)},onApprove:async()=>{const e=E[0];e&&(await s(e),await w())}}),t(Bn,{isOpen:!!E.length&&!I,richTitle:{icon:Xa,title:"Selected Clusters",badge:{label:E.length}},actions:H})]})})},gg=b.div`
|
|
976
|
+
`,ng=["50","25","10","1","0.1"],og=({value:n,onChange:o,label:a})=>{const l=v(),r=i(()=>ng.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(tg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:o})})]})},ig=({errorPresetEnabled:o,onErrorPresetChange:a,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=i(()=>R(o?{disabled:!1}:null),[o]);return e(n,{children:[t(xm,{title:Ai,onBack:s}),e(vm,{$width:854,children:[t(Dm,{children:Ri}),e(ae,{$gap:8,$width:"100%",children:[e(Tm,{children:[t(eg,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:Di})}),t(Em,{items:[_i,Pi,Li,Fi,Mi]}),t(Om,{message:Ti})]}),e($m,{children:[e(Am,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:zi}),t(fl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Rm,{children:t(mm,{name:$i,recommended:!0,toggleLabel:Oi,enabled:o,onEnabledChange:a,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Rm,{children:t(og,{value:l,onChange:r,label:Bi})})]})]})]}),t(Cm,{onNext:c,nextLoading:d})]})},ag=({isOpen:e,onClose:n,k8sHealthProbesConfig:o,samplingId:i,docsUrl:r})=>{const{samplingApi:s}=Gl(),[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(o?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,o?.enabled]);const x=d(async()=>{const e=i??"default",t=[];if(u!==(o?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:o?.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)}},[i,s,u,o?.enabled,o?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(Bm,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(Pm,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(Jm,{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(ig,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(Qm,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(qm,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Fm,{onClose:n})}return t(vo,{isOpen:e,onClose:n,children:w})};var lg,rg;(e=>{e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"})(lg||(lg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(rg||(rg={}));const sg=[{id:rg.CloudConnector,label:"Cloud Connector"}];var cg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(cg||(cg={}));const dg=[{key:cg.Name,label:"Name"},{key:cg.Type,label:"Type"},{key:cg.Status,label:"Status"},{key:cg.OdigosVersion,label:"Odigos Version"},{key:cg.ConnectedSince,label:"Connected Since"},{key:cg.LastActivity,label:"Last Activity"}],pg=(e,t)=>{const n=e.find(e=>e.key===cg.Id)?.rawValue;return t(n?.toString()||"")},ug={[Pe.Success]:"Connected",[Pe.Warning]:"Degraded",[Pe.Error]:"Error",[Pe.Disabled]:"Disabled",[Pe.Info]:"Pending"},hg={[Xi.K8s]:hn.Purple,[Xi.Vm]:hn.Blue,[Xi.Connector]:hn.Green,[Xi.AwsEcs]:hn.Yellow},mg=({connections:n,getConnections:o,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=an(),{capabilities:b}=Gl(),[y,C]=l(!n?.length),[S,x]=l(n||[]),w=d(async()=>{try{C(!0),x(await o()??[])}catch(e){}finally{C(!1)}},[]);a(()=>{S.length||w()},[]);const[T,k]=l(""),[I,E]=l(null),[N,O]=l([]),[$,A]=l(!1),[R,P]=l(!1),L=d(()=>{A(!1),P(!0),w()},[w]),F=d(e=>{e===rg.CloudConnector?A(!0):c?.(e)},[c]),M=i(()=>I===lg.BulkConfig?h:I===lg.BulkSource?m:0,[I,h,m]),{supportedConnections:z,supportedConnectionIds:B}=i(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,o=D(e.odigosVersion,t,e.type);return n&&o}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);a(()=>{if(!I||I===lg.Delete)return;const e=N.filter(e=>!B.includes(e));e.length&&O(t=>t.filter(t=>!e.includes(t)))},[I,N.length,B.length]);const X=i(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:cg.Id,rawValue:e.id},{key:cg.Name,rawValue:e.name},{key:cg.Type,rawValue:e.type,component:()=>t(nn,{variant:hg[e.type]??hn.Default,label:Ui(e.type),leftIcon:Vn(e.type)})},{key:cg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Xi.Connector){const n=ug[e.status]??"Pending",o=e.status===Pe.Success?Za:e.status===Pe.Error?Qa:void 0;return t(ce,{status:e.status,label:n,leftIcon:o})}const n=e.status===Pe.Success?"Connection live":"Connection lost",o=e.status===Pe.Success?Za:Qa;return t(ce,{status:e.status,label:n,leftIcon:o})})(e)},{key:cg.OdigosVersion,rawValue:e.odigosVersion},{key:cg.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:cg.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||I?void 0:()=>r(e),isSelected:N.includes(e.id),onSelect:()=>O(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>O(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Pe.Success||I===lg.BulkConfig&&!D(e.odigosVersion,h,e.type)||I===lg.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,N,T,I,h,m,f,r]),U=i(()=>S.length>0&&S.every(e=>e.type===Xi.K8s),[S]),V=i(()=>{const e=(e,t)=>{O([e]),E(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===cg.Status)?.rawValue===Pe.Success)(e))return[{id:bo(),label:"Delete Connection",rightIcon:Ha,onClick:()=>pg(e,i)}];const d=pg(e,e=>t.find(t=>t.id===e));if(d?.type!==Xi.K8s)return[];const p=!!d&&D(d.odigosVersion,n,d.type),u=!!d&&D(d.odigosVersion,o,d.type),h=_(n,d?.type),m=_(o,d?.type),g=[];return a&&g.push({id:bo(),tooltip:u?nt.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:tl,disabled:!u,onClick:()=>pg(e,a)}),l&&g.push({id:bo(),tooltip:nt.ADD_DESTINATION,rightIcon:Ya,onClick:()=>pg(e,l)}),r&&g.push({id:bo(),tooltip:nt.ADD_ACTION,rightIcon:Fa,onClick:()=>pg(e,r)}),s&&g.push({id:bo(),tooltip:nt.ADD_INSTRUMENTATION_RULE,rightIcon:el,onClick:()=>pg(e,s)}),c&&g.push({id:bo(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:ul,disabled:!p,onClick:()=>pg(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,lg.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,lg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,lg.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,lg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,lg.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,lg.BulkConfig):void 0})},[S,h,m,b]),H=i(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];n&&r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Add Sources",rightIcon:tl,onClick:n}});const s=[o?{id:lg.BulkDestination,label:nt.ADD_DESTINATION,icon:Ya}:null,i?{id:lg.BulkAction,label:nt.ADD_ACTION,icon:Fa}:null,a?{id:lg.BulkInstrumentationRule,label:nt.ADD_INSTRUMENTATION_RULE,icon:el}:null,l?{id:lg.BulkConfig,label:"Manage Configurations",icon:ul}:null];return s.some(Boolean)&&r.push({id:bo(),type:gn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Bulk Operations",onClick:e=>{e===lg.BulkSource?n?.():e===lg.BulkDestination?o?.():e===lg.BulkAction?i?.():e===lg.BulkInstrumentationRule?a?.():e===lg.BulkConfig&&l?.()}},dropDataProps:{alignX:fo.Left,items:s}}),r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:Ft.CANCEL,onClick:t}}),r})({onCancel:()=>O([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>E(lg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>E(lg.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>E(lg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>E(lg.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>E(lg.BulkConfig):void 0}),[b]),j=i(()=>t(mo,{items:sg,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>F(e[0]),buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW}}),[F]),G=i(()=>T.trim()&&S.length>0?{hideIcon:!0,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(T)}:{icon:Pl,title:nt.NO_CONNECTIONS,action:j},[T,S.length,j]);return t(Vi,{children:e(ut,{fullHeight:!0,richTitle:{icon:Pl,title:nt.CONNECTIONS,badge:{label:S.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:pl,onClick:w,disabled:y}},{id:"connections-create-new",type:gn.ButtonDropData,buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:fo.Right,items:sg}}],children:[t(Mn,{variant:zn.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:dg,rows:X,noDataProps:G,rowActionsPushRightPosition:I?`calc(${Or} - 24px)`:void 0,getRowActions:V}),I===lg.BulkConfig&&b.canApplyEffectiveConfig&&t(lr,{connectionIds:N,children:t(dp,{onClose:()=>E(null),connections:z,selectedConnectionIds:N,setSelectedConnectionIds:O})}),I===lg.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(lr,{connectionIds:N,children:t(rr,{selectedConnectionIds:N,children:t(Tc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),I===lg.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(lr,{connectionIds:N,children:t(sr,{children:t(rc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),I===lg.BulkAction&&b.canCreateAction&&t(lr,{connectionIds:N,children:t(cr,{children:t(qs,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),I===lg.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(lr,{connectionIds:N,children:t(dr,{children:t(sc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),$&&t(pr,{providers:p,children:t(lp,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(_r,{isOpen:R,onClose:()=>P(!1)}),t(Ar,{target:"connection",isOpen:I===lg.Delete,onClose:()=>{O([]),E(null)},onApprove:async()=>{const e=N[0];e&&(await s(e),await w())}}),t(Bn,{isOpen:!!N.length&&!I,richTitle:{icon:Xa,title:"Selected Clusters",badge:{label:N.length}},actions:H})]})})},gg=b.div`
|
|
977
977
|
display: flex;
|
|
978
978
|
align-items: center;
|
|
979
979
|
justify-content: space-between;
|
|
@@ -989,7 +989,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
989
989
|
padding: 8px;
|
|
990
990
|
border-radius: 8px;
|
|
991
991
|
background-color: ${({theme:e})=>e.v2.colors.white[500]+ie["004"]};
|
|
992
|
-
`,bg=({setStep:n,onSave:o,sourcesPayload:a,destinationsPayload:l,disableAnimation:r})=>{const s=v(),c=()=>n(2),d=()=>n(3),p=i(()=>Object.values(a||{}).flatMap((n,o)=>n.map((n,i)=>{if(!n.selected)return null;const a=n.kind||
|
|
992
|
+
`,bg=({setStep:n,onSave:o,sourcesPayload:a,destinationsPayload:l,disableAnimation:r})=>{const s=v(),c=()=>n(2),d=()=>n(3),p=i(()=>Object.values(a||{}).flatMap((n,o)=>n.map((n,i)=>{if(!n.selected)return null;const a=n.kind||Et.Namespace,l=a===Et.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(gg,{children:[t(ee,{nowrap:!0,children:l}),t(ce,{label:a,status:Pe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${o}-${i}`)})).filter(Boolean),[a]),u=i(()=>l?.map((n,o)=>{const i=wt(n.option.type).icon;return e(gg,{children:[e(oe,{$gap:8,children:[i&&t(fg,{children:t(i,{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?Za:Qa})]},`destination-${o}`)})||[],[l]);return t(Nr,{isOpen:!0,disableAnimation:r,onBack:()=>n(3),onSave:o,header:{icon:sl,title:nt.SUMMARY,subTitle:nt.REVIEW_SETUP},leftColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(tl,{size:24}),t(ee,{nowrap:!0,children:nt.SELECTED_SOURCES}),t(ce,{label:p.length})]}),t(Te,{"data-id":"summary-edit-sources",leftIcon:ja,variant:Ie.Secondary,size:ke.S,onClick:c})]}),list:p.length?p:[t(ft,{$height:"100%",children:t($e,{icon:tl,title:nt.NO_SOURCES_SELECTED,subTitle:nt.ADD_SOURCE_PROMPT,button:{leftIcon:za,label:nt.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Ya,{size:24}),t(ee,{nowrap:!0,children:nt.SELECTED_DESTINATIONS}),t(ce,{label:u.length})]}),t(Te,{"data-id":"summary-edit-destinations",leftIcon:ja,variant:Ie.Secondary,size:ke.S,onClick:d})]}),list:u.length?u:[t(ft,{"data-id":"summary-no-destinations",$height:"100%",children:t($e,{icon:Ya,title:nt.NO_DESTINATIONS_SELECTED,subTitle:nt.ADD_DESTINATION_PROMPT,button:{leftIcon:za,label:nt.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},vg=b.div`
|
|
993
993
|
position: relative;
|
|
994
994
|
overflow: hidden;
|
|
995
995
|
width: 100vw;
|
|
@@ -1022,12 +1022,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1022
1022
|
& * {
|
|
1023
1023
|
text-align: center;
|
|
1024
1024
|
}
|
|
1025
|
-
`,kg=({onStart:n})=>t(zt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(ft,{$height:"100%",children:e(wg,{children:[e(Tg,{children:[t(ee,{size:te.L,weight:500,children:nt.GET_STARTED_WITH}),t(Dr,{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:Ba,size:ke.L,onClick:n})]})})}),Ig=[{step:1,label:nt.INSTALLATION,forceDoneBadge:!0},{step:2,label:nt.SOURCES_SETUP},{step:3,label:nt.DESTINATIONS_SETUP},{step:4,label:nt.SUMMARY}],
|
|
1025
|
+
`,kg=({onStart:n})=>t(zt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(ft,{$height:"100%",children:e(wg,{children:[e(Tg,{children:[t(ee,{size:te.L,weight:500,children:nt.GET_STARTED_WITH}),t(Dr,{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:Ba,size:ke.L,onClick:n})]})})}),Ig=[{step:1,label:nt.INSTALLATION,forceDoneBadge:!0},{step:2,label:nt.SOURCES_SETUP},{step:3,label:nt.DESTINATIONS_SETUP},{step:4,label:nt.SUMMARY}],Eg=b.div`
|
|
1026
1026
|
display: flex;
|
|
1027
1027
|
flex-direction: column;
|
|
1028
1028
|
gap: 32px;
|
|
1029
1029
|
padding: 64px;
|
|
1030
|
-
`,
|
|
1030
|
+
`,Ng=({pagePaddingXAxis:n,pagePaddingYAxis:o,onDone:i})=>{const{setDrawerType:a}=vn(),{sourcesApi:r,destinationsApi:s}=Gl(),[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(xg,{paddingXAxis:n,paddingYAxis:o,children:[e(Eg,{children:[t(Dr,{useInline:!0}),t(Hi,{currentStep:c,data:Ig,gap:32})]}),t(rr,{initialInputs:h,children:e(sr,{children:[1===c&&t(kg,{onStart:b}),2===c&&t(Tc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(rc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(bg,{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(yo.OnboardingDone),i()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},Og=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),$g=e=>e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),Ag=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Rg=b.div`
|
|
1031
1031
|
position: relative;
|
|
1032
1032
|
display: inline-flex;
|
|
1033
1033
|
`,Dg=b.button`
|
|
@@ -1074,7 +1074,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1074
1074
|
align-items: center;
|
|
1075
1075
|
gap: 8px;
|
|
1076
1076
|
margin-left: auto;
|
|
1077
|
-
`,Mg=()=>{const n=v(),{platformType:o,isK8s:r,isConnector:s}=S(),{sourcesApi:c,namespacesApi:d}=Gl(),u=c.useSources().items,h=d.useNamespaces().items,{selectedStreamName:m}=ot(),{getItemSS:g,setItemSS:f,removeItemSS:b}=Ji(),{statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N,setAll:
|
|
1077
|
+
`,Mg=()=>{const n=v(),{platformType:o,isK8s:r,isConnector:s}=S(),{sourcesApi:c,namespacesApi:d}=Gl(),u=c.useSources().items,h=d.useNamespaces().items,{selectedStreamName:m}=ot(),{getItemSS:g,setItemSS:f,removeItemSS:b}=Ji(),{statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:E,enabledStatuses:N,setAll:O,clearFilters:$,getEmptyState:A}=ji(),R=i(()=>Gi(u,m),[u,m]);a(()=>{const e=g(Wi.OVERVIEW_FILTERS,A());O(e)},[]);const[D,_]=l({statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:E,enabledStatuses:N}),[P,L]=l(Ag(D)),[F,M]=l(!1),z=p(o);a(()=>{if(!F){const e={statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:E,enabledStatuses:N};_(e),L(Ag(e))}},[F,y,C,x,w,T,k,I,E,N]),a(()=>{z.current!==o&&(z.current=o,b(Wi.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1))},[o]);const B=p(null);Nn(B,()=>M(!1)),uo({key:"Escape",active:F},()=>M(!1));const X=i(()=>{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=i(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const{kind:o}=n;e.has(o)||(e.add(o),t.push({id:o,label:kn(o),withCheckbox:!0}))}),t},[R]),V=i(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const o=n.region?.trim();o&&!e.has(o)&&(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),H=i(()=>{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:Ki[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),j=i(()=>Yi.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),G=i(()=>{const e=new Set,t=[];return R.forEach(({instrumentationReport:n})=>{const o=n?.state||n?.progressStage;o&&!e.has(o)&&(e.add(o),t.push({id:o,label:$g(o),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[R]),W=i(()=>{const e=new Set,t=[];return R.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:o,message:i}=n||{};if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:Xt(o),withCheckbox:!0})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[R]),K=i(()=>[{id:"enabled",label:nt.ENABLED,withCheckbox:!0},{id:"disabled",label:nt.DISABLED,withCheckbox:!0}],[]),Y=(e,t,n)=>{const o=t.filter(e=>n.includes(e.id));_(t=>{return{...t,[e]:(n=o,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},J=F?Ja:qa,q=i(()=>Og(D.languages),[D.languages]);return e(Rg,{ref:B,children:[e(Dg,{"data-id":"filters-trigger",$isOpen:F,type:"button",onClick:()=>M(e=>!e),children:[t(Ll,{size:16,fill:n.v2.colors.white[500]}),t(ee,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),P>0&&t(ce,{label:P,status:Pe.Unknown,textSize:te.XXXS}),t(J,{size:16,fill:n.v2.colors.silver[200]})]}),F&&e(_g,{children:[e(Pg,{children:[r&&t(vt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!X.length,options:X,values:Og(D.namespaces),setValues:e=>Y("namespaces",X,e)}),s&&t(vt,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!V.length,options:V,values:Og(D.regions),setValues:e=>Y("regions",V,e)}),t(vt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!U.length,options:U,values:Og(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:Og(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:Og(D.podsAgentInjectionStatus),setValues:e=>Y("podsAgentInjectionStatus",W,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:Og(D.statuses),setValues:e=>Y("statuses",G,e)}),t(vt,{label:"Enabled Status",placeholder:"All",withMultiSelect:!0,options:K,values:Og(D.enabledStatuses),setValues:e=>Y("enabledStatuses",K,e)}),t(ge,{label:"Show only sources with errors",size:Nt.L,value:!!D.onlyErrors,onChange:e=>_(t=>({...t,onlyErrors:e}))})]}),e(Lg,{children:[t(Te,{"data-id":"filters-reset",size:ke.S,variant:Ie.Text,label:"Reset",onClick:()=>{b(Wi.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1)},textColor:n.v2.colors.red[500]}),e(Fg,{children:[t(Te,{"data-id":"filters-cancel",size:ke.S,variant:Ie.Secondary,label:"Cancel",onClick:()=>M(!1)}),t(Te,{"data-id":"filters-apply",size:ke.S,variant:Ie.Primary,label:"Apply",onClick:()=>{f(Wi.OVERVIEW_FILTERS,D),O(D),L(Ag(D)),M(!1)}})]})]})]})]})},zg=b.div`
|
|
1078
1078
|
position: relative;
|
|
1079
1079
|
display: flex;
|
|
1080
1080
|
align-items: center;
|
|
@@ -1127,7 +1127,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1127
1127
|
`,jg=b(oe)`
|
|
1128
1128
|
flex: 1;
|
|
1129
1129
|
min-width: 0;
|
|
1130
|
-
`,Gg=({entityId:n,entityType:o,title:a,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:m})=>{const g=v(),f=o===
|
|
1130
|
+
`,Gg=({entityId:n,entityType:o,title:a,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:m})=>{const g=v(),f=o===Et.Source,b="boolean"==typeof h,y=r||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=vn(),{selectedSources:x,setSelectedSources:w}=Qi(),T=m,k=f?T.id.namespace:"",I=i(()=>{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]),E=b&&!h?Pn(Pe.Info,g):l?Pn(l,g):void 0,N=f&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}${n.region?`-${n.region}`:""}`:n;return e(Hg,{"data-id":N,$faded:y,onClick:()=>{C(wn(o)),S(n)},children:[f&&t(Q,{size:qi.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(xn,{icons:p,icon:d,iconSrc:u}),e(jg,{$gap:4,children:[t(Ae,{size:te.XS,nowrap:!0,children:a}),t(oe,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:(c||b&&!h)&&t(Ue,{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:E,textSize:te.XXXS})})})]})]})};function Wg(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Pe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:sn.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Kg(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 Yg=b.div`
|
|
1131
1131
|
position: absolute;
|
|
1132
1132
|
top: 0;
|
|
1133
1133
|
left: 0;
|
|
@@ -1147,7 +1147,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1147
1147
|
flex: 1;
|
|
1148
1148
|
height: 1px;
|
|
1149
1149
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1150
|
-
`,Zg=({namespace:e})=>{const n=v();return t(Yg,{children:t(ee,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},Qg=({namespace:n})=>{const o=v();return e(Jg,{children:[t(qg,{}),t(ee,{size:te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:n}),t(qg,{})]})},ef={[
|
|
1150
|
+
`,Zg=({namespace:e})=>{const n=v();return t(Yg,{children:t(ee,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},Qg=({namespace:n})=>{const o=v();return e(Jg,{children:[t(qg,{}),t(ee,{size:te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:n}),t(qg,{})]})},ef={[Et.InstrumentationRule]:nt.NO_DATA_INSTRUMENTATION_RULES,[Et.Source]:nt.NO_DATA_SOURCES,[Et.Action]:nt.NO_DATA_ACTIONS,[Et.Destination]:nt.NO_DATA_DESTINATIONS},tf=b.div`
|
|
1151
1151
|
display: flex;
|
|
1152
1152
|
flex-direction: column;
|
|
1153
1153
|
flex: 1 0 0;
|
|
@@ -1174,7 +1174,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1174
1174
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1175
1175
|
height: ${({$height:e})=>e}px;
|
|
1176
1176
|
overflow: hidden;
|
|
1177
|
-
`,af=({entityType:n,entities:o,unfilteredCount:r,metrics:s,loading:c,maxHeight:p,refetch:u})=>{const h=n===
|
|
1177
|
+
`,af=({entityType:n,entities:o,unfilteredCount:r,metrics:s,loading:c,maxHeight:p,refetch:u})=>{const h=n===Et.Source,m=o.length!==r,g=$t(e=>h?e.progress[Dt.Instrumenting]?.percentage:void 0),f=$t(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}=Qi(),C=i(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=i(()=>{if(!s)return;const e=new Map,t=n===Et.Source?s.sources:n===Et.Destination?s.destinations:void 0;if(t)for(const n of t)e.set(ea(n),n.throughput);return e},[s,n]),x=i(()=>o.map(e=>((e,t,n)=>{const o=jt(e);if(!o)return null;const i=t===Et.Source;let a,l,r=!1,s=e;if(i){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status,n=!1===e.markedForInstrumentation?.markedForInstrumentation;switch(t){case sn.Failure:return{status:Pe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case sn.Notice:return{status:Pe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case sn.Pending:case sn.Waiting:return{status:void 0,faded:!1,displaySource:Wg(e)};case sn.Unsupported:case sn.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:Kg(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const n=t===Et.Action?ta(e):e.conditions,{priorotizedStatus:o,hasDisableds:i}=na(n);a=o,r=i}const c=oa(e,t,{extended:i,prioritizeDisplayName:!i});let d,p,u,h,m;switch(t){case Et.Source:{d=Sn(e),p=aa(Et.Source);const t=n?.get(ia(o));h=In(t);const i=e.markedForInstrumentation?.markedForInstrumentation;"boolean"==typeof i&&(m=i);break}case Et.Destination:{const t=wt(e.destinationType.type);p=t.icon,u=t.iconSrc;const i=n?.get(ia(o));h=In(i),m=!e.disabled;break}case Et.Action:p=Yt(e.type),m=!e.disabled;break;case Et.InstrumentationRule:p=on(e.type),m=!e.disabled}return{key:ia(o),entityId:o,namespace:i?e.id.namespace:void 0,raw:s,itemProps:{entityId:o,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),[o,n,S]),[w,T]=l(""),{elements:k,indexToNamespace:I,multipleNs:E,dividerCount:N}=i(()=>{const e=[],n=[],o=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;o&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let i=0,a="";for(const o of x)h&&o.namespace&&o.namespace!==a&&(""!==a&&(n.push(o.namespace),e.push(t(Qg,{namespace:o.namespace},`ns-divider-${o.namespace}`)),i+=1),a=o.namespace),n.push(o.namespace||""),e.push(t(Gg,{...o.itemProps},o.key));return{elements:e,indexToNamespace:n,multipleNs:o,dividerCount:i}},[x,h]);a(()=>{if(h&&I.length&&!w){const e=I.find(Boolean);e&&T(e)}},[h,I]);const O=d(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==w&&T(t)},[I,w]),$=58*x.length+(E?28:0)+32*N,A=Math.max(0,p-52-16),R=Math.min(A,$)+8,D="number"==typeof b?`${b}%`:m?`${o.length}/${r}`:r;return e(tf,{children:[t(Xg,{entityType:n,badge:D,badgeTooltip:m?nt.FILTERED_COUNT_TOOLTIP:void 0,isLoading:c,refetch:u,partiallySelected:C>0&&o?.length!==C,allSelected:C>0&&o?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};o?.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(nf,{children:o.length?e(of,{$height:R,children:[E&&w&&t(Zg,{namespace:w}),t(bn,{gap:4,elements:k,onTopIndexChange:E?O:void 0})]}):c?t(re,{size:3}):t(Vg,{entityType:n,description:ef[n]??nt.TO_COLLECT_OTEL_DATA})})]})},lf=b.div`
|
|
1178
1178
|
width: 100%;
|
|
1179
1179
|
flex: 1;
|
|
1180
1180
|
min-height: 0;
|
|
@@ -1182,7 +1182,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1182
1182
|
display: flex;
|
|
1183
1183
|
align-items: stretch;
|
|
1184
1184
|
gap: 16px;
|
|
1185
|
-
`,rf={sources:[],destinations:[]},sf=()=>{const n=ji(),{selectedStreamName:o}=ot(),{containerRef:a,containerHeight:l}=la(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p}=Gl(),{items:u,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=vn(e=>e.drawerType),{data:S}=p.useMetrics({skip:!u.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??rf,w=i(()=>Gi(u,o),[u,o]),T=i(()=>Qt(m,o),[m,o]),k=i(()=>ra(w,n),[w,n]),I=i(()=>sa(T,n),[T,n]),
|
|
1185
|
+
`,rf={sources:[],destinations:[]},sf=()=>{const n=ji(),{selectedStreamName:o}=ot(),{containerRef:a,containerHeight:l}=la(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p}=Gl(),{items:u,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=vn(e=>e.drawerType),{data:S}=p.useMetrics({skip:!u.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??rf,w=i(()=>Gi(u,o),[u,o]),T=i(()=>Qt(m,o),[m,o]),k=i(()=>ra(w,n),[w,n]),I=i(()=>sa(T,n),[T,n]),E=i(()=>ca(f,n),[f,n]);return e(lf,{ref:a,children:[t(af,{entityType:Et.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(af,{entityType:Et.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:l,refetch:r.fetchAll}),t(af,{entityType:Et.Action,entities:E,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(af,{entityType:Et.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:s.fetchAll})]})},cf="40vw",df=b.div`
|
|
1186
1186
|
position: relative;
|
|
1187
1187
|
width: ${cf};
|
|
1188
1188
|
`,pf=b.div`
|
|
@@ -1222,7 +1222,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1222
1222
|
}
|
|
1223
1223
|
`,ff=b.div`
|
|
1224
1224
|
padding: 16px 8px;
|
|
1225
|
-
`,bf=({preventPopup:n=!1})=>{const o=v(),{selectedStreamName:a}=ot(),{searchText:s,setSearchText:c}=ji(),{setDrawerType:d,setDrawerEntityId:u}=vn(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=Gl(),b=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,x=p(null),[w,T]=l(!1),[k,I]=l("all"),
|
|
1225
|
+
`,bf=({preventPopup:n=!1})=>{const o=v(),{selectedStreamName:a}=ot(),{searchText:s,setSearchText:c}=ji(),{setDrawerType:d,setDrawerEntityId:u}=vn(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=Gl(),b=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,x=p(null),[w,T]=l(!1),[k,I]=l("all"),E=!n&&(!!s||w),N=()=>{c(""),T(!1),I("all")};Nn(x,()=>N()),uo({key:"Escape",active:E},N);const{categories:O,searchResults:$}=i(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:o,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?n.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,c=i?o.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,d=[{category:Et.Source,label:"Sources",count:r.length,entities:[]},{category:Et.Action,label:"Actions",count:s.length,entities:[]},{category:Et.Destination,label:"Destinations",count:c.length,entities:[]},{category:Et.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const p=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===Et.InstrumentationRule?l:e.category===Et.Source?r:e.category===Et.Action?s:e.category===Et.Destination?c:[]}));return{categories:d,searchResults:p}})({instrumentationRules:S,sources:Gi(b,a),actions:C,destinations:Qt(y,a),searchText:s,selectedCategory:k}),[S,b,C,y,a,s,k]),A=i(()=>O.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:n})=>({value:e,label:n?`${t} (${n})`:t})),[O]),R=$.some(({entities:e})=>e.length>0);return e(df,{ref:x,children:[t(fn,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>T(!0),width:cf}),E&&e(pf,{children:[A.length>1&&t(uf,{children:t(ve,{options:A,selected:k,setSelected:I})}),R?t(hf,{children:$.map(({category:n,label:i,entities:a},l)=>{if(!a.length)return null;const s=aa(n);return e(r,{children:[t(mf,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:i})}),a.map((i,a)=>e(gf,{onClick:()=>{const e=jt(i);e&&(d(wn(n)),u(e),N())},children:[s&&t(s,{size:16,fill:o.v2.colors.white[500]}),t(ee,{size:te.XS,nowrap:!0,children:oa(i,n,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${n}`)})}):t(ff,{children:t($e,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},vf=({onRedirectToSampling:o})=>{const{sourcesApi:a}=Gl(),{items:l}=a.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=vn(),p=()=>{c(null),d(null)},u=i(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),h=i(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(n,{children:[t(pm,{}),r===yo.AddSource&&t(rr,{children:t(Tc,{onClose:p,withOverlay:!0})}),r===yo.AddDestination&&t(sr,{children:t(rc,{onClose:p,withOverlay:!0})}),r===yo.AddInstrumentationRule&&t(dr,{sourceOptions:u,namespaceOptions:h,children:t(sc,{onClose:p,withOverlay:!0})}),r===yo.AddAction&&t(cr,{sourceOptions:u,namespaceOptions:h,children:t(qs,{onClose:p,withOverlay:!0})}),r===yo.EditSource&&t(ur,{children:t(zh,{onClose:p,sourceId:s,onRedirectToSampling:o})}),r===yo.EditDestination&&t(sr,{children:t(up,{onClose:p,destinationId:s})}),r===yo.EditInstrumentationRule&&t(dr,{sourceOptions:u,namespaceOptions:h,children:t(mp,{onClose:p,ruleId:s})}),r===yo.EditAction&&t(cr,{sourceOptions:u,namespaceOptions:h,children:t(cp,{onClose:p,actionId:s})})]})},yf=b.div`
|
|
1226
1226
|
position: relative;
|
|
1227
1227
|
display: inline-flex;
|
|
1228
1228
|
`,Cf=b.div`
|
|
@@ -1283,18 +1283,30 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1283
1283
|
align-items: center;
|
|
1284
1284
|
gap: 2px;
|
|
1285
1285
|
flex-shrink: 0;
|
|
1286
|
-
`,
|
|
1286
|
+
`,Ef=b.div`
|
|
1287
1287
|
display: flex;
|
|
1288
1288
|
padding-top: 4px;
|
|
1289
1289
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1290
|
-
`,
|
|
1290
|
+
`,Nf=()=>{const o=v(),{isK8s:r}=S(),{clearStore:s}=da(),{dataStreamsApi:c}=Gl();c.useDataStreams();const{dataStreams:d,selectedStreamName:u,setSelectedStreamName:h}=ot(),m=p(null),[g,f]=l(!1),[b,y]=l(""),[C,x]=l(""),[w,T]=l(!1),[k,I]=l(!1),[E,N]=l(!1),[O,$]=l(""),[A,R]=l(!1);Nn(m,()=>f(!1)),a(()=>{g||y("")},[g]);const D=i(()=>{if(!b)return d;const e=b.toLowerCase();return d.filter(({name:t})=>t.toLowerCase().includes(e))},[d,b]),_=g?Ja:qa;return r?e(n,{children:[e(yf,{ref:m,children:[e(Cf,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(Fl,{size:24}),t(ee,{size:te.S,weight:500,nowrap:!0,children:(P=u,`Data Stream: ${P}`)}),t(ce,{label:d.length,status:Pe.Unknown,textSize:te.XXXS}),t(_,{size:20,fill:o.v2.colors.silver[200]})]}),g&&e(Sf,{children:[t(xf,{children:t(fn,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(wf,{children:0===D.length?t(Tf,{children:t(ee,{size:te.XS,color:ne.Secondary,children:"No streams match"})}):D.map(({name:n})=>{const o=n===pa;return e(Tf,{"data-id":`stream-row-${n}`,$selected:n===u,onClick:()=>(e=>{e!==u&&(s(),h(e)),f(!1)})(n),children:[t(kf,{children:t(ee,{size:te.XS,nowrap:!0,children:n})}),e(If,{children:[t(yt,{"data-id":`stream-edit-${n}`,icon:ja,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),x(n),T(!0)}}),!o&&t(yt,{"data-id":`stream-delete-${n}`,icon:Ma,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),$(n),R(!0)}})]})]},`stream-${n}`)})}),t(Ef,{children:t(Te,{"data-id":"add-stream-trigger",variant:Ie.Secondary,size:ke.S,leftIcon:za,label:`${Ft.NEW} ${nt.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),s(),N(!0),I(!0)}})})]})]}),E&&t(hr,{defaultExcludeName:u,children:t(rm,{isOpen:k,onClose:()=>I(!1),onCloseEnd:()=>N(!1)})}),C&&t(hr,{children:t(sm,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(Ar,{target:`${nt.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{O&&await c.remove(O)}})]}):null;var P},Of=b(ae)`
|
|
1291
|
+
width: 100%;
|
|
1292
|
+
max-height: 320px;
|
|
1293
|
+
overflow-y: auto;
|
|
1294
|
+
gap: 8px;
|
|
1295
|
+
`,$f=b(oe)`
|
|
1296
|
+
width: 100%;
|
|
1297
|
+
align-items: center;
|
|
1298
|
+
gap: 8px;
|
|
1299
|
+
padding: 8px 12px;
|
|
1300
|
+
border-radius: 8px;
|
|
1301
|
+
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1302
|
+
`,Af=()=>{const o=v(),{selectedStreamName:r}=ot(),{selectedSources:s,setSelectedSources:c}=Qi(),{sourcesApi:p}=Gl(),[u,h]=l(!1),[m,g]=l(!1),[f,b]=l(!1),[y,C]=l(!1),{toInstrument:S,toUninstrument:x,totalSelected:w}=i(()=>{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),[]),E=d(()=>b(!1),[]),N=d(()=>C(!1),[]);a(()=>{T()},[r,T]);const O=d((e,t)=>{if(!e.length)return;const n=new Map;e.forEach(e=>{const t=e.id.namespace,o=n.get(t)??[];o.push(e),n.set(t,o)}),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]),$=d(()=>{p.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==Tn.StaticPod).map(yn)),T()},[p,s,T]),A=d(()=>{O(S,!0),T()},[O,S,T]),R=d(()=>{O(x,!1),T()},[O,x,T]),D=d(()=>{O(S,!0),O(x,!1),T()},[O,S,x,T]),_=S.length>0,P=x.length>0,L=_&&P,F=i(()=>{const e=[{id:"multi-source-deselect",type:gn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:"Deselect",onClick:T}},{id:"multi-source-restart",type:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Restart",leftIcon:Sl,onClick:()=>h(!0)}}];return L?e.push({id:"multi-source-apply",type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Apply Changes",leftIcon:za,onClick:()=>C(!0)}}):_?e.push({id:"multi-source-instrument",type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Instrument",leftIcon:za,onClick:()=>b(!0)}}):P&&e.push({id:"multi-source-uninstrument",type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Uninstrument",leftIcon:Ma,onClick:()=>g(!0)}}),e},[T,L,_,P]),M=e=>oa(e,Et.Source,{extended:!0})||e.id.name;return e(n,{children:[t(Bn,{isOpen:w>0,richTitle:{icon:tl,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:()=>{$(),k()}}}),t(Ar,{isOpen:f,action:"instrument",target:`${S.length} source${1===S.length?"":"s"}`,onClose:E,onDeny:E,onApprove:A}),t(Ar,{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:N,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:N},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:()=>{D(),N()}},children:e(Of,{children:[S.map(n=>e($f,{children:[t(ce,{leftIcon:za,status:Pe.Success,useSecondaryTone:!0,textColor:o.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:M(n)})]},`instrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`)),x.map(n=>e($f,{children:[t(ce,{leftIcon:xl,status:Pe.Error,useSecondaryTone:!0,textColor:o.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:M(n)})]},`uninstrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`))]})})]})},Rf=C`
|
|
1291
1303
|
0% {
|
|
1292
1304
|
background-position: 200% 50%;
|
|
1293
1305
|
}
|
|
1294
1306
|
100% {
|
|
1295
1307
|
background-position: 0% 50%;
|
|
1296
1308
|
}
|
|
1297
|
-
`,
|
|
1309
|
+
`,Df=b.div`
|
|
1298
1310
|
display: flex;
|
|
1299
1311
|
align-items: center;
|
|
1300
1312
|
justify-content: space-evenly;
|
|
@@ -1305,43 +1317,43 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1305
1317
|
|
|
1306
1318
|
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%)`};
|
|
1307
1319
|
background-size: 200% 100%;
|
|
1308
|
-
animation: ${
|
|
1309
|
-
`,
|
|
1320
|
+
animation: ${Rf} 15s linear infinite;
|
|
1321
|
+
`,_f=[el,tl,Fa,Ya],Pf=({onRedirectToSampling:n})=>{const o=v();return e(Vi,{children:[e(ut,{fullHeight:!0,customTitle:t(Nf,{}),customSearch:t(bf,{}),filters:t(Mg,{}),children:[t(Df,{children:_f.map((n,i)=>e(r,{children:[t(n,{size:24}),i<_f.length-1&&t(La,{fill:o.v2.colors.white[500]+ie["020"],size:24})]},n.name))}),t(sf,{})]}),t(vf,{onRedirectToSampling:n}),t(Af,{})]})};var Lf;(e=>{e.Gateway="gateway",e.Node="node"})(Lf||(Lf={}));const Ff=({onClickDownloadDiagnose:n,onClickRefresh:o,loading:a,disabled:l})=>{const r=i(()=>{const e=[];return n&&e.push({id:bo(),type:gn.Button,buttonProps:{label:"Download Diagnose",leftIcon:Nl,size:ke.S,variant:Ie.Text,onClick:n,disabled:l}}),o&&e.push({id:bo(),type:gn.Button,buttonProps:{label:"Refresh",leftIcon:pl,size:ke.S,variant:Ie.Text,onClick:o,disabled:l,loading:a}}),e},[n,o,l,a]);return e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(ua,{icon:Ml,title:"Collectors Pipeline"}),t(ha,{actions:r})]})},Mf=({pod:n,onClose:o})=>{const{formatTimeAgo:a}=an(),{collectorsApi:l}=Gl(),{data:r}=l.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),s=i(()=>[{id:bo(),title:"Node",label:r?.node??"-",withCopy:!0},{id:bo(),title:"Status",badge:{status:ma(r?.status),label:r?.status??"-"}}],[r]),c=i(()=>r?.containers?.map(e=>({id:bo(),items:[{id:bo(),title:"Container",label:e.name??"-"},{id:bo(),title:"Status",label:e.startedAt?`${e.status} (since ${a(e.startedAt)})`:e.status},{id:bo(),title:"Ready",badge:{status:e.ready?Pe.Success:Pe.Error,leftIcon:e.ready?Xa:Ua,label:e.ready?"True":"False",invertColors:!0}},{id:bo(),title:"Started",badge:{status:e.started?Pe.Success:Pe.Error,leftIcon:e.started?Xa:Ua,label:e.started?"True":"False",invertColors:!0}},{id:bo(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:bo(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:bo(),title:nt.RESTARTS,label:e.restarts.toString()},{id:bo(),title:"State Reason",label:e.stateReason??"-"},{id:bo(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:bo(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(zt,{isOpen:!!n,header:{icon:hl,title:"Pod Information",onClose:o},children:r?e(Wt,{bgTint:"1000",richTitle:{icon:hl,title:r.name,withCopy:!0},children:[t(Wt,{bgTint:"900",cellsPerRow:2,items:s}),e(Wt,{bgTint:"900",richTitle:{icon:Cl,title:nt.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(mn,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(mn,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(mn,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Wt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:n})=>t(Wt,{bgTint:"800",cellsPerRow:2,items:n},e)):t($e,{title:"No containers",subTitle:"Pod has no containers"})}),t(Rr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})})})};var zf;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(zf||(zf={}));const Bf=e=>{const t=[{key:zf.PodName,label:"Pod Name"},{key:zf.Status,label:"Status"},{key:zf.Restarts,label:nt.RESTARTS},{key:zf.NodeName,label:"Node Name"},{key:zf.Age,label:"Age"},{key:zf.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:zf.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Xf=({isLoading:n,pods:o,withSpanDropRate:a})=>{const r=v(),{formatTimeAgo:s}=an(),[c,d]=l(null),p=i(()=>o.map(n=>({onClick:()=>d(n),cells:[{key:zf.PodName,rawValue:n.name},{key:zf.Status,rawValue:n.status,component:()=>{return e=n.status,t(ce,{status:ma(e),label:e});var e}},{key:zf.Restarts,rawValue:n.restartsCount.toString()},{key:zf.NodeName,rawValue:n.nodeName},{key:zf.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:o}=n;if(!o)return t(ee,{children:"-"});const i=(o?.metricsAcceptedRps??0)+(o?.metricsDroppedRps??0),a=i>0?Math.round((o?.metricsDroppedRps??0)/i*100):0,l=a>0?Pe.Error:Pe.Success,r=(o?.exporterSuccessRps??0)+(o?.exporterFailedRps??0),s=r>0?Math.round((o?.exporterFailedRps??0)/r*100):0,c=s>0?Pe.Error:Pe.Success;return e(oe,{$gap:4,children:[t(Ue,{text:`Accepted: ${o.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${o.metricsDroppedRps.toLocaleString()} spans/s`,children:t(ce,{status:l,label:`Receiver ${a}%`,leftIcon:l===Pe.Error?zl:Bl,useSecondaryTone:!0,invertColors:!0})}),t(Ue,{text:`Success: ${o.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${o.exporterFailedRps.toLocaleString()} spans/s`,children:t(ce,{status:c,label:`Exporter ${s}%`,leftIcon:c===Pe.Error?zl:Bl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:zf.Age,rawValue:s(n.creationTimestamp)},{key:zf.DockerImage,rawValue:n.image}]})),[o,r]);return e(Wt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:hl,title:"Pods"},children:[t(Mn,{variant:zn.Data,isLoading:n,columns:Bf(a),rows:p}),t(Mf,{pod:c,onClose:()=>d(null)})]})},Uf=({isOpen:e,onClose:n,title:o,yaml:i})=>t(zt,{isOpen:e,header:{icon:Xl,title:o,onClose:n},children:t(Rr,{yaml:i,defaultOpen:!0})}),Vf=e=>{switch(e){case ga.Healthy:return"All desired replicas are updated, available, and ready";case ga.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case ga.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case ga.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case ga.Down:return"No available replicas";case ga.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Hf;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(Hf||(Hf={}));const jf=b.div`
|
|
1310
1322
|
flex: 0.5;
|
|
1311
1323
|
padding: 12px;
|
|
1312
1324
|
border-radius: 12px;
|
|
1313
1325
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1314
|
-
`,
|
|
1326
|
+
`,Gf=({selectedTab:n,gatewayInfo:o,nodeCollectorInfo:a,isLoading:r})=>{const{formatTimeAgo:s}=an(),[c,d]=l(null),p=i(()=>(e=>{switch(e){case Lf.Gateway:return"Deployment";case Lf.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),u=i(()=>((e,t,n,o)=>{const i={status:Pe.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Lf.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Lf.Node:a=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return i}return a?{status:Pe.Info,label:"Rollout in progress",rightIcon:pl,useSecondaryTone:!0}:l?{status:Pe.Disabled,label:`Last Rollout: ${o(l)}`}:i})(n,o,a,s),[o,a,n,s]),h=i(()=>((e,t,n,o)=>{let i=o?Pe.Info:Pe.Unknown,a=o?"Loading":ga.Unknown,l=o?"Fetching data...":Vf(ga.Unknown);switch(e){case Lf.Gateway:i=t?.status?ma(t?.status):i,a=t?.status??a,l=t?.status?Vf(t.status):l;break;case Lf.Node:i=n?.status?ma(n?.status):i,a=n?.status??a,l=n?.status?Vf(n.status):l}return{status:i,title:a,description:l}})(n,o,a,r),[o,a,n,r]),m=i(()=>((e,t,n)=>{switch(e){case Lf.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 Lf.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,o,a),[o,a,n]),g=i(()=>((e,t,n,o)=>{switch(e){case Lf.Gateway:return[{title:"Data throughput",cells:[{label:"Traces data",value:In(t?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:In(t?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:In(t?.throughputLogsBytesPerSec??0),isLoading:o}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:o}]}];case Lf.Node:return[{title:"Data Throughput",cells:[{label:"Traces data",value:In(n?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:In(n?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:In(n?.throughputLogsBytesPerSec??0),isLoading:o}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${n?.resources?.requests.cpu}/${n?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${n?.resources?.requests.memory}/${n?.resources?.limits.memory}`,isLoading:o}]}];default:return[]}})(n,o,a,r),[o,a,n,r]),f=i(()=>(n===Lf.Gateway?o?.manifestYAML:a?.manifestYAML)??"",[o,a,n]),b=i(()=>(n===Lf.Gateway?o?.configMapYAML:a?.configMapYAML)??"",[o,a,n]);return e(Wt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Xl,title:p,badge:u},actions:[{id:bo(),type:gn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Hf.ManifestYaml,label:p,icon:Ul},{id:Hf.ConfigMapYaml,label:"ConfigMap",icon:Ul}]}}],children:[e(oe,{$gap:16,children:[t("div",{children:t(fa,{...h})}),m.map(e=>t(jf,{children:t("div",{children:t(ba,{...e})})},e.title)),g.map(e=>t(va,{...e},e.title))]}),t(Uf,{isOpen:c===Hf.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(Uf,{isOpen:c===Hf.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Wf=[{value:Lf.Gateway,label:"Gateway"},{value:Lf.Node,label:"Node Collector"}],Kf=({minSupportedVersion:n})=>{const{isVersionSupported:o,version:a,minSupportedVersion:r}=S(n),[s,c]=l(Lf.Gateway),p=s===Lf.Gateway,u=s===Lf.Node,{collectorsApi:h,configApi:m}=Gl(),{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:E,refetch:N}=h.useNodeCollectorPods({skip:!u}),O=p&&(b||C)||u&&(T||E),$=d(()=>{p?(v(),x()):u&&(k(),N())},[p,u,v,x,k,N]),A=i(()=>p?y:I,[y,I,p]);return e(Vi,{children:[t(Ff,{disabled:!o,loading:O,onClickDownloadDiagnose:void 0,onClickRefresh:$}),e(ya,{children:[e(ae,{children:[t(ve,{variant:Fn.Underline,size:Re.L,options:Wf,selected:s,setSelected:c}),t(Gf,{selectedTab:s,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:O})]}),t(Xf,{isLoading:O,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!o&&t(Pr,{minSupportedVersion:r,currentVersion:a||""})]})]})},Yf=b.div`
|
|
1315
1327
|
display: inline-flex;
|
|
1316
1328
|
align-items: center;
|
|
1317
1329
|
min-width: 0;
|
|
1318
1330
|
overflow: hidden;
|
|
1319
1331
|
white-space: pre;
|
|
1320
1332
|
text-overflow: ellipsis;
|
|
1321
|
-
`,
|
|
1333
|
+
`,Jf=b.div`
|
|
1322
1334
|
display: flex;
|
|
1323
1335
|
flex-direction: column;
|
|
1324
1336
|
gap: 4px;
|
|
1325
1337
|
min-width: 0;
|
|
1326
1338
|
flex: 1;
|
|
1327
1339
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
1328
|
-
`,
|
|
1340
|
+
`,qf=b(oe)`
|
|
1329
1341
|
flex-shrink: 0;
|
|
1330
1342
|
gap: 6px;
|
|
1331
1343
|
align-items: center;
|
|
1332
1344
|
min-height: 22px;
|
|
1333
|
-
`,
|
|
1345
|
+
`,Zf=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Qf=[{value:"all",label:Ca},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],eb=({title:n,items:o,isLoading:a,showTypeFilter:r,onRuleClick:s,onCreateRule:c,onEditRule:p,onDeleteRule:u})=>{const h=v(),[m,g]=l(""),[f,b]=l("all"),y=i(()=>{let e=((e,t,n)=>n&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(o,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),o=e.summary.map(e=>e.text).join("").toLowerCase();return t||o.includes(n)})})(e,m),e},[o,f,r,m]),C=i(()=>y.map(n=>{const o=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(Jf,{$disabled:n.disabled,children:[t(Yf,{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(qf,{children:[n.disabled&&t(ce,{label:Xn,textSize:te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&o&&t(ce,{label:n.typeBadge,textSize:te.XXXS,backgroundColor:o.bg,textColor:o.text})]})}],onClick:()=>s(n)}}),[y,h,s]),S=i(()=>{const e=e=>t(Ha,{...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:Wn,leftIcon:ja,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:Ol,title:n,badge:{label:o.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:Qf,selected:f,setSelected:b}}:{}},children:t(Mn,{variant:zn.Pretty,hideHeader:!0,isLoading:a,noDataProps:m.trim()?{hideIcon:!0,title:Sa,subTitle:Ta(m)}:{hideIcon:!0,title:wa,button:{label:xa,onClick:c}},columns:Zf,rows:C,getRowActions:x})})},tb=({docsUrl:n})=>{const{samplingApi:o,sourcesApi:r}=Gl(),{items:s}=r.useSources(),c=i(()=>s.map(e=>({id:e.id})),[s]),{items:u,loading:h,k8sHealthProbesConfig:m,refetch:g}=o.useSamplingRules(),f=d((e,t)=>o.createNoisy?.({samplingId:e,rule:t}),[o]),b=d((e,t,n)=>o.updateNoisy?.(t,{samplingId:e,rule:n}),[o]),v=d((e,t)=>o.createHighlyRelevant?.({samplingId:e,rule:t}),[o]),y=d((e,t,n)=>o.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[o]),C=d((e,t)=>o.createCostReduction?.({samplingId:e,rule:t}),[o]),S=d((e,t,n)=>o.updateCostReduction?.(t,{samplingId:e,rule:n}),[o]),x=d((e,t,n)=>"noisy"===n?o.deleteNoisy?.(t,e):"highlyRelevant"===n?o.deleteHighlyRelevant?.(t,e):"costReduction"===n?o.deleteCostReduction?.(t,e):void 0,[o]),w=d((e,t)=>o.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[o]),T=i(()=>c.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[c]),k=i(()=>Array.from(new Set(c.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[c]),[I,E]=l(P.Noisy),[N,O]=l(null),[$,D]=l(!1),[_,Q]=l(!1),[ee,te]=l(null),[ne,ie]=l(!1),[le,re]=l(!1),[se,ce]=l(!1),[de,pe]=l(!1);p(!1),a(()=>{},[h,u]);const{pendingViewSamplingRule:ue,setPendingViewSamplingRule:he}=vn();a(()=>{if(!ue)return;if(h||0===u.length)return;he(null);const e=L(u,ue.ruleId,ue.category);e&&(E(F[ue.category]),D(!1),O(e))},[h,u,ue,he]);const me=i(()=>A(m),[m]),ge=i(()=>M(u),[u]),fe=i(()=>R(ge?.rule??null),[ge]),be=i(()=>z(u),[u]),ye=i(()=>B(be?.rule??null),[be]),Ce=p(N);Ce.current=N,a(()=>{const e=Ce.current;if(!e)return;const t=X(u,e);t?O(t):(O(null),D(!1))},[u]);const Se=i(()=>{const e=new Set;return ge&&e.add(ge.rule.ruleId),be&&e.add(be.rule.ruleId),e},[ge,be]),xe=i(()=>U(u,I,Se),[u,I,Se]),we=d(()=>Q(!0),[]),Ee=d(()=>Q(!1),[]);d(()=>pe(!1),[]);const Ne=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]),Oe=d(e=>{const t=G(u,e);t&&(D(!1),O(t))},[u]),$e=d(()=>{O(null),D(!1)},[]),Ae=d((e,t)=>{const n=N;if(n&&n.rule.ruleId===e&&n.samplingId===t)D(!0),O({...n});else for(const n of u){if(n.id!==t)continue;const o=[...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(o)return D(!0),void O({category:o.category,rule:o.rule,samplingId:t,summary:W(o.category,o.rule)})}},[N,u]),De=d(async(e,t,n)=>{const o=N?.category;if(o){switch(o){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)}},[N,b,y,S]),Le=d((e,t)=>{te({ruleId:e,samplingId:t})},[]),Fe=d(async()=>{if(!ee)return;const{ruleId:e,samplingId:t}=ee,n=N?.category||K[I];await x(t,e,n),O(null),D(!1),te(null)},[ee,N,I,x]),Me=d(()=>te(null),[]),ze=d(async(e,t)=>{await w(e,t),ie(!1)},[w]),Be=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",o=be;o?await S(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:o.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]),Ue=d(e=>{const t=K[I];let n=null;switch(t){case"noisy":{const o=j(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}case"highlyRelevant":{const o=H(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs});break}case"costReduction":{const o=V(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}}return n?{message:ka,ruleId:n}:null},[u,I]),Ve=d(e=>{const t=N?.category,n=N?.rule.ruleId;if(!t)return null;let o=null;switch(t){case"noisy":{const i=j(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},n);break}case"highlyRelevant":{const i=H(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},n);break}case"costReduction":{const i=V(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},n);break}}return o?{message:ka,ruleId:o}:null},[u,N]),He=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 O({category:n.category,rule:n.rule,samplingId:t.id,summary:W(n.category,n.rule)})}},[u]),je=i(()=>{const e=[];return n&&e.push({id:bo(),type:gn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ia,leftIcon:Va,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:bo(),type:gn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ea,leftIcon:pl,size:ke.S,variant:Ie.Text,onClick:g,loading:h}}),e.push({id:bo(),type:gn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Na,rightIcon:za,size:ke.S,variant:Ie.Primary,onClick:we}}),e},[n,g,h,we]);return e(Vi,{children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(ua,{icon:Ol,title:$a,subTitle:Oa}),t(ha,{actions:je})]}),e(ae,{$gap:12,$fullHeight:!0,children:[t(ve,{variant:Fn.Underline,size:Re.L,options:J,selected:I,setSelected:E}),e(oe,{$justifyContent:"space-between",children:[t(_e,{status:Pe.Default,message:q[I]}),n&&t(Te,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Va,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")})]}),I===P.Noisy?t(yr,{title:ct,summary:me,onEdit:()=>ie(!0)}):I===P.HighlyRelevant?t(yr,{title:it,summary:fe,onEdit:()=>re(!0)}):I===P.CostReduction?t(yr,{title:rt,summary:ye,onEdit:()=>ce(!0)}):null,t(eb,{title:Z[I],items:xe,isLoading:h,showTypeFilter:I===P.HighlyRelevant,onRuleClick:Oe,onCreateRule:we,onEditRule:Ae,onDeleteRule:Le})]}),t(qh,{formType:Zl.View,data:N,defaultEditMode:$,onClose:$e,onDelete:Le,onSaveEdit:De,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t(qh,{formType:Zl.Create,isOpen:_,category:K[I],onClose:Ee,onSubmit:Ne,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t(qh,{formType:Zl.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(qh,{formType:Zl.EditAutoHighlyRelevant,isOpen:le,enabled:!!ge&&!ge.rule.disabled,onClose:()=>re(!1),onSave:Be}),t(qh,{formType:Zl.EditAutoCostReduction,isOpen:se,enabled:!!be&&!be.rule.disabled,dropPercentage:be?.rule.percentageAtMost??25,onClose:()=>ce(!1),onSave:Xe}),t(tt,{title:_a,description:Da,isOpen:!!ee,onClose:Me,denyButton:{label:Ra,variant:Ie.Secondary,onClick:Me},approveButton:{label:Aa,variant:Ie.Primary,onClick:()=>{Fe(),Me()}}}),!1]})},nb=b.div`
|
|
1334
1346
|
padding: 12px;
|
|
1335
1347
|
border-radius: 12px;
|
|
1336
1348
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
1337
|
-
`,
|
|
1349
|
+
`,ob=f(({id:e,data:n})=>t(nb,{"data-id":e,children:t($e,{...n})}));var ib,ab;ob.displayName=ob.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(ib||(ib={})),(e=>{e.AnimatedTraffic="animated-traffic"})(ab||(ab={}));const lb=(e,t,n)=>{if(n)return{icons:[yl],aggService:e,selected:!0};const o=e.isVirtual,i=o?[Cn(e)]:t?Sn(t):[Vl],{priorotizedStatus:a}=o?{priorotizedStatus:void 0}:na(t?.conditions||[]);return{icons:i,status:a,isVirtual:o,aggService:e,selected:!0}},rb=e=>!(!e||e.serviceName!==Lp||e.id.namespace||e.id.name||e.id.kind),sb=new Zr,cb={"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"},db=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},pb={id:{namespace:"",name:"",kind:""},serviceName:Lp,markedForInstrumentation:{markedForInstrumentation:!0}},ub=h(null),hb=()=>{const e=m(ub);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},mb=({serviceMap:e,children:n})=>{const o=v(),{sourcesApi:r}=Gl(),{items:s}=r.useSources(),[c,p,u]=zr([]),[h,m,g]=Br([]),[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),[]),E=d(()=>k(null),[]),N=d((e,t)=>{const n=new Set(e);p(e=>e.map(e=>e.type===ib.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,o=(e,n,o=!1)=>{let i=t.get(e);return i||(i={serviceName:n,isVirtual:o,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:n,value:o}of t)n in e||(e[n]=o)};for(const t of e){const{graphKey:e}=db(t.nodeId),a=o(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=db(e?.nodeId??"");e.isVirtual&&(n.add(t),i(o(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[i,a]of e)t.has(i)||o(i,a.targetServiceName,n.has(i));const l=[];for(const[e,{serviceName:n,isVirtual:o,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:n,isVirtual:o,connections:t,attributes:i})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),i=(({sources:e,aggregatedServiceMap:t})=>{const n=[],o={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name),a=rb(t);n.push({id:i.graphKey,type:ib.MapItem,position:o,data:lb(i,t,a),measured:{width:80,height:80}})}else n.push({id:ib.NoData,type:ib.NoData,position:o,data:{subTitle:nt.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:n,sources:[pb].concat(s)});if(1===i.length&&i[0].id===ib.NoData)return p(i),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:n})=>{const o=[],i=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=t.graphKey,a=i.get(n);if(!a)continue;const l=a.data?.status===Pe.Error;for(const a of t.connections){const r=a.targetGraphKey;i.has(r)&&o.push({id:`${n}-to-${r}`,type:"smoothstep",source:n,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Mr.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return o})({theme:o,nodes:i,aggregatedServiceMap:n});m(a);const l=i.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,n={})=>{const o={id:"root",layoutOptions:{...cb,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Lp?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await sb.layout(o),a=new Map;return i.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}})(i,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 i.map(e=>{const n=t.get(e.id);return n?e.type===ib.MapItem&&n.type===ib.MapItem?{...e,position:n.position,data:{...e.data,selected:n.data.selected}}:{...e,position:n.position}:e})})},[o,e,s,C]);const O=i(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:ab.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),$=i(()=>({nodes:c,edges:O,onNodesChange:u,onEdgesChange:g,setNodesSelected:N,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:I,resetActiveNode:E}),[c,O,u,g,N,f,x,T,I,E]);return t(ub.Provider,{value:$,children:n})},gb=b.div`
|
|
1338
1350
|
border: 1px ${({theme:e,$isSelected:t,$isVirtual:n})=>t?`solid ${e.v2.colors.blue[300]}`:n?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
|
|
1339
1351
|
border-radius: 8px;
|
|
1340
1352
|
cursor: pointer;
|
|
1341
1353
|
opacity: ${({$isVirtual:e})=>e?.8:1};
|
|
1342
|
-
`,
|
|
1354
|
+
`,fb=b.div`
|
|
1343
1355
|
position: relative;
|
|
1344
|
-
`,
|
|
1356
|
+
`,bb=b.div`
|
|
1345
1357
|
position: absolute;
|
|
1346
1358
|
top: 100%;
|
|
1347
1359
|
left: 50%;
|
|
@@ -1350,7 +1362,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1350
1362
|
align-items: center;
|
|
1351
1363
|
gap: 4px;
|
|
1352
1364
|
margin-top: 4px;
|
|
1353
|
-
`,
|
|
1365
|
+
`,vb=f(({id:o,data:a})=>{const{icons:l,status:r,isVirtual:s}=a,c=v(),{activeNodeId:d,hoveredNodeId:p}=hb(),{isUserSource:u,isNodeSelected:h,isHovered:m}=i(()=>({isUserSource:o===Lp,isNodeSelected:d===o,isHovered:p===o}),[o,d,p,o]),{isSelected:g,isHighlighted:f}=i(()=>({isSelected:h||u,isHighlighted:h||m||u}),[h,m,u]),b=r?Pn(r,c):null;return e(n,{children:[t(Xr,{type:"source",position:Ur.Right,style:{visibility:"hidden"}}),t(Xr,{type:"target",position:Ur.Left,style:{visibility:"hidden"}}),e(fb,{"data-id":o,children:[t(gb,{$isSelected:g,$isVirtual:s,children:t(xn,{padding:12,icons:l,status:f?Pe.Info:r})}),e(bb,{children:[b&&t(b,{}),t(ee,{size:te.XXS,nowrap:!0,children:o})]})]})]})});vb.displayName=vb.name;const yb=b.div`
|
|
1354
1366
|
display: flex;
|
|
1355
1367
|
flex-direction: column;
|
|
1356
1368
|
gap: 12px;
|
|
@@ -1363,10 +1375,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1363
1375
|
top: 16px;
|
|
1364
1376
|
left: 8px;
|
|
1365
1377
|
z-index: ${({theme:e})=>e.v2.zIndex.drawer};
|
|
1366
|
-
`,
|
|
1378
|
+
`,Cb=({children:e})=>t(yb,{children:e});var Sb,xb;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(Sb||(Sb={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(xb||(xb={}));const wb=b.div`
|
|
1367
1379
|
flex: 1 1 auto;
|
|
1368
1380
|
min-height: 0;
|
|
1369
|
-
`,
|
|
1381
|
+
`,Tb=()=>{const{nodes:n,activeNodeId:o,resetActiveNode:a}=hb(),[r,s]=l(Sb.All),c=i(()=>{const e=new Map;for(const t of n)t.type===ib.MapItem&&e.set(t.id,t);return e},[n]),d=i(()=>c.get(o??""),[c,o]),{inbound:p,outbound:u}=i(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:xb.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:xb.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=[Sb.All,Sb.Inbound].includes(r)&&p.length>0,m=[Sb.All,Sb.Outbound].includes(r)&&u.length>0;return e(Cb,{children:[e(oe,{$width:"100%",$gap:8,children:[t(Te,{variant:Ie.Text,size:ke.S,leftIcon:cl,onClick:a}),t(xn,{icons:d.data.icons}),t(ee,{size:te.XS,children:d.id})]}),t(ve,{fullWidth:!0,options:[{label:`${Sb.All}`,value:Sb.All,badge:{label:`${p.length+u.length}`}},{label:`${Sb.Inbound}`,value:Sb.Inbound,badge:{label:`${p.length}`}},{label:`${Sb.Outbound}`,value:Sb.Outbound,badge:{label:`${u.length}`}}],selected:r,setSelected:s}),h&&t(Ib,{halfHeight:m,title:"Inbound",icon:bl,connections:p,mapNodesById:c}),m&&t(Ib,{halfHeight:h,title:"Outbound",icon:vl,connections:u,mapNodesById:c})]})},kb=b.div`
|
|
1370
1382
|
display: flex;
|
|
1371
1383
|
flex-direction: column;
|
|
1372
1384
|
gap: 8px;
|
|
@@ -1374,17 +1386,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1374
1386
|
border-radius: 12px;
|
|
1375
1387
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1376
1388
|
height: ${({$halfHeight:e})=>e?"48%":"100%"};
|
|
1377
|
-
`,
|
|
1389
|
+
`,Ib=({halfHeight:n,title:o,icon:i,connections:a,mapNodesById:l})=>{const r=v();return e(kb,{$halfHeight:n,children:[e(oe,{children:[t(i,{size:16,fill:r.v2.colors.grey[300]}),t(ee,{size:te.XXS,color:ne.Secondary,children:o})]}),t(wb,{children:t(bn,{gap:4,elements:a.map(e=>t(Nb,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},Eb=b.div`
|
|
1378
1390
|
display: flex;
|
|
1379
1391
|
align-items: center;
|
|
1380
1392
|
gap: 8px;
|
|
1381
1393
|
padding: 8px;
|
|
1382
1394
|
border-radius: 8px;
|
|
1383
1395
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1384
|
-
`,
|
|
1396
|
+
`,Nb=({connection:n,peerNode:o})=>e(Eb,{children:[o&&t(xn,{icons:o.data.icons}),e(oe,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(ee,{size:te.XXS,children:n.peerId}),t(ce,{label:n.totalRequests,tooltip:"Total requests"})]})]}),Ob="0;0.5;1",$b=f(({id:o,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=Vr({sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${o}__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(Hr,{id:o,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(jr,{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,o)=>{const i=`-${(.8*o).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:i,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Ob,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Ob,values:`${g};${f};${f}`})]},o)})]})})]})});$b.displayName=$b.name;const Ab=b.div`
|
|
1385
1397
|
flex: 1 1 auto;
|
|
1386
1398
|
min-height: 0;
|
|
1387
|
-
|
|
1399
|
+
`,Rb=({})=>{const{nodes:n,setNodesSelected:o,resetActiveNode:a}=hb(),[r,s]=l(""),c=i(()=>n.filter(e=>e.type===ib.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[n]),p=i(()=>c.filter(e=>e.data.selected),[c]),u=i(()=>c.filter(e=>e.id.toLowerCase().includes(r.toLowerCase())),[c,r]),h=i(()=>u.every(e=>e.data.selected),[u]),m=d(()=>{const e=!h;o(u.map(e=>e.id),e),e||a()},[u,h,o,a]);return c.length?e(Cb,{children:[e(oe,{$width:"100%",$gap:8,children:[t(ee,{size:te.XS,children:"Services"}),t(ce,{label:c.length})]}),t(fn,{width:"100%",value:r,onChange:s}),e(oe,{$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(Ab,{children:t(bn,{gap:4,elements:u.map(e=>t(_b,{node:e},e.id))})})]}):null},Db=b.div`
|
|
1388
1400
|
display: flex;
|
|
1389
1401
|
align-items: center;
|
|
1390
1402
|
gap: 8px;
|
|
@@ -1392,7 +1404,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1392
1404
|
border-radius: 8px;
|
|
1393
1405
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1394
1406
|
cursor: pointer;
|
|
1395
|
-
`,
|
|
1407
|
+
`,_b=({node:n})=>{const{setNodesSelected:o,activeNodeId:i,resetActiveNode:a}=hb(),l=d(()=>{const e=!n.data.selected,t=i===n.id;o([n.id],e),!e&&t&&a()},[n,i,o,a]);return e(Db,{onClick:l,children:[t(Q,{value:n.data.selected||!1,onChange:l}),t(xn,{icons:n.data.icons}),t(ee,{size:te.XXS,children:n.id})]},n.id)},Pb=b.div`
|
|
1396
1408
|
position: relative;
|
|
1397
1409
|
height: 100%;
|
|
1398
1410
|
.react-flow__attribution {
|
|
@@ -1401,7 +1413,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1401
1413
|
* {
|
|
1402
1414
|
transition: none;
|
|
1403
1415
|
}
|
|
1404
|
-
`,
|
|
1416
|
+
`,Lb=b.div`
|
|
1405
1417
|
.react-flow__controls {
|
|
1406
1418
|
display: flex;
|
|
1407
1419
|
align-items: center;
|
|
@@ -1427,33 +1439,33 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1427
1439
|
}
|
|
1428
1440
|
}
|
|
1429
1441
|
}
|
|
1430
|
-
`,
|
|
1442
|
+
`,Fb={[ib.MapItem]:vb,[ib.NoData]:ob},Mb={[ab.AnimatedTraffic]:$b},zb={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},Bb=({trigger:e})=>{const{fitView:t}=qr(),n=p(!0);return a(()=>{n.current?n.current=!1:e>0&&requestAnimationFrame(()=>t(zb))},[e,t]),null},Xb=({onRefresh:n})=>{const{nodes:o,edges:a,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=hb(),p=i(()=>{const e=new Set(o.filter(e=>e.type===ib.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 o.filter(e=>e.type!==ib.MapItem||e.data.selected||t.has(e.id))},[o,a]);return e(Wr,{zoomOnScroll:!0,nodes:p,nodeTypes:Fb,edges:a,edgeTypes:Mb,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(Kr,{}),t(Bb,{trigger:l}),t(Lb,{children:t(Yr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:zb,children:t(Jr,{onClick:n,children:t(pl,{})})})})]})},Ub=n=>t(Gr,{children:e(Pb,{children:[t(Xb,{...n}),t(Rb,{}),t(Tb,{})]})}),Vb=b.div`
|
|
1431
1443
|
width: 100%;
|
|
1432
1444
|
flex: 1;
|
|
1433
1445
|
align-self: stretch;
|
|
1434
1446
|
min-height: 0;
|
|
1435
1447
|
height: 100%;
|
|
1436
1448
|
position: relative;
|
|
1437
|
-
`,
|
|
1449
|
+
`,Hb=()=>{const{serviceMapApi:e}=Gl(),{data:n,refetch:o}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(mb,{serviceMap:n?.serviceMap??[],children:t(Vb,{children:t(Ub,{onRefresh:o})})})},jb=b.div`
|
|
1438
1450
|
display: flex;
|
|
1439
1451
|
align-items: center;
|
|
1440
1452
|
justify-content: space-between;
|
|
1441
1453
|
padding: 0 12px;
|
|
1442
|
-
`,
|
|
1454
|
+
`,Gb=b.div`
|
|
1443
1455
|
display: flex;
|
|
1444
1456
|
align-items: center;
|
|
1445
1457
|
gap: 8px;
|
|
1446
|
-
`,
|
|
1458
|
+
`,Wb=b.div`
|
|
1447
1459
|
width: 1px;
|
|
1448
1460
|
height: 20px;
|
|
1449
1461
|
background-color: ${({theme:e})=>e.v2.colors.silver[500]};
|
|
1450
|
-
`,
|
|
1462
|
+
`,Kb=({disabled:n,loading:o,onClickShowYaml:a,onClickReset:r,onClickRefresh:s})=>{const c=v(),[d,p]=l(!1),u=i(()=>a?[{id:bo(),type:gn.Button,buttonProps:{label:"Show Config YAML",leftIcon:Ul,size:ke.S,variant:Ie.Secondary,onClick:a,disabled:n}}]:[],[a,n]),h=i(()=>{const e=[];return s&&e.push({id:bo(),type:gn.Button,buttonProps:{leftIcon:pl,tooltip:"Refresh",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,onClick:s,disabled:n,loading:o}}),r&&e.push({id:bo(),type:gn.Button,buttonProps:{leftIcon:Ma,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,o,r,s,c]),m=u.length>0,g=h.length>0;return e(jb,{children:[t(ua,{icon:ul,title:"Odigos Settings"}),e(Gb,{children:[m&&t(ha,{actions:u}),m&&g&&t(Wb,{}),g&&t(ha,{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)}}})]})},Yb=b(ae)`
|
|
1451
1463
|
width: 220px;
|
|
1452
1464
|
flex-shrink: 0;
|
|
1453
1465
|
height: 100%;
|
|
1454
1466
|
gap: 4px;
|
|
1455
1467
|
overflow-y: auto;
|
|
1456
|
-
`,
|
|
1468
|
+
`,Jb=({options:e,selected:n,setSelected:o,disabled:i})=>t(Yb,{children:e.map(e=>t(is,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:n===e.id,disabled:i,onClick:()=>o(e.id)},e.id))}),qb=b(ae)`
|
|
1457
1469
|
width: 100%;
|
|
1458
1470
|
/* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
|
|
1459
1471
|
max-width: 844px;
|
|
@@ -1463,25 +1475,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1463
1475
|
gap: 24px;
|
|
1464
1476
|
flex: 1;
|
|
1465
1477
|
min-height: 0;
|
|
1466
|
-
`,
|
|
1478
|
+
`,Zb=b(oe)`
|
|
1467
1479
|
flex: 1;
|
|
1468
1480
|
min-height: 0;
|
|
1469
1481
|
width: 100%;
|
|
1470
1482
|
align-self: stretch;
|
|
1471
|
-
`,
|
|
1483
|
+
`,Qb=b(ae)`
|
|
1472
1484
|
flex: 1;
|
|
1473
1485
|
min-height: 0;
|
|
1474
1486
|
height: 100%;
|
|
1475
1487
|
max-width: 600px;
|
|
1476
1488
|
overflow-y: auto;
|
|
1477
|
-
`,
|
|
1489
|
+
`,ev=b(oe)`
|
|
1478
1490
|
gap: 8px;
|
|
1479
1491
|
width: 100%;
|
|
1480
1492
|
align-items: center;
|
|
1481
|
-
`,
|
|
1493
|
+
`,tv=b.div`
|
|
1482
1494
|
flex: 1;
|
|
1483
1495
|
min-width: 0;
|
|
1484
|
-
`,
|
|
1496
|
+
`,nv=e=>"general"===e.name?0:"advanced"===e.name?2:1,ov=({minSupportedVersion:o})=>{const{isVersionSupported:r,version:s,isEnterprise:c,minSupportedVersion:d}=S(o),{configApi:p}=Gl(),{data:u,loading:h}=p.useConfigYamls(),{data:m,loading:g,refetch:f}=p.useEffectiveConfig(),b=u?.configYamls??[],[v,y]=l(!1),C=i(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...n}=m;return n},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:I}=Jt(C);a(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const E=i(()=>[...b].sort((e,t)=>nv(e)-nv(t)),[b]),N=i(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(m?.provenance),[m?.provenance]),O=i(()=>{const e=new Set;for(const t of b)for(const n of t.fields)n.componentType===Ht.Dropdown&&e.add(n.helmValuePath);return e},[b]),$=i(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,R]=l(!1),[D,_]=l(!1),P=i(()=>[{id:bo(),type:gn.Button,buttonProps:{"data-id":"settings-save",variant:Ie.Primary,size:ke.S,label:"Save Changes",leftIcon:Za,loading:v,onClick:()=>R(!0)}},{id:bo(),type:gn.Button,buttonProps:{"data-id":"settings-cancel",variant:Ie.Secondary,size:ke.S,label:"Cancel",leftIcon:Qa,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=i(()=>E.map(e=>({id:e.name,label:e.displayName})),[E]),F=i(()=>E.map(e=>e.name),[E]),{selectedSection:M,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=Pa({sectionNames:F});return t(Vi,{$gap:24,children:e(qb,{children:[t(Kb,{disabled:!r,loading:h||g,onClickShowYaml:()=>_(!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(Pr,{minSupportedVersion:d,currentVersion:s||""}),t(Bn,{isOpen:I,richTitle:{icon:ul,title:"Config Settings"},actions:P}),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 o=t[n];o in e&&"object"==typeof e[o]&&null!==e[o]||(e[o]={}),e=e[o]}e[t[t.length-1]]=n},o=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let i=o;for(const e of t){if(null==i||"object"!=typeof i){i=void 0;break}i=i[e]}"string"==typeof i&&n(o,t,i.replaceAll("-","_"))}return o})(k(C,x),O);await(async e=>{p.updateLocalUiConfig&&(y(!0),await p.updateLocalUiConfig(e),y(!1),await f())})(e),w(void 0,void 0,{})})(),R(!1)}}}),e(Zb,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(Jb,{options:L,selected:M,setSelected:z,disabled:!r}),t(Qb,{ref:X,$gap:24,$width:"100%",children:b.length?E.map(o=>t(ut,{id:o.name,bordered:!0,ref:e=>B(o.name,e),customTitle:t(ee,{size:te.M,weight:500,color:ne.Primary,children:o.displayName}),children:t(ae,{$gap:24,children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!c)return null;if(o.renderCondition&&!Zt(o.renderCondition,[],$))return null;const i=kt(o.componentProps||"{}",{}),a=N[o.helmValuePath],l=o.componentType===Ht.Toggle,r=t(ee,{size:te.XS,weight:500,color:ne.Primary,children:o.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=o.description?t(ee,{size:te.XXS,color:ne.Secondary,children:o.description}):null,u=e(ae,{$gap:4,children:[e(oe,{$gap:8,$alignItems:"center",children:[r,d]}),p]}),h=t(Lr,{componentType:o.componentType,inputType:i.type,name:o.helmValuePath,disabled:o.isHelmOnly||v,value:T("formData",o.helmValuePath),setValue:e=>w(o.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Nt.S},o.helmValuePath),m=o.isHelmOnly?t(Ue,{text:"This field can only be updated via the Helm values.yaml file",children:t(Hl,{})}):null;return t(ae,{$gap:8,children:l?e(oe,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(oe,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(n,{children:[u,e(ev,{children:[t(tv,{children:h}),m]})]})},o.helmValuePath)})})},o.name)):h?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(ut,{richTitle:{icon:ul,title:"Config Settings"},children:t($e,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(zt,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:Ul,title:"Effective Config YAML",onClose:()=>_(!1)},children:g&&!m?.manifestYAML?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(Rr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},iv=b.div`
|
|
1485
1497
|
position: fixed;
|
|
1486
1498
|
bottom: 12px;
|
|
1487
1499
|
left: 12px;
|
|
@@ -1490,4 +1502,4 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1490
1502
|
flex-direction: column-reverse;
|
|
1491
1503
|
gap: 6px;
|
|
1492
1504
|
max-width: 600px;
|
|
1493
|
-
`,
|
|
1505
|
+
`,av=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:o}=tn(),i=e.filter(({dismissed:e})=>!e);return t(iv,{children:i.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=i.length-s;return t(_e,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{n(e),t&&o(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{qs as AddActionDrawer,Ns as AddActionForm,rm as AddDataStreamModal,rc as AddDestinationDrawer,$s as AddDestinationForm,sc as AddRuleDrawer,Ms as AddRuleForm,Tc as AddSourceDrawer,mg as CentralConnections,op as CloudConnectorStep,lp as CreateCloudConnectorDrawer,rg as CreateNewType,Bs as DataStreamForm,zs as DataStreamMergeWarning,cp as EditActionDrawer,dp as EditConfigDrawer,sm as EditDataStreamModal,up as EditDestinationDrawer,mp as EditRuleDrawer,zh as EditSourceDrawer,Xs as EditSourceForm,Ng as Onboarding,pm as OnboardingDone,Pf as Overview,Kf as PipelineCollectors,mr as RegexTesterDrawer,ag as SamplingOnboardingModal,qh as SamplingRuleDrawer,Ws as SamplingRuleForm,tb as SamplingRules,Hb as ServiceMap,ov as Settings,lm as SystemDrawer,Wf as TABS,av as ToastList};
|