@odigos/ui-kit 0.0.284 → 0.0.286-dev.520
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 +28 -0
- package/docs/api-context.md +1 -1
- package/lib/chunks/{helpers-DqYXvhEu.js → helpers-B0SJ6hqm.js} +2 -2
- package/lib/chunks/index-9H2LDuOq.js +311 -0
- package/lib/chunks/source-instrument-form-context-BF70uJ_R.js +5 -0
- package/lib/chunks/ui-components-DqG0z5U0.js +1878 -0
- package/lib/components/_cards/data-card/index.d.ts +6 -1
- package/lib/components/_cards/text-card/index.d.ts +3 -0
- package/lib/components/drawer/header/index.d.ts +2 -0
- package/lib/components/hover-actions/index.d.ts +1 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/info-row/index.d.ts +11 -0
- package/lib/components/input/index.d.ts +2 -0
- package/lib/components/table/index.d.ts +10 -0
- package/lib/components/table/styled.d.ts +11 -0
- package/lib/components/table/table-rows/index.d.ts +6 -1
- package/lib/components/table/types.d.ts +11 -2
- package/lib/components/trace-view/index.d.ts +4 -0
- package/lib/components/trace-view/styled.d.ts +43 -0
- package/lib/components/trace-view/types.d.ts +46 -0
- package/lib/components.js +1 -1
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/recommendations/index.d.ts +31 -0
- package/lib/constants/strings/index.d.ts +3 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_drawers/edit-source-drawer/overview/runtime-card.d.ts +5 -2
- package/lib/containers/_drawers/edit-source-drawer/pods/containers-card/process-card.d.ts +1 -7
- package/lib/containers/_drawers/index.d.ts +1 -0
- package/lib/containers/_drawers/recommendations-drawer/helpers.d.ts +22 -0
- package/lib/containers/_drawers/recommendations-drawer/index.d.ts +9 -0
- package/lib/containers/_drawers/recommendations-drawer/manual-examples.d.ts +6 -0
- package/lib/containers/_drawers/recommendations-drawer/recommendation-card.d.ts +13 -0
- package/lib/containers/_drawers/recommendations-drawer/remediation-actions.d.ts +9 -0
- package/lib/containers/_drawers/recommendations-drawer/remediation-methods.d.ts +13 -0
- package/lib/containers/index.d.ts +1 -0
- package/lib/containers/insights/consts.d.ts +6 -0
- package/lib/containers/insights/findings/drawer/anomaly/anomaly-blast-radius/animated-edge.d.ts +10 -0
- package/lib/containers/insights/findings/drawer/anomaly/anomaly-blast-radius/blast-radius-node.d.ts +6 -0
- package/lib/containers/insights/findings/drawer/anomaly/anomaly-blast-radius/helpers.d.ts +28 -0
- package/lib/containers/insights/findings/drawer/anomaly/anomaly-blast-radius/index.d.ts +7 -0
- package/lib/containers/insights/findings/drawer/anomaly/anomaly-blast-radius/types.d.ts +19 -0
- package/lib/containers/insights/findings/drawer/anomaly/anomaly-trace-compare/helpers.d.ts +15 -0
- package/lib/containers/insights/findings/drawer/anomaly/anomaly-trace-compare/index.d.ts +7 -0
- package/lib/containers/insights/findings/drawer/anomaly/index.d.ts +15 -0
- package/lib/containers/insights/findings/drawer/anomaly/why-this-fired/index.d.ts +6 -0
- package/lib/containers/insights/findings/drawer/helpers.d.ts +11 -0
- package/lib/containers/insights/findings/drawer/index.d.ts +6 -0
- package/lib/containers/insights/findings/drawer/violation/index.d.ts +6 -0
- package/lib/containers/insights/findings/drawer/violation/violation-trace-view/index.d.ts +8 -0
- package/lib/containers/insights/findings/helpers.d.ts +47 -0
- package/lib/containers/insights/findings/index.d.ts +2 -0
- package/lib/containers/insights/index.d.ts +6 -0
- package/lib/containers/insights/insights-context.d.ts +44 -0
- package/lib/containers/insights/overview/contained-table-and-heading/index.d.ts +18 -0
- package/lib/containers/insights/overview/index.d.ts +6 -0
- package/lib/containers/insights/settings-and-configurations/constants.d.ts +16 -0
- package/lib/containers/insights/settings-and-configurations/content-panel/index.d.ts +11 -0
- package/lib/containers/insights/settings-and-configurations/index.d.ts +2 -0
- package/lib/containers/insights/settings-and-configurations/menu-config.d.ts +24 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/constants.d.ts +40 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/create-override-panel.d.ts +14 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/index.d.ts +2 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/mappers.d.ts +12 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/mock.d.ts +4 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/policies-menu.d.ts +10 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/policy-editor.d.ts +8 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/policy-list-item.d.ts +8 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/risk-levels.d.ts +15 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/risk-model-drawer/constants.d.ts +16 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/risk-model-drawer/default-catalog.d.ts +3 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/risk-model-drawer/helpers.d.ts +30 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/risk-model-drawer/index.d.ts +10 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/signal-weights-panel.d.ts +13 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/signal-weights.d.ts +17 -0
- package/lib/containers/insights/settings-and-configurations/panels/detection/types.d.ts +29 -0
- package/lib/containers/insights/settings-and-configurations/panels/guardrails/constants.d.ts +35 -0
- package/lib/containers/insights/settings-and-configurations/panels/guardrails/create-panel.d.ts +17 -0
- package/lib/containers/insights/settings-and-configurations/panels/guardrails/edit-panel.d.ts +10 -0
- package/lib/containers/insights/settings-and-configurations/panels/guardrails/facet-section.d.ts +13 -0
- package/lib/containers/insights/settings-and-configurations/panels/guardrails/guardrail-list-item.d.ts +8 -0
- package/lib/containers/insights/settings-and-configurations/panels/guardrails/guardrails-menu.d.ts +9 -0
- package/lib/containers/insights/settings-and-configurations/panels/guardrails/index.d.ts +2 -0
- package/lib/containers/insights/settings-and-configurations/panels/guardrails/mappers.d.ts +18 -0
- package/lib/containers/insights/settings-and-configurations/panels/guardrails/types.d.ts +10 -0
- package/lib/containers/insights/settings-and-configurations/panels/learning/constants.d.ts +82 -0
- package/lib/containers/insights/settings-and-configurations/panels/learning/create-override-panel.d.ts +21 -0
- package/lib/containers/insights/settings-and-configurations/panels/learning/index.d.ts +2 -0
- package/lib/containers/insights/settings-and-configurations/panels/learning/mappers.d.ts +38 -0
- package/lib/containers/insights/settings-and-configurations/panels/learning/policies-menu.d.ts +10 -0
- package/lib/containers/insights/settings-and-configurations/panels/learning/policy-editor.d.ts +9 -0
- package/lib/containers/insights/settings-and-configurations/panels/learning/policy-list-item.d.ts +8 -0
- package/lib/containers/insights/settings-and-configurations/panels/learning/types.d.ts +31 -0
- package/lib/containers/insights/settings-and-configurations/panels/storage/constants.d.ts +52 -0
- package/lib/containers/insights/settings-and-configurations/panels/storage/formatters.d.ts +5 -0
- package/lib/containers/insights/settings-and-configurations/panels/storage/index.d.ts +2 -0
- package/lib/containers/insights/settings-and-configurations/panels/storage/layout.d.ts +18 -0
- package/lib/containers/insights/settings-and-configurations/panels/storage/mappers.d.ts +27 -0
- package/lib/containers/insights/settings-and-configurations/panels/system/constants.d.ts +31 -0
- package/lib/containers/insights/settings-and-configurations/panels/system/index.d.ts +2 -0
- package/lib/containers/insights/settings-and-configurations/settings-menu/category-header.d.ts +8 -0
- package/lib/containers/insights/settings-and-configurations/settings-menu/index.d.ts +7 -0
- package/lib/containers/insights/transactions/drawer/baselines/helpers.d.ts +16 -0
- package/lib/containers/insights/transactions/drawer/baselines/index.d.ts +5 -0
- package/lib/containers/insights/transactions/drawer/index.d.ts +2 -0
- package/lib/containers/insights/transactions/drawer/observations/helpers.d.ts +11 -0
- package/lib/containers/insights/transactions/drawer/observations/index.d.ts +5 -0
- package/lib/containers/insights/transactions/helpers.d.ts +35 -0
- package/lib/containers/insights/transactions/index.d.ts +2 -0
- package/lib/containers/overview/search/builder.d.ts +3 -1
- package/lib/containers.js +1436 -248
- package/lib/contexts/odigos-api/capabilities.d.ts +5 -0
- package/lib/contexts/odigos-api/hooks/use-actions-api.d.ts +3 -1
- package/lib/contexts/odigos-api/hooks/use-insights-api.d.ts +153 -0
- package/lib/contexts/odigos-api/hooks/use-recommendations-api.d.ts +32 -0
- package/lib/contexts/odigos-api/index.d.ts +3 -1
- package/lib/contexts/odigos-api/internal/notify.d.ts +4 -3
- package/lib/contexts/odigos-api/types.d.ts +223 -1
- package/lib/contexts/odigos-api/use-odigos-api.d.ts +4 -0
- package/lib/contexts.js +1 -1
- package/lib/functions/index.d.ts +1 -0
- package/lib/functions/parse-raw-otlp/index.d.ts +43 -0
- package/lib/functions.js +1 -1
- package/lib/hooks/useCopy.d.ts +2 -3
- package/lib/hooks/useTimeAgo.d.ts +4 -0
- package/lib/hooks.js +1 -1
- package/lib/icons/common/index.d.ts +4 -0
- package/lib/icons/common/insights-findings-icon/index.d.ts +2 -0
- package/lib/icons/common/insights-transactions-icon/index.d.ts +2 -0
- package/lib/icons/common/recommendations-icon/index.d.ts +2 -0
- package/lib/icons/common/threat-detection-icon/index.d.ts +2 -0
- package/lib/icons/overview/index.d.ts +1 -0
- package/lib/icons/overview/insights-icon/index.d.ts +2 -0
- package/lib/icons.js +1 -1
- package/lib/snippets/animated-collapse/index.d.ts +10 -0
- package/lib/snippets/code-modal/index.d.ts +9 -0
- package/lib/snippets/index.d.ts +2 -0
- package/lib/snippets/rich-title/index.d.ts +4 -1
- package/lib/snippets/trace-modal/index.d.ts +8 -0
- package/lib/snippets/yaml-section-card/index.d.ts +1 -0
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme/palettes/index.d.ts +7 -1
- package/lib/theme.js +1 -1
- package/lib/types/common/index.d.ts +4 -1
- package/lib/types/destinations/index.d.ts +1 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/insights/index.d.ts +598 -0
- package/lib/types/recommendations.d.ts +73 -0
- package/lib/types/workload/index.d.ts +14 -0
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-DxXpZafj.js +0 -257
- package/lib/chunks/source-instrument-form-context-BPXm6ufr.js +0 -5
- package/lib/chunks/ui-components-M0c3qdR2.js +0 -1601
package/lib/containers.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMemo as a,useEffect as o,useState as r,Fragment as l,forwardRef as s,useImperativeHandle as c,useCallback as d,useRef as p,Children as u,createContext as h,useContext as g,useLayoutEffect as m,memo as b}from"react";import f,{useTheme as v,css as y,keyframes as S}from"styled-components";import{u as x,n as C,C as w,g as k,f as T,e as $,q as I,h as N,j as O,k as A,p as E,l as D,c as R,r as L,S as P,s as M,R as z,t as X,w as _,o as F,x as B,y as V,z as U,A as j,B as H,D as G,E as K,F as W,G as Y,H as q,I as J,J as Z}from"./chunks/helpers-B0SJ6hqm.js";import{w as Q,e as ee,g as te,f as ie,h as ne,bG as ae,F as oe,bH as re,bI as le,bJ as se,bK as ce,bw as de,d as pe,k as ue,z as he,bL as ge,q as me,r as be,G as fe,a2 as ve,bM as ye,bN as Se,ay as xe,bO as Ce,bP as we,B as ke,i as Te,j as $e,H as Ie,aa as Ne,bx as Oe,N as Ae,bQ as Ee,y as De,K as Re,S as Le,bR as Pe,bC as Me,bD as ze,bB as Xe,bS as _e,am as Fe,T as Be,ak as Ve,al as Ue,ai as je,ah as He,aj as Ge,ag as Ke,bb as We,af as Ye,bT as qe,bU as Je,bV as Ze,bW as Qe,bX as et,W as tt,o as it,bf as nt,bY as at,bZ as ot,b_ as rt,b$ as lt,c0 as st,c1 as ct,c2 as dt,c3 as pt,a0 as ut,c4 as ht,c5 as gt,c6 as mt,b6 as bt,bA as ft,x as vt,I as yt,l as St,b7 as xt,c7 as Ct,c8 as wt,b3 as kt,E as Tt,bE as $t,be as It,s as Nt,c9 as Ot,bg as At,ca as Et,cb as Dt,bi as Rt,cc as Lt,u as Pt,cd as Mt,n as zt,ac as Xt,J as _t,D as Ft,ce as Bt,an as Vt,cf as Ut,cg as jt,p as Ht,m as Gt,bm as Kt,bv as Wt,ch as Yt,ci as qt,bu as Jt,cj as Zt,a9 as Qt,ck as ei,cl as ti,ba as ii,Q as ni,cm as ai,cn as oi,co as ri,cp as li,cq as si,cr as ci,cs as di,ct as pi,cu as ui,cv as hi,$ as gi,cw as mi,cx as bi,A as fi,b8 as vi,b5 as yi,cy as Si,cz as xi,cA as Ci,cB as wi,cC as ki,cD as Ti,bF as $i,cE as Ii,cF as Ni,cG as Oi,cH as Ai,cI as Ei,b as Di,cJ as Ri,cK as Li,_ as Pi,cL as Mi,cM as zi,cN as Xi,cO as _i,cP as Fi,cQ as Bi,cR as Vi,cS as Ui,cT as ji,cU as Hi,cV as Gi,cW as Ki,cX as Wi,cY as Yi,cZ as qi,c_ as Ji,c$ as Zi,d0 as Qi,d1 as en,d2 as tn,d3 as nn,d4 as an,d5 as on,d6 as rn,d7 as ln,d8 as sn,d9 as cn,da as dn,db as pn,dc as un,dd as hn,de as gn,df as mn,dg as bn,dh as fn,di as vn,dj as yn,dk as Sn,dl as xn,dm as Cn,dn as wn,dp as kn,dq as Tn,dr as $n,ds as In,aV as Nn,dt as On,du as An,dv as En,dw as Dn,dx as Rn,dy as Ln,dz as Pn,dA as Mn,dB as zn,dC as Xn,dD as _n,dE as Fn,dF as Bn,dG as Vn,dH as Un,aE as jn,dI as Hn,dJ as Gn,b9 as Kn,M as Wn,dK as Yn,dL as qn,dM as Jn,dN as Zn,dO as Qn,dP as ea,dQ as ta,dR as ia,dS as na,dT as aa,dU as oa,dV as ra,dW as la,dX as sa,dY as ca,dZ as da,d_ as pa,d$ as ua,e0 as ha,e1 as ga,e2 as ma,e3 as ba,e4 as fa,e5 as va,e6 as ya,e7 as Sa,e8 as xa,e9 as Ca,ea as wa,eb as ka,ec as Ta,ed as $a,ee as Ia,ef as Na,eg as Oa,eh as Aa,ei as Ea,ej as Da,ek as Ra,el as La,em as Pa,en as Ma,eo as za,ep as Xa,eq as _a,er as Fa,es as Ba,et as Va,eu as Ua,ev as ja,ew as Ha,ex as Ga,ey as Ka,ez as Wa,eA as Ya,eB as qa,eC as Ja,eD as Za,eE as Qa,eF as eo,eG as to,eH as io,eI as no,eJ as ao,eK as oo,eL as ro,eM as lo,eN as so,eO as co,eP as po,eQ as uo,eR as ho,eS as go,eT as mo,eU as bo,eV as fo,P as vo,eW as yo,eX as So,R as xo,a as Co,eY as wo,eZ as ko,e_ as To,e$ as $o,f0 as Io,f1 as No,f2 as Oo,f3 as Ao,f4 as Eo,f5 as Do,f6 as Ro,f7 as Lo,f8 as Po,f9 as Mo,fa as zo,a5 as Xo,fb as _o,fc as Fo,fd as Bo,fe as Vo,ff as Uo,fg as jo,fh as Ho,fi as Go,fj as Ko,fk as Wo,b4 as Yo,fl as qo,fm as Jo,fn as Zo,fo as Qo,fp as er,fq as tr,fr as ir,fs as nr,ft as ar,fu as or,fv as rr,fw as lr,fx as sr,bh as cr,fy as dr,fz as pr,fA as ur,fB as hr,fC as gr,fD as mr,fE as br,fF as fr,fG as vr,fH as yr,fI as Sr,fJ as xr,fK as Cr,fL as wr,fM as kr,fN as Tr,fO as $r,fP as Ir,fQ as Nr,fR as Or}from"./chunks/ui-components-DqG0z5U0.js";import{ChevronRightIcon as Ar,ActionIcon as Er,TrashIcon as Dr,PlusIcon as Rr,ArrowRightIcon as Lr,BookIcon as Pr,DeleteIcon as Mr,EditIcon as zr,GoLogo as Xr,JavaLogo as _r,PhpLogo as Fr,VSquareIcon as Br,XSquareIcon as Vr,DestinationIcon as Ur,ChevronUpIcon as jr,ChevronDownIcon as Hr,VIcon as Gr,XIcon as Kr,InstrumentationRuleIcon as Wr,SourceIcon as Yr,NamespacesIcon as qr,AzureIcon as Jr,GoogleCloudPlatformLogo as Zr,AwsLogo as Qr,CloudConnectorIcon as el,EyeOpenIcon as tl,OdigosLogo as il,ArrowLeftIcon as nl,ISquareIcon as al,RefreshIcon as ol,SettingsIcon as rl,PodIcon as ll,K8sLogo as sl,ExclamationCircleIcon as cl,QuestionCircleIcon as dl,InboundIcon as pl,OutboundIcon as ul,UserIcon as hl,TerminalIcon as gl,RefreshLeftArrowIcon as ml,MinusIcon as bl,SearchIcon as fl,ExpandIcon as vl,CopyIcon as yl,DotIcon as Sl,ArrowDownIcon as xl,DownloadIcon as Cl,MetricsIcon as wl,EnrichmentIcon as kl,NormalizationIcon as Tl,SamplingIcon as $l,RecommendationsIcon as Il,ExclamationTriangleIcon as Nl,KeyIcon as Ol,DiagnoseIcon as Al,StarIcon as El,ArrowIcon as Dl,ConnectionsIcon as Rl,InsightsFindingsIcon as Ll,InsightsTransactionsIcon as Pl,HomeIcon as Ml,ThreatDetectionIcon as zl,PrivacyIcon as Xl,NotificationIcon as _l,FolderIcon as Fl,FilterIcon as Bl,DataStreamIcon as Vl,PipelineCollectorIcon as Ul,ArrowDownSquareIcon as jl,ArrowUpSquareIcon as Hl,GatewayIcon as Gl,YamlIcon as Kl,ImageErrorIcon as Wl,LockIcon as Yl}from"./icons.js";import{o as ql,g as Jl,E as Zl,l as Ql,I as es,m as ts,p as is,j as ns,P as as,S as os,R as rs,h as ls,k as ss,d as cs,i as ds,n as ps,W as us,C as hs,c as gs,Y as ms,A as bs,O as fs,b as vs,U as ys,a as Ss,f as xs}from"./chunks/index-9H2LDuOq.js";import{h as Cs,o as ws,n as ks,q as Ts,m as $s,t as Is,s as Ns,S as Os,w as As,E as Es,x as Ds,y as Rs,v as Ls,l as Ps,d as Ms,C as zs,O as Xs,f as _s,b as Fs,R as Bs,A as Vs,e as Us,D as js}from"./chunks/source-instrument-form-context-BF70uJ_R.js";import"@xyflow/react/dist/style.css";import{Handle as Hs,Position as Gs,getSmoothStepPath as Ks,BaseEdge as Ws,EdgeLabelRenderer as Ys,MarkerType as qs,ReactFlowProvider as Js,useNodesState as Zs,useEdgesState as Qs,ReactFlow as ec,Background as tc,useReactFlow as ic,Controls as nc,ControlButton as ac}from"@xyflow/react";import{createPortal as oc}from"react-dom";import rc from"elkjs/lib/elk.bundled.js";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 lc=f.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: space-between;
|
|
5
5
|
gap: 12px;
|
|
6
6
|
padding: 8px 12px;
|
|
7
7
|
border-radius: 12px;
|
|
8
|
-
background-color: ${({$isSelected:e,$purpleColors:t,theme:
|
|
8
|
+
background-color: ${({$isSelected:e,$purpleColors:t,theme:i})=>e?t?i.v2.colors.purple[800]:i.v2.colors.silver[600]:t?i.v2.colors.purple[900]:"transparent"};
|
|
9
9
|
cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
|
|
10
10
|
opacity: ${({$disabled:e})=>e?.5:1};
|
|
11
11
|
&:hover {
|
|
12
|
-
background-color: ${({$isSelected:e,$purpleColors:t,theme:
|
|
12
|
+
background-color: ${({$isSelected:e,$purpleColors:t,theme:i})=>i.v2.colors[t?"purple":"silver"][e?"700":"800"]};
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,sc=f.div`
|
|
15
15
|
display: flex;
|
|
16
16
|
align-items: center;
|
|
17
17
|
justify-content: center;
|
|
18
18
|
padding: 8px;
|
|
19
19
|
border-radius: 8px;
|
|
20
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
21
|
-
`,
|
|
20
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+ae["004"]};
|
|
21
|
+
`,cc=f(ne)`
|
|
22
22
|
flex: 1;
|
|
23
23
|
min-width: 0;
|
|
24
|
-
`,
|
|
24
|
+
`,dc=f(oe)`
|
|
25
25
|
flex: 1;
|
|
26
26
|
min-width: 0;
|
|
27
|
-
`,
|
|
27
|
+
`,pc=f(ne)`
|
|
28
28
|
flex-shrink: 0;
|
|
29
|
-
`,
|
|
29
|
+
`,uc=({dataId:i,icon:n,title:a,description:o,withCarret:r,purpleColors:l,disabled:s,children:c,isSelected:d,onClick:p,isChecked:u,isPartiallyChecked:h,onCheckboxChange:g})=>e(lc,{"data-id":i||`list-item-${a}`,$isSelected:d,$purpleColors:l,$disabled:s,onClick:()=>!d&&!s&&p(),children:[e(cc,{$gap:12,children:[g&&t(Q,{partiallyChecked:h||!1,value:u||!1,onChange:e=>g(e)}),n&&t(sc,{children:t(n,{size:20})}),e(dc,{$gap:4,children:[t(ee,{size:te.XS,nowrap:!0,children:a}),o&&t(ee,{size:te.XXXS,color:ie.Secondary,nowrap:!0,children:o})]})]}),(r||c)&&e(pc,{$gap:8,children:[c,r&&t(Ar,{size:18})]})]}),hc="other",gc={...se,[hc]:{TITLE:"Other",ICON:Er}},mc=f(ne)`
|
|
30
30
|
padding: 8px 12px 4px 12px;
|
|
31
|
-
`,
|
|
31
|
+
`,bc=({bucket:i,options:n,selectedType:a,onSelectOption:o})=>{const r=v(),{TITLE:l,ICON:s}=gc[i],c=r.v2.colors.purple[200];return e("div",{"data-id":`action-category-${i}`,children:[e(mc,{$gap:8,children:[t(s,{fill:c}),t(ee,{size:te.XXS,color:c,children:l}),t(ce,{label:n.length})]}),n.map(e=>t(uc,{dataId:e.type?`option-${e.type}`:void 0,icon:e.icon,title:e.label,description:e.subtitle||e.description,withCarret:!0,isSelected:a===e.type,onClick:()=>o(e)},e.type))]})},fc=[{id:"CREDIT_CARD",label:"Credit card"}],vc=[{id:de.CollectContainerAttributes,label:"Collect container attributes"},{id:de.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:de.CollectWorkloadId,label:"Collect workload ID"},{id:de.CollectClusterId,label:"Collect cluster ID"}],yc=[{id:ge.Pod,label:ge.Pod},{id:ge.Namespace,label:ge.Namespace},{id:ge.Node,label:ge.Node}],Sc=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:yc}],xc=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:yc}],Cc=de.ExtractAttribute;var wc;(e=>{e.Preset="preset",e.Regex="regex"})(wc||(wc={}));const kc=[Se.JSON,Se.SQL,Se.ResourcePath],Tc=(e=Se.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),$c=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,Ic=f.div`
|
|
32
32
|
width: 100%;
|
|
33
33
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
34
34
|
border-radius: 8px;
|
|
@@ -36,13 +36,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-direction: column;
|
|
38
38
|
gap: 8px;
|
|
39
|
-
`,
|
|
39
|
+
`,Nc=f.div`
|
|
40
40
|
flex: 1;
|
|
41
41
|
min-width: 0;
|
|
42
|
-
`,
|
|
42
|
+
`,Oc=f.div`
|
|
43
43
|
/* Pushes the arrow down to sit next to the inputs rather than the field titles. */
|
|
44
44
|
padding-top: 24px;
|
|
45
|
-
`,
|
|
45
|
+
`,Ac=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Ec=e=>{const t={};return e.forEach(({oldKey:e,newKey:i})=>{t[e]=i}),t},Dc=de.UrlTemplatizationRulesGroups,Rc=[{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"}],Lc={[Oe.K8sAttributes]:({value:n,setValue:a,formErrors:r})=>(o(()=>{n[de.CollectContainerAttributes]||n[de.CollectReplicaSetAttributes]||n[de.CollectWorkloadId]||n[de.CollectClusterId]||n[de.LabelsAttributes]?.length||n[de.AnnotationsAttributes]?.length||(a(de.CollectContainerAttributes,!0),a(de.CollectReplicaSetAttributes,!0),a(de.CollectWorkloadId,!0),a(de.CollectClusterId,!0),a(de.LabelsAttributes,[]),a(de.AnnotationsAttributes,[]))},[]),e(i,{children:[t(oe,{$gap:6,children:vc.map(({id:i,label:o})=>e(oe,{children:[t(Q,{label:o,value:n[i]||!1,onChange:e=>a(i,e)}),t(ue,{errorMessage:r[i]})]},i))}),t(he,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Sc,values:n[de.LabelsAttributes]||[],setValues:e=>a(de.LabelsAttributes,e),errorMessage:r[de.LabelsAttributes]}),t(he,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:xc,values:n[de.AnnotationsAttributes]||[],setValues:e=>a(de.AnnotationsAttributes,e),errorMessage:r[de.AnnotationsAttributes]})]})),[Oe.AddClusterInfo]:({value:n,setValue:a,formErrors:o})=>{const r=v();return e(i,{children:[t(me,{label:"Overwrite existing values",labelAlign:be.Left,labelColor:r.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[de.OverwriteExistingValues]||!1,onChange:e=>a(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:n[de.ClusterAttributes]||[],setValues:e=>a(de.ClusterAttributes,e),errorMessage:o[de.ClusterAttributes]})]})},[Oe.DeleteAttributes]:({value:e,setValue:i,formErrors:n})=>t(fe,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[de.AttributeNamesToDelete]||[],setValues:e=>i(de.AttributeNamesToDelete,e),errorMessage:n[de.AttributeNamesToDelete]}),[Oe.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=e[de.Renames],[l,s]=r(()=>Ac(a));return o(()=>{((e,t)=>{const i=Object.keys(e),n=Object.keys(t);return i.length===n.length&&i.every(i=>Object.prototype.hasOwnProperty.call(t,i)&&t[i]===e[i])})(Ec(l),a||{})||s(Ac(a))},[a]),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:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),i(de.Renames,Ec(t))},errorMessage:n[de.Renames]})},[Oe.PiiMasking]:({value:i,setValue:n,formErrors:a})=>(o(()=>{i[de.PiiCategories]?.length||n(de.PiiCategories,fc.map(({id:e})=>e))},[]),e(oe,{$gap:12,children:[t(pe,{label:"Attributes to mask"}),t(oe,{$gap:6,children:fc.map(({id:e,label:a})=>t(Q,{label:a,value:i[de.PiiCategories]?.includes(e)||!1,onChange:t=>{const a=i[de.PiiCategories]||[],o=t?[...a,e]:a.filter(t=>t!==e);n(de.PiiCategories,o)}},e))}),t(ue,{errorMessage:a[de.PiiCategories]})]})),[Oe.URLTemplatization]:({value:n,setValue:a,formErrors:o})=>{const r=v(),s=n[Dc]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(Dc,e),d=(e,t)=>c(s.map((i,n)=>n===e?{...i,...t}:i));return e(i,{children:[s.map((i,n)=>e(l,{children:[t(Ne,{}),e(oe,{$gap:12,children:[e(ne,{$justifyContent:"space-between",$alignItems:"center",children:[t(pe,{label:`Rule Group ${n+1}`}),t(ke,{leftIcon:()=>t(Dr,{fill:r.v2.colors.red[500]}),variant:$e.Secondary,size:Te.S,onClick:()=>{return e=n,c(s.filter((t,i)=>i!==e));var e},disabled:1===s.length})]}),t(Ie,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:i.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(he,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Rc,values:i.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(fe,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:i.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ue,{errorMessage:o[Dc]})]},`url-templatization-group-${n}`)),t(ke,{variant:$e.Secondary,label:"Add rule group",leftIcon:Rr,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ne,{})]})},[Oe.ExtractAttribute]:({value:i,setValue:n,formErrors:a})=>{const l=v(),s=a[Cc],c=i[Cc]?.extractions||[],[d,p]=r(()=>(e=>e.length&&e.some($c)?wc.Regex:wc.Preset)(c)),[u,h]=r(null),g=e=>n(Cc,{extractions:e});o(()=>{0===c.length&&g([d===wc.Preset?Tc():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const m=(e,t)=>{g(c.map((i,n)=>n===e?{...i,...t}:i))},b=()=>{g([...c,d===wc.Preset?Tc():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},f=d===wc.Preset,y=c.length?c:[f?Tc():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],S=null!=u&&y[u]?.regex||"";return e(oe,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:wc.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:wc.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),g([e===wc.Preset?Tc():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(oe,{$gap:8,$width:"100%",children:[y.map((i,n)=>{const a=n===y.length-1,o=i.dataFormat||Se.JSON,r=Ce[o];return e(Ic,{"data-id":`extract-row-${n}`,children:[e(ne,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(oe,{$gap:10,children:[t(pe,{label:f?ye.PRESET_ROW_TITLE(n):ye.REGEX_ROW_TITLE(n)}),f&&t(ne,{$gap:24,children:kc.map(e=>t(xe,{"data-id":`extract-row-${n}-fmt-${e}`,size:we.L,label:Ce[e].label,value:o===e,onChange:t=>t&&m(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(ne,{$gap:4,$alignItems:"center",children:[!f&&t(ke,{"data-id":`extract-row-${n}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:$e.Secondary,size:Te.S,onClick:()=>h(n),disabled:!i.regex?.trim()}),t(ke,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(Dr,{fill:l.v2.colors.red[500]}),variant:$e.Secondary,size:Te.S,onClick:()=>(e=>{const t=c.filter((t,i)=>i!==e);g(t.length?t:[d===wc.Preset?Tc():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),a&&t(ke,{"data-id":`extract-row-${n}-add`,leftIcon:Rr,variant:$e.Secondary,size:Te.S,onClick:b})]})]}),f?e(ne,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Nc,{children:t(Ie,{name:`extract-row-${n}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:i.lookupKey||"",onChange:e=>m(n,{lookupKey:e.target.value})})}),t(Oc,{children:t(Lr,{size:24,fill:l.v2.colors.silver[200]})}),t(Nc,{children:t(Ie,{name:`extract-row-${n}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:i.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})})]}):e(oe,{$gap:12,$width:"100%",children:[t(Ie,{name:`extract-row-${n}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:i.regex||"",onChange:e=>m(n,{regex:e.target.value})}),t(Ie,{name:`extract-row-${n}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:i.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(ue,{errorMessage:s})]}),t(ql,{isOpen:null!=u,regex:S,onClose:()=>h(null)})]})},[Oe.DbQueryTemplatization]:null,[Oe.InferDbAttributes]:null},Pc=({actionType:e,value:i,setValue:n,formErrors:a,dynamicFields:o,signals:r,sourceOptions:l,namespaceOptions:s})=>{if(!e)return null;if(o?.length)return t(Jl,{fields:o,value:i||{},setValue:n,formErrors:a||{},signals:r||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:l,namespaceOptions:s},e);const c=Lc[e];return c?t(c,{value:i,setValue:n,formErrors:a}):null},Mc=()=>{const{selectedOption:i,genericForm:n,sourceOptions:a,namespaceOptions:o}=Cs();if(!n||!i)return t(Ae,{title:"No active form"});const{formData:r,handleFormChange:l,formErrors:s}=n;return e(oe,{$gap:24,children:[e(ne,{$gap:12,$justifyContent:"space-between",children:[t(Ee,{size:te.XXXS,maxLines:2,children:i.description}),e(ne,{$gap:12,children:[t(Zl,{isEnabled:!r.disabled,setIsEnabled:e=>l("disabled",!e)}),t(ke,{leftIcon:Pr,variant:$e.Secondary,size:Te.S,onClick:()=>i.docsUrl&&window.open(i.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Ql,{title:"Signals for processing",allowedSignals:i.allowedSignals,selectedSignals:r.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(Ie,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:r.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(Pc,{actionType:i.type,dynamicFields:i.fields,signals:r.signals||[],value:r.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s,sourceOptions:a,namespaceOptions:o}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},zc=f(ne)`
|
|
46
46
|
position: sticky;
|
|
47
47
|
bottom: 4px;
|
|
48
48
|
align-self: center;
|
|
@@ -53,30 +53,30 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{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
|
-
`,Ls=s(({isEdit:n},i)=>{const o=v(),{isK8s:r}=S(),{destinationsApi:s}=Sr(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=xr(),[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(ze(p.formData));return y(e),e};return c(i,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,s]),p&&d?e(ae,{$gap:24,style:{minHeight:"100%"},children:[e(ie,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(De,{status:Pe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(De,{status:Pe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(ie,{$gap:12,children:[r&&t(Zl,{isEnabled:!p.formData.disabled,setIsEnabled:e=>p.handleFormChange("disabled",!e),fieldDisabled:C}),t(Te,{"data-id":"dest-form-docs",leftIcon:Ga,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${_e}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(Ql,{title:"This connection will monitor:",allowedSignals:Me(d.option.supportedSignals),selectedSignals:Fe(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes(Le.Logs),metrics:e.includes(Le.Metrics),traces:e.includes(Le.Traces),profiles:e.includes(Le.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(ql,{signals:Fe(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(_s,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Wa,variant:Ie.Secondary,textColor:o.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:Ka,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"})});Ls.displayName="AddDestinationForm";const Fs=[{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."}],Ms=[{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."}],zs=["*"],Xs=[{id:Ve.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Ve.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Ve.DbQuery,label:"Collect DB query",tooltip:""},{id:Ve.Messaging,label:"Collect messaging",tooltip:""}],Bs={[We.Java]:[new je("","")],[We.Golang]:[new He("")],[We.Php]:[new Ge("","")]},Us={[Ye.CodeAttributes]:({value:i,setValue:l,formErrors:r,disabled:s})=>{const c=r.codeAttributes,d=o(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);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),i=Object.values(Xe).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",i)};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:Fs.map(({id:e,label:n,tooltip:i})=>t(Be,{text:i,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:Ms.map(({id:e,label:n,tooltip:i})=>t(Be,{text:i,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]})]})},[Ye.CustomInstrumentation]:({value:i,setValue:l,formErrors:r,disabled:s})=>{const c=r.customInstrumentations,d=o(()=>(i?.customInstrumentations?.[We.Golang]||[]).map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),p=o(()=>(i?.customInstrumentations?.[We.Java]||[]).map(e=>new je(e.className,e.methodName)),[i]),u=o(()=>(i?.customInstrumentations?.[We.Php]||[]).map(e=>new Ge(e.className,e.functionName)),[i]);return a(()=>{i?.customInstrumentations||c||l("customInstrumentations",{[We.Golang]:Bs[We.Golang],[We.Java]:Bs[We.Java],[We.Php]:Bs[We.Php]})},[]),e(n,{children:[e(ae,{children:[e(ie,{$gap:8,children:[t(Ya,{}),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[We.Golang]=e.map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[We.Java]=p,t[We.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(ie,{$gap:8,children:[t(Ja,{}),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[We.Golang]=d,t[We.Java]=e.map(e=>new je(e.className,e.methodName)),t[We.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(ie,{$gap:8,children:[t(qa,{}),t(pe,{label:"PHP custom probes"})]}),t(De,{status:Pe.Warning,message:Ke.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[We.Golang]=d,t[We.Java]=p,t[We.Php]=e.map(e=>new Ge(e.className,e.functionName)),l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2})]})]})},[Ye.HeadersCollection]:({value:e,setValue:n,formErrors:i,disabled:l})=>{const r=i.headersCollection,s=o(()=>e?.headersCollection?.[Ue.HeaderKeys]||[],[e]),c=e=>{const t={[Ue.HeaderKeys]:e};n("headersCollection",t)};return a(()=>{s.length||r||c(zs)},[]),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})},[Ye.PayloadCollection]:({value:n,setValue:i,formErrors:l,disabled:r})=>{const s=l.payloadCollection,c=o(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);return a(()=>{if(!c.length&&!s){const e={[Ve.HttpRequest]:{},[Ve.HttpResponse]:{},[Ve.DbQuery]:{},[Ve.Messaging]:{}};i("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:Xs.map(({id:e,label:n,tooltip:o})=>t(Be,{text:o,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),o={[Ve.HttpRequest]:n.includes(Ve.HttpRequest)?{}:null,[Ve.HttpResponse]:n.includes(Ve.HttpResponse)?{}:null,[Ve.DbQuery]:n.includes(Ve.DbQuery)?{}:null,[Ve.Messaging]:n.includes(Ve.Messaging)?{}:null};i("payloadCollection",o)})(e,t),disabled:r})},e))}),t(ue,{errorMessage:s})]})},[Ye.UnknownType]:null},Vs=({ruleType:e,value:n,setValue:i,formErrors:o,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(ql,{fields:a,value:n||{},setValue:i,formErrors:o||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=Us[e];return r?t(r,{value:n,setValue:i,formErrors:o,disabled:l}):null},Hs=()=>{const n=v(),{isEnterprise:i,platformType:a,version:l}=S(),r=Je(a,l),{selectedOption:s,genericForm:c,sourceOptions:d,namespaceOptions:p}=wr(),u=o(()=>qe(s?.supportedLanguages),[s?.supportedLanguages]),h=o(()=>{if(s)return s.type===Ye.CustomInstrumentation?[]:Ze(s.supportedLanguages)},[s]);if(!c||!s)return t($e,{title:"No active form"});const{formData:m,handleFormChange:g,formErrors:f}=c;return e(ae,{$gap:24,children:[e(ie,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:s.description}),e(ie,{$gap:12,children:[t(Zl,{isEnabled:!m.disabled,setIsEnabled:e=>g("disabled",!e),fieldDisabled:!i}),t(Te,{leftIcon:Ga,variant:Ie.Secondary,size:ke.S,onClick:()=>s.docsUrl&&window.open(s.docsUrl,"_blank","noopener noreferrer")})]})]}),t(er,{option:s,formState:m}),!!u.length&&e(ie,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Supported Languages:"}),u.map(e=>t(ce,{label:et(e),leftIcon:Qe(e),backgroundColor:n.v2.colors.purple[900]},e))]}),r&&t(tr,{scopes:m.sourceScopes,onChange:e=>g("sourceScopes",e),sourceOptions:d,namespaceOptions:p,supportedLanguages:h,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!i}),t(Ne,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:m.ruleName,onChange:({target:{value:e}})=>g("ruleName",e),errorMessage:f.ruleName,disabled:!i}),t(Vs,{ruleType:s.type,dynamicFields:s.fields,value:m,setValue:(e,t)=>g(e,t),formErrors:f,disabled:!i}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:m.notes,onChange:({target:{value:e}})=>g("notes",e),errorMessage:f.notes,disabled:!i})]})},js=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:i}=Tr();if(!e)return null;const{existingName:o,editingName:a}=e;return t(tt,{isOpen:!0,onClose:i,title:"Merge with existing Data Stream?",description:nt.DATA_STREAM_MERGE_WARNING(a,o),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:i}})},Gs=({autoFocus:n})=>{const{dataStreams:i}=it(),{genericForm:a,excludeName:l,editingName:r}=Tr(),{formData:s,formErrors:c,handleFormChange:d}=a,p=s.name,u=o(()=>i.find(e=>e.name===p&&e.name!==l),[i,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(De,{status:Pe.Warning,message:nt.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},Ws=()=>{const{selectedStreamName:e}=it(),{genericForm:n}=kr();if(!n)return t($e,{title:"No active form"});const{formData:i,handleFormChange:o,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:i.otelServiceName,onChange:({target:{value:t}})=>{o("otelServiceName",t),o("currentStreamName",e)},errorMessage:a.otelServiceName})},Ks=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ys=b.div`
|
|
56
|
+
`,Xc=s(({isEdit:i},n)=>{const a=v(),{isK8s:l}=x(),{destinationsApi:s}=ws(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:b}=ks(),[f,y]=r(h?.testResult),[S,C]=r(!!h);o(()=>{h?(y(h.testResult),C(!0)):(y(void 0),C(!1))},[h]);const w=async()=>{if(!d?.option.testConnectionSupported||!p||!l)return;const e=await s.testConnection(_e(p.formData));return y(e),e};return c(n,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,s]),p&&d?e(oe,{$gap:24,style:{minHeight:"100%"},children:[e(ne,{$gap:12,$justifyContent:"space-between",children:[f?f.succeeded?t(Re,{status:Le.Success,message:f.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Re,{status:Le.Error,message:f.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(ne,{$gap:12,children:[l&&t(Zl,{isEnabled:!p.formData.disabled,setIsEnabled:e=>p.handleFormChange("disabled",!e),fieldDisabled:S}),t(ke,{"data-id":"dest-form-docs",leftIcon:Pr,variant:$e.Secondary,size:Te.S,onClick:()=>window.open(`${Pe}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(Ql,{title:"This connection will monitor:",allowedSignals:Xe(d.option.supportedSignals),selectedSignals:ze(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes(Me.Logs),metrics:e.includes(Me.Metrics),traces:e.includes(Me.Traces),profiles:e.includes(Me.Profiles)}),disabled:S,errorMessage:p.formErrors.exportedSignals}),t(Ie,{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:S,errorMessage:p.formErrors.name}),t(Jl,{signals:ze(p.formData.exportedSignals),fields:d.option.fields,disabled:S,value:Object.fromEntries(p.formData.fields.map(e=>[e.key,e.value])),setValue:(e,t)=>{const i=p.formData.fields.some(t=>t.key===e);p.handleFormChange("fields",i?p.formData.fields.map(i=>i.key===e?{...i,value:t}:i):[...p.formData.fields,{key:e,value:t}]),e&&p.formErrors[e]&&p.handleErrorChange(e,void 0)},formErrors:p.formErrors,keyValuePersistAs:"array"}),!i&&e(zc,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(ke,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Mr,variant:$e.Secondary,textColor:a.v2.colors.red[500],onClick:()=>b(d.unsavedIdx)})}),l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(ke,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:$e.Secondary,onClick:w})}),h&&t("div",S?{style:{width:"150px"},children:t(ke,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:zr,variant:$e.Secondary,onClick:()=>C(!1)})}:{style:{width:"150px"},children:t(ke,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:$e.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),i=!!e&&!e.succeeded;m(d.unsavedIdx,{formData:t,testResult:e},i)}}})}),!h&&t("div",{style:{width:"150px"},children:t(ke,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:$e.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),i=!!e&&!e.succeeded;g({formData:t,testResult:e},i)}}})})]})]}):t(Ae,{title:"No active form"})});Xc.displayName="AddDestinationForm";const _c=[{id:Fe.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Fe.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Fe.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Fc=[{id:Fe.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Fe.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Fe.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Bc=["*"],Vc=[{id:Ue.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Ue.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Ue.DbQuery,label:"Collect DB query",tooltip:""},{id:Ue.Messaging,label:"Collect messaging",tooltip:""}],Uc={[Ke.Java]:[new He("","")],[Ke.Golang]:[new je("")],[Ke.Php]:[new Ge("","")]},jc={[Ye.CodeAttributes]:({value:n,setValue:r,formErrors:l,disabled:s})=>{const c=l.codeAttributes,d=a(()=>Object.entries(n.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);o(()=>{if(!d.length&&!c){const e={[Fe.FilePath]:!0,[Fe.Function]:!0,[Fe.LineNumber]:!0,[Fe.Column]:null,[Fe.Namespace]:null,[Fe.StackTrace]:null};r("codeAttributes",e)}},[]);const p=(e,t)=>{const i=t?[...d,e]:d.filter(t=>t!==e),n=Object.values(Fe).reduce((e,t)=>(e[t]=!!i.includes(t)||null,e),{});r("codeAttributes",n)};return e(i,{children:[e(oe,{$gap:12,children:[t(ee,{size:te.XS,color:ie.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(oe,{$gap:6,children:_c.map(({id:e,label:i,tooltip:n})=>t(Be,{text:n,withIcon:!0,children:t(Q,{label:i,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]}),e(oe,{$gap:12,children:[t(ee,{size:te.XS,color:ie.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(oe,{$gap:6,children:Fc.map(({id:e,label:i,tooltip:n})=>t(Be,{text:n,withIcon:!0,children:t(Q,{label:i,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]})]})},[Ye.CustomInstrumentation]:({value:n,setValue:r,formErrors:l,disabled:s})=>{const c=l.customInstrumentations,d=a(()=>(n?.customInstrumentations?.[Ke.Golang]||[]).map(e=>new je(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),p=a(()=>(n?.customInstrumentations?.[Ke.Java]||[]).map(e=>new He(e.className,e.methodName)),[n]),u=a(()=>(n?.customInstrumentations?.[Ke.Php]||[]).map(e=>new Ge(e.className,e.functionName)),[n]);return o(()=>{n?.customInstrumentations||c||r("customInstrumentations",{[Ke.Golang]:Uc[Ke.Golang],[Ke.Java]:Uc[Ke.Java],[Ke.Php]:Uc[Ke.Php]})},[]),e(i,{children:[e(oe,{children:[e(ne,{$gap:8,children:[t(Xr,{}),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,r("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(oe,{children:[e(ne,{$gap:8,children:[t(_r,{}),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 He(e.className,e.methodName)),t[Ke.Php]=u,r("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(oe,{children:[e(ne,{$gap:8,children:[t(Fr,{}),t(pe,{label:"PHP custom probes"})]}),t(Re,{status:Le.Warning,message:We.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 Ge(e.className,e.functionName)),r("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2})]})]})},[Ye.HeadersCollection]:({value:e,setValue:i,formErrors:n,disabled:r})=>{const l=n.headersCollection,s=a(()=>e?.headersCollection?.[Ve.HeaderKeys]||[],[e]),c=e=>{const t={[Ve.HeaderKeys]:e};i("headersCollection",t)};return o(()=>{s.length||l||c(Bc)},[]),t(fe,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:s,setValues:c,errorMessage:l,disabled:r})},[Ye.PayloadCollection]:({value:i,setValue:n,formErrors:r,disabled:l})=>{const s=r.payloadCollection,c=a(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);return o(()=>{if(!c.length&&!s){const e={[Ue.HttpRequest]:{},[Ue.HttpResponse]:{},[Ue.DbQuery]:{},[Ue.Messaging]:{}};n("payloadCollection",e)}},[]),e(oe,{$gap:12,children:[t(ee,{size:te.XS,color:ie.Secondary,nowrap:!0,children:"Type of data to collect"}),t(oe,{$gap:6,children:Vc.map(({id:e,label:i,tooltip:a})=>t(Be,{text:a,withIcon:!0,children:t(Q,{label:i,value:c.includes(e),onChange:t=>((e,t)=>{const i=t?[...c,e]:c.filter(t=>t!==e),a={[Ue.HttpRequest]:i.includes(Ue.HttpRequest)?{}:null,[Ue.HttpResponse]:i.includes(Ue.HttpResponse)?{}:null,[Ue.DbQuery]:i.includes(Ue.DbQuery)?{}:null,[Ue.Messaging]:i.includes(Ue.Messaging)?{}:null};n("payloadCollection",a)})(e,t),disabled:l})},e))}),t(ue,{errorMessage:s})]})},[Ye.UnknownType]:null},Hc=({ruleType:e,value:i,setValue:n,formErrors:a,dynamicFields:o,disabled:r})=>{if(!e)return null;if(o?.length)return t(Jl,{fields:o,value:i||{},setValue:n,formErrors:a||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:r},e);const l=jc[e];return l?t(l,{value:i,setValue:n,formErrors:a,disabled:r}):null},Gc=()=>{const i=v(),{isEnterprise:n,platformType:o,version:r}=x(),l=qe(o,r),{selectedOption:s,genericForm:c,sourceOptions:d,namespaceOptions:p}=Ts(),u=a(()=>Je(s?.supportedLanguages),[s?.supportedLanguages]),h=a(()=>{if(s)return s.type===Ye.CustomInstrumentation?[]:Ze(s.supportedLanguages)},[s]);if(!c||!s)return t(Ae,{title:"No active form"});const{formData:g,handleFormChange:m,formErrors:b}=c;return e(oe,{$gap:24,children:[e(ne,{$gap:12,$justifyContent:"space-between",children:[t(Ee,{size:te.XXXS,maxLines:2,children:s.description}),e(ne,{$gap:12,children:[t(Zl,{isEnabled:!g.disabled,setIsEnabled:e=>m("disabled",!e),fieldDisabled:!n}),t(ke,{leftIcon:Pr,variant:$e.Secondary,size:Te.S,onClick:()=>s.docsUrl&&window.open(s.docsUrl,"_blank","noopener noreferrer")})]})]}),t(es,{option:s,formState:g}),!!u.length&&e(ne,{$gap:12,children:[t(ee,{size:te.XS,color:ie.Secondary,nowrap:!0,children:"Supported Languages:"}),u.map(e=>t(ce,{label:et(e),leftIcon:Qe(e),backgroundColor:i.v2.colors.purple[900]},e))]}),l&&t(ts,{scopes:g.sourceScopes,onChange:e=>m("sourceScopes",e),sourceOptions:d,namespaceOptions:p,supportedLanguages:h,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!n}),t(Ie,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:g.ruleName,onChange:({target:{value:e}})=>m("ruleName",e),errorMessage:b.ruleName,disabled:!n}),t(Hc,{ruleType:s.type,dynamicFields:s.fields,value:g,setValue:(e,t)=>m(e,t),formErrors:b,disabled:!n}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:g.notes,onChange:({target:{value:e}})=>m("notes",e),errorMessage:b.notes,disabled:!n})]})},Kc=()=>{const{pendingMerge:e,confirmMerge:i,cancelMerge:n}=$s();if(!e)return null;const{existingName:a,editingName:o}=e;return t(tt,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:it.DATA_STREAM_MERGE_WARNING(o,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:$e.Primary,onClick:i},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:$e.Secondary,onClick:n}})},Wc=({autoFocus:i})=>{const{dataStreams:n}=nt(),{genericForm:o,excludeName:r,editingName:l}=$s(),{formData:s,formErrors:c,handleFormChange:d}=o,p=s.name,u=a(()=>n.find(e=>e.name===p&&e.name!==r),[n,p,r]);return e(oe,{$width:"100%",$gap:12,children:[t(Ie,{name:"data-stream-name",label:it.STREAM_NAME,placeholder:it.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:it.STREAM_DESCRIPTION,required:!0,autoFocus:i,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(Re,{status:Le.Warning,message:it.DATA_STREAM_MERGE_WARNING(l,u.name),fullWidth:!0})]})},Yc=()=>{const{selectedStreamName:e}=nt(),{genericForm:i}=Is();if(!i)return t(Ae,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:o}=i;return t(Ie,{name:"sourceName",label:it.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:o.otelServiceName})},qc=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Jc=f.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
flex-direction: column;
|
|
59
59
|
gap: 24px;
|
|
60
|
-
`,
|
|
60
|
+
`,Zc=f.div`
|
|
61
61
|
display: contents;
|
|
62
62
|
& > * {
|
|
63
63
|
opacity: ${({$faded:e})=>e?.4:1};
|
|
64
64
|
transition: opacity 0.2s ease;
|
|
65
65
|
}
|
|
66
|
-
`,
|
|
66
|
+
`,Qc=({value:e})=>{const i=v();return t(ce,e?{status:Le.Success,label:dt,leftIcon:Br}:{label:pt,leftIcon:Vr,backgroundColor:i.v2.colors.silver[500],textColor:i.v2.colors.white[500]})},ed=({value:e,onChange:i})=>{const n=v(),o=a(()=>[{icon:Br,label:dt,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:Vr,label:pt,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(ve,{options:o,selected:e,setSelected:i??(()=>{}),disabled:!i})},td=()=>{const e=Ns();switch(e.formType){case Os.Create:return t(id,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(ed,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Os.View:return e.data?e.isEditing?t(id,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(ed,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(nd,{data:e.data,renderAction:()=>t(Qc,{value:!e.data?.rule.disabled})}):null;case Os.EditAutoNoisy:return t(ad,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ct,sectionTitle:rt,sectionSubTitle:st,presetLabel:ot,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(ed,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Os.EditAutoCostReduction:return t(ad,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:lt,sectionTitle:rt,presetLabel:ot,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(ed,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Os.EditAutoHighlyRelevant:return t(Jc,{children:t(is,{title:e.localEnabled?void 0:at,summary:e.summary,renderAction:()=>t(ed,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},id=({category:i,formData:n,onChange:a,sourceOptions:o,namespaceOptions:r,renderAction:l})=>e(Jc,{children:[t(os,{category:i,formState:n,renderAction:l}),e(Zc,{$faded:!!n.disabled,children:[t(rs,{category:i,formState:n,onChange:a}),t(ts,{scopes:n.sourceScopes,onChange:e=>a({sourceScopes:e}),sourceOptions:o,namespaceOptions:r,titleNumber:1,dataIdPrefix:"sampling"}),t(ls,{category:i,formState:n,onChange:a}),"highlyRelevant"===i&&t(ss,{formState:n,onChange:a}),"highlyRelevant"===i&&t(cs,{ruleType:n.ruleType,formState:n,onChange:a}),t(ds,{category:i,formState:n,onChange:a})]})]}),nd=({data:i,renderAction:n})=>e(Jc,{children:[t(os,{readOnly:!0,summary:i.summary,renderAction:n}),t(rs,{readOnly:!0,data:i}),t(ts,{readOnly:!0,scopes:C(i.rule.sourceScopes)}),t(ls,{readOnly:!0,data:i}),t(ds,{readOnly:!0,data:i}),"highlyRelevant"===i.category&&t(cs,{readOnly:!0,rule:i.rule})]}),ad=({enabled:i,summary:n,inactiveTitle:a,sectionTitle:o,sectionSubTitle:r,presetLabel:l,customInputName:s,showModeToggle:c=!0,percentageMode:p,setPercentageMode:u,percentagePreset:h,setPercentagePreset:g,customPercentage:m,setCustomPercentage:b,renderAction:f})=>{const v=d(e=>u(e),[u]),y=d(e=>g(e),[g]),S=d(e=>b(e.target.value),[b]),x=!c||"sample"===p;return e(Jc,{children:[t(is,{title:i?void 0:a,summary:n,renderAction:f}),t(Zc,{$faded:!i,children:e(ut,{richTitle:{title:o,subTitle:r},children:[c&&t(oe,{$alignItems:"flex-start",children:t(ve,{options:qc,selected:p,setSelected:v})}),x&&t(ns,{description:l,options:as,selected:h,onSelect:y,customName:s,customLabel:ht,customPlaceholder:"5%",customValue:m,onCustomChange:S})]})})]})},od=({onClose:i,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:l})=>{const{actionsApi:s}=ws(),{platformType:c,version:u}=x(),[h,g]=r(""),[m,b]=r(null),f=p(null),{selectedOption:v,onSelectOption:y,genericForm:S,validateFormData:C}=Cs(),{options:w,loading:k}=s.useActionTypes(),T=a(()=>w.length?w:gt(c,u),[w,c,u]),$=a(()=>(h?T.filter(e=>e?.label?.toLowerCase().includes(h.toLowerCase())):T).filter(e=>!!e),[T,h]),I=d(e=>{f.current?.clearErrors(),y(e)},[y]),N=(({isLoading:e,options:i,selectedCategory:n,selectedType:o,onSelectOption:r})=>({width:"40%",list:a(()=>{if(e)return[t(re,{$padding:"8px 12px",children:t(le,{size:6})},"loading")];const a=i.reduce((e,t)=>{const i=t.category&&t.category in gc?t.category:hc;return(e[i]||=[]).push(t),e},{});return Object.keys(gc).filter(e=>a[e]?.length&&(!n||n===e)).map(e=>t(bc,{bucket:e,options:a[e],selectedType:o,onSelectOption:r},e))},[e,i,n,o,r])}))({isLoading:k,options:$,selectedCategory:m,selectedType:v?.type,onSelectOption:I}),O=a(()=>{const e=new Set(T.map(e=>e.category));return[{value:null,label:"All Actions"},...Object.values(mt).filter(t=>e.has(t)).map(e=>({value:e,label:se[e].TITLE}))]},[T]),A=a(()=>k?[t(re,{$padding:"8px 12px",children:t(le,{size:4})},"loading")]:v?[t(Mc,{},v.type)]:[t(bt,{$height:"100%",children:t(Ae,{icon:Er,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[k,v]);return t(ps,{ref:f,isOpen:!0,withOverlay:l,onClose:i,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=C();if(e)return!1;await s.create(t)},disableSave:!v||!S?.isFormDirty,isFormDirty:S?.isFormDirty,hideDirtyNote:!0,progress:{title:it.CREATING_ACTION,subTitle:it.CREATING_ACTION_SUBTITLE},header:{icon:Er,title:it.ADD_ACTION,subTitle:it.ADD_ACTION_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:h,onChange:g,placeholder:"Search by action name",width:"370px"},filters:e(ne,{$gap:8,children:[t(ee,{size:te.XXS,color:ie.Secondary,nowrap:!0,children:"Show"}),t(ve,{options:O,selected:m,setSelected:b})]}),leftColumn:N,rightColumn:{width:"60%",list:A}})},rd=({destinationsByCategory:n,filters:o,setFilters:r})=>{const l=a(()=>Object.values(ft).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=a(()=>{const e=Object.values(Me).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(i,{children:[t(vt,{placeholder:"Select category",options:l,values:o.categoryType?[o.categoryType]:[],setValues:e=>r({...o,categoryType:o.categoryType===e[0]?null:e[0]})}),t(ve,{options:s,selected:o.signalType,setSelected:e=>r({...o,signalType:e})})]})},ld=f.div`
|
|
67
67
|
display: flex;
|
|
68
68
|
flex-direction: column;
|
|
69
69
|
padding: 8px;
|
|
70
70
|
border-radius: 16px;
|
|
71
71
|
border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
|
|
72
|
-
background-color: ${({$noBgColor:e,$purpleColors:t,theme:
|
|
73
|
-
`,
|
|
72
|
+
background-color: ${({$noBgColor:e,$purpleColors:t,theme:i})=>e?"transparent":t?i.v2.colors.purple[900]:i.v2.colors.silver[800]};
|
|
73
|
+
`,sd=f.div`
|
|
74
74
|
display: flex;
|
|
75
75
|
align-items: center;
|
|
76
76
|
justify-content: space-between;
|
|
77
77
|
gap: 12px;
|
|
78
78
|
padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
|
|
79
|
-
`,
|
|
79
|
+
`,cd=({title:i,tooltip:n,list:a,noBgColor:o,purpleColors:l})=>{const[s,c]=r(!0);return e(ld,{"data-id":`collapse-${i}`,$noBgColor:o,$purpleColors:l,children:[e(sd,{$isOpen:s,children:[e(ne,{$gap:10,children:[t(ee,{size:te.XS,children:i}),n&&t(Be,{text:n,withIcon:!0}),t(ce,{label:a.length,status:l?Le.Default:void 0})]}),t(yt,{icon:s?jr:Hr,size:St.M,onClick:()=>c(e=>!e)})]}),s?t(oe,{children:a.length?u.toArray(a):t(bt,{$padding:"12px 0",children:t(Ae,{})})}):null]})},dd=(e,t,i)=>t||i.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!i.signalType||Xe(e.supportedSignals).includes(i.signalType))):e,pd=({option:e,formData:i,testResult:n,isSelected:a,onSelect:o})=>t(uc,{icon:wt(e.type).icon,title:i?.name||e.displayName,withCarret:!0,purpleColors:!!i,isSelected:a,onClick:()=>o(),children:n&&t(ce,{status:n.succeeded?Le.Success:Le.Error,leftIcon:n.succeeded?Gr:Kr})}),ud=({listType:e,destinationOptions:i,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:o}=ks();return i?.length?t(cd,{title:Ct[e].TITLE,tooltip:Ct[e].DESCRIPTION,list:i.map((i,n)=>t(pd,{option:i,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=i.id&&""!==i.id?a?.option.id===i.id:a?.option.type===i.type),onSelect:()=>o({listType:e,option:i})},`${e}-${i.id??i.type}-${n}`))}):n?.length?t(cd,{purpleColors:!0,title:Ct[e].TITLE,tooltip:Ct[e].DESCRIPTION,list:n.map(({option:i,formData:n,testResult:r},l)=>t(pd,{option:i,formData:n,testResult:r,isSelected:a?.unsavedIdx===l&&a?.listType===e,onSelect:()=>o({listType:e,option:i,unsavedIdx:l})},`${e}-${l}`))},e):void 0};var hd;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(hd||(hd={}));const gd=(e,t)=>{const i=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===hd.SELF_HOSTED?n.push(...e.items):e.name===hd.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=kt(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=Tt(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),i.push(e.items[a]))}}}),{[ft.DETECTED]:i,[ft.SELF_HOSTED]:n,[ft.MANAGED]:a}},md=({onClose:e,onBack:i,onNext:n,selectedConnectionIds:l,setSelectedConnectionIds:s,initialInputs:c,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=ws(),[g,m]=r(""),[b,f]=r({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:S}=h.useDestinationCategories(),{data:x,loading:C}=h.usePotentialDestinations(),{activeForm:w,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=ks();o(()=>{c&&$(c)},[c]);const I=S||C,N=a(()=>y?.destinationCategories?.categories??[],[y]),[O,A]=r({[ft.ALL]:[],[ft.UNSAVED]:[],[ft.EXISTS]:[],[ft.DETECTED]:[],[ft.SELF_HOSTED]:[],[ft.MANAGED]:[]});o(()=>{const e=v.map(e=>{let t;for(const i of N){const n=i.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const i=Tt(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:i[e.name]??e.initialValue})):[]}});A(t=>({...t,[ft.EXISTS]:e}))},[v,N]),o(()=>{(y||x)&&A(e=>({...e,...gd(y,x)}))},[y,x]);const E=d(async()=>{for(const{option:e,formData:t}of T){const i=_e(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(i.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e])){await h.update(e.id,i);continue}}await h.create(i)}},[T,h]),D=(({isFetching:e,destinationsByCategory:i,searchText:n,filters:o})=>{const{unsavedDestinations:r}=ks();return{width:"40%",list:a(()=>{const a=[];r.length&&a.push(t(ud,{listType:ft.UNSAVED,unsavedDestinations:r},"unsaved"));for(const e of Object.values(ft)){if(o.categoryType&&o.categoryType!==e)continue;const r=dd(i[e],n,o);r.length&&a.push(t(ud,{listType:e,destinationOptions:r},e))}return e&&a.push(t(bt,{$height:"100%",children:t(xt,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[r,i,n,o,e])}})({isFetching:I,destinationsByCategory:O,searchText:g,filters:b}),R=(()=>{const{activeForm:e}=ks();return{width:"60%",list:e?[t(Xc,{},e.option.type)]:[t(bt,{$height:"100%",children:t(Ae,{icon:Ur,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(ps,{isOpen:!0,withOverlay:p,disableAnimation:u,onClose:e,onBack:i?()=>i(T):void 0,onNext:n?()=>n(T):void 0,nextIsSkip:!T.length,onSave:E,disableSave:!w&&!T.length,isFetching:I,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:it.CREATING_DESTINATION,subTitle:it.CREATING_DESTINATION_SUBTITLE},header:{icon:Ur,title:it.ADD_DESTINATIONS,subTitle:it.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:l&&s?{value:l,setValue:s}:void 0,search:{value:g,onChange:m},filters:t(rd,{destinationsByCategory:O,filters:b,setFilters:f}),leftColumn:D,rightColumn:R})},bd=({onClose:e,selectedConnectionIds:i,setSelectedConnectionIds:n,withOverlay:o})=>{const{isEnterprise:l}=x(),{instrumentationRulesApi:s}=ws(),[c,d]=r(""),u=p(null),{selectedOption:h,onSelectOption:g,genericForm:m,validateFormData:b}=Ts(),{options:f,loading:v}=s.useRuleTypes(),y=a(()=>f.length?f:$t,[f]),S=a(()=>c?y.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):y,[y,c]),C=a(()=>v?[t(re,{$padding:"8px 12px",children:t(le,{size:4})},"loading")]:S.map(e=>{const i=h?.type===e.type;return t(uc,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:i,onClick:()=>{u.current?.clearErrors(),g(e)}},e.type)}),[v,h?.type,S,g]),w=a(()=>v?[t(re,{$padding:"8px 12px",children:t(le,{size:4})},"loading")]:h?[t(Gc,{},h.type)]:[t(bt,{$height:"100%",children:t(Ae,{icon:Wr,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[v,h]);return t(ps,{ref:u,isOpen:!0,withOverlay:o,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await s.create(t,h?.type)},disableSave:!h||!m?.isFormDirty||!l,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,forcedNote:l?void 0:{fullWidth:!0,status:Le.Warning,message:"This feature is only supported for OnPrem (Enterprise) installations"},progress:{title:it.CREATING_INSTRUMENTATION_RULE,subTitle:it.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Wr,title:it.ADD_INSTRUMENTATION_RULE,subTitle:it.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:i&&n?{value:i,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:C},rightColumn:{width:"60%",list:w}})},fd={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:it.FETCHING_NAMESPACES,subTitle:it.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:it.SELECT_NAMESPACE,subTitle:it.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},vd={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===It.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"},yd=e=>e?vd:fd,Sd="No matches",xd=e=>(e?"Unselect":"Select")+" all",Cd="Selected",wd=f.div``,kd=f.div`
|
|
80
80
|
visibility: hidden;
|
|
81
81
|
|
|
82
82
|
transition: visibility 0s;
|
|
@@ -84,17 +84,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
84
84
|
transition-duration: 0s;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
${
|
|
87
|
+
${wd}:hover & {
|
|
88
88
|
visibility: visible;
|
|
89
89
|
}
|
|
90
|
-
`,
|
|
90
|
+
`,Td=({workloadName:e,workloadKind:i,isChecked:n,onToggle:a,disabled:o})=>{const r=v(),l=()=>{};return t(wd,{children:t(uc,{dataId:`source-${e}`,title:e,disabled:o,onClick:o?l:a,isChecked:n,onCheckboxChange:o?l:a,children:o?t(Be,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(ce,{label:"Enterprise only",status:Le.Default,textSize:te.XXXS})}):t(kd,{children:t(ce,{label:i,status:Le.Info,textSize:te.XXXS,backgroundColor:r.v2.colors.blue[900]})})})})},$d=f.div``,Id=f.div`
|
|
91
91
|
display: grid;
|
|
92
92
|
/* Auto: "Auto" label + S toggle ≈ 72px. Selected: label + count badge ≈ 110px. */
|
|
93
93
|
grid-template-columns: ${({$withAuto:e})=>e?"72px 110px":"110px"};
|
|
94
94
|
align-items: center;
|
|
95
95
|
column-gap: 12px;
|
|
96
96
|
flex-shrink: 0;
|
|
97
|
-
`,
|
|
97
|
+
`,Nd=f.div`
|
|
98
98
|
display: flex;
|
|
99
99
|
justify-content: flex-end;
|
|
100
100
|
align-items: center;
|
|
@@ -109,17 +109,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
109
109
|
transition: visibility 0s;
|
|
110
110
|
${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
|
|
111
111
|
|
|
112
|
-
${
|
|
112
|
+
${$d}:hover & {
|
|
113
113
|
visibility: visible;
|
|
114
114
|
pointer-events: auto;
|
|
115
115
|
}
|
|
116
|
-
`,
|
|
116
|
+
`,Od=f(ne)`
|
|
117
117
|
width: 100%;
|
|
118
118
|
gap: 8px;
|
|
119
119
|
justify-content: flex-end;
|
|
120
120
|
align-items: center;
|
|
121
121
|
min-width: 0;
|
|
122
|
-
`,
|
|
122
|
+
`,Ad=({clusterId:i,namespaceName:n,checkbox:a,isFutureApps:o,selectedCounts:r,isActive:l,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=ws(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:i,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t($d,{children:t(uc,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:l,onClick:s,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(Id,{$withAuto:p,children:[p&&t(Nd,{$visible:l||o,children:t(Be,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(me,{label:"Auto",labelAlign:be.Left,size:Nt.S,value:o,onChange:e=>u({auto:e,all:e||void 0})})})}),e(Od,{children:[t(ee,{variant:Ot.Span,size:te.XXXS,color:ie.Secondary,align:"right",nowrap:!0,children:Cd}),t(ce,{label:`${r.sourced}/${r.total}`,status:l?Le.Default:Le.Unknown,minWidth:"42px"})]})]})})})},Ed=({withCollapse:e,clusterId:i,clusterName:n,namespaces:o,selectedArea:r,setSelectedArea:l,handleSourceChange:s})=>{const c=a(()=>o.map(({name:e,totalWorkloads:a,selectedCount:o,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(Ad,{clusterId:i,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:o,total:a},isActive:r.clusterId===i&&r.namespaceName===e,onActive:()=>l({clusterId:i,clusterName:n,namespaceName:e}),handleSourceChange:s},`${i}#${e}`)),[i,n,o,r]);return e?t(cd,{title:n,list:c,noBgColor:!0}):c},Dd=({onClose:i,onBack:n,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isK8s:u}=x(),{sourcesApi:h,snapshotsApi:g,namespacesApi:m}=ws(),{data:b,loading:f,pending:v,refetch:y}=g.useSnapshots(),{items:S,loading:C}=m.useNamespaces({skip:v||!!b}),w=yd(!u),{selectedStreamName:k}=nt(),{progress:T,resetProgress:$}=At(),{isFetching:I,setIsFetching:N,setSnapshots:O,formData:A,handleSourceChange:E,handleSelectAll:D,formDiff:R,isFormDirty:L}=Ls();o(()=>{y()},[]);const P=a(()=>{if(b)return b;const e=S;return e.length?{clusters:[{clusterId:Dt,clusterName:Et,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),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(k)??!1)}))||[]}))}]}:null},[b,S,k]);o(()=>{N(f||C),P&&O(P)},[P,f,C,N,O]);const[M,z]=r(""),[X,_]=r(It.Namespace),[F,B]=r({showOnlySelected:!1}),[V,U]=r({clusterId:"",clusterName:"",namespaceName:""}),j=(({isFetching:i,formData:n,handleSourceChange:o,handleSelectAll:r,selectedArea:l,setSelectedArea:s,searchText:c,searchBy:d,filters:p})=>{const{isK8s:u}=x(),h=yd(!u),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ds(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Rs(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,p]),m=a(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:i,selectedCount:n}of t)if(e=!0,n!==i)return!1;return e},[g]),{list:b,withFilterCount:f,filteredCount:v,totalCount:y}=a(()=>{const e=g.map(({clusterId:e,clusterName:i,visibleNamespaces:n})=>n.length?t(Ed,{withCollapse:g.length>1,clusterId:e,clusterName:i,namespaces:n,selectedArea:l,setSelectedArea:s,handleSourceChange:o},e):null).filter(e=>null!==e),i=g.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=n.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:i!==a,filteredCount:i,totalCount:a}},[g,n,l]);return{width:"60%",header:e(ne,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ne,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:h.groupColumnHeader}),t(Be,{text:f?it.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${f?`${v} / ${y}`:y}`,status:Le.Unknown})})]}),t(ee,{"data-id":"namespaces-select-all",onClick:()=>r({boolean:!m,searchText:c,searchBy:d,filters:p}),disabled:!b.length,size:te.XS,children:xd(m)})]}),list:b.length?b:i?[t(bt,{$height:"100%",children:t(xt,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(bt,{$height:"100%",children:t(Ae,c?{icon:qr,title:Sd,subTitle:h.noGroupMatchedFilter(c)}:{icon:qr,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:I,formData:A,handleSourceChange:E,handleSelectAll:D,selectedArea:V,setSelectedArea:U,searchText:X===It.Namespace?M:"",searchBy:X,filters:F}),H=(({formData:i,handleSourceChange:n,handleSelectAll:o,selectedArea:r,searchText:l,searchBy:s,filters:c})=>{const{isK8s:d,isEnterprise:p}=x(),u=yd(!d),h=a(()=>r.value.namespaceName?i.find(({clusterId:e})=>e===r.value.clusterId)?.namespaces.find(({name:e})=>e===r.value.namespaceName):void 0,[i,r.value.clusterId,r.value.namespaceName]),g=a(()=>h?[...h.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>As(e,l,c)):[],[h,l,c]),m=a(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=a(()=>{if(!h)return[];const{clusterId:e}=r.value,{name:i}=h;return g.map(({name:a,selected:o,kind:r,region:l})=>{const s=d&&!p&&Es.has(r);return t(Td,{workloadName:a,workloadKind:r,isChecked:!s&&(o||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:i,name:a,kind:r,region:l}}),disabled:s},`${e}#${i}#${a}#${r}#${l??""}`)})},[g,h,r.value.clusterId,n,d,p]),{withFilterCount:f,filteredCount:v,totalCount:y}=a(()=>{const e=h?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,h]);return{width:"40%",header:e(ne,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ne,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:r.value.namespaceName?`${r.value.namespaceName} > ${u.itemColumnHeader}`:u.itemColumnHeader}),t(Be,{text:f?it.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${f?`${v} / ${y}`:y}`,status:Le.Unknown})})]}),t(ee,{"data-id":"workloads-select-all",onClick:()=>o({clusterId:r.value.clusterId,namespaceName:r.value.namespaceName,boolean:!m,searchText:l,searchBy:s,filters:c}),disabled:!b.length,size:te.XS,children:xd(m)})]}),list:b.length?b:[t(bt,{$height:"100%",children:t(Ae,h?l?{icon:Yr,title:Sd,subTitle:(S=l,`No sources matched the filter '${S}'`)}:{icon:Yr,title:"No sources",subTitle:u.noItemsInGroupSubTitle}:{icon:Yr,title:u.selectGroupPrompt.title,subTitle:u.selectGroupPrompt.subTitle})},"no-data")]};var S})({formData:A,handleSourceChange:E,handleSelectAll:D,selectedArea:{value:V},searchText:X===It.Source?M:"",searchBy:X,filters:F});return t(ps,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:i?()=>{$(Rt.BulkInstrumenting),i()}:void 0,onBack:n?()=>n(R):void 0,onNext:l?()=>l(R):void 0,nextIsSkip:!L,onSave:()=>h.persistV2(R),header:{icon:Yr,title:it.ADD_SOURCE,subTitle:it.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:M,onChange:e=>{z(e),X===It.Namespace&&U({clusterId:"",clusterName:"",namespaceName:""})},placeholder:w.searchPlaceholder(X),segment:{options:[{label:w.groupSegmentLabel,value:It.Namespace},{label:w.itemSegmentLabel,value:It.Source}],selected:X,setSelected:_}},filters:e(ne,{$gap:8,children:[t(ee,{size:te.XXXS,color:ie.Secondary,nowrap:!0,children:"Show only:"}),t(me,{name:"filter-selected",size:Nt.S,label:Cd,value:F.showOnlySelected,onChange:e=>B(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:L,isFetching:I,progress:{title:it.CREATING_SOURCES,subTitle:it.CREATING_SOURCES_SUBTITLE,percentage:T[Rt.BulkInstrumenting]?.percentage||0},leftColumn:j,rightColumn:H})},Rd={aws:Qr,gcp:Zr,azure:Jr},Ld={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Pd=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Md=e=>e.provider.toUpperCase(),zd=f.div`
|
|
123
123
|
display: flex;
|
|
124
124
|
flex-direction: column;
|
|
125
125
|
gap: 8px;
|
|
@@ -127,7 +127,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
127
127
|
padding: 8px 12px;
|
|
128
128
|
border-radius: 16px 0 0 16px;
|
|
129
129
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
130
|
-
`,
|
|
130
|
+
`,Xd=f.button`
|
|
131
131
|
display: flex;
|
|
132
132
|
align-items: center;
|
|
133
133
|
gap: 12px;
|
|
@@ -143,7 +143,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
143
143
|
&:hover {
|
|
144
144
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
145
145
|
}
|
|
146
|
-
`,
|
|
146
|
+
`,_d=f.div`
|
|
147
147
|
display: flex;
|
|
148
148
|
align-items: center;
|
|
149
149
|
justify-content: center;
|
|
@@ -152,13 +152,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
152
152
|
border-radius: 8px;
|
|
153
153
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
154
154
|
flex-shrink: 0;
|
|
155
|
-
`,
|
|
155
|
+
`,Fd=f.div`
|
|
156
156
|
display: flex;
|
|
157
157
|
flex-direction: column;
|
|
158
158
|
gap: 2px;
|
|
159
159
|
flex: 1;
|
|
160
160
|
min-width: 0;
|
|
161
|
-
`,
|
|
161
|
+
`,Bd=({providers:i,selectedProvider:n,onSelect:a})=>{const o=v();return i.length?t(zd,{children:i.map(i=>{const r=(e=>Rd[e.provider]??el)(i),l=i.provider===n,s=(e=>{const t=e.features.find(e=>e.key===Lt.Discovery);if(!t)return"";const i=[],n=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,a=Ld[t]??Pd(t);n.has(a)||(n.add(a),i.push(a))}return i.join(", ")})(i);return e(Xd,{type:"button",$selected:l,onClick:()=>a(i.provider),"data-id":`cloud-connector-provider-${i.provider}`,children:[t(_d,{children:t(r,{size:24})}),e(Fd,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ie.Primary,children:Md(i)}),s&&t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ie.Secondary,children:s})]}),t(Ar,{size:18,fill:o.v2.colors.silver[300]})]},i.provider)})}):t(ee,{size:te.XS,color:ie.Secondary,children:"No providers available."})},Vd=f.div`
|
|
162
162
|
display: flex;
|
|
163
163
|
flex-direction: column;
|
|
164
164
|
gap: 8px;
|
|
@@ -168,15 +168,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
168
168
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
169
169
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
170
170
|
cursor: default;
|
|
171
|
-
`,
|
|
171
|
+
`,Ud=f.div`
|
|
172
172
|
display: flex;
|
|
173
173
|
align-items: center;
|
|
174
174
|
gap: 4px;
|
|
175
175
|
width: 100%;
|
|
176
|
-
`,
|
|
176
|
+
`,jd=f.div`
|
|
177
177
|
flex: 1;
|
|
178
178
|
min-width: 0;
|
|
179
|
-
`,
|
|
179
|
+
`,Hd=f.div`
|
|
180
180
|
width: 100%;
|
|
181
181
|
max-height: 145px;
|
|
182
182
|
overflow: auto;
|
|
@@ -198,39 +198,43 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
198
198
|
transition: background-color 0.2s ease;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
${
|
|
201
|
+
${Vd}:hover & {
|
|
202
202
|
scrollbar-color: ${({theme:e})=>e.v2.colors.silver[300]} transparent;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
${
|
|
205
|
+
${Vd}:hover &::-webkit-scrollbar-thumb {
|
|
206
206
|
background-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
207
207
|
}
|
|
208
|
-
`,
|
|
208
|
+
`,Gd=f.pre`
|
|
209
209
|
margin: 0;
|
|
210
210
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
211
211
|
font-size: 12px;
|
|
212
212
|
line-height: 20px;
|
|
213
213
|
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
214
214
|
white-space: pre;
|
|
215
|
-
`,
|
|
215
|
+
`,Kd=({policy:i})=>{const n=v(),{CopyButton:a}=Pt();return e(Vd,{children:[e(Ud,{children:[t(tl,{size:16,fill:n.v2.colors.silver[200]}),t(jd,{children:t(ee,{size:te.XXS,color:ie.Primary,children:it.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(a,{value:i})]}),t(Hd,{children:t(Gd,{children:i})})]})},Wd="{{permissions}}",Yd=/\{\{(\w+)\}\}/g,qd="create-role",Jd=(e,t,i)=>(e?.setup?.artifacts??[]).find(e=>e.section===t&&(!i||e.id===i)),Zd=(e,t)=>(e?.setup?.artifacts??[]).filter(e=>e.section===t),Qd=(e,t)=>{const i=new Set,n=[];return Zd(e,t).forEach(e=>{e.variant&&!i.has(e.variant)&&(i.add(e.variant),n.push({id:e.variant,label:e.variantLabel||e.variant}))}),n},ep=(e,t,i)=>Zd(e,t).find(e=>e.variant===i),tp=(e,t={})=>{const i=((e,t,i)=>{const n=e.split("\n"),a=n.findIndex(e=>e.includes(Wd));if(-1===a)return e;const o=n[a],r=o.slice(0,o.indexOf(Wd)),l=t.itemTemplate||"{{permission}}",s=t.itemSeparator??"\n";return 0===i.length?n.splice(a,1):n[a]=i.map(e=>{return r+(t=e,l.split("{{permission}}").join(t));var t}).join(s),n.join("\n")})(e.template??"",e,t.permissions??[]);return((e,t)=>e.replace(Yd,(e,i)=>Object.prototype.hasOwnProperty.call(t,i)?t[i]:e))(i,t.vars??{})};var ip;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(ip||(ip={}));const np=[{id:ip.DiscoveryOnly,title:it.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:it.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[Lt.Discovery]},{id:ip.DiscoveryInstrumentation,title:it.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:it.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[Lt.Discovery,Lt.Instrumentation]},{id:ip.Custom,title:it.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:it.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],ap=(e,t)=>e.features?.find(e=>e.key===t),op=e=>{if(!e)return[];const t=ap(e,Lt.Discovery),i=ap(e,Lt.Instrumentation);return t?t.types.map(e=>{const t=i?.types.find(t=>t.name===e.name);return{typeName:e.name,displayName:e.displayName||e.name,discoveryPermissions:e.permissions??[],instrumentationPermissions:t?t.permissions??[]:void 0}}):[]},rp=()=>{const e=new Set,t=[];return{out:t,add:i=>i?.forEach(i=>{i&&!e.has(i)&&(e.add(i),t.push(i))})}},lp=(e,t)=>{if(!e)return[];const i=np.find(e=>e.id===t)?.featureKeys??[],{out:n,add:a}=rp();return a(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&i.includes(e.key)&&(a(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&a(e.permissions)}))}),n},sp=(e,t)=>{if(!e)return[];const i=op(e),n=ap(e,Lt.Discovery),a=i.some(e=>t[e.typeName]?.discovery),{out:o,add:r}=rp();return r(e.auth?.permissions),a&&r(n?.permissions),i.forEach(e=>{const i=t[e.typeName];i?.discovery&&r(e.discoveryPermissions),i?.instrumentation&&r(e.instrumentationPermissions)}),o},cp=(e,t,i)=>{const n=t===ip.Custom?sp(e,i??{}):lp(e,t),a=Jd(e,"permissions","policy-preview");return a?tp(a,{permissions:n}):""},dp=f.div`
|
|
216
216
|
width: 100%;
|
|
217
217
|
padding: 12px 16px;
|
|
218
218
|
border-radius: 12px;
|
|
219
219
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
220
220
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
221
|
-
`,
|
|
221
|
+
`,pp=f.div`
|
|
222
222
|
display: grid;
|
|
223
|
-
grid-template-columns: minmax(0, 1fr)
|
|
223
|
+
grid-template-columns: minmax(0, 1fr) 100px minmax(200px, 1.4fr);
|
|
224
224
|
align-items: center;
|
|
225
225
|
row-gap: 16px;
|
|
226
226
|
column-gap: 8px;
|
|
227
|
-
`,
|
|
227
|
+
`,up=f.div`
|
|
228
228
|
display: flex;
|
|
229
229
|
align-items: center;
|
|
230
230
|
min-width: 0;
|
|
231
|
-
`,
|
|
231
|
+
`,hp=f(up)`
|
|
232
232
|
justify-content: center;
|
|
233
|
-
`,
|
|
233
|
+
`,gp=f(up)`
|
|
234
|
+
justify-content: flex-start;
|
|
235
|
+
`,mp=f(up)`
|
|
236
|
+
gap: 4px;
|
|
237
|
+
`,bp={discovery:!1,instrumentation:!1},fp=({provider:i,capabilities:a,onCapabilitiesChange:o})=>{const r=v(),l=op(i),s=(e,t)=>{o({...a,[e]:t})};return l.length?t(dp,{children:e(pp,{children:[t(up,{children:t(ee,{size:te.XXS,color:ie.Secondary,children:it.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(hp,{children:t(ee,{size:te.XXS,color:ie.Secondary,children:it.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),e(mp,{children:[t(ee,{size:te.XXS,color:ie.Secondary,children:it.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION}),t(Be,{text:it.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION_TOOLTIP,withIcon:!0})]}),l.map(i=>{const o=a[i.typeName]??bp,l=void 0!==i.instrumentationPermissions,c=o.instrumentation||o.discovery;return e(n.Fragment,{children:[t(up,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ie.Primary,children:i.displayName})}),t(hp,{children:t(me,{name:`cloud-connector-custom-${i.typeName}-discovery`,size:Nt.S,value:c,disabled:o.instrumentation,onChange:e=>s(i.typeName,{discovery:e,instrumentation:o.instrumentation})})}),t(gp,{children:t(me,{name:`cloud-connector-custom-${i.typeName}-instrumentation`,size:Nt.S,value:o.instrumentation,disabled:!l,label:o.instrumentation?it.CLOUD_CONNECTOR_INSTRUMENTATION_MANAGED_BY_ODIGOS:it.CLOUD_CONNECTOR_INSTRUMENTATION_SELF_MANAGED,labelColor:o.instrumentation?r.v2.colors.purple[400]:r.v2.colors.silver[200],onChange:e=>s(i.typeName,{discovery:!!e||o.discovery,instrumentation:e})})})]},i.typeName)})]})}):null},vp=f.div`
|
|
234
238
|
display: flex;
|
|
235
239
|
flex-direction: column;
|
|
236
240
|
gap: 8px;
|
|
@@ -239,12 +243,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
239
243
|
padding: 8px;
|
|
240
244
|
border-radius: 0 16px 16px 0;
|
|
241
245
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
242
|
-
`,
|
|
246
|
+
`,yp=f.div`
|
|
243
247
|
display: flex;
|
|
244
248
|
flex-direction: column;
|
|
245
249
|
gap: 8px;
|
|
246
250
|
width: 100%;
|
|
247
|
-
`,
|
|
251
|
+
`,Sp=f.div`
|
|
248
252
|
display: flex;
|
|
249
253
|
align-items: center;
|
|
250
254
|
gap: 10px;
|
|
@@ -252,7 +256,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
252
256
|
padding: 4px 12px 4px 4px;
|
|
253
257
|
border-radius: 8px;
|
|
254
258
|
background-color: ${({theme:e})=>e.v2.colors.purple[900]};
|
|
255
|
-
`,
|
|
259
|
+
`,xp=f.div`
|
|
256
260
|
display: flex;
|
|
257
261
|
align-items: center;
|
|
258
262
|
justify-content: center;
|
|
@@ -261,30 +265,30 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
261
265
|
border-radius: 6px;
|
|
262
266
|
flex-shrink: 0;
|
|
263
267
|
background-color: ${({theme:e})=>e.v2.colors.purple[800]};
|
|
264
|
-
`,
|
|
268
|
+
`,Cp=({message:i})=>{const n=v();return e(Sp,{children:[t(xp,{children:t(il,{fill:"#B08BFD",size:24})}),t(ee,{size:te.XXS,color:n.v2.colors.purple[300],children:i})]})},wp=({provider:i,selectedPermission:n,onSelect:a,capabilities:o,onCapabilitiesChange:r})=>t(vp,{children:np.map(l=>{const s=l.id===n,c=l.id===ip.Custom,d=s?e(yp,{children:[c&&t(fp,{provider:i,capabilities:o,onCapabilitiesChange:r}),t(Kd,{policy:cp(i,l.id,o)})]}):void 0,p=s?t(Cp,{message:c?it.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:it.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Mt,{"data-id":`cloud-connector-permission-${l.id}`,title:l.title,description:l.description,checked:s,onChange:()=>a(l.id),body:d,footerNote:p},l.id)})}),kp=f.div`
|
|
265
269
|
display: flex;
|
|
266
270
|
flex-direction: column;
|
|
267
271
|
padding: 16px;
|
|
268
|
-
`,
|
|
272
|
+
`,Tp=f.div`
|
|
269
273
|
display: flex;
|
|
270
274
|
flex-direction: column;
|
|
271
275
|
gap: 16px;
|
|
272
276
|
padding: 16px;
|
|
273
277
|
border-radius: 16px;
|
|
274
278
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
275
|
-
|
|
279
|
+
`,$p=f.div`
|
|
276
280
|
display: flex;
|
|
277
281
|
flex-direction: column;
|
|
278
282
|
gap: 4px;
|
|
279
|
-
`,
|
|
283
|
+
`,Ip=f.div`
|
|
280
284
|
display: flex;
|
|
281
285
|
align-items: stretch;
|
|
282
286
|
width: 100%;
|
|
283
|
-
`,
|
|
287
|
+
`,Np=f.div`
|
|
284
288
|
display: flex;
|
|
285
289
|
flex: 0 0 40%;
|
|
286
290
|
min-width: 0;
|
|
287
|
-
`,
|
|
291
|
+
`,Op=()=>{const{providers:i,genericForm:n}=Ps(),[l,s]=r(!0),c=a(()=>i.find(e=>e.provider===n.formData.provider),[i,n.formData.provider]),p=d(e=>{e!==n.formData.provider&&n.handleFormChange(void 0,void 0,{...n.formData,provider:e,authMethod:"",setupMethod:"",accountId:"",credentials:{},customCapabilities:{}})},[n]);return o(()=>{!n.formData.provider&&i.length>0&&p(i[0].provider)},[i,n.formData.provider,p]),o(()=>{n.formData.permission||n.handleFormChange("permission",ip.DiscoveryInstrumentation)},[n.formData.permission,n]),t(kp,{children:e(Tp,{children:[e($p,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ie.Primary,children:it.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ie.Secondary,children:it.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),l&&t(Re,{fullWidth:!0,maxWidth:"800px",smallIcon:!0,status:Le.Info,message:it.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:zt.CLOSE,onClick:()=>s(!1)}}),e(Ip,{children:[t(Np,{children:t(Bd,{providers:i,selectedProvider:n.formData.provider,onSelect:p})}),t(wp,{provider:c,selectedPermission:n.formData.permission,onSelect:e=>n.handleFormChange("permission",e),capabilities:n.formData.customCapabilities,onCapabilitiesChange:e=>n.handleFormChange("customCapabilities",e)})]})]})})},Ap=f.div`
|
|
288
292
|
display: flex;
|
|
289
293
|
flex-direction: column;
|
|
290
294
|
gap: 16px;
|
|
@@ -292,12 +296,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
292
296
|
padding: 12px;
|
|
293
297
|
border-radius: 8px;
|
|
294
298
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
295
|
-
`,
|
|
299
|
+
`,Ep=f.div`
|
|
296
300
|
display: flex;
|
|
297
301
|
align-items: center;
|
|
298
302
|
gap: 12px;
|
|
299
303
|
width: 100%;
|
|
300
|
-
`,
|
|
304
|
+
`,Dp=f.div`
|
|
301
305
|
display: flex;
|
|
302
306
|
align-items: center;
|
|
303
307
|
justify-content: center;
|
|
@@ -306,41 +310,41 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
306
310
|
height: 24px;
|
|
307
311
|
border-radius: 16px;
|
|
308
312
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
309
|
-
`,
|
|
313
|
+
`,Rp=f.div`
|
|
310
314
|
display: flex;
|
|
311
315
|
flex: 1;
|
|
312
316
|
flex-direction: column;
|
|
313
317
|
gap: 2px;
|
|
314
318
|
min-width: 0;
|
|
315
|
-
|
|
319
|
+
`,Lp=f.div`
|
|
316
320
|
display: flex;
|
|
317
321
|
flex-direction: column;
|
|
318
322
|
gap: 10px;
|
|
319
323
|
width: 100%;
|
|
320
324
|
padding-left: 32px;
|
|
321
|
-
`,
|
|
325
|
+
`,Pp=({"data-id":i,step:n,title:a,description:o,children:r})=>e(Ap,{"data-id":i,children:[e(Ep,{children:[t(Dp,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ie.Primary,children:n})}),e(Rp,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ie.Primary,children:a}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ie.Secondary,children:o})]})]}),r&&t(Lp,{children:r})]}),Mp=f.div`
|
|
322
326
|
display: flex;
|
|
323
327
|
align-items: stretch;
|
|
324
328
|
gap: 10px;
|
|
325
329
|
width: 100%;
|
|
326
|
-
`,
|
|
330
|
+
`,zp=f.div`
|
|
327
331
|
display: flex;
|
|
328
332
|
flex: 2 1 0;
|
|
329
333
|
flex-direction: column;
|
|
330
334
|
gap: 12px;
|
|
331
335
|
min-width: 0;
|
|
332
336
|
padding: 12px 0;
|
|
333
|
-
`,
|
|
337
|
+
`,Xp=f.div`
|
|
334
338
|
display: flex;
|
|
335
339
|
flex-direction: column;
|
|
336
340
|
gap: 8px;
|
|
337
341
|
width: 100%;
|
|
338
|
-
`,
|
|
342
|
+
`,_p=f.div`
|
|
339
343
|
display: flex;
|
|
340
344
|
align-items: center;
|
|
341
345
|
gap: 12px;
|
|
342
346
|
width: 100%;
|
|
343
|
-
`,
|
|
347
|
+
`,Fp=f.div`
|
|
344
348
|
display: flex;
|
|
345
349
|
align-items: center;
|
|
346
350
|
justify-content: center;
|
|
@@ -349,7 +353,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
349
353
|
height: 24px;
|
|
350
354
|
border-radius: 16px;
|
|
351
355
|
background-color: ${({theme:e})=>e.v2.colors.purple[700]};
|
|
352
|
-
`,
|
|
356
|
+
`,Bp=f.div`
|
|
353
357
|
display: flex;
|
|
354
358
|
flex: 3 1 0;
|
|
355
359
|
flex-direction: column;
|
|
@@ -358,42 +362,42 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
358
362
|
border-radius: 12px;
|
|
359
363
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
360
364
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
361
|
-
`,
|
|
365
|
+
`,Vp=f.div`
|
|
362
366
|
display: flex;
|
|
363
367
|
align-items: center;
|
|
364
368
|
justify-content: flex-end;
|
|
365
369
|
width: 100%;
|
|
366
|
-
`,
|
|
370
|
+
`,Up=f.div`
|
|
367
371
|
flex: 1;
|
|
368
372
|
width: 100%;
|
|
369
373
|
min-height: 200px;
|
|
370
374
|
max-height: 260px;
|
|
371
375
|
overflow: auto;
|
|
372
376
|
padding: 0 12px 12px;
|
|
373
|
-
`,
|
|
377
|
+
`,jp=f.pre`
|
|
374
378
|
margin: 0;
|
|
375
379
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
376
380
|
font-size: 12px;
|
|
377
381
|
line-height: 20px;
|
|
378
382
|
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
379
383
|
white-space: pre;
|
|
380
|
-
`,
|
|
384
|
+
`,Hp=({step:i,artifact:n,code:a})=>{const o=v(),{CopyButton:r}=Pt(),l=n.steps??[];return t(Pp,{"data-id":"cloud-connector-create-role",step:i,title:n.title||it.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:n.description,children:e(Mp,{children:[l.length>0&&e(zp,{children:[t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ie.Primary,children:it.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(Xp,{children:l.map((i,a)=>e(_p,{children:[t(Fp,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:o.v2.colors.purple[200],children:a+1})}),t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ie.Primary,children:i})]},`${n.id}-step-${a}`))})]}),a&&e(Bp,{children:[t(Vp,{children:t(r,{value:a})}),t(Up,{children:t(jp,{children:a})})]})]})})},Gp=f.div`
|
|
381
385
|
display: flex;
|
|
382
386
|
flex-direction: column;
|
|
383
387
|
padding: 16px;
|
|
384
|
-
`,
|
|
388
|
+
`,Kp=f.div`
|
|
385
389
|
display: flex;
|
|
386
390
|
flex-direction: column;
|
|
387
391
|
gap: 12px;
|
|
388
392
|
padding: 16px 16px 12px;
|
|
389
393
|
border-radius: 16px;
|
|
390
394
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
391
|
-
`,
|
|
395
|
+
`,Wp=f.div`
|
|
392
396
|
display: flex;
|
|
393
397
|
align-items: center;
|
|
394
398
|
gap: 8px;
|
|
395
399
|
width: 100%;
|
|
396
|
-
`,
|
|
400
|
+
`,Yp=f.button`
|
|
397
401
|
display: flex;
|
|
398
402
|
align-items: center;
|
|
399
403
|
justify-content: center;
|
|
@@ -410,38 +414,38 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
410
414
|
&:hover {
|
|
411
415
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
412
416
|
}
|
|
413
|
-
`,
|
|
417
|
+
`,qp=f.div`
|
|
414
418
|
display: flex;
|
|
415
419
|
flex: 1;
|
|
416
420
|
flex-direction: column;
|
|
417
421
|
gap: 4px;
|
|
418
422
|
min-width: 0;
|
|
419
|
-
`,
|
|
423
|
+
`,Jp=f.div`
|
|
420
424
|
display: flex;
|
|
421
425
|
align-items: center;
|
|
422
426
|
gap: 4px;
|
|
423
427
|
padding: 8px 0 8px 2px;
|
|
424
|
-
`,
|
|
428
|
+
`,Zp=f.div`
|
|
425
429
|
display: flex;
|
|
426
430
|
flex-direction: column;
|
|
427
431
|
gap: 16px;
|
|
428
432
|
width: 100%;
|
|
429
|
-
`,
|
|
433
|
+
`,Qp=f.div`
|
|
430
434
|
display: flex;
|
|
431
435
|
flex-wrap: wrap;
|
|
432
436
|
gap: 24px;
|
|
433
437
|
width: 100%;
|
|
434
|
-
`,
|
|
438
|
+
`,eu=f.div`
|
|
435
439
|
display: flex;
|
|
436
440
|
flex: 1 1 calc(50% - 12px);
|
|
437
441
|
min-width: 0;
|
|
438
|
-
`,
|
|
442
|
+
`,tu=({field:e,value:i,onChange:n})=>{const a=`cloud-connector-credential-${e.name}`,o=e.displayName||e.name,r={name:a,label:o,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:o,value:i};return"textarea"===e.componentType||"credentialsJson"===e.name?t(De,{...r,minHeight:"120px",onChange:e=>n(e.target.value)}):t(Ie,{...r,width:"100%",type:e.secret?_t.Password:_t.Text,onChange:e=>n(e.target.value)})},iu=({onBack:i})=>{const n=v(),{providers:r,genericForm:l}=Ps(),{provider:s,authMethod:c,setupMethod:d,accountId:p,credentials:u,permission:h,customCapabilities:g}=l.formData,m=a(()=>r.find(e=>e.provider===s),[r,s]),b=m?.connectorFields?.[0],f=a(()=>(e=>{const t=e?.auth?.defaultMethod?.trim();return t&&e?.auth?.methods?.some(e=>e.id===t)?t:e?.auth?.methods?.find(e=>e.fields?.some(e=>e.required))?.id??e?.auth?.methods?.[0]?.id??""})(m),[m]),y=a(()=>m?.auth?.methods?.find(e=>e.id===c),[m,c]),S=a(()=>((e,t)=>{const i=e?.auth?.methods?.find(e=>e.id===t);if(!i)return[];const n=new Map(e?.auth?.methods?.map(e=>[e.id,e])),a=new Set,o=[],r=e=>e?.forEach(e=>{e.name&&!a.has(e.name)&&(a.add(e.name),o.push(e))});return i.baseMethods?.forEach(e=>r(n.get(e)?.fields)),r(i.fields),o})(m,c),[m,c]),x=a(()=>Qd(m,qd),[m]),C=x.length>0,w=a(()=>{if(C)return ep(m,qd,d)??(e=>{const t=Qd(e,qd);return t[0]?ep(e,qd,t[0].id):void 0})(m)},[m,d,C]),k=a(()=>Jd(m,"credentials"),[m]),T=a(()=>{const e=h;return e===ip.Custom?sp(m,g??{}):lp(m,e)},[m,h,g]),$=a(()=>w?tp(w,{permissions:T,vars:{accountId:p??"",externalId:u.externalId?.trim()||"odigos-connector",projectId:p??"",subscriptionId:p??"",...u}}):"",[w,T,p,u]);o(()=>{if(!m)return;const e=m.auth?.methods?.some(e=>e.id===c);e||l.handleFormChange("authMethod",f)},[m,c,f,l]),o(()=>{C&&(x.some(e=>e.id===d)||l.handleFormChange("setupMethod",x[0].id))},[C,x,d,l]);let I=1;const N=b?I++:0,O=I++,A=C?I++:0,E=C?I++:0,D=I,R=m?.setup?.subtitle||(m?.displayName?`Configure the ${m.displayName} account and authentication details.`:"Configure the account and authentication details."),L=b?`Enter ${b.displayName||b.name}`:"Enter account details",P=b?.tooltip||"Enter the provider account identifier that contains the resources Odigos should discover.",M=k?.title||"Enter credentials",z=k?.description||y?.description||"Enter the credentials required by the selected authentication method.";return t(Gp,{children:e(Kp,{children:[e(Wp,{children:[t(Yp,{"data-id":"cloud-connector-setup-back",type:"button",onClick:i,"aria-label":it.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(nl,{size:24})}),e(qp,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ie.Primary,children:it.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ie.Secondary,children:R})]})]}),b&&t(Pp,{"data-id":"cloud-connector-account",step:N,title:L,description:P,children:t(Ie,{name:`cloud-connector-account-${b.name}`,width:"100%",label:b.displayName||b.name,required:b.required,tooltip:b.tooltip||void 0,helpMessage:b.tooltip||void 0,placeholder:b.displayName||b.name,value:p,onChange:e=>l.handleFormChange("accountId",e.target.value)})}),e(Pp,{"data-id":"cloud-connector-auth-method",step:O,title:it.CLOUD_CONNECTOR_AUTH_TITLE,description:"Choose how the connector authenticates with this provider.",children:[t(ve,{"data-id":"cloud-connector-auth-method-segment",size:Xt.S,selected:c,setSelected:e=>{l.handleFormChange(void 0,void 0,{...l.formData,authMethod:e,credentials:{}})},options:(m?.auth?.methods??[]).map(e=>({value:e.id,label:e.displayName}))}),y?.description&&e(Jp,{children:[t(al,{size:16,fill:n.v2.colors.silver[200]}),t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ie.Secondary,children:y.description})]})]}),C&&t(Pp,{"data-id":"cloud-connector-setup-method",step:A,title:it.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:it.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ve,{"data-id":"cloud-connector-setup-method-segment",size:Xt.S,selected:d,setSelected:e=>l.handleFormChange("setupMethod",e),options:x.map(e=>({value:e.id,label:e.label}))})}),C&&w&&t(Hp,{step:E,artifact:w,code:$}),t(Pp,{"data-id":"cloud-connector-credentials",step:D,title:M,description:z,children:S.length>0?t(Zp,{children:t(Qp,{children:S.map(e=>{const i="textarea"===e.componentType||"credentialsJson"===e.name;return t(eu,{style:i?{flex:"1 1 100%"}:void 0,children:t(tu,{field:e,value:u[e.name]??"",onChange:t=>((e,t)=>{l.handleFormChange("credentials",{...u,[e]:t})})(e.name,t)})},e.name)})})}):t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ie.Secondary,children:"No stored credentials are required for this authentication method."})})]})})},nu=f.div`
|
|
439
443
|
display: flex;
|
|
440
444
|
flex-direction: column;
|
|
441
445
|
flex: 1;
|
|
442
446
|
min-height: 0;
|
|
443
447
|
padding: 16px;
|
|
444
|
-
`,
|
|
448
|
+
`,au=f.div`
|
|
445
449
|
display: flex;
|
|
446
450
|
flex-direction: column;
|
|
447
451
|
flex: 1;
|
|
@@ -449,13 +453,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
449
453
|
padding: 16px;
|
|
450
454
|
border-radius: 16px;
|
|
451
455
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
452
|
-
`,
|
|
456
|
+
`,ou=f.div`
|
|
453
457
|
display: flex;
|
|
454
458
|
flex: 1;
|
|
455
459
|
align-items: center;
|
|
456
460
|
justify-content: center;
|
|
457
461
|
width: 100%;
|
|
458
|
-
`,
|
|
462
|
+
`,ru=f.div`
|
|
459
463
|
display: flex;
|
|
460
464
|
flex-direction: column;
|
|
461
465
|
align-items: center;
|
|
@@ -465,7 +469,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
465
469
|
padding: 24px 8px;
|
|
466
470
|
border-radius: 8px;
|
|
467
471
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
468
|
-
`,
|
|
472
|
+
`,lu=f.div`
|
|
469
473
|
display: flex;
|
|
470
474
|
flex-direction: column;
|
|
471
475
|
align-items: center;
|
|
@@ -474,7 +478,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
474
478
|
padding: 16px;
|
|
475
479
|
border-radius: 12px;
|
|
476
480
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
477
|
-
`,
|
|
481
|
+
`,su=f.div`
|
|
478
482
|
display: flex;
|
|
479
483
|
align-items: center;
|
|
480
484
|
justify-content: center;
|
|
@@ -483,7 +487,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
483
487
|
height: 39px;
|
|
484
488
|
border-radius: 20px;
|
|
485
489
|
background-color: ${({theme:e})=>e.v2.colors.red[500]};
|
|
486
|
-
`,
|
|
490
|
+
`,cu=f.div`
|
|
487
491
|
display: flex;
|
|
488
492
|
align-items: flex-start;
|
|
489
493
|
gap: 8px;
|
|
@@ -493,7 +497,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
493
497
|
padding: 12px;
|
|
494
498
|
border-radius: 8px;
|
|
495
499
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
496
|
-
`,
|
|
500
|
+
`,du=f.pre`
|
|
497
501
|
flex: 1;
|
|
498
502
|
min-width: 0;
|
|
499
503
|
margin: 0;
|
|
@@ -503,25 +507,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
503
507
|
color: ${({theme:e})=>e.v2.colors.silver[200]};
|
|
504
508
|
white-space: pre-wrap;
|
|
505
509
|
word-break: break-word;
|
|
506
|
-
`,
|
|
510
|
+
`,pu=f.div`
|
|
507
511
|
display: flex;
|
|
508
512
|
flex-direction: column;
|
|
509
513
|
gap: 12px;
|
|
510
514
|
width: 100%;
|
|
511
|
-
`,
|
|
515
|
+
`,uu=f.div`
|
|
512
516
|
display: flex;
|
|
513
517
|
flex-wrap: wrap;
|
|
514
518
|
gap: 24px;
|
|
515
519
|
padding: 0 2px;
|
|
516
|
-
`,
|
|
520
|
+
`,hu=f.div`
|
|
517
521
|
display: flex;
|
|
518
522
|
gap: 6px;
|
|
519
523
|
min-width: 0;
|
|
520
|
-
`,
|
|
524
|
+
`,gu=f.div`
|
|
521
525
|
display: flex;
|
|
522
526
|
flex-direction: column;
|
|
523
527
|
gap: 8px;
|
|
524
|
-
`,
|
|
528
|
+
`,mu=f.div`
|
|
525
529
|
display: flex;
|
|
526
530
|
flex-direction: column;
|
|
527
531
|
gap: 6px;
|
|
@@ -529,7 +533,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
529
533
|
border-radius: 12px;
|
|
530
534
|
border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
|
|
531
535
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
532
|
-
`,up=({isTesting:n,error:i,result:a})=>{const l=v(),{CopyButton:r}=_t(),s=o(()=>a?.checks.filter(e=>!e.passed)??[],[a]),c=!(n||!i&&(!a||a.success)),d=i?nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=i||s.map(e=>e.message).filter(Boolean).join("\n");return t(Qd,{children:t(ep,{children:n?t(tp,{children:t(np,{children:t(St,{withVisual:!0,withGradient:!0,title:nt.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:te.XS})})}):c?t(tp,{children:e(ip,{children:[t(op,{children:t(ol,{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(ap,{children:[t(lp,{children:p}),t(r,{value:p,size:Ct.XS})]})]})}):a?e(rp,{children:[t(ce,{status:Pe.Success,label:nt.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:il,fullWidth:!0}),(a.accountId||a.identity)&&e(sp,{children:[a.accountId&&e(cp,{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(cp,{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(dp,{children:a.checks.map(n=>e(pp,{$passed:n.passed,children:[t(ce,{status:n.passed?Pe.Success:Pe.Error,label:n.displayName,leftIcon:n.passed?il:ol}),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(tp,{children:t(ee,{size:te.XXS,weight:400,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var hp;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(hp||(hp={}));const mp=hp.SelectProvider,gp=hp.Validate,fp=({onClose:n,withOverlay:i,onCreateCloudConnector:a,onCreated:r})=>{const{providers:s,genericForm:c}=Dr(),[p,u]=l(mp),[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===mp,k=p===gp,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>mp?e-1:e)},[]),E=d(()=>{if(x(void 0),p===hp.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<gp?e+1:e)},[p,c.formData.provider,c.formData.permission]),O=d(async()=>{if(x(void 0),C(void 0),v(void 0),!a)return;const{provider:e,permission:t,customCapabilities:n,accountId:i,authMethod:o,credentials:l,name:d}=c.formData,p=s.find(t=>t.provider===e),h=p?.connectorFields?.[0];if(h?.required&&!i.trim())return void x(`Please enter ${h.displayName||h.name}`);if(!o)return void x("Please select an authentication method");const m=((e,t,n)=>{const i=e?.auth?.methods?.find(e=>e.id===t);if(!i)return;const o=e=>!!n[e]?.trim(),a=e=>e?.find(e=>e.required&&!o(e.name)),l=a(i.fields);if(l)return l;if(!i.baseMethods?.length)return;const r=new Map(e?.auth?.methods?.map(e=>[e.id,e])),s=i.baseMethods.some(e=>{const t=r.get(e);return!(!t||t.fields&&0!==t.fields.length)});for(const e of i.baseMethods){const t=r.get(e);if(t?.fields?.length&&(t.fields.some(e=>o(e.name))||!s)){const e=a(t.fields);if(e)return e}}})(p,o,l);if(m)return void x(`Please enter ${m.displayName||m.name}`);const g=((e,t,n)=>{const i=id(e),o=[];return i.forEach(e=>{const i=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case ed.DiscoveryOnly:a=!0;break;case ed.DiscoveryInstrumentation:a=!0,l=i;break;case ed.Custom:{const t=n[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&o.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),o})(p,t,n);u(hp.Validate),f(!0);try{const t=await a({provider:e,displayName:d,credentials:l,expectedAccountId:i.trim(),capabilities:g});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=o(()=>S?{status:Pe.Error,message:S}:void 0,[S]),D=o(()=>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:ml,onClick:N,disabled:$},[T,I,N,$]),P=o(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Ft.RETRY,variant:Ie.Primary,rightIcon:fl,onClick:O}:void 0}return p===hp.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,$]),_=o(()=>[D,P].filter(Boolean),[D,P]);return e(Xt,{width:ur,isOpen:!0,hideOverlay:!$&&!i,header:{icon:pl,title:nt.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:R,actions:_},children:[p===hp.SelectProvider&&t(kd,{}),p===hp.Config&&t(Zd,{onBack:N}),p===hp.Validate&&t(up,{isTesting:g,error:y,result:b}),t(hr,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},bp=({statuses:e})=>{const n=o(()=>Bt(e).map(({status:e,type:t,reason:n,message:i})=>({status:e,title:Ut(n||t),subTitle:i??void 0})),[e]);return n.length?t(ae,{$gap:12,children:n.map(e=>t(Vt,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},vp=(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}}],i=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return i&&n.push({id:"signals",title:nt.SIGNALS_FOR_PROCESSING,label:i}),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},yp=e=>e.map(e=>"cells"===e.kind?t(Gt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):"list"===e.kind||"pairs"===e.kind?t(Gt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id):t(Gt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:e.items?.length?2:void 0,items:e.items,children:e.segments?.length?yp(e.segments):null},e.id)),Cp=({onClose:i,actionId:r})=>{const s=v(),{isK8s:c,platformType:u,version:h}=S(),{actionsApi:m}=Sr(),{items:g,refetch:f}=m.useActions(),{options:b}=m.useActionTypes(),{selectedOption:y,loadAction:C,validateFormData:x,genericForm:w}=Cr(),T=p(f);T.current=f,a(()=>{T.current()},[]);const[k,I]=l(!1),[N,E]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty;a(()=>{if(k)return;const e=setInterval(()=>T.current(),3e3);return()=>clearInterval(e)},[k]);const R=o(()=>g?.find(e=>Wt(e)===r),[r,g]),D=o(()=>b.find(({type:e})=>e===R?.type)??mt(u,h).find(({type:e})=>e===R?.type)??Kt.find(({type:e})=>e===R?.type)??null,[b,R?.type,u,h]),P=R?.statuses&&Array.isArray(R.statuses)?R.statuses:null;a(()=>{R&&C(R,D)},[R,D]);const _=d(()=>{R&&I(!0)},[R]),L=d(()=>{R&&(C(R,D),I(!1))},[R,D,C]),F=d(()=>{A?$("close"):i()},[A,i]),M=d(()=>{A?$("cancel"):L()},[A,L]),z=d(()=>{const e=O;$(null),"close"===e?(L(),i()):L()},[O,L,i]),X=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=x();e||(await m.update(R.id,t),I(!1))}},[R,x,m]),B=d(()=>{R&&E(!0)},[R]),U=d(async()=>{R&&(await m.remove(R.id,R.type),i())},[R,m,i]);if(!R||!D)return null;const V=(H=R,j=D,j?.fields?.length?Ht(H.fields||{},j.fields,{signals:H.signals||[],skipComponentTypes:[jt.SourceScopes]}):[]);var H,j;const G=D.fields?.find(e=>e.componentType===jt.SourceScopes),W=G?.name||de.Scopes,K=R.fields?.[W]??null,Y=c&&(!!G||void 0!==R.fields?.scopes);return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:Jt(R.type),title:D.label,onClose:F,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:Ka,active:k,onClick:_},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Va,color:s.v2.colors.red[500],active:N,onClick:B}]},footer:{actions:k?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:M},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:X}]:[]},children:t(le,{$padding:"4px 12px 12px",children:k&&y?t(Ps,{}):t(ae,{$gap:16,children:e(Gt,{bgTint:"1000",children:[c&&(P?t(bp,{statuses:P}):t(Yt,{conditions:R.conditions||[]})),t(Gt,{bgTint:"800",cellsPerRow:2,items:vp(R,D)}),Y&&t(tr,{readOnly:!0,scopes:K}),!!V.length&&t(Gt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:yp(V)})]})})})}),t(mr,{target:"action",isOpen:N,onClose:()=>E(!1),onApprove:U}),t(hr,{isOpen:null!==O,onClose:()=>$(null),onApprove:z})]})},Sp=({onClose:n,connections:i,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=Sr(),[d,p]=l(""),[u,h]=l({showOnlySelected:!1}),m=o(()=>i.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!u.showOnlySelected||u.showOnlySelected&&r.includes(e.id);return t&&n}),[i.length,r.length,d,u]),g=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},f=1===r.length?r[0]:void 0,{data:b,loading:v}=c.useEffectiveConfig({id:f},{skip:!f}),y=o(()=>({rollout:{automaticRolloutDisabled:b?.rollout?.automaticRolloutDisabled??!1}}),[b]),{formData:C,areFormValuesEqual:S,handleFormChange:x,resetFormData:w}=qt(y);a(()=>{y&&w(y)},[y]);const T=o(()=>r.length>1||!S(y,C),[r.length,y,C]);return t(pr,{isOpen:!0,onClose:n,onSave:async()=>await(c.applyConfigurations?.(C,r))??void 0,header:{icon:bl,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:p},filters:e(ie,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{size:Et.S,label:"Selected",value:u.showOnlySelected,onChange:e=>h(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:v,leftColumn:{width:"35%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(ee,{size:te.XS,children:"Clusters"}),t(ce,{label:m.length,status:Pe.Unknown})]}),e(ie,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,align:"right",children:"Selected clusters"}),t(ce,{label:`${r.length}/${m.length}`,status:Pe.Unknown})]})]}),list:m.map(e=>t(ds,{title:e.name,isChecked:r.includes(e.id),onClick:()=>g(e.id),onCheckboxChange:()=>g(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:C.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e),size:Et.S},"automatic-rollout-disabled")]}})},xp=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=Fe(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},wp=({onClose:i,destinationId:r})=>{const s=v(),{isK8s:c}=S(),{destinationsApi:u}=Sr(),{selectedStreamName:h}=it(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=xr();a(()=>{g()},[]);const T=p(null),[k,I]=l(!1),[N,E]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty,R=o(()=>en(m,h),[m,h]),D=o(()=>R?.find(e=>Wt(e)===r),[r,R]),P=f?.destinationCategories?.categories??null;a(()=>{D&&P&&C(D,P)},[D,P]);const _=o(()=>D&&P?tn(P,D):[],[D,P]),L=d(()=>{D&&I(!0)},[D]),F=d(()=>{D&&P&&(C(D,P),I(!1))},[D,P,C]),M=d(()=>{A?$("close"):i()},[A,i]),z=d(()=>{A?$("cancel"):F()},[A,F]),X=d(()=>{const e=O;$(null),"close"===e?(F(),i()):F()},[O,F,i]),B=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,ze(t)),I(!1))}},[D,x,u]),U=d(()=>{D&&E(!0)},[D]),V=d(async()=>{D&&(await u.remove(D.id),i())},[D,u,i]);if(!D)return null;const{icon:H,iconSrc:j}=wt(D.destinationType.type),G=((e,t)=>{const n=[],i=Zt(e,t),o=i.map(e=>({name:e.key,value:e.value})),a=Fe(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return i.forEach(({key:e,name:i,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Qt(h,a,o))return;const{type:g}=kt(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},i)=>{t==s&&l.push({id:`${e}-custom-${i}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:i,label:new Array(10).fill("•").join("")});else{if(p===jt.MultiInput){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:i,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(p===jt.KeyValuePair){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"pairs",id:e,title:i,items:t.map((t,n)=>{const i=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=i.key?String(i.key):"",label:null!=i.value?String(i.value):""}})})}l.push({id:e,title:i,label:s})}else l.push({id:e,title:i,label:"-"})}),r(),n})(D,_);return e(n,{children:[t(Xt,{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:Ka,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Va,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:B}]:[]},children:t(le,{$padding:"4px 12px 12px",children:b?t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})}):k&&y?t(Ls,{ref:T,isEdit:!0}):t(ae,{$gap:16,children:e(Gt,{bgTint:"1000",children:[e(Gt,{bgTint:"900",children:[c&&t(Yt,{conditions:D.conditions||[]}),t(Gt,{bgTint:"800",cellsPerRow:2,items:xp(D)})]}),!!G.length&&t(Gt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Gt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Gt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(mr,{target:"destination",isOpen:N,onClose:()=>E(!1),onApprove:V}),t(hr,{isOpen:null!==O,onClose:()=>$(null),onApprove:X})]})},Tp=(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},kp=({onClose:i,ruleId:r})=>{const s=v(),{addNotification:c}=nn(),{isK8s:p,platformType:u,version:h}=S(),m=Je(u,h),{instrumentationRulesApi:g}=Sr(),{items:f,refetch:b}=g.useRules(),{selectedOption:y,loadRule:C,validateFormData:x,genericForm:w}=wr();a(()=>{b()},[]);const[T,k]=l(!1),[I,N]=l(!1),[E,O]=l(null),$=T&&!!w?.isFormDirty,{options:A}=g.useRuleTypes(),R=o(()=>A.length?A:It,[A]),D=o(()=>f?.find(e=>Wt(e)===r),[r,f]),P=o(()=>R.find(({type:e})=>e===D?.type)??null,[R,D?.type]),_=o(()=>qe(P?.supportedLanguages),[P?.supportedLanguages]);a(()=>{D&&P&&C(D,P)},[D,P]);const L=d(()=>{if(D){if(!D.mutable)return void c({type:Pe.Warning,title:Ke.FORBIDDEN,message:Ke.CANNOT_EDIT_RULE,crdType:Nt.InstrumentationRule,target:D.ruleId,hideFromHistory:!0});k(!0)}},[D,c]),F=d(()=>{D&&P&&(C(D,P),k(!1))},[D,P,C]),M=d(()=>{$?O("close"):i()},[$,i]),z=d(()=>{$?O("cancel"):F()},[$,F]),X=d(()=>{const e=E;O(null),"close"===e?(F(),i()):F()},[E,F,i]),B=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await g.update(D.ruleId,t,D.type),k(!1))}},[D,x,g]),U=d(()=>{if(D){if(!D.mutable)return void c({type:Pe.Warning,title:Ke.FORBIDDEN,message:Ke.CANNOT_DELETE_RULE,crdType:Nt.InstrumentationRule,target:D.ruleId,hideFromHistory:!0});N(!0)}},[D,c]),V=d(async()=>{D&&(await g.remove(D.ruleId,D.type),i())},[D,g,i]);if(!D||!P)return null;const H=(j=D,G=P,G?.fields?.length?Ht(j,G.fields,{skipComponentTypes:[jt.SourceScopes]}):[]);var j,G;return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:an(D.type),title:P.label,onClose:M,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:Ka,active:T,onClick:L},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Va,color:s.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:T?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:z},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:B}]:[]},children:t(le,{$padding:"4px 12px 12px",children:T&&y?t(Hs,{}):t(ae,{$gap:16,children:e(Gt,{bgTint:"1000",children:[p&&t(Yt,{conditions:D.conditions||[]}),t(Gt,{bgTint:"800",cellsPerRow:2,items:Tp(D,P)}),m&&t(tr,{readOnly:!0,scopes:D.sourceScopes??null}),P.type===Ye.CustomInstrumentation&&!!D.customInstrumentations?.[We.Php]?.length&&t(De,{status:Pe.Warning,message:Ke.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!H.length&&t(Gt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:yp(H)}),!!_.length&&t(Gt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Gt,{bgTint:"800",children:t(ie,{$gap:12,$wrap:"wrap",children:_.map(e=>t(on,{label:et(e),leftIcon:Qe(e),flex:_.length>1?"0.5":"1"},e))})})})]})})})}),t(mr,{target:"instrumentation rule",isOpen:I,onClose:()=>N(!1),onApprove:V}),t(hr,{isOpen:null!==E,onClose:()=>O(null),onApprove:X})]})};var Ip;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(Ip||(Ip={}));const Np=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:i,namespace:a,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=ln(),{platformType:m,version:g}=S(),f=rn(m,g),b=sn(!!n),v=o(()=>({title:l,icon:vl,withCopy:!0}),[l]),y=o(()=>{const e=[],t=cn(c);t&&e.push(t);const n=cn(d,hl,"health");n&&e.push(n);const i=cn(p,yl,"health");return i&&e.push(i),e},[c,d,p]),C=o(()=>i?[{id:`restart-pod-${l}`,icon:fl,label:Ft.RESTART_POD,onClick:()=>i(a,l)}]:void 0,[i,a,l]),x=o(()=>[{id:"nodeName",title:nt.NODE,label:r,withCopy:!0},{id:"age",title:nt.AGE,label:s?h(s,{style:"short"}):f?nt.NOT_RUNNING:nt.UNKNOWN_VALUE,labelTooltip:s||(f?void 0:nt.START_TIME_UNAVAILABLE)}],[r,s,h,f]);return t("div",{ref:b,children:t(Gt,{bgTint:"900",richTitle:v,badges:y,dropDataActions:C,items:x,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},Ep=b.div`
|
|
536
|
+
`,bu=({isTesting:i,error:n,result:o})=>{const r=v(),{CopyButton:l}=Pt(),s=a(()=>o?.checks.filter(e=>!e.passed)??[],[o]),c=!(i||!n&&(!o||o.success)),d=n?it.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||it.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=n||s.map(e=>e.message).filter(Boolean).join("\n");return t(nu,{children:t(au,{children:i?t(ou,{children:t(ru,{children:t(xt,{withVisual:!0,withGradient:!0,title:it.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:te.XS})})}):c?t(ou,{children:e(lu,{children:[t(su,{children:t(Kr,{size:20,fill:r.v2.colors.black[500]})}),t(ee,{size:te.XS,weight:400,lineHeight:"20px",color:ie.Primary,children:it.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(ee,{align:"center",size:te.XXXS,weight:400,lineHeight:"normal",color:ie.Secondary,children:d}),p&&e(cu,{children:[t(du,{children:p}),t(l,{value:p})]})]})}):o?e(pu,{children:[t(ce,{status:Le.Success,label:it.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Gr,fullWidth:!0}),(o.accountId||o.identity)&&e(uu,{children:[o.accountId&&e(hu,{children:[e(ee,{size:te.XXS,weight:500,color:ie.Secondary,children:[it.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(ee,{size:te.XXS,weight:400,color:ie.Primary,children:o.accountId})]}),o.identity&&e(hu,{children:[e(ee,{size:te.XXS,weight:500,color:ie.Secondary,children:[it.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(ee,{size:te.XXS,weight:400,color:ie.Primary,children:o.identity})]})]}),o.checks.length>0&&t(gu,{children:o.checks.map(i=>e(mu,{$passed:i.passed,children:[t(ce,{status:i.passed?Le.Success:Le.Error,label:i.displayName,leftIcon:i.passed?Gr:Kr}),i.message&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ie.Secondary,children:i.message}),!i.passed&&i.remediation&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ie.Primary,children:i.remediation})]},i.name))})]}):t(ou,{children:t(ee,{size:te.XXS,weight:400,color:ie.Secondary,children:it.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var fu;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(fu||(fu={}));const vu=fu.SelectProvider,yu=fu.Validate,Su=({onClose:i,withOverlay:n,onCreateCloudConnector:o,onCreated:l})=>{const{providers:s,genericForm:c}=Ps(),[p,u]=r(vu),[h,g]=r(!1),[m,b]=r(!1),[f,v]=r(void 0),[y,S]=r(void 0),[x,C]=r(void 0),w=c.isFormDirty,k=p===vu,T=p===yu,$=d(()=>{w&&!h?g(!0):(g(!1),i?.())},[w,h,i]),I=d(()=>{C(void 0),S(void 0),v(void 0),u(e=>e>vu?e-1:e)},[]),N=d(()=>{if(C(void 0),p===fu.SelectProvider){if(!c.formData.provider)return void C("Please select a cloud provider");if(!c.formData.permission)return void C("Please select a permission level")}u(e=>e<yu?e+1:e)},[p,c.formData.provider,c.formData.permission]),O=d(async()=>{if(C(void 0),S(void 0),v(void 0),!o)return;const{provider:e,permission:t,customCapabilities:i,accountId:n,authMethod:a,credentials:r,name:d}=c.formData,p=s.find(t=>t.provider===e),h=p?.connectorFields?.[0];if(h?.required&&!n.trim())return void C(`Please enter ${h.displayName||h.name}`);if(!a)return void C("Please select an authentication method");const g=((e,t,i)=>{const n=e?.auth?.methods?.find(e=>e.id===t);if(!n)return;const a=e=>!!i[e]?.trim(),o=e=>e?.find(e=>e.required&&!a(e.name)),r=o(n.fields);if(r)return r;if(!n.baseMethods?.length)return;const l=new Map(e?.auth?.methods?.map(e=>[e.id,e])),s=n.baseMethods.some(e=>{const t=l.get(e);return!(!t||t.fields&&0!==t.fields.length)});for(const e of n.baseMethods){const t=l.get(e);if(t?.fields?.length&&(t.fields.some(e=>a(e.name))||!s)){const e=o(t.fields);if(e)return e}}})(p,a,r);if(g)return void C(`Please enter ${g.displayName||g.name}`);const m=((e,t,i)=>{const n=op(e),a=[];return n.forEach(e=>{const n=void 0!==e.instrumentationPermissions;let o=!1,r=!1;switch(t){case ip.DiscoveryOnly:o=!0;break;case ip.DiscoveryInstrumentation:o=!0,r=n;break;case ip.Custom:{const t=i[e.typeName];o=!!t?.discovery,r=!!t?.instrumentation;break}}(o||r)&&a.push({type:e.typeName,discovery:o,instrumentation:r,computePlatforms:!1})}),a})(p,t,i);u(fu.Validate),b(!0);try{const t=await o({provider:e,displayName:d,credentials:r,expectedAccountId:n.trim(),capabilities:m});if(t.created)return void l?.(t.connectorId);v(t.test)}catch(e){S(e instanceof Error?e.message:"Failed to create connector")}finally{b(!1)}},[o,l,c.formData,s]),A=m,E=T&&!m&&(!!y||!!f&&!f.success),D=a(()=>x?{status:Le.Error,message:x}:void 0,[x]),R=a(()=>k?{"data-id":"cloud-connector-cancel",label:zt.CANCEL,variant:$e.Secondary,onClick:$,disabled:A}:{"data-id":"cloud-connector-back",label:zt.BACK,variant:$e.Text,leftIcon:nl,onClick:I,disabled:A},[k,$,I,A]),L=a(()=>{if(T){if(m)return;return E?{"data-id":"cloud-connector-retry",label:zt.RETRY,variant:$e.Primary,rightIcon:ol,onClick:O}:void 0}return p===fu.Config?{"data-id":"cloud-connector-verify",label:zt.VERIFY_AND_CREATE_CONNECTOR,variant:$e.Primary,onClick:O,disabled:A}:{"data-id":"cloud-connector-next",label:zt.NEXT,variant:$e.Primary,onClick:N,disabled:A}},[T,m,E,p,O,N,A]),P=a(()=>[R,L].filter(Boolean),[R,L]);return e(Ft,{width:us,isOpen:!0,hideOverlay:!A&&!n,header:{icon:el,title:it.CREATE_CLOUD_CONNECTOR,onClose:i?$:void 0,onCloseDisabled:A},footer:{note:D,actions:P},children:[p===fu.SelectProvider&&t(Op,{}),p===fu.Config&&t(iu,{onBack:I}),p===fu.Validate&&t(bu,{isTesting:m,error:y,result:f}),t(hs,{isOpen:h,onClose:()=>g(!1),onApprove:()=>i?.()})]})},xu=({statuses:e})=>{const i=a(()=>Bt(e).map(({status:e,type:t,reason:i,message:n})=>({status:e,title:Vt(i||t),subTitle:n??void 0})),[e]);return i.length?t(oe,{$gap:12,children:i.map(e=>t(Ut,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},Cu=(e,t)=>{const i=[{id:"type",title:it.TYPE,label:t.label},{id:"status",title:it.STATUS,badge:{status:e.disabled?Le.Unknown:Le.Success,label:e.disabled?it.DISABLED:it.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&i.push({id:"signals",title:it.SIGNALS_FOR_PROCESSING,label:n}),e.name&&i.push({id:"name",title:it.NAME,label:e.name}),e.notes&&i.push({id:"notes",title:it.NOTES,label:e.notes}),i},wu=e=>e.map(e=>"cells"===e.kind?t(Gt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):"list"===e.kind||"pairs"===e.kind?t(Gt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id):t(Gt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:e.items?.length?2:void 0,items:e.items,children:e.segments?.length?wu(e.segments):null},e.id)),ku=({onClose:n,actionId:l})=>{const s=v(),{isK8s:c,platformType:u,version:h}=x(),{actionsApi:g}=ws(),{items:m,refetch:b}=g.useActions(),{options:f}=g.useActionTypes(),{selectedOption:y,loadAction:S,validateFormData:C,genericForm:w}=Cs(),k=p(b);k.current=b,o(()=>{k.current()},[]);const[T,$]=r(!1),[I,N]=r(!1),[O,A]=r(null),E=T&&!!w?.isFormDirty;o(()=>{if(T)return;const e=setInterval(()=>k.current(),3e3);return()=>clearInterval(e)},[T]);const D=a(()=>m?.find(e=>Kt(e)===l),[l,m]),R=a(()=>f.find(({type:e})=>e===D?.type)??gt(u,h).find(({type:e})=>e===D?.type)??Wt.find(({type:e})=>e===D?.type)??null,[f,D?.type,u,h]),L=D?.statuses&&Array.isArray(D.statuses)?D.statuses:null;o(()=>{D&&S(D,R)},[D,R]);const P=d(()=>{D&&$(!0)},[D]),M=d(()=>{D&&(S(D,R),$(!1))},[D,R,S]),z=d(()=>{E?A("close"):n()},[E,n]),X=d(()=>{E?A("cancel"):M()},[E,M]),_=d(()=>{const e=O;A(null),"close"===e?(M(),n()):M()},[O,M,n]),F=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=C();e||(await g.update(D.id,t),$(!1))}},[D,C,g]),B=d(()=>{D&&N(!0)},[D]),V=d(async()=>{D&&(await g.remove(D.id,D.type),n())},[D,g,n]);if(!D||!R)return null;const U=(j=D,H=R,H?.fields?.length?jt(j.fields||{},H.fields,{signals:j.signals||[],skipComponentTypes:[Ht.SourceScopes]}):[]);var j,H;const G=R.fields?.find(e=>e.componentType===Ht.SourceScopes),K=G?.name||de.Scopes,W=D.fields?.[K]??null,Y=c&&(!!G||void 0!==D.fields?.scopes);return e(i,{children:[t(Ft,{isOpen:!0,header:{icon:qt(D.type),title:R.label,onClose:z,actions:[{id:"edit-action-btn-edit",label:zt.EDIT,icon:zr,active:T,onClick:P},{id:"edit-action-btn-delete",label:zt.DELETE,icon:Dr,color:s.v2.colors.red[500],active:I,onClick:B}]},footer:{actions:T?[{"data-id":"edit-action-btn-cancel",label:zt.CANCEL,variant:$e.Secondary,onClick:X},{"data-id":"edit-action-btn-save",label:zt.SAVE,variant:$e.Primary,onClick:F}]:[]},children:t(re,{$padding:"4px 12px 12px",children:T&&y?t(Mc,{}):t(oe,{$gap:16,children:e(Gt,{bgTint:"1000",children:[c&&(L?t(xu,{statuses:L}):t(Yt,{conditions:D.conditions||[]})),t(Gt,{bgTint:"800",cellsPerRow:2,items:Cu(D,R)}),Y&&t(ts,{readOnly:!0,scopes:W}),!!U.length&&t(Gt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:wu(U)})]})})})}),t(gs,{target:"action",isOpen:I,onClose:()=>N(!1),onApprove:V}),t(hs,{isOpen:null!==O,onClose:()=>A(null),onApprove:_})]})},Tu=({onClose:i,connections:n,selectedConnectionIds:l,setSelectedConnectionIds:s})=>{const{configApi:c}=ws(),[d,p]=r(""),[u,h]=r({showOnlySelected:!1}),g=a(()=>n.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),i=!u.showOnlySelected||u.showOnlySelected&&l.includes(e.id);return t&&i}),[n.length,l.length,d,u]),m=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===l.length?l[0]:void 0,{data:f,loading:v}=c.useEffectiveConfig({id:b},{skip:!b}),y=a(()=>({rollout:{automaticRolloutDisabled:f?.rollout?.automaticRolloutDisabled??!1}}),[f]),{formData:S,areFormValuesEqual:x,handleFormChange:C,resetFormData:w}=Jt(y);o(()=>{y&&w(y)},[y]);const k=a(()=>l.length>1||!x(y,S),[l.length,y,S]);return t(ps,{isOpen:!0,onClose:i,onSave:async()=>await(c.applyConfigurations?.(S,l))??void 0,header:{icon:rl,title:"Cluster Configuration"},connectionIds:{value:l,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:p},filters:e(ne,{$gap:8,children:[t(ee,{size:te.XXXS,color:ie.Secondary,nowrap:!0,children:"Show only:"}),t(me,{size:Nt.S,label:"Selected",value:u.showOnlySelected,onChange:e=>h(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:k,isFetching:v,leftColumn:{width:"35%",header:e(ne,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ne,{$gap:8,children:[t(ee,{size:te.XS,children:"Clusters"}),t(ce,{label:g.length,status:Le.Unknown})]}),e(ne,{$gap:8,children:[t(ee,{size:te.XXXS,color:ie.Secondary,align:"right",children:"Selected clusters"}),t(ce,{label:`${l.length}/${g.length}`,status:Le.Unknown})]})]}),list:g.map(e=>t(uc,{title:e.name,isChecked:l.includes(e.id),onClick:()=>m(e.id),onCheckboxChange:()=>m(e.id)},e.id))},rightColumn:{width:"65%",header:t(ee,{size:te.XS,children:"Configurations"}),list:[t(me,{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=>C("rollout.automaticRolloutDisabled",e),size:Nt.S},"automatic-rollout-disabled")]}})},$u=e=>{const t=[{id:"type",title:it.TYPE,label:e.destinationType.displayName},{id:"status",title:it.STATUS,badge:{status:e.disabled?Le.Unknown:Le.Success,label:e.disabled?it.DISABLED:it.ENABLED}}],i=ze(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return i&&t.push({id:"monitors",title:it.MONITORS,label:i}),e.name&&t.push({id:"name",title:it.NAME,label:e.name}),t},Iu=({onClose:n,destinationId:l})=>{const s=v(),{isK8s:c}=x(),{destinationsApi:u}=ws(),{selectedStreamName:h}=nt(),{items:g,refetch:m}=u.useDestinations(),{data:b,loading:f}=u.useDestinationCategories(),{activeForm:y,loadDestination:S,validateFormData:C,genericForm:w}=ks();o(()=>{m()},[]);const k=p(null),[T,$]=r(!1),[I,N]=r(!1),[O,A]=r(null),E=T&&!!w?.isFormDirty,D=a(()=>ei(g,h),[g,h]),R=a(()=>D?.find(e=>Kt(e)===l),[l,D]),L=b?.destinationCategories?.categories??null;o(()=>{R&&L&&S(R,L)},[R,L]);const P=a(()=>R&&L?ti(L,R):[],[R,L]),M=d(()=>{R&&$(!0)},[R]),z=d(()=>{R&&L&&(S(R,L),$(!1))},[R,L,S]),X=d(()=>{E?A("close"):n()},[E,n]),_=d(()=>{E?A("cancel"):z()},[E,z]),F=d(()=>{const e=O;A(null),"close"===e?(z(),n()):z()},[O,z,n]),B=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=C();e||(await u.update(R.id,_e(t)),$(!1))}},[R,C,u]),V=d(()=>{R&&N(!0)},[R]),U=d(async()=>{R&&(await u.remove(R.id),n())},[R,u,n]);if(!R)return null;const{icon:j,iconSrc:H}=wt(R.destinationType.type),G=((e,t)=>{const i=[],n=Zt(e,t),a=n.map(e=>({name:e.key,value:e.value})),o=ze(e.exportedSignals);let r=[];const l=()=>{r.length&&(i.push({kind:"cells",id:`cells-${i.length}`,items:r}),r=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&Qt(h,o,a))return;const{type:m}=Tt(u,{type:""}),b=d||"password"===m;if(g?.length)g.forEach(({condition:t,...i},n)=>{t==s&&r.push({id:`${e}-custom-${n}`,title:i.title,label:i.value})});else if(s)if(b)r.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(p===Ht.MultiInput){const t=Tt(s,null);if(Array.isArray(t)&&t.length)return l(),void i.push({kind:"list",id:e,title:n,items:t.map((t,i)=>({id:`${e}-${i}`,label:String(t)}))})}if(p===Ht.KeyValuePair){const t=Tt(s,null);if(Array.isArray(t)&&t.length)return l(),void i.push({kind:"pairs",id:e,title:n,items:t.map((t,i)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${i}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}r.push({id:e,title:n,label:s})}else r.push({id:e,title:n,label:"-"})}),l(),i})(R,P);return e(i,{children:[t(Ft,{isOpen:!0,header:{icon:j,iconSrc:H,title:R.name||R.destinationType.displayName,onClose:X,actions:[{id:"edit-destination-btn-edit",label:zt.EDIT,icon:zr,active:T,onClick:M},{id:"edit-destination-btn-delete",label:zt.DELETE,icon:Dr,color:s.v2.colors.red[500],active:I,onClick:V}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:zt.CANCEL,variant:$e.Secondary,onClick:_},...y?.option.testConnectionSupported&&c?[{"data-id":"edit-destination-btn-test-connection",label:zt.TEST_CONNECTION,variant:$e.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:zt.SAVE,variant:$e.Primary,onClick:B}]:[]},children:t(re,{$padding:"4px 12px 12px",children:f?t(bt,{$height:"50vh",children:t(xt,{withSpinner:!0})}):T&&y?t(Xc,{ref:k,isEdit:!0}):t(oe,{$gap:16,children:e(Gt,{bgTint:"1000",children:[e(Gt,{bgTint:"900",children:[c&&t(Yt,{conditions:R.conditions||[]}),t(Gt,{bgTint:"800",cellsPerRow:2,items:$u(R)})]}),!!G.length&&t(Gt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Gt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Gt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(gs,{target:"destination",isOpen:I,onClose:()=>N(!1),onApprove:U}),t(hs,{isOpen:null!==O,onClose:()=>A(null),onApprove:F})]})},Nu=(e,t)=>{const i=[{id:"type",title:it.TYPE,label:t.label},{id:"status",title:it.STATUS,badge:{status:e.disabled?Le.Unknown:Le.Success,label:e.disabled?it.DISABLED:it.ENABLED}}];return e.ruleName&&i.push({id:"name",title:it.NAME,label:e.ruleName}),e.profileName&&i.push({id:"profile",title:it.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&i.push({id:"notes",title:it.NOTES,label:e.notes}),i},Ou=({onClose:n,ruleId:l})=>{const s=v(),{addNotification:c}=ii(),{isK8s:p,platformType:u,version:h}=x(),g=qe(u,h),{instrumentationRulesApi:m}=ws(),{items:b,refetch:f}=m.useRules(),{selectedOption:y,loadRule:S,validateFormData:C,genericForm:w}=Ts();o(()=>{f()},[]);const[k,T]=r(!1),[$,I]=r(!1),[N,O]=r(null),A=k&&!!w?.isFormDirty,{options:E}=m.useRuleTypes(),D=a(()=>E.length?E:$t,[E]),R=a(()=>b?.find(e=>Kt(e)===l),[l,b]),L=a(()=>D.find(({type:e})=>e===R?.type)??null,[D,R?.type]),P=a(()=>Je(L?.supportedLanguages),[L?.supportedLanguages]);o(()=>{R&&L&&S(R,L)},[R,L]);const M=d(()=>{if(R){if(!R.mutable)return void c({type:Le.Warning,title:We.FORBIDDEN,message:We.CANNOT_EDIT_RULE,crdType:It.InstrumentationRule,target:R.ruleId,hideFromHistory:!0});T(!0)}},[R,c]),z=d(()=>{R&&L&&(S(R,L),T(!1))},[R,L,S]),X=d(()=>{A?O("close"):n()},[A,n]),_=d(()=>{A?O("cancel"):z()},[A,z]),F=d(()=>{const e=N;O(null),"close"===e?(z(),n()):z()},[N,z,n]),B=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=C();e||(await m.update(R.ruleId,t,R.type),T(!1))}},[R,C,m]),V=d(()=>{if(R){if(!R.mutable)return void c({type:Le.Warning,title:We.FORBIDDEN,message:We.CANNOT_DELETE_RULE,crdType:It.InstrumentationRule,target:R.ruleId,hideFromHistory:!0});I(!0)}},[R,c]),U=d(async()=>{R&&(await m.remove(R.ruleId,R.type),n())},[R,m,n]);if(!R||!L)return null;const j=(H=R,G=L,G?.fields?.length?jt(H,G.fields,{skipComponentTypes:[Ht.SourceScopes]}):[]);var H,G;return e(i,{children:[t(Ft,{isOpen:!0,header:{icon:ai(R.type),title:L.label,onClose:X,actions:[{id:"edit-rule-btn-edit",label:zt.EDIT,icon:zr,active:k,onClick:M},{id:"edit-rule-btn-delete",label:zt.DELETE,icon:Dr,color:s.v2.colors.red[500],active:$,onClick:V}]},footer:{actions:k?[{"data-id":"edit-rule-btn-cancel",label:zt.CANCEL,variant:$e.Secondary,onClick:_},{"data-id":"edit-rule-btn-save",label:zt.SAVE,variant:$e.Primary,onClick:B}]:[]},children:t(re,{$padding:"4px 12px 12px",children:k&&y?t(Gc,{}):t(oe,{$gap:16,children:e(Gt,{bgTint:"1000",children:[p&&t(Yt,{conditions:R.conditions||[]}),t(Gt,{bgTint:"800",cellsPerRow:2,items:Nu(R,L)}),g&&t(ts,{readOnly:!0,scopes:R.sourceScopes??null}),L.type===Ye.CustomInstrumentation&&!!R.customInstrumentations?.[Ke.Php]?.length&&t(Re,{status:Le.Warning,message:We.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!j.length&&t(Gt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:wu(j)}),!!P.length&&t(Gt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Gt,{bgTint:"800",children:t(ne,{$gap:12,$wrap:"wrap",children:P.map(e=>t(ni,{label:et(e),leftIcon:Qe(e),flex:P.length>1?"0.5":"1"},e))})})})]})})})}),t(gs,{target:"instrumentation rule",isOpen:$,onClose:()=>I(!1),onApprove:U}),t(hs,{isOpen:null!==N,onClose:()=>O(null),onApprove:F})]})};var Au;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(Au||(Au={}));const Eu=({collapseIsDefaultOpen:e,isJumpToTarget:i,onClickRestartPod:n,namespace:o,podName:r,nodeName:l,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=oi(),{platformType:g,version:m}=x(),b=ri(g,m),f=li(!!i),v=a(()=>({title:r,icon:ll,withCopy:!0}),[r]),y=a(()=>{const e=[],t=si(c);t&&e.push(t);const i=si(d,il,"health");i&&e.push(i);const n=si(p,sl,"health");return n&&e.push(n),e},[c,d,p]),S=a(()=>n?[{id:`restart-pod-${r}`,icon:ol,label:zt.RESTART_POD,onClick:()=>n(o,r)}]:void 0,[n,o,r]),C=a(()=>[{id:"nodeName",title:it.NODE,label:l,withCopy:!0},{id:"age",title:it.AGE,label:s?h(s,{style:"short"}):b?it.NOT_RUNNING:it.UNKNOWN_VALUE,labelTooltip:s||(b?void 0:it.START_TIME_UNAVAILABLE)}],[l,s,h,b]);return t("div",{ref:f,children:t(Gt,{bgTint:"900",richTitle:v,badges:y,dropDataActions:S,items:C,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},Du=f.div`
|
|
533
537
|
display: flex;
|
|
534
538
|
align-items: center;
|
|
535
539
|
justify-content: space-between;
|
|
@@ -537,7 +541,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
537
541
|
padding: ${({$noPadding:e})=>e?"0":"12px"};
|
|
538
542
|
border-radius: 12px;
|
|
539
543
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
540
|
-
`,
|
|
544
|
+
`,Ru=({podsOdigosHealthStatus:i,pods:n,noPadding:o})=>{const r=di(i?.status),l=Vt(i?.name),s=i?.message,{totalPodsCount:c,odigosHealthyPodsCount:d,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:n?.length||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===ci.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===ci.Success?1:0),0)||0}),[n]);return n?.length&&i&&r?e(Du,{$noPadding:o,children:[t(Ut,{invertColors:!0,hideBackground:!0,status:r,title:l,subTitle:s}),e(ne,{$gap:8,children:[t(Pu,{label:it.PODS,count:c}),t(Pu,{label:it.ODIGOS_HEALTHY,icon:il,count:d,total:c}),t(Pu,{label:it.KUBERNETES_HEALTHY,icon:sl,count:p,total:c})]})]}):null},Lu=f.div`
|
|
541
545
|
display: flex;
|
|
542
546
|
flex-direction: column;
|
|
543
547
|
justify-content: center;
|
|
@@ -548,32 +552,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
548
552
|
width: fit-content;
|
|
549
553
|
border-radius: 8px;
|
|
550
554
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
551
|
-
`,
|
|
552
|
-
display: flex;
|
|
553
|
-
align-items: ${({$withHealthBadge:e})=>e?"center":"flex-start"};
|
|
554
|
-
gap: 8px;
|
|
555
|
-
padding: 8px;
|
|
556
|
-
border-radius: 4px;
|
|
557
|
-
&:hover {
|
|
558
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
559
|
-
}
|
|
560
|
-
`,Lp=b(ee)`
|
|
561
|
-
flex: 0 0 ${({$withHealthBadge:e})=>e?"auto":"30%"};
|
|
562
|
-
`,Fp=b(ee)`
|
|
563
|
-
flex: 1 1 auto;
|
|
564
|
-
min-width: 0;
|
|
565
|
-
`,Mp=b(ie)`
|
|
566
|
-
flex: 1 1 auto;
|
|
567
|
-
justify-content: flex-end;
|
|
568
|
-
min-width: 0;
|
|
569
|
-
`,zp=({label:n,value:i,isStandardLibrary:o,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(_p,{$withHealthBadge:r,children:[t(Lp,{size:te.XXS,color:ne.Secondary,$withHealthBadge:r,children:n}),i&&t(Fp,{size:te.XXS,color:ne.Primary,align:"right",children:i}),(o||r)&&e(Mp,{children:[o&&t(ce,{status:Pe.Info,label:nt.STANDARD,textSize:te.XXXS,invertColors:!0}),r&&e(ie,{$gap:4,children:[l&&t(Fp,{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:hl,textSize:te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},Xp=h(null),Bp=({value:e,children:n})=>t(Xp.Provider,{value:e,children:n}),Up=({podContainers:e,sourceContainers:n,jumpToTarget:i})=>{const a=e??[],l=o(()=>({title:nt.CONTAINERS,titleSize:te.XS,badge:{label:a.length}}),[a.length]),r=o(()=>{const e=new Map;return n?.forEach(t=>e.set(t.containerName,t)),e},[n]);return t(Gt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:a.map(e=>{const n=i?.containerName===e.containerName;return t(Hp,{...e,language:hn(r.get(e.containerName)),jumpToTarget:n?i:null},`pod-container-${e.containerName}`)})})})},Vp=b.div`
|
|
555
|
+
`,Pu=({count:i,total:n,label:a,icon:o})=>{const r=v(),l=void 0===n?void 0:i===n?r.v2.colors.green[500]:r.v2.colors.red[500];return e(Lu,{children:[e(ne,{$gap:0,$alignItems:"flex-end",children:[t(ee,{size:te.L,color:l,weight:500,nowrap:!0,children:i}),void 0!==n&&t(ee,{size:te.S,color:l,weight:500,nowrap:!0,children:`/${n}`})]}),e(ne,{$alignItems:"center",$gap:4,children:[o&&t(o,{size:16}),t(ee,{size:te.XXXS,nowrap:!0,children:a})]})]})},Mu=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===pi.PID)??e.identifyingAttributes?.find(({name:e})=>e===pi.VPID);return t?.value??null};var zu;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(zu||(zu={}));const Xu=({overrideProcessNum:i,healthy:n,healthStatus:l,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const p=v(),[u,h]=r(zu.IdentifyingAttributes),g=li(!!d),{tabOptions:m,firstTabValue:b,bothTabsDisabled:f}=a(()=>{const e=c?.some(e=>!1===e.healthy),i=[{value:zu.IdentifyingAttributes,label:it.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:p.v2.colors.purple[500]},{value:zu.InstrumentationLibraries,label:it.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(cl,{...e,fill:p.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:p.v2.colors.purple[500]}];return{tabOptions:i,firstTabValue:i.find(e=>!e.disabled)?.value||i[0].value,bothTabsDisabled:i.every(e=>e.disabled)}},[s,c]);o(()=>{b&&h(b)},[b]);const y=a(()=>{switch(u){case zu.IdentifyingAttributes:return t(oe,{children:s?.map((e,i)=>t(ui,{label:e.name,value:e.value},`attr-${i}-${e.name}`))});case zu.InstrumentationLibraries:return t(oe,{children:c?.map((e,i)=>t(ui,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${i}-${e.name}`))});default:return null}},[u,s,c]),S=a(()=>Mu({overrideProcessNum:i,identifyingAttributes:s}),[i,s]);return t("div",{ref:g,children:e(Gt,{bgTint:"800",richTitle:{title:S?`${it.PROCESS} ${it.PID(S)}`:it.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ee,{color:n?ie.Success:ie.Error,size:te.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:n?Le.Success:Le.Error,leftIcon:il,label:n?it.HEALTHY:it.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!f,collapseIsDefaultOpen:d,children:[!f&&t(ve,{options:m,selected:u,setSelected:h}),!f&&y]})})},_u=h(null),Fu=({value:e,children:i})=>t(_u.Provider,{value:e,children:i}),Bu=({podContainers:e,sourceContainers:i,jumpToTarget:n})=>{const o=e??[],r=a(()=>({title:it.CONTAINERS,titleSize:te.XS,badge:{label:o.length}}),[o.length]),l=a(()=>{const e=new Map;return i?.forEach(t=>e.set(t.containerName,t)),e},[i]);return t(Gt,{bgTint:"800",richTitle:r,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(oe,{$gap:8,children:o.map(e=>{const i=n?.containerName===e.containerName;return t(Uu,{...e,language:hi(l.get(e.containerName)),jumpToTarget:i?n:null},`pod-container-${e.containerName}`)})})})},Vu=f.div`
|
|
570
556
|
display: flex;
|
|
571
557
|
flex-direction: column;
|
|
572
558
|
gap: 12px;
|
|
573
559
|
padding: 8px 12px;
|
|
574
560
|
border-radius: 8px;
|
|
575
561
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
576
|
-
`,
|
|
562
|
+
`,Uu=({language:i,containerName:n,otelDistroName:o,runningStartedTime:r,started:l,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,odigosHealthStatus:h,k8sHealthStatus:g,processes:m,jumpToTarget:b})=>{const f=!!b,v=f&&!b?.processPid,{formatDurationAgo:y}=oi(),{platformType:S,version:C}=x(),w=ri(S,C),k=li(v),T=a(()=>({title:n,icon:i?gi(i):dl,iconWithWrapper:!0}),[n,i]),$=a(()=>{const e=[],t=si({status:o?ci.Success:ci.Disabled,reasonEnum:o?it.INSTRUMENTED_WITH_DISTRO(o):it.UNINSTRUMENTED,message:""});t&&e.push(t);const i=si(h,il,"health");i&&e.push(i);const n=si(g,sl,"health");return n&&e.push(n),e},[g,h,o]),I=a(()=>{const e=[{id:"runningTime",title:it.RUNNING_TIME,label:r?y(r,{style:"short"}):w?it.NOT_RUNNING:it.UNKNOWN_VALUE,labelTooltip:r?`${it.RUNNING_TIME_TOOLTIP}. (${r})`:w?it.RUNNING_TIME_TOOLTIP:it.START_TIME_UNAVAILABLE},{id:"blank",spacer:!0},{id:"started",badge:{status:l?Le.Success:Le.Disabled,leftIcon:l?Br:Vr,label:l?it.STARTED:it.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Le.Success:Le.Disabled,leftIcon:s?Br:Vr,label:s?it.READY:it.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}];return d&&e.push({id:"isCrashLoop",badge:{status:Le.Error,leftIcon:Vr,label:it.CRASHLOOP,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}),e.push({id:"restartCount",title:it.RESTARTS,badge:{status:c?Le.Error:void 0,label:c||0,textSize:te.XXXS}}),e},[r,y,l,s,d,c,w]),N=a(()=>u?Vt(p):"",[u,p]);return t("div",{ref:k,children:e(Gt,{bgTint:"750",richTitle:T,badges:$,items:I,withCollapse:!0,collapseIsDefaultOpen:f,children:[u&&t(Vu,{children:e(ne,{$gap:10,$alignItems:"center",children:[t(ni,{variant:mi.Pink,leftIcon:sl,label:N}),t(ee,{size:te.XXXS,color:ie.Error,children:u})]})}),(m??[]).map((e,i)=>{const a=i+1,o=f&&(r=b,l=e,!!r?.processPid&&Mu({identifyingAttributes:l.identifyingAttributes})===r.processPid);var r,l;return t(Xu,{...e,overrideProcessNum:a,isJumpToTarget:o},`pod-container-${n}-process-${a}`)})]})})},ju=({podName:e,namespace:i,hasRestarted:n})=>{const o=a(()=>({title:it.DEBUG_COMMANDS,titleSize:te.XS}),[]),r=a(()=>[{label:it.GET_POD_YAML,value:`kubectl get pod ${e} -n ${i} -o yaml`},{label:it.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${i}`},{label:it.GET_POD_LOGS,value:`kubectl logs ${e} -n ${i}${n?" -p":""}`}],[e,i,n]);return t(Gt,{bgTint:"800",richTitle:o,withCollapse:!0,children:r.map(({label:e,value:i})=>t(bi,{bgTint:"700",label:e,value:i},e))})},Hu=({source:n,onClickRestartPod:o})=>{const{jumpToTarget:r}=(()=>{const e=g(_u);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),l=r?.tab===Au.Pods?r:null,s=n?.pods??[],c=s.length>0,d=a(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),p=a(()=>({title:it.PODS,badge:{label:s.length}}),[s.length]);return t(oe,{$gap:12,children:c?e(i,{children:[t(Ru,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(Gt,{bgTint:"1000",richTitle:p,children:s.map(i=>{const a=l?.podName===i.podName,r=a&&!l?.containerName;return e(Eu,{...i,namespace:n.id.namespace,onClickRestartPod:o,collapseIsDefaultOpen:a,isJumpToTarget:r,children:[t(ju,{podName:i.podName,namespace:n.id.namespace,hasRestarted:d}),t(Bu,{podContainers:i.containers,sourceContainers:n.containers,jumpToTarget:a?l:null})]},`pod-${i.podName}`)})})]}):t(bt,{$height:"70vh",children:t(Ae,{title:it.NO_RUNNING_PODS,subTitle:it.NO_RUNNING_PODS_SUBTITLE})})})},Gu="user",Ku=({source:i})=>{const n=a(()=>i.serviceName||i.id.name,[i]),{sourcesApi:o}=ws(),{data:r,loading:l,refetch:s}=o.usePeerSources({serviceName:n},{fetchPolicy:"network-only"}),c=r?.peerSources??null;return!c||l?t(bt,l?{$height:"70vh",children:t(xt,{withSpinner:!0})}:{$height:"70vh",children:t(Ae,{subTitle:it.COULD_NOT_FETCH_PEER_SOURCES})}):e(ne,{$gap:16,$alignItems:"flex-start",children:[t(Wu,{icon:pl,title:it.INBOUND,subTitle:it.INBOUND_DESCRIPTION(n),onRefresh:s,items:c?.inbound??[]}),t(Wu,{icon:ul,title:it.OUTBOUND,subTitle:it.OUTBOUND_DESCRIPTION(n),onRefresh:s,items:c?.outbound??[]})]})},Wu=({icon:i,title:n,subTitle:o,onRefresh:l,items:s})=>{const[c,d]=r(""),p=a(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(Gt,{bgTint:"1000",richTitle:{icon:i,title:n,titleSize:te.XS,subTitle:o,subTitleSize:te.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:fi.Button,buttonProps:{variant:$e.Secondary,size:Te.S,leftIcon:ol,onClick:l}}],children:[t(vi,{value:c,onChange:d,width:"100%"}),t(yi,{height:"calc(100vh - 284px)",gap:4,elements:p.length||c?!p.length&&c?[t(bt,{$height:"50vh",children:t(Ae,{icon:i,title:it.NO_RESULTS,subTitle:it.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:p.map(e=>t(qu,{...e},`${n}-${e.serviceName}`)):[t(bt,{$height:"50vh",children:t(Ae,{icon:i,title:`No ${n} connections yet`,subTitle:n===it.INBOUND?it.NO_INBOUND_CONNECTIONS_DESCRIPTION:it.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Yu=f.div`
|
|
577
563
|
display: flex;
|
|
578
564
|
align-items: center;
|
|
579
565
|
justify-content: space-between;
|
|
@@ -587,9 +573,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
587
573
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
588
574
|
}
|
|
589
575
|
`}
|
|
590
|
-
`,
|
|
576
|
+
`,qu=({serviceName:i,isVirtual:n,nodeAttributes:o})=>{const r=Si(e=>e.drawerEntityId),{items:l}=ws().sourcesApi.useSources(),s=a(()=>l.find(e=>e.id.name===i||e.serviceName===i),[l,i]),c=a(()=>s&&JSON.stringify(xi(s))!==JSON.stringify(xi(r)),[s,r]),d=a(()=>{if(n){const e=Object.fromEntries((o??[]).map(({key:e,value:t})=>[e,t]));return[Ci({serviceName:i,attributes:e})]}if(i?.toLowerCase()===Gu)return[hl];const e=s?wi(s):void 0;return e?.length?e:[dl]},[n,o,i,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Si.getState();e(Ti(It.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??"",region:s?.id.region??""})}:void 0;return e(Yu,{onClick:p,$withClick:!!p,children:[e(ne,{$gap:8,children:[t(ki,{icons:d}),t(ee,{size:te.XXS,children:i})]}),n&&t(ce,{status:Le.Info,label:it.VIRTUAL,textSize:te.XXXS,invertColors:!0,tooltip:it.VIRTUAL_TOOLTIP})]})},Ju=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}},Zu=({source:i})=>{const n=v(),{k8sManifestApi:l}=ws(),[s,c]=r(!0),[d,u]=r(void 0),[h,g]=r(!0),[m,b]=r(void 0),[f,y]=r(!0),[S,x]=r({}),C=p(l);C.current=l,o(()=>{C.current.fetch({namespace:i.id.namespace,kind:i.id.kind,name:i.id.name}).then(({data:e})=>u(Ju(e))).finally(()=>c(!1)),C.current.fetch({namespace:i.id.namespace,kind:$i.InstrumentationConfig,name:`${i.id.kind}-${i.id.name}`.toLowerCase()}).then(({data:e})=>b(Ju(e))).finally(()=>g(!1))},[i.id.namespace,i.id.kind,i.id.name]);const w=a(()=>(i.pods??[]).map(e=>e.podName).join(","),[i.pods]);o(()=>{if(Object.keys(S).length>0)return;const e=w?w.split(","):[];if(0===e.length)return x({}),void y(!1);let t=!1;return y(!0),Promise.all(e.map(async e=>{const{data:t}=await C.current.fetch({namespace:i.id.namespace,kind:$i.Pod,name:e});return[e,Ju(t)]})).then(e=>{t||x(Object.fromEntries(e))}).finally(()=>{t||y(!1)}),()=>{t=!0}},[S,w,i.id.namespace]);const k=a(()=>[{label:it.DESCRIBE_POD,value:`kubectl describe ${i.id.kind} ${i.id.name} -n ${i.id.namespace}`},{label:it.GET_POD_YAML,value:`kubectl get ${i.id.kind} ${i.id.name} -n ${i.id.namespace} -o yaml`},{label:it.GET_POD_YAML,value:`kubectl get ${$i.InstrumentationConfig} ${i.id.kind}-${i.id.name} -n ${i.id.namespace} -o yaml`}],[i.id.kind,i.id.name,i.id.namespace]);return e(Gt,{bgTint:"1000",children:[t(Gt,{bgTint:"900",richTitle:{icon:gl,title:it.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:k.map(({label:e,value:i},n)=>t(bi,{label:e,value:i},`debug-cmd-${n}-${e}`))}),s?t(le,{size:1}):t(ms,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:`${i.id.kind} YAML`,yaml:d}),h?t(le,{size:1}):t(ms,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m}),i.pods?.map(e=>f?t(le,{size:1},e.podName):t(ms,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:`Pod ${e.podName} YAML`,yaml:S[e.podName]},e.podName))]})},Qu=({title:i,children:n})=>e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ie.Secondary,children:i}),n]}),eh=({source:i})=>{const n=a(()=>{const[e,t]=Ni(i.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[i]);return t(Qu,{title:it.THROUGHPUT_LAST_10_SECONDS,children:e(ne,{$alignItems:"flex-end",$gap:4,children:[t(ee,{size:te.L,children:n.value}),t(ee,{size:te.XS,variant:Ot.Span,children:n.units})]})})},th=({source:i})=>{const{CopyButton:n}=Pt();return t(Qu,{title:it.NAMESPACE,children:e(ne,{children:[t(ni,{variant:mi.Blue,label:i.id.namespace}),t(n,{value:i.id.namespace})]})})},ih=({source:i})=>{const{CopyButton:n}=Pt(),a=i.id.region;return a?t(Qu,{title:it.REGION,children:e(ne,{children:[t(ni,{variant:mi.Blue,label:a}),t(n,{value:a})]})}):null},nh=({source:e})=>{const i=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(Qu,{title:it.ENABLED,children:t(ne,{children:t(ni,{variant:i?mi.Green:mi.Default,label:i?it.ENABLED:it.DISABLED})})})},ah=({source:e,label:i})=>t(Qu,{title:it.KIND,children:t(ne,{children:t(ni,{variant:mi.Blue,label:i||e.id.kind})})}),oh=({source:i})=>{const{CopyButton:n}=Pt();return t(Qu,{title:it.NAME,children:e(ne,{children:[t(ni,{variant:mi.Blue,label:i.id.name}),t(n,{value:i.id.name})]})})},rh=({source:i})=>{const{CopyButton:n}=Pt(),a=i.serviceName||i.id.name;return t(Qu,{title:it.SERVICE_NAME,children:e(ne,{children:[t(ni,{variant:mi.Blue,label:a}),t(n,{value:a})]})})},lh=({source:i})=>{const{isK8s:n,isConnector:o}=x(),r=a(()=>Ii(i.id.kind),[i.id.kind]);return t(Gt,{children:e(ne,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[n&&t(eh,{source:i}),t(nh,{source:i}),o&&t(ih,{source:i}),n&&t(th,{source:i}),t(ah,{source:i,label:r}),t(oh,{source:i}),!n&&t(rh,{source:i})]})})},sh=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Gt,{bgTint:"900",children:t(Ru,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,ch=({source:e})=>{const i=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?Oi(e.workloadOdigosHealthStatus.status):Le.Unknown,title:Vt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return i?t(Ut,{...i,width:"100%"}):null},dh=h(null),ph=f.div`
|
|
591
577
|
position: relative;
|
|
592
|
-
`,
|
|
578
|
+
`,uh=({children:e})=>{const i=p(null);return t(ph,{ref:i,children:t(dh.Provider,{value:i,children:e})})},hh=f.div`
|
|
593
579
|
position: fixed;
|
|
594
580
|
top: ${({$coords:e})=>e.top}px;
|
|
595
581
|
right: ${({$coords:e})=>e.right}px;
|
|
@@ -603,25 +589,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
603
589
|
padding: 12px 16px;
|
|
604
590
|
border-radius: 12px;
|
|
605
591
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
606
|
-
`,
|
|
592
|
+
`,gh=f.div`
|
|
607
593
|
display: flex;
|
|
608
594
|
align-items: flex-end;
|
|
609
595
|
justify-content: space-between;
|
|
610
596
|
gap: 8px;
|
|
611
|
-
`,
|
|
597
|
+
`,mh=f.div`
|
|
612
598
|
flex: 1;
|
|
613
|
-
`,
|
|
599
|
+
`,bh=({width:i,onClose:n,onSave:a,saveTooltip:o,onDelete:l,deleteTooltip:s,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const b=v(),f=g(dh),[y,S]=r(null);return Ai(f??{current:null},n),m(()=>{const e=f?.current?.getBoundingClientRect();e&&S({top:e.bottom+4,right:window.innerWidth-e.left-24})},[f]),y?oc(e(hh,{$coords:y,$width:i,"data-ignore-outside-click":"true",children:[e(oe,{$gap:4,children:[t(ee,{size:te.XXS,children:c}),t(ee,{size:te.XXXS,color:ie.Secondary,children:d})]}),e(gh,{children:[t(mh,{children:u}),e(ne,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(ke,{variant:$e.Secondary,onClick:l,leftIcon:Dr,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:Te.S,textColor:b.v2.colors.red[500]}),t(ke,{variant:$e.Primary,onClick:a,leftIcon:Gr,tooltip:o,hideTooltipIcon:!0,iconSize:16,size:Te.S})]})]}),t("div",{children:t(Re,{status:Le.Warning,message:p})})]}),document.body):null},fh=({language:i,overridden:n,onOverride:o,defaultValues:l})=>{const{tier:s}=x(),{formData:c,handleFormChange:d,resetFormData:p}=Jt(l),u=a(()=>{if(!i)return[];const e=Ei[i].community,t=s===Di.Onprem?Ei[i].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))},[i,s]),[h,g]=r(!1),[m,b]=r(!1),f=()=>{h||(m&&p(),b(e=>!e))};return e(ne,{$gap:4,$alignItems:"center",children:[n?t(ce,{status:Le.Info,invertColors:!0,label:it.OVERIDDEN}):null,e(uh,{children:[t(Be,{text:it.OVERRIDE_OTEL_DISTRO_NAME,children:t(yt,{icon:zr,onClick:f})}),m&&t(bh,{width:"500px",onClose:f,onSave:async()=>{g(!0),await o(c),g(!1),f()},saveTooltip:it.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await o({otelDistroName:null}),g(!1),f()},deleteTooltip:it.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:it.OVERRIDE_OTEL_DISTRO_NAME,subTitle:it.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:it.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(vt,{label:it.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},vh=({overridden:i,onOverride:n,defaultValues:o,originalValues:l})=>{const{addNotification:s}=ii(),{formData:c,handleFormChange:d,resetFormData:p}=Jt(o),u=a(()=>Ri.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,g]=r(!1),[m,b]=r(!1),f=()=>{h||(m&&p(),b(e=>!e))};return e(ne,{children:[i?t(ce,{status:Le.Info,invertColors:!0,label:it.OVERIDDEN}):null,e(uh,{children:[t(Be,{text:it.OVERRIDE_RUNTIME_DETAILS,children:t(yt,{icon:zr,onClick:f})}),m&&t(bh,{width:"500px",onClose:f,onSave:async()=>{!c.version||Li(c.version)?(g(!0),await n(c),g(!1),f()):s({type:Le.Warning,message:We.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:it.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await n({language:null,version:""}),g(!1),f()},deleteTooltip:it.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:it.OVERRIDE_RUNTIME_DETAILS,subTitle:it.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:it.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(ne,{$gap:8,children:[t(vt,{label:it.LANGUAGE,options:u,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(Ie,{label:it.RUNTIME_VERSION,placeholder:it.VERSION_PLACEHOLDER,value:c.version??"",onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},yh=f.div`
|
|
614
600
|
display: flex;
|
|
615
601
|
flex-direction: column;
|
|
616
602
|
gap: 10px;
|
|
617
603
|
padding: 10px 12px 10px 20px;
|
|
618
604
|
border-radius: 8px;
|
|
619
605
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
620
|
-
`,
|
|
606
|
+
`,Sh=f.div`
|
|
621
607
|
display: flex;
|
|
622
608
|
flex-wrap: wrap;
|
|
623
609
|
gap: 12px 24px;
|
|
624
|
-
`,
|
|
610
|
+
`,xh=({title:i,children:n})=>e(oe,{$gap:4,children:[t(ee,{size:te.XXXS,color:ie.Secondary,children:i}),n]}),Ch=({processes:i})=>{const n=a(()=>[...i].sort((e,t)=>e.pid-t.pid),[i]);return n.length?e(oe,{$gap:6,children:[t(ee,{size:te.XXXS,color:ie.Secondary,children:`${it.PROCESSES} (${n.length})`}),n.map(i=>{const n=i.exe?.trim()||null,a=i.cmdline?.trim()||null;return e(yh,{children:[t(Sh,{children:t(xh,{title:it.PROCESS_PID,children:t(ee,{size:te.XS,children:String(i.pid)})})}),n?t(bi,{label:it.EXECUTABLE,value:n,bgTint:"900"}):null,a&&a!==n?t(bi,{label:it.COMMAND,value:a,bgTint:"900"}):null]},i.pid)})]}):null},wh=f.div`
|
|
625
611
|
display: flex;
|
|
626
612
|
flex-direction: column;
|
|
627
613
|
align-self: stretch;
|
|
@@ -629,14 +615,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
629
615
|
padding: 8px 12px;
|
|
630
616
|
border-radius: 8px;
|
|
631
617
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
632
|
-
`,
|
|
618
|
+
`,kh=f.div`
|
|
633
619
|
display: flex;
|
|
634
620
|
align-items: center;
|
|
635
621
|
justify-content: center;
|
|
636
622
|
padding: 8px;
|
|
637
623
|
border-radius: 10px;
|
|
638
624
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
639
|
-
`,
|
|
625
|
+
`,Th=e=>{if(!e)return Pi.Unknown;const t=e.trim().toLowerCase();return{go:Pi.Go,golang:Pi.Go,javascript:Pi.JavaScript,js:Pi.JavaScript,node:Pi.JavaScript,nodejs:Pi.JavaScript,typescript:Pi.JavaScript,python:Pi.Python,java:Pi.Java,dotnet:Pi.DotNet,csharp:Pi.CSharp,php:Pi.Php,ruby:Pi.Ruby,rust:Pi.Rust,swift:Pi.Swift,elixir:Pi.Elixir}[t]??Pi.Unknown},$h=({source:i})=>{const n=v(),{isK8s:o,isVm:r}=x(),{sourcesApi:l}=ws(),s=i.instrumentationReport,c=i.sourceConfig,d=r?s?.processes:null,p=a(()=>!(!c?.runtimeOverride?.language&&!c?.runtimeOverride?.version),[c]),u=a(()=>{const e=Th(s?.runtimeLanguage);return e!==Pi.Unknown?e:i.runtimeInfo?.detectedLanguages?.[0]??Pi.Unknown},[s?.runtimeLanguage,i.runtimeInfo?.detectedLanguages]),h=s?.runtimeVersion?.trim()||"",g=a(()=>{const e=Th(c?.runtimeOverride?.language);return{language:e!==Pi.Unknown?e:u,version:c?.runtimeOverride?.version?.trim()||h||void 0}},[c,u,h]),m=a(()=>!!c?.distroOverride?.otelDistroName,[c]),b=a(()=>({otelDistroName:c?.distroOverride?.otelDistroName||void 0}),[c]),f=a(()=>{const{language:e,version:t}=g;return e!==Pi.Unknown||t?e!==Pi.Unknown&&t?`${e} • ${t}`:e!==Pi.Unknown?e:t||null:null},[g]),y=!f&&!p&&"Instrumenting"===s?.state,S=a(()=>y||g.language===Pi.Unknown?dl:gi(g.language),[y,g.language]),C=a(()=>{const e=s?.state??"",t=s?.instrumented||"Instrumented"===e,i=c?.distroOverride?.otelDistroName?.trim()||s?.sdkType?.trim();return"Instrumenting"===e?{status:Le.Loading,label:Vt(s?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:Le.Disabled,leftIcon:Vr,label:Vt(e)||e}:"Error"===e?{status:Le.Error,leftIcon:Vr,label:"Error"}:t?{status:Le.Success,leftIcon:Br,label:i?`Instrumented | ${i}`:"Instrumented"}:{status:Le.Disabled,leftIcon:Vr,label:it.UNINSTRUMENTED}},[s,c]),w=e=>l.update(i.id,{...m?b:{},...p?{language:g.language!==Pi.Unknown?g.language:void 0,version:g.version}:{},...e});return o?null:s?t(Gt,{bgTint:"1000",richTitle:{title:it.INSTRUMENTATION,tooltip:it.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(oe,{$gap:8,children:e(wh,{children:[e(ne,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ne,{$gap:8,$alignItems:"center",children:[t(kh,{children:t(S,{size:24,fill:y||g.language===Pi.Unknown?n.v2.colors.grey[400]:void 0})}),t(ee,{children:i.id.name}),y?t(ni,{variant:mi.Loader,label:it.DETECTING_RUNTIME_INFO}):f?t(ni,{variant:mi.Blue,label:f}):null,t(vh,{overridden:p,onOverride:w,defaultValues:{language:g.language!==Pi.Unknown?g.language:void 0,version:g.version||""},originalValues:{language:u!==Pi.Unknown?u:void 0,version:h}})]}),e(ne,{$gap:8,$alignItems:"center",children:[t(ce,{...C,textSize:te.XXXS}),t(fh,{language:g.language!==Pi.Unknown?g.language:null,overridden:m,onOverride:w,defaultValues:b})]})]}),d?.length?t(Ch,{processes:d}):null]})})}):null},Ih="100%",Nh=f(ne)`
|
|
640
626
|
@media (max-width: 1099px) {
|
|
641
627
|
flex-direction: column;
|
|
642
628
|
|
|
@@ -644,12 +630,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
644
630
|
width: 100%;
|
|
645
631
|
}
|
|
646
632
|
}
|
|
647
|
-
|
|
633
|
+
`,Oh=(e,t)=>e?e.toLowerCase().includes(t.toLowerCase())?Vt(e):`${t} ${Vt(e)}`:t,Ah=f(ne)`
|
|
648
634
|
width: fit-content;
|
|
649
635
|
padding: 2px 6px;
|
|
650
636
|
border-radius: 8px;
|
|
651
637
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
652
|
-
`,
|
|
638
|
+
`,Eh=({overview:i,status:n})=>{const a=v(),o=i?[{id:"applied",count:i.totalAgentAppliedPods,ok:i.agentAppliedOk,label:"Agent applied"},{id:"out-of-date",count:i.totalAgentOutOfDatePods,ok:i.agentOutOfDateOk,label:"Agent out of date"},{id:"not-applied",count:i.totalAgentNotAppliedPods,ok:i.agentNotAppliedOk,label:"No agent applied"}].filter(({count:e})=>e>0):[];return o.length?t(Ah,{$gap:12,$wrap:"wrap",children:o.map(({id:o,count:r,ok:l,label:s})=>{const c=l?Le.Success:n,d=zi(c,a);return e(ne,{$gap:2,children:[t(d,{size:16,fill:Mi(a,c,"300")}),t(ee,{size:te.XXXS,color:ie.Secondary,children:`${r}/${i?.totalPods??0} ${s}`})]},o)})}):null},Dh=({changedTime:e})=>{const{formatTimeAgo:i}=oi();return t(ee,{size:te.XXXS,color:ie.Disable,nowrap:!0,children:`Agent Assignment Updated · ${i(e)}`})},Rh=({source:i,onClickRollout:n,onClickRollback:o})=>{const r=i.rollout?.podsManifestInjectionStatus??i.conditions?.rollout,l=a(()=>{const{status:e,reasonEnum:a,message:o,actionItems:l}=r||{},s=di(e);if(!s)return null;const c=Oh(a,it.ROLLOUT),d=o,p=(l??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:ml,onClick:n}]);return{status:s,title:c,subTitle:d,details:t(Eh,{overview:i.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:i.rollout?.agentsMetaHashChangedTime?t(Dh,{changedTime:i.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[i.rollout,r,n]),s=a(()=>{const{status:e,reasonEnum:t,message:n,actionItems:a}=i.autoRollback?.autoRollbackStatus||{},r=di(e);if(!r)return null;const l=Oh(t,it.ROLLBACK),s=n,c=(a??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:ol,onClick:o}]);return c.length||r===Le.Success||c.push({"data-id":"rollback-action",label:it.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:ol,onClick:o}),{status:r,title:l,subTitle:s,actionButtons:c}},[i,o]);return l||s?e(Nh,{$gap:12,$alignItems:"stretch",children:[l&&t(Ut,{invertColors:!0,slim:!0,width:s?"calc(60% - 6px)":Ih,...l}),s&&t(Ut,{invertColors:!0,slim:!0,width:l?"calc(40% - 6px)":Ih,...s})]}):null},Lh="Instrumented",Ph=({source:e})=>{const{isK8s:i}=x(),{containers:n,containersRichTitle:o}=a(()=>{const t=e?.conditions?.runtimeDetection,n=i?`${e.id.kind} ${it.CONTAINERS}`:it.CONTAINERS;return{containers:e?.containers??[],containersRichTitle:{title:n,tooltip:t?.message||it.DETECTED_CONTAINERS_DESCRIPTION,badge:di(t?.status)===Le.Loading?{status:Le.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,i]);return n.length?t(Gt,{bgTint:"1000",richTitle:o,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(oe,{$gap:8,children:n.map(i=>i&&t(_h,{...i,sourceId:e.id},`source-container-${i.containerName}`))})}):null},Mh=f.div`
|
|
653
639
|
display: flex;
|
|
654
640
|
flex-direction: column;
|
|
655
641
|
align-self: stretch;
|
|
@@ -657,26 +643,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
657
643
|
padding: 8px 12px;
|
|
658
644
|
border-radius: 8px;
|
|
659
645
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
660
|
-
`,
|
|
646
|
+
`,zh=f.div`
|
|
661
647
|
display: flex;
|
|
662
648
|
align-items: center;
|
|
663
649
|
justify-content: center;
|
|
664
650
|
padding: 8px;
|
|
665
651
|
border-radius: 10px;
|
|
666
652
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
667
|
-
`,
|
|
653
|
+
`,Xh=f.div`
|
|
668
654
|
display: flex;
|
|
669
655
|
flex-direction: column;
|
|
670
656
|
gap: 12px;
|
|
671
657
|
padding: 8px 12px;
|
|
672
658
|
border-radius: 8px;
|
|
673
659
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
674
|
-
`,
|
|
660
|
+
`,_h=({sourceId:i,...n})=>{const{containerName:o,runtimeInfo:l,agentEnabled:s,overrides:c}=n,d=v(),{isK8s:p}=x(),{sourcesApi:u}=ws(),[h,g]=r(!1),m=a(()=>!!c?.runtimeInfo?.language||!!c?.runtimeInfo?.runtimeVersion,[c]),b=a(()=>({language:hi(n),version:Xi(n)||""}),[n]),f=a(()=>!!c?.otelDistroName,[c]),y=a(()=>({otelDistroName:c?.otelDistroName||n.agentEnabled?.otelDistroName}),[c,n]),S=a(()=>!l&&!m,[l,m]),C=a(()=>S?dl:gi(b.language),[S,b]),w=a(()=>{if(S)return"";const{language:e,version:t}=b;return`${e}${t?` • ${t}`:""}`},[S,b]),k=a(()=>{if(S)return{status:Le.Loading,label:it.WAITING_FOR_RUNTIME_DETECTION};const e=s?.otelDistroName?.trim(),t=p?!!e:!!s?.agentEnabled;return{status:t?Le.Success:Le.Disabled,leftIcon:t?Br:Vr,label:t?e?`${Lh} | ${e}`:Lh:"Uninstrumented",tooltip:s?.agentEnabledStatus?.message}},[S,s,p]),T=e=>u.update(i,{containerName:o,...f?y:{},...m?b:{},...null!=c?.allowConcurrentAgents?{allowConcurrentAgents:c.allowConcurrentAgents}:{},...e}),$=(s?.agentEnabledStatus?.actionItems??[]).flatMap(e=>{let t;if(e.type===_i.AllowConcurrentAgentsForContainer)t=!0;else{if(e.type!==_i.DisallowConcurrentAgentsForContainer)return[];t=!1}return[{type:e.type,label:e.buttonText,onClick:t?()=>g(!0):()=>T({allowConcurrentAgents:!1})}]}),I=a(()=>{const e=[];return n.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(it.HEAD_SAMPLING),(n.collectorConfig?.tailSampling?.noisyOperations?.length||n.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||n.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(it.TAIL_SAMPLING),e},[n]);return e(Mh,{children:[e(ne,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ne,{$gap:8,$alignItems:"center",children:[t(zh,{children:t(C,{size:24,fill:l?void 0:d.v2.colors.grey[400]})}),t(ee,{children:o}),t(ni,w?{variant:mi.Blue,label:w}:{variant:mi.Loader,label:it.DETECTING_RUNTIME_INFO}),t(vh,{overridden:m,onOverride:T,defaultValues:b,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(ne,{$gap:8,$alignItems:"center",children:[t(ce,{...k,textSize:te.XXXS}),t(fh,{language:b.language,overridden:f,onOverride:T,defaultValues:y})]})]}),s&&(!s.agentEnabled||$.length>0)&&!S?t(Xh,{children:e(ne,{$gap:10,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ne,{$gap:10,$alignItems:"center",children:[t(ni,{variant:mi.Pink,label:Vt(s.agentEnabledStatus?.reasonEnum)||it.NO_AVAILABLE_AGENT}),t(ee,{size:te.XXXS,color:ie.Secondary,children:s?.agentEnabledStatus?.message})]}),$.map(e=>t(ke,{"data-id":`container-action-${e.type}`,label:e.label,variant:$e.Secondary,size:Te.S,onClick:e.onClick},e.type))]})}):null,I.length>0&&t(Xh,{children:t(ne,{$gap:16,$wrap:"wrap",children:I.map((e,i)=>t(ce,{label:e,leftIcon:Br,status:Le.Success,invertColors:!0,useSecondaryTone:!0},`${o}-rule-${i}`))})}),t(tt,{isOpen:h,title:"Run Odigos with other agents?",description:"Running multiple instrumentation agents in the same container is not recommended and may affect performance or reliability.",onClose:()=>g(!1),denyButton:{label:"Cancel",variant:$e.Secondary,onClick:()=>g(!1)},approveButton:{label:"Run Odigos With Other Agents",variant:$e.Primary,onClick:async()=>{await T({allowConcurrentAgents:!0}),g(!1)}}})]})},Fh=({source:i,onClickRollout:n,onClickRollback:o})=>{const{isK8s:r,platformType:l,version:s}=x(),c=a(()=>Fi(l,s)?Bt(Bi(i.conditions)):[],[l,s,i.conditions]);return e(oe,{$gap:12,children:[t(lh,{source:i}),t(ch,{source:i}),r&&t(Rh,{source:i,onClickRollout:n,onClickRollback:o}),!!c.length&&t(Yt,{conditions:c,title:it.INSTRUMENTATION_LIFECYCLE}),t(Ph,{source:i}),!r&&!i.containers?.length&&t($h,{source:i}),r&&t(sh,{source:i})]})},Bh=({source:e})=>{const i=e.containers||[];return t(Gt,{bgTint:"1000",richTitle:{title:it.INSTRUMENTED_LIBRARIES},children:i.length?i.map(e=>{const i=e.instrumentations||[];return t(Gt,{bgTint:"800",richTitle:{title:e.containerName,badge:{label:i.length}},withCollapse:!0,collapseIsDefaultOpen:!!i?.length,children:i?.length?t(oe,{children:i.map((e,i)=>t(ui,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${i}-${e.name}`))}):t(Ae,{title:"No libraries found"})},e.containerName)}):t(Ae,{title:"No containers found"})})},Vh=f(oe)`
|
|
675
661
|
width: 100%;
|
|
676
662
|
max-height: 320px;
|
|
677
663
|
overflow-y: auto;
|
|
678
664
|
gap: 8px;
|
|
679
|
-
`,
|
|
665
|
+
`,Uh=f(ne)`
|
|
680
666
|
width: 100%;
|
|
681
667
|
align-items: center;
|
|
682
668
|
gap: 8px;
|
|
@@ -686,14 +672,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
686
672
|
& > * {
|
|
687
673
|
font-family: monospace !important;
|
|
688
674
|
}
|
|
689
|
-
`,Hu=({pendingModify:n,onClose:i,onConfirm:o})=>{const a=v();return t(tt,{isOpen:!!n,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:i,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:i},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:o},children:n&&e(Uu,{children:[n.add.map(n=>e(Vu,{children:[t(ce,{leftIcon:Ha,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(Vu,{children:[t(ce,{leftIcon:Nl,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 ju(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 Gu(e){const t=Math.abs(e);return t>=1e9?`${Wu(e/1e9)}s`:t>=1e6?`${Wu(e/1e6)}ms`:t>=1e3?`${Wu(e/1e3)}μs`:String(Math.round(e))}function Wu(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Ku(e){const t=[];for(let n=0;n<e.levels.length;n++){const i=e.levels[n];let o=0;for(let e=0;e+3<i.length;e+=4){const a=i[e],l=i[e+1],r=i[e+2],s=i[e+3],c=o+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),o=c+l}}return t}function Yu(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Ju(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function qu(e,t,n){return((e,t)=>{const n=[];for(let i=0;i<=t.level;i++){let o;for(const n of e)if(n.level===i&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){o=n;break}if(!o)return n;n.push(o)}return n})(t,n).map(t=>ju(e,t.nameIndex))}function Zu(e,t,n){if(0===n.length)return null;let i=null,o=null;for(let a=0;a<n.length;a++){const l=n[a];let r=null;for(const n of t)n.level===a&&ju(e,n.nameIndex)===l&&(i&&(n.offset<i.offset||n.offset+n.size>i.offset+i.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;i=r,o=r}return o}function Qu(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),i=new Map;for(const t of e){const e=i.get(t.level);e?e.push(t):i.set(t.level,[t])}const o=[t];for(let e=t.level+1;e<=n;e++){const t=o.filter(t=>t.level===e-1);if(0===t.length)break;const n=i.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){o.push(e);break}}return o}function eh(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function th(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const i=t.v2.colors.black[500],o=[{fill:t.v2.colors.purple[300],text:i},{fill:t.v2.colors.green[300],text:i},{fill:t.v2.colors.red[300],text:i},{fill:t.v2.colors.blue[300],text:i},{fill:t.v2.colors.yellow[300],text:i}];return o[n%o.length]}var nh,ih;function oh(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function ah(e,t,n){for(const i of n)if(e>=i.x&&e<i.x+i.w&&t>=i.y&&t<i.y+i.h)return i;return null}function lh(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"})(nh||(nh={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(ih||(ih={}));const rh=({flamebearer:n,maxRowPx:i,searchQuery:r="",shouldKeepName:s,minHostHeight:c=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=p(null),S=p(null),x=p({x:0,y:0}),[w,T]=l({w:0,h:0}),[k,I]=l(""),[N,E]=l(null),[O,$]=l([]),[A,R]=l(!1),[D,P]=l(nh.Fit),[_,L]=l(ih.Fit),[F,M]=l(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),X=Math.max(1,Math.min(Math.floor(w.h*_),8192)),B=O.length>0?O[O.length-1]:null,U=B?.size??n.numTicks,V=o(()=>Ku(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 i=((e,t,n,i,o)=>{const a=[];for(const l of o){const o=qu(e,t,l);if(0===o.length)break;const r=Zu(n,i,o);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return i.length===t.length&&i.every((e,n)=>Ju(e,t[n]))?t:i}))},[n,V]),a(()=>{if(!f)return;if(!B)return void f(null);const e=Qu(V,B),t=new Set;for(const i of e){const e=ju(n,i.nameIndex);e&&t.add(e)}f([...t])},[B,n,V,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),a(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),a(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=o(()=>function(e,t,n,i,o,a={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Ku(e);let p=l?Qu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(ju(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((e,t)=>{if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),i=new Map;for(const e of n){const t=i.get(e.level);t?t.push(e):i.set(e.level,[e])}const o=new Set;for(const t of n){const n=i.get(t.level+1);if(!n)continue;const a=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&ju(e,l.nameIndex)===ju(e,t.nameIndex)&&o.add(Yu(l))}if(0===o.size)return n;const a=[];for(const e of n){if(o.has(Yu(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=i.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&o.has(Yu(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=i??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=o.trim(),y=b>8?1:0;return p.map(n=>{const i=n.level-u,o=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=i*b,r=Math.max(b-y,1),s=ju(e,n.nameIndex);return{...n,x:o,y:l,w:a,h:r,name:s,matchesSearch:eh(s,v)}})}(n,z,X,i,r,{zoomRoot:B,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,i,r,X,z,B,s,F,V]),G=o(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?r.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,r]),W=d(e=>{if(z<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const i=ah((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*X,G);if(i){const e=Yu(i);E(e);const t=U>0?(100*i.size/U).toFixed(1):"0",o=n.numTicks>0?(100*i.size/n.numTicks).toFixed(1):"0";I(`${i.name}\ntotal ${Gu(i.size)} (${t}% of view, ${o}% of profile) · self ${Gu(i.self)}`)}else E(null),I("")},[G,n.numTicks,X,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||X<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=ah((e.clientX-i.left)/i.width*z,(e.clientY-i.top)/i.height*X,G);if(!o)return;m?.(o.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(o);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&Ju(a,t)?e.slice(0,-1):[...e,a]})},[G,X,z,m]);g(()=>{const e=S.current;if(!e||z<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,i=Math.max(z,X),o=Math.min(t,16384/i);e.width=Math.floor(z*o),e.height=Math.floor(X*o),e.style.width=`${z}px`,e.style.height=`${X}px`;const a=e.getContext("2d");a&&(a.setTransform(o,0,0,o,0,0),a.clearRect(0,0,z,X),j?.length?((e,t,n,i,o,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=o.trim().length>0;e.textRendering="optimizeLegibility";for(const t of i){const{x:n,y:i,w:o,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=th(s,a);e.fillStyle=u,e.fillRect(n,i,o,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,i+.5),e.lineTo(n+o-.5,i+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,i+.5,Math.max(o-1,0),Math.max(l-1,0));const m=oh(d,r),g=`${s} (${Gu(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(o>=y&&C>=b){e.font=`${C}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>o-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,i+l/2),e.fillStyle=h,e.fillText(t,n+v,i+l/2))}}if(l)for(const t of i){if(Yu(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:i,w:o,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,i+1,Math.max(o-2,0),Math.max(a-2,0));break}})(a,z,X,j,r,y,N,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,X)))},[j,n.numTicks,N,r,X,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,oe=o(()=>((e,t,n)=>{const i=n??Ku(e),o=t?.offset??0,a=o+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of i)e.level<l||e.offset<o||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(n,B,V),[n,B,V]),ae=null!==oe,le=O.length>0,re=B?ju(n,B.nameIndex):"",se=d(()=>{$([]),b?.()},[b]),ce=d(()=>$(e=>e.slice(0,-1)),[]),de=d(()=>{oe&&$(e=>[...e,oe])},[oe]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:c,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(ie,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(ge,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:fe.Left,size:Et.S,value:F,onChange:M}),e(ie,{$gap:8,children:[e(ie,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,label:"Reset zoom",leftIcon:El,onClick:se,disabled:!O.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:Nl,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:Ha,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ae,onClick:de})]}),e(ie,{children:[t(Be,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Un.Filled,options:[{value:nh.Fit,label:"W: Fit"},{value:nh.X10,label:"10x"}],selected:D,setSelected:P})}),t(Be,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Un.Filled,options:[{value:ih.Fit,label:"H: Fit"},{value:ih.X10,label:"10x"}],selected:_,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?ol:Ol,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Be,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:D>1?"auto":"hidden",overflowY:_>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:X||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:N?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(ie,{$justifyContent:"space-between",children:[t(ee,B?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${re} • ${Gu(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 · ${lh(h.totalBytesUsed)} / ${lh(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},sh=[_n.Go,_n.Java],ch="Profiling Symbols";function dh(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?_n.Go:e.includes(" ")||e.includes("(")?_n.Java:_n.Go)(e);if(n===_n.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),i=t.indexOf(".",n+1);if(-1===i)return null;const o=t.slice(0,i),a=t.slice(i+1);if(!o||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new He(o,"",l[1],l[2]);return e.Verify()?e:null}const r=new He(o,a);return r.Verify()?r:null})(e);return t?{language:n,golang:t}:null}if(n===_n.Java){const t=(e=>{let t=e.trim();if(!t)return null;const n=t.indexOf("(");-1!==n&&(t=t.slice(0,n).trim());const i=t.split(/\s+/);t=i[i.length-1]??"";const o=t.lastIndexOf(".");if(-1===o)return null;const a=t.slice(0,o),l=t.slice(o+1),r=new je(a,l);return r.Verify()?r:null})(e);return t?{language:n,java:t}:null}return null}function ph(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function uh(e,t,n){if(!e)return!0;const{sources:i=[],namespaces:o=[],languages:a=[]}=e,l=!i.length||i.some(e=>ph(e,t.id)),r=!o.length||o.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function hh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function mh(e,t){return e.className===t.className&&e.methodName===t.methodName}function gh(e,t,n,i){const o=dh(e,n);if(!o)return[];const a=[];for(const e of i){const n=e.customInstrumentations;if(!n)continue;if(!uh(e.sourceScopes,t,o.language))continue;const i=!!o.golang&&!!n[We.Golang]?.some(e=>hh(e,o.golang)),l=!!o.java&&!!n[We.Java]?.some(e=>mh(e,o.java));(i||l)&&a.push({rule:e,resolved:o})}return a}var fh,bh,vh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(fh||(fh={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(bh||(bh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(vh||(vh={}));const yh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Ch(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(vh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(vh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&yh.test(n))}const Sh=({rows:e,languages:n,instrumentation:i,searchQuery:a,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!n?.includes(_n.Java),h=o(()=>{const t=s?new Set(s):null,n=a?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,a,s]),m=o(()=>{const e=[];if(i.selectionEnabled&&e.push({id:bh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:vh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:vh.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===fh.Symbol)?.rawValue?.toString()??"";return!(t.includes(bh.OnlyInstrumentable)&&!i.getSymbolState(n).showCheckbox)&&Ch(n,t)}}},[i,u]),g=o(()=>[{key:fh.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:fh.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:fh.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=o(()=>h.map(e=>{const t=i.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:fh.Symbol,rawValue:e.name},{key:fh.Self,rawValue:Gu(e.self)},{key:fh.Total,rawValue:Gu(e.total)}],isSelected:n?i.isSelected(e.name):void 0,onSelect:n?()=>i.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>i.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,i]),b=d(e=>{const t=e.cells[0].rawValue,n=i.getSymbolState(t),o=[];return n.inManagedRule?o.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Va,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>i.onRemove(t)}):o.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Ha,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>i.onAdd(t)}),o.push({id:`copy-${t}`,label:"",leftIcon:$l,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),o},[i]);return t(Vn,{variant:Hn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:i.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:b})};var xh;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(xh||(xh={}));const wh=b(ae)`
|
|
675
|
+
`,jh=({pendingModify:i,onClose:n,onConfirm:a})=>{const o=v();return t(tt,{isOpen:!!i,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:n,denyButton:{variant:$e.Secondary,label:"Cancel",onClick:n},approveButton:{variant:$e.Primary,label:"Confirm",onClick:a},children:i&&e(Vh,{children:[i.add.map(i=>e(Uh,{children:[t(ce,{leftIcon:Rr,status:Le.Success,useSecondaryTone:!0,textColor:o.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ie.Primary,children:i})]},`add-${i}`)),i.remove.map(i=>e(Uh,{children:[t(ce,{leftIcon:bl,status:Le.Error,useSecondaryTone:!0,textColor:o.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ie.Primary,children:i})]},`remove-${i}`))]})})};function Hh(e,t){const i=e.names[t];if(null==i)return"";if("string"==typeof i)return i;if("object"==typeof i&&"name"in i){const e=i.name;if("string"==typeof e)return e}return"number"==typeof i||"boolean"==typeof i?String(i):""}function Gh(e){const t=Math.abs(e);return t>=1e9?`${Kh(e/1e9)}s`:t>=1e6?`${Kh(e/1e6)}ms`:t>=1e3?`${Kh(e/1e3)}μs`:String(Math.round(e))}function Kh(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Wh(e){const t=[];for(let i=0;i<e.levels.length;i++){const n=e.levels[i];let a=0;for(let e=0;e+3<n.length;e+=4){const o=n[e],r=n[e+1],l=n[e+2],s=n[e+3],c=a+o;t.push({level:i,offset:c,size:r,self:l,nameIndex:s}),a=c+r}}return t}function Yh(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function qh(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Jh(e,t,i){return((e,t)=>{const i=[];for(let n=0;n<=t.level;n++){let a;for(const i of e)if(i.level===n&&t.offset>=i.offset&&t.offset+t.size<=i.offset+i.size){a=i;break}if(!a)return i;i.push(a)}return i})(t,i).map(t=>Hh(e,t.nameIndex))}function Zh(e,t,i){if(0===i.length)return null;let n=null,a=null;for(let o=0;o<i.length;o++){const r=i[o];let l=null;for(const i of t)i.level===o&&Hh(e,i.nameIndex)===r&&(n&&(i.offset<n.offset||i.offset+i.size>n.offset+n.size)||(!l||i.size>l.size)&&(l=i));if(!l)return null;n=l,a=l}return a}function Qh(e,t){const i=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=i;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const i=n.get(e);if(i?.length)for(const e of i)for(const i of t)if(e.offset>=i.offset&&e.offset+e.size<=i.offset+i.size){a.push(e);break}}return a}function eg(e,t){const i=t.trim().toLowerCase();return!i||e.toLowerCase().includes(i)}function tg(e,t){let i=0;for(let t=0;t<e.length;t++)i=31*i+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[i%a.length]}var ig,ng;function ag(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function og(e,t,i){for(const n of i)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function rg(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"})(ig||(ig={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(ng||(ng={}));const lg=({flamebearer:i,maxRowPx:n,searchQuery:l="",shouldKeepName:s,minHostHeight:c=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:g,onZoomedSymbolsChange:b,onResetZoom:f})=>{const y=v(),S=p(null),x=p(null),C=p({x:0,y:0}),[w,k]=r({w:0,h:0}),[T,$]=r(""),[I,N]=r(null),[O,A]=r([]),[E,D]=r(!1),[R,L]=r(ig.Fit),[P,M]=r(ng.Fit),[z,X]=r(!1),_=Math.max(1,Math.min(Math.floor(w.w*R),8192)),F=Math.max(1,Math.min(Math.floor(w.h*P),8192)),B=O.length>0?O[O.length-1]:null,V=B?.size??i.numTicks,U=a(()=>Wh(i),[i]),j=p({fb:i,rects:U});o(()=>{const e=j.current;e.fb!==i&&(j.current={fb:i,rects:U},A(t=>{if(0===t.length)return t;const n=((e,t,i,n,a)=>{const o=[];for(const r of a){const a=Jh(e,t,r);if(0===a.length)break;const l=Zh(i,n,a);if(!l)break;o.push(l)}return o})(e.fb,e.rects,i,U,t);return n.length===t.length&&n.every((e,i)=>qh(e,t[i]))?t:n}))},[i,U]),o(()=>{if(!b)return;if(!B)return void b(null);const e=Qh(U,B),t=new Set;for(const n of e){const e=Hh(i,n.nameIndex);e&&t.add(e)}b([...t])},[B,i,U,b]),m(()=>{const e=S.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();k({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),o(()=>{if(!E)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[E]),o(()=>(u?.(E),()=>{E&&u?.(!1)}),[E,u]);const H=a(()=>function(e,t,i,n,a,o={}){if(0===e.levels.length||t<2||i<2)return null;const{zoomRoot:r=null,shouldKeepName:l,collapseRecursive:s=!1,allRects:c}=o,d=c??Wh(e);let p=r?Qh(d,r):d;if(0===p.length)return null;if(l&&(p=p.filter(t=>l(Hh(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((e,t)=>{if(0===t.length)return t;const i=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of i){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of i){const i=n.get(t.level+1);if(!i)continue;const o=i.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==o.length)continue;const r=o[0];r.size===t.size&&Hh(e,r.nameIndex)===Hh(e,t.nameIndex)&&a.add(Yh(r))}if(0===a.size)return i;const o=[];for(const e of i){if(a.has(Yh(e)))continue;let t=0;for(let i=0;i<e.level;i++){const o=n.get(i);if(!o)continue;const r=o.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);r&&a.has(Yh(r))&&t++}o.push({...e,level:e.level-t})}return o})(e,p),0===p.length))return null;const u=r?.level??0,h=r?.offset??0,g=r?.size??e.numTicks;if(g<=0)return null;const m=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,b=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(i/m,b)),v=a.trim(),y=f>8?1:0;return p.map(i=>{const n=i.level-u,a=(i.offset-h)/g*t,o=Math.max(i.size/g*t,1),r=n*f,l=Math.max(f-y,1),s=Hh(e,i.nameIndex);return{...i,x:a,y:r,w:o,h:l,name:s,matchesSearch:eg(s,v)}})}(i,_,F,n,l,{zoomRoot:B,shouldKeepName:s,collapseRecursive:z,allRects:U}),[i,n,l,F,_,B,s,z,U]),G=a(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(H?.length?l.trim()?H.filter(e=>e.matchesSearch):H:[]),[H,l]),K=d(e=>{if(_<2||F<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=og((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*F,G);if(n){const e=Yh(n);N(e);const t=V>0?(100*n.size/V).toFixed(1):"0",a=i.numTicks>0?(100*n.size/i.numTicks).toFixed(1):"0";$(`${n.name}\ntotal ${Gh(n.size)} (${t}% of view, ${a}% of profile) · self ${Gh(n.self)}`)}else N(null),$("")},[G,i.numTicks,F,_,V]),W=d(e=>{K(e)},[K]),Y=d(()=>{N(null),$("")},[]),q=d(e=>{C.current={x:e.clientX,y:e.clientY}},[]),J=d(e=>{const{x:t,y:i}=C.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-i)>3)return;if(_<2||F<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=og((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*F,G);if(!a)return;g?.(a.name);const o=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(a);A(e=>{const t=e.length>0?e[e.length-1]:null;return t&&qh(o,t)?e.slice(0,-1):[...e,o]})},[G,F,_,g]);m(()=>{const e=x.current;if(!e||_<2||F<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,F),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(F*a),e.style.width=`${_}px`,e.style.height=`${F}px`;const o=e.getContext("2d");o&&(o.setTransform(a,0,0,a,0,0),o.clearRect(0,0,_,F),H?.length?((e,t,i,n,a,o,r,l)=>{const s=o.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,i);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:i,y:n,w:a,h:r,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=tg(s,o);e.fillStyle=u,e.fillRect(i,n,a,r),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(i+.5,n+.5),e.lineTo(i+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(i+.5,n+.5,Math.max(a-1,0),Math.max(r-1,0));const g=ag(d,l),m=`${s} (${Gh(d)}, ${g}%)`,b=o.v2.text.size.xs,f=8,v=5,y=26,S=Math.min(b,Math.floor(r-2));if(a>=y&&S>=f){e.font=`${S}px ${o.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=m;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,i+v,n+r/2),e.fillStyle=h,e.fillText(t,i+v,n+r/2))}}if(r)for(const t of n){if(Yh(t)!==r)continue;if(c&&!t.matchesSearch)continue;const{x:i,y:n,w:a,h:o}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(i+1,n+1,Math.max(a-2,0),Math.max(o-2,0));break}})(o,_,F,H,l,y,I,i.numTicks):(o.fillStyle=y.v2.colors.silver[900],o.fillRect(0,0,_,F)))},[H,i.numTicks,I,l,F,_,y]);const Z=d(()=>D(e=>!e),[]),Q=i.numTicks>0?Math.max(0,Math.min(100,Math.round(V/i.numTicks*100))):100,ae=a(()=>((e,t,i)=>{const n=i??Wh(e),a=t?.offset??0,o=a+(t?.size??e.numTicks),r=(t?.level??-1)+1,l=t?.size??e.numTicks;let s=null;for(const e of n)e.level<r||e.offset<a||e.offset+e.size>o||e.size>=l||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(i,B,U),[i,B,U]),oe=null!==ae,re=O.length>0,le=B?Hh(i,B.nameIndex):"",se=d(()=>{A([]),f?.()},[f]),ce=d(()=>A(e=>e.slice(0,-1)),[]),de=d(()=>{ae&&A(e=>[...e,ae])},[ae]);return e("div",{style:E?{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(ne,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(me,{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:be.Left,size:Nt.S,value:z,onChange:X}),e(ne,{$gap:8,children:[e(ne,{children:[t(ke,{variant:$e.Secondary,size:Te.S,label:"Reset zoom",leftIcon:fl,onClick:se,disabled:!O.length}),t(ke,{variant:$e.Secondary,size:Te.S,iconSize:20,leftIcon:bl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!re,onClick:ce}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ee,{size:te.XXS,color:ie.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(ke,{variant:$e.Secondary,size:Te.S,iconSize:20,leftIcon:Rr,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!oe,onClick:de})]}),e(ne,{children:[t(Be,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Vi.Filled,options:[{value:ig.Fit,label:"W: Fit"},{value:ig.X10,label:"10x"}],selected:R,setSelected:L})}),t(Be,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Vi.Filled,options:[{value:ng.Fit,label:"H: Fit"},{value:ng.X10,label:"10x"}],selected:P,setSelected:M})})]}),t(ke,{variant:$e.Secondary,size:Te.S,iconSize:24,leftIcon:E?Kr:vl,tooltip:E?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Be,{fullWidth:!0,keepAlive:!0,text:T,children:t("div",{ref:S,style:{flex:1,minWidth:0,width:"100%",height:E?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:R>1?"auto":"hidden",overflowY:P>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:F||"100%",position:"relative"},children:t("canvas",{ref:x,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:I?"pointer":"default"},onPointerDown:q,onPointerMove:W,onPointerLeave:Y,onClick:J})})})})}),e(ne,{$justifyContent:"space-between",children:[t(ee,B?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${le} • ${Gh(V)} samples in view`}:{size:te.XXXS,color:y.v2.colors.silver[300],children:g?"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 · ${rg(h.totalBytesUsed)} / ${rg(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},sg=[Pi.Go,Pi.Java],cg="Profiling Symbols";function dg(e,t){if(0===t.length)return null;const i=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Pi.Go:e.includes(" ")||e.includes("(")?Pi.Java:Pi.Go)(e);if(i===Pi.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const i=t.lastIndexOf("/"),n=t.indexOf(".",i+1);if(-1===n)return null;const a=t.slice(0,n),o=t.slice(n+1);if(!a||!o)return null;const r=o.match(/^\(\*?([^)]+)\)\.(.+)$/);if(r){const e=new je(a,"",r[1],r[2]);return e.Verify()?e:null}const l=new je(a,o);return l.Verify()?l:null})(e);return t?{language:i,golang:t}:null}if(i===Pi.Java){const t=(e=>{let t=e.trim();if(!t)return null;const i=t.indexOf("(");-1!==i&&(t=t.slice(0,i).trim());const n=t.split(/\s+/);t=n[n.length-1]??"";const a=t.lastIndexOf(".");if(-1===a)return null;const o=t.slice(0,a),r=t.slice(a+1),l=new He(o,r);return l.Verify()?l:null})(e);return t?{language:i,java:t}:null}return null}function pg(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function ug(e,t,i){if(!e)return!0;const{sources:n=[],namespaces:a=[],languages:o=[]}=e,r=!n.length||n.some(e=>pg(e,t.id)),l=!a.length||a.includes(t.id.namespace),s=!o.length||null==i||o.includes(i);return r&&l&&s}function hg(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function gg(e,t){return e.className===t.className&&e.methodName===t.methodName}function mg(e,t,i,n){const a=dg(e,i);if(!a)return[];const o=[];for(const e of n){const i=e.customInstrumentations;if(!i)continue;if(!ug(e.sourceScopes,t,a.language))continue;const n=!!a.golang&&!!i[Ke.Golang]?.some(e=>hg(e,a.golang)),r=!!a.java&&!!i[Ke.Java]?.some(e=>gg(e,a.java));(n||r)&&o.push({rule:e,resolved:a})}return o}var bg,fg,vg;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(bg||(bg={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(fg||(fg={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(vg||(vg={}));const yg=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Sg(e,t){const i=(e=>e.split(" ")[0]??"")(e);return(!t.includes(vg.FilterOutVoid)||"void"!==i)&&!!(!t.includes(vg.OnlyWithReturnValues)||e.includes(" ")&&"void"!==i&&yg.test(i))}const xg=({rows:e,languages:i,instrumentation:n,searchQuery:o,filters:r,onFiltersChange:l,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!i?.includes(Pi.Java),h=a(()=>{const t=s?new Set(s):null,i=o?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!i||e.name.toLowerCase().includes(i)))},[e,o,s]),g=a(()=>{const e=[];if(n.selectionEnabled&&e.push({id:fg.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:vg.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:vg.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const i=e.cells.find(e=>e.key===bg.Symbol)?.rawValue?.toString()??"";return!(t.includes(fg.OnlyInstrumentable)&&!n.getSymbolState(i).showCheckbox)&&Sg(i,t)}}},[n,u]),m=a(()=>[{key:bg.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:g,noFilter:!g},{key:bg.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:bg.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[g]),b=a(()=>h.map(e=>{const t=n.getSymbolState(e.name),i=t.showCheckbox;return{id:e.name,cells:[{key:bg.Symbol,rawValue:e.name},{key:bg.Self,rawValue:Gh(e.self)},{key:bg.Total,rawValue:Gh(e.total)}],isSelected:i?n.isSelected(e.name):void 0,onSelect:i?()=>n.onToggleSymbol(e.name,!0):void 0,onDeselect:i?()=>n.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!i,checkboxDisabled:i?t.checkboxDisabled:void 0,checkboxTooltip:i?t.checkboxTooltip:void 0}}),[h,n]),f=d(e=>{const t=e.cells[0].rawValue,i=n.getSymbolState(t),a=[];return i.inManagedRule?a.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Dr,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>n.onRemove(t)}):a.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Rr,tooltip:i.addTooltip,disabled:!i.addEnabled,onClick:()=>n.onAdd(t)}),a.push({id:`copy-${t}`,label:"",leftIcon:yl,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),a},[n]);return t(Ui,{variant:ji.Data,maxHeight:"calc(100vh - 306px)",columns:m,rows:b,withCheckboxes:n.selectionEnabled,filters:r,onFiltersChange:l,activeRowId:c,scrollSignal:p,getRowActions:f})};var Cg;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(Cg||(Cg={}));const wg=f(oe)`
|
|
690
676
|
width: 100%;
|
|
691
677
|
flex: 1;
|
|
692
678
|
border-radius: 16px;
|
|
693
679
|
overflow: hidden;
|
|
694
680
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
695
681
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
696
|
-
`,
|
|
682
|
+
`,kg=f.div`
|
|
697
683
|
display: flex;
|
|
698
684
|
align-items: center;
|
|
699
685
|
gap: 10px;
|
|
@@ -701,11 +687,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
701
687
|
padding: 12px 12px 8px;
|
|
702
688
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
703
689
|
border-radius: 16px 16px 0 0;
|
|
704
|
-
`,
|
|
690
|
+
`,Tg=f(ne)`
|
|
705
691
|
flex-shrink: 0;
|
|
706
692
|
align-items: center;
|
|
707
693
|
gap: 4px;
|
|
708
|
-
|
|
694
|
+
`,$g=f.div`
|
|
709
695
|
flex: 1;
|
|
710
696
|
display: flex;
|
|
711
697
|
align-items: stretch;
|
|
@@ -713,20 +699,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
713
699
|
padding: 16px;
|
|
714
700
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
715
701
|
border-radius: 0 0 16px 16px;
|
|
716
|
-
`,
|
|
702
|
+
`,Ig=f(oe)`
|
|
717
703
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
718
704
|
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
719
705
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
720
706
|
gap: 10px;
|
|
721
|
-
`,
|
|
707
|
+
`,Ng=f(oe)`
|
|
722
708
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
723
709
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
724
710
|
gap: 10px;
|
|
725
|
-
`,
|
|
711
|
+
`,Og=f(ne)`
|
|
726
712
|
width: 100%;
|
|
727
713
|
min-height: 32px;
|
|
728
714
|
flex-shrink: 0;
|
|
729
|
-
`,$h=({source:n,onFlameFullscreenChange:i})=>{const s=v(),{profilingApi:c}=Sr(),u=o(()=>({namespace:n.id.namespace,name:n.id.name,kind:n.id.kind,region:n.id.region,serviceName:n.serviceName}),[n.id.namespace,n.id.name,n.id.kind,n.id.region,n.serviceName]),[h,m]=l(!0),[g,f]=l(xh.Both),[b,y]=l(""),[C,S]=l({}),[x,w]=l(!1),T=p(!1);a(()=>{T.current||(T.current=!0,c.enableProfiling?.(u),w(!0))},[c,u]);const{data:k}=c.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:I,loading:N,refetch:E}=c.useSourceProfiling(u,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),O=I?.profileJson??null,$=o(()=>(e=>{if(!e?.trim())return null;try{const t=JSON.parse(e),n=t.flamebearer;return!n?.names?.length||!Array.isArray(n.levels)||"number"!=typeof n.numTicks||n.numTicks<=0?null:{flamebearer:n,units:t.metadata?.units}}catch{return null}})(O),[O]),A=o(()=>$?(e=>{const t=new Map;for(let n=0;n<e.levels.length;n++){const i=e.levels[n];for(let n=0;n+3<i.length;n+=4){const o=i[n+1],a=i[n+2],l=ju(e,i[n+3]);if(!l)continue;const r=t.get(l);(!r||o>r.total)&&t.set(l,{self:a,total:o})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})($.flamebearer):[],[$]),R=g===xh.Table||g===xh.Both,D=g===xh.Flame||g===xh.Both,P=R&&D,_=n.runtimeInfo?.detectedLanguages?.join("\0")??"",L=n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=o(()=>_?_.split("\0"):L?L.split("\0"):void 0,[_,L]),M=o(()=>((e,t)=>{if(!t?.includes(_n.Java))return;const n=(e?.[fh.Symbol]?.filter(Boolean)??[]).filter(e=>e===vh.FilterOutVoid||e===vh.OnlyWithReturnValues);return 0!==n.length?e=>Ch(e,n):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:X,pendingModify:B,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:n}){const{instrumentationRulesApi:i,capabilities:a}=Sr(),{items:r}=i.useRules(),[s,c]=l(new Set),[p,u]=l(new Set),[h,m]=l(null),g=o(()=>(e=>{const t=new Set(e??[]);return sh.filter(e=>t.has(e))})(t),[t]),f=a.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=o(()=>((e,t)=>{const n=e.filter(e=>e.type===Ye.CustomInstrumentation&&e.ruleName===ch&&uh(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>ph(e,t.id)))??n[0]??null})(r,e),[r,b]),y=f&&g.length>0,C=o(()=>{const t=new Map;for(const i of n){const n=!!dh(i.name,g),o=gh(i.name,e,g,r),a=!!v&&o.some(e=>e.rule.ruleId===v.ruleId),l=o.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&l.length>0,c=y&&n,d=s;let p;if(s){const e=[...new Set(l.map(e=>e.rule.ruleName))];p=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let u=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=p??"Managed by another rule":0===o.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?u=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(i.name,{parsable:n,inManagedRule:a,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[n,r,b,g,f,y,v]),S=o(()=>{const e=new Set;return C.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[C]),x=o(()=>[...s].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[s,C,S]),w=o(()=>[...p].filter(e=>S.has(e)),[p,S]),T=x.length+w.length,k=d(e=>{const t=C.get(e);return t?.inManagedRule?!p.has(e):!!(t&&t.otherRules.length>0)||s.has(e)},[C,p,s]),I=d((e,t)=>{const n=C.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?u(n=>{const i=new Set(n);return t?i.delete(e):i.add(e),i}):c(n=>{const i=new Set(n);return t?i.add(e):i.delete(e),i}))},[C]),N=d(()=>{c(new Set),u(new Set)},[]),E=d(t=>{(async()=>{const n=t.add.map(e=>dh(e,g)).filter(e=>!!e),o=t.remove.map(e=>dh(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,n)=>{const i=e.customInstrumentations??{};let o=[...i[We.Golang]??[]],a=[...i[We.Java]??[]];for(const e of n)e.golang&&(o=o.filter(t=>!hh(t,e.golang))),e.java&&(a=a.filter(t=>!mh(t,e.java)));for(const e of t)e.golang&&!o.some(t=>hh(t,e.golang))&&o.push(e.golang),e.java&&!a.some(t=>mh(t,e.java))&&a.push(e.java);return{customInstrumentations:{[We.Golang]:o,[We.Java]:a},isEmpty:0===o.length&&0===a.length}})(v,n,o);t?await i.remove(v.ruleId,Ye.CustomInstrumentation):await i.update(v.ruleId,((e,t)=>({ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}))(v,e),Ye.CustomInstrumentation)}else n.length>0&&await i.create(((e,t)=>{const n=e.map(e=>e.golang).filter(e=>!!e),i=e.map(e=>e.java).filter(e=>!!e),o={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:ch,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:o,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[We.Golang]:n,[We.Java]:i}}})(n,e),Ye.CustomInstrumentation)})()},[v,g,e,i]),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&&(E(h),m(null),N())},[h,E,N]),P=d(e=>C.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[C]);return{instrumentation:o(()=>({getSymbolState:P,onAdd:$,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[P,$,A,y,k,I]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:O,resetSelection:N,confirmModify:D}}({source:n,languages:F,rows:A}),[G,W]=l(null),[K,Y]=l(0),[J,q]=l(null),Z=d(e=>{W(e),Y(e=>e+1),f(e=>e===xh.Flame?xh.Both:e)},[]),Q=d(e=>{q(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const n=new Set(t);if(e.every(e=>n.has(e)))return t}return e})},[]),oe=d(()=>W(null),[]);return!O&&N?t(ft,{$height:"70vh",children:t(St,{withSpinner:!0})}):e(wh,{$gap:0,$width:"100%",children:[e(Th,{children:[t(Be,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(kh,{children:t(ee,{size:te.S,weight:500,color:ne.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(ie,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(vn,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:s.v2.colors.silver[900],emphasizeBackgroundColor:s.v2.colors.silver[800]})}),t(ve,{variant:Un.Filled,options:[{value:xh.Table,label:"Top table"},{value:xh.Flame,label:"Flame graph"},{value:xh.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(Al,{...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(Al,{...e,size:8,fill:s.v2.colors.red[500]})})]})]}),t(Ih,{$gap:R&&D?16:0,children:$?e(r,{children:[R&&e(Nh,{$splitWithFlame:P,children:[e(Oh,{$justifyContent:"space-between",children:[e(ae,{$margin:"0 0 0 20px",children:[t(ee,{size:te.XXXS,nowrap:!0,children:"Please select symbols to"}),e(ie,{$gap:8,children:[e(ie,{children:[t(Rl,{size:24}),t(ee,{size:te.S,color:ne.Success,nowrap:!0,children:"Custom Instrument"})]}),t(Te,{leftIcon:Ga,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${_e}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(ie,{$gap:8,children:[J&&t(Be,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(ce,{label:`Zoomed: ${J.length} symbols`,backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS})}),t(Te,{variant:Ie.Secondary,size:ke.S,label:"Download snapshot",rightIcon:Dl,onClick:()=>{if(!O)return;const e=new Blob([O],{type:"application/json"}),t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,i.click(),URL.revokeObjectURL(t)},disabled:!O})]})]}),t(Sh,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),D&&e(Eh,{$splitWithTable:P,children:[e(Oh,{$justifyContent:"space-between",children:[t(ce,{label:$?`Total in view ${Gu($.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS}),e(ie,{$gap:12,children:[!h&&t(Te,{variant:Ie.Secondary,size:ke.S,label:"Refresh",leftIcon:fl,onClick:E}),t(ge,{label:"Auto refresh",labelAlign:fe.Left,size:Et.S,value:h,onChange:m})]})]}),t(rh,{flamebearer:$.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:i,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:oe})]})]}):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(Hu,{pendingModify:B,onClose:U,onConfirm:j}),t(jn,{isOpen:X>0,richTitle:{icon:al,title:"Profiling Symbols",badge:{label:X}},actions:[{id:"profiling-bulk-cancel",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Modify Rule",leftIcon:Ka,onClick:V}}]})]})},Ah=b.div`
|
|
715
|
+
`,Ag=({source:i,onFlameFullscreenChange:n})=>{const s=v(),{profilingApi:c}=ws(),u=a(()=>({namespace:i.id.namespace,name:i.id.name,kind:i.id.kind,region:i.id.region,serviceName:i.serviceName}),[i.id.namespace,i.id.name,i.id.kind,i.id.region,i.serviceName]),[h,g]=r(!0),[m,b]=r(Cg.Both),[f,y]=r(""),[S,x]=r({}),[C,w]=r(!1),k=p(!1);o(()=>{k.current||(k.current=!0,c.enableProfiling?.(u),w(!0))},[c,u]);const{data:T}=c.useSlots({skip:!C,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:$,loading:I,refetch:N}=c.useSourceProfiling(u,{skip:!C,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),O=$?.profileJson??null,A=a(()=>(e=>{if(!e?.trim())return null;try{const t=JSON.parse(e),i=t.flamebearer;return!i?.names?.length||!Array.isArray(i.levels)||"number"!=typeof i.numTicks||i.numTicks<=0?null:{flamebearer:i,units:t.metadata?.units}}catch{return null}})(O),[O]),E=a(()=>A?(e=>{const t=new Map;for(let i=0;i<e.levels.length;i++){const n=e.levels[i];for(let i=0;i+3<n.length;i+=4){const a=n[i+1],o=n[i+2],r=Hh(e,n[i+3]);if(!r)continue;const l=t.get(r);(!l||a>l.total)&&t.set(r,{self:o,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})(A.flamebearer):[],[A]),D=m===Cg.Table||m===Cg.Both,R=m===Cg.Flame||m===Cg.Both,L=D&&R,P=i.runtimeInfo?.detectedLanguages?.join("\0")??"",M=i.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",z=a(()=>P?P.split("\0"):M?M.split("\0"):void 0,[P,M]),X=a(()=>((e,t)=>{if(!t?.includes(Pi.Java))return;const i=(e?.[bg.Symbol]?.filter(Boolean)??[]).filter(e=>e===vg.FilterOutVoid||e===vg.OnlyWithReturnValues);return 0!==i.length?e=>Sg(e,i):void 0})(S,z),[S,z]),{instrumentation:_,pendingCount:F,pendingModify:B,closeModify:V,openBulkModify:U,resetSelection:j,confirmModify:H}=function({source:e,languages:t,rows:i}){const{instrumentationRulesApi:n,capabilities:o}=ws(),{items:l}=n.useRules(),[s,c]=r(new Set),[p,u]=r(new Set),[h,g]=r(null),m=a(()=>(e=>{const t=new Set(e??[]);return sg.filter(e=>t.has(e))})(t),[t]),b=o.canCreateInstrumentationRule,f=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=a(()=>((e,t)=>{const i=e.filter(e=>e.type===Ye.CustomInstrumentation&&e.ruleName===cg&&ug(e.sourceScopes,t));return i.find(e=>e.sourceScopes?.sources?.some(e=>pg(e,t.id)))??i[0]??null})(l,e),[l,f]),y=b&&m.length>0,S=a(()=>{const t=new Map;for(const n of i){const i=!!dg(n.name,m),a=mg(n.name,e,m,l),o=!!v&&a.some(e=>e.rule.ruleId===v.ruleId),r=a.filter(e=>e.rule.ruleId!==v?.ruleId),s=!o&&r.length>0,c=y&&i,d=s;let p;if(s){const e=[...new Set(r.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===a.length&&(0===m.length?h="Custom instrumentation is only available for Go and Java sources":b?i?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(n.name,{parsable:i,inManagedRule:o,otherRules:r,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[i,l,f,m,b,y,v]),x=a(()=>{const e=new Set;return S.forEach((t,i)=>{t.inManagedRule&&e.add(i)}),e},[S]),C=a(()=>[...s].filter(e=>S.get(e)?.addEnabled&&!x.has(e)),[s,S,x]),w=a(()=>[...p].filter(e=>x.has(e)),[p,x]),k=C.length+w.length,T=d(e=>{const t=S.get(e);return t?.inManagedRule?!p.has(e):!!(t&&t.otherRules.length>0)||s.has(e)},[S,p,s]),$=d((e,t)=>{const i=S.get(e);i&&!i.checkboxDisabled&&(i.inManagedRule?u(i=>{const n=new Set(i);return t?n.delete(e):n.add(e),n}):c(i=>{const n=new Set(i);return t?n.add(e):n.delete(e),n}))},[S]),I=d(()=>{c(new Set),u(new Set)},[]),N=d(t=>{(async()=>{const i=t.add.map(e=>dg(e,m)).filter(e=>!!e),a=t.remove.map(e=>dg(e,m)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,i)=>{const n=e.customInstrumentations??{};let a=[...n[Ke.Golang]??[]],o=[...n[Ke.Java]??[]];for(const e of i)e.golang&&(a=a.filter(t=>!hg(t,e.golang))),e.java&&(o=o.filter(t=>!gg(t,e.java)));for(const e of t)e.golang&&!a.some(t=>hg(t,e.golang))&&a.push(e.golang),e.java&&!o.some(t=>gg(t,e.java))&&o.push(e.java);return{customInstrumentations:{[Ke.Golang]:a,[Ke.Java]:o},isEmpty:0===a.length&&0===o.length}})(v,i,a);t?await n.remove(v.ruleId,Ye.CustomInstrumentation):await n.update(v.ruleId,((e,t)=>({ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}))(v,e),Ye.CustomInstrumentation)}else i.length>0&&await n.create(((e,t)=>{const i=e.map(e=>e.golang).filter(e=>!!e),n=e.map(e=>e.java).filter(e=>!!e),a={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:cg,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:a,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ke.Golang]:i,[Ke.Java]:n}}})(i,e),Ye.CustomInstrumentation)})()},[v,m,e,n]),O=d(()=>{k&&g({add:C,remove:w})},[k,C,w]),A=d(e=>g({add:[e],remove:[]}),[]),E=d(e=>g({add:[],remove:[e]}),[]),D=d(()=>g(null),[]),R=d(()=>{h&&(N(h),g(null),I())},[h,N,I]),L=d(e=>S.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[S]);return{instrumentation:a(()=>({getSymbolState:L,onAdd:A,onRemove:E,selectionEnabled:y,isSelected:T,onToggleSymbol:$}),[L,A,E,y,T,$]),pendingCount:k,pendingModify:h,closeModify:D,openBulkModify:O,resetSelection:I,confirmModify:R}}({source:i,languages:z,rows:E}),[G,K]=r(null),[W,Y]=r(0),[q,J]=r(null),Z=d(e=>{K(e),Y(e=>e+1),b(e=>e===Cg.Flame?Cg.Both:e)},[]),Q=d(e=>{J(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const i=new Set(t);if(e.every(e=>i.has(e)))return t}return e})},[]),ae=d(()=>K(null),[]);return!O&&I?t(bt,{$height:"70vh",children:t(xt,{withSpinner:!0})}):e(wg,{$gap:0,$width:"100%",children:[e(kg,{children:[t(Be,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(Tg,{children:t(ee,{size:te.S,weight:500,color:ie.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(ne,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(vi,{value:f,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:s.v2.colors.silver[900],emphasizeBackgroundColor:s.v2.colors.silver[800]})}),t(ve,{variant:Vi.Filled,options:[{value:Cg.Table,label:"Top table"},{value:Cg.Flame,label:"Flame graph"},{value:Cg.Both,label:"Both"}],selected:m,setSelected:b}),t(ke,h?{variant:$e.Secondary,size:Te.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(Sl,{...e,size:8,fill:s.v2.colors.green[500]})}:{variant:$e.Secondary,size:Te.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Sl,{...e,size:8,fill:s.v2.colors.red[500]})})]})]}),t($g,{$gap:D&&R?16:0,children:A?e(l,{children:[D&&e(Ig,{$splitWithFlame:L,children:[e(Og,{$justifyContent:"space-between",children:[e(oe,{$margin:"0 0 0 20px",children:[t(ee,{size:te.XXXS,nowrap:!0,children:"Please select symbols to"}),e(ne,{$gap:8,children:[e(ne,{children:[t(xl,{size:24}),t(ee,{size:te.S,color:ie.Success,nowrap:!0,children:"Custom Instrument"})]}),t(ke,{leftIcon:Pr,variant:$e.Secondary,size:Te.S,onClick:()=>window.open(`${Pe}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(ne,{$gap:8,children:[q&&t(Be,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(ce,{label:`Zoomed: ${q.length} symbols`,backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS})}),t(ke,{variant:$e.Secondary,size:Te.S,label:"Download snapshot",rightIcon:Cl,onClick:()=>{if(!O)return;const e=new Blob([O],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${i.id.namespace}-${i.id.kind}-${i.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!O})]})]}),t(xg,{rows:E,languages:z,instrumentation:_,searchQuery:f,filters:S,onFiltersChange:x,zoomedSymbols:q,highlightSymbol:G,scrollSignal:W})]}),R&&e(Ng,{$splitWithTable:L,children:[e(Og,{$justifyContent:"space-between",children:[t(ce,{label:A?`Total in view ${Gh(A.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS}),e(ne,{$gap:12,children:[!h&&t(ke,{variant:$e.Secondary,size:Te.S,label:"Refresh",leftIcon:ol,onClick:N}),t(me,{label:"Auto refresh",labelAlign:be.Left,size:Nt.S,value:h,onChange:g})]})]}),t(lg,{flamebearer:A.flamebearer,maxRowPx:24,searchQuery:f,shouldKeepName:X,minHostHeight:280,onFullscreenChange:n,profilingSlots:T??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:ae})]})]}):t(bt,{children:t(Ae,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(jh,{pendingModify:B,onClose:V,onConfirm:H}),t(Hi,{isOpen:F>0,richTitle:{icon:Wr,title:"Profiling Symbols",badge:{label:F}},actions:[{id:"profiling-bulk-cancel",type:fi.Button,buttonProps:{variant:$e.Secondary,size:Te.S,label:"Cancel",onClick:j}},{id:"profiling-bulk-apply",type:fi.Button,buttonProps:{variant:$e.Primary,size:Te.S,label:"Modify Rule",leftIcon:zr,onClick:U}}]})]})},Eg=f.div`
|
|
730
716
|
position: relative;
|
|
731
717
|
display: flex;
|
|
732
718
|
align-items: center;
|
|
@@ -734,23 +720,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
734
720
|
padding: 8px 16px;
|
|
735
721
|
border-radius: 12px;
|
|
736
722
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
737
|
-
`,
|
|
723
|
+
`,Dg=f.div`
|
|
738
724
|
display: flex;
|
|
739
725
|
flex-direction: column;
|
|
740
726
|
gap: 4px;
|
|
741
727
|
flex: 1;
|
|
742
728
|
min-width: 0;
|
|
743
729
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
744
|
-
`,
|
|
730
|
+
`,Rg=f.div`
|
|
745
731
|
flex-shrink: 0;
|
|
746
732
|
display: flex;
|
|
747
733
|
align-items: center;
|
|
748
734
|
margin-right: ${({$reserveJumpSpace:e})=>e?"32px":"0"};
|
|
749
|
-
`,
|
|
735
|
+
`,Lg=f.div`
|
|
750
736
|
min-width: 0;
|
|
751
737
|
white-space: pre;
|
|
752
738
|
overflow-x: auto;
|
|
753
|
-
`,
|
|
739
|
+
`,Pg=f.div`
|
|
754
740
|
position: absolute;
|
|
755
741
|
top: 50%;
|
|
756
742
|
right: 8px;
|
|
@@ -759,24 +745,88 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
759
745
|
pointer-events: none;
|
|
760
746
|
transition: opacity 0.15s ease;
|
|
761
747
|
|
|
762
|
-
${
|
|
748
|
+
${Eg}:hover & {
|
|
763
749
|
opacity: 1;
|
|
764
750
|
pointer-events: auto;
|
|
765
751
|
}
|
|
766
|
-
`,
|
|
752
|
+
`,Mg=({name:i,summary:n,disabled:a=!1,onJumpToRule:o})=>{const r=v();return e(Eg,{children:[e(Dg,{$disabled:a,children:[i&&t(ee,{size:te.XXXS,color:ie.Secondary,nowrap:!0,children:i}),t(Lg,{children:t(w,{parts:n})})]}),a&&t(Rg,{$reserveJumpSpace:!!o,children:t(ce,{label:Gi,textSize:te.XXXS,backgroundColor:r.v2.colors.grey[700],textColor:r.v2.colors.grey[300]})}),o&&t(Pg,{children:t(Be,{text:it.OPEN_IN_SAMPLING_PAGE,children:t(ke,{"data-id":"sampling-rule-jump",variant:$e.Primary,size:Te.S,leftIcon:vl,onClick:o})})})]})},zg=f.div`
|
|
767
753
|
opacity: 0;
|
|
768
754
|
pointer-events: none;
|
|
769
755
|
transition: opacity 0.15s ease;
|
|
770
|
-
`,
|
|
771
|
-
&:hover ${
|
|
756
|
+
`,Xg=f.div`
|
|
757
|
+
&:hover ${zg} {
|
|
772
758
|
opacity: 1;
|
|
773
759
|
pointer-events: auto;
|
|
774
760
|
}
|
|
775
|
-
`,
|
|
761
|
+
`,_g=f.div`
|
|
776
762
|
display: flex;
|
|
777
763
|
align-items: center;
|
|
778
764
|
padding: 4px 12px;
|
|
779
|
-
`,Xh=({source:e,onRedirectToSampling:n})=>t(Gt,{bgTint:"1000",richTitle:{title:nt.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(Vh,{container:e,onRedirectToSampling:n},e.containerName))});var Bh;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(Bh||(Bh={}));const Uh=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],Vh=({container:n,onRedirectToSampling:i})=>{const[a,r]=l(Bh.All),s=Cn(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=o(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),p=o(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=o(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=o(()=>a===Bh.Noisy?d:a===Bh.HighlyRelevant?p:a===Bh.CostReduction?u:[...d,...p,...u],[a,p,u]),m=d.length+p.length+u.length,g=o(()=>(e,t)=>{s({ruleId:e,category:t}),i()},[i,s]),f=t(Fh,{children:t(Te,{"data-id":"sampling-container-create-rule",variant:Ie.Secondary,size:ke.S,label:Wn,rightIcon:Ha,onClick:e=>{e.stopPropagation(),i()}})});return t(Mh,{children:e(Gt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Gt,{bgTint:"800",richTitle:{title:nt.HEAD_SAMPLING,badge:{label:c.length}},children:[t(ee,{size:te.XXS,children:nt.NOISY_OPERATIONS}),t(ae,{$gap:4,children:c.map(e=>t(Lh,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(zh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.HEAD_SAMPLING})}),m?e(Gt,{bgTint:"800",richTitle:{title:nt.TAIL_SAMPLING,badge:{label:m}},children:[t(ve,{options:(b=d.length,v=p.length,y=u.length,[{value:Bh.All,label:"All",badge:{label:b+v+y,textSize:te.XXXS}},{value:Bh.Noisy,label:nt.NOISY_OPERATIONS,badge:{label:b,textSize:te.XXXS}},{value:Bh.HighlyRelevant,label:nt.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:te.XXXS}},{value:Bh.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(Lh,{name:e.rule.name,summary:Uh(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t($e,{title:`No ${a===Bh.All?`${Bh.Noisy}, ${Bh.HighlyRelevant} and ${Bh.CostReduction}`:a} operations`})})]}):t(zh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.TAIL_SAMPLING})})]})});var b,v,y},Hh=[In.Deployment,In.StatefulSet,In.DaemonSet,In.DeploymentConfig,In.Rollout,In.Pod];var jh;(e=>{e.Workload="Workload",e.Pod="Pod"})(jh||(jh={}));const Gh=e=>!!e&&pn(e.status)===Pe.Error,Wh=e=>Gh(e.healthStatus),Kh=e=>Gh(e.odigosHealthStatus)||(e.processes??[]).some(Wh),Yh=e=>Gh(e.agentInjectedStatus)||Gh(e.odigosHealthStatus)||(e.containers??[]).some(Kh),Jh=({onClose:n,sourceId:i,onRedirectToSampling:r})=>{const s=v(),{isK8s:c,isVm:u,platformType:h}=S(),{selectedStreamName:m}=it(),{sourcesApi:g,configApi:f,capabilities:b}=Sr(),{genericForm:y,loadSource:C,validateFormData:x}=kr(),{data:w}=f.useEffectiveConfig(),[T,k]=l(!1),[I,N]=l(!1),[E,O]=l(!1),[$,A]=l(Ip.Overview),[R,D]=l(null),[P,_]=l({openFor:null}),L=(()=>{const[e,t]=l(null),n=d(e=>{t({tab:Ip.Pods,podName:e.podName})},[]),i=d((e,n)=>{t({tab:Ip.Pods,podName:e.podName,containerName:n.containerName})},[]),a=d((e,n,i)=>{const o=Rp({identifyingAttributes:i.identifyingAttributes});t({tab:Ip.Pods,podName:e.podName,containerName:n.containerName,processPid:o})},[]),r=d(()=>t(null),[]);return o(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:i,jumpToProcess:a,clearJumpToTarget:r}),[e,n,i,a,r])})();a(()=>{L.jumpToTarget&&A(L.jumpToTarget.tab)},[L.jumpToTarget]),a(()=>{R&&JSON.stringify(Sn(i))!==JSON.stringify(Sn(R))&&D(null)},[i,R]);const F=p(!1),M=d(async()=>D(await g.fetchById(i)||null),[i,g]);a(()=>{if(F.current||(M(),F.current=!0),!T){const e=setInterval(()=>M(),3e3);return()=>clearInterval(e)}},[M,T]),a(()=>{R&&C(R)},[R]);const z=R&&Hh.includes(R.id.kind),X=o(()=>{const e=[],n=(R?.pods??[]).some(Yh),i=(o=R,(o?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var o;const a=e=>t(Cl,{...e,fill:s.v2.colors.red[500]});return e.push({value:Ip.Overview,label:nt.OVERVIEW}),c?(e.push({value:Ip.Pods,label:nt.PODS,icon:n?a:void 0}),e.push({value:Ip.Libraries,label:nt.LIBRARIES,icon:i?a:void 0}),e.push({value:Ip.PeerSources,label:nt.PEER_SOURCES}),w?.profiling?.enabled&&e.push({value:Ip.Profiling,label:nt.PROFILING}),e.push({value:Ip.Sampling,label:nt.SAMPLING}),e.push({value:Ip.Debug,label:nt.DEBUG}),e):(u&&b.canFetchProfiling&&e.push({value:Ip.Profiling,label:nt.PROFILING}),e)},[c,u,b.canFetchProfiling,w,R?.pods,s]),B=d(()=>k(!0),[]),U=o(()=>()=>{n(),r()},[n,r]),V=d(()=>{R&&C(R),k(!1)},[R]),H=d(async()=>{if(!R||!y)return;const{errorMessage:e,preparedFormData:t}=x();if(e)return;const n=t.otelServiceName!==R.id.name?t.otelServiceName:"";await g.update(i,{...t,otelServiceName:n}),k(!1)},[R,y,x,i,g]),j=!1===R?.markedForInstrumentation?.markedForInstrumentation,G=d(()=>N(!0),[]),W=d(async()=>{if(!R)return;const e=!1===R.markedForInstrumentation?.markedForInstrumentation;await g.persistV2({[Rt]:[{namespace:R.id.namespace,name:R.id.name,kind:R.id.kind,...R.id.region?{region:R.id.region}:{},selected:e,currentStreamName:m}]}),N(!1),e||n()},[R,g,m,n]),K=d(()=>{_({openFor:jh.Workload})},[]),Y=d(e=>{A(e),L.clearJumpToTarget()},[L]),J=d(async()=>{await g.recoverFromRollback(i)},[g,i]),q=d(()=>_({openFor:null}),[]),Z=d(async()=>{P.openFor===jh.Workload?await g.restartWorkloads([i]):P.openFor===jh.Pod&&P.podNamespace&&P.podName&&await g.restartPod(P.podNamespace,P.podName),q()},[P,g,i,q]),Q=o(()=>{const{kind:e,name:t}=i;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[i]),ee=o(()=>{const e=[];return T||$===Ip.Overview&&(e.push({id:"edit-source-btn-edit",label:Ft.EDIT,icon:Ka,active:T,onClick:B}),c&&z&&e.push({id:"edit-source-btn-restart",label:nt.ROLLOUT_RESTART,icon:Il,onClick:K}),e.push(j?{id:"edit-source-btn-instrument",label:Ft.INSTRUMENT,icon:Ha,color:s.v2.colors.green[500],active:I,onClick:G}:{id:"edit-source-btn-delete",label:Ft.UNINSTRUMENT,icon:Va,color:s.v2.colors.red[500],active:I,onClick:G})),e},[$,T,I,j,c,z,B,K,G,s]),ne=o(()=>{if(!R)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:R.id.name,leftIcon:c?yl:void 0}),R.serviceName&&R.serviceName!==R.id.name&&e.push({...t,label:R.serviceName,leftIcon:hl,textColor:s.v2.colors.silver[200]}),e},[R,s,c]);if(!R)return t(Xt,{isOpen:!0,children:t(ft,{$height:"80vh",children:t(St,{withSpinner:!0})})});const ie=$===Ip.Profiling?E?"95vw":"fit-content":T?void 0:"60vw",oe=c?Yn(R.containers)[0]:Kn(h);return e(Bp,{value:L,children:[t(Xt,{isOpen:!0,width:ie,minWidth:"min(1100px, 100vw)",header:{icon:oe,titleBadges:ne,onClose:()=>{Y(Ip.Overview),D(null),O(!1),n()},actions:ee},footer:{actions:T?[{"data-id":"edit-source-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:V},{"data-id":"edit-source-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:H}]:[]},children:t(le,{$padding:"4px 12px 12px",children:e(ae,{$gap:16,children:[!T&&X.length>1&&t(ve,{options:X,selected:$,setSelected:Y}),(()=>{switch($){case Ip.Overview:return T?t(Ws,{}):t(Xu,{source:R,onClickRollout:K,onClickRollback:J});case Ip.Pods:return t(Gp,{source:R,onClickRestartPod:z?(e,t)=>_({openFor:jh.Pod,podNamespace:e,podName:t}):void 0});case Ip.Libraries:return t(Bu,{source:R});case Ip.PeerSources:return t(Kp,{source:R});case Ip.Profiling:return t($h,{source:R,onFlameFullscreenChange:O});case Ip.Sampling:return t(Xh,{source:R,onRedirectToSampling:U});case Ip.Debug:return t(Qp,{source:R});default:return null}})()]})})}),t(mr,{target:"source",action:j?"instrument":"uninstrument",isOpen:I,onClose:()=>N(!1),onApprove:W}),t(tt,{isOpen:P.openFor===jh.Workload,title:Q.title,description:Q.description,onClose:q,denyButton:{label:"Go back",variant:Ie.Secondary,onClick:q},approveButton:{label:Ft.CONFIRM,variant:Ie.Primary,onClick:Z}}),t(mr,{target:"pod",action:"restart",description:nt.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:P.openFor===jh.Pod,onClose:q,onApprove:Z,overrideApproveButtonLabel:nt.DELETE_POD_TO_RESTART})]})},qh=b.div`
|
|
765
|
+
`,Fg=({source:e,onRedirectToSampling:i})=>t(Gt,{bgTint:"1000",richTitle:{title:it.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(Ug,{container:e,onRedirectToSampling:i},e.containerName))});var Bg;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(Bg||(Bg={}));const Vg=e=>"noisy"===e.type?k(e.rule,"source"):"highlyRelevant"===e.type?T(e.rule,"source"):"costReduction"===e.type?$(e.rule,"source"):[],Ug=({container:i,onRedirectToSampling:n})=>{const[o,l]=r(Bg.All),s=Si(e=>e.setPendingViewSamplingRule),c=i.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(i.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[i.agentConfig?.traces?.headSampling?.noisyOperations]),p=a(()=>(i.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[i.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=a(()=>(i.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[i.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>o===Bg.Noisy?d:o===Bg.HighlyRelevant?p:o===Bg.CostReduction?u:[...d,...p,...u],[o,p,u]),g=d.length+p.length+u.length,m=a(()=>(e,t)=>{s({ruleId:e,category:t}),n()},[n,s]),b=t(zg,{children:t(ke,{"data-id":"sampling-container-create-rule",variant:$e.Secondary,size:Te.S,label:Ki,rightIcon:Rr,onClick:e=>{e.stopPropagation(),n()}})});return t(Xg,{children:e(Gt,{bgTint:"900",richTitle:{title:i.containerName},renderOnRightSide:b,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Gt,{bgTint:"800",richTitle:{title:it.HEAD_SAMPLING,badge:{label:c.length}},children:[t(ee,{size:te.XXS,children:it.NOISY_OPERATIONS}),t(oe,{$gap:4,children:c.map(e=>t(Mg,{name:e.name,summary:k(e),disabled:e.disabled,onJumpToRule:()=>m(e.ruleId,"noisy")},e.ruleId))})]}):t(_g,{children:t(ee,{size:te.XS,color:ie.Secondary,children:it.HEAD_SAMPLING})}),g?e(Gt,{bgTint:"800",richTitle:{title:it.TAIL_SAMPLING,badge:{label:g}},children:[t(ve,{options:(f=d.length,v=p.length,y=u.length,[{value:Bg.All,label:"All",badge:{label:f+v+y,textSize:te.XXXS}},{value:Bg.Noisy,label:it.NOISY_OPERATIONS,badge:{label:f,textSize:te.XXXS}},{value:Bg.HighlyRelevant,label:it.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:te.XXXS}},{value:Bg.CostReduction,label:it.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:te.XXXS}}]),selected:o,setSelected:l}),t(oe,{$gap:4,children:h.length?h.map(e=>t(Mg,{name:e.rule.name,summary:Vg(e),disabled:e.rule.disabled,onJumpToRule:()=>m(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Ae,{title:`No ${o===Bg.All?`${Bg.Noisy}, ${Bg.HighlyRelevant} and ${Bg.CostReduction}`:o} operations`})})]}):t(_g,{children:t(ee,{size:te.XS,color:ie.Secondary,children:it.TAIL_SAMPLING})})]})});var f,v,y},jg=[$i.Deployment,$i.StatefulSet,$i.DaemonSet,$i.DeploymentConfig,$i.Rollout,$i.Pod];var Hg;(e=>{e.Workload="Workload",e.Pod="Pod"})(Hg||(Hg={}));const Gg=e=>!!e&&di(e.status)===Le.Error,Kg=e=>Gg(e.healthStatus),Wg=e=>Gg(e.odigosHealthStatus)||(e.processes??[]).some(Kg),Yg=e=>Gg(e.agentInjectedStatus)||Gg(e.odigosHealthStatus)||(e.containers??[]).some(Wg),qg=({onClose:i,sourceId:n,onRedirectToSampling:l})=>{const s=v(),{isK8s:c,isVm:u,platformType:h}=x(),{selectedStreamName:g}=nt(),{sourcesApi:m,configApi:b,capabilities:f}=ws(),{genericForm:y,loadSource:S,validateFormData:C}=Is(),{data:w}=b.useEffectiveConfig(),[k,T]=r(!1),[$,I]=r(!1),[N,O]=r(!1),[A,E]=r(Au.Overview),[D,R]=r(null),[L,P]=r({openFor:null}),M=(()=>{const[e,t]=r(null),i=d(e=>{t({tab:Au.Pods,podName:e.podName})},[]),n=d((e,i)=>{t({tab:Au.Pods,podName:e.podName,containerName:i.containerName})},[]),o=d((e,i,n)=>{const a=Mu({identifyingAttributes:n.identifyingAttributes});t({tab:Au.Pods,podName:e.podName,containerName:i.containerName,processPid:a})},[]),l=d(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:i,jumpToContainer:n,jumpToProcess:o,clearJumpToTarget:l}),[e,i,n,o,l])})();o(()=>{M.jumpToTarget&&E(M.jumpToTarget.tab)},[M.jumpToTarget]),o(()=>{D&&JSON.stringify(xi(n))!==JSON.stringify(xi(D))&&R(null)},[n,D]);const z=p(!1),X=d(async()=>R(await m.fetchById(n)||null),[n,m]);o(()=>{if(z.current||(X(),z.current=!0),!k){const e=setInterval(()=>X(),3e3);return()=>clearInterval(e)}},[X,k]),o(()=>{D&&S(D)},[D]);const _=D&&jg.includes(D.id.kind),F=a(()=>{const e=[],i=(D?.pods??[]).some(Yg),n=(a=D,(a?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var a;const o=e=>t(cl,{...e,fill:s.v2.colors.red[500]});return e.push({value:Au.Overview,label:it.OVERVIEW}),c?(e.push({value:Au.Pods,label:it.PODS,icon:i?o:void 0}),e.push({value:Au.Libraries,label:it.LIBRARIES,icon:n?o:void 0}),e.push({value:Au.PeerSources,label:it.PEER_SOURCES}),w?.profiling?.enabled&&e.push({value:Au.Profiling,label:it.PROFILING}),e.push({value:Au.Sampling,label:it.SAMPLING}),e.push({value:Au.Debug,label:it.DEBUG}),e):(u&&f.canFetchProfiling&&e.push({value:Au.Profiling,label:it.PROFILING}),e)},[c,u,f.canFetchProfiling,w,D?.pods,s]),B=d(()=>T(!0),[]),V=a(()=>()=>{i(),l()},[i,l]),U=d(()=>{D&&S(D),T(!1)},[D]),j=d(async()=>{if(!D||!y)return;const{errorMessage:e,preparedFormData:t}=C();if(e)return;const i=t.otelServiceName!==D.id.name?t.otelServiceName:"";await m.update(n,{...t,otelServiceName:i}),T(!1)},[D,y,C,n,m]),H=!1===D?.markedForInstrumentation?.markedForInstrumentation,G=d(()=>I(!0),[]),K=d(async()=>{if(!D)return;const e=!1===D.markedForInstrumentation?.markedForInstrumentation;await m.persistV2({[Dt]:[{namespace:D.id.namespace,name:D.id.name,kind:D.id.kind,...D.id.region?{region:D.id.region}:{},selected:e,currentStreamName:g}]}),I(!1),e||i()},[D,m,g,i]),W=d(()=>{P({openFor:Hg.Workload})},[]),Y=d(e=>{E(e),M.clearJumpToTarget()},[M]),q=d(async()=>{await m.recoverFromRollback(n)},[m,n]),J=d(()=>P({openFor:null}),[]),Z=d(async()=>{L.openFor===Hg.Workload?await m.restartWorkloads([n]):L.openFor===Hg.Pod&&L.podNamespace&&L.podName&&await m.restartPod(L.podNamespace,L.podName),J()},[L,m,n,J]),Q=a(()=>{const{kind:e,name:t}=n;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[n]),ee=a(()=>{const e=[];return k||A===Au.Overview&&(e.push({id:"edit-source-btn-edit",label:zt.EDIT,icon:zr,active:k,onClick:B}),c&&_&&e.push({id:"edit-source-btn-restart",label:it.ROLLOUT_RESTART,icon:ml,onClick:W}),e.push(H?{id:"edit-source-btn-instrument",label:zt.INSTRUMENT,icon:Rr,color:s.v2.colors.green[500],active:$,onClick:G}:{id:"edit-source-btn-delete",label:zt.UNINSTRUMENT,icon:Dr,color:s.v2.colors.red[500],active:$,onClick:G})),e},[A,k,$,H,c,_,B,W,G,s]),ie=a(()=>{if(!D)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:D.id.name,leftIcon:c?sl:void 0}),D.serviceName&&D.serviceName!==D.id.name&&e.push({...t,label:D.serviceName,leftIcon:il,textColor:s.v2.colors.silver[200]}),e},[D,s,c]);if(!D)return t(Ft,{isOpen:!0,children:t(bt,{$height:"80vh",children:t(xt,{withSpinner:!0})})});const ne=A===Au.Profiling?N?"95vw":"fit-content":k?void 0:"60vw",ae=c?Yi(D.containers)[0]:Wi(h);return e(Fu,{value:M,children:[t(Ft,{isOpen:!0,width:ne,minWidth:"min(1100px, 100vw)",header:{icon:ae,titleBadges:ie,onClose:()=>{Y(Au.Overview),R(null),O(!1),i()},actions:ee},footer:{actions:k?[{"data-id":"edit-source-btn-cancel",label:zt.CANCEL,variant:$e.Secondary,onClick:U},{"data-id":"edit-source-btn-save",label:zt.SAVE,variant:$e.Primary,onClick:j}]:[]},children:t(re,{$padding:"4px 12px 12px",children:e(oe,{$gap:16,children:[!k&&F.length>1&&t(ve,{options:F,selected:A,setSelected:Y}),(()=>{switch(A){case Au.Overview:return k?t(Yc,{}):t(Fh,{source:D,onClickRollout:W,onClickRollback:q});case Au.Pods:return t(Hu,{source:D,onClickRestartPod:_?(e,t)=>P({openFor:Hg.Pod,podNamespace:e,podName:t}):void 0});case Au.Libraries:return t(Bh,{source:D});case Au.PeerSources:return t(Ku,{source:D});case Au.Profiling:return t(Ag,{source:D,onFlameFullscreenChange:O});case Au.Sampling:return t(Fg,{source:D,onRedirectToSampling:V});case Au.Debug:return t(Zu,{source:D});default:return null}})()]})})}),t(gs,{target:"source",action:H?"instrument":"uninstrument",isOpen:$,onClose:()=>I(!1),onApprove:K}),t(tt,{isOpen:L.openFor===Hg.Workload,title:Q.title,description:Q.description,onClose:J,denyButton:{label:"Go back",variant:$e.Secondary,onClick:J},approveButton:{label:zt.CONFIRM,variant:$e.Primary,onClick:Z}}),t(gs,{target:"pod",action:"restart",description:it.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:L.openFor===Hg.Pod,onClose:J,onApprove:Z,overrideApproveButtonLabel:it.DELETE_POD_TO_RESTART})]})},Jg={"Cost Optimization":{icon:$l,status:Le.Warning},Normalization:{icon:Tl,status:Le.Default},Enrichment:{icon:kl,status:Le.Info},Maintenance:{icon:ol,status:Le.Warning},Reliability:{icon:Wr,status:Le.Success},Usability:{icon:wl,status:Le.Info}},Zg={icon:Il,status:Le.Unknown},Qg={[qi.Recommended]:Le.Info,[qi.Applied]:Le.Success,[qi.Dismissed]:Le.Disabled,[qi.NotApplicable]:Le.Unknown},em="Created from recommendation",tm={[Zi.EnableUrlTemplatization]:()=>({type:Oe.URLTemplatization,name:"URL Templatization",notes:em,disabled:!1,signals:[Me.Traces],fields:{}}),[Zi.EnableInferDbAttributes]:()=>({type:Oe.InferDbAttributes,name:"Infer DB Attributes",notes:em,disabled:!1,signals:[Me.Traces],fields:{}})},im=e=>e.applyExamples.some(({type:e})=>e===Ji.OdigosAction),nm=e=>im(e)?tm[e.type]?.():void 0,am=e=>e.applied?qi.Applied:e.conditionsMet?e.dismissed?qi.Dismissed:qi.Recommended:qi.NotApplicable,om=e=>{const t={[qi.Recommended]:[],[qi.Applied]:[],[qi.Dismissed]:[],[qi.NotApplicable]:[]};for(const i of e)t[am(i)].push(i);return t},rm=e=>{let t=0;for(const i of e)am(i)===qi.Recommended&&(t+=1);return t},lm=[qi.Recommended,qi.Applied,qi.Dismissed,qi.NotApplicable],sm={[Ji.HelmValues]:"Helm values",[Ji.OdigosAction]:"Odigos Action"},cm=({remediations:i})=>{const n=i.flatMap(e=>e.applyExamples.map((t,n)=>({key:`${e.type}-${t.type}-${n}`,title:i.length>1?`${sm[t.type]||t.type} — ${e.buttonText}`:sm[t.type]||t.type,content:t.content})));return n.length?e(oe,{$gap:8,children:[e(oe,{$gap:2,children:[t(ee,{size:te.XS,color:ie.Primary,weight:500,children:Qi}),t(ee,{size:te.XXS,color:ie.Secondary,children:en})]}),n.map(e=>t(ms,{title:e.title,yaml:e.content,compact:!0},e.key))]}):null},dm=({recommendation:i,onApplyServerRemediation:n,onCreateAction:a,onApplied:o})=>{const[l,s]=r(),c=i.remediations.filter(e=>im(e)?!!nm(e)&&!!a:!!n);return c.length?e(oe,{$gap:8,children:[e(oe,{$gap:2,children:[t(ee,{size:te.XS,color:ie.Primary,weight:500,children:tn}),t(ee,{size:te.XXS,color:ie.Secondary,children:nn})]}),t(Re,{status:Le.Default,message:an,fullWidth:!0,smallIcon:!0}),t(ne,{$gap:8,$wrap:"wrap",children:c.map(e=>t(ke,{"data-id":`apply-recommendation-${e.type}`,label:e.buttonText,tooltip:e.tooltip,size:Te.S,variant:$e.Primary,loading:l===e.type,disabled:!!l,onClick:()=>(async e=>{if(!l){s(e.type);try{(im(e)?await(a?.(e)):await(n?.(e.type)))&&o?.()}finally{s(void 0)}}})(e)},e.type))})]}):null};var pm;(e=>{e.Ui="ui",e.GitOps="gitops"})(pm||(pm={}));const um=({recommendation:i,onDismiss:n,onAcceptedChange:a,onApplyServerRemediation:l,onCreateAction:s,onApplied:c})=>{const p=!i.requireOdigosDeployment&&i.remediations.some(e=>im(e)?!!nm(e)&&!!s:!!l),u=i.remediations.some(({applyExamples:e})=>e.length>0),[h,g]=r(!1),[m,b]=r(!1),[f,v]=r(()=>p?pm.Ui:pm.GitOps),y=[...p?[{value:pm.Ui,label:dn}]:[],...u?[{value:pm.GitOps,label:pn}]:[]],S=y.length>1;o(()=>()=>a?.(!1),[a]);const x=d(()=>{g(!0),a?.(!0)},[a]),C=d(async()=>{if(n&&!m){b(!0);try{await n(i.name,!0)}finally{b(!1)}}},[m,n,i.name]);return p||u?e(oe,{$gap:0,children:[t(bs,{open:!h,gapCancelPx:0,children:e(oe,{$gap:12,children:[e(oe,{$gap:4,children:[t(ee,{size:te.XS,color:ie.Primary,weight:500,children:on}),t(ee,{size:te.XXS,color:ie.Secondary,children:rn})]}),e(ne,{$gap:8,children:[t(ke,{"data-id":"recommendation-accept",label:ln,size:Te.S,variant:$e.Primary,onClick:x}),n&&t(ke,{"data-id":"recommendation-dismiss",label:sn,size:Te.S,variant:$e.Secondary,disabled:m,onClick:C})]})]})}),t(bs,{open:h,delayInMs:40,children:e(oe,{$gap:20,children:[S&&e(oe,{$gap:4,children:[t(ee,{size:te.XS,color:ie.Primary,weight:500,children:on}),t(ee,{size:te.XXS,color:ie.Secondary,children:cn}),t(ve,{"data-id":"recommendation-installation-method",size:Xt.S,fullWidth:!0,selected:f,setSelected:v,options:y})]}),f===pm.Ui&&p?t(dm,{recommendation:i,onApplyServerRemediation:l,onCreateAction:s,onApplied:c}):t(cm,{remediations:i.remediations})]})})]}):null},hm=f.ul`
|
|
766
|
+
margin: 0;
|
|
767
|
+
padding-left: 18px;
|
|
768
|
+
display: flex;
|
|
769
|
+
flex-direction: column;
|
|
770
|
+
gap: 4px;
|
|
771
|
+
`,gm=f.li`
|
|
772
|
+
color: ${({theme:e})=>e.v2.colors.grey[300]};
|
|
773
|
+
`,mm=f.div`
|
|
774
|
+
display: grid;
|
|
775
|
+
grid-template-columns: 1fr;
|
|
776
|
+
gap: 16px;
|
|
777
|
+
width: 100%;
|
|
778
|
+
padding-top: 16px;
|
|
779
|
+
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
780
|
+
`,bm=f(oe)`
|
|
781
|
+
min-width: 0;
|
|
782
|
+
`,fm=f.div`
|
|
783
|
+
display: flex;
|
|
784
|
+
align-items: center;
|
|
785
|
+
justify-content: center;
|
|
786
|
+
width: 16px;
|
|
787
|
+
height: 16px;
|
|
788
|
+
flex-shrink: 0;
|
|
789
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.green[600]};
|
|
790
|
+
border-radius: 50%;
|
|
791
|
+
`,vm=f.div`
|
|
792
|
+
width: 100%;
|
|
793
|
+
min-width: 0;
|
|
794
|
+
|
|
795
|
+
> section {
|
|
796
|
+
min-height: 96px;
|
|
797
|
+
transition:
|
|
798
|
+
background-color 0.15s ease,
|
|
799
|
+
transform 0.15s ease,
|
|
800
|
+
box-shadow 0.15s ease;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
&:hover > section {
|
|
804
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
805
|
+
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
|
|
806
|
+
transform: translateY(-1px);
|
|
807
|
+
}
|
|
808
|
+
`,ym=f(ne)`
|
|
809
|
+
width: 100%;
|
|
810
|
+
padding-top: 4px;
|
|
811
|
+
`,Sm=({recommendation:i,state:n,onDismiss:a,onApplyServerRemediation:o,onCreateAction:l,onRemediationApplied:s})=>{const c=v(),[p,u]=r(!1),[h,g]=r(!1),m=n===qi.NotApplicable?un:i.summary,b=i.description.trim().split(/\n\s*\n/).map(e=>e.replace(/\s+/g," ").trim()).filter(Boolean),f=(y=i.categories[0])&&Jg[y]||Zg;var y;const S=n===qi.Recommended&&i.conditionsMet,x=S&&!h,C=n===qi.Recommended&&!!a&&!x,w=n===qi.Dismissed&&!!a,k=n===qi.Recommended?void 0:{key:n,label:hn[n],status:Qg[n],useSecondaryTone:!0,textSize:te.XXXS},T=d(async()=>{if(a&&!p){u(!0);try{await a(i.name,n!==qi.Dismissed)}finally{u(!1)}}},[a,p,i.name,n]);return t(vm,{children:t(Gt,{bgTint:"900",moreSpacing:!0,withCollapse:!0,badges:k?[k]:[],richTitle:{icon:f.icon,title:i.title,titleSize:te.S,titleWrap:!0,titleMeta:i.categories.join(" · "),subTitle:m,subTitleSize:te.XXS,subTitleWrap:!0,textGap:6,alignItems:"flex-start"},children:e(oe,{$gap:16,children:[t(bs,{open:!h,gapCancelPx:16,children:e(oe,{$gap:16,children:[b.length>0&&t(oe,{$gap:8,children:b.map(e=>t(ee,{size:te.XS,color:ie.Secondary,lineHeight:"20px",children:e},e))}),(i.pros.length>0||i.cons.length>0)&&e(mm,{children:[i.pros.length>0&&e(bm,{$gap:8,children:[e(ne,{$gap:8,children:[t(fm,{children:t(Gr,{size:10,fill:c.v2.colors.green[600]})}),t(ee,{size:te.XS,weight:400,color:ie.Primary,children:gn})]}),t(hm,{children:i.pros.slice(0,3).map(e=>t(gm,{children:t(ee,{size:te.XXS,color:ie.Secondary,variant:Ot.Span,children:e})},e))})]}),i.cons.length>0&&e(bm,{$gap:8,children:[e(ne,{$gap:8,children:[t(cl,{size:18,fill:c.v2.colors.orange[500]}),t(ee,{size:te.XS,weight:400,color:ie.Primary,children:mn})]}),t(hm,{children:i.cons.slice(0,3).map(e=>t(gm,{children:t(ee,{size:te.XXS,color:ie.Secondary,variant:Ot.Span,children:e})},e))})]})]})]})}),S&&t(um,{recommendation:i,onDismiss:a,onAcceptedChange:g,onApplyServerRemediation:o,onCreateAction:l,onApplied:s}),e(ym,{$gap:8,$justifyContent:"flex-end",children:[i.docsUrl&&t(ke,{label:bn,leftIcon:Pr,size:Te.S,variant:$e.Text,onClick:()=>window.open(i.docsUrl,"_blank","noopener noreferrer")}),C&&t(ke,{label:sn,size:Te.S,variant:$e.Secondary,disabled:p,onClick:T}),w&&t(ke,{label:fn,size:Te.S,variant:$e.Secondary,disabled:p,onClick:T})]})]})})})},xm=f.div`
|
|
812
|
+
width: 100%;
|
|
813
|
+
min-width: 0;
|
|
814
|
+
max-width: 100%;
|
|
815
|
+
padding: 8px 16px 20px;
|
|
816
|
+
`,Cm=f(oe)`
|
|
817
|
+
opacity: ${({$state:e})=>e===qi.Applied?.78:1};
|
|
818
|
+
transition: opacity 0.15s ease;
|
|
819
|
+
|
|
820
|
+
&:hover {
|
|
821
|
+
opacity: 1;
|
|
822
|
+
}
|
|
823
|
+
`,wm=f(ne)`
|
|
824
|
+
width: 100%;
|
|
825
|
+
min-height: 28px;
|
|
826
|
+
padding-left: 10px;
|
|
827
|
+
border-left: 2px solid
|
|
828
|
+
${({theme:e,$state:t})=>t===qi.Recommended?e.v2.colors.purple[500]:t===qi.Applied?e.v2.colors.green[500]:e.v2.colors.grey[500]};
|
|
829
|
+
`,km=({isOpen:i,onClose:n})=>{const{actionsApi:r,capabilities:l,recommendationsApi:s}=ws(),{items:c,loading:u,refetch:h}=s.useRecommendations(),g=p([]),m=p(h);m.current=h,o(()=>{i&&m.current()},[i]),o(()=>()=>{g.current.forEach(clearTimeout)},[]);const b=d(()=>{g.current.forEach(clearTimeout),g.current=[2e3,5e3,1e4].map(e=>setTimeout(()=>{m.current()},e))},[]),f=d(async(e,t)=>{if(!s.applyRemediation)return!1;const i=await s.applyRemediation(e,t);return!i?.error},[s]),v=d(async e=>{const t=nm(e);if(!t)return!1;const i=await r.create(t);return!i?.error},[r]),y=a(()=>om(c),[c]),S=c.length>0;return t(Ft,{isOpen:i,width:"min(700px, 100vw)",header:{icon:Il,title:yn,subTitle:vn,onClose:n},children:t(xm,{children:u&&!S?t(le,{size:3}):S?t(oe,{$gap:28,$width:"100%",children:lm.map(i=>{const n=y[i];return 0===n.length?null:e(Cm,{$state:i,$gap:12,$width:"100%",children:[e(wm,{$state:i,$gap:8,$justifyContent:"space-between",children:[t(ee,{size:te.XS,weight:600,color:i===qi.Recommended?ie.Primary:ie.Secondary,children:hn[i]}),t(ce,{label:n.length,status:Qg[i],useSecondaryTone:!0,textSize:te.XXXS})]}),t(oe,{$gap:12,$width:"100%",children:n.map(e=>t(Sm,{recommendation:e,state:i,onDismiss:s.setDismissed,onApplyServerRemediation:s.applyRemediation?t=>f(e.type,t):void 0,onCreateAction:l.canCreateAction?v:void 0,onRemediationApplied:b},e.name))})]},i)})}):t(Ae,{icon:Il,title:xn,subTitle:Sn})})})},Tm=f.div`
|
|
780
830
|
display: flex;
|
|
781
831
|
align-items: center;
|
|
782
832
|
gap: 8px;
|
|
@@ -786,9 +836,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
786
836
|
&:hover {
|
|
787
837
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
788
838
|
}
|
|
789
|
-
|
|
839
|
+
`,$m=f.div`
|
|
790
840
|
flex: 1;
|
|
791
|
-
`,
|
|
841
|
+
`,Im=({onClick:i})=>{const n=v().v2.colors.red[500];return e(Tm,{"data-id":"sampling-view-btn-delete",onClick:i,children:[t(ee,{size:te.XS,weight:500,color:n,children:Tn}),t(Dr,{size:16,fill:n})]})};const Nm={[Os.EditAutoNoisy]:{title:_n,subTitle:Xn,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Os.EditAutoCostReduction]:{title:zn,subTitle:Mn,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Os.EditAutoHighlyRelevant]:{title:Pn,subTitle:Ln,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Om=({isOpen:e,title:i,subTitle:n,onClose:a,footer:o,renderBody:r})=>t(Ft,{isOpen:e,width:Bn,header:{icon:$l,title:i,subTitle:n,onClose:a},footer:o,children:r?r():t(re,{$padding:"12px",children:t(td,{})})}),Am=({isOpen:n,onClose:l,onSubmit:s,validateForm:c,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:g,duplicateWarning:m,setDuplicateWarning:b}=Ns(Os.Create),[f,v]=r(!1);o(()=>{n&&(g(),v(!1))},[n]);const y=d(()=>{v(!1),s(h)},[h,s]),S=d(()=>{if(c){const e=c(h);if(e)return void b(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(I(t)))(h,u)?v(!0):y()},[h,u,c,b,y]),x=a(()=>f?((e,t)=>{switch(e){case"noisy":return k(A(t));case"highlyRelevant":return T(O(t));case"costReduction":return $(N(t))}})(u,h):[],[f,u,h]),C={note:m?{status:Le.Warning,message:m.message,action:p?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>p(m.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:Cn,variant:$e.Secondary,size:Te.S,onClick:l},{"data-id":"sampling-create-btn-submit",label:Ki,variant:$e.Primary,size:Te.S,onClick:S,disabled:!!m}]};return e(i,{children:[t(Om,{isOpen:n,title:On[u],subTitle:$n[u],onClose:l,footer:C}),t(tt,{isOpen:f,title:Dn,description:En,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:An,variant:$e.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Ki,variant:$e.Primary,onClick:y},children:e(oe,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(ee,{size:te.XS,weight:500,color:ie.Secondary,children:Rn}),t("div",{style:{width:"100%"},children:t(is,{summary:x})})]})})]})},Em=({onClose:n,onDelete:o,onSaveEdit:r,validateForm:l,onNavigateToDuplicate:s})=>{const{data:c,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:g,duplicateWarning:m,setDuplicateWarning:b}=Ns(Os.View),f=c?.rule.name||Nn,v=p&&c?In[c.category]:`${f} preview`,y=d(()=>{if(c&&p){if(l){const e=l(u);if(e)return void b(e)}r(u,c.rule.ruleId,c.samplingId),g()}},[c,p,u,r,l,b,g]),S=d(()=>{c&&o(c.rule.ruleId,c.samplingId)},[c,o]),x=a(()=>{if(!c)return;const a=m?{message:m.message,onViewRule:s?()=>s(m.ruleId):void 0}:null;return function(n){if(n.isEditing){const{onCancelEdit:a,onSave:o,onDelete:r,duplicateWarning:l}=n;return{children:e(i,{children:[t(Im,{onClick:r}),l&&t(Re,{status:Le.Warning,message:l.message,action:l.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:l.onViewRule}:void 0}),t($m,{}),t(ke,{"data-id":"sampling-view-edit-btn-cancel",label:Cn,variant:$e.Secondary,size:Te.S,onClick:a}),t(ke,{"data-id":"sampling-view-edit-btn-save",label:wn,variant:$e.Primary,size:Te.S,onClick:o,disabled:!!l})]})}}const{onDelete:a,onCancel:o,onEdit:r}=n;return{children:e(i,{children:[t(Im,{onClick:a}),t($m,{}),t(ke,{"data-id":"sampling-view-btn-cancel",label:Cn,variant:$e.Secondary,size:Te.S,onClick:o}),t(ke,{"data-id":"sampling-view-btn-edit",label:kn,variant:$e.Primary,size:Te.S,onClick:r})]})}}(p?{isEditing:!0,onCancelEdit:g,onSave:y,onDelete:S,duplicateWarning:a}:{isEditing:!1,onDelete:S,onCancel:n,onEdit:h})},[c,p,m,g,y,S,h,n,s]);return t(Om,{isOpen:!!c,title:v,subTitle:c?$n[c.category]:"",onClose:n,footer:x})},Dm=({isOpen:e,onClose:i,onSave:n})=>{const{localEnabled:a,resolvedPercentage:o}=Ns(Os.EditAutoNoisy),r=d(()=>n(a,o),[n,a,o]);return t(Pm,{formType:Os.EditAutoNoisy,isOpen:e,onClose:i,onSave:r})},Rm=({isOpen:e,onClose:i,onSave:n})=>{const{localEnabled:a,resolvedPercentage:o}=Ns(Os.EditAutoCostReduction),r=d(()=>n(a,o),[n,a,o]);return t(Pm,{formType:Os.EditAutoCostReduction,isOpen:e,onClose:i,onSave:r})},Lm=({isOpen:e,onClose:i,onSave:n})=>{const{localEnabled:a}=Ns(Os.EditAutoHighlyRelevant),o=d(()=>n(a),[n,a]);return t(Pm,{formType:Os.EditAutoHighlyRelevant,isOpen:e,onClose:i,onSave:o})},Pm=({formType:e,isOpen:i,onClose:n,onSave:a})=>{const o=Nm[e];return t(Om,{isOpen:i,title:o.title,subTitle:o.subTitle,onClose:n,footer:{actions:[{"data-id":o.cancelId,label:Cn,variant:$e.Secondary,size:Te.S,onClick:n},{"data-id":o.saveId,label:Fn,variant:$e.Primary,size:Te.S,onClick:a}]}})},Mm=e=>{switch(e.formType){case Os.Create:return t(Ms,{formType:Os.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Am,{...e})});case Os.View:return t(Ms,{formType:Os.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Em,{...e})});case Os.EditAutoNoisy:return t(Ms,{formType:Os.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Dm,{...e})});case Os.EditAutoCostReduction:return t(Ms,{formType:Os.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Rm,{...e})});case Os.EditAutoHighlyRelevant:return t(Ms,{formType:Os.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Lm,{...e})})}},zm=({token:n,isLoading:a,isEditing:o,onEdit:r,onCancel:l,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=Pt(),g=!o||a||!c.newToken;return Vn({key:"Enter",active:!g},s),e(ne,o?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Ie,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(ne,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(xt,{title:"Saving...",withGradient:!0}):e(i,{children:[t(ke,{variant:$e.Secondary,size:Te.S,leftIcon:Kr,onClick:l,disabled:a}),t(ke,{variant:$e.Primary,size:Te.S,leftIcon:Gr,onClick:s,disabled:g})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ee,{size:te.XS,children:new Array(55).fill("•").join("")}),e(ne,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(yt,{icon:zr,onClick:r})]})]})},Xm=({expiresAt:e,callbackValid:i,callbackExpired:n})=>{const{formatTimeAgo:r}=oi(),l=a(()=>r(e),[e,r]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Un(e,0)?Le.Error:Un(e,2592e6)?Le.Warning:Le.Success,[e]),d=a(()=>c===Le.Success?Gr:c===Le.Warning?Nl:cl,[c]);return o(()=>{c===Le.Success?i():c===Le.Error&&n()},[c]),t(Be,{text:s,children:t(ce,{leftIcon:d,label:l,status:c,invertColors:!0,useSecondaryTone:!0})})},_m=f.div`
|
|
792
842
|
display: flex;
|
|
793
843
|
flex-direction: column;
|
|
794
844
|
gap: 12px;
|
|
@@ -796,7 +846,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
796
846
|
border-radius: 12px;
|
|
797
847
|
border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
|
|
798
848
|
background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
|
|
799
|
-
`,
|
|
849
|
+
`,Fm=({children:e})=>{const i=v();return t(ee,{size:te.XXXS,color:i.v2.colors.grey[150],children:e})},Bm=({token:i})=>{const{tokensApi:n}=ws(),[a,o]=r(!1),[l,s]=r(!1),[c,d]=r(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:g,resetFormData:m}=Jt({newToken:""});return t(ut,{richTitle:{icon:Ol,title:"Odigos Pro Token"},children:e(_m,{$isExpired:c,children:[e(ne,{$justifyContent:"space-between",children:[e(oe,{$gap:4,children:[t(Fm,{children:"Issued for"}),t(ee,{size:te.XS,children:i.name||"N/A"})]}),e(oe,{$gap:4,children:[t(Fm,{children:"Expiration"}),t(Xm,{expiresAt:i.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(oe,{})]}),t(ne,{children:e(oe,{children:[t(Fm,{children:"Token"}),t(zm,{token:i.token,newToken:p.newToken,isLoading:a,isEditing:l,onEdit:()=>s(!0),onCancel:()=>(s(!1),void u("newToken","")),onSave:()=>(async()=>{if(!n.updateToken)return;o(!0);const e=await n.updateToken(p.newToken.trim());o(!1),e?.error?g("newToken",e.error):(s(!1),m())})(),formData:p,handleFormChange:u,handleErrorChange:g,formErrors:h})]})})]})})},Vm=f.div`
|
|
800
850
|
display: flex;
|
|
801
851
|
flex-direction: column;
|
|
802
852
|
align-items: center;
|
|
@@ -805,23 +855,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
805
855
|
padding: 12px 24px;
|
|
806
856
|
border-radius: 8px;
|
|
807
857
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
808
|
-
`,gm=()=>{const{progress:n}=$t(),{describeApi:i,namespacesApi:o}=Sr(),{items:a}=o.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=qt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ut,{richTitle:{icon:Fl,title:"Diagnose"},children:r?e(mm,{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:Dl,startedAt:r}),n[Dt.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[Dt.DownloadingDiagnose].list.map((n,i)=>e(ie,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(il,{size:16}):n.status===Pe.Error?t(ol,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ee,{size:te.XXXS,color:ne.Secondary,children:n.label})]},`diagnose-item-${i}-${n.label}`))})]}):e(ae,{$gap:24,children:[t(ee,{size:te.XXS,color:ne.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(ae,{$gap:16,children:[e(ie,{$gap:8,children:[t(Q,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include pprof profiles"})]}),e(ie,{$gap:8,children:[t(Q,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include Prometheus metrics"})]}),e(ie,{$gap:8,children:[t(Q,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>d("includeSourceWorkloads",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(vi,{alignX:Ci.Left,alignY:yi.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:Ie.Secondary,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(ce,{label:c.sourceWorkloadNamespaces.length,status:Pe.Default}):void 0}}),t(ie,{$justifyContent:"flex-end",children:t(Te,{label:"Download Diagnose",rightIcon:Dl,variant:Ie.Primary,onClick:async()=>{i.downloadDiagnose&&(s(Date.now()),await i.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},fm=()=>{const{platformType:e,version:n,tier:i}=S(),{describeApi:o}=Sr(),[r,s]=l(null);return a(()=>{o.fetchDescribeOdigos&&o.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ut,{richTitle:{icon:kl,title:"General Information"},children:t(Gt,{cellsPerRow:2,items:[{id:Si(),title:"Odigos Version",label:n},{id:Si(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:Si(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:Si(),title:"Tier",label:i}]})})},bm=({isOpen:n,onClose:i})=>{const{describeApi:o,tokensApi:a}=Sr(),l=a.useTokens().items[0];return e(Xt,{isOpen:n,header:{icon:kl,title:"System Overview",onClose:i},children:[o.fetchDescribeOdigos&&t(fm,{}),a.updateToken&&l&&t(hm,{token:l}),o.downloadDiagnose&&t(gm,{})]})},vm=({isOpen:i,onClose:o,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=it(),{dataStreamsApi:s}=Sr(),{requestSubmit:c}=Tr(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),o()},[s,l,r,o]),u=d(()=>c(p),[c,p]);return fi({key:"Enter",active:i},u),e(n,{children:[t(tt,{isOpen:i,onClose:o,onCloseEnd:a,title:nt.NAME_YOUR_STREAM,description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:Ie.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:o},children:t(Gs,{autoFocus:!0})}),t(js,{})]})},ym=({isOpen:i,onClose:o,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=Sr(),{genericForm:c,loadDataStream:p,requestSubmit:u}=Tr();a(()=>{i&&r&&p(r)},[i,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),o()},[s,r,o]),g=d(()=>u(m),[u,m]);return fi({key:"Enter",active:i},g),e(n,{children:[t(tt,{isOpen:i,onClose:o,onCloseEnd:l,title:nt.RENAME_STREAM(r),description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:o},children:t(Gs,{autoFocus:!0})}),t(js,{})]})},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)"})})]})]}),Sm=b.div`
|
|
858
|
+
`,Um=()=>{const{progress:i}=At(),{describeApi:n,namespacesApi:a}=ws(),{items:o}=a.useNamespaces(),[l,s]=r(null),{formData:c,handleFormChange:d,resetFormData:p}=Jt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ut,{richTitle:{icon:Al,title:"Diagnose"},children:l?e(Vm,{children:[t(xt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof i[Rt.DownloadingDiagnose]?.percentage,percentage:i[Rt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof i[Rt.DownloadingDiagnose]?.percentage,visualIcon:Cl,startedAt:l}),i[Rt.DownloadingDiagnose]?.list?.length&&t(oe,{$width:"100%",children:i[Rt.DownloadingDiagnose].list.map((i,n)=>e(ne,{$gap:4,$alignItems:"center",children:[i.status===Le.Success?t(Gr,{size:16}):i.status===Le.Error?t(Kr,{size:16}):t(xt,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ee,{size:te.XXXS,color:ie.Secondary,children:i.label})]},`diagnose-item-${n}-${i.label}`))})]}):e(oe,{$gap:24,children:[t(ee,{size:te.XXS,color:ie.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(oe,{$gap:16,children:[e(ne,{$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:ie.Secondary,children:"Include pprof profiles"})]}),e(ne,{$gap:8,children:[t(Q,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ee,{size:te.XXXS,color:ie.Secondary,children:"Include Prometheus metrics"})]}),e(ne,{$gap:8,children:[t(Q,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>d("includeSourceWorkloads",e)}),t(ee,{size:te.XXXS,color:ie.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(jn,{alignX:Gn.Left,alignY:Hn.Bottom,items:o.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:$e.Secondary,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(ce,{label:c.sourceWorkloadNamespaces.length,status:Le.Default}):void 0}}),t(ne,{$justifyContent:"flex-end",children:t(ke,{label:"Download Diagnose",rightIcon:Cl,variant:$e.Primary,onClick:async()=>{n.downloadDiagnose&&(s(Date.now()),await n.downloadDiagnose(c),s(null),p())},disabled:null!==l})})]})})},jm=()=>{const{platformType:e,version:i,tier:n}=x(),{describeApi:a}=ws(),[l,s]=r(null);return o(()=>{a.fetchDescribeOdigos&&a.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ut,{richTitle:{icon:gl,title:"General Information"},children:t(Gt,{cellsPerRow:2,items:[{id:Kn(),title:"Odigos Version",label:i},{id:Kn(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Kn(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Kn(),title:"Tier",label:n}]})})},Hm=({isOpen:i,onClose:n})=>{const{describeApi:a,tokensApi:o}=ws(),r=o.useTokens().items[0];return e(Ft,{isOpen:i,header:{icon:gl,title:"System Overview",onClose:n},children:[a.fetchDescribeOdigos&&t(jm,{}),o.updateToken&&r&&t(Bm,{token:r}),a.downloadDiagnose&&t(Um,{})]})},Gm=({isOpen:n,onClose:a,onCloseEnd:o})=>{const{addDataStreams:r,setSelectedStreamName:l}=nt(),{dataStreamsApi:s}=ws(),{requestSubmit:c}=$s(),p=d(async e=>{s.create?await s.create(e):(r([e]),l(e.name)),a()},[s,r,l,a]),u=d(()=>c(p),[c,p]);return Vn({key:"Enter",active:n},u),e(i,{children:[t(tt,{isOpen:n,onClose:a,onCloseEnd:o,title:it.NAME_YOUR_STREAM,description:it.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:zt.DONE,variant:$e.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:zt.CANCEL,variant:$e.Secondary,onClick:a},children:t(Wc,{autoFocus:!0})}),t(Kc,{})]})},Km=({isOpen:n,onClose:a,onCloseEnd:r,dataStreamName:l})=>{const{dataStreamsApi:s}=ws(),{genericForm:c,loadDataStream:p,requestSubmit:u}=$s();o(()=>{n&&l&&p(l)},[n,l]);const h=!!c?.isFormDirty,g=d(async e=>{await s.update(l,e),a()},[s,l,a]),m=d(()=>u(g),[u,g]);return Vn({key:"Enter",active:n},m),e(i,{children:[t(tt,{isOpen:n,onClose:a,onCloseEnd:r,title:it.RENAME_STREAM(l),description:it.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:zt.SAVE,variant:$e.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:zt.CANCEL,variant:$e.Secondary,onClick:a},children:t(Wc,{autoFocus:!0})}),t(Kc,{})]})},Wm=({scale:i=1})=>e("svg",{width:742*i,height:533*i,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)"})})]})]}),Ym=f.div`
|
|
809
859
|
position: absolute;
|
|
810
860
|
top: 50%;
|
|
811
861
|
left: 50%;
|
|
812
862
|
transform: translate(-50%, -50%);
|
|
813
863
|
z-index: ${({theme:e})=>e.v2.zIndex.modal};
|
|
814
|
-
`,
|
|
864
|
+
`,qm=()=>{const{drawerType:i,setDrawerType:n}=Si(),a=i===Yn.OnboardingDone,o=()=>n(null);return e(Wn,{isOpen:a,onClose:o,children:[t(Wm,{}),t(Ym,{children:e(oe,{$gap:32,$alignItems:"center",children:[e(oe,{$gap:24,$alignItems:"center",children:[t(ee,{size:te.L,weight:500,children:"Welcome to"}),t(fs,{size:260}),t(ee,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(ke,{label:"Get Started",rightIcon:Lr,onClick:o})]})})]})},Jm=f.div`
|
|
815
865
|
display: flex;
|
|
816
866
|
flex-direction: column;
|
|
817
867
|
gap: 8px;
|
|
818
868
|
padding: 4px 8px;
|
|
819
869
|
border-radius: 8px;
|
|
820
870
|
width: 100%;
|
|
821
|
-
`,
|
|
871
|
+
`,Zm=f.div`
|
|
822
872
|
white-space: pre;
|
|
823
873
|
overflow-x: auto;
|
|
824
|
-
`,
|
|
874
|
+
`,Qm=({name:i,recommended:n,toggleLabel:a,enabled:o,onEnabledChange:r,summary:l,toggleName:s})=>{const c=v();return e(Jm,{children:[e(ne,{$gap:8,$justifyContent:"space-between",children:[e(ne,{$gap:4,children:[t(ee,{size:te.XS,color:c.v2.colors.white[500],nowrap:!0,children:i}),n&&t(ce,{label:qn,leftIcon:El,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:te.XXXS})]}),t(me,{name:s??`sampling-onboarding-toggle-${i}`,label:a,labelAlign:be.Left,value:o,onChange:r,size:Nt.S})]}),t(Zm,{children:t(w,{parts:l})})]})},eb=f.div`
|
|
825
875
|
position: relative;
|
|
826
876
|
display: flex;
|
|
827
877
|
align-items: center;
|
|
@@ -831,18 +881,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
831
881
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
832
882
|
border-top-left-radius: 18px;
|
|
833
883
|
border-top-right-radius: 18px;
|
|
834
|
-
`,
|
|
884
|
+
`,tb=f.div`
|
|
835
885
|
position: absolute;
|
|
836
886
|
left: 16px;
|
|
837
887
|
top: 50%;
|
|
838
888
|
transform: translateY(-50%);
|
|
839
|
-
`,
|
|
889
|
+
`,ib=f.div`
|
|
840
890
|
height: 16px;
|
|
841
891
|
width: 100%;
|
|
842
892
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
843
893
|
border-top-left-radius: 18px;
|
|
844
894
|
border-top-right-radius: 18px;
|
|
845
|
-
`,
|
|
895
|
+
`,nb=f.div`
|
|
846
896
|
width: ${({$width:e})=>e}px;
|
|
847
897
|
display: flex;
|
|
848
898
|
flex-direction: column;
|
|
@@ -850,7 +900,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
850
900
|
gap: 22px;
|
|
851
901
|
padding: 8px 32px 32px 32px;
|
|
852
902
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
853
|
-
|
|
903
|
+
`,ab=e=>t(Dl,{rotate:90,...e}),ob=({children:i,center:n,onNext:a,nextLabel:o=Jn,nextLoading:r})=>e(ne,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[i,a&&t(ke,{"data-id":"sampling-onboarding-btn-next",label:o,rightIcon:ab,variant:$e.Primary,size:Te.M,onClick:a,loading:r})]}),rb=e=>t(Dl,{rotate:-90,...e}),lb=({title:i,onBack:n})=>{const a=v();return e(eb,{$hasBack:!!n,children:[n&&t(tb,{children:t(yt,{"data-id":"sampling-onboarding-back",icon:rb,size:St.M,onClick:n})}),t(ee,{size:te.M,weight:500,color:a.v2.colors.white[500],align:"center",children:i})]})},sb=f.div`
|
|
854
904
|
box-sizing: border-box;
|
|
855
905
|
width: ${({$width:e})=>e??"100%"};
|
|
856
906
|
${({$fillHeight:e})=>e&&y`
|
|
@@ -863,16 +913,16 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
863
913
|
padding: 16px;
|
|
864
914
|
border-radius: 16px;
|
|
865
915
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
866
|
-
`,
|
|
916
|
+
`,cb=({children:e,fillHeight:i,width:n})=>t(sb,{$fillHeight:i,$width:n,children:e}),db=f.ul`
|
|
867
917
|
margin: 0;
|
|
868
918
|
padding: 0;
|
|
869
919
|
list-style: disc;
|
|
870
|
-
`,
|
|
920
|
+
`,pb=f.li`
|
|
871
921
|
margin-left: 18px;
|
|
872
922
|
& + & {
|
|
873
923
|
margin-top: 6px;
|
|
874
924
|
}
|
|
875
|
-
`,
|
|
925
|
+
`,ub=({items:e,color:i})=>{const n=v(),a=i||n.v2.colors.silver[200];return t(db,{children:e.map((e,i)=>t(pb,{style:{color:a},children:t(ee,{size:te.XXS,color:a,children:e})},i))})},hb=({items:i})=>{const n=v();return t(oe,{$gap:16,children:i.map((i,a)=>e(ne,{$gap:8,$alignItems:"flex-start",children:[e(ee,{size:te.XS,color:n.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(oe,{$gap:2,children:[t(ee,{size:te.XS,color:n.v2.colors.white[500],weight:500,children:i.title}),t(ee,{size:te.XS,color:n.v2.colors.silver[200],children:i.description})]})]},a))})},gb=({message:e})=>t(Re,{status:Le.Default,message:e,fullWidth:!0,smallIcon:!0}),mb=f.div`
|
|
876
926
|
width: 100%;
|
|
877
927
|
padding: 8px;
|
|
878
928
|
display: flex;
|
|
@@ -880,12 +930,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
880
930
|
gap: 4px;
|
|
881
931
|
border-radius: 16px;
|
|
882
932
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
883
|
-
`,
|
|
933
|
+
`,bb=f.div`
|
|
884
934
|
display: flex;
|
|
885
935
|
align-items: center;
|
|
886
936
|
gap: 8px;
|
|
887
937
|
padding: 4px 8px 12px 8px;
|
|
888
|
-
`,
|
|
938
|
+
`,fb=f.div`
|
|
889
939
|
width: 100%;
|
|
890
940
|
display: flex;
|
|
891
941
|
flex-direction: column;
|
|
@@ -893,20 +943,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
893
943
|
padding: 8px;
|
|
894
944
|
border-radius: 12px;
|
|
895
945
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
896
|
-
`,
|
|
946
|
+
`,vb=({children:e})=>{const i=v();return t(ee,{size:te.S,weight:500,color:i.v2.colors.white[500],align:"center",children:e})},yb=f.div`
|
|
897
947
|
white-space: pre-line;
|
|
898
|
-
`,
|
|
948
|
+
`,Sb=({enabled:n,onEnabledChange:o,onBack:r,onNext:l})=>{const s=v(),c=a(()=>E({enabled:n,keepPercentage:0}),[n]);return e(i,{children:[t(lb,{title:Zn,onBack:r}),e(nb,{$width:854,children:[t(vb,{children:Qn}),e(oe,{$gap:8,$width:"100%",children:[t(cb,{children:t(yb,{children:t(ee,{size:te.XXS,color:s.v2.colors.silver[200],children:ea})})}),e(oe,{$gap:8,$width:"100%",children:[e(mb,{children:[t(bb,{children:t(ee,{size:te.S,weight:500,color:s.v2.colors.white[500],children:ta})}),t(fb,{children:t(Qm,{name:na,recommended:!0,toggleLabel:ia,enabled:n,onEnabledChange:o,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(gb,{message:aa})]})]})]}),t(ob,{onNext:l})]})},xb=e=>t(Dl,{rotate:90,...e}),Cb=({onClose:n})=>{const a=v();return e(i,{children:[t(ib,{}),e(nb,{$width:732,children:[t(oa,{icon:$l}),e(oe,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ee,{size:te.M,weight:500,color:a.v2.colors.white[500],children:ra}),la.split("\n").map((e,i)=>t(vb,{children:e},`subtitle-${i}-${e}`)),e(cb,{children:[t(ee,{size:te.XS,color:a.v2.colors.silver[200],children:sa}),t(ub,{color:a.v2.colors.white[500],items:[ca,da,pa]})]})]})]}),t(ob,{center:!0,children:t(ke,{"data-id":"sampling-onboarding-btn-go-to",label:ua,rightIcon:xb,variant:$e.Primary,size:Te.M,onClick:n})})]})},wb=e=>t(Dl,{rotate:90,...e}),kb=f.div`
|
|
899
949
|
display: flex;
|
|
900
950
|
flex-direction: column;
|
|
901
951
|
align-items: center;
|
|
902
952
|
gap: 8px;
|
|
903
953
|
width: 100%;
|
|
904
|
-
`,
|
|
954
|
+
`,Tb=({onSkip:n,onNext:a})=>{const o=v();return e(i,{children:[t(ib,{}),e(nb,{$width:732,children:[t(oa,{icon:$l}),e(oe,{$gap:16,$alignItems:"center",$width:"100%",children:[e(kb,{children:[t(ee,{size:te.M,weight:500,color:o.v2.colors.white[500],children:ha}),t(vb,{children:ga})]}),e(cb,{children:[t(ee,{size:te.XS,color:o.v2.colors.silver[200],children:ma}),t(hb,{items:[{title:fa,description:ba},{title:ya,description:va},{title:xa,description:Sa}]}),t(gb,{message:Ca})]})]})]}),e(ob,{center:!0,children:[t(ke,{"data-id":"sampling-onboarding-btn-skip",label:wa,variant:$e.Secondary,onClick:n}),t(ke,{"data-id":"sampling-onboarding-btn-start",label:ka,rightIcon:wb,variant:$e.Primary,onClick:a})]})]})},$b=f.div`
|
|
905
955
|
display: flex;
|
|
906
956
|
align-items: stretch;
|
|
907
957
|
gap: 16px;
|
|
908
958
|
width: 100%;
|
|
909
|
-
`,
|
|
959
|
+
`,Ib=f.div`
|
|
910
960
|
flex: 1;
|
|
911
961
|
display: flex;
|
|
912
962
|
flex-direction: column;
|
|
@@ -926,18 +976,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
926
976
|
background-color: ${t.v2.colors.silver[700]};
|
|
927
977
|
}
|
|
928
978
|
`}
|
|
929
|
-
`,
|
|
979
|
+
`,Nb=f.div`
|
|
930
980
|
display: flex;
|
|
931
981
|
align-items: center;
|
|
932
982
|
gap: 8px;
|
|
933
983
|
padding: 12px 16px;
|
|
934
|
-
`,
|
|
984
|
+
`,Ob=f.div`
|
|
935
985
|
flex: 1;
|
|
936
986
|
padding: 8px;
|
|
937
987
|
display: flex;
|
|
938
988
|
flex-direction: column;
|
|
939
989
|
gap: 8px;
|
|
940
|
-
`,
|
|
990
|
+
`,Ab=f.div`
|
|
941
991
|
flex: 1;
|
|
942
992
|
display: flex;
|
|
943
993
|
flex-direction: column;
|
|
@@ -945,17 +995,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
945
995
|
padding: 12px;
|
|
946
996
|
border-radius: 12px;
|
|
947
997
|
background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
948
|
-
`,
|
|
998
|
+
`,Eb=f.div`
|
|
949
999
|
display: flex;
|
|
950
1000
|
justify-content: flex-end;
|
|
951
|
-
`,
|
|
1001
|
+
`,Db=f.div`
|
|
952
1002
|
display: flex;
|
|
953
1003
|
align-items: center;
|
|
954
1004
|
gap: 8px;
|
|
955
1005
|
padding: 4px 12px 4px 4px;
|
|
956
1006
|
border-radius: 8px;
|
|
957
1007
|
background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
|
|
958
|
-
`,
|
|
1008
|
+
`,Rb=f.div`
|
|
959
1009
|
display: flex;
|
|
960
1010
|
align-items: center;
|
|
961
1011
|
justify-content: center;
|
|
@@ -963,13 +1013,1151 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
963
1013
|
height: 24px;
|
|
964
1014
|
border-radius: 6px;
|
|
965
1015
|
background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
|
|
966
|
-
`,
|
|
1016
|
+
`,Lb=({selected:i,onSelect:n,name:a,description:o,badgeProps:r,bullets:l,warning:s,onReadMore:c})=>{const d=v(),p=i?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Ib,{$selected:i,onClick:n,children:[e(Nb,{children:[t(xe,{"data-id":`sampling-onboarding-radio-${a}`,value:i,onChange:n,size:we.L}),t($l,{size:24,fill:d.v2.colors.white[500]}),t(ee,{size:te.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(Ob,{children:[e(Ab,{$selected:i,children:[e(oe,{$gap:8,children:[t(ce,{...r,textSize:te.XXXS}),t(ee,{size:te.XXS,color:p,children:o})]}),l&&l.length>0&&t(ub,{color:p,items:l}),s&&e(Db,{children:[t(Rb,{children:t(Nl,{size:18,fill:d.v2.colors.yellow[500]})}),t(ee,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Eb,{children:t(ke,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:Ba,rightIcon:Pr,variant:$e.Text,size:Te.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Pb=({strategy:n,onStrategyChange:a,onBack:o,onNext:r,docsUrl:l})=>{const s=v(),c=l?()=>window.open(l,"_blank"):void 0;return e(i,{children:[t(lb,{title:Ta,onBack:o}),e(nb,{$width:854,children:[t(vb,{children:$a}),e($b,{children:[t(Lb,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:Da,description:Ea,badgeProps:{label:Aa,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Na,Oa],warning:Ia,onReadMore:c}),t(Lb,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:za,description:Ma,badgeProps:{label:Pa,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Ra,La],onReadMore:c}),t(Lb,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:Fa,description:_a,badgeProps:{label:Xa,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(ob,{onNext:r})]})},Mb=({onBack:n,onNext:o,submitting:r})=>{const l=v(),s=a(()=>[{title:Ha,bullets:[Va,Ua,ja]},{title:Ja,bullets:[Ga,Ka,Wa,Ya,qa]}],[]);return e(i,{children:[t(lb,{title:Za,onBack:n}),e(nb,{$width:854,children:[t(vb,{children:Qa}),t(ne,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((i,n)=>e(cb,{fillHeight:!0,width:"50%",children:[t(ee,{size:te.XS,color:l.v2.colors.white[500],children:i.title}),t(ub,{items:i.bullets})]},n))}),t(gb,{message:eo})]}),t(ob,{onNext:o,nextLoading:r})]})},zb=f.div`
|
|
967
1017
|
white-space: pre-line;
|
|
968
|
-
`,
|
|
1018
|
+
`,Xb=({errorPresetEnabled:n,onErrorPresetChange:o,onBack:r,onNext:l,submitting:s})=>{const c=v(),d=a(()=>D(n?{disabled:!1}:null),[n]);return e(i,{children:[t(lb,{title:to,onBack:r}),e(nb,{$width:854,children:[t(vb,{children:io}),e(oe,{$gap:8,$width:"100%",children:[e(cb,{children:[t(zb,{children:t(ee,{size:te.XXS,color:c.v2.colors.silver[200],children:no})}),t(gb,{message:eo})]}),e(mb,{children:[e(bb,{children:[t(ee,{size:te.S,weight:500,color:c.v2.colors.white[500],children:ao}),t(dl,{size:16,fill:c.v2.colors.silver[200]})]}),t(fb,{children:t(Qm,{name:ro,recommended:!0,toggleLabel:oo,enabled:n,onEnabledChange:o,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(ob,{onNext:l,nextLoading:s})]})},_b=f.div`
|
|
969
1019
|
white-space: pre-line;
|
|
970
|
-
`,
|
|
1020
|
+
`,Fb=f.div`
|
|
971
1021
|
width: fit-content;
|
|
972
|
-
`,
|
|
1022
|
+
`,Bb=["50","25","10","1","0.1"],Vb=({value:i,onChange:n,label:o})=>{const r=v(),l=a(()=>Bb.map(e=>({value:e,label:`${e}%`,selectedBgColor:r.v2.colors.purple[900],selectedBorderColor:r.v2.colors.purple[400]})),[r]);return e(oe,{$gap:8,children:[t(ee,{size:te.XS,color:r.v2.colors.white[500],children:o}),t(Fb,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:l,selected:i,setSelected:n})})]})},Ub=({errorPresetEnabled:n,onErrorPresetChange:o,ambientPercentage:r,onAmbientPercentageChange:l,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=a(()=>D(n?{disabled:!1}:null),[n]);return e(i,{children:[t(lb,{title:lo,onBack:s}),e(nb,{$width:854,children:[t(vb,{children:so}),e(oe,{$gap:8,$width:"100%",children:[e(cb,{children:[t(_b,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:co})}),t(ub,{items:[po,uo,ho,go,mo]}),t(gb,{message:eo})]}),e(mb,{children:[e(bb,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:bo}),t(dl,{size:16,fill:p.v2.colors.silver[200]})]}),t(fb,{children:t(Qm,{name:ro,recommended:!0,toggleLabel:oo,enabled:n,onEnabledChange:o,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(fb,{children:t(Vb,{value:r,onChange:l,label:fo})})]})]})]}),t(ob,{onNext:c,nextLoading:d})]})},jb=({isOpen:e,onClose:i,k8sHealthProbesConfig:n,samplingId:a,docsUrl:l})=>{const{samplingApi:s}=ws(),[c,p]=r("welcome"),[u,h]=r(!0),[g,m]=r("keep-list"),[b,f]=r(!0),[v,y]=r("25"),[S,x]=r(!1);o(()=>{e&&(p("welcome"),h(n?.enabled??!0),m("keep-list"),f(!0),y("25"),x(!1))},[e,n?.enabled]);const C=d(async()=>{const e=a??"default",t=[];if(u!==(n?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:n?.keepPercentage??0}))}if("advanced"!==g&&b){const i=s.createHighlyRelevant;i&&t.push(i({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===g){const i=s.createCostReduction;i&&t.push(i({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}x(!0);try{await Promise.all(t),p("success")}catch{}finally{x(!1)}},[a,s,u,n?.enabled,n?.keepPercentage,g,b,v]);let w=null;switch(c){case"welcome":w=t(Tb,{onSkip:i,onNext:()=>p("noisy")});break;case"noisy":w=t(Sb,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(Pb,{strategy:g,onStrategyChange:m,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===g?"keep-list":"drop-list"===g?"drop-list":"advanced")},docsUrl:l});break;case"keep-list":w=t(Ub,{errorPresetEnabled:b,onErrorPresetChange:f,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:C,submitting:S});break;case"drop-list":w=t(Xb,{errorPresetEnabled:b,onErrorPresetChange:f,onBack:()=>p("strategy"),onNext:C,submitting:S});break;case"advanced":w=t(Mb,{onBack:()=>p("strategy"),onNext:C,submitting:S});break;case"success":w=t(Cb,{onClose:i})}return t(Wn,{isOpen:e,onClose:i,children:w})};var Hb,Gb;(e=>{e.BulkConfig="bulk-config",e.Delete="delete"})(Hb||(Hb={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(Gb||(Gb={}));const Kb=[{id:Gb.CloudConnector,label:"Cloud Connector"}];var Wb;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(Wb||(Wb={}));const Yb=[{key:Wb.Name,label:"Name"},{key:Wb.Type,label:"Type"},{key:Wb.Status,label:"Status"},{key:Wb.OdigosVersion,label:"Odigos Version"},{key:Wb.ConnectedSince,label:"Connected Since"},{key:Wb.LastActivity,label:"Last Activity"}],qb=(e,t)=>{const i=e.find(e=>e.key===Wb.Id)?.rawValue;return t(i?.toString()||"")},Jb={[Le.Success]:"Connected",[Le.Warning]:"Degraded",[Le.Error]:"Error",[Le.Disabled]:"Disabled",[Le.Info]:"Pending"},Zb={[vo.K8s]:mi.Purple,[vo.Vm]:mi.Blue,[vo.Connector]:mi.Green,[vo.AwsEcs]:mi.Yellow},Qb=({connections:i,getConnections:n,onClickConnection:l,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0})=>{const g=v(),{formatTimeAgo:m}=oi(),[b,f]=r(!i?.length),[y,S]=r(i||[]),x=d(async()=>{try{f(!0),S(await n()??[])}catch(e){}finally{f(!1)}},[]);o(()=>{y.length||x()},[]);const[C,w]=r(""),[k,T]=r(null),[$,I]=r([]),[N,O]=r(!1),[A,E]=r(!1),D=d(()=>{O(!1),E(!0),x()},[x]),P=d(e=>{e===Gb.CloudConnector?O(!0):c?.(e)},[c]),{supportedConnections:M,supportedConnectionIds:z}=a(()=>{const e=((e,t)=>e.filter(e=>{const i=e.status===Le.Success,n=R(e.odigosVersion,t,e.type);return i&&n}))(y,h);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[y,h]),X=a(()=>$.map(e=>y.find(t=>t.id===e)).filter(e=>!!e),[y,$]);o(()=>{if(!k||k===Hb.Delete)return;const e=$.filter(e=>!z.includes(e));e.length&&I(t=>t.filter(t=>!e.includes(t)))},[k,$.length,z.length]);const _=a(()=>y.filter(e=>!C||e.name.toLowerCase().includes(C.toLowerCase())).map(e=>({cells:[{key:Wb.Id,rawValue:e.id},{key:Wb.Name,rawValue:e.name},{key:Wb.Type,rawValue:e.type,component:()=>t(ni,{variant:Zb[e.type]??mi.Default,label:yo(e.type),leftIcon:Wi(e.type)})},{key:Wb.Status,rawValue:e.status,component:()=>(e=>{if(e.type===vo.Connector){const i=Jb[e.status]??"Pending",n=e.status===Le.Success?Gr:e.status===Le.Error?Kr:void 0;return t(ce,{status:e.status,label:i,leftIcon:n})}const i=e.status===Le.Success?"Connection live":"Connection lost",n=e.status===Le.Success?Gr:Kr;return t(ce,{status:e.status,label:i,leftIcon:n})})(e)},{key:Wb.OdigosVersion,rawValue:e.odigosVersion},{key:Wb.ConnectedSince,rawValue:e.connectedAt?m(e.connectedAt):"-"},{key:Wb.LastActivity,rawValue:e.lastSeenAt?m(e.lastSeenAt):"-"}],onClick:e.status!==Le.Success||k?void 0:()=>l(e),isSelected:$.includes(e.id),onSelect:()=>I(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>I(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.type!==vo.K8s||e.status!==Le.Success||!R(e.odigosVersion,h,e.type)})),[y,$,C,k,h,m,l]),F=a(()=>_.some(e=>!e.hideCheckbox),[_]),B=a(()=>{const e=(e,t)=>{I([e]),T(t)};return(e=>{const{connections:t,configMinSupportedVersion:i,onDelete:n,onEditConfiguration:a}=e;return({cells:e})=>{const o=qb(e,e=>t.find(t=>t.id===e)),r={id:Kn(),label:"Delete Connection",rightIcon:Mr,onClick:()=>qb(e,n)};if(!(e=>e.find(e=>e.key===Wb.Status)?.rawValue===Le.Success)(e)||o?.type===vo.Connector)return[r];if(o?.type!==vo.K8s)return[];const l=!!o&&R(o.odigosVersion,i,o.type),s=L(i,o?.type),c=[];return a&&c.push({id:Kn(),tooltip:l?"Edit Configuration":`To use this feature, please upgrade to Odigos v${s} or later.`,rightIcon:rl,disabled:!l,onClick:()=>qb(e,a)}),c}})({connections:y,configMinSupportedVersion:h,onDelete:t=>e(t,Hb.Delete),onEditConfiguration:t=>e(t,Hb.BulkConfig)})},[y,h]),V=a(()=>(e=>{const{onCancel:t,onManageConfigurations:i}=e,n=[];return i&&n.push({id:Hb.BulkConfig,type:fi.Button,buttonProps:{variant:$e.Secondary,size:Te.S,leftIcon:rl,label:"Manage Configurations",onClick:i}}),n.push({id:Kn(),type:fi.Button,buttonProps:{variant:$e.Text,size:Te.S,label:zt.CANCEL,onClick:t}}),n})({onCancel:()=>I([]),onManageConfigurations:()=>T(Hb.BulkConfig)}),[]),U=a(()=>t(jn,{items:Kb,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>P(e[0]),buttonProps:{variant:$e.Primary,size:Te.S,label:zt.CREATE_NEW}}),[P]),j=a(()=>C.trim()&&y.length>0?{hideIcon:!0,title:it.NO_RESULTS,subTitle:it.NO_RESULTS_FOR_FILTER(C)}:{icon:Rl,title:it.NO_CONNECTIONS,action:U},[C,y.length,U]);return t(So,{children:e(ut,{fullHeight:!0,richTitle:{icon:Rl,title:it.CONNECTIONS,badge:{label:y.length.toString(),status:Le.Unknown}},search:{placeholder:"Search by cluster name",value:C,onChange:e=>w(e),width:"300px"},actions:[{id:"connections-refresh",type:fi.Button,buttonProps:{variant:$e.Secondary,size:Te.S,leftIcon:ol,onClick:x,disabled:b}},{id:"connections-create-new",type:fi.ButtonDropData,buttonProps:{variant:$e.Primary,size:Te.S,label:zt.CREATE_NEW,onClick:e=>P(e)},dropDataProps:{alignX:Gn.Right,items:Kb}}],children:[t(Ui,{variant:ji.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:b,withCheckboxes:F,columns:Yb,rows:_,noDataProps:j,rowActionsPushRightPosition:k?`calc(${us} - 24px)`:void 0,getRowActions:B}),N&&t(zs,{providers:p,children:t(Su,{onClose:()=>O(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:D})}),t(vs,{isOpen:A,onClose:()=>E(!1)}),t(Hi,{isOpen:!!$.length&&!k,richTitle:{icon:Br,title:"Selected Clusters",badge:{label:$.length}},actions:V}),k===Hb.BulkConfig&&t(Xs,{connections:X,children:t(Tu,{onClose:()=>T(null),connections:M,selectedConnectionIds:$,setSelectedConnectionIds:I})}),t(gs,{target:"connection",isOpen:k===Hb.Delete,onClose:()=>{I([]),T(null)},onApprove:async()=>{const e=$[0];e&&(await s(e),await x())}})]})})};var ef,tf,nf;(e=>{e.Overview="overview",e.Findings="findings",e.Transactions="transactions",e.SettingsAndConfigurations="settings-and-configurations"})(ef||(ef={})),(e=>{e.Anomaly="anomaly",e.Violation="violation",e.Transaction="transaction"})(tf||(tf={})),(e=>{e.JsonCode="jsonCode",e.TraceView="traceView"})(nf||(nf={}));const af={drawerIsOpenFor:{type:null,id:null},openDrawer:()=>{},closeDrawer:()=>{},modalIsOpenFor:{type:null,payload:null},openModal:()=>{},closeModal:()=>{}},of=h(af),rf=({children:e})=>{const[i,n]=r(af.drawerIsOpenFor),o=d((e,t)=>n({type:e,id:t}),[]),l=d(()=>n(af.drawerIsOpenFor),[]),[s,c]=r(af.modalIsOpenFor),p=d((e,t)=>c({type:e,payload:t}),[]),u=d(()=>c(af.modalIsOpenFor),[]),h=a(()=>({drawerIsOpenFor:i,openDrawer:o,closeDrawer:l,modalIsOpenFor:s,openModal:p,closeModal:u}),[i,o,l,s,p,u]);return t(of.Provider,{value:h,children:e})},lf=()=>g(of),sf=f.div`
|
|
1023
|
+
display: flex;
|
|
1024
|
+
flex-direction: column;
|
|
1025
|
+
align-self: stretch;
|
|
1026
|
+
flex: 1;
|
|
1027
|
+
min-height: 0;
|
|
1028
|
+
padding: 16px;
|
|
1029
|
+
border-radius: 16px;
|
|
1030
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1031
|
+
`,cf=f.div`
|
|
1032
|
+
display: flex;
|
|
1033
|
+
flex-direction: column;
|
|
1034
|
+
align-self: stretch;
|
|
1035
|
+
flex: 1;
|
|
1036
|
+
min-height: 0;
|
|
1037
|
+
gap: 16px;
|
|
1038
|
+
padding: 16px;
|
|
1039
|
+
`,df=f.div`
|
|
1040
|
+
display: flex;
|
|
1041
|
+
flex-direction: column;
|
|
1042
|
+
align-self: stretch;
|
|
1043
|
+
flex: 1;
|
|
1044
|
+
min-height: 0;
|
|
1045
|
+
padding: 8px;
|
|
1046
|
+
border-radius: 12px;
|
|
1047
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1048
|
+
`,pf=({richTitle:i,textCards:n,tableColumns:a,tableRows:o,getRowActions:r,tableKey:l,tableMaxHeight:s,isLoading:c,actions:d,children:p})=>{const u=v();return t(sf,{children:e(cf,{children:[e(ne,{$justifyContent:"space-between",children:[t(xo,{...i}),d&&t(Co,{actions:d})]}),t(ne,{$gap:22,children:n.map(e=>t(wo,{...e},e.title))}),p,!!a.length&&t(df,{children:t(Ui,{maxHeight:s,headerBackgroundColor:u.v2.colors.silver[800],variant:ji.Data,columns:a,rows:o,isLoading:c,getRowActions:r},l)})]})})};var uf;(e=>{e.Title="title",e.TransactionId="transactionId",e.LastSeen="lastSeen",e.Namespace="namespace",e.Service="service",e.Kind="kind",e.Status="status",e.Score="score",e.Severity="severity",e.Occurrences="occurrences",e.Offending="offending",e.Signature="signature",e.RuleKey="ruleKey",e.ScopeKey="scopeKey"})(uf||(uf={}));const hf=e=>e.kind===ko.Anomaly?["anomaly",e.transactionId??"",e.signature??""].join("\0"):["violation",e.scopeKey??"",e.ruleKey??"",e.offending??""].join("\0"),gf=(e,t)=>[{id:`${e.id}-investigate`,label:"Investigate",rightIcon:Lr,variant:$e.Primary,onClick:()=>{if(!e.id)return;const i=e.cells.find(e=>e.key===uf.Kind)?.rawValue;t(i===ko.Anomaly?tf.Anomaly:tf.Violation,e.id)}}],mf=[{label:"Severity",key:uf.Severity},{label:"Service",key:uf.Service,noFilter:!0},{label:"Finding",key:uf.Title,noFilter:!0},{label:"Type",key:uf.Kind},{label:"Matched traces",key:uf.Occurrences,noFilter:!0},{label:"Last seen",key:uf.LastSeen,noFilter:!0},{label:"Status",key:uf.Status}],bf=[{label:"Service",key:uf.Service,noFilter:!0},{label:"Events",key:uf.Occurrences,noFilter:!0},{label:"Last seen",key:uf.LastSeen,noFilter:!0}],ff=e=>({open:e?.length||0,violations:e?.filter(e=>"violation"===e.kind).length||0,anomalies:e?.filter(e=>"anomaly"===e.kind).length||0,critical:e?.filter(e=>"critical"===e.severity).length||0,high:e?.filter(e=>"high"===e.severity).length||0,medium:e?.filter(e=>"medium"===e.severity).length||0,low:e?.filter(e=>"low"===e.severity).length||0}),vf=(e,t)=>({label:t,backgroundColor:(()=>{switch(t){case Io.Low:return e.v2.colors.purple[900];case Io.Medium:return e.v2.colors.yellow[550];case Io.High:return e.v2.colors.orange[500];case Io.Critical:return e.v2.colors.red[800];default:return}})(),textColor:(()=>{switch(t){case Io.Low:case Io.Critical:return e.v2.colors.white[500];case Io.Medium:case Io.High:return e.v2.colors.black[500];default:return}})()}),yf=(e,t)=>({label:t,backgroundColor:(()=>{switch(t){case $o.Open:case To.Open:return e.v2.colors.beige[600];default:return e.v2.colors.silver[500]}})(),textColor:(()=>{switch(t){case $o.Open:case To.Open:return e.v2.colors.black[500];default:return e.v2.colors.white[500]}})()}),Sf=(e,i,n,a)=>n?.slice(0,a||n.length).map(n=>({id:hf(n),cells:[{key:uf.Title,rawValue:n.title,component:()=>t(ni,{label:n.title,variant:mi.Blue})},{key:uf.TransactionId,rawValue:n.transactionId??"-"},{key:uf.LastSeen,rawValue:i(n.lastSeen,{style:"short"})},{key:uf.Namespace,rawValue:n.namespace},{key:uf.Service,rawValue:n.service},{key:uf.Kind,rawValue:n.kind,component:()=>t(ce,{label:n.kind,backgroundColor:e.v2.colors.pink[1e3],textColor:e.v2.colors.pink[500]})},{key:uf.Status,rawValue:n.status,component:()=>t(ce,{...yf(e,n.status)})},{key:uf.Score,rawValue:Number(n.score).toLocaleString()},{key:uf.Severity,rawValue:n.severity,component:()=>t(ce,{...vf(e,n.severity)})},{key:uf.Occurrences,rawValue:Number(n.occurrences).toLocaleString()},{key:uf.Offending,rawValue:n.offending??"-"},{key:uf.Signature,rawValue:n.signature??"-"},{key:uf.RuleKey,rawValue:n.ruleKey??"-",component:n.ruleKey?()=>t(ni,{label:n.ruleKey,variant:mi.Blue}):void 0},{key:uf.ScopeKey,rawValue:n.scopeKey??"-",component:n.scopeKey?()=>t(ni,{label:n.scopeKey,variant:mi.Default}):void 0}]}))||[];var xf;(e=>{e.TransactionId="transactionId",e.LastSeen="lastSeen",e.Namespace="namespace",e.Service="service",e.Kind="kind",e.Operation="operation",e.Baseline="baseline",e.Promoted="promoted",e.Volume="volume",e.TransactionCount="transactionCount"})(xf||(xf={}));const Cf=(e,t)=>[{id:`${e.id}-open-baseline`,label:"Open baseline",rightIcon:Lr,variant:$e.Primary,onClick:()=>{const i=e.cells.find(e=>e.key===xf.TransactionId)?.rawValue;t(tf.Transaction,i)}}],wf=[{label:"Namespace",key:xf.Namespace},{label:"Service",key:xf.Service,noFilter:!0},{label:"Operation",key:xf.Operation,noFilter:!0},{label:"Kind",key:xf.Kind},{label:"Volume",key:xf.Volume,noFilter:!0},{label:"Baseline",key:xf.Promoted},{label:"Last seen",key:xf.LastSeen,noFilter:!0}],kf=[{label:"Namespace",key:xf.Namespace},{label:"Service",key:xf.Service,noFilter:!0},{label:"Transactions",key:xf.TransactionCount,noFilter:!0},{label:"Volume",key:xf.Volume,noFilter:!0}],Tf=e=>({total:e?.length||0,services:Array.from(new Set(e?.map(e=>e.service))).length,volume:e?.reduce((e,t)=>e+Number(t.volume),0)||0,promoted:e?.filter(e=>e.promoted).length||0,learning:e?.filter(e=>!e.promoted).length||0}),$f=(e,i,n,a)=>n?.slice(0,a||n.length).map(n=>({id:n.id,cells:[{key:xf.TransactionId,rawValue:n.id},{key:xf.LastSeen,rawValue:i(n.lastSeen,{style:"short"})},{key:xf.Namespace,rawValue:n.namespace},{key:xf.Service,rawValue:n.service},{key:xf.Kind,rawValue:n.kind,component:()=>t(ce,{label:n.kind,backgroundColor:e.v2.colors.blue[900]})},{key:xf.Operation,rawValue:n.operation,component:()=>t(ni,{label:n.operation,variant:mi.Blue})},{key:xf.Baseline,rawValue:n.hasBaseline?"Yes":"No",component:()=>t(ce,{label:n.hasBaseline?"Yes":"No",backgroundColor:n.hasBaseline?e.v2.colors.green[500]:e.v2.colors.beige[600],textColor:e.v2.colors.black[500]})},{key:xf.Promoted,rawValue:n.promoted?"Promoted":"Learning",component:()=>t(ce,{label:n.promoted?"Promoted":"Learning",backgroundColor:n.promoted?e.v2.colors.green[500]:e.v2.colors.beige[600],textColor:e.v2.colors.black[500]})},{key:xf.Volume,rawValue:Number(n.volume).toLocaleString()}]}))||[],If=({setSelectedTab:i})=>{const n=v(),{openDrawer:o}=lf(),{formatDurationAgo:r}=oi(),{insightsApi:l}=ws(),{data:s,loading:c,refetch:d}=l.useFindings(),{data:p,loading:u,refetch:h}=l.useTransactions(),g=a(()=>ff(s),[s]),m=a(()=>Sf(n,r,s,5),[s,n,r]),b=a(()=>Tf(p),[p]),f=a(()=>$f(n,r,p,5),[p,n,r]);return e(oe,{children:[e(ne,{$padding:"12px 0",$justifyContent:"space-between",children:[t(ee,{size:te.M,children:"Runtime Trace Security (Insights)"}),t(ke,{variant:$e.Text,size:Te.S,leftIcon:ol,label:"Refresh",onClick:()=>{d(),h()},disabled:c||u})]}),e(oe,{$gap:24,children:[t(pf,{tableMaxHeight:"380px",richTitle:{title:"Top 5 Findings",titleSize:te.M,icon:Ll,badge:{label:s?.length||0}},textCards:[{bgTint:"900",title:"Open findings",cells:[{value:g.open.toLocaleString()}]},{bgTint:"900",title:"Critical / High",cells:[{value:(g.critical+g.high).toLocaleString()}]},{bgTint:"900",title:"Policy violations",cells:[{value:g.violations.toLocaleString()}]},{bgTint:"900",title:"Anomalies",cells:[{value:g.anomalies.toLocaleString()}]}],tableColumns:mf,tableRows:m,isLoading:c,actions:[{id:"view-all",type:fi.Button,buttonProps:{label:"View all",rightIcon:Lr,variant:$e.Secondary,size:Te.S,onClick:()=>i(ef.Findings)}}],getRowActions:e=>gf(e,o)}),t(pf,{tableMaxHeight:"380px",richTitle:{title:"Top 5 Transactions",titleSize:te.M,icon:Pl,badge:{label:p?.length||0}},textCards:[{bgTint:"900",title:"Transactions",cells:[{value:b.total.toLocaleString()}]},{bgTint:"900",title:"Services",cells:[{value:b.services.toLocaleString()}]},{bgTint:"900",title:"Volume",cells:[{value:b.volume.toLocaleString()}]},{bgTint:"900",title:"Baseline Promoted",cells:[{value:((b.promoted||0)/(b.total||1)*100).toFixed(1)+"%"}]}],tableColumns:wf,tableRows:f,isLoading:u,actions:[{id:"view-all",type:fi.Button,buttonProps:{label:"View all",rightIcon:Lr,variant:$e.Secondary,size:Te.S,onClick:()=>i(ef.Transactions)}}],getRowActions:e=>Cf(e,o)})]})]})};var Nf;(e=>{e.All="all",e.GroupByService="groupByService"})(Nf||(Nf={}));const Of=[{label:"All findings",value:Nf.All},{label:"Group by service",value:Nf.GroupByService}],Af=()=>{const i=v(),{openDrawer:n}=lf(),{formatDurationAgo:o}=oi(),{insightsApi:l}=ws(),{data:s,loading:c,refetch:d}=l.useFindings(),[p,u]=r(""),[h,g]=r(Nf.All),m=a(()=>p?s?.filter(e=>e.namespace?.toLowerCase().includes(p.toLowerCase())||e.service?.toLowerCase().includes(p.toLowerCase())||e.kind?.toLowerCase().includes(p.toLowerCase())||e.title.toLowerCase().includes(p.toLowerCase())):s,[s,p]),b=a(()=>{const e=[];return m?.forEach(t=>{const i=e.find(e=>e.service===t.service);i?(i.findings.push(t),i.occurrences+=t.occurrences,new Date(i.lastSeen)<new Date(t.lastSeen)&&(i.lastSeen=t.lastSeen)):e.push({service:t.service,namespace:t.namespace,occurrences:t.occurrences,lastSeen:t.lastSeen,findings:[t]})}),e},[m]),f=a(()=>ff(s),[s]),y=a(()=>h===Nf.GroupByService?((e,i,n,a)=>a.map(a=>({id:`${a.namespace}/${a.service}`,cells:[{key:uf.Service,rawValue:a.service},{key:uf.Occurrences,rawValue:Number(a.occurrences).toLocaleString()},{key:uf.LastSeen,rawValue:new Date(a.lastSeen).toLocaleString()}],expandedContent:({maxHeight:o})=>t(Ui,{fitContent:!0,variant:ji.DataSecondary,maxHeight:o,columns:mf,rows:Sf(e,i,a.findings),getRowActions:e=>gf(e,n)})})))(i,o,n,b):Sf(i,o,m),[i,m,b,h,o,n]);return t(pf,{richTitle:{title:"Findings",titleSize:te.M,icon:Ll,badge:{label:s?.length||0}},textCards:[{bgTint:"900",title:"Open findings",cells:[{value:f.open.toLocaleString()}]},{bgTint:"900",title:"Critical / High",cells:[{value:(f.critical+f.high).toLocaleString()}]},{bgTint:"900",title:"Policy violations",cells:[{value:f.violations.toLocaleString()}]},{bgTint:"900",title:"Anomalies",cells:[{value:f.anomalies.toLocaleString()}]}],tableKey:h,tableColumns:h===Nf.GroupByService?bf:mf,tableRows:y,isLoading:c,actions:[{id:"refresh",type:fi.Button,buttonProps:{label:"Refresh",leftIcon:ol,variant:$e.Secondary,size:Te.S,disabled:c,onClick:()=>d()}}],getRowActions:h===Nf.All?e=>gf(e,n):void 0,children:e(ne,{$width:"100%",$gap:12,children:[t(xo,{title:"Findings list",titleSize:te.S,badge:{label:m?.length||0}}),t(vi,{width:"400px",value:p,onChange:u}),t(ve,{options:Of,selected:h,setSelected:g})]})})};var Ef;(e=>{e.All="all",e.GroupByService="groupByService"})(Ef||(Ef={}));const Df=[{label:"All transactions",value:Ef.All},{label:"Group by service",value:Ef.GroupByService}],Rf=()=>{const i=v(),{openDrawer:n}=lf(),{formatDurationAgo:o}=oi(),{insightsApi:l}=ws(),{data:s,loading:c,refetch:d}=l.useTransactions(),[p,u]=r(""),[h,g]=r(Ef.All),m=a(()=>p?s?.filter(e=>e.id?.toLowerCase().includes(p.toLowerCase())||e.namespace?.toLowerCase().includes(p.toLowerCase())||e.service?.toLowerCase().includes(p.toLowerCase())||e.kind?.toLowerCase().includes(p.toLowerCase())||e.operation?.toLowerCase().includes(p.toLowerCase())):s,[s,p]),b=a(()=>{const e=[];return m?.forEach(t=>{const i=e.find(e=>e.service===t.service);i?(i.transactions.push(t),i.volume+=t.volume):e.push({namespace:t.namespace,service:t.service,volume:t.volume,transactions:[t]})}),e},[m]),f=a(()=>Tf(s),[s]),y=a(()=>h===Ef.GroupByService?((e,i,n,a)=>a.map(a=>({id:`${a.namespace}/${a.service}`,cells:[{key:xf.Namespace,rawValue:a.namespace},{key:xf.Service,rawValue:a.service},{key:xf.TransactionCount,rawValue:a.transactions.length.toLocaleString()},{key:xf.Volume,rawValue:a.volume.toLocaleString()}],expandedContent:({maxHeight:o})=>t(Ui,{fitContent:!0,variant:ji.DataSecondary,maxHeight:o,columns:wf,rows:$f(e,i,a.transactions),getRowActions:e=>Cf(e,n)})})))(i,o,n,b):$f(i,o,m),[i,m,b,h,o,n]);return t(pf,{richTitle:{title:"Transactions",titleSize:te.M,icon:Pl,badge:{label:s?.length||0}},textCards:[{bgTint:"900",title:"Transactions",cells:[{value:f.total.toLocaleString()}]},{bgTint:"900",title:"Services",cells:[{value:f.services.toLocaleString()}]},{bgTint:"900",title:"Volume",cells:[{value:f.volume.toLocaleString()}]},{bgTint:"900",title:"Baseline Promoted",cells:[{value:((f.promoted||0)/(f.total||1)*100).toFixed(1)+"%"}]}],tableKey:h,tableColumns:h===Ef.GroupByService?kf:wf,tableRows:y,isLoading:c,actions:[{id:"refresh",type:fi.Button,buttonProps:{label:"Refresh",leftIcon:ol,variant:$e.Secondary,size:Te.S,disabled:c,onClick:()=>d()}}],getRowActions:h===Ef.All?e=>Cf(e,n):void 0,children:t(ne,{$width:"100%",$justifyContent:"space-between",children:e(ne,{$gap:12,children:[t(xo,{title:"Transactions list",titleSize:te.S,badge:{label:m?.length||0}}),t(vi,{width:"400px",value:p,onChange:u}),t(ve,{options:Df,selected:h,setSelected:g})]})})})},Lf=f.div`
|
|
1049
|
+
display: flex;
|
|
1050
|
+
flex-direction: column;
|
|
1051
|
+
gap: 8px;
|
|
1052
|
+
padding: 12px;
|
|
1053
|
+
border-radius: 12px;
|
|
1054
|
+
border-left: 2px solid ${({theme:e})=>e.v2.colors.red[500]};
|
|
1055
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1056
|
+
`,Pf=({classFindings:i})=>{const n=v();return i?.length?t(l,{children:i?.map((i,a)=>e(Lf,{children:[e(ne,{$gap:8,children:[t(ee,{size:te.XS,color:ie.Primary,children:i.title}),t(ce,{label:i.class,status:Le.Info,invertColors:!0}),t(ce,{label:i.kind,status:Le.Info,invertColors:!0})]}),t(ee,{size:te.XXS,color:n.v2.colors.red[400],children:i.summary||"-"}),i.spanHighlights?t(oe,{children:i.spanHighlights?.map((t,i)=>e(ee,{size:te.XXXS,color:ie.Secondary,children:["• ",t.reason," - ",t.spanId]},`span-highlight--${i}`))}):null,i.attrHighlights?t(oe,{children:i.attrHighlights?.map((t,i)=>e(ee,{size:te.XXXS,color:ie.Secondary,children:["• ",t.value," - ",t.key," - ",t.spanId]},`attribute-highlight--${i}`))}):null]},`${i.class}-${a}`))}):null},Mf=f.div`
|
|
1057
|
+
box-sizing: border-box;
|
|
1058
|
+
min-width: 109px;
|
|
1059
|
+
max-width: 160px;
|
|
1060
|
+
padding: 12px;
|
|
1061
|
+
border-radius: 8px;
|
|
1062
|
+
display: flex;
|
|
1063
|
+
flex-direction: column;
|
|
1064
|
+
gap: 8px;
|
|
1065
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1066
|
+
border: 1px
|
|
1067
|
+
${({theme:e,$isRoot:t,$isAttacker:i,$isVirtual:n})=>t?`solid ${e.v2.colors.purple[400]}`:i?`solid ${e.v2.colors.red[500]}`:n?`dashed ${e.v2.colors.silver[300]}`:`solid ${e.v2.colors.silver[200]}`};
|
|
1068
|
+
opacity: ${({$isVirtual:e,$isRoot:t,$isAttacker:i})=>!e||t||i?1:.85};
|
|
1069
|
+
`,zf=f.div`
|
|
1070
|
+
display: flex;
|
|
1071
|
+
align-items: center;
|
|
1072
|
+
gap: 4px;
|
|
1073
|
+
min-width: 0;
|
|
1074
|
+
`,Xf=f.div`
|
|
1075
|
+
flex-shrink: 0;
|
|
1076
|
+
width: 16px;
|
|
1077
|
+
height: 16px;
|
|
1078
|
+
display: flex;
|
|
1079
|
+
align-items: center;
|
|
1080
|
+
justify-content: center;
|
|
1081
|
+
`,_f={visibility:"hidden"},Ff=b(({data:n})=>{const a=v(),{service:o,namespace:r,isVirtual:l,isRoot:s,isAttacker:c,isUser:d}=n,p=((e,t)=>"user"===e?hl:t?Ur:Ml)(o,l),u=s?a.v2.colors.purple[400]:c?a.v2.colors.red[500]:a.v2.colors.silver[200],h=s?ie.Link:c?ie.Error:ie.Secondary,g=r?`${r}/${o}`:o,m=l?"virtual":"-";return e(i,{children:[t(Hs,c||d?{type:"source",position:Gs.Bottom,style:_f}:{type:"source",position:Gs.Top,style:_f}),t(Hs,c||d?{type:"target",position:Gs.Right,style:_f}:{type:"target",position:Gs.Left,style:_f}),e(Mf,{$isRoot:s,$isAttacker:c,$isVirtual:l,children:[e(zf,{children:[t(Xf,{children:t(p,{size:16,fill:u})}),t(ee,{size:te.XXXS,color:h,nowrap:!0,children:g})]}),t(ee,{size:te.XXXS,color:h,nowrap:!0,children:m})]})]})});Ff.displayName=Ff.name;const Bf="0;0.5;1",Vf=b(({id:n,sourceX:o,sourceY:r,targetX:l,targetY:s,sourcePosition:c,targetPosition:d,markerEnd:p,style:u,data:h})=>{const g=v(),[m]=Ks({sourceX:o,sourceY:r,targetX:l,targetY:s,sourcePosition:c,targetPosition:d}),b=`${n}__blast-radius-motion`,f=!!h?.isAttacker,y="string"==typeof u?.stroke?u.stroke:f?g.v2.colors.red[500]:g.v2.colors.silver[400],S=f?g.v2.colors.red[700]:g.v2.colors.silver[600],x=f?g.v2.colors.red[400]:g.v2.colors.silver[200],{travelDuration:C,ballCount:w}=a(()=>{const e=Math.hypot(l-o,s-r),t=((e,t)=>{if("undefined"==typeof document)return t;const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",e),i.getTotalLength()||t})(m,e);return{travelDuration:Math.max(1.2,t/100),ballCount:Math.min(10,Math.max(3,Math.round(t/72)))}},[m,o,r,l,s]),k=`${C.toFixed(3)}s`;return e(i,{children:[t(Ws,{id:n,path:m,markerEnd:p,style:{...u,stroke:y,strokeWidth:1}}),t(Ys,{children:e("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[t("path",{id:b,d:m,fill:"none",stroke:"none"}),Array.from({length:w}).map((i,n)=>{const a=`-${(C/w*n).toFixed(3)}s`;return e("circle",{r:0,fill:S,children:[t("animateMotion",{dur:k,begin:a,repeatCount:"indefinite",children:t("mpath",{href:`#${b}`})}),t("animate",{attributeName:"r",dur:k,begin:a,repeatCount:"indefinite",keyTimes:Bf,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:k,begin:a,repeatCount:"indefinite",keyTimes:Bf,values:`${S};${x};${x}`})]},n)})]})})]})});var Uf,jf;Vf.displayName=Vf.name,(e=>{e.Service="blast-radius-service"})(Uf||(Uf={})),(e=>{e.Animated="blast-radius-animated"})(jf||(jf={}));const Hf=(e,t)=>{const i=(e||"").trim();return i?`${i}/${t}`:t},Gf=e=>Hf(e.namespace,e.service),Kf=(e,t,i)=>{const n=new Set(e),a=[...e];for(;a.length;){const e=a.shift();for(const o of i.get(e)??[])o===t||n.has(o)||(n.add(o),a.push(o))}return n},Wf=(e,t,i)=>{const n=new Map;if(!e.length)return n;const a=[];for(let t=0;t<e.length;t+=6)a.push(e.slice(t,t+6));const o=-72*(a.length-1)/2;return a.forEach((e,a)=>{const r=o+72*a;e.forEach((e,a)=>{const o=t+i*(a+1)*160;n.set(e,{x:o,y:r})})}),n},Yf=(e,t,i)=>{const n=t.map(e=>i.get(e)).filter(e=>!!e);if(!n.length)return{x:0,y:72};const a={x:n.reduce((e,t)=>e+t.x,0)/n.length,y:n.reduce((e,t)=>e+t.y,0)/n.length+72},o=new Set([...i.entries()].filter(([t])=>t!==e).map(([,e])=>`${e.x},${e.y}`));let r=a;for(;o.has(`${r.x},${r.y}`);)r={x:r.x,y:r.y+72};return r},qf=f.div`
|
|
1082
|
+
position: relative;
|
|
1083
|
+
width: 100%;
|
|
1084
|
+
height: 286px;
|
|
1085
|
+
border-radius: 8px;
|
|
1086
|
+
overflow: hidden;
|
|
1087
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1088
|
+
|
|
1089
|
+
.react-flow__attribution {
|
|
1090
|
+
visibility: hidden;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
* {
|
|
1094
|
+
transition: none;
|
|
1095
|
+
}
|
|
1096
|
+
`,Jf={[Uf.Service]:Ff},Zf={[jf.Animated]:Vf},Qf={duration:300,padding:.2,includeHiddenNodes:!0,maxZoom:1},ev=({trigger:e})=>{const{fitView:t}=ic(),i=p(!0);return o(()=>{i.current?i.current=!1:e>0&&requestAnimationFrame(()=>t(Qf))},[e,t]),null},tv=({subgraph:i})=>{const n=v(),[l,s,c]=Zs([]),[d,p,u]=Qs([]),[h,g]=r(0),[m,b]=r(null),f=a(()=>{const e=i.nodes.map(e=>`${e.namespace||""}/${e.service}:${e.isVirtual?1:0}`).join("|"),t=i.edges.map(e=>`${e.clientNamespace||""}/${e.clientService}->${e.serverNamespace||""}/${e.serverService}`).join("|");return`${(e=>`${e.root.namespace||""}/${e.root.service}`)(i)}::${e}::${t}`},[i]);o(()=>{const e=((e,t)=>{const i=new Map,n=new Map;for(const e of t)i.set(e.source,(i.get(e.source)??0)+1),n.set(e.target,(n.get(e.target)??0)+1);const a=[...new Set([...i.keys(),...n.keys()])].filter(t=>t!==e&&(i.get(t)??0)>0&&(n.get(t)??0)>0);if(!a.length)return null;const o=a.filter(i=>t.some(t=>t.source===e&&t.target===i)&&t.some(t=>t.source===i&&t.target===e));return(o.length?o:a).sort((e,t)=>{const a=(i.get(e)??0)+(n.get(e)??0);return(i.get(t)??0)+(n.get(t)??0)-a||e.localeCompare(t)})[0]})(Gf(i.root),i.edges.map(e=>({source:Hf(e.clientNamespace,e.clientService),target:Hf(e.serverNamespace,e.serverService)}))),t=((e,t)=>{const i=Gf(e.root);return e.nodes.map(e=>{const n=Gf(e);return{id:n,type:Uf.Service,position:{x:0,y:0},data:{service:e.service,namespace:e.namespace||"",isVirtual:e.isVirtual,isRoot:n===i,isAttacker:n===t,isUser:"user"===e.service},measured:{width:120,height:58}}})})(i,e),a=new Set(t.map(e=>e.id)),o=((e,t,i,n)=>{const a=t.v2.colors.silver[400],o=t.v2.colors.red[500];return e.edges.flatMap(e=>{const t=(e=>Hf(e.clientNamespace,e.clientService))(e),r=(e=>Hf(e.serverNamespace,e.serverService))(e);if(!i.has(t)||!i.has(r))return[];const l=!!n&&(t===n||r===n),s=l?o:a;return[{id:`${t}->${r}`,type:"smoothstep",source:t,target:r,data:{isAttacker:l},markerEnd:{type:qs.ArrowClosed,color:s,width:16,height:16},style:{stroke:s,strokeWidth:1}}]})})(i,n,a,e),r=((e,t)=>{if(!e.length)return{nodes:e,edges:t};const i=(e.find(e=>e.data.isRoot)??e[0]).id,n=e.find(e=>e.data.isAttacker)?.id??null,a=new Map,o=new Map,r=new Map;for(const t of e)a.set(t.id,[]),o.set(t.id,[]),r.set(t.id,[]);for(const e of t)a.get(e.source)?.push(e.target),o.get(e.target)?.push(e.source),r.get(e.source)?.push(e.target),r.get(e.target)?.push(e.source);const l=Kf((o.get(i)??[]).filter(e=>e!==n),i,r),s=Kf((a.get(i)??[]).filter(e=>e!==n&&!l.has(e)),i,r);n&&(l.delete(n),s.delete(n));const c=((e,t)=>{const i=new Map([[e,0]]),n=[e];for(;n.length;){const e=n.shift(),a=(i.get(e)??0)+1;for(const o of t.get(e)??[])i.has(o)||(i.set(o,a),n.push(o))}return i})(i,r),d=[...l].sort((e,t)=>{const i=(c.get(t)??0)-(c.get(e)??0);return 0!==i?i:e.localeCompare(t)}),p=[...s].filter(e=>!l.has(e)).sort((e,t)=>{const i=(c.get(e)??0)-(c.get(t)??0);return 0!==i?i:e.localeCompare(t)});for(const t of e)t.id===i||t.id===n||l.has(t.id)||s.has(t.id)||d.push(t.id);const u=new Map([[i,{x:0,y:0}]]);for(const[e,t]of Wf(d,0,-1))u.set(e,t);for(const[e,t]of Wf(p,0,1))u.set(e,t);return n&&u.set(n,Yf(n,r.get(n)??[],u)),{nodes:e.map(e=>({...e,position:u.get(e.id)??e.position})),edges:t}})(t,o);s(r.nodes),p(r.edges),b(null),g(e=>e+1)},[f,i,n,s,p]);const y=a(()=>m?d.map(e=>{if(e.source===m||e.target===m)return{...e,type:jf.Animated};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):d,[d,m]);return t(qf,{children:e(ec,{nodes:l,edges:y,nodeTypes:Jf,edgeTypes:Zf,onNodesChange:c,onEdgesChange:u,onNodeMouseEnter:(e,t)=>b(t.id),onNodeMouseLeave:()=>b(null),nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!0,zoomOnScroll:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},children:[t(tc,{color:n.v2.colors.silver[600],gap:17,size:1}),t(ev,{trigger:h})]})})},iv=({blastRadius:e})=>e?.nodes?.length?t(Js,{children:t(tv,{subgraph:e})}):t(bt,{children:t(Ae,{subTitle:"No blast-radius neighborhood for this service yet."})}),nv=["server.address","net.peer.name","net.host.name","http.host","url.full","http.url","db.system","db.name"],av=(e,t)=>e.attrs?.find(e=>e?.key===t)?.value??"",ov=e=>{for(const t of nv){const i=av(e,t);if(i)return i}return""},rv=e=>`${e.depth??0}::${e.name??""}::${ov(e)}`,lv=(e,t)=>{const i=ov(e),n=ov(t);return!(!i||!n||i===n)||(e.name??"")!==(t.name??"")},sv=e=>null==e||Number.isNaN(e)?null:No(1e6*Math.max(0,e)),cv=e=>(e.attrs??[]).filter(e=>!!e?.key).map(e=>({key:e.key??null,value:e.value??null})),dv=(e,t,i,n)=>({id:t,index:i,service:e.service??null,name:e.name??null,durationLabel:sv(e.durationMs),depth:e.depth??0,scope:e.scope??null,attributes:cv(e),variant:"default",...n}),pv=f(ne)`
|
|
1097
|
+
width: 100%;
|
|
1098
|
+
min-width: 0;
|
|
1099
|
+
align-items: flex-start;
|
|
1100
|
+
`,uv=f.div`
|
|
1101
|
+
flex: 1;
|
|
1102
|
+
min-width: 0;
|
|
1103
|
+
`,hv=e=>{let t=0;return e.scope&&(t+=1),t+=e.attributes?.filter(e=>!!e?.key).length??0,t},gv=(e,t)=>({id:e,variant:"placeholder",depth:t,badge:{icon:Rr}}),mv=({baselineTrace:i,anomalyTrace:n})=>{const o=a(()=>((e,t)=>{const i=e?.spans??[],n=t?.spans??[],a=e?.error||t?.error||null;if(!i.length&&!n.length)return{baselineRows:[],observedRows:[],newSpanCount:0,timingChangeCount:0,observedDurationLabel:null,error:a};const o=((e,t)=>{const i=e.length,n=t.length,a=Array.from({length:i+1},()=>Array(n+1).fill(0));for(let o=i-1;o>=0;o--)for(let i=n-1;i>=0;i--)rv(e[o])===rv(t[i])?a[o][i]=1+(a[o+1][i+1]??0):a[o][i]=Math.max(a[o+1][i]??0,a[o][i+1]??0);const o=[];let r=0,l=0;for(;r<i&&l<n;)rv(e[r])===rv(t[l])?(o.push({baselineIdx:r,observedIdx:l}),r+=1,l+=1):(a[r+1][l]??0)>=(a[r][l+1]??0)?(o.push({baselineIdx:r,observedIdx:null}),r+=1):(o.push({baselineIdx:null,observedIdx:l}),l+=1);for(;r<i;)o.push({baselineIdx:r,observedIdx:null}),r+=1;for(;l<n;)o.push({baselineIdx:null,observedIdx:l}),l+=1;return o})(i,n),r=[],l=[];let s=0,c=0,d=0,p=0,u=0;for(const e of o){const t=null!=e.baselineIdx?i[e.baselineIdx]:void 0,a=null!=e.observedIdx?n[e.observedIdx]:void 0;if(t&&a){if(lv(t,a)){s+=1,c+=1;const i=`baseline-only-${e.baselineIdx}`;r.push(dv(t,i,s)),l.push(dv(t,i,c)),d+=1,c+=1,u+=1;const n=`new-${e.observedIdx}`;r.push({id:`placeholder-${u}`,variant:"placeholder",depth:a.depth??0,badge:{icon:Rr}}),l.push(dv(a,n,c,{variant:"new",badge:{label:"New",tone:"danger",icon:Rr}}));continue}const i=`pair-${e.baselineIdx}-${e.observedIdx}`;s+=1,c+=1;const n=t.durationMs??0,o=a.durationMs??0;if(n>0&&o/n>=2){p+=1;const e=Math.max(1,Math.round(o/n));r.push(dv(t,i,s,{variant:"timing"})),l.push(dv(a,i,c,{variant:"timing",badge:{label:`${e}x Slower`,tone:"warning",icon:Nl}}))}else r.push(dv(t,i,s)),l.push(dv(a,i,c));continue}if(a&&!t){d+=1,c+=1,u+=1;const t=`new-${e.observedIdx}`;r.push({id:`placeholder-${u}`,variant:"placeholder",depth:a.depth??0,badge:{icon:Rr}}),l.push(dv(a,t,c,{variant:"new",badge:{label:"New",tone:"danger",icon:Rr}}));continue}if(t&&!a){s+=1,c+=1;const i=`baseline-only-${e.baselineIdx}`;r.push(dv(t,i,s)),l.push(dv(t,i,c))}}const h=n.find(e=>0===(e.depth??0))??n[0];return{baselineRows:r,observedRows:l,newSpanCount:d,timingChangeCount:p,observedDurationLabel:sv(h?.durationMs??null),error:a}})(i,n),[i,n]),[l,s]=r([]),c=a(()=>new Set(l),[l]),p=a(()=>((e,t,i)=>{const n=[],a=[],o=Math.max(e.length,t.length);for(let r=0;r<o;r++){const o=e[r],l=t[r];o&&n.push(o),l&&a.push(l);const s=!!o&&"placeholder"!==o.variant&&i.has(o.id),c=!!l&&"placeholder"!==l.variant&&i.has(l.id),d=s?hv(o):0,p=c?hv(l):0,u=Math.max(d,p),h=l?.depth??o?.depth??0;for(let e=0;e<u-d;e++)n.push(gv(`expand-filler-baseline-${l?.id??o?.id}-${r}-${e}`,h));for(let e=0;e<u-p;e++)a.push(gv(`expand-filler-observed-${o?.id??l?.id}-${r}-${e}`,h))}return{baseline:n,observed:a}})(o.baselineRows,o.observedRows,c),[o.baselineRows,o.observedRows,c]),u=d(e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),h=a(()=>[],[]),g=a(()=>{const e=[];return o.observedDurationLabel&&e.push({label:o.observedDurationLabel}),o.newSpanCount>0&&e.push({label:`${o.newSpanCount} new span${1===o.newSpanCount?"":"s"}`}),o.timingChangeCount>0&&e.push({label:`${o.timingChangeCount} timing change${1===o.timingChangeCount?"":"s"}`}),e},[o.newSpanCount,o.observedDurationLabel,o.timingChangeCount]);return e(pv,{children:[t(uv,{children:o.baselineRows.length?t(Oo,{title:"Baseline trace",titleIcon:Br,headerBadge:{label:"Baseline",tone:"success"},meta:h,rows:p.baseline,expandedRowIds:l,onToggleRow:u,corner:"left"}):t(bt,{children:t(Ae,{title:"No trace available",subTitle:o.error?`Unable to compare traces: ${o.error}`:"No baseline spans available"})})}),t(uv,{children:o.observedRows.length?t(Oo,{title:"Observed trace",titleIcon:Nl,headerBadge:{label:"Flagged",tone:"danger"},meta:g,rows:p.observed,expandedRowIds:l,onToggleRow:u,corner:"right"}):t(bt,{children:t(Ae,{title:"No trace available",subTitle:o.error?`Unable to compare traces: ${o.error}`:"No observed spans available"})})})]})},bv=(e,t)=>({title:e,titleSize:te.S,subTitle:t,subTitleWrap:!0,subTitleSize:te.XXXS,textGap:4}),fv=()=>[{id:"dismiss",type:fi.Button,buttonProps:{label:"Dismiss",variant:$e.Secondary,size:Te.S,disabled:!0,onClick:()=>{}}},{id:"allow",type:fi.Button,buttonProps:{label:"Allow (Add to baseline)",variant:$e.Primary,size:Te.S,disabled:!0,onClick:()=>{}}}],vv=(e,t,i)=>t?[{id:"severity",title:"Severity",badge:vf(e,t.severity)},{id:"status",title:"Status",badge:yf(e,t.status)},{id:"operation",title:"Operation",tag:{label:t.operation||"-"}},{id:"spacer",spacer:!0},{id:"transaction-id",title:"Transaction ID",label:t.transactionId,withCopy:!0},{id:"signature",title:"Signature",label:t.signature,withCopy:!0},{id:"matched-traces",title:"Matched traces",label:t.occurrences.toString()},{id:"last-seen",title:"Last seen",label:t.lastSeen?i(t.lastSeen,{style:"short"}):"-"}]:[],yv=[{id:"alert-only",title:"Alert only",description:"Notify when this behavior appears again. No runtime action is taken. Safe."},{id:"kill-thread",title:"Kill thread",description:"Stop the matching execution thread when this behavior appears again."},{id:"kill-process",title:"Kill process",description:"Terminate the affected process on the next match. This may interrupt service availability."}],Sv=({finding:i})=>{const n=v(),{formatDurationAgo:o}=oi(),{insightsApi:r}=ws(),{data:l,loading:s}=r.useAnomaly({transactionId:i.transactionId,signature:i.signature},{skip:!i.transactionId||!i.signature}),c=a(()=>Ao(l?.anomalyTrace?.rawOtlp),[l?.anomalyTrace?.rawOtlp]),d=a(()=>Ao(l?.baselineTrace?.rawOtlp),[l?.baselineTrace?.rawOtlp]),{data:p,loading:u}=r.useBlastRadius({namespace:i.namespace,service:i.service},{skip:!i.namespace||!i.service}),{formData:h,handleFormChange:g}=Jt({responseOnNextMatch:""});return e(Gt,{bgTint:"1000",moreSpacing:!0,children:[t(Gt,{bgTint:"900",moreSpacing:!0,richTitle:{icon:Ll,title:i?.title},actions:fv(),items:vv(n,l||null,o)}),t(Gt,{bgTint:"900",richTitle:{title:"Why this fired",icon:cl},withCollapse:!0,children:t(Pf,{classFindings:l?.classFindings})}),t(Gt,{bgTint:"900",richTitle:bv("Baseline vs observed trace","Compare the learned normal trace with the observed trace that triggered this anomaly."),withCollapse:!0,collapseIsDefaultOpen:!0,children:s&&!l?t(bt,{children:t(xt,{withSpinner:!0})}):t(mv,{baselineTrace:d,anomalyTrace:c})}),t(Gt,{bgTint:"900",richTitle:bv("Blast Radius","Services and resources touched by traces matching this anomaly."),withCollapse:!0,collapseIsDefaultOpen:!0,children:u&&!p?t(bt,{children:t(xt,{withSpinner:!0})}):t(iv,{blastRadius:p})}),t(Gt,{bgTint:"900",richTitle:{...bv("Response on next match","This action will be applied only when a future trace matches this anomaly pattern again."),badge:{label:"Coming soon",tooltip:"We are working on this feature and it will be available soon.",backgroundColor:n.v2.colors.pink[500],textColor:n.v2.colors.black[500]}},actions:[{id:"apply",type:fi.Button,buttonProps:{label:"Apply on next match",rightIcon:Lr,variant:$e.Primary,size:Te.S,disabled:!0,onClick:()=>{}}}],withCollapse:!0,children:t(ne,{$gap:16,children:t(xv,{options:yv,selectedId:h.responseOnNextMatch,setSelectedId:e=>g("responseOnNextMatch",e)})})})]})},xv=({options:i,selectedId:n,setSelectedId:a})=>i.map(i=>{const o=n===i.id,r=()=>a(i.id);return t(Gt,{bgTint:"800",moreSpacing:!0,onClick:r,clickStylesRemainActive:o,children:e(ne,{$gap:16,children:[t(xe,{value:o,onChange:r}),e(oe,{$gap:4,children:[t(ee,{size:te.S,color:ie.Primary,children:i.title}),t(ee,{size:te.XXS,color:ie.Secondary,children:i.description})]})]})},i.id)}),Cv=f(ne)`
|
|
1104
|
+
width: 100%;
|
|
1105
|
+
min-width: 0;
|
|
1106
|
+
align-items: flex-start;
|
|
1107
|
+
`,wv=f.div`
|
|
1108
|
+
flex: 1;
|
|
1109
|
+
min-width: 0;
|
|
1110
|
+
`,kv=e=>(e.attrs??[]).filter(e=>!!e?.key).map(e=>({key:e.key??null,value:e.value??null})),Tv=({evidenceTrace:e,spanHighlights:i})=>{const n=a(()=>((e,t)=>{const i=e?.spans??[],n=new Map((t??[]).map(e=>[e.spanId,e]));return i.map((e,t)=>{const i=e.spanId?n.get(e.spanId):void 0;return{id:e.spanId||`span-${t}`,index:t+1,service:e.service??null,name:e.name??null,durationLabel:(a=e.durationMs,null==a||Number.isNaN(a)?null:No(1e6*Math.max(0,a))),depth:e.depth??0,scope:e.scope??null,attributes:kv(e),variant:i?"new":"default",badge:i?{icon:Nl,tone:"danger",label:i.reason}:null};var a})})(e,i),[e,i]),[o,l]=r([]);return e&&e.spans?.length?t(Cv,{children:t(wv,{children:e&&e.spans?.length?t(Oo,{title:"Evidence trace",rows:n,expandedRowIds:o,onToggleRow:e=>{l(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}}):t(bt,{children:t(Ae,{title:"No evidence retained",subTitle:e?.error?`Unable to parse traces: ${e.error}`:"No sample trace was captured for this violation."})})})}):t(bt,{children:t(Ae,{title:"No evidence retained",subTitle:e?.error?`Unable to parse traces: ${e.error}`:"No sample trace was captured for this violation."})})},$v=(e,t,i)=>[{id:"severity",title:"Severity",badge:vf(e,t.severity)},{id:"status",title:"Status",badge:yf(e,t.status)},{id:"rule-key",title:"Rule key",tag:{label:t.ruleKey||"-"}},{id:"spacer",spacer:!0},{id:"offending",title:"Offending",label:t.offending||"-",withCopy:!0},{id:"matched-traces",title:"Matched traces",label:t.occurrences.toString()},{id:"last-seen",title:"Last seen",label:t.lastSeen?i(t.lastSeen,{style:"short"}):"-"}],Iv=({finding:i})=>{const n=v(),{formatDurationAgo:o}=oi(),{insightsApi:r}=ws(),l=i.scopeKey||"",s=i.ruleKey||"",c=i.offending||"",d=!!l&&!!s&&!!c,{data:p,loading:u}=r.useGuardrailViolation({scopeKey:l,ruleKey:s,offending:c},{skip:!d}),h=a(()=>Ao(p?.evidenceTrace?.rawOtlp),[p?.evidenceTrace?.rawOtlp]);return e(Gt,{bgTint:"1000",moreSpacing:!0,children:[t(Gt,{bgTint:"900",moreSpacing:!0,richTitle:{icon:Ll,title:i?.title},actions:fv(),items:$v(n,i,o),children:t(Gt,{bgTint:"800",items:[{id:"summary",title:"Summary",label:p?.summary||"-"}]})}),t(Gt,{bgTint:"900",richTitle:bv("Evidence trace","The trace that triggered this violation."),withCollapse:!0,collapseIsDefaultOpen:!0,children:u&&!p?t(bt,{children:t(xt,{withSpinner:!0})}):t(Tv,{evidenceTrace:h,spanHighlights:p?.spanHighlights})})]})},Nv=({type:i})=>{const n=v(),{drawerIsOpenFor:o,closeDrawer:r}=lf(),{insightsApi:s}=ws(),{data:c,loading:d}=s.useFindings(void 0,{fetchPolicy:"cache-first"}),p=a(()=>{if(o.id)return((e,t)=>e?.find(e=>hf(e)===t))(c,o.id)},[c,o.id]);return t(Ft,{width:"95vw",isOpen:!0,header:{onClose:r,icon:Yr,title:p?.service||"-",titleBadges:[{label:p?.namespace||"-",tooltip:"Namespace"},{label:p?.kind||"-",tooltip:"Finding kind",backgroundColor:n.v2.colors.blue[900]}],subTitleTags:[{label:`Captured ${p?.lastSeen?new Date(p.lastSeen).toLocaleString():"-"}`,disabled:!0}]},children:p?e(l,{children:[i===tf.Anomaly&&t(Sv,{finding:p}),i===tf.Violation&&t(Iv,{finding:p})]}):t(Ft,{width:"95vw",isOpen:!0,header:{onClose:r},children:t(bt,{children:d?t(xt,{withSpinner:!0}):t(Ae,{})})})})},Ov=f.div`
|
|
1111
|
+
display: flex;
|
|
1112
|
+
flex-direction: column;
|
|
1113
|
+
gap: 12px;
|
|
1114
|
+
width: 70vw;
|
|
1115
|
+
height: 70vh;
|
|
1116
|
+
padding: 12px;
|
|
1117
|
+
`,Av=f.div`
|
|
1118
|
+
display: flex;
|
|
1119
|
+
align-items: center;
|
|
1120
|
+
justify-content: space-between;
|
|
1121
|
+
width: 100%;
|
|
1122
|
+
`,Ev=e=>(e.attrs??[]).filter(e=>!!e?.key).map(e=>({key:e.key??null,value:e.value??null})),Dv=({isOpen:i,onClose:n,transactionId:o,traceId:s})=>{const{insightsApi:c}=ws(),{data:d,loading:p}=c.useObservation({transactionId:o,traceId:s},{skip:!o||!s}),u=a(()=>(e=>e?.spans?.map((e,t)=>{return{id:e.spanId||`span-${t}`,index:t+1,service:e.service??null,name:e.name,duration:(i=e.durationMs,null==i||Number.isNaN(i)?null:No(1e6*Math.max(0,i))),depth:e.depth??0,scope:e.scope??null,attributes:Ev(e),variant:"default",badge:null};var i})??[])(Ao(d?.rawOtlp)),[d?.rawOtlp]),[h,g]=r([]);return t(Wn,{isOpen:i,onClose:n,children:e(Ov,{children:[e(Av,{children:[t(ee,{size:te.XS,children:"JSON view"}),t(yt,{icon:e=>t(Kr,{...e}),size:St.L,onClick:n})]}),d?t(Gt,{fullHeight:!0,overflow:"auto",children:t(Oo,{rows:u,expandedRowIds:h,onToggleRow:e=>g(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])})}):t(l,{children:p?t(xt,{withSpinner:!0}):t(Ae,{})})]})})};var Rv;(e=>{e.TransactionId="transactionId",e.Class="class",e.Status="status",e.Learning="learning",e.Data="data",e.ObservationCount="observationCount",e.ObservationCountAtLastChange="observationCountAtLastChange",e.LearningStartedAt="learningStartedAt",e.LastChangedAt="lastChangedAt"})(Rv||(Rv={}));const Lv=(e,i)=>i?.map((e,i)=>({id:`${e.transactionId}-${i}`,cells:[{key:Rv.TransactionId,rawValue:e.transactionId},{key:Rv.Class,rawValue:e.class},{key:Rv.Status,rawValue:e.learning.phase,component:()=>t(zv,{phase:e.learning.phase,readyToPromote:e.learning.readyToPromote})},{key:Rv.Learning,rawValue:e.learning.phase,component:()=>t("div",{style:{minWidth:"300px"},children:t(Xv,{learning:e.learning})})},{key:Rv.LearningStartedAt,rawValue:e.learningStartedAt?new Date(e.learningStartedAt).toLocaleString():""},{key:Rv.ObservationCount,rawValue:Number(e.observationCount).toLocaleString()},{key:Rv.ObservationCountAtLastChange,rawValue:Number(e.observationCountAtLastChange??0).toLocaleString()},{key:Rv.LastChangedAt,rawValue:e.lastChangedAt?new Date(e.lastChangedAt).toLocaleString():""},{key:Rv.Data,rawValue:e.data??""}]}))??[],Pv=f.div`
|
|
1123
|
+
position: relative;
|
|
1124
|
+
width: 100%;
|
|
1125
|
+
height: 6px;
|
|
1126
|
+
border-radius: 3px;
|
|
1127
|
+
overflow: hidden;
|
|
1128
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
1129
|
+
`,Mv=f.div`
|
|
1130
|
+
position: absolute;
|
|
1131
|
+
left: 0;
|
|
1132
|
+
top: 0;
|
|
1133
|
+
height: 100%;
|
|
1134
|
+
width: ${({$pct:e})=>`${Math.max(0,Math.min(100,e))}%`};
|
|
1135
|
+
border-radius: 3px;
|
|
1136
|
+
background-color: ${({$color:e})=>e};
|
|
1137
|
+
`,zv=({phase:e,readyToPromote:i})=>{const n=v();if(i)return t(ce,{label:"Ready to promote",backgroundColor:n.v2.colors.green[800],textColor:n.v2.colors.green[300]});switch(e){case Eo.Empty:case Eo.Learning:return t(ce,{label:"Learning",backgroundColor:n.v2.colors.beige[600],textColor:n.v2.colors.black[500]});case Eo.Promoted:return t(ce,{label:"Promoted",leftIcon:Gr,backgroundColor:n.v2.colors.mint[1e3],textColor:n.v2.colors.mint[500]});default:return null}},Xv=({learning:i})=>{const n=v();switch(i.phase){case Eo.Empty:return t(Be,{text:"No data yet: this class has not grown a baseline structure. Stability does not apply until it learns something.",children:t(ee,{size:te.XXXS,color:ie.Secondary,children:"No baseline data yet"})});case Eo.Promoted:return t(Be,{text:"Locked: this class is promoted - its baseline is frozen and no longer changes.",children:t(ee,{size:te.XXXS,color:ie.Secondary,children:"Baseline locked"})});case Eo.Learning:{const{observations:r,duration:l}=i.stability;return t(Be,{text:i.readyToPromote?"Ready to promote: the learning policy gate is already satisfied, but the engine has not graduated the class yet.":"Learning: progress toward the resolved stability targets. A full bar is not promotion - Locked is only when phase is promoted.",children:e(oe,{$gap:4,children:[e(ee,{size:te.XXXS,color:ie.Primary,children:[r.current.toLocaleString()," / ",r.target.toLocaleString()," observations"]}),t(Pv,{children:t(Mv,{$pct:(a=r.current,o=r.target,o<=0?0:a/o*100),$color:n.v2.colors.blue[400]})}),t(ee,{size:te.XXXS,color:ie.Secondary,children:l.current<=0?"grew just now":`grew ${Do(l.current,{units:2,style:"long",suffix:!0})}`})]})})}default:return null}var a,o},_v=({transactionId:i})=>{const n=v(),{openModal:o}=lf(),{insightsApi:l}=ws(),{data:s,loading:c,refetch:d}=l.useBaseline({transactionId:i},{pollInterval:3e4}),{baselinesColumns:p,baselinesRows:u}=a(()=>({baselinesColumns:[{key:Rv.Class,label:"Class"},{key:Rv.Status,label:"Status"},{key:Rv.Learning,label:"Learning stability",noFilter:!0,noSort:!0},{key:Rv.ObservationCount,label:"Observations",noFilter:!0},{key:Rv.LearningStartedAt,label:"First observed",noFilter:!0}],baselinesRows:Lv(0,s)}),[n,s]),[h,g]=r(!1),[m,b]=r(null);return t(Gt,{bgTint:"900",richTitle:bv("Baseline (One row per deviation class)",'"Learning stability" shows how converged each class\'s baseline is. Locked means the class is promoted and frozen. While learning, progress shows observations and quiet time toward the resolved policy — a full bar is not promotion until the engine graduates the class.'),actions:[{id:"reset-all-baselines",type:fi.Button,buttonProps:{label:"Reset all baselines",leftIcon:ml,variant:$e.Secondary,onClick:()=>g(!0)}},{id:"refetch-baselines",type:fi.Button,buttonProps:{tooltip:"Refetch",hideTooltipIcon:!0,leftIcon:ol,variant:$e.Secondary,onClick:d,loading:c}}],children:e(Gt,{bgTint:"800",children:[t(Ui,{maxHeight:"35vh",variant:ji.Data,isLoading:c,columns:p,rows:u,getRowActions:e=>[{id:`${e.id}-view-json-data`,label:"View JSON data",leftIcon:tl,variant:$e.Primary,onClick:()=>{const t=e.cells.find(e=>e.key===Rv.Data)?.rawValue;o(nf.JsonCode,{jsonCode:t})}},{id:`${e.id}-re-learn`,label:"Re-learn (reset)",leftIcon:ml,onClick:()=>{const t=e.cells.find(e=>e.key===Rv.Class)?.rawValue;b(t)}}]}),t(tt,{isOpen:h,onClose:()=>g(!1),title:"Reset transaction baselines",description:"Are you sure you want to reset all baselines for this transaction?",approveButton:{label:"Reset all baselines",onClick:()=>(async()=>{g(!1),await(l?.resetTransactionBaselines?.(i)),d()})()},denyButton:{label:"Cancel",onClick:()=>g(!1),variant:$e.Secondary}}),t(tt,{isOpen:null!==m,onClose:()=>b(null),title:"Reset baseline class",description:"Are you sure you want to reset the baseline class?",approveButton:{label:"Reset baseline class",onClick:()=>(async e=>{b(null),await(l?.resetBaselineClass?.(i,e)),d()})(m)},denyButton:{label:"Cancel",onClick:()=>b(null),variant:$e.Secondary}})]})})};var Fv;(e=>{e.TraceId="traceId",e.TransactionId="transactionId",e.ObservedAt="observedAt",e.DurationMs="durationMs",e.SampleReason="sampleReason"})(Fv||(Fv={}));const Bv=e=>e?.map((e,i)=>({id:`${e.transactionId}-${e.traceId}-${i}`,cells:[{key:Fv.TraceId,rawValue:e.traceId},{key:Fv.TransactionId,rawValue:e.transactionId},{key:Fv.ObservedAt,rawValue:e.observedAt?new Date(e.observedAt).toLocaleString():""},{key:Fv.DurationMs,rawValue:`${e.durationMs}ms`},{key:Fv.SampleReason,rawValue:e.sampleReason,component:()=>t(ce,{label:e.sampleReason})}]}))??[];var Vv;(e=>{e.Examples="examples",e.Anomalies="anomalies"})(Vv||(Vv={}));const Uv=({transactionId:e})=>{const{openModal:i}=lf(),{insightsApi:n}=ws(),{data:o,loading:l,refetch:s}=n.useObservations({transactionId:e},{pollInterval:3e4}),{observationsColumns:c,observationsRows:d}=a(()=>({observationsColumns:[{key:Fv.TraceId,label:"Trace ID",noFilter:!0},{key:Fv.ObservedAt,label:"Observed at",noFilter:!0},{key:Fv.DurationMs,label:"Duration",noFilter:!0},{key:Fv.SampleReason,label:"Sample reason"}],observationsRows:Bv(o)}),[o]),[p,u]=r(Vv.Examples),{examplesRows:h,anomaliesRows:g}=a(()=>{const e=[],t=[];return d.forEach(i=>{const n=i.cells.find(e=>e.key===Fv.SampleReason)?.rawValue;[Ro.Example].includes(n)&&e.push(i),[Ro.AnomalyEvidence,Ro.GuardrailEvidence].includes(n)&&t.push(i)}),{examplesRows:e,anomaliesRows:t}},[d]);return t(Gt,{bgTint:"900",richTitle:bv("Trace observations","Representative sample of normal traffic - up to 10 collected while learning, then collection stops."),actions:[{id:"refetch-observations",type:fi.Button,buttonProps:{tooltip:"Refetch",hideTooltipIcon:!0,leftIcon:ol,variant:$e.Secondary,onClick:s,loading:l}}],renderOnRightSide:t(ve,{options:(m=h.length,b=g.length,[{label:"Examples",value:Vv.Examples,badge:{label:m.toString()}},{label:"Anomaly issues",value:Vv.Anomalies,badge:{label:b.toString()}}]),selected:p,setSelected:u,size:Xt.L}),children:t(Gt,{bgTint:"800",children:t(Ui,{maxHeight:"35vh",variant:ji.Data,isLoading:l,columns:c,rows:p===Vv.Examples?h:g,getRowActions:e=>[{id:`${e.id}-view-trace`,label:"View trace",rightIcon:tl,variant:$e.Primary,onClick:()=>{const t=e.cells.find(e=>e.key===Fv.TransactionId)?.rawValue,n=e.cells.find(e=>e.key===Fv.TraceId)?.rawValue;i(nf.TraceView,{transactionId:t,traceId:n})}}]})})});var m,b},jv=()=>{const{drawerIsOpenFor:e,closeDrawer:i}=lf(),{insightsApi:n}=ws(),{data:o,loading:r}=n.useTransactions(void 0,{fetchPolicy:"cache-first"}),l=a(()=>{if(e.id)return o?.find(t=>t.id===e.id)},[o,e.id]);return t(Ft,l?{width:"95vw",isOpen:!0,header:{onClose:i,icon:Pl,title:l?.id},children:t(Hv,{transaction:l})}:r?{width:"95vw",isOpen:!0,header:{onClose:i},children:t(bt,{children:t(xt,{withSpinner:!0})})}:{width:"95vw",isOpen:!0,header:{onClose:i},children:t(bt,{children:t(Ae,{})})})},Hv=({transaction:i})=>{const n=v();return e(Gt,{bgTint:"1000",moreSpacing:!0,children:[e(ne,{$gap:8,children:[t(ee,{size:te.M,children:i.service}),t(ni,{variant:mi.Blue,label:i.operation}),t(ce,{backgroundColor:n.v2.colors.blue[900],label:i.kind}),t(ni,{disabled:!0,label:`Transaction ID: ${i.id}`})]}),t(_v,{transactionId:i.id}),t(Uv,{transactionId:i.id})]})},Gv=f(oe)`
|
|
1138
|
+
flex: 1;
|
|
1139
|
+
min-width: 0;
|
|
1140
|
+
min-height: 0;
|
|
1141
|
+
height: 100%;
|
|
1142
|
+
overflow: hidden;
|
|
1143
|
+
border-radius: 16px;
|
|
1144
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1145
|
+
`,Kv=f(ne)`
|
|
1146
|
+
width: 100%;
|
|
1147
|
+
flex-shrink: 0;
|
|
1148
|
+
align-items: center;
|
|
1149
|
+
gap: 24px;
|
|
1150
|
+
padding: 12px 12px 16px 12px;
|
|
1151
|
+
`,Wv=f(ne)`
|
|
1152
|
+
flex-shrink: 0;
|
|
1153
|
+
align-items: center;
|
|
1154
|
+
gap: 8px;
|
|
1155
|
+
`,Yv=f(ee)`
|
|
1156
|
+
flex: 1;
|
|
1157
|
+
min-width: 0;
|
|
1158
|
+
white-space: pre-line;
|
|
1159
|
+
`,qv=f(oe)`
|
|
1160
|
+
flex: 1;
|
|
1161
|
+
min-height: 0;
|
|
1162
|
+
width: 100%;
|
|
1163
|
+
overflow: hidden;
|
|
1164
|
+
`,Jv=({icon:i,title:n,count:a,description:o,children:r})=>{const l=v();return e(Gv,{"data-id":`settings-content-panel-${n}`,children:[e(Kv,{children:[e(Wv,{children:[i&&t(i,{size:18}),t(ee,{size:te.S,children:n}),null!=a&&t(ce,{label:a})]}),o&&t(Yv,{size:te.XXS,color:l.v2.colors.silver[300],children:o})]}),t(qv,{children:r})]})},Zv="System",Qv="Storage",ey="Global",ty="Service",iy="Transaction",ny="Medium",ay="High",oy="Critical",ry=(e,t)=>`Fire when risk score ≥ ${e} · ${t} signal weight override(s)`,ly="Guardrails are rules you declare about how a service may communicate. A broken guardrail is a Policy violation.\nPick a service to see what it actually talks to, check the callers/callees/egress you want to allow.",sy="No guardrails yet",cy="Create a guardrail to declare allowed service communication.",dy="Namespace",py="Service",uy="Callers",hy="Who may call this service (inbound)",gy="No Callers detected",my="No callers found for this selection",by="Callees",fy="Internal services it may call (outbound)",vy="No Callees detected",yy="No callees found for this selection",Sy="Egress",xy="External destinations it may reach",Cy="No egress detected",wy="No egress found for this selection",ky="Adopt as enforce",Ty="Alert on violation",$y="Adopt as suggest",Iy="Observe only",Ny="Create new guardrail",Oy="allowed_callers",Ay="allowed_callees",Ey="allowed_egress";var Dy;(e=>{e.Minutes="minutes",e.Hours="hours",e.Days="days"})(Dy||(Dy={}));const Ry=e=>e.scope===Po.Global,Ly=[Lo.D1_call_edges,Lo.D2_egress,Lo.D3_latency,Lo.D5_libraries,Lo.D7_db_access,Lo.D8_payload_size],Py="Configure when a class stops learning and how baselines are finalized.\nUse service overrides to adjust learning for specific services or transactions.",My="Global",zy="Service",Xy="Transaction",_y="K of",Fy={[Lo.D1_call_edges]:"D1 call edges",[Lo.D2_egress]:"D2 egress",[Lo.D3_latency]:"D3 latency",[Lo.D4_args_returns]:"D4 args/returns",[Lo.D5_libraries]:"D5 libraries",[Lo.D6_attr_relations]:"D6 attr relations",[Lo.D7_db_access]:"D7 db access",[Lo.D8_payload_size]:"D8 payload size"},By={[Mo.Any]:"Any",[Mo.All]:"All",[Mo.KOf]:_y},Vy=[{id:Mo.Any,label:"Any (OR)"},{id:Mo.All,label:"All (AND)"},{id:Mo.KOf,label:"K of N"}],Uy=[{id:zo.StableObservations,label:"Stable for N observations"},{id:zo.StableDuration,label:"Stable for a duration"},{id:zo.MinObservations,label:"Min observations"},{id:zo.MinDuration,label:"Min duration"}],jy=[{id:Dy.Minutes,label:"Minutes"},{id:Dy.Hours,label:"Hours"},{id:Dy.Days,label:"Days"}],Hy=e=>e===zo.StableDuration||e===zo.MinDuration;var Gy;(e=>{e.Detection="detection",e.Guardrails="guardrails",e.Learning="learning",e.System="system",e.Storage="storage"})(Gy||(Gy={}));const Ky=Gy.Guardrails,Wy=[{id:"threat-detection",title:"Threat detection",icon:zl,items:[{id:Gy.Detection,title:"Detection",description:"When a finding fires",panelIcon:zl,panelDescription:"Configure when Odigos should create findings based on runtime risk signals.\nUse service overrides to adjust detection sensitivity for specific services."},{id:Gy.Guardrails,title:"Guardrails",description:"L7 allowlist rules (Enforce / Suggest)",panelIcon:Xl,panelDescription:ly}]},{id:"learning",title:"Learning",icon:Pr,items:[{id:Gy.Learning,title:"Learning",description:"Control baseline learning",panelIcon:Pr,panelDescription:Py}]},{id:"advanced",title:"Advanced",icon:_l,items:[{id:Gy.System,title:Zv,description:"Sampling, retention, capacity",panelIcon:_l,panelDescription:"Engine-wide operational configuration. Detection thresholds and learning rules live on their own tabs."},{id:Gy.Storage,title:Qv,description:"ClickHouse health",panelIcon:Fl}]}],Yy=e=>Wy.flatMap(e=>e.items).find(t=>t.id===e),qy="seconds",Jy="System settings are not available.",Zy={examplesPerTransaction:0,exampleSampleIntervalSeconds:0,observationRetentionDays:0,maxResidentTransactions:0,maxBaselineSetMembers:0,flushIntervalSeconds:0},Qy="260px",eS=e=>({examplesPerTransaction:e.sampling.examplesPerTransaction,exampleSampleIntervalSeconds:e.sampling.exampleSampleIntervalSeconds,observationRetentionDays:e.retention.observationRetentionDays,maxResidentTransactions:e.capacity.maxResidentTransactions,maxBaselineSetMembers:e.capacity.maxBaselineSetMembers,flushIntervalSeconds:e.writeback.flushIntervalSeconds}),tS=f(oe)`
|
|
1165
|
+
flex: 1;
|
|
1166
|
+
min-height: 0;
|
|
1167
|
+
width: 100%;
|
|
1168
|
+
overflow-y: auto;
|
|
1169
|
+
gap: 20px;
|
|
1170
|
+
padding: 4px 12px 32px;
|
|
1171
|
+
`,iS=f.div`
|
|
1172
|
+
flex-shrink: 0;
|
|
1173
|
+
display: flex;
|
|
1174
|
+
justify-content: flex-end;
|
|
1175
|
+
align-items: center;
|
|
1176
|
+
gap: 12px;
|
|
1177
|
+
width: 100%;
|
|
1178
|
+
padding: 12px 16px;
|
|
1179
|
+
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1180
|
+
background-color: ${({theme:e})=>e.v2.colors.black[500]+ae["095"]};
|
|
1181
|
+
|
|
1182
|
+
@media (max-width: 560px) {
|
|
1183
|
+
flex-direction: column-reverse;
|
|
1184
|
+
align-items: stretch;
|
|
1185
|
+
}
|
|
1186
|
+
`,nS=f(ke)`
|
|
1187
|
+
@media (max-width: 560px) {
|
|
1188
|
+
width: 100%;
|
|
1189
|
+
}
|
|
1190
|
+
`,aS=f(oe)`
|
|
1191
|
+
width: 100%;
|
|
1192
|
+
min-width: 0;
|
|
1193
|
+
gap: 4px;
|
|
1194
|
+
`,oS=f(oe)`
|
|
1195
|
+
width: 100%;
|
|
1196
|
+
min-width: 0;
|
|
1197
|
+
gap: 0;
|
|
1198
|
+
`,rS=f.div`
|
|
1199
|
+
display: flex;
|
|
1200
|
+
flex-wrap: wrap;
|
|
1201
|
+
align-items: flex-start;
|
|
1202
|
+
justify-content: flex-start;
|
|
1203
|
+
gap: 16px;
|
|
1204
|
+
width: 100%;
|
|
1205
|
+
padding: 10px 0;
|
|
1206
|
+
`,lS=f.label`
|
|
1207
|
+
display: flex;
|
|
1208
|
+
flex-direction: column;
|
|
1209
|
+
gap: 4px;
|
|
1210
|
+
flex: 1 1 240px;
|
|
1211
|
+
max-width: 420px;
|
|
1212
|
+
min-width: 0;
|
|
1213
|
+
cursor: pointer;
|
|
1214
|
+
`,sS=f.div`
|
|
1215
|
+
display: flex;
|
|
1216
|
+
flex-direction: column;
|
|
1217
|
+
gap: 4px;
|
|
1218
|
+
flex: 0 0 ${Qy};
|
|
1219
|
+
width: ${Qy};
|
|
1220
|
+
max-width: 100%;
|
|
1221
|
+
box-sizing: border-box;
|
|
1222
|
+
`,cS=({title:i,tooltip:n,children:a})=>e(aS,{"data-id":`insights-system-section-${i}`,children:[e(ne,{$width:"100%",$gap:6,$alignItems:"center",children:[t(ee,{size:te.S,children:i}),n?t(Be,{text:n,withIcon:!0}):null]}),a]}),dS=({id:i,label:n,helper:a,hint:o,value:r,unit:l,min:s=1,max:c,disabled:d,onChange:p})=>{const u=`${i}-helper`,h=o?`${i}-hint`:void 0,g=h?`${u} ${h}`:u,m=r<s||null!=c&&r>c;return e(rS,{"data-id":`insights-system-row-${i}`,children:[e(lS,{htmlFor:i,children:[t(ee,{size:te.XXS,children:n}),t("span",{id:u,children:t(ee,{size:te.XXXS,color:ie.Secondary,children:a})})]}),e(sS,{children:[t(Ie,{id:i,name:i,"aria-label":n,"aria-describedby":g,type:_t.Number,inputMode:"numeric",autoComplete:"off",value:r?String(r):"",onChange:e=>{const t=Number(e.target.value);p(Number.isFinite(t)?t:0)},width:"100%",min:s,max:c,disabled:d,hasError:m,suffix:l}),o?t("span",{id:h,children:t(ee,{size:te.XXXS,color:ie.Secondary,children:o})}):null]})]})},pS=()=>{const n=Yy(Gy.System),{insightsApi:a}=ws(),{data:l,loading:s,unsupported:c,error:p}=a.useSystemSettings(),[u,h]=r(Zy),[g,m]=r(!1);o(()=>{l&&h(eS(l))},[l?.sampling.examplesPerTransaction,l?.sampling.exampleSampleIntervalSeconds,l?.retention.observationRetentionDays,l?.capacity.maxResidentTransactions,l?.capacity.maxBaselineSetMembers,l?.writeback.flushIntervalSeconds]);const b=d(e=>t=>h(i=>({...i,[e]:t})),[]),f=!!l&&((e,t)=>{const i=eS(t);return e.examplesPerTransaction!==i.examplesPerTransaction||e.exampleSampleIntervalSeconds!==i.exampleSampleIntervalSeconds||e.observationRetentionDays!==i.observationRetentionDays||e.maxResidentTransactions!==i.maxResidentTransactions||e.maxBaselineSetMembers!==i.maxBaselineSetMembers||e.flushIntervalSeconds!==i.flushIntervalSeconds})(u,l),v=f&&(e=>e.examplesPerTransaction>=1&&e.exampleSampleIntervalSeconds>=1&&e.observationRetentionDays>=1&&e.observationRetentionDays<=90&&e.maxResidentTransactions>=1&&e.maxBaselineSetMembers>=1&&e.flushIntervalSeconds>=1&&e.flushIntervalSeconds<=300)(u)&&!g&&!!a.updateSystemSettings,y=f&&!g,S=async()=>{if(l&&a.updateSystemSettings&&v){m(!0);try{await a.updateSystemSettings(((e,t)=>({sampling:{examplesPerTransaction:e.examplesPerTransaction,exampleSampleIntervalSeconds:e.exampleSampleIntervalSeconds},retention:{observationRetentionDays:e.observationRetentionDays},findings:t.findings,capacity:{maxResidentTransactions:e.maxResidentTransactions,maxBaselineSetMembers:e.maxBaselineSetMembers},writeback:{flushIntervalSeconds:e.flushIntervalSeconds}}))(u,l))}finally{m(!1)}}},x=()=>{l&&y&&h(eS(l))};return t(Jv,{icon:n?.panelIcon,title:n?.title||Zv,description:n?.panelDescription,children:(()=>{if(c)return t(bt,{$height:"200px",children:t(ee,{size:te.XS,color:ie.Secondary,children:Jy})});if(s&&!l)return t(bt,{$height:"200px",children:t(xt,{})});if(!l)return t(bt,{$height:"200px",children:t(Ae,{hideIcon:!0,title:Jy,subTitle:p?.message})});const n=g;return e(i,{children:[e(tS,{"data-id":"insights-system-panel",children:[t(cS,{title:"Learning examples",tooltip:"Anomaly and guardrail evidence each keep a single write-once sample; occurrences are counted separately.",children:e(oS,{children:[t(dS,{id:"system-examples-per-transaction",label:"Maximum example traces",helper:"Maximum number of example traces collected per transaction.",value:u.examplesPerTransaction,unit:"traces",disabled:n,onChange:b("examplesPerTransaction")}),t(dS,{id:"system-example-sample-interval",label:"Minimum sampling interval",helper:"Minimum time between collected examples.",value:u.exampleSampleIntervalSeconds,unit:qy,disabled:n,onChange:b("exampleSampleIntervalSeconds")})]})}),t(cS,{title:"Retention",tooltip:"Findings lookback is chosen per page, not here.",children:t(oS,{children:t(dS,{id:"system-observation-retention-days",label:"Sample trace retention",helper:"Stored sample traces are deleted after this period.",hint:"Default: 30 · Maximum: 90",value:u.observationRetentionDays,unit:"days",max:90,disabled:n,onChange:b("observationRetentionDays")})})}),t(cS,{title:"Memory limits",children:e(oS,{children:[t(dS,{id:"system-max-resident-transactions",label:"Maximum transactions in memory",helper:"Least-recently used baselines are unloaded when this limit is reached and loaded again if traffic returns.",value:u.maxResidentTransactions,unit:"transactions",disabled:n,onChange:b("maxResidentTransactions")}),t(dS,{id:"system-max-baseline-set-members",label:"Maximum members per baseline",helper:"Limits the size of an individual baseline set, such as unique call edges or paths.",value:u.maxBaselineSetMembers,unit:"members",disabled:n,onChange:b("maxBaselineSetMembers")})]})}),t(cS,{title:"Database writeback",children:t(oS,{children:t(dS,{id:"system-flush-interval-seconds",label:"Flush interval",helper:"How often pending learning data and occurrence counts are written to ClickHouse. Changes apply without a restart.",hint:"Default: 5 · Maximum: 300",value:u.flushIntervalSeconds,unit:qy,max:300,disabled:n,onChange:b("flushIntervalSeconds")})})})]}),e(iS,{children:[f?t(nS,{"data-id":"insights-system-discard",label:"Discard changes",variant:$e.Secondary,size:Te.M,disabled:!y,onClick:x}):null,t(nS,{"data-id":"insights-system-save",label:"Save settings",variant:$e.Primary,size:Te.M,disabled:!v,loading:g,onClick:S})]})]})})()})},uS=f(ne)`
|
|
1223
|
+
padding: 8px 12px 4px 12px;
|
|
1224
|
+
`,hS=({icon:i,title:n,count:a})=>{const o=v().v2.colors.purple[200];return e(uS,{$gap:8,children:[t(i,{size:14,fill:o}),t(ee,{size:te.XXS,color:o,children:n}),t(ce,{label:a})]})},gS=f(oe)`
|
|
1225
|
+
width: 280px;
|
|
1226
|
+
flex-shrink: 0;
|
|
1227
|
+
height: 100%;
|
|
1228
|
+
gap: 16px;
|
|
1229
|
+
overflow-y: auto;
|
|
1230
|
+
`,mS=f(ne)`
|
|
1231
|
+
padding: 4px 12px;
|
|
1232
|
+
`,bS=f(oe)`
|
|
1233
|
+
gap: 0;
|
|
1234
|
+
`,fS=({selected:i,onSelect:n})=>{const a=v();return e(gS,{"data-id":"insights-settings-menu",children:[e(mS,{$gap:8,children:[t(rl,{size:16,fill:a.v2.colors.silver[200]}),t(ee,{size:te.XS,children:"Settings Menu"})]}),Wy.map(a=>e(bS,{"data-id":`settings-menu-category-${a.id}`,children:[t(hS,{icon:a.icon,title:a.title,count:a.items.length}),a.items.map(e=>t(uc,{dataId:`settings-menu-item-${e.id}`,title:e.title,description:e.description,withCarret:!0,isSelected:i===e.id,onClick:()=>n(e.id)},e.id))]},a.id))]})},vS=f(oe)`
|
|
1235
|
+
flex: 1;
|
|
1236
|
+
min-width: 0;
|
|
1237
|
+
height: 100%;
|
|
1238
|
+
gap: 16px;
|
|
1239
|
+
padding: 16px;
|
|
1240
|
+
overflow: hidden;
|
|
1241
|
+
border-radius: 16px 0 16px 0;
|
|
1242
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1243
|
+
`,yS=f(oe)`
|
|
1244
|
+
width: 100%;
|
|
1245
|
+
gap: 4px;
|
|
1246
|
+
`,SS=f(ee)`
|
|
1247
|
+
white-space: pre-line;
|
|
1248
|
+
`,xS=f(oe)`
|
|
1249
|
+
width: 100%;
|
|
1250
|
+
gap: 32px;
|
|
1251
|
+
padding: 12px;
|
|
1252
|
+
border-radius: 16px;
|
|
1253
|
+
align-items: center;
|
|
1254
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1255
|
+
`,CS=f(oe)`
|
|
1256
|
+
width: 100%;
|
|
1257
|
+
gap: 24px;
|
|
1258
|
+
align-items: center;
|
|
1259
|
+
padding: 0 12px;
|
|
1260
|
+
`,wS=f(ne)`
|
|
1261
|
+
width: 100%;
|
|
1262
|
+
align-items: flex-end;
|
|
1263
|
+
justify-content: center;
|
|
1264
|
+
gap: 16px;
|
|
1265
|
+
flex-wrap: wrap;
|
|
1266
|
+
`,kS=f(oe)`
|
|
1267
|
+
gap: 4px;
|
|
1268
|
+
`,TS=f(kS)`
|
|
1269
|
+
width: 530px;
|
|
1270
|
+
max-width: 100%;
|
|
1271
|
+
`,$S=f(kS)`
|
|
1272
|
+
width: 319px;
|
|
1273
|
+
max-width: 100%;
|
|
1274
|
+
`,IS="32px",NS=f.div`
|
|
1275
|
+
display: flex;
|
|
1276
|
+
align-items: stretch;
|
|
1277
|
+
height: ${IS};
|
|
1278
|
+
|
|
1279
|
+
& > div {
|
|
1280
|
+
height: 100%;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
& button {
|
|
1284
|
+
height: 100%;
|
|
1285
|
+
box-sizing: border-box;
|
|
1286
|
+
}
|
|
1287
|
+
`,OS=f.div`
|
|
1288
|
+
width: 100%;
|
|
1289
|
+
|
|
1290
|
+
& > div > div > div:first-child {
|
|
1291
|
+
height: ${IS};
|
|
1292
|
+
box-sizing: border-box;
|
|
1293
|
+
padding-top: 0;
|
|
1294
|
+
padding-bottom: 0;
|
|
1295
|
+
}
|
|
1296
|
+
`,AS=f(ne)`
|
|
1297
|
+
width: 100%;
|
|
1298
|
+
justify-content: center;
|
|
1299
|
+
`,ES=f(ke)`
|
|
1300
|
+
min-width: 271px;
|
|
1301
|
+
`,DS=(e,t)=>`${e}/${t}`,RS=e=>{const t=DS(e.namespace,e.service);return e.operation?`${t} · ${e.operation}`:t},LS=Ly.map(e=>({id:e,label:Fy[e]})),PS=({services:i,transactions:n,existingOverrides:l,initialClass:s,onSubmit:c})=>{const d=v(),[p,u]=r(s||Ly[0]),[h,g]=r(Po.Service),[m,b]=r(""),[f,y]=r(!1);o(()=>{s&&u(s)},[s]);const S=a(()=>l.filter(e=>e.class===p).map(e=>e.scopeKey),[l,p]),x=a(()=>{const e=new Set,t=[];for(const n of i){if(!n.namespace||!n.service)continue;const i=DS(n.namespace,n.service);e.has(i)||(e.add(i),t.push({id:i,label:i}))}return t.sort((e,t)=>e.label.localeCompare(t.label))},[i]),C=a(()=>n.filter(e=>!!e.id).map(e=>({id:String(e.id),label:RS(e)})).sort((e,t)=>e.label.localeCompare(t.label)),[n]),w=h===Po.Service?x:C,k=h===Po.Service?"Select Service":"Select Transaction",T=h===Po.Service?"Select service…":"Select transaction…";o(()=>{const e=w.find(e=>!S.includes(e.id))?.id||w[0]?.id||"";b(t=>t&&w.some(e=>e.id===t)?t:e)},[w,S]);const $=!!p&&!!m&&!f;return e(vS,{"data-id":"learning-create-override-panel",children:[e(yS,{children:[t(ee,{size:te.S,children:"Choose override scope"}),t(SS,{size:te.XXS,color:ie.Secondary,children:"Select where this policy should override the global learning settings.\nYou can apply it to a specific service or transaction."})]}),e(xS,{children:[e(CS,{children:[e(TS,{children:[t(ee,{size:te.XS,color:ie.Secondary,children:"Select Deviation class"}),t(OS,{children:t(vt,{"data-id":"learning-override-class",options:LS,values:[p],setValues:e=>u(e[0]||Ly[0]),placeholder:"Select deviation class…"})})]}),e(wS,{children:[e(kS,{children:[t(ee,{size:te.XS,color:ie.Secondary,children:"Choose Override type"}),t(NS,{children:t(ve,{"data-id":"learning-override-type",size:Xt.L,selected:h,setSelected:e=>g(e),options:[{value:Po.Service,label:zy,selectedBgColor:d.v2.colors.purple[500],selectedBorderColor:d.v2.colors.purple[500]},{value:Po.Transaction,label:Xy,selectedBgColor:d.v2.colors.purple[500],selectedBorderColor:d.v2.colors.purple[500]}]})})]}),e($S,{children:[t(ee,{size:te.XS,color:ie.Secondary,children:k}),t(OS,{children:t(vt,{"data-id":"learning-override-target",options:w,values:m?[m]:[],setValues:e=>b(e[0]||""),placeholder:T,withSearch:!0,disabled:!w.length})})]})]})]}),t(AS,{children:t(ES,{"data-id":"learning-add-selection",label:"Add selection",rightIcon:Rr,variant:$e.Primary,size:Te.M,disabled:!$,onClick:async()=>{if(!$)return;const e=w.find(e=>e.id===m);y(!0);try{await c({class:p,scope:h,scopeKey:m,name:e?.label||m})}finally{y(!1)}}})})]})]})};let MS=0;const zS=()=>"cond-"+ ++MS,XS=(e,t,i)=>`${e}:${t||"global"}:${i}`,_S=(e,t)=>{switch(t){case Dy.Days:return Math.max(0,Math.round(24*e*60));case Dy.Hours:return Math.max(0,Math.round(60*e));case Dy.Minutes:default:return Math.max(0,Math.round(e))}},FS=e=>e<=0?{value:0,unit:Dy.Minutes}:e%1440==0?{value:e/1440,unit:Dy.Days}:e%60==0?{value:e/60,unit:Dy.Hours}:{value:e,unit:Dy.Minutes},BS=e=>{const{value:t,unit:i}=FS(e);return i===Dy.Days?7===t?"1w":`${t}d`:i===Dy.Hours?`${t}h`:`${t}m`},VS=e=>{const{value:t,unit:i}=FS(e);return i===Dy.Days?1===t?"1 day":`${t} days`:i===Dy.Hours?1===t?"1 hour":`${t} hours`:1===t?"1 minute":`${t} minutes`},US=e=>{switch(e.type){case zo.StableObservations:return`Unchanged for ${e.value} observations`;case zo.StableDuration:return`unchanged for ${BS(_S(e.value,e.durationUnit))}`;case zo.MinObservations:return`Min ${e.value} observations`;case zo.MinDuration:return`min ${BS(_S(e.value,e.durationUnit))}`;default:return""}},jS=e=>{switch(e.type){case zo.StableObservations:return`unchanged for ${e.value} observations`;case zo.StableDuration:return`unchanged for ${VS(_S(e.value,e.durationUnit))}`;case zo.MinObservations:return`at least ${e.value} observations`;case zo.MinDuration:return`at least ${VS(_S(e.value,e.durationUnit))}`;default:return""}},HS=(e,t,i)=>t.length?((e,t,i)=>{if(!e.length)return"";const n=e.map((e,t)=>0===t?e.charAt(0).toUpperCase()+e.slice(1):0===t?e:e.charAt(0).toLowerCase()+e.slice(1));if(1===n.length)return n[0];const a=t===Mo.All?" AND ":t===Mo.KOf?` (${_y} ${i??1}) `:" OR ";return n.join(a)})(t.map(US),e,i):"Falls back to count-only default",GS=e=>{const{value:t,durationUnit:i}=(e=>{switch(e.type){case zo.StableObservations:return{value:e.stableObservations??0,durationUnit:Dy.Hours};case zo.MinObservations:return{value:e.minObservations??0,durationUnit:Dy.Hours};case zo.StableDuration:{const t=e.stableMinutes??0,i=FS(t);return{value:i.value,durationUnit:i.unit}}case zo.MinDuration:{const t=e.minDurationMinutes??0,i=FS(t);return{value:i.value,durationUnit:i.unit}}default:return{value:0,durationUnit:Dy.Hours}}})(e);return{key:zS(),type:e.type,value:t,durationUnit:i}},KS=e=>{const t=_S(e.value,e.durationUnit);switch(e.type){case zo.StableObservations:return{type:e.type,minObservations:null,minDurationMinutes:null,stableObservations:e.value,stableMinutes:null};case zo.MinObservations:return{type:e.type,minObservations:e.value,minDurationMinutes:null,stableObservations:null,stableMinutes:null};case zo.StableDuration:return{type:e.type,minObservations:null,minDurationMinutes:null,stableObservations:null,stableMinutes:t};case zo.MinDuration:return{type:e.type,minObservations:null,minDurationMinutes:t,stableObservations:null,stableMinutes:null};default:return{type:e.type}}},WS=(e=zo.StableObservations)=>({key:zS(),type:e,value:Hy(e)?1:100,durationUnit:Dy.Hours}),YS=e=>{const t=(e.conditions??[]).map(GS),i=e.mode,n=e.minMatches??null,a=e.scope,o=Fy[e.class],r=a===Po.Global?o:`${o} · ${e.scopeKey}`;return{id:XS(a,e.scopeKey,e.class),name:r,class:e.class,mode:i,conditions:t,minMatches:n,scope:a,scopeKey:e.scopeKey,summary:HS(i,t,n)}},qS=e=>{const t=`${e.namespace}/${e.service}`;return e.operation?`${t} · ${e.operation}`:t},JS=e=>({class:e.class,mode:e.mode,conditions:e.conditions.map(KS),minMatches:e.mode===Mo.KOf?e.minMatches??1:null,scope:e.scope,scopeKey:e.scopeKey}),ZS=f.button`
|
|
1302
|
+
display: flex;
|
|
1303
|
+
align-items: center;
|
|
1304
|
+
justify-content: space-between;
|
|
1305
|
+
gap: 4px;
|
|
1306
|
+
width: 100%;
|
|
1307
|
+
padding: 8px 8px 8px 12px;
|
|
1308
|
+
border: none;
|
|
1309
|
+
border-radius: 8px;
|
|
1310
|
+
background-color: ${({$isSelected:e,theme:t})=>e?t.v2.colors.silver[800]:"transparent"};
|
|
1311
|
+
cursor: pointer;
|
|
1312
|
+
text-align: left;
|
|
1313
|
+
|
|
1314
|
+
&:hover {
|
|
1315
|
+
background-color: ${({theme:e,$isSelected:t})=>t?e.v2.colors.silver[800]:e.v2.colors.silver[900]};
|
|
1316
|
+
}
|
|
1317
|
+
`,QS=f(oe)`
|
|
1318
|
+
flex: 1;
|
|
1319
|
+
min-width: 0;
|
|
1320
|
+
`,ex=f(ne)`
|
|
1321
|
+
flex-wrap: wrap;
|
|
1322
|
+
align-items: center;
|
|
1323
|
+
gap: 4px;
|
|
1324
|
+
`,tx=({policy:i,isSelected:n,onSelect:a})=>{const o=v(),r=(e=>{switch(e){case Po.Global:return{label:My,status:Le.Warning};case Po.Service:return{label:zy,status:Le.Info};case Po.Transaction:return{label:Xy,status:Le.Info}}})(i.scope);return e(ZS,{type:"button","data-id":`learning-policy-item-${i.id}`,$isSelected:n,onClick:()=>a(i.id),children:[e(QS,{$gap:4,children:[e(ex,{children:[t(ee,{size:te.XXS,nowrap:!0,children:i.name}),Ry(i)&&t(ce,{label:r.label,status:r.status,invertColors:!0}),t(ce,{label:By[i.mode],invertColors:!0,backgroundColor:o.v2.colors.blue[900],textColor:o.v2.colors.blue[300]})]}),t(ee,{size:te.XXXS,color:ie.Secondary,nowrap:!0,children:i.summary})]}),t(Ar,{size:18})]})},ix=f(oe)`
|
|
1325
|
+
width: 320px;
|
|
1326
|
+
flex-shrink: 0;
|
|
1327
|
+
height: 100%;
|
|
1328
|
+
gap: 16px;
|
|
1329
|
+
padding: 8px 12px 12px 12px;
|
|
1330
|
+
overflow-y: auto;
|
|
1331
|
+
`,nx=f(oe)`
|
|
1332
|
+
width: 100%;
|
|
1333
|
+
gap: 8px;
|
|
1334
|
+
`,ax=f(ne)`
|
|
1335
|
+
width: 100%;
|
|
1336
|
+
align-items: center;
|
|
1337
|
+
gap: 4px;
|
|
1338
|
+
padding: 8px 12px 4px 8px;
|
|
1339
|
+
`,ox=f(oe)`
|
|
1340
|
+
width: 100%;
|
|
1341
|
+
min-height: 60px;
|
|
1342
|
+
align-items: stretch;
|
|
1343
|
+
justify-content: center;
|
|
1344
|
+
gap: 2px;
|
|
1345
|
+
padding: 12px 8px;
|
|
1346
|
+
border-radius: 12px;
|
|
1347
|
+
text-align: center;
|
|
1348
|
+
`,rx=f(ke)`
|
|
1349
|
+
&&:enabled {
|
|
1350
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[900]};
|
|
1351
|
+
|
|
1352
|
+
&:hover {
|
|
1353
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[800]};
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
&:active {
|
|
1357
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[700]};
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
`,lx=({defaultPolicies:i,overridePolicies:n,selectedId:a,onSelect:o,onAddOverride:r})=>{const l=v();return e(ix,{"data-id":"learning-policies-menu",children:[e(nx,{children:[e(ax,{children:[t(ee,{size:te.XXS,color:l.v2.colors.purple[300],children:"Default policy"}),t(ce,{label:i.length})]}),i.map(e=>t(tx,{policy:e,isSelected:a===e.id,onSelect:o},e.id))]}),e(nx,{children:[e(ax,{children:[t(ee,{size:te.XXS,color:l.v2.colors.purple[300],children:"Overrides"}),t(ce,{label:n.length})]}),0===n.length?e(ox,{children:[t(ee,{size:te.XXS,color:ie.Secondary,align:"center",children:"No overrides yet"}),t(ee,{size:te.XXXS,color:ie.Disable,align:"center",children:"Add overrides to adjust learning for specific services."})]}):n.map(e=>t(tx,{policy:e,isSelected:a===e.id,onSelect:o},e.id)),t(rx,{"data-id":"learning-add-override-policy",label:"Add override policy",rightIcon:Rr,variant:$e.Primary,size:Te.M,fullWidth:!0,textColor:l.v2.colors.purple[300],onClick:r})]})]})},sx=f(oe)`
|
|
1361
|
+
flex: 1;
|
|
1362
|
+
min-width: 0;
|
|
1363
|
+
height: 100%;
|
|
1364
|
+
gap: 24px;
|
|
1365
|
+
padding: 8px 16px 16px 16px;
|
|
1366
|
+
overflow: hidden;
|
|
1367
|
+
border-radius: 16px 0 16px 0;
|
|
1368
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1369
|
+
`,cx=f(oe)`
|
|
1370
|
+
flex: 1;
|
|
1371
|
+
min-height: 0;
|
|
1372
|
+
width: 100%;
|
|
1373
|
+
gap: 12px;
|
|
1374
|
+
overflow-y: auto;
|
|
1375
|
+
`,dx=f(oe)`
|
|
1376
|
+
width: 100%;
|
|
1377
|
+
gap: 4px;
|
|
1378
|
+
padding: 12px;
|
|
1379
|
+
`,px=f(ne)`
|
|
1380
|
+
width: 100%;
|
|
1381
|
+
align-items: center;
|
|
1382
|
+
gap: 4px;
|
|
1383
|
+
`,ux=f(oe)`
|
|
1384
|
+
width: 100%;
|
|
1385
|
+
gap: 12px;
|
|
1386
|
+
padding: 12px;
|
|
1387
|
+
border-radius: 12px;
|
|
1388
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1389
|
+
`,hx=f(ne)`
|
|
1390
|
+
width: 100%;
|
|
1391
|
+
align-items: center;
|
|
1392
|
+
gap: 12px;
|
|
1393
|
+
flex-wrap: wrap;
|
|
1394
|
+
`,gx=f(ne)`
|
|
1395
|
+
width: 100%;
|
|
1396
|
+
align-items: center;
|
|
1397
|
+
gap: 8px;
|
|
1398
|
+
flex-wrap: wrap;
|
|
1399
|
+
`,mx=f.button`
|
|
1400
|
+
display: flex;
|
|
1401
|
+
align-items: center;
|
|
1402
|
+
gap: 8px;
|
|
1403
|
+
height: 32px;
|
|
1404
|
+
padding: 0 12px;
|
|
1405
|
+
border-radius: 6px;
|
|
1406
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
1407
|
+
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
1408
|
+
cursor: pointer;
|
|
1409
|
+
|
|
1410
|
+
&:hover {
|
|
1411
|
+
border-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
1412
|
+
}
|
|
1413
|
+
`,bx=f.div`
|
|
1414
|
+
height: 32px;
|
|
1415
|
+
display: flex;
|
|
1416
|
+
align-items: stretch;
|
|
1417
|
+
|
|
1418
|
+
& > div {
|
|
1419
|
+
height: 100%;
|
|
1420
|
+
justify-content: center;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
& > div > div:first-child {
|
|
1424
|
+
height: 100%;
|
|
1425
|
+
box-sizing: border-box;
|
|
1426
|
+
padding-top: 0;
|
|
1427
|
+
padding-bottom: 0;
|
|
1428
|
+
}
|
|
1429
|
+
`,fx=f.div`
|
|
1430
|
+
width: 100%;
|
|
1431
|
+
display: flex;
|
|
1432
|
+
align-items: center;
|
|
1433
|
+
padding: 8px 16px;
|
|
1434
|
+
border-radius: 4px;
|
|
1435
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1436
|
+
`,vx=f.p`
|
|
1437
|
+
margin: 0;
|
|
1438
|
+
font-family: ${({theme:e})=>e.font_family.primary};
|
|
1439
|
+
font-size: 12px;
|
|
1440
|
+
font-weight: 400;
|
|
1441
|
+
line-height: normal;
|
|
1442
|
+
color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
1443
|
+
`,yx=f.span`
|
|
1444
|
+
color: ${({theme:e})=>e.v2.colors.purple[400]};
|
|
1445
|
+
`,Sx=f(ne)`
|
|
1446
|
+
flex-shrink: 0;
|
|
1447
|
+
width: 100%;
|
|
1448
|
+
align-items: center;
|
|
1449
|
+
justify-content: space-between;
|
|
1450
|
+
gap: 20px;
|
|
1451
|
+
padding: 8px;
|
|
1452
|
+
border-radius: 8px;
|
|
1453
|
+
background-color: ${({theme:e})=>e.v2.colors.black[500]+ae["095"]};
|
|
1454
|
+
box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
|
|
1455
|
+
`,xx=f(ne)`
|
|
1456
|
+
flex: 1;
|
|
1457
|
+
min-width: 0;
|
|
1458
|
+
align-items: center;
|
|
1459
|
+
gap: 10px;
|
|
1460
|
+
padding: 4px 12px 4px 4px;
|
|
1461
|
+
border-radius: 8px;
|
|
1462
|
+
background-color: ${({theme:e})=>e.v2.colors.blue[1e3]};
|
|
1463
|
+
`,Cx=f.div`
|
|
1464
|
+
display: flex;
|
|
1465
|
+
align-items: center;
|
|
1466
|
+
justify-content: center;
|
|
1467
|
+
width: 24px;
|
|
1468
|
+
height: 24px;
|
|
1469
|
+
border-radius: 6px;
|
|
1470
|
+
flex-shrink: 0;
|
|
1471
|
+
background-color: ${({theme:e})=>e.v2.colors.blue[900]};
|
|
1472
|
+
`,wx=f(ne)`
|
|
1473
|
+
gap: 16px;
|
|
1474
|
+
align-items: center;
|
|
1475
|
+
flex-shrink: 0;
|
|
1476
|
+
`,kx=f(ke)`
|
|
1477
|
+
min-width: 140px;
|
|
1478
|
+
`,Tx=f(ke)`
|
|
1479
|
+
&&:enabled {
|
|
1480
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[900]};
|
|
1481
|
+
|
|
1482
|
+
&:hover {
|
|
1483
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[800]};
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
&:active {
|
|
1487
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[700]};
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
`,$x=f.button`
|
|
1491
|
+
display: inline-flex;
|
|
1492
|
+
align-items: center;
|
|
1493
|
+
justify-content: center;
|
|
1494
|
+
width: 32px;
|
|
1495
|
+
height: 32px;
|
|
1496
|
+
border: none;
|
|
1497
|
+
border-radius: 6px;
|
|
1498
|
+
background: transparent;
|
|
1499
|
+
cursor: pointer;
|
|
1500
|
+
|
|
1501
|
+
&:hover {
|
|
1502
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1503
|
+
}
|
|
1504
|
+
`,Ix=e=>({...e,summary:HS(e.mode,e.conditions,e.minMatches)}),Nx=({policy:l,onAddOverride:s,onSave:c,onDelete:d})=>{const p=v(),[u,h]=r(l),[g,m]=r(!1),[b,f]=r(!1),y=!Ry(u);o(()=>{h(l)},[l]);const S=a(()=>Vy.find(e=>e.id===u.mode),[u.mode]),x=((e,t,i)=>{if(!t.length)return{parts:["Falls back to the count-only default"],joiner:null};const n=t.map(jS).map((e,t)=>0===t?e:e.charAt(0).toLowerCase()+e.slice(1));return 1===n.length?{parts:n,joiner:null}:{parts:n,joiner:e===Mo.All?"AND":e===Mo.KOf?`${_y} ${i??1}`:"OR"}})(u.mode,u.conditions,u.minMatches),C=HS(u.mode,u.conditions,u.minMatches),w=u.scope===Po.Service?zy:u.scope===Po.Transaction?Xy:My,k=`${Fy[u.class]} · `,T=u.name.startsWith(k)?u.name.slice(k.length):u.scopeKey,$=e=>{h(t=>Ix({...t,conditions:e(t.conditions)}))};return e(sx,{"data-id":`learning-policy-editor-${l.id}`,children:[e(cx,{children:[e(dx,{children:[e(px,{children:[e(i,y?{children:[t(ce,{label:w,status:Le.Info,invertColors:!0}),t(ee,{size:te.XS,nowrap:!0,children:T})]}:{children:[t(ee,{size:te.XS,nowrap:!0,children:u.name}),t(ce,{label:My,status:Le.Warning,invertColors:!0})]}),t(ce,{label:By[u.mode],invertColors:!0,backgroundColor:p.v2.colors.blue[900],textColor:p.v2.colors.blue[300]})]}),e(ee,{size:te.XXXS,color:ie.Secondary,children:["Currently:"," ",C]})]}),e(ux,{children:[e(hx,{children:[t(ee,{size:te.XS,children:"Combine"}),t(jn,{items:[...Vy],selectedIds:[u.mode],setSelectedIds:e=>{const t=e[0]||u.mode;h(e=>Ix({...e,mode:t,minMatches:t===Mo.KOf?e.minMatches??1:null}))},alignX:Gn.Left,children:({ChevronIcon:i,handleClick:n})=>e(mx,{type:"button",onClick:n,"data-id":"learning-policy-combine-mode",children:[t(ee,{size:te.XXS,children:S?.label||u.mode}),t(i,{size:18})]})}),u.mode===Mo.KOf&&e(ne,{$gap:8,style:{alignItems:"center"},children:[t(ee,{size:te.XS,children:"Min matches"}),t(bx,{children:t(Ie,{"data-id":"learning-policy-min-matches",type:_t.Number,value:String(u.minMatches??1),onChange:e=>h(t=>Ix({...t,minMatches:Math.max(1,Number(e.target.value)||1)})),width:"72px",small:!0,min:1})})]})]}),u.conditions.map(i=>{const n=Uy.find(e=>e.id===i.type),a=jy.find(e=>e.id===i.durationUnit),o=Hy(i.type);return e(gx,{"data-id":`learning-condition-${i.key}`,children:[t(jn,{items:[...Uy],selectedIds:[i.type],setSelectedIds:e=>{return t=i.key,n=e[0]||i.type,void $(e=>e.map(e=>e.key===t?((e,t)=>{const i=Hy(e.type),n=Hy(t);return i===n?{...e,type:t}:{...e,type:t,value:n?1:100,durationUnit:e.durationUnit||Dy.Hours}})(e,n):e));var t,n},alignX:Gn.Left,children:({ChevronIcon:a,handleClick:o})=>e(mx,{type:"button",onClick:o,"data-id":`learning-condition-type-${i.key}`,children:[t(ee,{size:te.XXS,children:n?.label||i.type}),t(a,{size:18})]})}),t(bx,{children:t(Ie,{"data-id":`learning-condition-value-${i.key}`,type:_t.Number,value:String(i.value),onChange:e=>((e,t)=>{const i=Number(t);$(t=>t.map(t=>t.key===e?{...t,value:Number.isFinite(i)?i:0}:t))})(i.key,e.target.value),width:"79px",small:!0,min:0})}),o&&t(jn,{items:[...jy],selectedIds:[i.durationUnit],setSelectedIds:e=>{return t=i.key,n=e[0]||i.durationUnit,void $(e=>e.map(e=>e.key===t?{...e,durationUnit:n}:e));var t,n},alignX:Gn.Left,children:({ChevronIcon:n,handleClick:o})=>e(mx,{type:"button",onClick:o,"data-id":`learning-condition-unit-${i.key}`,children:[t(ee,{size:te.XXS,children:a?.label||i.durationUnit}),t(n,{size:18})]})}),t($x,{type:"button","data-id":`learning-condition-remove-${i.key}`,onClick:()=>{return e=i.key,void $(t=>t.filter(t=>t.key!==e));var e},children:t(Dr,{size:16,fill:p.v2.colors.red[500]})})]},i.key)}),t(fx,{children:e(vx,{children:["Promotes when"," ",x.parts[0],x.joiner&&x.parts.slice(1).map((i,a)=>e(n.Fragment,{children:[" ",t(yx,{children:x.joiner})," ",i]},`${x.joiner}-${a}`))]})}),t(Tx,{"data-id":"learning-add-condition",label:"Add condition",rightIcon:Rr,variant:$e.Primary,size:Te.M,fullWidth:!0,textColor:p.v2.colors.purple[300],onClick:()=>{$(e=>[...e,WS()])}})]})]}),e(Sx,{children:[e(xx,{children:[t(Cx,{children:t(al,{size:18,fill:p.v2.colors.blue[200]})}),t(ee,{size:te.XXXS,color:p.v2.colors.blue[200],children:"A policy with no conditions falls back to the count-only default."})]}),e(wx,{children:[y?t(ke,{"data-id":"learning-policy-delete",label:"Delete override",rightIcon:Dr,variant:$e.Text,size:Te.M,textColor:p.v2.colors.red[400],onClick:async()=>{if(d){f(!0);try{await d()}finally{f(!1)}}},disabled:b||g}):t(kx,{"data-id":"learning-policy-add-override",label:"Add override",rightIcon:Rr,variant:$e.Secondary,size:Te.M,onClick:s}),t(kx,{"data-id":"learning-policy-save",label:"Save Changes",variant:$e.Primary,size:Te.M,onClick:async()=>{m(!0);try{await c(Ix(u))}finally{m(!1)}},disabled:g||b})]})]})]})},Ox=f(ne)`
|
|
1505
|
+
flex: 1;
|
|
1506
|
+
min-height: 0;
|
|
1507
|
+
width: 100%;
|
|
1508
|
+
align-items: stretch;
|
|
1509
|
+
`,Ax=f.div`
|
|
1510
|
+
flex: 1;
|
|
1511
|
+
min-width: 0;
|
|
1512
|
+
height: 100%;
|
|
1513
|
+
overflow: hidden;
|
|
1514
|
+
`,Ex=()=>{const i=Yy(Gy.Learning),{insightsApi:n}=ws(),{data:l,loading:s,refetch:c}=n.useLearningPolicies(),d=n.useServices(),p=n.useTransactions(),u=Array.isArray(l)?l:[],[h,g]=r(!1),[m,b]=r(null),[f,v]=r(null),y=a(()=>Array.isArray(d.data)?d.data:[],[d.data]),S=a(()=>Array.isArray(p.data)?p.data:[],[p.data]),x=a(()=>((e,t)=>{if(!t.length)return e;const i=new Map(t.map(e=>[String(e.id),e]));return e.map(e=>{if(e.scope!==Po.Transaction)return e;const t=i.get(e.scopeKey);return t?{...e,name:`${Fy[e.class]} · ${qS(t)}`}:e})})(u.map(YS),S),[u,S]),C=a(()=>(e=>{const t=new Map(Ly.map((e,t)=>[e,t]));return[...e].sort((e,i)=>(t.get(e.class)??99)-(t.get(i.class)??99))})(x.filter(Ry)),[x]),w=a(()=>x.filter(e=>!Ry(e)),[x]),k=a(()=>[...C,...w],[C,w]);o(()=>{h||(k.length?b(e=>e&&k.some(t=>t.id===e)?e:k[0].id):b(null))},[k,h]);const T=a(()=>k.find(e=>e.id===m)??null,[k,m]),$=a(()=>h?k.find(e=>e.id===f)??C[0]??null:T??C[0]??null,[h,f,k,T,C]),I=a(()=>w.map(e=>({class:e.class,scopeKey:e.scopeKey})),[w]),N=()=>{v(m??C[0]?.id??null),g(!0),b(null)};return t(Jv,{icon:i?.panelIcon,title:"Learning Policies",count:k.length,description:i?.panelDescription||Py,children:!s||k.length||h?e(Ox,{children:[t(lx,{defaultPolicies:C,overridePolicies:w,selectedId:h?null:m,onSelect:e=>{g(!1),v(null),b(e)},onAddOverride:N}),t(Ax,{children:h?t(PS,{services:y,transactions:S,existingOverrides:I,initialClass:$?.class,onSubmit:async e=>{if(!n.upsertLearningPolicy)return;const t=C.find(t=>t.class===e.class)??k.find(t=>t.class===e.class&&Ry(t))??(e=>{const t=[WS()],i=Mo.Any;return{id:XS(Po.Global,"",e),name:Fy[e],class:e,mode:i,conditions:t,minMatches:null,scope:Po.Global,scopeKey:"",summary:HS(i,t,null)}})(e.class),i=w.find(t=>t.class===e.class&&t.scope===e.scope&&t.scopeKey===e.scopeKey);if(i)return g(!1),void b(i.id);const a=(({scope:e,scopeKey:t,source:i,displayName:n})=>{const a=i.conditions.map(e=>({...e,key:zS()})),o=n||t;return{id:XS(e,t,i.class),name:`${Fy[i.class]} · ${o}`,class:i.class,mode:i.mode,conditions:a,minMatches:i.minMatches,scope:e,scopeKey:t,summary:HS(i.mode,a,i.minMatches)}})({scope:e.scope,scopeKey:e.scopeKey,source:{...t,class:e.class},displayName:e.name}),o=await n.upsertLearningPolicy(JS(a));o&&!o.error&&(await c(),g(!1),v(null),b(o.data?YS(o.data).id:a.id))}}):T?t(Nx,{policy:T,onAddOverride:N,onSave:async e=>{if(!n.upsertLearningPolicy)return;const t=await n.upsertLearningPolicy(JS(e));t&&!t.error&&await c()},onDelete:Ry(T)?void 0:()=>(async e=>{if(!n.deleteLearningPolicy)return;const t=await n.deleteLearningPolicy(e.class,e.scope,e.scopeKey);t?.error||(await c(),b(null))})(T)},T.id):t(bt,{$height:"100%",children:t(ee,{size:te.XS,color:ie.Secondary,children:"Select a policy"})})})]}):t(bt,{$height:"100%",children:t(xt,{withSpinner:!0})})})};var Dx,Rx;(e=>{e.Global="global",e.Service="service",e.Transaction="transaction"})(Dx||(Dx={})),(e=>{e.Low="low",e.Medium="medium",e.High="high",e.Critical="critical"})(Rx||(Rx={}));const Lx=e=>e.scope===Dx.Global,Px=f(oe)`
|
|
1515
|
+
flex: 1;
|
|
1516
|
+
min-width: 0;
|
|
1517
|
+
height: 100%;
|
|
1518
|
+
gap: 16px;
|
|
1519
|
+
padding: 16px;
|
|
1520
|
+
overflow: hidden;
|
|
1521
|
+
border-radius: 16px 0 16px 0;
|
|
1522
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1523
|
+
`,Mx=f(oe)`
|
|
1524
|
+
width: 100%;
|
|
1525
|
+
gap: 4px;
|
|
1526
|
+
`,zx=f(ee)`
|
|
1527
|
+
white-space: pre-line;
|
|
1528
|
+
`,Xx=f(oe)`
|
|
1529
|
+
width: 100%;
|
|
1530
|
+
gap: 32px;
|
|
1531
|
+
padding: 12px;
|
|
1532
|
+
border-radius: 16px;
|
|
1533
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1534
|
+
`,_x=f(ne)`
|
|
1535
|
+
width: 100%;
|
|
1536
|
+
align-items: flex-end;
|
|
1537
|
+
justify-content: center;
|
|
1538
|
+
gap: 16px;
|
|
1539
|
+
padding: 0 12px;
|
|
1540
|
+
flex-wrap: wrap;
|
|
1541
|
+
`,Fx=f(oe)`
|
|
1542
|
+
gap: 4px;
|
|
1543
|
+
`,Bx=f(Fx)`
|
|
1544
|
+
width: 319px;
|
|
1545
|
+
max-width: 100%;
|
|
1546
|
+
`,Vx=f(ne)`
|
|
1547
|
+
width: 100%;
|
|
1548
|
+
justify-content: center;
|
|
1549
|
+
`,Ux=f(ke)`
|
|
1550
|
+
min-width: 271px;
|
|
1551
|
+
`,jx=(e,t)=>`${e}/${t}`,Hx=e=>{const t=jx(e.namespace,e.service);return e.operation?`${t} · ${e.operation}`:t},Gx=({services:i,transactions:n,existingScopeKeys:l,onSubmit:s})=>{const c=v(),[d,p]=r(Dx.Service),[u,h]=r(""),[g,m]=r(!1),b=a(()=>{const e=new Set,t=[];for(const n of i){if(!n.namespace||!n.service)continue;const i=jx(n.namespace,n.service);e.has(i)||(e.add(i),t.push({id:i,label:i}))}return t.sort((e,t)=>e.label.localeCompare(t.label))},[i]),f=a(()=>n.filter(e=>!!e.id).map(e=>({id:e.id,label:Hx(e)})).sort((e,t)=>e.label.localeCompare(t.label)),[n]),y=d===Dx.Service?b:f,S=d===Dx.Service?"Select Service":"Select Transaction",x=d===Dx.Service?"Select service…":"Select transaction…";o(()=>{const e=y.find(e=>!l.includes(e.id))?.id||y[0]?.id||"";h(t=>t&&y.some(e=>e.id===t)?t:e)},[y,l]);const C=!!u&&!g;return e(Px,{"data-id":"detection-create-override-panel",children:[e(Mx,{children:[t(ee,{size:te.S,children:"Choose override scope"}),t(zx,{size:te.XXS,color:ie.Secondary,children:"Select where this policy should override the global detection settings.\nYou can apply it to a specific service or transaction."})]}),e(Xx,{children:[e(_x,{children:[e(Fx,{children:[t(ee,{size:te.XS,color:ie.Secondary,children:"Choose Override type"}),t(ve,{"data-id":"detection-override-type",size:Xt.L,selected:d,setSelected:e=>p(e),options:[{value:Dx.Service,label:ty,selectedBgColor:c.v2.colors.purple[500],selectedBorderColor:c.v2.colors.purple[500]},{value:Dx.Transaction,label:iy,selectedBgColor:c.v2.colors.purple[500],selectedBorderColor:c.v2.colors.purple[500]}]})]}),t(Bx,{children:t(vt,{"data-id":"detection-override-target",label:S,options:y,values:u?[u]:[],setValues:e=>h(e[0]||""),placeholder:x,withSearch:!0,disabled:!y.length})})]}),t(Vx,{children:t(Ux,{"data-id":"detection-add-selection",label:"Add selection",rightIcon:Rr,variant:$e.Primary,size:Te.M,disabled:!C,onClick:async()=>{if(!C)return;const e=y.find(e=>e.id===u);m(!0);try{await s({scope:d,scopeKey:u,name:e?.label||u})}finally{m(!1)}}})})]})]})},Kx=[{id:Rx.Low,label:"Low"},{id:Rx.Medium,label:ny},{id:Rx.High,label:ay},{id:Rx.Critical,label:oy}],Wx={[Rx.Low]:20,[Rx.Medium]:40,[Rx.High]:60,[Rx.Critical]:75},Yx={[Rx.Low]:"Low",[Rx.Medium]:ny,[Rx.High]:ay,[Rx.Critical]:oy},qx=e=>{let t=Rx.Medium,i=Number.POSITIVE_INFINITY;for(const[n,a]of Object.entries(Wx)){const o=Math.abs(a-e);o<i&&(t=n,i=o)}return t},Jx=e=>`Triggers at ${Yx[e]} risk or higher`,Zx=e=>{const t=(e=>{switch(e){case Dx.Global:return Dx.Global;case Dx.Transaction:return Dx.Transaction;case Dx.Service:default:return Dx.Service}})(e.scope),i=qx(e.fireAtScore),n=(e=>{if(!e)return 0;try{const t=JSON.parse(e);if(t&&"object"==typeof t&&!Array.isArray(t))return Object.keys(t).length}catch{}return 0})(e.signalWeights);return{id:e.id,name:e.name,scope:t,scopeKey:e.scopeKey,enabled:e.enabled,summary:t===Dx.Global?Jx(i):ry(e.fireAtScore,n),fireAtScore:e.fireAtScore,riskLevel:i,signalWeightOverrideCount:n,signalWeights:e.signalWeights??null,enricherLists:e.enricherLists??null}},Qx=e=>({id:e.id,name:e.name,enabled:e.enabled,fireAtScore:e.fireAtScore,signalWeights:e.signalWeights,enricherLists:e.enricherLists,scope:e.scope,scopeKey:e.scopeKey}),eC=[{id:"global-default",name:"Global default",scope:Dx.Global,scopeKey:"",enabled:!0,summary:"Triggers at Medium risk or higher",fireAtScore:20,riskLevel:Rx.Low,signalWeightOverrideCount:1}],tC=[],iC=f.button`
|
|
1552
|
+
display: flex;
|
|
1553
|
+
align-items: center;
|
|
1554
|
+
justify-content: space-between;
|
|
1555
|
+
gap: 4px;
|
|
1556
|
+
width: 100%;
|
|
1557
|
+
padding: 8px 8px 8px 12px;
|
|
1558
|
+
border: none;
|
|
1559
|
+
border-radius: 8px;
|
|
1560
|
+
background-color: ${({$isSelected:e,theme:t})=>e?t.v2.colors.silver[800]:"transparent"};
|
|
1561
|
+
cursor: pointer;
|
|
1562
|
+
text-align: left;
|
|
1563
|
+
|
|
1564
|
+
&:hover {
|
|
1565
|
+
background-color: ${({theme:e,$isSelected:t})=>t?e.v2.colors.silver[800]:e.v2.colors.silver[900]};
|
|
1566
|
+
}
|
|
1567
|
+
`,nC=f(oe)`
|
|
1568
|
+
flex: 1;
|
|
1569
|
+
min-width: 0;
|
|
1570
|
+
`,aC=f(ne)`
|
|
1571
|
+
flex-wrap: wrap;
|
|
1572
|
+
align-items: center;
|
|
1573
|
+
gap: 4px;
|
|
1574
|
+
`,oC=({policy:i,isSelected:n,onSelect:a})=>{const o=v(),r=(e=>{switch(e){case Dx.Global:return{label:ey,status:Le.Warning};case Dx.Service:return{label:ty,status:Le.Info};case Dx.Transaction:return{label:iy,status:Le.Info}}})(i.scope);return e(iC,{type:"button","data-id":`detection-policy-item-${i.id}`,$isSelected:n,onClick:()=>a(i.id),children:[e(nC,{$gap:4,children:[e(aC,{children:[t(ee,{size:te.XXS,nowrap:!0,children:i.name}),t(ce,{label:r.label,status:r.status,invertColors:!0}),t(ce,{label:i.enabled?dt:pt,status:i.enabled?Le.Success:Le.Error,invertColors:!0,backgroundColor:o.v2.colors.silver[750],textColor:i.enabled?o.v2.colors.green[400]:o.v2.colors.red[400]})]}),t(ee,{size:te.XXXS,color:ie.Secondary,nowrap:!0,children:i.summary})]}),t(Ar,{size:18})]})},rC=f(oe)`
|
|
1575
|
+
width: 320px;
|
|
1576
|
+
flex-shrink: 0;
|
|
1577
|
+
height: 100%;
|
|
1578
|
+
gap: 16px;
|
|
1579
|
+
padding: 8px 12px 12px 12px;
|
|
1580
|
+
overflow-y: auto;
|
|
1581
|
+
`,lC=f(oe)`
|
|
1582
|
+
width: 100%;
|
|
1583
|
+
gap: 8px;
|
|
1584
|
+
`,sC=f(ne)`
|
|
1585
|
+
width: 100%;
|
|
1586
|
+
align-items: center;
|
|
1587
|
+
gap: 4px;
|
|
1588
|
+
padding: 8px 12px 4px 8px;
|
|
1589
|
+
`,cC=f(oe)`
|
|
1590
|
+
width: 100%;
|
|
1591
|
+
min-height: 60px;
|
|
1592
|
+
align-items: stretch;
|
|
1593
|
+
justify-content: center;
|
|
1594
|
+
gap: 2px;
|
|
1595
|
+
padding: 12px 8px;
|
|
1596
|
+
border-radius: 12px;
|
|
1597
|
+
text-align: center;
|
|
1598
|
+
`,dC=f(ke)`
|
|
1599
|
+
&&:enabled {
|
|
1600
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[900]};
|
|
1601
|
+
|
|
1602
|
+
&:hover {
|
|
1603
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[800]};
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
&:active {
|
|
1607
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[700]};
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
`,pC=({defaultPolicies:i,overridePolicies:n,selectedId:a,onSelect:o,onAddOverride:r})=>{const l=v();return e(rC,{"data-id":"detection-policies-menu",children:[e(lC,{children:[e(sC,{children:[t(ee,{size:te.XXS,color:l.v2.colors.purple[300],children:"Default Policy"}),t(ce,{label:i.length})]}),i.map(e=>t(oC,{policy:e,isSelected:a===e.id,onSelect:o},e.id))]}),e(lC,{children:[e(sC,{children:[t(ee,{size:te.XXS,color:l.v2.colors.purple[300],children:"Overrides"}),t(ce,{label:n.length})]}),0===n.length?e(cC,{children:[t(ee,{size:te.XXS,color:ie.Secondary,align:"center",children:"No overrides yet"}),t(ee,{size:te.XXXS,color:ie.Disable,align:"center",children:"Add overrides to adjust detection sensitivity for specific services."})]}):n.map(e=>t(oC,{policy:e,isSelected:a===e.id,onSelect:o},e.id)),t(dC,{"data-id":"detection-add-override-policy",label:"Add override policy",rightIcon:Rr,variant:$e.Primary,size:Te.M,fullWidth:!0,textColor:l.v2.colors.purple[300],onClick:r})]})]})},uC=[{severity:Io.Critical,minScore:75},{severity:Io.High,minScore:50},{severity:Io.Medium,minScore:35},{severity:Io.Low,minScore:20},{severity:Io.Info,minScore:0}],hC={[Io.Info]:"Info",[Io.Low]:"Low",[Io.Medium]:"Medium",[Io.High]:"High",[Io.Critical]:"Critical"},gC=(e,t=uC)=>{const i=[...t].sort((e,t)=>t.minScore-e.minScore);for(const t of i)if(e>=t.minScore)return t.severity;return Io.Info},mC=e=>e.join(", "),bC=e=>e.split(/[\n,]+/).map(e=>e.trim()).filter(Boolean),fC=(e,t)=>e.length===t.length&&e.every((e,i)=>e===t[i]),vC=(e,t)=>e.enrichers.filter(e=>e.parentClass===t),yC=e=>{const t=Object.values(Lo);return[...e.deviationClasses].sort((e,i)=>{const n=t.indexOf(e.id),a=t.indexOf(i.id);return-1===n&&-1===a?e.id.localeCompare(i.id):-1===n?1:-1===a?-1:n-a})},SC=f(oe)`
|
|
1611
|
+
width: 100%;
|
|
1612
|
+
gap: 12px;
|
|
1613
|
+
padding: 0 4px 8px 4px;
|
|
1614
|
+
`,xC=f(ee)`
|
|
1615
|
+
white-space: pre-line;
|
|
1616
|
+
`,CC=f(oe)`
|
|
1617
|
+
width: 100%;
|
|
1618
|
+
gap: 12px;
|
|
1619
|
+
padding: 12px;
|
|
1620
|
+
border-radius: 12px;
|
|
1621
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1622
|
+
`,wC=f(ne)`
|
|
1623
|
+
width: 100%;
|
|
1624
|
+
align-items: center;
|
|
1625
|
+
gap: 8px;
|
|
1626
|
+
flex-wrap: wrap;
|
|
1627
|
+
`,kC=f(ne)`
|
|
1628
|
+
width: 100%;
|
|
1629
|
+
align-items: center;
|
|
1630
|
+
gap: 8px;
|
|
1631
|
+
flex-wrap: wrap;
|
|
1632
|
+
`,TC=f(ne)`
|
|
1633
|
+
align-items: center;
|
|
1634
|
+
gap: 8px;
|
|
1635
|
+
`,$C=f(oe)`
|
|
1636
|
+
width: 100%;
|
|
1637
|
+
gap: 16px;
|
|
1638
|
+
padding: 8px 12px;
|
|
1639
|
+
border-radius: 8px;
|
|
1640
|
+
border-left: 2px solid ${({theme:e})=>e.v2.colors.purple[400]};
|
|
1641
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1642
|
+
`,IC=f(oe)`
|
|
1643
|
+
width: 100%;
|
|
1644
|
+
gap: 8px;
|
|
1645
|
+
padding: 8px 12px;
|
|
1646
|
+
border-radius: 12px;
|
|
1647
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1648
|
+
`,NC=f(ne)`
|
|
1649
|
+
align-items: center;
|
|
1650
|
+
gap: 8px;
|
|
1651
|
+
`,OC=({label:i,source:n,value:a,tooltip:o,onChange:r})=>{const l=v(),s=gC(a),c=((e,t)=>{switch(e){case Io.Info:return{backgroundColor:t.v2.colors.blue[900],textColor:t.v2.colors.white[500]};case Io.Low:return{backgroundColor:t.v2.colors.green[900],textColor:t.v2.colors.white[500]};case Io.Medium:return{backgroundColor:t.v2.colors.yellow[550],textColor:t.v2.colors.black[500]};case Io.High:return{backgroundColor:t.v2.colors.orange[500],textColor:t.v2.colors.white[500]};case Io.Critical:return{backgroundColor:t.v2.colors.red[800],textColor:t.v2.colors.white[500]}}})(s,l);return e(kC,{children:[e(NC,{children:[t(ee,{size:te.XS,children:i}),o?t(Be,{text:o,withIcon:!0}):null]}),t(Ie,{"data-id":`detection-weight-${n}`,type:_t.Number,value:String(a),onChange:e=>{const t=Number(e.target.value);Number.isFinite(t)&&r(n,Math.max(0,Math.min(100,Math.round(t))))},width:"79px",small:!0,min:0,max:100}),e(TC,{children:[e(ee,{size:te.XXXS,color:ie.Secondary,children:["Risk points"," ",a]}),t(ce,{label:hC[s],backgroundColor:c.backgroundColor,textColor:c.textColor})]})]})},AC=({enricher:n,weight:a,listText:o,onWeightChange:r,onListChange:l})=>e(IC,{children:[t(OC,{label:n.label,source:n.source,value:a,tooltip:n.description,onChange:r}),n.list?e(i,{children:[t(De,{"data-id":`detection-list-${n.list.key}`,label:n.list.label,value:o,onChange:e=>l(n.list.key,e.target.value),minHeight:64}),n.list.hint?t(ee,{size:te.XXXS,color:ie.Secondary,children:n.list.hint}):null]}):null]}),EC=({catalog:i,signalWeights:n,enricherLists:o,onChange:l})=>{const s=v(),c=a(()=>yC(i),[i]),[d,p]=r(()=>((e,t)=>{const i=(e=>{if(!e)return{};try{const t=JSON.parse(e);if(!t||"object"!=typeof t||Array.isArray(t))return{};const i={};for(const[e,n]of Object.entries(t)){const t="number"==typeof n?n:Number(n);Number.isFinite(t)&&(i[e]=Math.max(0,Math.min(100,Math.round(t))))}return i}catch{return{}}})(t),n={};for(const t of e.deviationClasses)n[t.id]=i[t.id]??t.weight;for(const t of e.enrichers)n[t.source]=i[t.source]??t.weight;return n})(i,n)),[u,h]=r(()=>{const e=((e,t)=>{const i=(e=>{if(!e)return{};try{const t=JSON.parse(e);if(!t||"object"!=typeof t||Array.isArray(t))return{};const i={};for(const[e,n]of Object.entries(t))Array.isArray(n)&&(i[e]=n.map(String).map(e=>e.trim()).filter(Boolean));return i}catch{return{}}})(t),n={};for(const t of e.enrichers)t.list&&(n[t.list.key]=i[t.list.key]??t.list.default??[]);return n})(i,o);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,mC(t)]))}),g=(e,t)=>{const n=Object.fromEntries(Object.entries(t).map(([e,t])=>[e,bC(t)])),a=((e,t)=>{const i={};for(const n of e.deviationClasses){const e=t[n.id];void 0!==e&&e!==n.weight&&(i[n.id]=e)}for(const n of e.enrichers){const e=t[n.source];void 0!==e&&e!==n.weight&&(i[n.source]=e)}return Object.keys(i).length?JSON.stringify(i):null})(i,e),o=((e,t)=>{const i={};for(const n of e.enrichers){if(!n.list)continue;const e=n.list.key,a=t[e]??n.list.default??[],o=n.list.default??[];fC(a,o)||(i[e]=a)}return Object.keys(i).length?JSON.stringify(i):null})(i,n);l({signalWeights:a,enricherLists:o,overrideCount:a?Object.keys(JSON.parse(a)).length:0})},m=(e,t)=>{const i={...d,[e]:t};p(i),g(i,u)},b=(e,t)=>{const i={...u,[e]:t};h(i),g(d,i)};return e(SC,{"data-id":"detection-signal-weights-panel",children:[t(xC,{size:te.XXXS,color:ie.Secondary,children:"Every detected signal adds its weight (points) to a 0–100 risk score; the policy fires when the total reaches the threshold above. Sub-cases add on top of the base. Set any weight to 0 to mute that signal for this scope."}),c.map(n=>{const a=vC(i,n.id);return e(CC,{"data-id":`detection-signal-card-${n.id}`,children:[e(oe,{$gap:4,children:[e(wC,{children:[t(ee,{size:te.XS,children:n.label}),t(ee,{size:te.XXXS,color:ie.Secondary,children:n.id}),t(ce,{label:n.categoryLabel||n.category,backgroundColor:s.v2.colors.silver[750]})]}),n.description?t(ee,{size:te.XXXS,color:ie.Secondary,children:n.description}):null]}),t(OC,{label:"Base weight",source:n.id,value:d[n.id]??n.weight,onChange:m}),a.length>0?e($C,{children:[t(ee,{size:te.XXXS,color:s.v2.colors.purple[300],children:"Dangerous sub-cases - added on top of the base when detected:"}),a.map(e=>t(AC,{enricher:e,weight:d[e.source]??e.weight,listText:u[e.list?.key||""]??mC(e.list?.default??[]),onWeightChange:m,onListChange:b},e.source))]}):null]},n.id)})]})},DC=e=>`A trace whose signals span two or more kill-chain categories gets a +${e} correlation bonus on top of the summed weights — coordinated behavior across stages is riskier than any single novelty on its own.`,RC=(e,t)=>{const i=gC(e.weight,t);return{id:e.id,signal:e.label,source:e.id,weight:e.weight,weightLabel:String(e.weight),band:i,bandLabel:hC[i],category:e.categoryLabel||e.category,description:e.description||"",isSubCase:!1}},LC=(e,t,i)=>{const n=Math.min(100,t+e.weight),a=gC(n,i);return{id:e.source,signal:e.label,source:e.source,weight:e.weight,weightLabel:`${t} + ${e.weight} = ${n}`,band:a,bandLabel:hC[a],category:"",description:e.description||"",isSubCase:!0}},PC=f(oe)`
|
|
1652
|
+
width: 100%;
|
|
1653
|
+
gap: 24px;
|
|
1654
|
+
padding: 0 2px 24px;
|
|
1655
|
+
`,MC=f(ee)`
|
|
1656
|
+
max-width: 820px;
|
|
1657
|
+
line-height: 1.45;
|
|
1658
|
+
`,zC=f(ne)`
|
|
1659
|
+
flex-wrap: wrap;
|
|
1660
|
+
align-items: center;
|
|
1661
|
+
gap: 6px;
|
|
1662
|
+
`,XC=f(oe)`
|
|
1663
|
+
width: 100%;
|
|
1664
|
+
gap: 10px;
|
|
1665
|
+
padding: 14px 16px;
|
|
1666
|
+
border-radius: 10px;
|
|
1667
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1668
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1669
|
+
`,_C=f.div`
|
|
1670
|
+
width: fit-content;
|
|
1671
|
+
max-width: 100%;
|
|
1672
|
+
padding: 8px 10px;
|
|
1673
|
+
border-radius: 6px;
|
|
1674
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1675
|
+
color: ${({theme:e})=>e.v2.colors.silver[100]};
|
|
1676
|
+
font-family: ${({theme:e})=>e.font_family.primary};
|
|
1677
|
+
font-size: 12px;
|
|
1678
|
+
font-weight: 500;
|
|
1679
|
+
line-height: 1.4;
|
|
1680
|
+
`,FC=f(oe)`
|
|
1681
|
+
gap: 3px;
|
|
1682
|
+
`,BC=f(ne)`
|
|
1683
|
+
align-items: center;
|
|
1684
|
+
flex-wrap: wrap;
|
|
1685
|
+
gap: 6px;
|
|
1686
|
+
font-variant-numeric: tabular-nums;
|
|
1687
|
+
`,VC=f.div`
|
|
1688
|
+
width: 100%;
|
|
1689
|
+
overflow: auto;
|
|
1690
|
+
max-height: calc(100vh - 280px);
|
|
1691
|
+
border-radius: 10px;
|
|
1692
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1693
|
+
`,UC=f.table`
|
|
1694
|
+
width: 100%;
|
|
1695
|
+
min-width: 760px;
|
|
1696
|
+
border-collapse: collapse;
|
|
1697
|
+
table-layout: fixed;
|
|
1698
|
+
`,jC=f.th`
|
|
1699
|
+
position: sticky;
|
|
1700
|
+
top: 0;
|
|
1701
|
+
z-index: 1;
|
|
1702
|
+
padding: 12px 14px;
|
|
1703
|
+
text-align: left;
|
|
1704
|
+
vertical-align: middle;
|
|
1705
|
+
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1706
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1707
|
+
white-space: nowrap;
|
|
1708
|
+
`,HC=f.tr`
|
|
1709
|
+
background-color: ${({theme:e,$sub:t})=>t?e.v2.colors.silver[1e3]:"transparent"};
|
|
1710
|
+
transition: background-color 0.12s ease;
|
|
1711
|
+
|
|
1712
|
+
&:hover {
|
|
1713
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1714
|
+
}
|
|
1715
|
+
`,GC=f.td`
|
|
1716
|
+
padding: 14px;
|
|
1717
|
+
vertical-align: middle;
|
|
1718
|
+
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1719
|
+
word-break: break-word;
|
|
1720
|
+
|
|
1721
|
+
tr:last-child > & {
|
|
1722
|
+
border-bottom: none;
|
|
1723
|
+
}
|
|
1724
|
+
`,KC=f(GC)`
|
|
1725
|
+
padding-left: ${({$sub:e})=>e?"32px":"14px"};
|
|
1726
|
+
position: relative;
|
|
1727
|
+
|
|
1728
|
+
${({$sub:e,theme:t})=>e&&`\n &::before {\n content: '•';\n position: absolute;\n left: 18px;\n top: 50%;\n transform: translateY(-50%);\n line-height: 1;\n color: ${t.v2.colors.silver[300]};\n }\n `}
|
|
1729
|
+
`,WC=f.code`
|
|
1730
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
|
|
1731
|
+
font-size: 10.5px;
|
|
1732
|
+
line-height: 1.35;
|
|
1733
|
+
color: ${({theme:e})=>e.v2.colors.silver[200]};
|
|
1734
|
+
`,YC=f(ee)`
|
|
1735
|
+
font-variant-numeric: tabular-nums;
|
|
1736
|
+
white-space: nowrap;
|
|
1737
|
+
`,qC=f(oe)`
|
|
1738
|
+
width: 100%;
|
|
1739
|
+
gap: 6px;
|
|
1740
|
+
padding: 14px 16px;
|
|
1741
|
+
border-radius: 10px;
|
|
1742
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1743
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1744
|
+
`,JC=(e,t)=>{switch(e){case Io.Info:return{backgroundColor:t.v2.colors.blue[900],textColor:t.v2.colors.white[500]};case Io.Low:return{backgroundColor:t.v2.colors.green[900],textColor:t.v2.colors.white[500]};case Io.Medium:return{backgroundColor:t.v2.colors.yellow[550],textColor:t.v2.colors.black[500]};case Io.High:return{backgroundColor:t.v2.colors.orange[500],textColor:t.v2.colors.white[500]};case Io.Critical:return{backgroundColor:t.v2.colors.red[800],textColor:t.v2.colors.white[500]}}},ZC=({isOpen:i,onClose:n,catalog:a})=>{const o=v(),r=(e=>{const t=e.severityBands?.length?e.severityBands:void 0,i=[];for(const n of yC(e)){i.push(RC(n,t));for(const a of vC(e,n.id))i.push(LC(a,n.weight,t))}return i})(a),l=(e=>{const t=e.severityBands?.length?e.severityBands:void 0,i=[...e.enrichers].sort((e,t)=>t.weight-e.weight)[0],n=i?e.deviationClasses.find(e=>e.id===i.parentClass):void 0;if(!n||!i)return null;const a=Math.min(100,n.weight+i.weight),o=gC(a,t);return{baseLabel:n.label,baseScore:n.weight,modifierLabel:i.label,modifierWeight:i.weight,finalScore:a,finalBand:o,finalBandLabel:hC[o]}})(a),s=(e=>[...e.severityBands?.length?e.severityBands:[]].filter(e=>e.severity!==Io.Info).sort((e,t)=>e.minScore-t.minScore).map(e=>({severity:e.severity,label:hC[e.severity],minScore:e.minScore})))(a),c=a.correlationBonus??15,d=l?JC(l.finalBand,o):null;return t(Ft,{isOpen:i,width:"960px",minWidth:"720px",header:{icon:zl,title:"Risk model",onClose:n},children:e(PC,{"data-id":"insights-risk-model-drawer",children:[e(oe,{$gap:6,children:[t(MC,{size:te.XXXS,color:ie.Secondary,children:"The default risk model every anomaly policy builds on. Each signal adds its weight (points) to a 0–100 risk score; dangerous sub-cases add on top of a class’s base novelty. Read-only reference — tune the weights per scope in this Detection policy."}),s.length?e(zC,{children:[t(ee,{size:te.XXXS,color:ie.Secondary,children:"A signal alone lands at"}),s.map(e=>{const i=JC(e.severity,o);return t(ce,{label:`${e.label.toLowerCase()} ${e.minScore}`,backgroundColor:i.backgroundColor,textColor:i.textColor},e.label)})]}):null]}),e(XC,{children:[t(ee,{size:te.XXS,children:"How scoring works"}),t(_C,{children:"Base signal + modifiers + cross-category bonus = final risk score"}),e(FC,{children:[t(ee,{size:te.XXXS,color:ie.Secondary,children:"Modifiers are not independent signals. They are added only when their parent base signal occurs."}),t(ee,{size:te.XXXS,color:ie.Secondary,children:(p=c,`Signals spanning two or more kill-chain categories receive a +${p} correlation bonus. The final risk score is capped at 100.`)})]}),l&&d?e(BC,{children:[t(ee,{size:te.XXXS,children:`${l.baseLabel} ${l.baseScore}`}),t(ee,{size:te.XXXS,color:ie.Secondary,children:"+"}),t(ee,{size:te.XXXS,children:`${l.modifierLabel} ${l.modifierWeight}`}),t(ee,{size:te.XXXS,color:ie.Secondary,children:"="}),t(ce,{label:`${l.finalScore} · ${l.finalBandLabel}`,backgroundColor:d.backgroundColor,textColor:d.textColor})]}):null]}),t(VC,{children:e(UC,{children:[t("thead",{children:e("tr",{children:[t(jC,{style:{width:"17%"},children:t(ee,{size:te.XXXS,color:ie.Secondary,children:"Signal"})}),t(jC,{style:{width:"15%"},children:t(ee,{size:te.XXXS,color:ie.Secondary,children:"Class / source"})}),t(jC,{style:{width:"13%"},children:t(ee,{size:te.XXXS,color:ie.Secondary,children:"Weight"})}),t(jC,{style:{width:"9%"},children:t(ee,{size:te.XXXS,color:ie.Secondary,children:"Band"})}),t(jC,{style:{width:"13%"},children:t(ee,{size:te.XXXS,color:ie.Secondary,children:"Category"})}),t(jC,{style:{width:"33%"},children:t(ee,{size:te.XXXS,color:ie.Secondary,children:"What it means"})})]})}),t("tbody",{children:r.map(i=>{const n=JC(i.band,o);return e(HC,{"data-id":`risk-model-row-${i.id}`,$sub:i.isSubCase,children:[t(KC,{$sub:i.isSubCase,children:t(ee,{size:te.XXXS,children:i.isSubCase?i.signal:t("strong",{children:i.signal})})}),t(GC,{children:t(WC,{children:i.source})}),t(GC,{children:t(YC,{size:te.XXXS,children:i.weightLabel})}),t(GC,{children:t(ce,{label:i.bandLabel.toLowerCase(),backgroundColor:n.backgroundColor,textColor:n.textColor})}),t(GC,{children:t(ee,{size:te.XXXS,color:ie.Secondary,children:i.isSubCase?"Modifier":i.category})}),t(GC,{children:t(ee,{size:te.XXXS,color:ie.Secondary,children:i.description})})]},i.id)})})]})}),e(qC,{children:[t(ee,{size:te.XXS,children:"Cross-class correlation"}),t(ee,{size:te.XXXS,color:ie.Secondary,children:DC(c)})]})]})});var p},QC={deviationClasses:[{id:Lo.D1_call_edges,label:"New call edge",description:"A service→service call path not seen during learning.",category:"lateral_movement",categoryLabel:"Lateral movement",weight:20,mitre:"TA0008",owasp:null},{id:Lo.D2_egress,label:"New egress destination",description:"An outbound destination (host/port) not seen during learning.",category:"exfiltration",categoryLabel:"Exfiltration",weight:35,mitre:"TA0010",owasp:null},{id:Lo.D3_latency,label:"Latency above baseline",description:"Request latency well above the learned p99.",category:"resource_abuse",categoryLabel:"Resource abuse",weight:10,mitre:"T1499",owasp:null},{id:Lo.D4_args_returns,label:"Argument / return anomaly",description:"Arguments or return values outside the learned shape.",category:"injection",categoryLabel:"Injection",weight:40,mitre:"T1190",owasp:"A03"},{id:Lo.D5_libraries,label:"New instrumentation library",description:"An instrumentation library/runtime not seen during learning.",category:"supply_chain",categoryLabel:"Supply chain",weight:30,mitre:"T1195",owasp:"A06"},{id:Lo.D6_attr_relations,label:"Attribute-relation anomaly",description:"Span attribute relationships outside the learned pattern.",category:"access_anomaly",categoryLabel:"Access anomaly",weight:35,mitre:"TA0004",owasp:"A01"},{id:Lo.D7_db_access,label:"New database access",description:"A database table/operation not accessed during learning.",category:"lateral_movement",categoryLabel:"Lateral movement",weight:25,mitre:"TA0008",owasp:null},{id:Lo.D8_payload_size,label:"Payload size above baseline",description:"Request/response payload larger than the learned baseline.",category:"resource_abuse",categoryLabel:"Resource abuse",weight:20,mitre:"T1499",owasp:null}],enrichers:[{source:"d1_edge_fanout",parentClass:Lo.D1_call_edges,category:"lateral_movement",weight:30,label:"Call fan-out",description:"One request reached many new services at once — possible lateral movement / enumeration."},{source:"d2_metadata_endpoint",parentClass:Lo.D2_egress,category:"exfiltration",weight:50,label:"Cloud metadata endpoint",description:"New egress to a cloud metadata address (e.g. 169.254.169.254) — a hallmark of SSRF / credential theft.",list:{key:"metadata_endpoints",label:"Cloud metadata addresses",hint:"Comma- or newline-separated hosts/IPs. A new egress to any of these is flagged.",default:["169.254.169.254","fd00:ec2::254","metadata.google.internal","100.100.100.200"]}},{source:"d2_dangerous_port",parentClass:Lo.D2_egress,category:"exfiltration",weight:45,label:"Suspicious egress port",description:"New egress on a port commonly used by reverse shells, C2, or tunneling (e.g. 4444, 1337).",list:{key:"dangerous_ports",label:"Suspicious ports",hint:"Comma- or newline-separated port numbers. New egress to any of these is flagged.",default:["23","1080","1337","2323","4444","6667","6697","9050","12345","31337"]}},{source:"d7_destructive_op",parentClass:Lo.D7_db_access,category:"impact",weight:45,label:"Destructive operation",description:"New DELETE/DROP/TRUNCATE/ALTER/UPDATE not seen during learning."},{source:"d7_sensitive_table",parentClass:Lo.D7_db_access,category:"exfiltration",weight:30,label:"Sensitive table access",description:"New access to a table whose name looks sensitive (credentials, payment, token…).",list:{key:"sensitive_tables",label:"Sensitive keywords",hint:"Comma- or newline-separated substrings. A newly-accessed table whose name contains any of these is flagged.",default:["credential","password","passwd","secret","token","apikey","api_key","payment","card","ssn","account","auth","session","admins","users"]}},{source:"d7_injection_shape",parentClass:Lo.D7_db_access,category:"injection",weight:35,label:"Multi-table / join shape",description:"A new query joining several tables — a classic injection / data-harvesting shape."},{source:"d7_schema_recon",parentClass:Lo.D7_db_access,category:"injection",weight:30,label:"Database schema recon",description:"New access to a DB system-catalog / metadata table (e.g. information_schema) — classic SQL-injection enumeration.",list:{key:"schema_catalog_tables",label:"Schema-catalog tables",hint:"Comma- or newline-separated names/substrings. A newly-accessed table matching any is flagged as schema reconnaissance.",default:["information_schema","pg_catalog","pg_class","pg_tables","pg_attribute","pg_shadow","pg_user","mysql.user","mysql.db","sqlite_master","sys.tables","sys.columns","sys.databases","all_tables","dba_tables","user_tables"]}},{source:"d8_response_exfil",parentClass:Lo.D8_payload_size,category:"exfiltration",weight:40,label:"Oversized response (bulk data)",description:"Response body far larger than the learned baseline — possible bulk data extraction."}],categories:[{id:"impact",label:"Impact",base:45,mitre:"TA0040",owasp:null},{id:"injection",label:"Injection",base:40,mitre:"T1190",owasp:"A03"},{id:"exfiltration",label:"Exfiltration",base:35,mitre:"TA0010",owasp:null},{id:"access_anomaly",label:"Access anomaly",base:35,mitre:"TA0004",owasp:"A01"},{id:"supply_chain",label:"Supply chain",base:30,mitre:"T1195",owasp:"A06"},{id:"lateral_movement",label:"Lateral movement",base:25,mitre:"TA0008",owasp:null},{id:"recon",label:"Recon",base:15,mitre:"TA0043",owasp:null},{id:"resource_abuse",label:"Resource abuse",base:10,mitre:"T1499",owasp:null}],guardrailRules:[{key:"allowed_callers",label:"Allowed callers",description:"Restrict which services may call this service",category:"lateral_movement",weight:25,hint:"namespace/service"}],severityBands:[{severity:Io.Info,minScore:0},{severity:Io.Low,minScore:20},{severity:Io.Medium,minScore:35},{severity:Io.High,minScore:50},{severity:Io.Critical,minScore:75}],correlationBonus:15,tags:JSON.stringify({T1190:"Exploit Public-Facing Application",T1195:"Supply Chain Compromise",T1499:"Endpoint Denial of Service",TA0004:"Privilege Escalation (tactic)",TA0008:"Lateral Movement (tactic)",TA0010:"Exfiltration (tactic)",TA0040:"Impact (tactic)",TA0043:"Reconnaissance (tactic)",A01:"Broken Access Control",A03:"Injection",A06:"Vulnerable and Outdated Components"})},ew=f(oe)`
|
|
1745
|
+
flex: 1;
|
|
1746
|
+
min-width: 0;
|
|
1747
|
+
height: 100%;
|
|
1748
|
+
gap: 24px;
|
|
1749
|
+
padding: 8px 16px 16px 16px;
|
|
1750
|
+
overflow: hidden;
|
|
1751
|
+
border-radius: 16px 0 16px 0;
|
|
1752
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1753
|
+
`,tw=f(oe)`
|
|
1754
|
+
flex: 1;
|
|
1755
|
+
min-height: 0;
|
|
1756
|
+
width: 100%;
|
|
1757
|
+
gap: 12px;
|
|
1758
|
+
overflow-y: auto;
|
|
1759
|
+
`,iw=f(oe)`
|
|
1760
|
+
width: 100%;
|
|
1761
|
+
gap: 4px;
|
|
1762
|
+
padding: 12px;
|
|
1763
|
+
`,nw=f(ne)`
|
|
1764
|
+
width: 100%;
|
|
1765
|
+
align-items: center;
|
|
1766
|
+
gap: 4px;
|
|
1767
|
+
`,aw=f(ne)`
|
|
1768
|
+
flex: 1;
|
|
1769
|
+
justify-content: flex-end;
|
|
1770
|
+
`,ow=f(ne)`
|
|
1771
|
+
width: 100%;
|
|
1772
|
+
align-items: center;
|
|
1773
|
+
gap: 16px;
|
|
1774
|
+
padding: 8px 16px;
|
|
1775
|
+
flex-wrap: wrap;
|
|
1776
|
+
`,rw=f(ne)`
|
|
1777
|
+
align-items: center;
|
|
1778
|
+
gap: 8px;
|
|
1779
|
+
flex-shrink: 0;
|
|
1780
|
+
`,lw=f.button`
|
|
1781
|
+
display: flex;
|
|
1782
|
+
align-items: center;
|
|
1783
|
+
gap: 8px;
|
|
1784
|
+
height: 32px;
|
|
1785
|
+
padding: 0 12px;
|
|
1786
|
+
border-radius: 6px;
|
|
1787
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
1788
|
+
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
1789
|
+
cursor: pointer;
|
|
1790
|
+
|
|
1791
|
+
&:hover {
|
|
1792
|
+
border-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
1793
|
+
}
|
|
1794
|
+
`,sw=f(oe)`
|
|
1795
|
+
width: 100%;
|
|
1796
|
+
gap: 8px;
|
|
1797
|
+
`,cw=f.button`
|
|
1798
|
+
display: flex;
|
|
1799
|
+
align-items: center;
|
|
1800
|
+
gap: 4px;
|
|
1801
|
+
width: 100%;
|
|
1802
|
+
height: 42px;
|
|
1803
|
+
padding: 12px;
|
|
1804
|
+
border: none;
|
|
1805
|
+
border-radius: 12px;
|
|
1806
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1807
|
+
cursor: pointer;
|
|
1808
|
+
text-align: left;
|
|
1809
|
+
`,dw=f.span`
|
|
1810
|
+
display: inline-flex;
|
|
1811
|
+
transform: rotate(${({$open:e})=>e?90:0}deg);
|
|
1812
|
+
transition: transform 0.15s ease;
|
|
1813
|
+
`,pw=f(ne)`
|
|
1814
|
+
flex-shrink: 0;
|
|
1815
|
+
width: 100%;
|
|
1816
|
+
justify-content: center;
|
|
1817
|
+
`,uw=f(ne)`
|
|
1818
|
+
gap: 24px;
|
|
1819
|
+
align-items: center;
|
|
1820
|
+
padding: 8px;
|
|
1821
|
+
border-radius: 8px;
|
|
1822
|
+
background-color: ${({theme:e})=>e.v2.colors.black[500]+ae["095"]};
|
|
1823
|
+
box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
|
|
1824
|
+
`,hw=f(ke)`
|
|
1825
|
+
min-width: 160px;
|
|
1826
|
+
`,gw=({policy:i,onAddOverride:n,onSave:l})=>{const s=v(),{insightsApi:c}=ws(),d=c.useCatalog(),p=d.data?.deviationClasses?.length?d.data:QC,[u,h]=r(i),[g,m]=r(!1),[b,f]=r(!1),[y,S]=r(!1);o(()=>{h(i),m(!1)},[i]);const x=a(()=>Kx.find(e=>e.id===u.riskLevel),[u.riskLevel]),C=((e,t)=>{switch(e){case Rx.Low:return{backgroundColor:t.v2.colors.green[900],textColor:t.v2.colors.white[500]};case Rx.Medium:return{backgroundColor:t.v2.colors.yellow[1e3],textColor:t.v2.colors.yellow[500]};case Rx.High:return{backgroundColor:t.v2.colors.orange[500],textColor:t.v2.colors.white[500]};case Rx.Critical:return{backgroundColor:t.v2.colors.red[800],textColor:t.v2.colors.white[500]}}})(u.riskLevel,s);return e(ew,{"data-id":`detection-policy-editor-${i.id}`,children:[e(tw,{children:[e(iw,{children:[e(nw,{children:[t(ee,{size:te.XS,nowrap:!0,children:u.name}),Lx(u)&&t(ce,{label:ey,status:Le.Warning,invertColors:!0}),t(aw,{children:t(ke,{"data-id":"detection-view-risk-model",label:"View risk model",leftIcon:Pr,variant:$e.Text,size:Te.S,onClick:()=>f(!0)})})]}),t(ee,{size:te.XXXS,color:ie.Secondary,children:ry(u.fireAtScore,u.signalWeightOverrideCount)}),e(ow,{children:[e(rw,{children:[t(ee,{size:te.XS,children:"Name"}),t(Ie,{value:u.name,onChange:e=>h(t=>({...t,name:e.target.value})),width:"205px",small:!0})]}),e(rw,{children:[t(ee,{size:te.XS,children:"Trigger when risk level is"}),t(jn,{items:[...Kx],selectedIds:[u.riskLevel],setSelectedIds:e=>{const t=e[0]||u.riskLevel;h(e=>({...e,riskLevel:t,fireAtScore:Wx[t],summary:Lx(e)?e.summary:ry(Wx[t],e.signalWeightOverrideCount)}))},alignX:Gn.Left,children:({ChevronIcon:i,handleClick:n})=>e(lw,{type:"button",onClick:n,"data-id":"detection-policy-risk-level",children:[t(ce,{label:x?.label||u.riskLevel,backgroundColor:C.backgroundColor,textColor:C.textColor}),t(i,{size:18})]})})]})]})]}),e(sw,{children:[e(cw,{type:"button",onClick:e=>{e.preventDefault(),m(e=>!e)},"data-id":"detection-policy-advanced-toggle",children:[t(dw,{$open:g,children:t(Ar,{size:18})}),t(ee,{size:te.XXS,children:"Customize signal weights (advanced)"})]}),g?t(EC,{catalog:p,signalWeights:u.signalWeights,enricherLists:u.enricherLists,onChange:e=>{h(t=>({...t,signalWeights:e.signalWeights,enricherLists:e.enricherLists,signalWeightOverrideCount:e.overrideCount,summary:Lx(t)?t.summary:ry(t.fireAtScore,e.overrideCount)}))}},i.id):null]})]}),t(pw,{children:e(uw,{children:[t(hw,{"data-id":"detection-policy-add-override",label:"Add override",rightIcon:Rr,variant:$e.Secondary,size:Te.M,onClick:n}),t(hw,{"data-id":"detection-policy-save",label:"Save Changes",variant:$e.Primary,size:Te.M,onClick:async()=>{S(!0);try{await l(u)}finally{S(!1)}},disabled:y})]})}),t(ZC,{isOpen:b,onClose:()=>f(!1),catalog:p})]})},mw=f(ne)`
|
|
1827
|
+
flex: 1;
|
|
1828
|
+
min-height: 0;
|
|
1829
|
+
width: 100%;
|
|
1830
|
+
align-items: stretch;
|
|
1831
|
+
`,bw=f.div`
|
|
1832
|
+
flex: 1;
|
|
1833
|
+
min-width: 0;
|
|
1834
|
+
height: 100%;
|
|
1835
|
+
overflow: hidden;
|
|
1836
|
+
`,fw=()=>{const i=Yy(Gy.Detection),{insightsApi:n}=ws(),{data:l,loading:s,unsupported:c,refetch:d}=n.usePolicies(),p=n.useServices(),u=n.useTransactions(),h=Array.isArray(l)?l:[],[g,m]=r(eC),[b,f]=r(tC),[v,y]=r(!1),[S,x]=r(null),C=a(()=>h.map(Zx),[h]),w=a(()=>c?g:C.filter(Lx),[c,g,C]),k=a(()=>c?b:C.filter(e=>!Lx(e)),[c,b,C]),T=a(()=>[...w,...k],[w,k]),$=a(()=>Array.isArray(p.data)?p.data:[],[p.data]),I=a(()=>Array.isArray(u.data)?u.data:[],[u.data]),N=a(()=>k.map(e=>e.scopeKey),[k]);o(()=>{v||(T.length?x(e=>e&&T.some(t=>t.id===e)?e:T[0].id):x(null))},[T,v]);const O=a(()=>T.find(e=>e.id===S)??null,[T,S]),A=w[0]??null,E=()=>{y(!0),x(null)};return t(Jv,{icon:i?.panelIcon,title:"Anomaly Detection Policies",count:T.length,description:i?.panelDescription,children:!s||c||T.length||v?e(mw,{children:[t(pC,{defaultPolicies:w,overridePolicies:k,selectedId:v?null:S,onSelect:e=>{y(!1),x(e)},onAddOverride:E}),t(bw,{children:v?t(Gx,{services:$,transactions:I,existingScopeKeys:N,onSubmit:async e=>{const t=k.find(t=>t.scope===e.scope&&t.scopeKey===e.scopeKey);if(t)return y(!1),void x(t.id);const i=(({scope:e,scopeKey:t,name:i,defaults:n})=>{const a=n?.fireAtScore??Wx[Rx.Medium],o=qx(a),r=n?.signalWeightOverrideCount??0;return{id:`${e}:${t}`,name:i,scope:e,scopeKey:t,enabled:!0,summary:ry(a,r),fireAtScore:a,riskLevel:o,signalWeightOverrideCount:r,signalWeights:n?.signalWeights??null,enricherLists:n?.enricherLists??null}})({scope:e.scope,scopeKey:e.scopeKey,name:e.name,defaults:A});if(c)return f(e=>[...e.filter(e=>!(e.scope===i.scope&&e.scopeKey===i.scopeKey)),i]),y(!1),void x(i.id);const a=Qx(i),o=await(n.upsertPolicy?.({...a,id:null}));o?.error||(await d(),y(!1),x(o?.data?Zx(o.data).id:i.id))}}):O?t(gw,{policy:O,onAddOverride:E,onSave:async e=>{if(c){const t=t=>t.map(t=>t.id===e.id?e:t);return m(e=>t(e)),void f(e=>t(e))}const t=await(n.upsertPolicy?.(Qx(e)));t?.error||await d()}},`${O.id}-${O.name}-${O.enabled}-${O.fireAtScore}-${O.summary}`):t(bt,{$height:"100%",children:t(ee,{size:te.XS,color:ie.Secondary,children:"Coming soon"})})})]}):t(bt,{$height:"100%",children:t(xt,{withSpinner:!0})})})},vw=f(oe)`
|
|
1837
|
+
width: 100%;
|
|
1838
|
+
gap: 4px;
|
|
1839
|
+
padding: 12px;
|
|
1840
|
+
border-radius: 12px;
|
|
1841
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1842
|
+
`,yw=f(oe)`
|
|
1843
|
+
width: 100%;
|
|
1844
|
+
gap: 4px;
|
|
1845
|
+
`,Sw=f(ne)`
|
|
1846
|
+
align-items: center;
|
|
1847
|
+
gap: 4px;
|
|
1848
|
+
`,xw=f.div`
|
|
1849
|
+
width: 100%;
|
|
1850
|
+
min-height: 99px;
|
|
1851
|
+
padding: 8px 16px;
|
|
1852
|
+
border-radius: 12px;
|
|
1853
|
+
overflow: hidden;
|
|
1854
|
+
`,Cw=f(ne)`
|
|
1855
|
+
width: 100%;
|
|
1856
|
+
align-items: flex-start;
|
|
1857
|
+
gap: 12px;
|
|
1858
|
+
`,ww=f(oe)`
|
|
1859
|
+
flex: 1;
|
|
1860
|
+
min-width: 0;
|
|
1861
|
+
gap: 4px;
|
|
1862
|
+
`,kw=f.div`
|
|
1863
|
+
display: flex;
|
|
1864
|
+
align-items: center;
|
|
1865
|
+
width: 100%;
|
|
1866
|
+
min-height: 32px;
|
|
1867
|
+
`,Tw=f(oe)`
|
|
1868
|
+
width: 100%;
|
|
1869
|
+
min-height: 80px;
|
|
1870
|
+
align-items: center;
|
|
1871
|
+
justify-content: center;
|
|
1872
|
+
gap: 8px;
|
|
1873
|
+
padding: 8px 0;
|
|
1874
|
+
text-align: center;
|
|
1875
|
+
`,$w=f.div`
|
|
1876
|
+
display: flex;
|
|
1877
|
+
align-items: center;
|
|
1878
|
+
justify-content: center;
|
|
1879
|
+
width: 40px;
|
|
1880
|
+
height: 40px;
|
|
1881
|
+
padding: 4px;
|
|
1882
|
+
border-radius: 23px;
|
|
1883
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1884
|
+
`,Iw=f(oe)`
|
|
1885
|
+
align-items: center;
|
|
1886
|
+
gap: 0;
|
|
1887
|
+
`,Nw=e=>{const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e},Ow=({title:i,description:n,items:o,selected:r,onToggle:l,emptyIcon:s,emptyTitle:c,emptyDescription:d})=>{const p=v(),u=a(()=>((e,t=3)=>{const i=Math.ceil(e.length/t)||1;return Array.from({length:t},(t,n)=>e.slice(n*i,(n+1)*i))})(o),[o]);return e(vw,{"data-id":`guardrail-facet-${i.toLowerCase()}`,children:[e(yw,{children:[e(Sw,{children:[t(ee,{size:te.XXS,children:i}),t(ce,{label:o.length,backgroundColor:p.v2.colors.blue[900],textSize:te.XXXS})]}),t(ee,{size:te.XXXS,color:ie.Secondary,children:n})]}),t(xw,{children:0===o.length?e(Tw,{children:[t($w,{children:t(s,{size:32,fill:p.v2.colors.silver[400]})}),e(Iw,{children:[t(ee,{size:te.XS,color:ie.Secondary,align:"center",children:c}),t(ee,{size:te.XXXS,color:ie.Disable,align:"center",children:d})]})]}):t(Cw,{children:u.map((e,n)=>t(ww,{children:e.map((e,a)=>t(kw,{children:t(Q,{name:`guardrail-facet-${i}-${n}-${a}`,label:Nw(e),size:Xo.S,value:r.has(e),onChange:t=>l(e,t)})},`${e}-${n}-${a}`))},`col-${n}`))})})]})},Aw=f(oe)`
|
|
1888
|
+
flex: 1;
|
|
1889
|
+
min-width: 0;
|
|
1890
|
+
height: 100%;
|
|
1891
|
+
gap: 0;
|
|
1892
|
+
padding: 12px 16px 8px 16px;
|
|
1893
|
+
overflow: hidden;
|
|
1894
|
+
border-radius: 16px 0 16px 0;
|
|
1895
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1896
|
+
`,Ew=f(oe)`
|
|
1897
|
+
flex: 1;
|
|
1898
|
+
min-height: 0;
|
|
1899
|
+
width: 100%;
|
|
1900
|
+
gap: 16px;
|
|
1901
|
+
overflow-y: auto;
|
|
1902
|
+
padding-bottom: 8px;
|
|
1903
|
+
`,Dw=f.div`
|
|
1904
|
+
width: 100%;
|
|
1905
|
+
padding: 0 16px;
|
|
1906
|
+
`,Rw=f(ne)`
|
|
1907
|
+
width: 100%;
|
|
1908
|
+
gap: 10px;
|
|
1909
|
+
align-items: flex-start;
|
|
1910
|
+
flex-wrap: wrap;
|
|
1911
|
+
`,Lw=f.div`
|
|
1912
|
+
width: 296px;
|
|
1913
|
+
max-width: 100%;
|
|
1914
|
+
`,Pw=f(ne)`
|
|
1915
|
+
flex-shrink: 0;
|
|
1916
|
+
width: 100%;
|
|
1917
|
+
align-items: center;
|
|
1918
|
+
justify-content: center;
|
|
1919
|
+
gap: 24px;
|
|
1920
|
+
padding: 8px 16px;
|
|
1921
|
+
border-radius: 8px;
|
|
1922
|
+
background-color: rgba(31, 33, 37, 0.95);
|
|
1923
|
+
box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
|
|
1924
|
+
`,Mw=f(ne)`
|
|
1925
|
+
width: 100%;
|
|
1926
|
+
justify-content: center;
|
|
1927
|
+
padding: 48px 0;
|
|
1928
|
+
`,zw=f(ne)`
|
|
1929
|
+
flex: 1;
|
|
1930
|
+
min-width: 0;
|
|
1931
|
+
align-items: center;
|
|
1932
|
+
gap: 8px;
|
|
1933
|
+
`,Xw=f.button`
|
|
1934
|
+
display: flex;
|
|
1935
|
+
align-items: center;
|
|
1936
|
+
gap: 8px;
|
|
1937
|
+
flex-shrink: 0;
|
|
1938
|
+
width: 242px;
|
|
1939
|
+
height: 38px;
|
|
1940
|
+
padding: 0 16px;
|
|
1941
|
+
border-radius: 8px;
|
|
1942
|
+
border: 1px solid ${({$selected:e,theme:t})=>e?t.v2.colors.purple[500]:"transparent"};
|
|
1943
|
+
background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.purple[900]:t.v2.colors.silver[800]};
|
|
1944
|
+
cursor: pointer;
|
|
1945
|
+
text-align: left;
|
|
1946
|
+
|
|
1947
|
+
&:hover {
|
|
1948
|
+
border-color: ${({theme:e})=>e.v2.colors.purple[400]};
|
|
1949
|
+
}
|
|
1950
|
+
`,_w=f(oe)`
|
|
1951
|
+
gap: 0;
|
|
1952
|
+
`,Fw=f(ke)`
|
|
1953
|
+
flex-shrink: 0;
|
|
1954
|
+
height: 38px;
|
|
1955
|
+
`,Bw=e=>new Set(e),Vw=({services:n,profile:l,profileLoading:s,namespace:c,service:d,onNamespaceChange:p,onServiceChange:u,onSubmit:h})=>{const[g,m]=r(_o.Enforce),[b,f]=r(new Set),[v,y]=r(new Set),[S,x]=r(new Set),[C,w]=r(!1),k=a(()=>{const e=new Set(n.map(e=>e.namespace).filter(Boolean));return Array.from(e).sort()},[n]),T=a(()=>n.filter(e=>e.namespace===c).map(e=>e.service).sort(),[n,c]),$=a(()=>k.map(e=>({id:e,label:e})),[k]),I=a(()=>T.map(e=>({id:e,label:e})),[T]);o(()=>{f(Bw(l?.callers??[])),y(Bw(l?.callees??[])),x(Bw(l?.egress??[]))},[l]);const N=b.size+v.size+S.size,O=!!c&&!!d&&N>0&&!C,A=e=>(t,i)=>{e(e=>{const n=new Set(e);return i?n.add(t):n.delete(t),n})};return e(Aw,{"data-id":"guardrails-create-panel",children:[e(Ew,{children:[t(Dw,{children:t(ee,{size:te.S,children:"Inspect a service"})}),e(Rw,{children:[t(Lw,{children:t(vt,{label:dy,options:$,values:c?[c]:[],setValues:e=>p(e[0]||""),placeholder:"Select namespace…"})}),t(Lw,{children:t(vt,{label:py,options:I,values:d?[d]:[],setValues:e=>u(e[0]||""),placeholder:"Select service…",disabled:!c})})]}),s?t(Mw,{children:t(xt,{withSpinner:!0})}):e(i,{children:[t(Ow,{title:uy,description:hy,items:l?.callers??[],selected:b,onToggle:A(f),emptyIcon:pl,emptyTitle:gy,emptyDescription:my}),t(Ow,{title:by,description:fy,items:l?.callees??[],selected:v,onToggle:A(y),emptyIcon:ul,emptyTitle:vy,emptyDescription:yy}),t(Ow,{title:Sy,description:xy,items:l?.egress??[],selected:S,onToggle:A(x),emptyIcon:Ur,emptyTitle:Cy,emptyDescription:wy})]})]}),e(Pw,{children:[e(zw,{children:[e(Xw,{type:"button",$selected:g===_o.Enforce,onClick:()=>m(_o.Enforce),children:[t(xe,{"data-id":"guardrail-mode-enforce",value:g===_o.Enforce,onChange:()=>m(_o.Enforce),size:we.S}),e(_w,{children:[t(ee,{size:te.XXS,children:ky}),t(ee,{size:te.XXXS,color:ie.Secondary,children:Ty})]})]}),e(Xw,{type:"button",$selected:g===_o.Suggest,onClick:()=>m(_o.Suggest),children:[t(xe,{"data-id":"guardrail-mode-suggest",value:g===_o.Suggest,onChange:()=>m(_o.Suggest),size:we.S}),e(_w,{children:[t(ee,{size:te.XXS,children:$y}),t(ee,{size:te.XXXS,color:ie.Secondary,children:Iy})]})]})]}),t(Fw,{"data-id":"guardrails-add-to-guardrails",label:"Add to guardrails",rightIcon:Rr,variant:$e.Primary,size:Te.M,disabled:!O,onClick:async()=>{if(O){w(!0);try{await h({scopeKey:`${c}/${d}`,mode:g,items:JSON.stringify({[Oy]:Array.from(b),[Ay]:Array.from(v),[Ey]:Array.from(S)})})}finally{w(!1)}}}})]})]})},Uw=e=>{if(e.length)return e.reduce((e,t)=>{const i=e.allowlist?.length??0;return(t.allowlist?.length??0)>i?t:e})},jw=e=>{const t=Uw(e.rules);return{id:e.scopeKey,scopeKey:e.scopeKey,ruleLabel:t?.label||"No rules",allowlistCount:t?.allowlist?.length??0,mode:t?.mode||_o.Suggest}},Hw=e=>{const t=e.indexOf("/");return t<0?{namespace:"",service:e}:{namespace:e.slice(0,t),service:e.slice(t+1)}},Gw=(e,t)=>e.rules.find(e=>e.key===t)?.allowlist?.filter(Boolean)??[],Kw=e=>Uw(e.rules)?.mode||_o.Suggest,Ww=(...e)=>{const t=new Set,i=[];for(const n of e)for(const e of n??[])e&&!t.has(e)&&(t.add(e),i.push(e));return i},Yw=f(oe)`
|
|
1956
|
+
flex: 1;
|
|
1957
|
+
min-width: 0;
|
|
1958
|
+
height: 100%;
|
|
1959
|
+
gap: 0;
|
|
1960
|
+
padding: 12px 16px 8px 16px;
|
|
1961
|
+
overflow: hidden;
|
|
1962
|
+
border-radius: 16px 0 16px 0;
|
|
1963
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1964
|
+
`,qw=f(oe)`
|
|
1965
|
+
flex: 1;
|
|
1966
|
+
min-height: 0;
|
|
1967
|
+
width: 100%;
|
|
1968
|
+
gap: 16px;
|
|
1969
|
+
overflow-y: auto;
|
|
1970
|
+
padding-bottom: 8px;
|
|
1971
|
+
`,Jw=f.div`
|
|
1972
|
+
width: 100%;
|
|
1973
|
+
padding: 0 16px;
|
|
1974
|
+
`,Zw=f(ne)`
|
|
1975
|
+
width: 100%;
|
|
1976
|
+
gap: 10px;
|
|
1977
|
+
align-items: flex-start;
|
|
1978
|
+
flex-wrap: wrap;
|
|
1979
|
+
`,Qw=f(oe)`
|
|
1980
|
+
width: 296px;
|
|
1981
|
+
max-width: 100%;
|
|
1982
|
+
gap: 4px;
|
|
1983
|
+
`,ek=f.div`
|
|
1984
|
+
display: flex;
|
|
1985
|
+
align-items: center;
|
|
1986
|
+
min-height: 38px;
|
|
1987
|
+
padding: 0 12px;
|
|
1988
|
+
border-radius: 8px;
|
|
1989
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1990
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1991
|
+
`,tk=f(ne)`
|
|
1992
|
+
flex-shrink: 0;
|
|
1993
|
+
width: 100%;
|
|
1994
|
+
align-items: center;
|
|
1995
|
+
justify-content: center;
|
|
1996
|
+
gap: 24px;
|
|
1997
|
+
padding: 8px 16px;
|
|
1998
|
+
border-radius: 8px;
|
|
1999
|
+
background-color: rgba(31, 33, 37, 0.95);
|
|
2000
|
+
box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
|
|
2001
|
+
`,ik=f(ne)`
|
|
2002
|
+
width: 100%;
|
|
2003
|
+
justify-content: center;
|
|
2004
|
+
padding: 48px 0;
|
|
2005
|
+
`,nk=f(ne)`
|
|
2006
|
+
flex: 1;
|
|
2007
|
+
min-width: 0;
|
|
2008
|
+
align-items: center;
|
|
2009
|
+
gap: 8px;
|
|
2010
|
+
`,ak=f.button`
|
|
2011
|
+
display: flex;
|
|
2012
|
+
align-items: center;
|
|
2013
|
+
gap: 8px;
|
|
2014
|
+
flex-shrink: 0;
|
|
2015
|
+
width: 242px;
|
|
2016
|
+
height: 38px;
|
|
2017
|
+
padding: 0 16px;
|
|
2018
|
+
border-radius: 8px;
|
|
2019
|
+
border: 1px solid ${({$selected:e,theme:t})=>e?t.v2.colors.purple[500]:"transparent"};
|
|
2020
|
+
background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.purple[900]:t.v2.colors.silver[800]};
|
|
2021
|
+
cursor: pointer;
|
|
2022
|
+
text-align: left;
|
|
2023
|
+
|
|
2024
|
+
&:hover {
|
|
2025
|
+
border-color: ${({theme:e})=>e.v2.colors.purple[400]};
|
|
2026
|
+
}
|
|
2027
|
+
`,ok=f(oe)`
|
|
2028
|
+
gap: 0;
|
|
2029
|
+
`,rk=f(ne)`
|
|
2030
|
+
flex-shrink: 0;
|
|
2031
|
+
align-items: center;
|
|
2032
|
+
gap: 8px;
|
|
2033
|
+
`,lk=e=>new Set(e),sk=({guardrail:n,profile:l,profileLoading:s,onSave:c,onDelete:d})=>{const{namespace:p,service:u}=a(()=>Hw(n.scopeKey),[n.scopeKey]),[h,g]=r(()=>Kw(n)),[m,b]=r(()=>lk(Gw(n,Oy))),[f,v]=r(()=>lk(Gw(n,Ay))),[y,S]=r(()=>lk(Gw(n,Ey))),[x,C]=r(!1);o(()=>{g(Kw(n)),b(lk(Gw(n,Oy))),v(lk(Gw(n,Ay))),S(lk(Gw(n,Ey)))},[n]);const w=a(()=>Ww(Gw(n,Oy),l?.callers),[n,l?.callers]),k=a(()=>Ww(Gw(n,Ay),l?.callees),[n,l?.callees]),T=a(()=>Ww(Gw(n,Ey),l?.egress),[n,l?.egress]),$=m.size+f.size+y.size>0&&!x,I=e=>(t,i)=>{e(e=>{const n=new Set(e);return i?n.add(t):n.delete(t),n})};return e(Yw,{"data-id":"guardrails-edit-panel",children:[e(qw,{children:[t(Jw,{children:t(ee,{size:te.S,children:"Edit guardrail"})}),e(Zw,{children:[e(Qw,{children:[t(ee,{size:te.XXXS,color:ie.Secondary,children:dy}),t(ek,{children:t(ee,{size:te.XXS,children:p||"—"})})]}),e(Qw,{children:[t(ee,{size:te.XXXS,color:ie.Secondary,children:py}),t(ek,{children:t(ee,{size:te.XXS,children:u||"—"})})]})]}),s?t(ik,{children:t(xt,{withSpinner:!0})}):e(i,{children:[t(Ow,{title:uy,description:hy,items:w,selected:m,onToggle:I(b),emptyIcon:pl,emptyTitle:gy,emptyDescription:my}),t(Ow,{title:by,description:fy,items:k,selected:f,onToggle:I(v),emptyIcon:ul,emptyTitle:vy,emptyDescription:yy}),t(Ow,{title:Sy,description:xy,items:T,selected:y,onToggle:I(S),emptyIcon:Ur,emptyTitle:Cy,emptyDescription:wy})]})]}),e(tk,{children:[e(nk,{children:[e(ak,{type:"button",$selected:h===_o.Enforce,onClick:()=>g(_o.Enforce),children:[t(xe,{"data-id":"guardrail-edit-mode-enforce",value:h===_o.Enforce,onChange:()=>g(_o.Enforce),size:we.S}),e(ok,{children:[t(ee,{size:te.XXS,children:ky}),t(ee,{size:te.XXXS,color:ie.Secondary,children:Ty})]})]}),e(ak,{type:"button",$selected:h===_o.Suggest,onClick:()=>g(_o.Suggest),children:[t(xe,{"data-id":"guardrail-edit-mode-suggest",value:h===_o.Suggest,onChange:()=>g(_o.Suggest),size:we.S}),e(ok,{children:[t(ee,{size:te.XXS,children:$y}),t(ee,{size:te.XXXS,color:ie.Secondary,children:Iy})]})]})]}),e(rk,{children:[t(ke,{"data-id":"guardrails-delete",label:"Delete",leftIcon:Dr,variant:$e.Secondary,size:Te.M,disabled:x,onClick:async()=>{if(!x){C(!0);try{await d(n.scopeKey)}finally{C(!1)}}}}),t(ke,{"data-id":"guardrails-save-changes",label:"Save changes",variant:$e.Primary,size:Te.M,disabled:!$,onClick:async()=>{if($){C(!0);try{await c((e=>{const t=[{key:Oy,label:"Allowed callers",allowlist:e.callers},{key:Ay,label:"Allowed callees",allowlist:e.callees},{key:Ey,label:"Allowed egress",allowlist:e.egress}].filter(e=>e.allowlist.length>0).map(t=>({...t,mode:e.mode}));return{scope:e.scope,scopeKey:e.scopeKey,rules:t}})({scope:n.scope,scopeKey:n.scopeKey,mode:h,callers:Array.from(m),callees:Array.from(f),egress:Array.from(y)}))}finally{C(!1)}}}})]})]})]})},ck=f.button`
|
|
2034
|
+
display: flex;
|
|
2035
|
+
align-items: center;
|
|
2036
|
+
justify-content: space-between;
|
|
2037
|
+
gap: 4px;
|
|
2038
|
+
width: 100%;
|
|
2039
|
+
padding: 8px 8px 8px 12px;
|
|
2040
|
+
border: none;
|
|
2041
|
+
border-radius: 8px;
|
|
2042
|
+
background-color: ${({$isSelected:e,theme:t})=>e?t.v2.colors.silver[800]:"transparent"};
|
|
2043
|
+
cursor: pointer;
|
|
2044
|
+
text-align: left;
|
|
2045
|
+
|
|
2046
|
+
&:hover {
|
|
2047
|
+
background-color: ${({theme:e,$isSelected:t})=>t?e.v2.colors.silver[800]:e.v2.colors.silver[900]};
|
|
2048
|
+
}
|
|
2049
|
+
`,dk=f(oe)`
|
|
2050
|
+
flex: 1;
|
|
2051
|
+
min-width: 0;
|
|
2052
|
+
`,pk=f(ne)`
|
|
2053
|
+
align-items: center;
|
|
2054
|
+
gap: 4px;
|
|
2055
|
+
min-width: 0;
|
|
2056
|
+
`,uk=({guardrail:i,isSelected:n,onSelect:a})=>{const o=v(),r=i.mode===_o.Enforce?"Enforce":"Suggest";return e(ck,{type:"button","data-id":`guardrail-item-${i.id}`,$isSelected:n,onClick:()=>a(i.id),children:[e(dk,{children:[t(ee,{size:te.XXS,nowrap:!0,children:i.scopeKey}),e(pk,{children:[t(ee,{size:te.XXXS,color:ie.Secondary,nowrap:!0,children:i.ruleLabel}),t(ce,{label:i.allowlistCount,backgroundColor:o.v2.colors.blue[900]}),t(ce,{label:r,backgroundColor:o.v2.colors.grey[800],textColor:i.mode===_o.Enforce?o.v2.colors.red[500]:o.v2.colors.purple[300]})]})]}),t(Ar,{size:18})]})},hk=f(oe)`
|
|
2057
|
+
width: 320px;
|
|
2058
|
+
flex-shrink: 0;
|
|
2059
|
+
height: 100%;
|
|
2060
|
+
gap: 16px;
|
|
2061
|
+
padding: 12px;
|
|
2062
|
+
overflow-y: auto;
|
|
2063
|
+
`,gk=f(oe)`
|
|
2064
|
+
width: 100%;
|
|
2065
|
+
gap: 8px;
|
|
2066
|
+
`,mk=f(ne)`
|
|
2067
|
+
width: 100%;
|
|
2068
|
+
align-items: center;
|
|
2069
|
+
gap: 4px;
|
|
2070
|
+
padding: 8px 12px 0 12px;
|
|
2071
|
+
`,bk=f(oe)`
|
|
2072
|
+
width: 100%;
|
|
2073
|
+
min-height: 60px;
|
|
2074
|
+
align-items: stretch;
|
|
2075
|
+
justify-content: center;
|
|
2076
|
+
gap: 2px;
|
|
2077
|
+
padding: 12px 8px;
|
|
2078
|
+
border-radius: 12px;
|
|
2079
|
+
text-align: center;
|
|
2080
|
+
`,fk=f(ke)`
|
|
2081
|
+
&&:enabled {
|
|
2082
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[900]};
|
|
2083
|
+
|
|
2084
|
+
&:hover {
|
|
2085
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[800]};
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
&:active {
|
|
2089
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[700]};
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
`,vk=({guardrails:i,selectedId:n,onSelect:a,onCreate:o})=>{const r=v();return e(hk,{"data-id":"guardrails-menu",children:[t(fk,{"data-id":"guardrails-create-new",label:Ny,rightIcon:Rr,variant:$e.Primary,size:Te.M,fullWidth:!0,textColor:r.v2.colors.purple[300],onClick:o}),e(gk,{children:[e(mk,{children:[t(ee,{size:te.XXS,color:r.v2.colors.purple[300],children:"Created Guardrails"}),t(ce,{label:i.length})]}),0===i.length?e(bk,{children:[t(ee,{size:te.XXS,color:ie.Secondary,align:"center",children:sy}),t(ee,{size:te.XXXS,color:ie.Disable,align:"center",children:cy})]}):i.map(e=>t(uk,{guardrail:e,isSelected:n===e.id,onSelect:a},e.id))]})]})},yk=f(ne)`
|
|
2093
|
+
flex: 1;
|
|
2094
|
+
min-height: 0;
|
|
2095
|
+
width: 100%;
|
|
2096
|
+
align-items: stretch;
|
|
2097
|
+
`,Sk=f.div`
|
|
2098
|
+
flex: 1;
|
|
2099
|
+
min-width: 0;
|
|
2100
|
+
height: 100%;
|
|
2101
|
+
overflow: hidden;
|
|
2102
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
2103
|
+
border-radius: 16px 0 16px 0;
|
|
2104
|
+
`,xk=()=>{const i=Yy(Gy.Guardrails),{insightsApi:n}=ws(),{data:l,loading:s,unsupported:c,refetch:d}=n.useGuardrails(),p=n.useServices(),u=Array.isArray(l)?l:[],[h,g]=r([]),[m,b]=r(!1),[f,v]=r(null),[y,S]=r(""),[x,C]=r(""),w=a(()=>c?h:u,[c,h,u]),k=a(()=>w.map(jw),[w]),T=a(()=>w.find(e=>e.scopeKey===f)??null,[w,f]),$=a(()=>Array.isArray(p.data)?p.data:[],[p.data]),I=a(()=>T?Hw(T.scopeKey):null,[T]),N=m?y:I?.namespace||"",O=m?x:I?.service||"",A=n.useServiceProfile({namespace:N||null,service:O||""},{skip:!(m||T)||!O}),E=O?A.data??null:null;o(()=>{m||(k.length?v(e=>e&&k.some(t=>t.id===e)?e:k[0].id):v(null))},[k,m]),o(()=>{if(m&&$.length){if(!y){const e=$[0]?.namespace||"";return S(e),void C($.find(t=>t.namespace===e)?.service||"")}x&&$.some(e=>e.namespace===y&&e.service===x)||C($.find(e=>e.namespace===y)?.service||"")}},[m,$,y,x]);const D=()=>{b(!0),v(null)};return t(Jv,{icon:i?.panelIcon,title:"Guardrails",count:k.length,description:ly,children:!s||c||k.length||m?e(yk,{children:[t(vk,{guardrails:k,selectedId:m?null:f,onSelect:e=>{b(!1),v(e)},onCreate:D}),t(Sk,{children:m?t(Vw,{services:$,profile:E,profileLoading:!!x&&A.loading,namespace:y,service:x,onNamespaceChange:e=>{S(e),C($.find(t=>t.namespace===e)?.service||"")},onServiceChange:C,onSubmit:async e=>{if(c){const t=JSON.parse(e.items),i=Object.entries(t).filter(([,e])=>e.length>0).map(([t,i])=>({key:t,label:t.replace(/^allowed_/,"Allowed ").replace(/_/g," "),mode:e.mode,allowlist:i}));return g(t=>[...t.filter(t=>t.scopeKey!==e.scopeKey),{scope:Po.Service,scopeKey:e.scopeKey,rules:i}]),b(!1),void v(e.scopeKey)}const t=await(n.seedGuardrail?.(e));t?.error||(await d(),b(!1),v(e.scopeKey))}}):k.length?T?t(sk,{guardrail:T,profile:E,profileLoading:!!O&&A.loading,onSave:async e=>{if(c)return g(t=>[...t.filter(t=>t.scopeKey!==e.scopeKey),e]),void v(e.scopeKey);const t=await(n.upsertGuardrail?.(e));t?.error||(await d(),v(e.scopeKey))},onDelete:async e=>{if(c)return g(t=>t.filter(t=>t.scopeKey!==e)),void v(null);const t=await(n.deleteGuardrail?.(e));t?.error||(await d(),v(null))}},T.scopeKey):null:t(bt,{$height:"100%",children:t(Ae,{icon:Xl,title:sy,subTitle:cy,button:{"data-id":"guardrails-create-first",label:Ny,rightIcon:Rr,size:Te.M,onClick:D}})})})]}):t(bt,{$height:"100%",children:t(xt,{withSpinner:!0})})})},Ck="—",wk="Storage health is not available.",kk="Memory",Tk="User",$k="Query",Ik=["B","KB","MB","GB","TB","PB"],Nk=e=>{if(null==e||e<=0)return"0 B";const t=Math.min(Math.floor(Math.log(e)/Math.log(1024)),Ik.length-1);return`${(e/Math.pow(1024,t)).toFixed(0===t?0:1)} ${Ik[t]}`},Ok=e=>null==e||!Number.isFinite(e)||e<=0?"0 ms":No(1e9*e),Ak=e=>null!=e&&Number.isFinite(e)?Math.round(e).toLocaleString():"0",Ek=e=>`${Math.round(e??0)}%`,Dk=f(oe)`
|
|
2105
|
+
width: 100%;
|
|
2106
|
+
min-width: 0;
|
|
2107
|
+
gap: 12px;
|
|
2108
|
+
`,Rk=f(ne)`
|
|
2109
|
+
width: 100%;
|
|
2110
|
+
min-width: 0;
|
|
2111
|
+
align-items: flex-start;
|
|
2112
|
+
justify-content: space-between;
|
|
2113
|
+
gap: 12px;
|
|
2114
|
+
flex-wrap: wrap;
|
|
2115
|
+
`,Lk=f(oe)`
|
|
2116
|
+
min-width: 0;
|
|
2117
|
+
flex: 1;
|
|
2118
|
+
gap: 4px;
|
|
2119
|
+
`,Pk=({title:i,description:n,extra:a,children:o})=>e(Dk,{"data-id":`insights-storage-section-${i}`,children:[e(Rk,{children:[e(Lk,{children:[t(ee,{size:te.XS,children:i}),n&&t(ee,{size:te.XXXS,color:ie.Secondary,children:n})]}),a]}),o]}),Mk=f.div`
|
|
2120
|
+
display: flex;
|
|
2121
|
+
flex-wrap: wrap;
|
|
2122
|
+
gap: 12px;
|
|
2123
|
+
width: 100%;
|
|
2124
|
+
min-width: 0;
|
|
2125
|
+
`,zk=f(oe)`
|
|
2126
|
+
flex: 1 1 160px;
|
|
2127
|
+
min-width: min(100%, 160px);
|
|
2128
|
+
max-width: 280px;
|
|
2129
|
+
gap: 8px;
|
|
2130
|
+
padding: 12px 16px;
|
|
2131
|
+
border-radius: 12px;
|
|
2132
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
2133
|
+
`,Xk=({label:i,value:n})=>{const a=v();return e(zk,{children:[t(ee,{size:te.XXXS,color:a.v2.colors.grey[150],children:i}),t(ee,{size:te.XS,children:n})]})},_k=f.div`
|
|
2134
|
+
width: 100%;
|
|
2135
|
+
padding: 12px 16px;
|
|
2136
|
+
border-radius: 8px;
|
|
2137
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
2138
|
+
`,Fk=f.div`
|
|
2139
|
+
width: 100%;
|
|
2140
|
+
min-width: 0;
|
|
2141
|
+
overflow-x: auto;
|
|
2142
|
+
`,Bk=f.div`
|
|
2143
|
+
width: 100%;
|
|
2144
|
+
min-width: 0;
|
|
2145
|
+
overflow-x: auto;
|
|
2146
|
+
`;var Vk,Uk,jk;(e=>{e.When="when",e.Duration="duration",e.Memory="memory",e.User="user",e.Query="query"})(Vk||(Vk={})),(e=>{e.Elapsed="elapsed",e.User="user",e.Memory="memory",e.Query="query"})(Uk||(Uk={})),(e=>{e.Table="table",e.Rows="rows",e.OnDisk="onDisk",e.ActiveParts="activeParts"})(jk||(jk={}));const Hk=[{key:Vk.When,label:"When",minWidth:"110px"},{key:Vk.Duration,label:"Duration",minWidth:"100px"},{key:Vk.Memory,label:kk,minWidth:"100px"},{key:Vk.User,label:Tk,minWidth:"140px"},{key:Vk.Query,label:$k,minWidth:"280px",flex:1,noSort:!0,noFilter:!0}],Gk=[{key:Uk.Elapsed,label:"Elapsed",minWidth:"100px"},{key:Uk.User,label:Tk,minWidth:"140px"},{key:Uk.Memory,label:kk,minWidth:"100px"},{key:Uk.Query,label:$k,minWidth:"280px",flex:1,noSort:!0,noFilter:!0}],Kk=[{key:jk.Table,label:"Table",minWidth:"200px",flex:1},{key:jk.Rows,label:"Rows (approx)",minWidth:"140px"},{key:jk.OnDisk,label:"On disk",minWidth:"120px"},{key:jk.ActiveParts,label:"Active parts",minWidth:"120px"}],Wk=f(oe)`
|
|
2147
|
+
flex: 1;
|
|
2148
|
+
min-height: 0;
|
|
2149
|
+
width: 100%;
|
|
2150
|
+
overflow-y: auto;
|
|
2151
|
+
gap: 24px;
|
|
2152
|
+
padding: 4px 12px 24px;
|
|
2153
|
+
`,Yk=e=>{switch(e){case Vo.Critical:return Le.Error;case Vo.Warning:return Le.Warning;default:return Le.Success}},qk=({title:e})=>t(_k,{children:t(ee,{size:te.XXS,color:ie.Secondary,children:e})}),Jk=()=>{const i=v(),n=Yy(Gy.Storage),{formatDurationAgo:o}=oi(),{insightsApi:l}=ws(),{data:s,loading:c,unsupported:p,error:u}=l.useStorageHealth({pollInterval:15e3}),[h,g]=r("heaviest"),m=d(e=>e?o(e,{style:"short"}):Ck,[o]),b=("heaviest"===h?s?.queries.recentHeaviest??[]:s?.queries.recentLatest??[]).slice(0,5),f=a(()=>((e,t)=>e.map((e,i)=>({id:`recent-${i}`,cells:[{key:Vk.When,rawValue:t(e.finishedAt)},{key:Vk.Duration,rawValue:Ok(e.elapsedSeconds)},{key:Vk.Memory,rawValue:Nk(e.memoryBytes)},{key:Vk.User,rawValue:e.user},{key:Vk.Query,rawValue:e.query}]})))(b,m),[b,m]),y=a(()=>(s?.queries.items??[]).map((e,t)=>({id:`running-${t}`,cells:[{key:Uk.Elapsed,rawValue:Ok(e.elapsedSeconds)},{key:Uk.User,rawValue:e.user},{key:Uk.Memory,rawValue:Nk(e.memoryBytes)},{key:Uk.Query,rawValue:e.query}]})),[s?.queries.items]),S=a(()=>(s?.tables??[]).map(e=>({id:e.name,cells:[{key:jk.Table,rawValue:e.name},{key:jk.Rows,rawValue:Ak(e.rows)},{key:jk.OnDisk,rawValue:Nk(e.bytesOnDisk)},{key:jk.ActiveParts,rawValue:Ak(e.activeParts)}]})),[s?.tables]),x=s?.disk.usedPercent??0,C=Math.max(0,100-x);return t(Jv,{icon:n?.panelIcon,title:n?.title||Qv,description:n?.panelDescription,children:(()=>{if(p)return t(bt,{$height:"200px",children:t(ee,{size:te.XS,color:ie.Secondary,children:wk})});if(c&&!s)return t(bt,{$height:"200px",children:t(xt,{})});if(!s)return t(bt,{$height:"200px",children:t(Ae,{hideIcon:!0,title:wk,subTitle:u?.message})});const n=s.connection.reachable,a=s.disk.totalBytes>0;return e(Wk,{"data-id":"insights-storage-panel",children:[e(Pk,{title:"Connection",children:[e(Mk,{children:[t(Xk,{label:"Reachable",value:n?"OK":"No"}),t(Xk,{label:"Ping latency",value:n?(b=s.connection.pingLatencyMs,null!=b&&Number.isFinite(b)?`${Math.round(b)} ms`:"—"):Ck}),t(Xk,{label:"ClickHouse version",value:s.connection.version||Ck}),t(Xk,{label:"Database",value:s.connection.database||Ck})]}),s.connection.error?t(ee,{size:te.XXS,color:i.v2.colors.orange[500],children:s.connection.error}):null]}),t(Ne,{margin:"0",opacity:.45}),e(Pk,{title:"Disk",children:[t(Mk,{children:t(Xk,{label:"Insights data",value:n?Nk(s.disk.insightsBytes):Ck})}),a?t(Bk,{children:e(Gt,{bgTint:"900",richTitle:{title:"Filesystem (ClickHouse volume)",titleSize:te.XS},badges:[{key:"disk-used",label:`${Ek(s.disk.usedPercent)} used`,status:Yk(s.disk.status)}],children:[t(ee,{size:te.XXXS,color:ie.Secondary,children:"On shared volumes this includes unrelated host data — use Insights data above for stored size."}),t(Fo,{variant:Bo.CurrentOfMax,gaugeWidth:150,min:0,max:"100%",current:`${Math.round(x)}%`,title:`Total ${Nk(s.disk.totalBytes)}`,primaryLabel:`Used ${Nk(s.disk.usedBytes)} (${Ek(x)})`,secondaryLabel:`Available ${Nk(s.disk.availableBytes)} (${Ek(C)})`})]})}):t(qk,{title:"Filesystem usage is not available."})]}),t(Ne,{margin:"0",opacity:.45}),t(Pk,{title:"Memory",children:e(Mk,{children:[t(Xk,{label:"Process RSS",value:n?Nk(s.memory.processRssBytes):Ck}),t(Xk,{label:"Pod (cgroup)",value:n?(l=s.memory.cgroupUsedBytes,d=s.memory.cgroupTotalBytes,d>0?`${Nk(l)} / ${Nk(d)}`:Nk(l)):Ck}),t(Xk,{label:"Uptime",value:n?Ok(s.memory.uptimeSeconds):Ck})]})}),t(Ne,{margin:"0",opacity:.45}),e(Pk,{title:"Running queries",children:[e(Mk,{children:[t(Xk,{label:"Active now",value:n?String(s.queries.active):Ck}),t(Xk,{label:"Longest running",value:n?Ok(s.queries.longestSeconds):Ck}),t(Xk,{label:"Peak memory (active)",value:n?Nk(s.queries.peakMemoryBytes):Ck})]}),y.length?t(Fk,{children:t(Ui,{variant:ji.DataSecondary,fitContent:!0,columns:Gk,rows:y})}):t(qk,{title:"No active queries (idle is normal)."})]}),t(Ne,{margin:"0",opacity:.45}),t(Pk,{title:"Recent queries",description:"Last 5 min · max 5",extra:t(ve,{"data-id":"insights-storage-recent-sort",size:Xt.S,selected:h,setSelected:g,options:[{value:"heaviest",label:"Heaviest"},{value:"latest",label:"Latest"}]}),children:f.length?t(Fk,{children:t(Ui,{variant:ji.DataSecondary,fitContent:!0,maxHeight:320,columns:Hk,rows:f})}):t(qk,{title:"No finished queries in the last 5 minutes."})}),t(Ne,{margin:"0",opacity:.45}),t(Pk,{title:"Database Tables",children:S.length?t(Fk,{children:t(Ui,{variant:ji.DataSecondary,fitContent:!0,maxHeight:400,columns:Kk,rows:S})}):t(qk,{title:"No table stats."})}),t(Ne,{margin:"0",opacity:.45}),t(Pk,{title:"Write pressure",children:e(Mk,{children:[t(Xk,{label:"Unfinished mutations",value:n?String(s.writePressure.unfinishedMutations):Ck}),t(Xk,{label:"Active parts",value:n?String(s.writePressure.activeParts):Ck}),t(Xk,{label:"Flush interval",value:s.writeback.flushIntervalSeconds?`${s.writeback.flushIntervalSeconds} s`:Ck})]})}),t(Ne,{margin:"0",opacity:.45}),t(Pk,{title:"Insights <> DB",children:e(Mk,{children:[t(Xk,{label:"Last flush",value:(o=s.writeback.everFlushed,r=s.writeback.lastFlushOk,o?r?"OK":"Error":Ck)}),t(Xk,{label:"Last flush at",value:s.writeback.everFlushed?m(s.writeback.lastFlushAt):Ck}),t(Xk,{label:"Last flush error",value:s.writeback.lastFlushError||Ck})]})})]});var o,r,l,d,b})()})},Zk=f(ne)`
|
|
2154
|
+
flex: 1;
|
|
2155
|
+
min-height: 0;
|
|
2156
|
+
width: 100%;
|
|
2157
|
+
align-items: stretch;
|
|
2158
|
+
gap: 24px;
|
|
2159
|
+
padding-top: 16px;
|
|
2160
|
+
`,Qk=()=>{const[i,n]=r(Ky),a=d(()=>{switch(i){case Gy.Detection:return t(fw,{});case Gy.Guardrails:return t(xk,{});case Gy.Learning:return t(Ex,{});case Gy.System:return t(pS,{});case Gy.Storage:return t(Jk,{});default:return null}},[i]);return e(Zk,{"data-id":"insights-settings-and-configurations",children:[t(fS,{selected:i,onSelect:n}),a()]})},eT=[{label:"Overview",value:ef.Overview},{label:"Findings",value:ef.Findings},{label:"Transactions",value:ef.Transactions},{label:"Settings & Configurations",value:ef.SettingsAndConfigurations}],tT=({minSupportedVersion:i})=>{const{isVersionSupported:n,version:a,minSupportedVersion:o}=x(i),[l,s]=r(ef.Overview),c=d(()=>{switch(l){case ef.Overview:return t(If,{setSelectedTab:s});case ef.Findings:return t(Af,{});case ef.Transactions:return t(Rf,{});case ef.SettingsAndConfigurations:return t(Qk,{});default:return null}},[l]);return t(rf,{children:t(of.Consumer,{children:({drawerIsOpenFor:i,modalIsOpenFor:r,closeModal:d})=>t(So,{children:e(Uo,{children:[!n&&t(ys,{minSupportedVersion:o,currentVersion:a||""}),e(oe,{$fullHeight:!0,$gap:12,children:[e(oe,{$gap:0,children:[t(ve,{variant:Vi.Underline,size:Xt.L,options:eT,selected:l,setSelected:s}),t(Ne,{margin:"0"})]}),c(),i.type===tf.Anomaly&&!!i.id&&t(Nv,{type:tf.Anomaly}),i.type===tf.Violation&&!!i.id&&t(Nv,{type:tf.Violation}),i.type===tf.Transaction&&!!i.id&&t(jv,{}),r.type===nf.JsonCode&&t(Ss,{isOpen:!0,onClose:()=>d(),language:"json",code:r.payload?.jsonCode}),r.type===nf.TraceView&&t(Dv,{isOpen:!0,onClose:()=>d(),transactionId:r.payload?.transactionId,traceId:r.payload?.traceId})]})]})})})})},iT=f.div`
|
|
973
2161
|
display: flex;
|
|
974
2162
|
align-items: center;
|
|
975
2163
|
justify-content: space-between;
|
|
@@ -978,26 +2166,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
978
2166
|
width: 100%;
|
|
979
2167
|
border-radius: 16px;
|
|
980
2168
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
981
|
-
`,
|
|
2169
|
+
`,nT=f.div`
|
|
982
2170
|
display: flex;
|
|
983
2171
|
align-items: center;
|
|
984
2172
|
justify-content: center;
|
|
985
2173
|
padding: 8px;
|
|
986
2174
|
border-radius: 8px;
|
|
987
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
988
|
-
`,
|
|
2175
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+ae["004"]};
|
|
2176
|
+
`,aT=({setStep:i,onSave:n,sourcesPayload:o,destinationsPayload:r,disableAnimation:l})=>{const s=v(),c=()=>i(2),d=()=>i(3),p=a(()=>Object.values(o||{}).flatMap((i,n)=>i.map((i,a)=>{if(!i.selected)return null;const o=i.kind||It.Namespace,r=o===It.Namespace?i.namespace:`${i.namespace} → ${i.name}`;return e(iT,{children:[t(ee,{nowrap:!0,children:r}),t(ce,{label:o,status:Le.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${a}`)})).filter(Boolean),[o]),u=a(()=>r?.map((i,n)=>{const a=wt(i.option.type).icon;return e(iT,{children:[e(ne,{$gap:8,children:[a&&t(nT,{children:t(a,{size:24})}),t(ee,{nowrap:!0,children:i.formData.name||i.option.displayName})]}),void 0!==i.testResult&&t(ce,{status:i.testResult.succeeded?Le.Success:Le.Error,leftIcon:i.testResult.succeeded?Gr:Kr})]},`destination-${n}`)})||[],[r]);return t(ps,{isOpen:!0,disableAnimation:l,onBack:()=>i(3),onSave:n,header:{icon:il,title:it.SUMMARY,subTitle:it.REVIEW_SETUP},leftColumn:{width:"50%",header:e(ne,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ne,{$gap:8,children:[t(Yr,{size:24}),t(ee,{nowrap:!0,children:it.SELECTED_SOURCES}),t(ce,{label:p.length})]}),t(ke,{"data-id":"summary-edit-sources",leftIcon:zr,variant:$e.Secondary,size:Te.S,onClick:c})]}),list:p.length?p:[t(bt,{$height:"100%",children:t(Ae,{icon:Yr,title:it.NO_SOURCES_SELECTED,subTitle:it.ADD_SOURCE_PROMPT,button:{leftIcon:Rr,label:it.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(ne,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ne,{$gap:8,children:[t(Ur,{size:24}),t(ee,{nowrap:!0,children:it.SELECTED_DESTINATIONS}),t(ce,{label:u.length})]}),t(ke,{"data-id":"summary-edit-destinations",leftIcon:zr,variant:$e.Secondary,size:Te.S,onClick:d})]}),list:u.length?u:[t(bt,{"data-id":"summary-no-destinations",$height:"100%",children:t(Ae,{icon:Ur,title:it.NO_DESTINATIONS_SELECTED,subTitle:it.ADD_DESTINATION_PROMPT,button:{leftIcon:Rr,label:it.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},oT=f.div`
|
|
989
2177
|
position: relative;
|
|
990
2178
|
overflow: hidden;
|
|
991
2179
|
width: 100vw;
|
|
992
2180
|
height: 100vh;
|
|
993
2181
|
box-sizing: border-box;
|
|
994
|
-
|
|
2182
|
+
`,rT=f.svg`
|
|
995
2183
|
position: absolute;
|
|
996
2184
|
top: 50%;
|
|
997
2185
|
left: 50%;
|
|
998
2186
|
transform: translate(-50%, -50%);
|
|
999
2187
|
z-index: -1;
|
|
1000
|
-
`,
|
|
2188
|
+
`,lT=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],sT=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:lT},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:lT},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:lT}],cT=({paddingXAxis:i="0px",paddingYAxis:n="0px",children:l})=>{const[s,c]=r(window.innerWidth),d=a(()=>s/sT[0].width,[s]);return o(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(oT,{$paddingXAxis:i,$paddingYAxis:n,children:[sT.map(({width:i,height:n,pathOpacity:a,path:o,gradientTransform:r,stops:l},s)=>{const c=`purple-ring-${s}`;return e(rT,{width:i*d,height:"100%",viewBox:`0 0 ${i} ${n}`,fill:"none",children:[t("path",{opacity:a,d:o,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:r,children:l.map(({offset:e,opacity:i},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:i},n))})})]},c)}),l]})},dT=f.div`
|
|
1001
2189
|
display: flex;
|
|
1002
2190
|
flex-direction: column;
|
|
1003
2191
|
align-items: center;
|
|
@@ -1008,7 +2196,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1008
2196
|
width: 50vw;
|
|
1009
2197
|
border-radius: 16px;
|
|
1010
2198
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1011
|
-
`,
|
|
2199
|
+
`,pT=f.div`
|
|
1012
2200
|
display: flex;
|
|
1013
2201
|
flex-direction: column;
|
|
1014
2202
|
align-items: center;
|
|
@@ -1018,15 +2206,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1018
2206
|
& * {
|
|
1019
2207
|
text-align: center;
|
|
1020
2208
|
}
|
|
1021
|
-
`,
|
|
2209
|
+
`,uT=({onStart:i})=>t(Ft,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(bt,{$height:"100%",children:e(dT,{children:[e(pT,{children:[t(ee,{size:te.L,weight:500,children:it.GET_STARTED_WITH}),t(fs,{size:260}),t(ee,{size:te.S,weight:400,children:it.GET_STARTED_DESCRIPTION})]}),t(ke,{"data-id":"onboarding-get-started",label:zt.GET_STARTED,rightIcon:Lr,size:Te.L,onClick:i})]})})}),hT=[{step:1,label:it.INSTALLATION,forceDoneBadge:!0},{step:2,label:it.SOURCES_SETUP},{step:3,label:it.DESTINATIONS_SETUP},{step:4,label:it.SUMMARY}],gT=f.div`
|
|
1022
2210
|
display: flex;
|
|
1023
2211
|
flex-direction: column;
|
|
1024
2212
|
gap: 32px;
|
|
1025
2213
|
padding: 64px;
|
|
1026
|
-
`,
|
|
2214
|
+
`,mT=({pagePaddingXAxis:i,pagePaddingYAxis:n,onDone:a})=>{const{setDrawerType:o}=Si(),{sourcesApi:l,destinationsApi:s}=ws(),[c,d]=r(1),[p,u]=r(!1),[h,g]=r(null),[m,b]=r(null),f=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(cT,{paddingXAxis:i,paddingYAxis:n,children:[e(gT,{children:[t(fs,{useInline:!0}),t(jo,{currentStep:c,data:hT,gap:32})]}),t(_s,{initialInputs:h,children:e(Fs,{children:[1===c&&t(uT,{onStart:f}),2===c&&t(Dd,{disableAnimation:!0,onBack:e=>{g(e),v()},onNext:e=>{g(e),f()}}),3===c&&t(md,{disableAnimation:!0,onBack:e=>{b(e),v()},onNext:e=>{b(e),f()},initialInputs:m}),4===c&&t(aT,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!p){u(!0);try{const e=[];h&&e.push(l.persistV2(h)),m&&e.push(...m.map(e=>s.create(e.formData)));const t=await Promise.allSettled(e),i=[];for(const e of t)"rejected"===e.status?i.push(e.reason?.message||String(e.reason)):e.value&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&i.push(e.value.error);if(i.length)return{error:i.join("\n")};o(Yn.OnboardingDone),a()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:m})]})})]})},bT=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),fT=e=>e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),vT=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},yT=f.div`
|
|
1027
2215
|
position: relative;
|
|
1028
2216
|
display: inline-flex;
|
|
1029
|
-
`,
|
|
2217
|
+
`,ST=f.button`
|
|
1030
2218
|
display: inline-flex;
|
|
1031
2219
|
align-items: center;
|
|
1032
2220
|
gap: 8px;
|
|
@@ -1039,7 +2227,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1039
2227
|
&:hover {
|
|
1040
2228
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1041
2229
|
}
|
|
1042
|
-
`,
|
|
2230
|
+
`,xT=f.div`
|
|
1043
2231
|
position: absolute;
|
|
1044
2232
|
top: calc(100% + 8px);
|
|
1045
2233
|
right: 0;
|
|
@@ -1052,25 +2240,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1052
2240
|
border-radius: 12px;
|
|
1053
2241
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1054
2242
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
1055
|
-
`,
|
|
2243
|
+
`,CT=f.div`
|
|
1056
2244
|
display: flex;
|
|
1057
2245
|
flex-direction: column;
|
|
1058
2246
|
gap: 12px;
|
|
1059
2247
|
padding: 16px;
|
|
1060
2248
|
max-height: 60vh;
|
|
1061
2249
|
overflow-y: auto;
|
|
1062
|
-
`,
|
|
2250
|
+
`,wT=f.div`
|
|
1063
2251
|
display: flex;
|
|
1064
2252
|
align-items: center;
|
|
1065
2253
|
gap: 8px;
|
|
1066
2254
|
padding: 12px 16px;
|
|
1067
2255
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1068
|
-
`,
|
|
2256
|
+
`,kT=f.div`
|
|
1069
2257
|
display: flex;
|
|
1070
2258
|
align-items: center;
|
|
1071
2259
|
gap: 8px;
|
|
1072
2260
|
margin-left: auto;
|
|
1073
|
-
`,
|
|
2261
|
+
`,TT=()=>{const i=v(),{platformType:n,isK8s:l,isConnector:s}=x(),{sourcesApi:c,namespacesApi:d}=ws(),u=c.useSources().items,h=d.useNamespaces().items,{selectedStreamName:g}=nt(),{getItemSS:m,setItemSS:b,removeItemSS:f}=qo(),{statuses:y,namespaces:S,regions:C,kinds:w,monitors:k,languages:T,onlyErrors:$,podsAgentInjectionStatus:I,enabledStatuses:N,setAll:O,clearFilters:A,getEmptyState:E}=Ho(),D=a(()=>Go(u,g),[u,g]);o(()=>{const e=m(Ko.OVERVIEW_FILTERS,E());O(e)},[]);const[R,L]=r({statuses:y,namespaces:S,regions:C,kinds:w,monitors:k,languages:T,onlyErrors:$,podsAgentInjectionStatus:I,enabledStatuses:N}),[P,M]=r(vT(R)),[z,X]=r(!1),_=p(n);o(()=>{if(!z){const e={statuses:y,namespaces:S,regions:C,kinds:w,monitors:k,languages:T,onlyErrors:$,podsAgentInjectionStatus:I,enabledStatuses:N};L(e),M(vT(e))}},[z,y,S,C,w,k,T,$,I,N]),o(()=>{_.current!==n&&(_.current=n,f(Ko.OVERVIEW_FILTERS),A(),L(E()),M(0),X(!1))},[n]);const F=p(null);Ai(F,()=>X(!1)),Vn({key:"Escape",active:z},()=>X(!1));const B=a(()=>{const e=new Set,t=[];return h.forEach(({name:i})=>{e.has(i)||(e.add(i),t.push({id:i,label:i,withCheckbox:!0}))}),t},[h]),V=a(()=>{const e=new Set,t=[];return D.forEach(({id:i})=>{const{kind:n}=i;e.has(n)||(e.add(n),t.push({id:n,label:Ii(n),withCheckbox:!0}))}),t},[D]),U=a(()=>{const e=new Set,t=[];return D.forEach(({id:i})=>{const n=i.region?.trim();n&&!e.has(n)&&(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t.sort((e,t)=>e.id.localeCompare(t.id))},[D]),j=a(()=>{const e=new Set,t=[];return D.forEach(({runtimeInfo:i})=>{i?.detectedLanguages?.forEach(i=>{e.has(i)||(e.add(i),t.push({id:i,label:Wo[i]||i,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[D]),H=a(()=>Yo.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),G=a(()=>{const e=new Set,t=[];return D.forEach(({instrumentationReport:i})=>{const n=i?.state||i?.progressStage;n&&!e.has(n)&&(e.add(n),t.push({id:n,label:fT(n),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[D]),K=a(()=>{const e=new Set,t=[];return D.forEach(({podsAgentInjectionStatus:i})=>{const{reasonEnum:n,message:a}=i||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Vt(n),withCheckbox:!0})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[D]),W=a(()=>[{id:"enabled",label:it.ENABLED,withCheckbox:!0},{id:"disabled",label:it.DISABLED,withCheckbox:!0}],[]),Y=(e,t,i)=>{const n=t.filter(e=>i.includes(e.id));L(t=>{return{...t,[e]:(i=n,i.map(({id:e,label:t})=>({id:e,label:t})))};var i})},q=z?jr:Hr,J=a(()=>bT(R.languages),[R.languages]);return e(yT,{ref:F,children:[e(ST,{"data-id":"filters-trigger",$isOpen:z,type:"button",onClick:()=>X(e=>!e),children:[t(Bl,{size:16,fill:i.v2.colors.white[500]}),t(ee,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),P>0&&t(ce,{label:P,status:Le.Unknown,textSize:te.XXXS}),t(q,{size:16,fill:i.v2.colors.silver[200]})]}),z&&e(xT,{children:[e(CT,{children:[l&&t(vt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!B.length,options:B,values:bT(R.namespaces),setValues:e=>Y("namespaces",B,e)}),s&&t(vt,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!U.length,options:U,values:bT(R.regions),setValues:e=>Y("regions",U,e)}),t(vt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!V.length,options:V,values:bT(R.kinds),setValues:e=>Y("kinds",V,e)}),t(vt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!j.length,options:j,values:J,setValues:e=>Y("languages",j,e)}),t(vt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!H.length,options:H,values:bT(R.monitors),setValues:e=>Y("monitors",H,e)}),t(vt,l?{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!K.length,options:K,values:bT(R.podsAgentInjectionStatus),setValues:e=>Y("podsAgentInjectionStatus",K,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:bT(R.statuses),setValues:e=>Y("statuses",G,e)}),t(vt,{label:"Enabled Status",placeholder:"All",withMultiSelect:!0,options:W,values:bT(R.enabledStatuses),setValues:e=>Y("enabledStatuses",W,e)}),t(me,{label:"Show only sources with errors",size:Nt.L,value:!!R.onlyErrors,onChange:e=>L(t=>({...t,onlyErrors:e}))})]}),e(wT,{children:[t(ke,{"data-id":"filters-reset",size:Te.S,variant:$e.Text,label:"Reset",onClick:()=>{f(Ko.OVERVIEW_FILTERS),A(),L(E()),M(0),X(!1)},textColor:i.v2.colors.red[500]}),e(kT,{children:[t(ke,{"data-id":"filters-cancel",size:Te.S,variant:$e.Secondary,label:"Cancel",onClick:()=>X(!1)}),t(ke,{"data-id":"filters-apply",size:Te.S,variant:$e.Primary,label:"Apply",onClick:()=>{b(Ko.OVERVIEW_FILTERS,R),O(R),M(vT(R)),X(!1)}})]})]})]})]})},$T=f.div`
|
|
1074
2262
|
position: relative;
|
|
1075
2263
|
display: flex;
|
|
1076
2264
|
align-items: center;
|
|
@@ -1081,7 +2269,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1081
2269
|
box-sizing: border-box;
|
|
1082
2270
|
border-radius: 16px 16px 0 0;
|
|
1083
2271
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1084
|
-
`,
|
|
2272
|
+
`,IT=f.div`
|
|
1085
2273
|
position: absolute;
|
|
1086
2274
|
bottom: 0;
|
|
1087
2275
|
left: 0;
|
|
@@ -1090,7 +2278,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1090
2278
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
1091
2279
|
border-radius: 32px;
|
|
1092
2280
|
transition: width 0.3s;
|
|
1093
|
-
`,
|
|
2281
|
+
`,NT=({entityType:i,badge:n,badgeTooltip:a,isLoading:o,refetch:r,partiallySelected:l,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=Si();return e($T,{children:[e(ne,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Q,{size:Xo.S,partiallyChecked:l,value:!!s,onChange:c}),t(ee,{size:te.S,nowrap:!0,children:`${Vt(i)}s`}),t(ce,{label:n,tooltip:a,status:Le.Unknown,textSize:te.XXXS})]}),e(ne,{children:[t(yt,{"data-id":`add-${i}`,icon:Rr,onClick:()=>p(Jo(i))}),t(yt,{"data-id":`refresh-${i}`,icon:ol,onClick:r,disabled:o})]}),"number"==typeof d&&t(IT,{$percent:d})]})},OT=f(oe)`
|
|
1094
2282
|
align-items: center !important;
|
|
1095
2283
|
justify-content: center !important;
|
|
1096
2284
|
align-self: stretch;
|
|
@@ -1105,7 +2293,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1105
2293
|
&:hover {
|
|
1106
2294
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1107
2295
|
}
|
|
1108
|
-
`,
|
|
2296
|
+
`,AT=({entityType:i,description:n})=>{const{setDrawerType:a}=Si();return e(OT,{onClick:()=>a(Jo(i)),children:[e(ne,{$gap:4,children:[t(Rr,{size:16}),t(ee,{size:te.S,children:`Add ${Vt(i)}`})]}),t(ee,{size:te.XXS,align:"center",children:n})]})},ET=f.div`
|
|
1109
2297
|
display: flex;
|
|
1110
2298
|
align-items: center;
|
|
1111
2299
|
gap: 12px;
|
|
@@ -1120,10 +2308,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1120
2308
|
&:hover {
|
|
1121
2309
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1122
2310
|
}
|
|
1123
|
-
`,
|
|
2311
|
+
`,DT=f(ne)`
|
|
1124
2312
|
flex: 1;
|
|
1125
2313
|
min-width: 0;
|
|
1126
|
-
`,
|
|
2314
|
+
`,RT=({entityId:i,entityType:n,title:o,status:r,faded:l,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:g})=>{const m=v(),b=n===It.Source,f="boolean"==typeof h,y=l||f&&!h,{setDrawerType:S,setDrawerEntityId:x}=Si(),{selectedSources:C,setSelectedSources:w}=Zo(),k=g,T=b?k.id.namespace:"",$=a(()=>{if(!b)return-1;const e=C[T];return e?.length?e.findIndex(e=>e.id.name===k.id.name&&e.id.kind===k.id.kind&&(e.id.region??"")===(k.id.region??"")):-1},[b,C,T,k.id]),I=f&&!h?zi(Le.Info,m):r?zi(r,m):void 0,N=b&&"object"==typeof i?`${i.namespace}-${i.name}-${i.kind}${i.region?`-${i.region}`:""}`:i;return e(ET,{"data-id":N,$faded:y,onClick:()=>{S(Ti(n)),x(i)},children:[b&&t(Q,{size:Xo.S,value:-1!==$,onChange:()=>{const e={...C};e[T]||(e[T]=[]),-1===$?e[T].push(k):e[T].splice($,1),w(e)}}),t(ki,{icons:p,icon:d,iconSrc:u}),e(DT,{$gap:4,children:[t(Ee,{size:te.XS,nowrap:!0,children:o}),t(ne,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:(c||f&&!h)&&t(Be,{text:s||(f&&!h?it.DISABLED:"Heads up! The data-flow metrics you see are calculated over 10-second intervals."),children:t(ce,{label:c||it.DISABLED,status:r&&[Le.Error,Le.Warning].includes(r)?r:Le.Unknown,leftIcon:I,textSize:te.XXXS})})})]})]})};function LT(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Le.Loading)?e:{...e,workloadOdigosHealthStatus:{status:ci.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function PT(e){const t=Object.values(e.conditions??{}).filter(Boolean),i=t.filter(({status:e})=>e!==Le.Loading);return i?.length===t?.length?e:{...e,conditions:i?.length?i.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const MT=f.div`
|
|
1127
2315
|
position: absolute;
|
|
1128
2316
|
top: 0;
|
|
1129
2317
|
left: 0;
|
|
@@ -1134,21 +2322,21 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1134
2322
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1135
2323
|
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1136
2324
|
pointer-events: none;
|
|
1137
|
-
`,
|
|
2325
|
+
`,zT=f.div`
|
|
1138
2326
|
display: flex;
|
|
1139
2327
|
align-items: center;
|
|
1140
2328
|
gap: 8px;
|
|
1141
2329
|
padding: 4px 8px 0;
|
|
1142
|
-
`,
|
|
2330
|
+
`,XT=f.div`
|
|
1143
2331
|
flex: 1;
|
|
1144
2332
|
height: 1px;
|
|
1145
2333
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1146
|
-
`,
|
|
2334
|
+
`,_T=({namespace:e})=>{const i=v();return t(MT,{children:t(ee,{size:te.XXS,nowrap:!0,color:i.v2.colors.grey[300],children:e})})},FT=({namespace:i})=>{const n=v();return e(zT,{children:[t(XT,{}),t(ee,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:i}),t(XT,{})]})},BT={[It.InstrumentationRule]:it.NO_DATA_INSTRUMENTATION_RULES,[It.Source]:it.NO_DATA_SOURCES,[It.Action]:it.NO_DATA_ACTIONS,[It.Destination]:it.NO_DATA_DESTINATIONS},VT=f.div`
|
|
1147
2335
|
display: flex;
|
|
1148
2336
|
flex-direction: column;
|
|
1149
2337
|
flex: 1 0 0;
|
|
1150
2338
|
min-width: 0;
|
|
1151
|
-
`,
|
|
2339
|
+
`,UT=f.div`
|
|
1152
2340
|
display: flex;
|
|
1153
2341
|
flex-direction: column;
|
|
1154
2342
|
align-items: stretch;
|
|
@@ -1158,7 +2346,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1158
2346
|
border-radius: 0 0 16px 16px;
|
|
1159
2347
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1160
2348
|
overflow: hidden;
|
|
1161
|
-
`,
|
|
2349
|
+
`,jT=f.div`
|
|
1162
2350
|
position: relative;
|
|
1163
2351
|
display: flex;
|
|
1164
2352
|
flex-direction: column;
|
|
@@ -1170,7 +2358,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1170
2358
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1171
2359
|
height: ${({$height:e})=>e}px;
|
|
1172
2360
|
overflow: hidden;
|
|
1173
|
-
`,
|
|
2361
|
+
`,HT=({entityType:i,entities:n,unfilteredCount:l,metrics:s,loading:c,maxHeight:p,refetch:u})=>{const h=i===It.Source,g=n.length!==l,m=At(e=>h?e.progress[Rt.Instrumenting]?.percentage:void 0),b=At(e=>h?e.progress[Rt.Uninstrumenting]?.percentage:void 0),f=!h||void 0===m&&void 0===b?void 0:m||b||0,{selectedSources:v,setSelectedSources:y}=Zo(),S=a(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),x=a(()=>{if(!s)return;const e=new Map,t=i===It.Source?s.sources:i===It.Destination?s.destinations:void 0;if(t)for(const i of t)e.set(Qo(i),i.throughput);return e},[s,i]),C=a(()=>n.map(e=>((e,t,i)=>{const n=Kt(e);if(!n)return null;const a=t===It.Source;let o,r,l=!1,s=e;if(a){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status,i=!1===e.markedForInstrumentation?.markedForInstrumentation;switch(t){case ci.Failure:return{status:Le.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case ci.Notice:return{status:Le.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case ci.Pending:case ci.Waiting:return{status:void 0,faded:!1,displaySource:LT(e)};case ci.Unsupported:case ci.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return i?{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e}:{status:void 0,faded:!1,displaySource:PT(e)}}})(e);o=t.status,l=t.faded,r=t.tooltip,s=t.displaySource}else{const i=t===It.Action?er(e):e.conditions,{priorotizedStatus:n,hasDisableds:a}=tr(i);o=n,l=a}const c=ir(e,t,{extended:a,prioritizeDisplayName:!a});let d,p,u,h,g;switch(t){case It.Source:{d=wi(e),p=ar(It.Source);const t=i?.get(nr(n));h=Ni(t);const a=e.markedForInstrumentation?.markedForInstrumentation;"boolean"==typeof a&&(g=a);break}case It.Destination:{const t=wt(e.destinationType.type);p=t.icon,u=t.iconSrc;const a=i?.get(nr(n));h=Ni(a),g=!e.disabled;break}case It.Action:p=qt(e.type),g=!e.disabled;break;case It.InstrumentationRule:p=ai(e.type),g=!e.disabled}return{key:nr(n),entityId:n,namespace:a?e.id.namespace:void 0,raw:s,itemProps:{entityId:n,entityType:t,title:c,status:o,faded:l,tooltip:r,throughput:h,icon:p,icons:d,iconSrc:u,isActive:g,raw:s}}})(e,i,x)).filter(Boolean),[n,i,x]),[w,k]=r(""),{elements:T,indexToNamespace:$,multipleNs:I,dividerCount:N}=a(()=>{const e=[],i=[],n=new Set(C.map(e=>e.namespace).filter(Boolean)).size>1;n&&(i.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,o="";for(const n of C)h&&n.namespace&&n.namespace!==o&&(""!==o&&(i.push(n.namespace),e.push(t(FT,{namespace:n.namespace},`ns-divider-${n.namespace}`)),a+=1),o=n.namespace),i.push(n.namespace||""),e.push(t(RT,{...n.itemProps},n.key));return{elements:e,indexToNamespace:i,multipleNs:n,dividerCount:a}},[C,h]);o(()=>{if(h&&$.length&&!w){const e=$.find(Boolean);e&&k(e)}},[h,$]);const O=d(e=>{if(!$.length)return;const t=$[Math.min(e,$.length-1)];t&&t!==w&&k(t)},[$,w]),A=58*C.length+(I?28:0)+32*N,E=Math.max(0,p-52-16),D=Math.min(E,A)+8,R="number"==typeof f?`${f}%`:g?`${n.length}/${l}`:l;return e(VT,{children:[t(NT,{entityType:i,badge:R,badgeTooltip:g?it.FILTERED_COUNT_TOOLTIP:void 0,isLoading:c,refetch:u,partiallySelected:S>0&&n?.length!==S,allSelected:S>0&&n?.length===S,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:i}=t.id;e[i]?e[i].push(t):e[i]=[t]}),y(e)}else y({})}:void 0,progressPercent:f}),t(UT,{children:n.length?e(jT,{$height:D,children:[I&&w&&t(_T,{namespace:w}),t(yi,{gap:4,elements:T,onTopIndexChange:I?O:void 0})]}):c?t(le,{size:3}):t(AT,{entityType:i,description:BT[i]??it.TO_COLLECT_OTEL_DATA})})]})},GT=f.div`
|
|
1174
2362
|
width: 100%;
|
|
1175
2363
|
flex: 1;
|
|
1176
2364
|
min-height: 0;
|
|
@@ -1178,10 +2366,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1178
2366
|
display: flex;
|
|
1179
2367
|
align-items: stretch;
|
|
1180
2368
|
gap: 16px;
|
|
1181
|
-
`,
|
|
2369
|
+
`,KT={sources:[],destinations:[]},WT=()=>{const i=Ho(),{selectedStreamName:n}=nt(),{containerRef:o,containerHeight:r}=or(),{sourcesApi:l,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p,capabilities:u}=ws(),{items:h,loading:g}=l.useSources(),{items:m,loading:b}=s.useDestinations(),{items:f,loading:v}=c.useActions(),{items:y,loading:S}=d.useRules(),x=Si(e=>e.drawerType),{data:C}=p.useMetrics({skip:!h.length||!m.length||!!x,pollInterval:1e4,fetchPolicy:"network-only"}),w=C?.getOverviewMetrics??KT,k=a(()=>Go(h,n),[h,n]),T=a(()=>ei(m,n),[m,n]),$=a(()=>rr(k,i),[k,i]),I=a(()=>lr(T,i),[T,i]),N=a(()=>sr(f,i),[f,i]);return e(GT,{ref:o,children:[u.canManageInstrumentationRules&&t(HT,{entityType:It.InstrumentationRule,entities:y,unfilteredCount:y.length,loading:S,maxHeight:r,refetch:d.fetchAll}),t(HT,{entityType:It.Source,entities:$,unfilteredCount:k.length,metrics:w,loading:g,maxHeight:r,refetch:l.fetchAll}),u.canManageActions&&t(HT,{entityType:It.Action,entities:N,unfilteredCount:f.length,loading:v,maxHeight:r,refetch:c.fetchAll}),t(HT,{entityType:It.Destination,entities:I,unfilteredCount:T.length,metrics:w,loading:b,maxHeight:r,refetch:s.fetchAll})]})},YT="40vw",qT=f.div`
|
|
1182
2370
|
position: relative;
|
|
1183
|
-
width: ${
|
|
1184
|
-
`,
|
|
2371
|
+
width: ${YT};
|
|
2372
|
+
`,JT=f.div`
|
|
1185
2373
|
position: absolute;
|
|
1186
2374
|
top: calc(100% + 8px);
|
|
1187
2375
|
left: 0;
|
|
@@ -1190,23 +2378,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1190
2378
|
flex-direction: column;
|
|
1191
2379
|
gap: 8px;
|
|
1192
2380
|
padding: 8px;
|
|
1193
|
-
width: calc(${
|
|
2381
|
+
width: calc(${YT} - 16px);
|
|
1194
2382
|
border-radius: 12px;
|
|
1195
2383
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1196
2384
|
box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
|
|
1197
|
-
`,
|
|
2385
|
+
`,ZT=f.div`
|
|
1198
2386
|
display: flex;
|
|
1199
2387
|
align-items: center;
|
|
1200
2388
|
overflow-x: auto;
|
|
1201
|
-
`,
|
|
2389
|
+
`,QT=f.div`
|
|
1202
2390
|
display: flex;
|
|
1203
2391
|
flex-direction: column;
|
|
1204
2392
|
gap: 0;
|
|
1205
2393
|
max-height: 60vh;
|
|
1206
2394
|
overflow-y: auto;
|
|
1207
|
-
`,
|
|
2395
|
+
`,e$=f.div`
|
|
1208
2396
|
padding: 8px 12px 4px 12px;
|
|
1209
|
-
`,
|
|
2397
|
+
`,t$=f.div`
|
|
1210
2398
|
display: flex;
|
|
1211
2399
|
align-items: center;
|
|
1212
2400
|
gap: 8px;
|
|
@@ -1216,12 +2404,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1216
2404
|
&:hover {
|
|
1217
2405
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1218
2406
|
}
|
|
1219
|
-
`,
|
|
2407
|
+
`,i$=f.div`
|
|
1220
2408
|
padding: 16px 8px;
|
|
1221
|
-
`,
|
|
2409
|
+
`,n$=({preventPopup:i=!1})=>{const n=v(),{selectedStreamName:o}=nt(),{searchText:s,setSearchText:c}=Ho(),{setDrawerType:d,setDrawerEntityId:u}=Si(),{sourcesApi:h,destinationsApi:g,actionsApi:m,instrumentationRulesApi:b,capabilities:f}=ws(),y=h.useSources().items,S=g.useDestinations().items,x=m.useActions().items,C=b.useRules().items,w=p(null),[k,T]=r(!1),[$,I]=r("all"),N=!i&&(!!s||k),O=()=>{c(""),T(!1),I("all")};Ai(w,()=>O()),Vn({key:"Escape",active:N},O);const{categories:A,searchResults:E}=a(()=>(({instrumentationRules:e,sources:t,actions:i,destinations:n,searchText:a,selectedCategory:o,includeActions:r=!0,includeInstrumentationRules:l=!0})=>{const s=l?a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e:[],c=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,d=r?a?i.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):i:[],p=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,u=[{category:It.Source,label:"Sources",count:c.length,entities:[]},...r?[{category:It.Action,label:"Actions",count:d.length,entities:[]}]:[],{category:It.Destination,label:"Destinations",count:p.length,entities:[]},...l?[{category:It.InstrumentationRule,label:"Instrumentation Rules",count:s.length,entities:[]}]:[]];u.unshift({category:"all",label:"All",count:s.length+c.length+d.length+p.length,entities:[]});const h=u.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(o)).map(e=>({...e,entities:e.category===It.InstrumentationRule?s:e.category===It.Source?c:e.category===It.Action?d:e.category===It.Destination?p:[]}));return{categories:u,searchResults:h}})({instrumentationRules:C,sources:Go(y,o),actions:x,destinations:ei(S,o),searchText:s,selectedCategory:$,includeActions:f.canManageActions,includeInstrumentationRules:f.canManageInstrumentationRules}),[C,y,x,S,o,s,$,f.canManageActions,f.canManageInstrumentationRules]),D=a(()=>A.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:i})=>({value:e,label:i?`${t} (${i})`:t})),[A]),R=E.some(({entities:e})=>e.length>0);return e(qT,{ref:w,children:[t(vi,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>T(!0),width:YT}),N&&e(JT,{children:[D.length>1&&t(ZT,{children:t(ve,{options:D,selected:$,setSelected:I})}),R?t(QT,{children:E.map(({category:i,label:a,entities:o},r)=>{if(!o.length)return null;const s=ar(i);return e(l,{children:[t(e$,{children:t(ee,{size:te.XXS,color:ie.Secondary,children:a})}),o.map((a,o)=>e(t$,{onClick:()=>{const e=Kt(a);e&&(d(Ti(i)),u(e),O())},children:[s&&t(s,{size:16,fill:n.v2.colors.white[500]}),t(ee,{size:te.XS,nowrap:!0,children:ir(a,i,{extended:!0})})]},`entity-${r}-${o}`))]},`category-list-${i}`)})}):t(i$,{children:t(Ae,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},a$=({onRedirectToSampling:n})=>{const{sourcesApi:o}=ws(),{items:r}=o.useSources(),{drawerType:l,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=Si(),p=()=>{c(null),d(null)},u=a(()=>r.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[r]),h=a(()=>Array.from(new Set(r.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[r]);return e(i,{children:[t(qm,{}),l===Yn.AddSource&&t(_s,{children:t(Dd,{onClose:p,withOverlay:!0})}),l===Yn.AddDestination&&t(Fs,{children:t(md,{onClose:p,withOverlay:!0})}),l===Yn.AddInstrumentationRule&&t(Bs,{sourceOptions:u,namespaceOptions:h,children:t(bd,{onClose:p,withOverlay:!0})}),l===Yn.AddAction&&t(Vs,{sourceOptions:u,namespaceOptions:h,children:t(od,{onClose:p,withOverlay:!0})}),l===Yn.EditSource&&t(Us,{children:t(qg,{onClose:p,sourceId:s,onRedirectToSampling:n})}),l===Yn.EditDestination&&t(Fs,{children:t(Iu,{onClose:p,destinationId:s})}),l===Yn.EditInstrumentationRule&&t(Bs,{sourceOptions:u,namespaceOptions:h,children:t(Ou,{onClose:p,ruleId:s})}),l===Yn.EditAction&&t(Vs,{sourceOptions:u,namespaceOptions:h,children:t(ku,{onClose:p,actionId:s})})]})},o$=f.div`
|
|
1222
2410
|
position: relative;
|
|
1223
2411
|
display: inline-flex;
|
|
1224
|
-
`,
|
|
2412
|
+
`,r$=f.div`
|
|
1225
2413
|
display: inline-flex;
|
|
1226
2414
|
align-items: center;
|
|
1227
2415
|
gap: 6px;
|
|
@@ -1232,7 +2420,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1232
2420
|
&:hover {
|
|
1233
2421
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1234
2422
|
}
|
|
1235
|
-
`,
|
|
2423
|
+
`,l$=f.div`
|
|
1236
2424
|
position: absolute;
|
|
1237
2425
|
top: calc(100% + 8px);
|
|
1238
2426
|
left: 0;
|
|
@@ -1246,18 +2434,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1246
2434
|
border-radius: 12px;
|
|
1247
2435
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1248
2436
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
1249
|
-
`,
|
|
2437
|
+
`,s$=f.div`
|
|
1250
2438
|
display: flex;
|
|
1251
2439
|
align-items: center;
|
|
1252
2440
|
gap: 8px;
|
|
1253
2441
|
width: 100%;
|
|
1254
|
-
`,
|
|
2442
|
+
`,c$=f.div`
|
|
1255
2443
|
display: flex;
|
|
1256
2444
|
flex-direction: column;
|
|
1257
2445
|
gap: 0;
|
|
1258
2446
|
max-height: 240px;
|
|
1259
2447
|
overflow-y: auto;
|
|
1260
|
-
`,
|
|
2448
|
+
`,d$=f.div`
|
|
1261
2449
|
display: flex;
|
|
1262
2450
|
align-items: center;
|
|
1263
2451
|
gap: 8px;
|
|
@@ -1268,41 +2456,41 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1268
2456
|
&:hover {
|
|
1269
2457
|
background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
|
|
1270
2458
|
}
|
|
1271
|
-
`,
|
|
2459
|
+
`,p$=f.div`
|
|
1272
2460
|
flex: 1;
|
|
1273
2461
|
min-width: 0;
|
|
1274
2462
|
overflow: hidden;
|
|
1275
2463
|
text-overflow: ellipsis;
|
|
1276
2464
|
white-space: nowrap;
|
|
1277
|
-
`,
|
|
2465
|
+
`,u$=f.div`
|
|
1278
2466
|
display: flex;
|
|
1279
2467
|
align-items: center;
|
|
1280
2468
|
gap: 2px;
|
|
1281
2469
|
flex-shrink: 0;
|
|
1282
|
-
`,
|
|
2470
|
+
`,h$=f.div`
|
|
1283
2471
|
display: flex;
|
|
1284
2472
|
padding-top: 4px;
|
|
1285
2473
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1286
|
-
`,
|
|
2474
|
+
`,g$=()=>{const n=v(),{isK8s:l}=x(),{clearStore:s}=cr(),{dataStreamsApi:c}=ws();c.useDataStreams();const{dataStreams:d,selectedStreamName:u,setSelectedStreamName:h}=nt(),g=p(null),[m,b]=r(!1),[f,y]=r(""),[S,C]=r(""),[w,k]=r(!1),[T,$]=r(!1),[I,N]=r(!1),[O,A]=r(""),[E,D]=r(!1);Ai(g,()=>b(!1)),o(()=>{m||y("")},[m]);const R=a(()=>{if(!f)return d;const e=f.toLowerCase();return d.filter(({name:t})=>t.toLowerCase().includes(e))},[d,f]),L=m?jr:Hr;return l?e(i,{children:[e(o$,{ref:g,children:[e(r$,{"data-id":"data-stream-select",$isOpen:m,onClick:()=>b(e=>!e),children:[t(Vl,{size:24}),t(ee,{size:te.S,weight:500,nowrap:!0,children:(P=u,`Data Stream: ${P}`)}),t(ce,{label:d.length,status:Le.Unknown,textSize:te.XXXS}),t(L,{size:20,fill:n.v2.colors.silver[200]})]}),m&&e(l$,{children:[t(s$,{children:t(vi,{value:f,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(c$,{children:0===R.length?t(d$,{children:t(ee,{size:te.XS,color:ie.Secondary,children:"No streams match"})}):R.map(({name:i})=>{const n=i===dr;return e(d$,{"data-id":`stream-row-${i}`,$selected:i===u,onClick:()=>(e=>{e!==u&&(s(),h(e)),b(!1)})(i),children:[t(p$,{children:t(ee,{size:te.XS,nowrap:!0,children:i})}),e(u$,{children:[t(yt,{"data-id":`stream-edit-${i}`,icon:zr,size:St.XS,onClick:e=>{e.stopPropagation(),b(!1),C(i),k(!0)}}),!n&&t(yt,{"data-id":`stream-delete-${i}`,icon:Dr,size:St.XS,onClick:e=>{e.stopPropagation(),b(!1),A(i),D(!0)}})]})]},`stream-${i}`)})}),t(h$,{children:t(ke,{"data-id":"add-stream-trigger",variant:$e.Secondary,size:Te.S,leftIcon:Rr,label:`${zt.NEW} ${it.STREAM_NAME}`,fullWidth:!0,onClick:()=>{b(!1),s(),N(!0),$(!0)}})})]})]}),I&&t(js,{defaultExcludeName:u,children:t(Gm,{isOpen:T,onClose:()=>$(!1),onCloseEnd:()=>N(!1)})}),S&&t(js,{children:t(Km,{isOpen:w,dataStreamName:S,onClose:()=>k(!1),onCloseEnd:()=>C("")})}),t(gs,{target:`${it.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:E,onClose:()=>D(!1),onApprove:async()=>{O&&await c.remove(O)}})]}):null;var P},m$=f(oe)`
|
|
1287
2475
|
width: 100%;
|
|
1288
2476
|
max-height: 320px;
|
|
1289
2477
|
overflow-y: auto;
|
|
1290
2478
|
gap: 8px;
|
|
1291
|
-
`,
|
|
2479
|
+
`,b$=f(ne)`
|
|
1292
2480
|
width: 100%;
|
|
1293
2481
|
align-items: center;
|
|
1294
2482
|
gap: 8px;
|
|
1295
2483
|
padding: 8px 12px;
|
|
1296
2484
|
border-radius: 8px;
|
|
1297
2485
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1298
|
-
`,
|
|
2486
|
+
`,f$=()=>{const n=v(),{selectedStreamName:l}=nt(),{selectedSources:s,setSelectedSources:c}=Zo(),{sourcesApi:p}=ws(),[u,h]=r(!1),[g,m]=r(!1),[b,f]=r(!1),[y,S]=r(!1),{toInstrument:x,toUninstrument:C,totalSelected:w}=a(()=>{const e=[],t=[];return Object.values(s).forEach(i=>{i.forEach(i=>{(e=>!1===e.markedForInstrumentation?.markedForInstrumentation)(i)?e.push(i):t.push(i)})}),{toInstrument:e,toUninstrument:t,totalSelected:e.length+t.length}},[s]),k=d(()=>{c({})},[c]),T=d(()=>h(!1),[]),$=d(()=>m(!1),[]),I=d(()=>f(!1),[]),N=d(()=>S(!1),[]);o(()=>{k()},[l,k]);const O=d((e,t)=>{if(!e.length)return;const i=new Map;e.forEach(e=>{const t=e.id.namespace,n=i.get(t)??[];n.push(e),i.set(t,n)}),p.persistV2(Object.fromEntries([...i.entries()].map(([e,i])=>[e,i.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,...e.region?{region:e.region}:{},selected:t,currentStreamName:l}))])))},[p,l]),A=d(()=>{p.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==$i.StaticPod).map(xi)),k()},[p,s,k]),E=d(()=>{O(x,!0),k()},[O,x,k]),D=d(()=>{O(C,!1),k()},[O,C,k]),R=d(()=>{O(x,!0),O(C,!1),k()},[O,x,C,k]),L=x.length>0,P=C.length>0,M=L&&P,z=a(()=>{const e=[{id:"multi-source-deselect",type:fi.Button,buttonProps:{variant:$e.Text,size:Te.S,label:"Deselect",onClick:k}},{id:"multi-source-restart",type:fi.Button,buttonProps:{variant:$e.Secondary,size:Te.S,label:"Restart",leftIcon:ml,onClick:()=>h(!0)}}];return M?e.push({id:"multi-source-apply",type:fi.Button,buttonProps:{variant:$e.Primary,size:Te.S,label:"Apply Changes",leftIcon:Rr,onClick:()=>S(!0)}}):L?e.push({id:"multi-source-instrument",type:fi.Button,buttonProps:{variant:$e.Primary,size:Te.S,label:"Instrument",leftIcon:Rr,onClick:()=>f(!0)}}):P&&e.push({id:"multi-source-uninstrument",type:fi.Button,buttonProps:{variant:$e.Primary,size:Te.S,label:"Uninstrument",leftIcon:Dr,onClick:()=>m(!0)}}),e},[k,M,L,P]),X=e=>ir(e,It.Source,{extended:!0})||e.id.name;return e(i,{children:[t(Hi,{isOpen:w>0,richTitle:{icon:Yr,title:"Selected sources",badge:{label:w}},actions:z}),t(tt,{isOpen:u,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:T,denyButton:{label:"Go Back",variant:$e.Secondary,onClick:T},approveButton:{label:"Confirm",variant:$e.Primary,onClick:()=>{A(),T()}}}),t(gs,{isOpen:b,action:"instrument",target:`${x.length} source${1===x.length?"":"s"}`,onClose:I,onDeny:I,onApprove:E}),t(gs,{isOpen:g,action:"uninstrument",target:`${C.length} source${1===C.length?"":"s"}`,onClose:$,onDeny:$,onApprove:D}),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:$e.Secondary,label:"Cancel",onClick:N},approveButton:{variant:$e.Primary,label:"Confirm",onClick:()=>{R(),N()}},children:e(m$,{children:[x.map(i=>e(b$,{children:[t(ce,{leftIcon:Rr,status:Le.Success,useSecondaryTone:!0,textColor:n.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ie.Primary,children:X(i)})]},`instrument-${i.id.namespace}-${i.id.kind}-${i.id.name}-${i.id.region??""}`)),C.map(i=>e(b$,{children:[t(ce,{leftIcon:bl,status:Le.Error,useSecondaryTone:!0,textColor:n.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ie.Primary,children:X(i)})]},`uninstrument-${i.id.namespace}-${i.id.kind}-${i.id.name}-${i.id.region??""}`))]})})]})},v$=S`
|
|
1299
2487
|
0% {
|
|
1300
2488
|
background-position: 200% 50%;
|
|
1301
2489
|
}
|
|
1302
2490
|
100% {
|
|
1303
2491
|
background-position: 0% 50%;
|
|
1304
2492
|
}
|
|
1305
|
-
`,
|
|
2493
|
+
`,y$=f.div`
|
|
1306
2494
|
display: flex;
|
|
1307
2495
|
align-items: center;
|
|
1308
2496
|
justify-content: space-evenly;
|
|
@@ -1313,43 +2501,43 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1313
2501
|
|
|
1314
2502
|
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%)`};
|
|
1315
2503
|
background-size: 200% 100%;
|
|
1316
|
-
animation: ${
|
|
1317
|
-
`,
|
|
2504
|
+
animation: ${v$} 15s linear infinite;
|
|
2505
|
+
`,S$=({onRedirectToSampling:i})=>{const n=v(),{capabilities:o}=ws(),r=a(()=>{const e=[];return o.canManageInstrumentationRules&&e.push(Wr),e.push(Yr),o.canManageActions&&e.push(Er),e.push(Ur),e},[o.canManageActions,o.canManageInstrumentationRules]);return e(So,{children:[e(ut,{fullHeight:!0,customTitle:t(g$,{}),customSearch:t(n$,{}),filters:t(TT,{}),children:[t(y$,{children:r.map((i,a)=>e(l,{children:[t(i,{size:24}),a<r.length-1&&t(Ar,{fill:n.v2.colors.white[500]+ae["020"],size:24})]},i.name))}),t(WT,{})]}),t(a$,{onRedirectToSampling:i}),t(f$,{})]})};var x$;(e=>{e.Gateway="gateway",e.Node="node"})(x$||(x$={}));const C$=({onClickDownloadDiagnose:i,onClickRefresh:n,loading:o,disabled:r})=>{const l=a(()=>{const e=[];return i&&e.push({id:Kn(),type:fi.Button,buttonProps:{label:"Download Diagnose",leftIcon:Cl,size:Te.S,variant:$e.Text,onClick:i,disabled:r}}),n&&e.push({id:Kn(),type:fi.Button,buttonProps:{label:"Refresh",leftIcon:ol,size:Te.S,variant:$e.Text,onClick:n,disabled:r,loading:o}}),e},[i,n,r,o]);return e(ne,{$alignItems:"center",$justifyContent:"space-between",children:[t(xo,{icon:Ul,title:"Collectors Pipeline"}),t(Co,{actions:l})]})},w$=({pod:i,onClose:n})=>{const{formatTimeAgo:o}=oi(),{collectorsApi:r}=ws(),{data:l}=r.usePodInfo(i?{namespace:i.namespace,name:i.name}:void 0,{skip:!i}),s=a(()=>[{id:Kn(),title:"Node",label:l?.node??"-",withCopy:!0},{id:Kn(),title:"Status",badge:{status:pr(l?.status),label:l?.status??"-"}}],[l]),c=a(()=>l?.containers?.map(e=>({id:Kn(),items:[{id:Kn(),title:"Container",label:e.name??"-"},{id:Kn(),title:"Status",label:e.startedAt?`${e.status} (since ${o(e.startedAt)})`:e.status},{id:Kn(),title:"Ready",badge:{status:e.ready?Le.Success:Le.Error,leftIcon:e.ready?Br:Vr,label:e.ready?"True":"False",invertColors:!0}},{id:Kn(),title:"Started",badge:{status:e.started?Le.Success:Le.Error,leftIcon:e.started?Br:Vr,label:e.started?"True":"False",invertColors:!0}},{id:Kn(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Kn(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Kn(),title:it.RESTARTS,label:e.restarts.toString()},{id:Kn(),title:"State Reason",label:e.stateReason??"-"},{id:Kn(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Kn(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[l]);return t(Ft,{isOpen:!!i,header:{icon:ll,title:"Pod Information",onClose:n},children:l?e(Gt,{bgTint:"1000",richTitle:{icon:ll,title:l.name,withCopy:!0},children:[t(Gt,{bgTint:"900",cellsPerRow:2,items:s}),e(Gt,{bgTint:"900",richTitle:{icon:gl,title:it.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(bi,{value:`kubectl get pod ${l.name} -n ${l.namespace} -o yaml`}),t(bi,{value:`kubectl describe pod ${l.name} -n ${l.namespace}`}),t(bi,{value:`kubectl logs ${l.name} -n ${l.namespace}`})]}),t(Gt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:i})=>t(Gt,{bgTint:"800",cellsPerRow:2,items:i},e)):t(Ae,{title:"No containers",subTitle:"Pod has no containers"})}),t(ms,{bgTint:"900",yaml:l.manifestYAML,defaultOpen:!0})]}):t(bt,{$height:"50vh",children:t(xt,{withSpinner:!0})})})};var k$;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(k$||(k$={}));const T$=e=>{const t=[{key:k$.PodName,label:"Pod Name"},{key:k$.Status,label:"Status"},{key:k$.Restarts,label:it.RESTARTS},{key:k$.NodeName,label:"Node Name"},{key:k$.Age,label:"Age"},{key:k$.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:k$.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},$$=({isLoading:i,pods:n,withSpanDropRate:o})=>{const l=v(),{formatTimeAgo:s}=oi(),[c,d]=r(null),p=a(()=>n.map(i=>({onClick:()=>d(i),cells:[{key:k$.PodName,rawValue:i.name},{key:k$.Status,rawValue:i.status,component:()=>{return e=i.status,t(ce,{status:pr(e),label:e});var e}},{key:k$.Restarts,rawValue:i.restartsCount.toString()},{key:k$.NodeName,rawValue:i.nodeName},{key:k$.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=i;if(!n)return t(ee,{children:"-"});const a=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),o=a>0?Math.round((n?.metricsDroppedRps??0)/a*100):0,r=o>0?Le.Error:Le.Success,l=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=l>0?Math.round((n?.exporterFailedRps??0)/l*100):0,c=s>0?Le.Error:Le.Success;return e(ne,{$gap:4,children:[t(Be,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(ce,{status:r,label:`Receiver ${o}%`,leftIcon:r===Le.Error?jl:Hl,useSecondaryTone:!0,invertColors:!0})}),t(Be,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(ce,{status:c,label:`Exporter ${s}%`,leftIcon:c===Le.Error?jl:Hl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:k$.Age,rawValue:s(i.creationTimestamp)},{key:k$.DockerImage,rawValue:i.image}]})),[n,l]);return e(Gt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:ll,title:"Pods"},children:[t(Ui,{variant:ji.Data,isLoading:i,columns:T$(o),rows:p}),t(w$,{pod:c,onClose:()=>d(null)})]})},I$=({isOpen:e,onClose:i,title:n,yaml:a})=>t(Ft,{isOpen:e,header:{icon:Gl,title:n,onClose:i},children:t(ms,{yaml:a,defaultOpen:!0})}),N$=e=>{switch(e){case ur.Healthy:return"All desired replicas are updated, available, and ready";case ur.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case ur.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case ur.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case ur.Down:return"No available replicas";case ur.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var O$;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(O$||(O$={}));const A$=f.div`
|
|
1318
2506
|
flex: 0.5;
|
|
1319
2507
|
padding: 12px;
|
|
1320
2508
|
border-radius: 12px;
|
|
1321
2509
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1322
|
-
`,
|
|
2510
|
+
`,E$=({selectedTab:i,gatewayInfo:n,nodeCollectorInfo:o,isLoading:l})=>{const{formatTimeAgo:s}=oi(),[c,d]=r(null),p=a(()=>(e=>{switch(e){case x$.Gateway:return"Deployment";case x$.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(i),[i]),u=a(()=>((e,t,i,n)=>{const a={status:Le.Disabled,label:"No rollouts yet"};let o=!1,r=null;switch(e){case x$.Gateway:o=t?.rolloutInProgress??!1,r=t?.lastRolloutAt??null;break;case x$.Node:o=i?.rolloutInProgress??!1,r=i?.lastRolloutAt??null;break;default:return a}return o?{status:Le.Info,label:"Rollout in progress",rightIcon:ol,useSecondaryTone:!0}:r?{status:Le.Disabled,label:`Last Rollout: ${n(r)}`}:a})(i,n,o,s),[n,o,i,s]),h=a(()=>((e,t,i,n)=>{let a=n?Le.Info:Le.Unknown,o=n?"Loading":ur.Unknown,r=n?"Fetching data...":N$(ur.Unknown);switch(e){case x$.Gateway:a=t?.status?pr(t?.status):a,o=t?.status??o,r=t?.status?N$(t.status):r;break;case x$.Node:a=i?.status?pr(i?.status):a,o=i?.status??o,r=i?.status?N$(i.status):r}return{status:a,title:o,description:r}})(i,n,o,l),[n,o,i,l]),g=a(()=>((e,t,i)=>{switch(e){case x$.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 x$.Node:return[{gaugeWidth:128,min:0,max:i?.nodes?.desired??0,current:i?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(i,n,o),[n,o,i]),m=a(()=>((e,t,i,n)=>{switch(e){case x$.Gateway:return[{title:"Data throughput",cells:[{label:"Traces data",value:Ni(t?.throughputTracesBytesPerSec??0),isLoading:n},{label:"Metrics data",value:Ni(t?.throughputMetricsBytesPerSec??0),isLoading:n},{label:"Logs data",value:Ni(t?.throughputLogsBytesPerSec??0),isLoading:n}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:n}]}];case x$.Node:return[{title:"Data Throughput",cells:[{label:"Traces data",value:Ni(i?.throughputTracesBytesPerSec??0),isLoading:n},{label:"Metrics data",value:Ni(i?.throughputMetricsBytesPerSec??0),isLoading:n},{label:"Logs data",value:Ni(i?.throughputLogsBytesPerSec??0),isLoading:n}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${i?.resources?.requests.cpu}/${i?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${i?.resources?.requests.memory}/${i?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(i,n,o,l),[n,o,i,l]),b=a(()=>(i===x$.Gateway?n?.manifestYAML:o?.manifestYAML)??"",[n,o,i]),f=a(()=>(i===x$.Gateway?n?.configMapYAML:o?.configMapYAML)??"",[n,o,i]);return e(Gt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Gl,title:p,badge:u},actions:[{id:Kn(),type:fi.ButtonDropData,buttonProps:{variant:$e.Secondary,size:Te.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:O$.ManifestYaml,label:p,icon:Kl},{id:O$.ConfigMapYaml,label:"ConfigMap",icon:Kl}]}}],children:[e(ne,{$gap:16,children:[t("div",{children:t(hr,{...h})}),g.map(e=>t(A$,{children:t("div",{children:t(Fo,{...e})})},e.title)),m.map(e=>t(wo,{...e},e.title))]}),t(I$,{isOpen:c===O$.ManifestYaml,onClose:()=>d(null),title:p,yaml:b}),t(I$,{isOpen:c===O$.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:f})]})},D$=[{value:x$.Gateway,label:"Gateway"},{value:x$.Node,label:"Node Collector"}],R$=({minSupportedVersion:i})=>{const{isVersionSupported:n,version:o,minSupportedVersion:l}=x(i),[s,c]=r(x$.Gateway),p=s===x$.Gateway,u=s===x$.Node,{collectorsApi:h,configApi:g}=ws(),{data:m}=g.useEffectiveConfig(),{data:b,loading:f,refetch:v}=h.useGatewayInfo({skip:!p}),{data:y=[],loading:S,refetch:C}=h.useGatewayPods({skip:!p}),{data:w,loading:k,refetch:T}=h.useNodeCollectorInfo({skip:!u}),{data:$=[],loading:I,refetch:N}=h.useNodeCollectorPods({skip:!u}),O=p&&(f||S)||u&&(k||I),A=d(()=>{p?(v(),C()):u&&(T(),N())},[p,u,v,C,T,N]),E=a(()=>p?y:$,[y,$,p]);return e(So,{children:[t(C$,{disabled:!n,loading:O,onClickDownloadDiagnose:void 0,onClickRefresh:A}),e(Uo,{children:[e(oe,{children:[t(ve,{variant:Vi.Underline,size:Xt.L,options:D$,selected:s,setSelected:c}),t(E$,{selectedTab:s,gatewayInfo:b??null,nodeCollectorInfo:w??null,isLoading:O})]}),t($$,{isLoading:O,pods:E,withSpanDropRate:!1===m?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!n&&t(ys,{minSupportedVersion:l,currentVersion:o||""})]})]})},L$=f.div`
|
|
1323
2511
|
display: inline-flex;
|
|
1324
2512
|
align-items: center;
|
|
1325
2513
|
min-width: 0;
|
|
1326
2514
|
overflow: hidden;
|
|
1327
2515
|
white-space: pre;
|
|
1328
2516
|
text-overflow: ellipsis;
|
|
1329
|
-
`,
|
|
2517
|
+
`,P$=f.div`
|
|
1330
2518
|
display: flex;
|
|
1331
2519
|
flex-direction: column;
|
|
1332
2520
|
gap: 4px;
|
|
1333
2521
|
min-width: 0;
|
|
1334
2522
|
flex: 1;
|
|
1335
2523
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
1336
|
-
`,
|
|
2524
|
+
`,M$=f(ne)`
|
|
1337
2525
|
flex-shrink: 0;
|
|
1338
2526
|
gap: 6px;
|
|
1339
2527
|
align-items: center;
|
|
1340
2528
|
min-height: 22px;
|
|
1341
|
-
`,
|
|
2529
|
+
`,z$=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],X$=[{value:"all",label:gr},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],_$=({title:i,items:n,isLoading:o,showTypeFilter:l,onRuleClick:s,onCreateRule:c,onEditRule:p,onDeleteRule:u})=>{const h=v(),[g,m]=r(""),[b,f]=r("all"),y=a(()=>{let e=((e,t,i)=>i&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(n,b,l);return e=((e,t)=>{if(!t.trim())return e;const i=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(i),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(i)})})(e,g),e},[n,b,l,g]),S=a(()=>y.map(i=>{const n=i.typeBadge?((e,t)=>{const i=e.v2.colors;switch(t){case"Relevance":return{bg:i.blue[700],text:i.white[500]};case"Duration":return{bg:i.purple[700],text:i.white[500]};case"Error":return{bg:i.red[500],text:i.black[500]}}})(h,i.typeBadge):void 0;return{cells:[{key:"content",rawValue:i.summary.map(e=>e.text).join(""),component:()=>e(P$,{$disabled:i.disabled,children:[t(L$,{children:t(w,{parts:i.summary})}),i.name&&t(ee,{size:te.XXS,color:ie.Secondary,nowrap:!0,children:i.name})]})},{key:"badges",rawValue:i.typeBadge||"",component:()=>e(M$,{children:[i.disabled&&t(ce,{label:Gi,textSize:te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),i.typeBadge&&n&&t(ce,{label:i.typeBadge,textSize:te.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>s(i)}}),[y,h,s]),x=a(()=>{const e=e=>t(Mr,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),C=d(e=>{const t=S.indexOf(e);if(t<0)return[];const i=y[t];return i?[{id:"edit","data-id":"sampling-rule-action-edit",label:kn,leftIcon:zr,onClick:()=>p(i.ruleId,i.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:x,onClick:()=>u(i.ruleId,i.samplingId)}]:[]},[S,y,p,u,x]);return t(ut,{fullHeight:!0,richTitle:{icon:$l,title:i,badge:{label:n.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:g,onChange:m,placeholder:"Search..",width:"500px",...l?{segment:{"data-id":"sampling-segment-type-filter",options:X$,selected:b,setSelected:f}}:{}},children:t(Ui,{variant:ji.Pretty,hideHeader:!0,isLoading:o,noDataProps:g.trim()?{hideIcon:!0,title:mr,subTitle:vr(g)}:{hideIcon:!0,title:fr,button:{label:br,onClick:c}},columns:z$,rows:S,getRowActions:C})})},F$=({docsUrl:i})=>{const{samplingApi:n,sourcesApi:l}=ws(),{items:s}=l.useSources(),c=a(()=>s.map(e=>({id:e.id})),[s]),{items:u,loading:h,k8sHealthProbesConfig:g,refetch:m}=n.useSamplingRules(),b=d((e,t)=>n.createNoisy?.({samplingId:e,rule:t}),[n]),f=d((e,t,i)=>n.updateNoisy?.(t,{samplingId:e,rule:i}),[n]),v=d((e,t)=>n.createHighlyRelevant?.({samplingId:e,rule:t}),[n]),y=d((e,t,i)=>n.updateHighlyRelevant?.(t,{samplingId:e,rule:i}),[n]),S=d((e,t)=>n.createCostReduction?.({samplingId:e,rule:t}),[n]),x=d((e,t,i)=>n.updateCostReduction?.(t,{samplingId:e,rule:i}),[n]),C=d((e,t,i)=>"noisy"===i?n.deleteNoisy?.(t,e):"highlyRelevant"===i?n.deleteHighlyRelevant?.(t,e):"costReduction"===i?n.deleteCostReduction?.(t,e):void 0,[n]),w=d((e,t)=>n.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[n]),k=a(()=>c.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[c]),T=a(()=>Array.from(new Set(c.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[c]),[$,I]=r(P.Noisy),[N,O]=r(null),[A,R]=r(!1),[L,Q]=r(!1),[ee,te]=r(null),[ie,ae]=r(!1),[re,le]=r(!1),[se,ce]=r(!1),[de,pe]=r(!1);p(!1),o(()=>{},[h,u]);const{pendingViewSamplingRule:ue,setPendingViewSamplingRule:he}=Si();o(()=>{if(!ue)return;if(h||0===u.length)return;he(null);const e=M(u,ue.ruleId,ue.category);e&&(I(z[ue.category]),R(!1),O(e))},[h,u,ue,he]);const ge=a(()=>E(g),[g]),me=a(()=>X(u),[u]),be=a(()=>D(me?.rule??null),[me]),fe=a(()=>_(u),[u]),ye=a(()=>F(fe?.rule??null),[fe]),Se=p(N);Se.current=N,o(()=>{const e=Se.current;if(!e)return;const t=B(u,e);t?O(t):(O(null),R(!1))},[u]);const xe=a(()=>{const e=new Set;return me&&e.add(me.rule.ruleId),fe&&e.add(fe.rule.ruleId),e},[me,fe]),Ce=a(()=>V(u,$,xe),[u,$,xe]),we=d(()=>Q(!0),[]),Ie=d(()=>Q(!1),[]);d(()=>pe(!1),[]);const Ne=d(async e=>{const t=u[0]?.id??"default";switch(W[$]){case"noisy":await b(t,H(e));break;case"highlyRelevant":await v(t,j(e));break;case"costReduction":await S(t,U(e))}Q(!1)},[u,$,b,v,S]),Oe=d(e=>{const t=G(u,e);t&&(R(!1),O(t))},[u]),Ae=d(()=>{O(null),R(!1)},[]),Ee=d((e,t)=>{const i=N;if(i&&i.rule.ruleId===e&&i.samplingId===t)R(!0),O({...i});else for(const i of u){if(i.id!==t)continue;const n=[...i.noisyOperations.map(e=>({category:"noisy",rule:e})),...i.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...i.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return R(!0),void O({category:n.category,rule:n.rule,samplingId:t,summary:K(n.category,n.rule)})}},[N,u]),De=d(async(e,t,i)=>{const n=N?.category;if(n){switch(n){case"noisy":await f(i,t,H(e));break;case"highlyRelevant":await y(i,t,j(e));break;case"costReduction":await x(i,t,U(e))}R(!1)}},[N,f,y,x]),Pe=d((e,t)=>{te({ruleId:e,samplingId:t})},[]),Me=d(async()=>{if(!ee)return;const{ruleId:e,samplingId:t}=ee,i=N?.category||W[$];await C(t,e,i),O(null),R(!1),te(null)},[ee,N,$,C]),ze=d(()=>te(null),[]),Xe=d(async(e,t)=>{await w(e,t),ae(!1)},[w]),_e=d(async e=>{const t=u[0]?.id??"default",i=me;i?await y(i.samplingId,i.rule.ruleId,{name:i.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:i.rule.notes}):e&&await v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[u,me,v,y]),Fe=d(async(e,t)=>{const i=u[0]?.id??"default",n=fe;n?await x(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await S(i,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),ce(!1)},[u,fe,S,x]),Be=d(e=>{const t=W[$];let i=null;switch(t){case"noisy":{const n=H(e);i=Y(u,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=j(e);i=Y(u,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=U(e);i=Y(u,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return i?{message:yr,ruleId:i}:null},[u,$]),Ve=d(e=>{const t=N?.category,i=N?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const a=H(e);n=Y(u,t,{sourceScopes:a.sourceScopes,operation:a.operation},i);break}case"highlyRelevant":{const a=j(e);n=Y(u,t,{sourceScopes:a.sourceScopes,operation:a.operation,error:a.error??!1,durationAtLeastMs:a.durationAtLeastMs},i);break}case"costReduction":{const a=U(e);n=Y(u,t,{sourceScopes:a.sourceScopes,operation:a.operation},i);break}}return n?{message:yr,ruleId:n}:null},[u,N]),Ue=d(e=>{Q(!1);for(const t of u){const i=[...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(i)return R(!0),void O({category:i.category,rule:i.rule,samplingId:t.id,summary:K(i.category,i.rule)})}},[u]),je=a(()=>{const e=[];return i&&e.push({id:Kn(),type:fi.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Sr,leftIcon:Pr,size:Te.S,variant:$e.Text,onClick:()=>window.open(i,"_blank")}}),e.push({id:Kn(),type:fi.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:xr,leftIcon:ol,size:Te.S,variant:$e.Text,onClick:m,loading:h}}),e.push({id:Kn(),type:fi.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Cr,rightIcon:Rr,size:Te.S,variant:$e.Primary,onClick:we}}),e},[i,m,h,we]);return e(So,{children:[e(ne,{$gap:12,$justifyContent:"space-between",children:[t(xo,{icon:$l,title:kr,subTitle:wr}),t(Co,{actions:je})]}),e(oe,{$gap:12,$fullHeight:!0,children:[t(ve,{variant:Vi.Underline,size:Xt.L,options:q,selected:$,setSelected:I}),e(ne,{$justifyContent:"space-between",children:[t(Re,{status:Le.Default,message:J[$]}),i&&t(ke,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Pr,size:Te.S,variant:$e.Text,onClick:()=>window.open(i,"_blank")})]}),$===P.Noisy?t(is,{title:ct,summary:ge,onEdit:()=>ae(!0)}):$===P.HighlyRelevant?t(is,{title:at,summary:be,onEdit:()=>le(!0)}):$===P.CostReduction?t(is,{title:lt,summary:ye,onEdit:()=>ce(!0)}):null,t(_$,{title:Z[$],items:Ce,isLoading:h,showTypeFilter:$===P.HighlyRelevant,onRuleClick:Oe,onCreateRule:we,onEditRule:Ee,onDeleteRule:Pe})]}),t(Mm,{formType:Os.View,data:N,defaultEditMode:A,onClose:Ae,onDelete:Pe,onSaveEdit:De,sourceOptions:k,namespaceOptions:T,validateForm:Ve,onNavigateToDuplicate:Ue}),t(Mm,{formType:Os.Create,isOpen:L,category:W[$],onClose:Ie,onSubmit:Ne,sourceOptions:k,namespaceOptions:T,validateForm:Be,onNavigateToDuplicate:Ue}),t(Mm,{formType:Os.EditAutoNoisy,isOpen:ie,enabled:g?.enabled??!1,keepPercentage:g?.keepPercentage??0,onClose:()=>ae(!1),onSave:Xe}),t(Mm,{formType:Os.EditAutoHighlyRelevant,isOpen:re,enabled:!!me&&!me.rule.disabled,onClose:()=>le(!1),onSave:_e}),t(Mm,{formType:Os.EditAutoCostReduction,isOpen:se,enabled:!!fe&&!fe.rule.disabled,dropPercentage:fe?.rule.percentageAtMost??25,onClose:()=>ce(!1),onSave:Fe}),t(tt,{title:Nr,description:Ir,isOpen:!!ee,onClose:ze,denyButton:{label:$r,variant:$e.Secondary,onClick:ze},approveButton:{label:Tr,variant:$e.Primary,onClick:()=>{Me(),ze()}}}),!1]})},B$=f.div`
|
|
1342
2530
|
padding: 12px;
|
|
1343
2531
|
border-radius: 12px;
|
|
1344
2532
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
1345
|
-
`,
|
|
1346
|
-
border: 1px ${({theme:e,$isSelected:t,$isVirtual:
|
|
2533
|
+
`,V$=b(({id:e,data:i})=>t(B$,{"data-id":e,children:t(Ae,{...i})}));var U$,j$;V$.displayName=V$.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(U$||(U$={})),(e=>{e.AnimatedTraffic="animated-traffic"})(j$||(j$={}));const H$=(e,t,i)=>{if(i)return{icons:[hl],aggService:e,selected:!0};const n=e.isVirtual,a=n?[Ci(e)]:t?wi(t):[Wl],{priorotizedStatus:o}=n?{priorotizedStatus:void 0}:tr(t?.conditions||[]);return{icons:a,status:o,isVirtual:n,aggService:e,selected:!0}},G$=e=>!(!e||e.serviceName!==Gu||e.id.namespace||e.id.name||e.id.kind),K$=new rc,W$={"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"},Y$=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},q$={id:{namespace:"",name:"",kind:""},serviceName:Gu,markedForInstrumentation:{markedForInstrumentation:!0}},J$=h(null),Z$=()=>{const e=g(J$);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},Q$=({serviceMap:e,children:i})=>{const n=v(),{sourcesApi:l}=ws(),{items:s}=l.useSources(),[c,p,u]=Zs([]),[h,g,m]=Qs([]),[b,f]=r(0),y=d(()=>f(e=>e+1),[]),[S,x]=r(""),[C,w]=r(null),[k,T]=r(null),$=d(e=>T(t=>t===e?null:e),[]),I=d(()=>T(null),[]),N=d((e,t)=>{const i=new Set(e);p(e=>e.map(e=>e.type===U$.MapItem&&i.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[p]);o(()=>{let t=!1;const i=(e=>{const t=new Map,i=new Set,n=(e,i,n=!1)=>{let a=t.get(e);return a||(a={serviceName:i,isVirtual:n,attributes:{},connectionMap:new Map},t.set(e,a)),a},a=(e,t)=>{if(t)for(const{key:i,value:n}of t)i in e||(e[i]=n)};for(const t of e){const{graphKey:e}=Y$(t.nodeId),o=n(e,t.serviceName);o.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:r}=Y$(e?.nodeId??"");e.isVirtual&&(i.add(t),a(n(t,e.serviceName,!0).attributes,e.nodeAttributes));let l=o.connectionMap.get(t);if(l||(l={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},o.connectionMap.set(t,l)),l.totalRequests+=e.requests,e.dateTime>l.lastDateTime&&(l.lastDateTime=e.dateTime),r){const t=l.details.find(e=>e.value===r);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):l.details.push({value:r,requests:e.requests,dateTime:e.dateTime})}}}const o=[...t.entries()];for(const[,{connectionMap:e}]of o)for(const[a,o]of e)t.has(a)||n(a,o.targetServiceName,i.has(a));const r=[];for(const[e,{serviceName:i,isVirtual:n,attributes:a,connectionMap:o}]of t){const t=[...o.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),r.push({graphKey:e,serviceName:i,isVirtual:n,connections:t,attributes:a})}return r.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),r})(e),a=(({sources:e,aggregatedServiceMap:t})=>{const i=[],n={x:0,y:0};if(t.length&&e.length)for(const a of t){const t=e.find(e=>a.serviceName===e.serviceName||a.serviceName===e.id.name),o=G$(t);i.push({id:a.graphKey,type:U$.MapItem,position:n,data:H$(a,t,o),measured:{width:80,height:80}})}else i.push({id:U$.NoData,type:U$.NoData,position:n,data:{subTitle:it.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return i})({aggregatedServiceMap:i,sources:[q$].concat(s)});if(1===a.length&&a[0].id===U$.NoData)return p(a),g([]),x(""),void y();const o=(({theme:e,nodes:t,aggregatedServiceMap:i})=>{const n=[],a=new Map(t.map(e=>[e.id,e]));for(const t of i){const i=t.graphKey,o=a.get(i);if(!o)continue;const r=o.data?.status===Le.Error;for(const o of t.connections){const l=o.targetGraphKey;a.has(l)&&n.push({id:`${i}-to-${l}`,type:"smoothstep",source:i,target:l,data:{sourceGraphKey:t.graphKey,targetGraphKey:o.targetGraphKey},markerEnd:{type:qs.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})}}return n})({theme:n,nodes:a,aggregatedServiceMap:i});g(o);const r=a.map(e=>e.id).sort().join("|");if(r!==S)return(async(e,t,i={})=>{const n={id:"root",layoutOptions:{...W$,...i},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Gu?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},a=await K$.layout(n),o=new Map;return a.children?.forEach(e=>{o.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:o.get(e.id)??e.position})),edges:t}})(a,o).then(({nodes:e})=>{t||(p(e),x(r),y())}),()=>{t=!0};p(e=>{const t=new Map(e.map(e=>[e.id,e]));return a.map(e=>{const i=t.get(e.id);return i?e.type===U$.MapItem&&i.type===U$.MapItem?{...e,position:i.position,data:{...e.data,selected:i.data.selected}}:{...e,position:i.position}:e})})},[n,e,s,S]);const O=a(()=>C||k?h.map(e=>{if(e.source===C||e.target===C||e.source===k||e.target===k)return{...e,type:j$.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,C,k]),A=a(()=>({nodes:c,edges:O,onNodesChange:u,onEdgesChange:m,setNodesSelected:N,fitViewTrigger:b,hoveredNodeId:C,setHoveredNodeId:w,activeNodeId:k,toggleActiveNode:$,resetActiveNode:I}),[c,O,u,m,N,b,C,k,$,I]);return t(J$.Provider,{value:A,children:i})},eI=f.div`
|
|
2534
|
+
border: 1px ${({theme:e,$isSelected:t,$isVirtual:i})=>t?`solid ${e.v2.colors.blue[300]}`:i?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
|
|
1347
2535
|
border-radius: 8px;
|
|
1348
2536
|
cursor: pointer;
|
|
1349
2537
|
opacity: ${({$isVirtual:e})=>e?.8:1};
|
|
1350
|
-
`,
|
|
2538
|
+
`,tI=f.div`
|
|
1351
2539
|
position: relative;
|
|
1352
|
-
`,
|
|
2540
|
+
`,iI=f.div`
|
|
1353
2541
|
position: absolute;
|
|
1354
2542
|
top: 100%;
|
|
1355
2543
|
left: 50%;
|
|
@@ -1358,7 +2546,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1358
2546
|
align-items: center;
|
|
1359
2547
|
gap: 4px;
|
|
1360
2548
|
margin-top: 4px;
|
|
1361
|
-
`,
|
|
2549
|
+
`,nI=b(({id:n,data:o})=>{const{icons:r,status:l,isVirtual:s}=o,c=v(),{activeNodeId:d,hoveredNodeId:p}=Z$(),{isUserSource:u,isNodeSelected:h,isHovered:g}=a(()=>({isUserSource:n===Gu,isNodeSelected:d===n,isHovered:p===n}),[n,d,p,n]),{isSelected:m,isHighlighted:b}=a(()=>({isSelected:h||u,isHighlighted:h||g||u}),[h,g,u]),f=l?zi(l,c):null;return e(i,{children:[t(Hs,{type:"source",position:Gs.Right,style:{visibility:"hidden"}}),t(Hs,{type:"target",position:Gs.Left,style:{visibility:"hidden"}}),e(tI,{"data-id":n,children:[t(eI,{$isSelected:m,$isVirtual:s,children:t(ki,{padding:12,icons:r,status:b?Le.Info:l})}),e(iI,{children:[f&&t(f,{}),t(ee,{size:te.XXS,nowrap:!0,children:n})]})]})]})});nI.displayName=nI.name;const aI=f.div`
|
|
1362
2550
|
display: flex;
|
|
1363
2551
|
flex-direction: column;
|
|
1364
2552
|
gap: 12px;
|
|
@@ -1370,11 +2558,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1370
2558
|
position: absolute;
|
|
1371
2559
|
top: 16px;
|
|
1372
2560
|
left: 8px;
|
|
1373
|
-
z-index: ${({theme:e})=>e.v2.zIndex.
|
|
1374
|
-
`,
|
|
2561
|
+
z-index: ${({theme:e})=>e.v2.zIndex.island};
|
|
2562
|
+
`,oI=({children:e})=>t(aI,{children:e});var rI,lI;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(rI||(rI={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(lI||(lI={}));const sI=f.div`
|
|
1375
2563
|
flex: 1 1 auto;
|
|
1376
2564
|
min-height: 0;
|
|
1377
|
-
`,
|
|
2565
|
+
`,cI=()=>{const{nodes:i,activeNodeId:n,resetActiveNode:o}=Z$(),[l,s]=r(rI.All),c=a(()=>{const e=new Map;for(const t of i)t.type===U$.MapItem&&e.set(t.id,t);return e},[i]),d=a(()=>c.get(n??""),[c,n]),{inbound:p,outbound:u}=a(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:lI.Outbound,totalRequests:e.totalRequests});for(const t of c.values())if(t.id!==d.id)for(const i of t.data.aggService?.connections??[])i.targetGraphKey===d.id&&e.push({peerId:t.id,direction:lI.Inbound,totalRequests:i.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=[rI.All,rI.Inbound].includes(l)&&p.length>0,g=[rI.All,rI.Outbound].includes(l)&&u.length>0;return e(oI,{children:[e(ne,{$width:"100%",$gap:8,children:[t(ke,{variant:$e.Text,size:Te.S,leftIcon:nl,onClick:o}),t(ki,{icons:d.data.icons}),t(ee,{size:te.XS,children:d.id})]}),t(ve,{fullWidth:!0,options:[{label:`${rI.All}`,value:rI.All,badge:{label:`${p.length+u.length}`}},{label:`${rI.Inbound}`,value:rI.Inbound,badge:{label:`${p.length}`}},{label:`${rI.Outbound}`,value:rI.Outbound,badge:{label:`${u.length}`}}],selected:l,setSelected:s}),h&&t(pI,{halfHeight:g,title:"Inbound",icon:pl,connections:p,mapNodesById:c}),g&&t(pI,{halfHeight:h,title:"Outbound",icon:ul,connections:u,mapNodesById:c})]})},dI=f.div`
|
|
1378
2566
|
display: flex;
|
|
1379
2567
|
flex-direction: column;
|
|
1380
2568
|
gap: 8px;
|
|
@@ -1382,17 +2570,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1382
2570
|
border-radius: 12px;
|
|
1383
2571
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1384
2572
|
height: ${({$halfHeight:e})=>e?"48%":"100%"};
|
|
1385
|
-
`,
|
|
2573
|
+
`,pI=({halfHeight:i,title:n,icon:a,connections:o,mapNodesById:r})=>{const l=v();return e(dI,{$halfHeight:i,children:[e(ne,{children:[t(a,{size:16,fill:l.v2.colors.grey[300]}),t(ee,{size:te.XXS,color:ie.Secondary,children:n})]}),t(sI,{children:t(yi,{gap:4,elements:o.map(e=>t(hI,{connection:e,peerNode:r.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},uI=f.div`
|
|
1386
2574
|
display: flex;
|
|
1387
2575
|
align-items: center;
|
|
1388
2576
|
gap: 8px;
|
|
1389
2577
|
padding: 8px;
|
|
1390
2578
|
border-radius: 8px;
|
|
1391
2579
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1392
|
-
`,
|
|
2580
|
+
`,hI=({connection:i,peerNode:n})=>e(uI,{children:[n&&t(ki,{icons:n.data.icons}),e(ne,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(ee,{size:te.XXS,children:i.peerId}),t(ce,{label:i.totalRequests,tooltip:"Total requests"})]})]}),gI="0;0.5;1",mI=b(({id:n,sourceX:a,sourceY:o,targetX:r,targetY:l,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=Ks({sourceX:a,sourceY:o,targetX:r,targetY:l,sourcePosition:s,targetPosition:c}),h=`${n}__animated-traffic-motion`,g=p.v2.colors.blue[700],m=p.v2.colors.blue[900],b=p.v2.colors.blue[500],f="4s";return e(i,{children:[t(Ws,{id:n,path:u,markerEnd:d,style:{stroke:g,strokeWidth:1}}),t(Ys,{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((i,n)=>{const a=`-${(.8*n).toFixed(3)}s`;return e("circle",{r:0,fill:m,children:[t("animateMotion",{dur:f,begin:a,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:f,begin:a,repeatCount:"indefinite",keyTimes:gI,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:f,begin:a,repeatCount:"indefinite",keyTimes:gI,values:`${m};${b};${b}`})]},n)})]})})]})});mI.displayName=mI.name;const bI=f.div`
|
|
1393
2581
|
flex: 1 1 auto;
|
|
1394
2582
|
min-height: 0;
|
|
1395
|
-
`,
|
|
2583
|
+
`,fI=({})=>{const{nodes:i,setNodesSelected:n,resetActiveNode:o}=Z$(),[l,s]=r(""),c=a(()=>i.filter(e=>e.type===U$.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[i]),p=a(()=>c.filter(e=>e.data.selected),[c]),u=a(()=>c.filter(e=>e.id.toLowerCase().includes(l.toLowerCase())),[c,l]),h=a(()=>u.every(e=>e.data.selected),[u]),g=d(()=>{const e=!h;n(u.map(e=>e.id),e),e||o()},[u,h,n,o]);return c.length?e(oI,{children:[e(ne,{$width:"100%",$gap:8,children:[t(ee,{size:te.XS,children:"Services"}),t(ce,{label:c.length})]}),t(vi,{width:"100%",value:l,onChange:s}),e(ne,{$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:g,disabled:!u.length,size:te.XS,children:h?it.UNSELECT_ALL:it.SELECT_ALL})]}),t(bI,{children:t(yi,{gap:4,elements:u.map(e=>t(yI,{node:e},e.id))})})]}):null},vI=f.div`
|
|
1396
2584
|
display: flex;
|
|
1397
2585
|
align-items: center;
|
|
1398
2586
|
gap: 8px;
|
|
@@ -1400,7 +2588,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1400
2588
|
border-radius: 8px;
|
|
1401
2589
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1402
2590
|
cursor: pointer;
|
|
1403
|
-
`,
|
|
2591
|
+
`,yI=({node:i})=>{const{setNodesSelected:n,activeNodeId:a,resetActiveNode:o}=Z$(),r=d(()=>{const e=!i.data.selected,t=a===i.id;n([i.id],e),!e&&t&&o()},[i,a,n,o]);return e(vI,{onClick:r,children:[t(Q,{value:i.data.selected||!1,onChange:r}),t(ki,{icons:i.data.icons}),t(ee,{size:te.XXS,children:i.id})]},i.id)},SI=f.div`
|
|
1404
2592
|
position: relative;
|
|
1405
2593
|
height: 100%;
|
|
1406
2594
|
.react-flow__attribution {
|
|
@@ -1409,7 +2597,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1409
2597
|
* {
|
|
1410
2598
|
transition: none;
|
|
1411
2599
|
}
|
|
1412
|
-
`,
|
|
2600
|
+
`,xI=f.div`
|
|
1413
2601
|
.react-flow__controls {
|
|
1414
2602
|
display: flex;
|
|
1415
2603
|
align-items: center;
|
|
@@ -1435,33 +2623,33 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1435
2623
|
}
|
|
1436
2624
|
}
|
|
1437
2625
|
}
|
|
1438
|
-
`,
|
|
2626
|
+
`,CI={[U$.MapItem]:nI,[U$.NoData]:V$},wI={[j$.AnimatedTraffic]:mI},kI={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},TI=({trigger:e})=>{const{fitView:t}=ic(),i=p(!0);return o(()=>{i.current?i.current=!1:e>0&&requestAnimationFrame(()=>t(kI))},[e,t]),null},$I=({onRefresh:i})=>{const{nodes:n,edges:o,fitViewTrigger:r,onNodesChange:l,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=Z$(),p=a(()=>{const e=new Set(n.filter(e=>e.type===U$.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const i of o)e.has(i.source)&&t.add(i.target),e.has(i.target)&&t.add(i.source);return n.filter(e=>e.type!==U$.MapItem||e.data.selected||t.has(e.id))},[n,o]);return e(ec,{zoomOnScroll:!0,nodes:p,nodeTypes:CI,edges:o,edgeTypes:wI,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:l,onEdgesChange:s,children:[t(tc,{}),t(TI,{trigger:r}),t(xI,{children:t(nc,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:kI,children:t(ac,{onClick:i,children:t(ol,{})})})})]})},II=i=>t(Js,{children:e(SI,{children:[t($I,{...i}),t(fI,{}),t(cI,{})]})}),NI=f.div`
|
|
1439
2627
|
width: 100%;
|
|
1440
2628
|
flex: 1;
|
|
1441
2629
|
align-self: stretch;
|
|
1442
2630
|
min-height: 0;
|
|
1443
2631
|
height: 100%;
|
|
1444
2632
|
position: relative;
|
|
1445
|
-
`,
|
|
2633
|
+
`,OI=()=>{const{serviceMapApi:e}=ws(),{data:i,refetch:n}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(Q$,{serviceMap:i?.serviceMap??[],children:t(NI,{children:t(II,{onRefresh:n})})})},AI=f.div`
|
|
1446
2634
|
display: flex;
|
|
1447
2635
|
align-items: center;
|
|
1448
2636
|
justify-content: space-between;
|
|
1449
2637
|
padding: 0 12px;
|
|
1450
|
-
`,
|
|
2638
|
+
`,EI=f.div`
|
|
1451
2639
|
display: flex;
|
|
1452
2640
|
align-items: center;
|
|
1453
2641
|
gap: 8px;
|
|
1454
|
-
`,
|
|
2642
|
+
`,DI=f.div`
|
|
1455
2643
|
width: 1px;
|
|
1456
2644
|
height: 20px;
|
|
1457
2645
|
background-color: ${({theme:e})=>e.v2.colors.silver[500]};
|
|
1458
|
-
`,
|
|
2646
|
+
`,RI=({disabled:i,loading:n,onClickShowYaml:o,onClickReset:l,onClickRefresh:s})=>{const c=v(),[d,p]=r(!1),u=a(()=>o?[{id:Kn(),type:fi.Button,buttonProps:{label:"Show Config YAML",leftIcon:Kl,size:Te.S,variant:$e.Secondary,onClick:o,disabled:i}}]:[],[o,i]),h=a(()=>{const e=[];return s&&e.push({id:Kn(),type:fi.Button,buttonProps:{leftIcon:ol,tooltip:"Refresh",hideTooltipIcon:!0,size:Te.S,variant:$e.Text,onClick:s,disabled:i,loading:n}}),l&&e.push({id:Kn(),type:fi.Button,buttonProps:{leftIcon:Dr,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:Te.S,variant:$e.Text,textColor:c.v2.colors.red[500],onClick:()=>p(!0),disabled:i}}),e},[i,n,l,s,c]),g=u.length>0,m=h.length>0;return e(AI,{children:[t(xo,{icon:rl,title:"Odigos Settings"}),e(EI,{children:[g&&t(Co,{actions:u}),g&&m&&t(DI,{}),m&&t(Co,{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:$e.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:$e.Primary,onClick:()=>{l?.(),p(!1)}}})]})},LI=f(oe)`
|
|
1459
2647
|
width: 220px;
|
|
1460
2648
|
flex-shrink: 0;
|
|
1461
2649
|
height: 100%;
|
|
1462
2650
|
gap: 4px;
|
|
1463
2651
|
overflow-y: auto;
|
|
1464
|
-
`,
|
|
2652
|
+
`,PI=({options:e,selected:i,setSelected:n,disabled:a})=>t(LI,{children:e.map(e=>t(uc,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:i===e.id,disabled:a,onClick:()=>n(e.id)},e.id))}),MI=f(oe)`
|
|
1465
2653
|
width: 100%;
|
|
1466
2654
|
/* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
|
|
1467
2655
|
max-width: 844px;
|
|
@@ -1471,25 +2659,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1471
2659
|
gap: 24px;
|
|
1472
2660
|
flex: 1;
|
|
1473
2661
|
min-height: 0;
|
|
1474
|
-
`,
|
|
2662
|
+
`,zI=f(ne)`
|
|
1475
2663
|
flex: 1;
|
|
1476
2664
|
min-height: 0;
|
|
1477
2665
|
width: 100%;
|
|
1478
2666
|
align-self: stretch;
|
|
1479
|
-
`,
|
|
2667
|
+
`,XI=f(oe)`
|
|
1480
2668
|
flex: 1;
|
|
1481
2669
|
min-height: 0;
|
|
1482
2670
|
height: 100%;
|
|
1483
2671
|
max-width: 600px;
|
|
1484
2672
|
overflow-y: auto;
|
|
1485
|
-
`,
|
|
2673
|
+
`,_I=f(ne)`
|
|
1486
2674
|
gap: 8px;
|
|
1487
2675
|
width: 100%;
|
|
1488
2676
|
align-items: center;
|
|
1489
|
-
`,
|
|
2677
|
+
`,FI=f.div`
|
|
1490
2678
|
flex: 1;
|
|
1491
2679
|
min-width: 0;
|
|
1492
|
-
`,
|
|
2680
|
+
`,BI=e=>"general"===e.name?0:"advanced"===e.name?2:1,VI=({minSupportedVersion:n})=>{const{isVersionSupported:l,version:s,isEnterprise:c,minSupportedVersion:d}=x(n),{configApi:p}=ws(),{data:u,loading:h}=p.useConfigYamls(),{data:g,loading:m,refetch:b}=p.useEffectiveConfig(),f=u?.configYamls??[],[v,y]=r(!1),S=a(()=>{if(!g)return{};const{manifestYAML:e,provenance:t,...i}=g;return i},[g]),{formData:C,handleFormChange:w,getNestedValue:k,getFormDiff:T,isFormDirty:$}=Jt(S);o(()=>{"{}"!==JSON.stringify(S)&&"{}"===JSON.stringify(C)&&w(void 0,void 0,S)},[S,C]);const I=a(()=>[...f].sort((e,t)=>BI(e)-BI(t)),[f]),N=a(()=>(e=>{if(!e)return{};const t={};for(const i of e)t[i.helmPath]=i.reconciledFrom;return t})(g?.provenance),[g?.provenance]),O=a(()=>{const e=new Set;for(const t of f)for(const i of t.fields)i.componentType===Ht.Dropdown&&e.add(i.helmValuePath);return e},[f]),A=a(()=>f.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:k("formData",e.helmValuePath)}))),[f,C,k]),[E,D]=r(!1),[R,L]=r(!1),P=a(()=>[{id:Kn(),type:fi.Button,buttonProps:{"data-id":"settings-save",variant:$e.Primary,size:Te.S,label:"Save Changes",leftIcon:Gr,loading:v,onClick:()=>D(!0)}},{id:Kn(),type:fi.Button,buttonProps:{"data-id":"settings-cancel",variant:$e.Secondary,size:Te.S,label:"Cancel",leftIcon:Kr,onClick:()=>w(void 0,void 0,S)}}],[v,T,S,C,w]),M=a(()=>I.map(e=>({id:e.name,label:e.displayName})),[I]),z=a(()=>I.map(e=>e.name),[I]),{selectedSection:X,setSelectedSection:_,setSectionRef:F,setScrollContainerRef:B}=Or({sectionNames:z});return t(So,{$gap:24,children:e(MI,{children:[t(RI,{disabled:!l,loading:h||m,onClickShowYaml:()=>L(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(b?.()),w(void 0,void 0,{})},onClickRefresh:b?()=>b():void 0}),e(Uo,{children:[!l&&t(ys,{minSupportedVersion:d,currentVersion:s||""}),t(Hi,{isOpen:$,richTitle:{icon:rl,title:"Config Settings"},actions:P}),t(tt,{isOpen:E,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:()=>D(!1),denyButton:{label:"Keep editing",variant:$e.Secondary,onClick:()=>D(!1)},approveButton:{label:"Save changes",variant:$e.Primary,onClick:()=>{(async()=>{const e=((e,t)=>{const i=(e,t,i)=>{for(let i=0;i<t.length-1;i++){const n=t[i];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=i},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=n;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&i(n,t,a.replaceAll("-","_"))}return n})(T(S,C),O);await(async e=>{p.updateLocalUiConfig&&(y(!0),await p.updateLocalUiConfig(e),y(!1),await b())})(e),w(void 0,void 0,{})})(),D(!1)}}}),e(zI,{$gap:24,$alignItems:"stretch",children:[!!f.length&&t(PI,{options:M,selected:X,setSelected:_,disabled:!l}),t(XI,{ref:B,$gap:24,$width:"100%",children:f.length?I.map(n=>t(ut,{id:n.name,bordered:!0,ref:e=>F(n.name,e),customTitle:t(ee,{size:te.M,weight:500,color:ie.Primary,children:n.displayName}),children:t(oe,{$gap:24,children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!c)return null;if(n.renderCondition&&!Qt(n.renderCondition,[],A))return null;const a=Tt(n.componentProps||"{}",{}),o=N[n.helmValuePath],r=n.componentType===Ht.Toggle,l=t(ee,{size:te.XS,weight:500,color:ie.Primary,children:n.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Le.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Le.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Le.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(o),d=s?t(ce,{...s}):null,p=n.description?t(ee,{size:te.XXS,color:ie.Secondary,children:n.description}):null,u=e(oe,{$gap:4,children:[e(ne,{$gap:8,$alignItems:"center",children:[l,d]}),p]}),h=t(xs,{componentType:n.componentType,inputType:a.type,name:n.helmValuePath,disabled:n.isHelmOnly||v,value:k("formData",n.helmValuePath),setValue:e=>w(n.helmValuePath,e),dropdownOptions:a.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Nt.S},n.helmValuePath),g=n.isHelmOnly?t(Be,{text:"This field can only be updated via the Helm values.yaml file",children:t(Yl,{})}):null;return t(oe,{$gap:8,children:r?e(ne,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(ne,{$gap:8,$alignItems:"center",children:[g,h]})]}):e(i,{children:[u,e(_I,{children:[t(FI,{children:h}),g]})]})},n.helmValuePath)})})},n.name)):h?t(bt,{$height:"30vh",children:t(xt,{withSpinner:!0})}):t(ut,{richTitle:{icon:rl,title:"Config Settings"},children:t(Ae,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(Ft,{isOpen:R,width:"40vw",minWidth:"480px",header:{icon:Kl,title:"Effective Config YAML",onClose:()=>L(!1)},children:m&&!g?.manifestYAML?t(bt,{$height:"30vh",children:t(xt,{withSpinner:!0})}):t(ms,{yaml:g?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},UI=f.div`
|
|
1493
2681
|
position: fixed;
|
|
1494
2682
|
bottom: 12px;
|
|
1495
2683
|
left: 12px;
|
|
@@ -1498,4 +2686,4 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
|
|
|
1498
2686
|
flex-direction: column-reverse;
|
|
1499
2687
|
gap: 6px;
|
|
1500
2688
|
max-width: 600px;
|
|
1501
|
-
`,
|
|
2689
|
+
`,jI=()=>{const{notifications:e,markAsDismissed:i,markAsSeen:n}=ii(),a=e.filter(({dismissed:e})=>!e);return t(UI,{children:a.map(({id:e,type:o,title:r,message:l},s)=>{const c=l||r;if(!c)return null;const d=a.length-s;return t(Re,{status:o,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{i(e),t&&n(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{od as AddActionDrawer,Mc as AddActionForm,Gm as AddDataStreamModal,md as AddDestinationDrawer,Xc as AddDestinationForm,bd as AddRuleDrawer,Gc as AddRuleForm,Dd as AddSourceDrawer,Qb as CentralConnections,fu as CloudConnectorStep,Su as CreateCloudConnectorDrawer,Gb as CreateNewType,Wc as DataStreamForm,Kc as DataStreamMergeWarning,ku as EditActionDrawer,Tu as EditConfigDrawer,Km as EditDataStreamModal,Iu as EditDestinationDrawer,Ou as EditRuleDrawer,qg as EditSourceDrawer,Yc as EditSourceForm,tT as Insights,mT as Onboarding,qm as OnboardingDone,S$ as Overview,R$ as PipelineCollectors,km as RecommendationsDrawer,ql as RegexTesterDrawer,lm as SECTION_ORDER,jb as SamplingOnboardingModal,Mm as SamplingRuleDrawer,td as SamplingRuleForm,F$ as SamplingRules,OI as ServiceMap,VI as Settings,Hm as SystemDrawer,D$ as TABS,jI as ToastList,rm as countRecommended,am as getRecommendationState,om as groupRecommendations};
|