@odigos/ui-kit 0.0.110-dev.360 → 0.0.110-dev.361
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chunks/{ui-components-6079e13b.js → ui-components-85b0f109.js} +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers.js +37 -37
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/icons.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/package.json +1 -1
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperativeHandle as a,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{D as p,a as m,A as h,K as g,F as y,C as v,b,c as f,I as x,d as C,i as $,e as S,f as k,g as w,h as D,j as N,k as T,T as I,S as E,l as O,m as M,M as A,n as F,u as R,o as L,p as P,q,B as K,r as H,s as z,t as W,E as B,v as j,w as V,x as U,y as _,z as G,G as J,H as Y,J as X,L as Q,N as Z,O as ee,P as te,Q as oe,R as ie,U as ne,V as ae,W as le,X as re,Y as se,Z as ce,_ as de,$ as ue,a0 as pe,a1 as me,a2 as he,a3 as ge,a4 as ye,a5 as ve,a6 as be,a7 as fe,a8 as xe,a9 as Ce,aa as $e,ab as Se,ac as ke,ad as we,ae as De,af as Ne,ag as Te,ah as Ie,ai as Ee,aj as Oe,ak as Me,al as Ae,am as Fe,an as Re,ao as Le,ap as Pe,aq as qe,ar as Ke,as as He,at as ze,au as We,av as Be,aw as je,ax as Ve,ay as Ue,az as _e,aA as Ge,aB as Je,aC as Ye,aD as Xe,aE as Qe,aF as Ze,aG as et,aH as tt,aI as ot,aJ as it,aK as nt,aL as at,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,aS as pt,aT as mt,aU as ht,aV as gt,aW as yt,aX as vt,aY as bt,aZ as ft,a_ as xt,a$ as Ct,b0 as $t,b1 as St,b2 as kt,b3 as wt,b4 as Dt,b5 as Nt,b6 as Tt,b7 as It,b8 as Et,b9 as Ot,ba as Mt,bb as At,bc as Ft,bd as Rt,be as Lt,bf as Pt,bg as qt,bh as Kt,bi as Ht,bj as zt,bk as Wt,bl as Bt,bm as jt,bn as Vt,bo as Ut,bp as _t,bq as Gt,br as Jt,bs as Yt,bt as Xt,bu as Qt,bv as Zt,bw as eo,bx as to,by as oo,bz as io,bA as no,bB as ao,bC as lo,bD as ro,bE as so,bF as co,bG as uo,bH as po,bI as mo,bJ as ho,bK as go,bL as yo,bM as vo,bN as bo,bO as fo,bP as xo}from"./chunks/ui-components-
|
|
1
|
+
import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperativeHandle as a,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{D as p,a as m,A as h,K as g,F as y,C as v,b,c as f,I as x,d as C,i as $,e as S,f as k,g as w,h as D,j as N,k as T,T as I,S as E,l as O,m as M,M as A,n as F,u as R,o as L,p as P,q,B as K,r as H,s as z,t as W,E as B,v as j,w as V,x as U,y as _,z as G,G as J,H as Y,J as X,L as Q,N as Z,O as ee,P as te,Q as oe,R as ie,U as ne,V as ae,W as le,X as re,Y as se,Z as ce,_ as de,$ as ue,a0 as pe,a1 as me,a2 as he,a3 as ge,a4 as ye,a5 as ve,a6 as be,a7 as fe,a8 as xe,a9 as Ce,aa as $e,ab as Se,ac as ke,ad as we,ae as De,af as Ne,ag as Te,ah as Ie,ai as Ee,aj as Oe,ak as Me,al as Ae,am as Fe,an as Re,ao as Le,ap as Pe,aq as qe,ar as Ke,as as He,at as ze,au as We,av as Be,aw as je,ax as Ve,ay as Ue,az as _e,aA as Ge,aB as Je,aC as Ye,aD as Xe,aE as Qe,aF as Ze,aG as et,aH as tt,aI as ot,aJ as it,aK as nt,aL as at,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,aS as pt,aT as mt,aU as ht,aV as gt,aW as yt,aX as vt,aY as bt,aZ as ft,a_ as xt,a$ as Ct,b0 as $t,b1 as St,b2 as kt,b3 as wt,b4 as Dt,b5 as Nt,b6 as Tt,b7 as It,b8 as Et,b9 as Ot,ba as Mt,bb as At,bc as Ft,bd as Rt,be as Lt,bf as Pt,bg as qt,bh as Kt,bi as Ht,bj as zt,bk as Wt,bl as Bt,bm as jt,bn as Vt,bo as Ut,bp as _t,bq as Gt,br as Jt,bs as Yt,bt as Xt,bu as Qt,bv as Zt,bw as eo,bx as to,by as oo,bz as io,bA as no,bB as ao,bC as lo,bD as ro,bE as so,bF as co,bG as uo,bH as po,bI as mo,bJ as ho,bK as go,bL as yo,bM as vo,bN as bo,bO as fo,bP as xo}from"./chunks/ui-components-85b0f109.js";import{CheckCircledIcon as Co,CrossCircledIcon as $o,EditIcon as So,TrashIcon as ko,OdigosLogoText as wo,SearchIcon as Do,FilterIcon as No,DataStreamsIcon as To,CheckIcon as Io,OdigosLogo as Eo,ArrowIcon as Oo,PlusIcon as Mo,RefreshLeftArrowIcon as Ao,NotificationIcon as Fo,UserIcon as Ro,ImageErrorIcon as Lo,OverviewIcon as Po,RulesIcon as qo,SourcesIcon as Ko,ActionsIcon as Ho,DestinationsIcon as zo,SlackLogo as Wo,CopyIcon as Bo,KeyIcon as jo,TerminalIcon as Vo,GearIcon as Uo,WarningTriangleIcon as _o,TraceViewIcon as Go,ErrorTriangleIcon as Jo}from"./icons.js";import{useNodesState as Yo,useEdgesState as Xo,applyNodeChanges as Qo,MarkerType as Zo}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const ei=e=>{const{type:t,name:o,notes:i,signals:n,disabled:a,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:y,overwriteExistingValues:v,attributeNamesToDelete:b,renames:f,piiCategories:x,fallbackSamplingRatio:C,samplingPercentage:$,endpointsFilters:S,servicesNameFilters:k,attributeFilters:w}}=e,D=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!a)},{type:m.Monitors,title:p.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:p.NAME,value:o||""},{title:p.NOTES,value:i||""},{type:m.Divider}];if(t===h.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(l)}),D.push({title:"Collect ReplicaSet Attributes",value:String(r)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:m.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:o},i)=>{let n="";n+=`Label Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${o||g.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${i+1}`:""),value:n})}),u?.length&&D.push({type:m.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:o},i)=>{let n="";n+=`Annotation Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${o||g.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${i+1}`:""),value:n})})),t===h.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";y?.forEach(({attributeName:t,attributeStringValue:o},i)=>{e+=`${t}: ${o}`,i<y.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.DeleteAttributes){let e="";b?.forEach((t,o)=>{e+=t,o<b.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([o,i],n)=>{e+=`${o}: ${i}`,n<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.PiiMasking){let e="";x?.forEach((t,o)=>{e+=t,o<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===h.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(C)}),t===h.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String($)}),t===h.LatencySampler&&S?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`HTTP Route: ${t}\n`,a+=`Min. Latency: ${o}\n`,a+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Endpoint"+(S.length>1?` #${n+1}`:""),value:a})}),t===h.ServiceNameSampler&&k?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o},i)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${o}`,D.push({title:"Filter"+(k.length>1?` #${i+1}`:""),value:n})}),t===h.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`Fallback Sampling Ratio: ${o}\n`;const l=Object.keys(i)[0];a+=`Condition: ${l}\n`,a+=`Operation: ${i[l]?.operation}\n`,a+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(a+=`\nJSON Path: ${i[l].jsonPath}`),D.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:a})}),D},ti=f.PiiCategories,oi=d.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
gap: 32px;
|
|
@@ -45,11 +45,11 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
45
45
|
text-align: center;
|
|
46
46
|
line-height: 26px;
|
|
47
47
|
color: ${({theme:e})=>e.text.info};
|
|
48
|
-
`,Ki=()=>{const[i,n]=t(0);return o(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ee(500),n(e)})()},[]),e.createElement(Ri,null,e.createElement(wo,{size:100}),e.createElement(Te,{width:400}),e.createElement(Li,null,e.createElement(ce,{$gap:16},e.createElement(Pi,null,"Preparing your workspace..."),e.createElement(Ie,{label:`${i}%`})),e.createElement(qi,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},{nodeHeight:Hi,framePadding:zi}=
|
|
48
|
+
`,Ki=()=>{const[i,n]=t(0);return o(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ee(500),n(e)})()},[]),e.createElement(Ri,null,e.createElement(wo,{size:100}),e.createElement(Te,{width:400}),e.createElement(Li,null,e.createElement(ce,{$gap:16},e.createElement(Pi,null,"Preparing your workspace..."),e.createElement(Ie,{label:`${i}%`})),e.createElement(qi,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},{nodeHeight:Hi,framePadding:zi}=Re,Wi=(e,t)=>{const{theme:o,label:i,isMultiTarget:n,isError:a,animated:l}=t||{},[r,s]=e.split("-to-");return{id:e,type:i?Fe.Labeled:"default",source:r,target:s,animated:l,data:{label:i,isMultiTarget:n,isError:a},style:{stroke:a?o?.colors.dark_red:o?.colors.border}}},{nodeWidth:Bi,nodeHeight:ji,framePadding:Vi}=Re,Ui=e=>({nodeWidth:Bi,nodeHeight:ji,id:e.ruleId,type:B.InstrumentationRule,status:void 0,title:be(e,B.InstrumentationRule,{prioritizeDisplayName:!0}),subTitle:e.type,icon:Pe(e.type),isActive:!e.disabled,raw:e}),{nodeWidth:_i,nodeHeight:Gi,framePadding:Ji}=Re,Yi=e=>{const{hasDisableds:t,priorotizedStatus:o}=re(e.conditions||[]);return{nodeWidth:_i,nodeHeight:Gi,id:e.id,type:B.Action,status:o,faded:t,title:be(e,B.Action,{prioritizeDisplayName:!0}),subTitle:e.type,icon:G(e.type),monitors:e.signals,isActive:!e.disabled,raw:e}},{nodeWidth:Xi,nodeHeight:Qi,framePadding:Zi}=Re,en=e=>{const{priorotizedStatus:t,hasDisableds:o}=re(he(e)&&e.conditions||[]);return{nodeWidth:Xi,nodeHeight:Qi,id:he(e)?{namespace:e.namespace,name:e.name,kind:e.kind}:e.name,type:B.Source,status:t,faded:o,title:he(e)?be(e,B.Source,{extended:!0}):e.name,subTitle:he(e)?`${e.namespace} • ${e.kind}`:e.kind,icons:qe(he(e)?e.containers:null),raw:e}},{nodeWidth:tn,nodeHeight:on}=Re,{nodeWidth:nn,nodeHeight:an,framePadding:ln}=Re,rn=e=>{const{hasDisableds:t,priorotizedStatus:o}=re(e.conditions||[]),{icon:i,iconSrc:n}=ze(e.destinationType.type);return{nodeWidth:nn,nodeHeight:an,id:e.id,type:B.Destination,status:o,faded:t,title:be(e,B.Destination,{prioritizeDisplayName:!0}),subTitle:e.destinationType.displayName,icon:i,iconSrc:n,monitors:He(e.exportedSignals),isActive:!e.disabled,raw:e}},sn=d.div`
|
|
49
49
|
width: 100%;
|
|
50
50
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
51
51
|
position: relative;
|
|
52
|
-
`,cn=({heightToRemove:t,metrics:i})=>{const n=I.useTheme(),a=ge(),{selectedStreamName:r}=
|
|
52
|
+
`,cn=({heightToRemove:t,metrics:i})=>{const n=I.useTheme(),a=ge(),{selectedStreamName:r}=We(),{isAwaitingInstrumentation:s}=Be(),{containerRef:c,containerWidth:d,containerHeight:u}=je(),{sources:m,sourcesLoading:h,destinations:g,destinationsLoading:y,actions:v,actionsLoading:b,instrumentationRules:f,instrumentationRulesLoading:x}=V(),[C,$,S]=Yo([]),[k,w,D]=Xo([]);o(()=>w((({theme:e,nodes:t,metrics:o,containerHeight:i})=>{const n=[],a=t.find(({id:e})=>[`${B.Action}-${Oe.Frame}`,`${B.Action}-${Oe.Add}`].includes(e))?.id,l=-Hi/2+zi,r=Math.floor(i/Hi)*Hi-(Hi/2+zi),s=e=>e===Oe.Base||e===Oe.Edged;return t.forEach(({type:t,id:i,data:{type:c,id:d,status:u},position:p})=>{if(c===B.Source&&s(t)){const t=o?Me(o,B.Source,d):void 0;p.y>=l&&p.y<=r&&n.push(Wi(`${i}-to-${a}`,{theme:e,animated:!1,isMultiTarget:!1,label:Ae(t?.throughput),isError:u===j.Error}))}if(c===B.Destination&&s(t)){const t=o?.destinations.find(e=>e.id===d);p.y>=l&&p.y<=r&&n.push(Wi(`${a}-to-${i}`,{theme:e,animated:!1,isMultiTarget:!0,label:Ae(t?.throughput),isError:u===j.Error}))}}),n})({theme:n,nodes:C,metrics:i,containerHeight:u})),[n,C,i,u]);const N=l(()=>(({containerWidth:e})=>{const t=(e<=1500?1500:e)-tn-24,o=e=>on*((e||0)+1);return{[B.Namespace]:{x:0,y:()=>0},[B.InstrumentationRule]:{x:24,y:o},[B.Source]:{x:Ke(e,[[0,1600,t/3.5],[1600,null,t/4]]),y:o},[B.Action]:{x:Ke(e,[[0,1600,t/1.55],[1600,null,t/1.6]]),y:o},[B.Destination]:{x:t,y:o}}})({containerWidth:d}),[d]),T=(e,t)=>{$(o=>{const i=[...o].filter(({id:e})=>e.split("-")[0]!==t);return i.push(...e),i})},E=(e,t,o)=>{$(i=>Qo(e.filter(e=>"parent"===e.extent&&e.parentId===`${t}-${Oe.Scroll}`).map(e=>({id:e.id,type:"position",position:{...e.position,y:e.position.y-o}})),i))};return o(()=>{const e=Ve(m,r),t=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[B.Source],s=t.length!==i;return l.push({id:`${B.Source}-${Oe.Header}`,type:Oe.Header,position:{x:o[B.Source].x,y:0},data:{nodeWidth:Xi,title:p.SOURCES,icon:Se(B.Source),badge:s?`${t.length}/${i}`:i,badgeTooltip:s?p.FILTERED_COUNT_TOOLTIP:void 0,isFetching:e,sources:t}}),t.length?(l.push({id:`${B.Source}-${Oe.Scroll}`,type:Oe.Scroll,position:{x:r.x,y:r.y()-Zi},style:{zIndex:1},data:{nodeWidth:Xi,nodeHeight:n-Qi+2*Zi,items:t.map((e,t)=>({id:`${B.Source}-${t}`,data:en(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${B.Source}-${t}-hidden`,type:Oe.Edged,extent:"parent",parentId:`${B.Source}-${Oe.Scroll}`,position:{x:Zi,y:r.y(t)-(Qi-Zi/2)},style:{zIndex:-1},data:en(e)})})):e?l.push({id:`${B.Source}-${Oe.Skeleton}`,type:Oe.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Xi}}):l.push({id:`${B.Source}-${Oe.Add}`,type:Oe.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Xi,type:Le.AddSource,title:p.ADD_SOURCE,subTitle:p.TO_COLLECT_OTEL_DATA}}),l})({entities:Ue(e,a),loading:h||s,unfilteredCount:e.length,positions:N,containerHeight:u,onScroll:({scrollTop:e})=>E(t,B.Source,e)});T(t,B.Source)},[r,m,h,s,N[B.Source],a,u]),o(()=>{const e=_e(g,r),t=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[B.Destination];return l.push({id:`${B.Destination}-${Oe.Header}`,type:Oe.Header,position:{x:o[B.Destination].x,y:0},data:{nodeWidth:nn,title:p.DESTINATIONS,icon:Se(B.Destination),badge:i,isFetching:e}}),t.length?(l.push({id:`${B.Destination}-${Oe.Scroll}`,type:Oe.Scroll,position:{x:r.x,y:r.y()-ln},style:{zIndex:1},data:{nodeWidth:nn,nodeHeight:n-an+2*ln,items:t.map((e,t)=>({id:`${B.Destination}-${t}`,data:rn(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${B.Destination}-${t}-hidden`,type:Oe.Edged,extent:"parent",parentId:`${B.Destination}-${Oe.Scroll}`,position:{x:ln,y:r.y(t)-(an-ln/2)},style:{zIndex:-1},data:rn(e)})})):e?l.push({id:`${B.Destination}-${Oe.Skeleton}`,type:Oe.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:nn}}):l.push({id:`${B.Destination}-${Oe.Add}`,type:Oe.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:nn,type:Le.AddDestination,title:p.ADD_DESTINATION,subTitle:p.TO_MONITOR_OTEL_DATA}}),l})({entities:Ge(e,a),loading:y,unfilteredCount:e.length,positions:N,containerHeight:u,onScroll:({scrollTop:e})=>E(t,B.Destination,e)});T(t,B.Destination)},[r,g,y,N[B.Destination],a,u]),o(()=>{const e=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[B.Action];return l.push({id:`${B.Action}-${Oe.Header}`,type:Oe.Header,position:{x:o[B.Action].x,y:0},data:{nodeWidth:_i,title:p.ACTIONS,icon:Se(B.Action),badge:i,isFetching:e}}),t.length?(l.push({id:`${B.Action}-${Oe.Scroll}`,type:Oe.Scroll,position:{x:r.x,y:r.y()-Ji},style:{zIndex:1},data:{nodeWidth:_i,nodeHeight:n-Gi+2*Ji,items:t.map((e,t)=>({id:`${B.Action}-${t}`,data:Yi(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${B.Action}-${t}-hidden`,type:Oe.Edged,extent:"parent",parentId:`${B.Action}-${Oe.Scroll}`,position:{x:Ji,y:r.y(t)-(Gi-Ji/2)},style:{zIndex:-1},data:Yi(e)})}),l.push({id:`${B.Action}-${Oe.Frame}`,type:Oe.Frame,position:{x:r.x-Ji,y:r.y()-Ji},data:{nodeWidth:_i+2*Ji,nodeHeight:Math.min(n,Gi*t.length+Ji)}})):e?l.push({id:`${B.Action}-${Oe.Skeleton}`,type:Oe.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:_i}}):l.push({id:`${B.Action}-${Oe.Add}`,type:Oe.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:_i,type:Le.AddAction,title:p.ADD_ACTION,subTitle:p.TO_MODIFY_OTEL_DATA}}),l})({entities:ye(v,a),loading:b,unfilteredCount:v.length,positions:N,containerHeight:u,onScroll:({scrollTop:t})=>E(e,B.Action,t)});T(e,B.Action)},[v,b,N[B.Action],a,u]),o(()=>{const e=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[B.InstrumentationRule];return l.push({id:`${B.InstrumentationRule}-${Oe.Header}`,type:Oe.Header,position:{x:o[B.InstrumentationRule].x,y:0},data:{nodeWidth:Bi,title:p.INSTRUMENTATION_RULES,icon:Se(B.InstrumentationRule),badge:i,isFetching:e}}),t.length?(l.push({id:`${B.InstrumentationRule}-${Oe.Scroll}`,type:Oe.Scroll,position:{x:r.x,y:r.y()-Vi},style:{zIndex:1},data:{nodeWidth:Bi,nodeHeight:n-ji+2*Vi,items:t.map((e,t)=>({id:`${B.InstrumentationRule}-${t}`,data:Ui(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${B.InstrumentationRule}-${t}-hidden`,type:Oe.Edged,extent:"parent",parentId:`${B.InstrumentationRule}-${Oe.Scroll}`,position:{x:Vi,y:r.y(t)-(ji-Vi/2)},style:{zIndex:-1},data:Ui(e)})})):e?l.push({id:`${B.InstrumentationRule}-${Oe.Skeleton}`,type:Oe.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Bi}}):l.push({id:`${B.InstrumentationRule}-${Oe.Add}`,type:Oe.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Bi,type:Le.AddRule,title:p.ADD_INSTRUMENTATION_RULE,subTitle:p.TO_MODIFY_OTEL_DATA}}),l})({entities:f,loading:x,unfilteredCount:f.length,positions:N,containerHeight:u,onScroll:({scrollTop:t})=>E(e,B.InstrumentationRule,t)});T(e,B.InstrumentationRule)},[f,x,N[B.InstrumentationRule],u]),e.createElement(sn,{ref:c,$heightToRemove:t},e.createElement(Je,{nodes:C,edges:k,onNodesChange:S,onEdgesChange:D}))},dn=d.div`
|
|
53
53
|
position: relative;
|
|
54
54
|
max-width: 200px;
|
|
55
55
|
`;d.div`
|
|
@@ -67,30 +67,30 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
67
67
|
display: flex;
|
|
68
68
|
align-items: center;
|
|
69
69
|
overflow-x: scroll;
|
|
70
|
-
`,pn=({onClose:i})=>{const n=I.useTheme(),{onClickNode:a}=
|
|
70
|
+
`,pn=({onClose:i})=>{const n=I.useTheme(),{onClickNode:a}=Ye(),{searchText:s}=ge(),{selectedStreamName:c}=We(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=V(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=Xe();o(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:C,searchResults:$}=l(()=>Mi({instrumentationRules:m,sources:Ve(d,c),actions:p,destinations:_e(u,c),searchText:s,selectedCategory:f}),[m,d,p,u,c,s,f]);return $.length?e.createElement(Qe,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(un,null,C.map(({category:t,label:o,count:i})=>!!i&&e.createElement(Ze,{key:`category-select-${t}`,label:o,badgeLabel:i,isSelected:f===t,onClick:()=>x(t)})))},$.map(({category:t,label:o,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(et,{style:{maxHeight:"all"!==f?"240px":"140px",padding:"12px 0"}},e.createElement(T,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},o),l.map((o,n)=>e.createElement(Ze,{key:`entity-${s}-${n}`,icon:Se(t),label:be(o,t,{extended:!0}),onClick:()=>{const e=tt(o);a(null,{data:{type:t,id:e}}),i()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(le,{thickness:s===$.length-1?0:1,length:"90%",margin:"8px auto"})))):e.createElement(Qe,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(Ne,null))},mn=({preventPopup:o=!1})=>{const{searchText:i,setSearchText:a}=ge(),[l,r]=t(!1),s=!!i||l,c=()=>{a(""),r(!1)},d=n(null);return ot(d,c),q({key:"Escape",active:s},c),e.createElement(dn,{ref:d},e.createElement(x,{placeholder:"Search",icon:Do,value:i,onChange:e=>a(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!o?e.createElement(pn,{onClose:c}):null)},hn=({sources:t,title:o="Condition",value:i,onSelect:n,onDeselect:a,...r})=>{const s=l(()=>{const e=[];return t.forEach(t=>{he(t)&&t.conditions?.forEach(({type:t,reason:o})=>{e.find(e=>e.id===`${t}#${o}`)||e.push({id:`${t}#${o}`,value:`${it(t)} - ${it(o)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(nt,{disabled:!s?.length,title:o,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:a,...r})},gn=({sources:t,title:o="Error Message",value:i,onSelect:n,onDeselect:a,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(t=>{he(t)&&de(t.conditions||[]).forEach(({status:t,message:o,reason:i})=>{t!==j.Error||e.find(e=>e.id===o)||(o?e.find(e=>e.id===o)||e.push({id:o,value:o}):i&&(e.find(e=>e.id===i)||e.push({id:i,value:i})))})}),e},[t]);return e.createElement(nt,{disabled:r||!c?.length,title:o,placeholder:"All",options:c,value:i,onSelect:n,onDeselect:a,...s})},yn=({sources:t,title:o="Programming Language",value:i,onSelect:n,onDeselect:a,...r})=>{const s=l(()=>{const e=[];return t.forEach(t=>{he(t)&&t.containers?.forEach(({language:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:at[t]||t})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(nt,{disabled:!s?.length,title:o,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:a,...r})},vn=({title:t="Monitors",value:o,onSelect:i,onDeselect:n,...a})=>{const r=l(()=>{const e=[];return lt.forEach(({id:t,value:o})=>{e.find(e=>e.id===t)||e.push({id:t,value:o})}),e},[]);return e.createElement(nt,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:o,onSelect:i,onDeselect:n,...a})},bn=({namespaces:t,title:o="Namespace",value:i,onSelect:n,onDeselect:a,...r})=>{const s=l(()=>{const e=[];return t?.forEach(({name:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(nt,{disabled:!s?.length,title:o,placeholder:"Select namespace",options:s,value:i,onSelect:n,onDeselect:a,...r})},fn=({sources:t,title:o="Kind",value:i,onSelect:n,onDeselect:a,...r})=>{const s=l(()=>{const e=[];return t.forEach(({kind:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(nt,{disabled:!s?.length,title:o,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:a,...r})},xn=d.div`
|
|
71
71
|
display: flex;
|
|
72
72
|
flex-direction: column;
|
|
73
73
|
gap: 12px;
|
|
74
74
|
padding: 12px;
|
|
75
75
|
`,Cn=d.div`
|
|
76
76
|
padding: 12px 6px 6px 6px;
|
|
77
|
-
`,$n=d(
|
|
77
|
+
`,$n=d(rt)`
|
|
78
78
|
font-size: 14px;
|
|
79
79
|
${({$color:e})=>`color: ${e};`}
|
|
80
80
|
`,Sn=d.div`
|
|
81
81
|
margin-left: auto;
|
|
82
|
-
`,kn=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},wn=()=>{const i=I.useTheme(),{namespaces:a,sources:r}=V(),{selectedStreamName:s}=
|
|
82
|
+
`,kn=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},wn=()=>{const i=I.useTheme(),{namespaces:a,sources:r}=V(),{selectedStreamName:s}=We(),{getItemSS:c,setItemSS:d,removeItemSS:u}=ct(),{popupRef:p,popupOpen:m,setPopupOpen:h,popupPosition:g,handlePosition:y}=Xe(),{namespaces:v,kinds:b,monitors:f,languages:x,conditions:C,errors:$,onlyErrors:S,setAll:w,clearAll:D,getEmptyState:N}=ge(),T=l(()=>Ve(r,s),[r,s]),[E,O]=t({namespaces:v,kinds:b,monitors:f,languages:x,conditions:C,errors:$,onlyErrors:S}),[M,A]=t(kn(E));o(()=>{const e=c(st.OVERVIEW_FILTERS,N());w(e)},[]),o(()=>{if(!m){const e={namespaces:v,kinds:b,monitors:f,languages:x,conditions:C,errors:$,onlyErrors:S};O(e),A(kn(e))}},[m,v,b,f,x,C,$,S]);const F=()=>{h(!1)},R=n(null);return ot(R,F),q({key:"Escape",active:m},F),e.createElement(dn,{ref:R},e.createElement(Ze,{label:"Filters",icon:No,badgeLabel:M,badgeFilled:!!M,withBorder:!0,color:"transparent",onClick:()=>{y(0,50),h(!0)}}),e.createElement(Qe,{ref:p,isOpen:m,top:g.top,left:g.left,width:"420px",footer:e.createElement(ce,null,e.createElement($n,{variant:"primary",onClick:()=>{d(st.OVERVIEW_FILTERS,E),w(E),A(kn(E)),h(!1)}},"Apply"),e.createElement($n,{variant:"secondary",onClick:F},"Cancel"),e.createElement(Sn,null,e.createElement($n,{variant:"tertiary",onClick:()=>{u(st.OVERVIEW_FILTERS),D(),O(N()),A(0),h(!1)},$color:i.text.error},"Reset")))},e.createElement(xn,null,e.createElement(bn,{namespaces:a,value:E.namespaces,onSelect:e=>O(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>O(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(fn,{sources:T,value:E.kinds,onSelect:e=>O(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>O(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(yn,{sources:T,value:E.languages,onSelect:e=>O(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>O(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(vn,{value:E.monitors,onSelect:e=>O(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>O(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(hn,{sources:T,value:E.conditions,onSelect:e=>O(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>O(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(Cn,null,e.createElement(k,{title:"Show only sources with errors",initialValue:E.onlyErrors,onChange:e=>O(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(gn,{sources:T,value:E.errors,onSelect:e=>O(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>O(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!E.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},Dn=d.div`
|
|
83
83
|
display: flex;
|
|
84
84
|
flex-direction: column;
|
|
85
85
|
gap: 24px;
|
|
86
86
|
padding: 4px;
|
|
87
|
-
`,Nn=({formData:t,handleFormChange:o,formErrors:i})=>{const{dataStreams:n,selectedStreamName:a}=
|
|
87
|
+
`,Nn=({formData:t,handleFormChange:o,formErrors:i})=>{const{dataStreams:n,selectedStreamName:a}=We(),r=l(()=>n.find(e=>e.name===t.name&&e.name!==a),[n,t.name,a]);return e.createElement(Dn,null,e.createElement(x,{name:"name",title:p.STREAM_NAME,placeholder:p.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:t.name,onChange:({target:{value:e}})=>o("name",e),errorMessage:i.name}),r&&e.createElement(ie,{type:j.Warning,message:p.DATA_STREAM_EXISTS_WARNING(a,r.name)}))},Tn=d.div`
|
|
88
88
|
width: 100%;
|
|
89
89
|
height: 100%;
|
|
90
90
|
max-height: calc(100vh - 220px);
|
|
91
91
|
overflow: overlay;
|
|
92
92
|
overflow-y: auto;
|
|
93
|
-
`,In=({isOpen:o,onClose:i,dataStreamName:a,updateDataStream:r})=>{const{dataStreams:c}=
|
|
93
|
+
`,In=({isOpen:o,onClose:i,dataStreamName:a,updateDataStream:r})=>{const{dataStreams:c}=We(),d=n(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=dt({name:a}),f=l(()=>{if(!o)return v();const e=c?.find(e=>e.name===a);return e?b(e):v(),e},[o,c,a]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return f?e.createElement($i,{ref:d,title:f.name,icons:[To],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:X.Update})&&(r(a,m),p(!1),i())},onCancel:()=>{v(),p(!1),i()}},e.createElement(Tn,null,e.createElement(Nn,{formData:m,handleFormChange:x,formErrors:g}))):null},En=d.div`
|
|
94
94
|
position: relative;
|
|
95
95
|
`,On=d(ce)`
|
|
96
96
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
@@ -101,14 +101,14 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
101
101
|
}
|
|
102
102
|
`,Mn=d(T)`
|
|
103
103
|
text-wrap: nowrap;
|
|
104
|
-
`,An=d(
|
|
104
|
+
`,An=d(et)`
|
|
105
105
|
max-height: 240px;
|
|
106
106
|
padding: 0px !important;
|
|
107
107
|
`,Fn=d(ce)`
|
|
108
108
|
width: 100%;
|
|
109
109
|
`,Rn=d.div`
|
|
110
110
|
width: 100%;
|
|
111
|
-
`,Ln=({onClickNewDataStream:o,updateDataStream:i,deleteDataStream:n})=>{const a=I.useTheme(),{dataStreams:r,selectedStreamName:s,setSelectedStreamName:c}=
|
|
111
|
+
`,Ln=({onClickNewDataStream:o,updateDataStream:i,deleteDataStream:n})=>{const a=I.useTheme(),{dataStreams:r,selectedStreamName:s,setSelectedStreamName:c}=We(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:m,handlePosition:h}=Xe(),[g,y]=t(""),[v,b]=t(""),[f,C]=t(""),$=l(()=>r.filter(({name:e})=>!f||e.toLowerCase().includes(f.toLowerCase())).map(({name:t})=>e.createElement(Fn,{key:`stream-${t}`},e.createElement(Rn,null,e.createElement(Ze,{label:t,isSelected:s===t,onClick:()=>{c(t),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==ut&&e.createElement(pt,{onClick:()=>b(t),tooltip:K.DELETE},e.createElement(ko,null)),e.createElement(pt,{onClick:()=>y(t),tooltip:K.EDIT},e.createElement(So,null)))),[r,s,f]);return e.createElement(e.Fragment,null,e.createElement(En,null,e.createElement(On,{$gap:0},e.createElement(rt,{variant:"tertiary",onClick:()=>{h(0,50),p(e=>!e)}},e.createElement(To,{fill:a.text.info}),e.createElement(Mn,null,"Data Stream: ",s),e.createElement(mt,{extend:u}),e.createElement(Ie,{label:r.length})),e.createElement(le,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(ht,{onClick:()=>{c(""),o()},label:K.NEW})),e.createElement(Qe,{ref:d,isOpen:u,top:m.top,left:m.left,header:e.createElement(x,{placeholder:"Search...",icon:Do,value:f,onChange:e=>C(e.target.value)})},e.createElement(An,null,$))),e.createElement(z,{isOpen:""!==v,name:v,onApprove:()=>{n(v),b("")},onDeny:()=>{b("")}}),e.createElement(In,{isOpen:""!==g,onClose:()=>{y("")},dataStreamName:g,updateDataStream:i}))},Pn=d.div`
|
|
112
112
|
display: flex;
|
|
113
113
|
align-items: center;
|
|
114
114
|
margin: 20px 0;
|
|
@@ -116,7 +116,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
116
116
|
gap: 8px;
|
|
117
117
|
`,qn=d.div`
|
|
118
118
|
margin-left: auto;
|
|
119
|
-
`,Kn=({addEntity:t,preventSearchPopup:o,onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a})=>{const{setCurrentModal:l}=Z();return e.createElement(Pn,null,e.createElement(Ln,{onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a}),e.createElement(mn,{preventPopup:o}),e.createElement(wn,null),t&&e.createElement(qn,null,e.createElement(
|
|
119
|
+
`,Kn=({addEntity:t,preventSearchPopup:o,onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a})=>{const{setCurrentModal:l}=Z();return e.createElement(Pn,null,e.createElement(Ln,{onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a}),e.createElement(mn,{preventPopup:o}),e.createElement(wn,null),t&&e.createElement(qn,null,e.createElement(ht,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${K.ADD} ${it(t)}`,variant:"primary",textProps:{weight:900}})))},Hn=i(({isModal:t,onClickSummary:o},i)=>{const{selectedStreamName:n}=We(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=dt({name:n});return a(i,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(oe,{$isNotModal:!t},e.createElement(Q,{$gap:24},o&&e.createElement(gt,{onClick:o}),e.createElement(O,{title:p.NAME_YOUR_STREAM,description:p.STREAM_DESCRIPTION}),e.createElement(Nn,{formData:l,handleFormChange:r,formErrors:s})))});Hn.displayName=Hn.name;const zn=e=>Object.keys(e).filter(t=>e[t]).join(", "),Wn=(e,t)=>{const{destinationType:o,disabled:i,exportedSignals:n}=e,a=[{title:p.TYPE,value:o.type},{type:m.ActiveStatus,title:p.STATUS,value:String(!i)},{type:m.Monitors,title:p.MONITORS,value:zn(n)},{title:p.NAME,value:o.displayName}],l=yt(e,t),r=l.map(e=>({name:e.key,value:e.value}));return l.map(({key:e,name:o,value:i})=>{const{secret:l,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!vt(c,He(n),r)){const{type:e}=bt(s,{type:""}),t=(l||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";a.push({type:m.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&a.push({title:t.title,value:t.value})}):a.push({title:o,value:t||i})}}),a},Bn=({signals:t,fields:o,onChange:i,formErrors:n})=>o?.map(a=>{const{componentType:l,renderCondition:r,...s}=a;if(r&&!vt(r,t,o))return null;switch(l){case N.Input:return e.createElement(x,{key:a.name,...s,onChange:e=>i(a.name,e.target.value),errorMessage:n[a.name]});case N.Dropdown:return e.createElement(nt,{key:a.name,...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>i(a.name,e.id),errorMessage:n[a.name]});case N.MultiInput:return e.createElement(D,{key:a.name,...s,value:"string"==typeof s.value?bt(s.value,[]):s.value,onChange:e=>i(a.name,JSON.stringify(e)),errorMessage:n[a.name]});case N.KeyValuePair:return e.createElement(w,{key:a.name,...s,value:"string"==typeof s.value?bt(s.value,[]):s.value,onChange:e=>i(a.name,JSON.stringify(e)),errorMessage:n[a.name]});case N.TextArea:return e.createElement(F,{key:a.name,...s,onChange:e=>i(a.name,e.target.value),errorMessage:n[a.name]});case N.Checkbox:return e.createElement(v,{key:a.name,...s,value:"true"==s.value,onChange:e=>i(a.name,String(e)),errorMessage:n[a.name]});default:return null}}),jn=d(rt)`
|
|
120
120
|
display: flex;
|
|
121
121
|
align-items: center;
|
|
122
122
|
gap: 8px;
|
|
@@ -130,7 +130,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
130
130
|
`:u`
|
|
131
131
|
background-color: transparent;
|
|
132
132
|
`}
|
|
133
|
-
`,Vn=({destination:o,validateForm:i,status:n,testConnection:a,onSuccess:l,onError:r})=>{const s=I.useTheme(),{selectedStreamName:c}=
|
|
133
|
+
`,Vn=({destination:o,validateForm:i,status:n,testConnection:a,onSuccess:l,onError:r})=>{const s=I.useTheme(),{selectedStreamName:c}=We(),[d,u]=t(!1),p=n?me(n,s):void 0;return e.createElement(jn,{$status:n,variant:"secondary",onClick:async()=>{if(i()){u(!0);const e=await a({...o,currentStreamName:c});e&&(e.succeeded?l(e):r(e)),u(!1)}}},d?e.createElement(ft,null):p?e.createElement(p,null):null,e.createElement(T,{family:"secondary",decoration:"underline",size:14,color:n?s.text[n]:void 0},d?"Checking":n===j.Success?"Connection OK":"error"===n?"Connection Failed":"Test Connection"))},Un=d(Q)`
|
|
134
134
|
align-items: unset;
|
|
135
135
|
padding: 0 4px;
|
|
136
136
|
`,_n=d.div`
|
|
@@ -141,7 +141,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
141
141
|
justify-content: space-between;
|
|
142
142
|
`,Jn=d(T)`
|
|
143
143
|
margin-bottom: 12px;
|
|
144
|
-
`,Yn=({isUpdate:i,categoryItem:a,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:m,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:b}=a||{},f=I.useTheme(),[C,$]=t(!1),[S,k]=t(!1),[w,D]=t(void 0),N=n(!1);o(()=>{if(u.length&&!N.current){N.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:o,value:i}=u[t];if(o){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}$(e)}},[u,S]);const T=l(()=>{const{logs:e,metrics:t,traces:o}=v||{},i=[];return e?.supported&&i.push(
|
|
144
|
+
`,Yn=({isUpdate:i,categoryItem:a,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:m,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:b}=a||{},f=I.useTheme(),[C,$]=t(!1),[S,k]=t(!1),[w,D]=t(void 0),N=n(!1);o(()=>{if(u.length&&!N.current){N.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:o,value:i}=u[t];if(o){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}$(e)}},[u,S]);const T=l(()=>{const{logs:e,metrics:t,traces:o}=v||{},i=[];return e?.supported&&i.push(xt.Logs),t?.supported&&i.push(xt.Metrics),o?.supported&&i.push(xt.Traces),i},[v]),F=l(()=>{const{logs:e,metrics:t,traces:o}=r.exportedSignals||{},i=[];return e&&i.push(xt.Logs),t&&i.push(xt.Metrics),o&&i.push(xt.Traces),i},[r.exportedSignals]),R=()=>{$(!1),k(!0),D(void 0)};return e.createElement(Un,{$gap:24},e.createElement(Un,{$gap:12},e.createElement(O,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:b&&e.createElement(Vn,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{k(!1),D({type:j.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{k(!1),D({type:j.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(_n,null,b&&w&&e.createElement(ie,{type:w.type,title:w.title,message:w.message}),C&&!w&&!i&&e.createElement(ie,{type:j.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(le,null)),e.createElement(Gn,null,e.createElement(A,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:T,selectedSignals:F,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes(xt.Logs),metrics:e.includes(xt.Metrics),traces:e.includes(xt.Traces)})},errorMessage:s.exportedSignals}),!i&&e.createElement(M,{endpoint:`/backends/${g}`})),i&&e.createElement("div",null,e.createElement(Jn,null,"Status"),e.createElement(E,{options:[{icon:Co,label:p.ENABLED,value:!1,selectedBgColor:f.text.success+I.opacity.hex["050"]},{icon:$o,label:p.DISABLED,value:!0,selectedBgColor:f.text.error+I.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!i&&e.createElement(x,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(Bn,{signals:F,fields:u,onChange:(e,t)=>{R(),m(o=>{const i=[...o],n=i.findIndex(t=>t.name===e);return-1!==n&&(i[n]={...i[n],value:t}),i})},formErrors:s}))},Xn=d.div`
|
|
145
145
|
width: 100%;
|
|
146
146
|
height: 100%;
|
|
147
147
|
max-height: calc(100vh - 220px);
|
|
@@ -151,11 +151,11 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
151
151
|
display: flex;
|
|
152
152
|
flex-direction: column;
|
|
153
153
|
gap: 12px;
|
|
154
|
-
`,Zn=({categories:o,updateDestination:i,deleteDestination:a,testConnection:r})=>{const{destinations:s}=V(),{selectedStreamName:c}=
|
|
154
|
+
`,Zn=({categories:o,updateDestination:i,deleteDestination:a,testConnection:r})=>{const{destinations:s}=V(),{selectedStreamName:c}=We(),{drawerType:d,drawerEntityId:u}=P(),m=l(()=>_e(s,c),[s,c]),h=n(null),g=d!==B.Destination,[y,v]=t(!1),[b,f]=t(!1),{formData:x,formErrors:C,handleFormChange:$,resetFormData:S,validateForm:k,loadFormWithDrawerItem:w,yamlFields:D,setYamlFields:N,dynamicFields:T,setDynamicFields:I}=Ct({}),E=l(()=>{if(g)return S();const e=m?.find(e=>e.id===u);return e?(w(e),N($t(o,e))):S(),e},[g,u,m]);if(!E)return null;const O=o.flatMap(e=>e.items).find(e=>e.type===E.destinationType.type),{icon:M,iconSrc:A}=O?ze(O?.type):{icon:void 0,iconSrc:void 0};return e.createElement($i,{ref:h,title:E.name||E.destinationType.displayName,icons:M?[M]:void 0,iconSrcs:A?[A]:void 0,isEdit:y,isFormDirty:b,onEdit:e=>{v("boolean"!=typeof e||e)},onSave:async e=>{if(k({withAlert:!0,alertTitle:X.Update})){const t=e!==E.destinationType.displayName?e:"";$("name",t),i(u,{...x,name:t}),v(!1),f(!1)}},onDelete:async()=>{a(u),v(!1),f(!1),h.current?.closeDrawer()},onCancel:()=>{v(!1),f(!1),w(E)},isLastItem:1===m.length},y?e.createElement(Xn,null,e.createElement(Yn,{isUpdate:!0,categoryItem:O,formData:x,formErrors:C,handleFormChange:(...e)=>{f(!0),$(...e)},dynamicFields:T,setDynamicFields:(...e)=>{f(!0),I(...e)},validateForm:k,testConnection:r})):e.createElement(Qn,null,E.conditions?.length?e.createElement(J,{conditions:E.conditions}):null,e.createElement(Y,{title:p.DESTINATION_DETAILS,data:E?Wn(E,D):[]})))},ea=d.div`
|
|
155
155
|
display: flex;
|
|
156
156
|
flex-direction: column;
|
|
157
157
|
gap: 12px;
|
|
158
|
-
`,ta=({items:t,onSelectNew:o,onSelectConfigured:i,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:a}
|
|
158
|
+
`,ta=({items:t,onSelectNew:o,onSelectConfigured:i,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:a}=St();return t.map(t=>{const l=t.name===Dt.EXISTS.TITLE;return e.createElement(ea,{key:`category-${t.name}`},e.createElement(O,{size:"small",icon:t.icon,title:kt(t.name),description:t.description}),t.items.map(r=>{const s=`select-${t.name.replaceAll(" ","")}-destination-${r.type}`,c=Object.keys(r.supportedSignals).filter(e=>r.supportedSignals[e].supported),{icon:d,iconSrc:u}=ze(r.type),p=r.selected||a.some(e=>e.id===r.id),m=!!n.find(e=>e===r.id),h=l?()=>i(r.id):()=>o(r);return e.createElement(wt,{key:s,"data-id":s,title:r.displayName,hoverText:K.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>i(r.id)}})}))})},oa=d.div`
|
|
159
159
|
display: flex;
|
|
160
160
|
flex-direction: column;
|
|
161
161
|
gap: 24px;
|
|
@@ -179,7 +179,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
179
179
|
}
|
|
180
180
|
`,la=d(oa)`
|
|
181
181
|
margin-top: 80px;
|
|
182
|
-
`,{MANAGED:ra,SELF_HOSTED:sa,DETECTED:ca,EXISTS:da}=
|
|
182
|
+
`,{MANAGED:ra,SELF_HOSTED:sa,DETECTED:ca,EXISTS:da}=Dt,ua=[{value:"All types",id:"all"},{value:ra.TITLE,id:ra.TITLE},{value:sa.TITLE,id:sa.TITLE},{value:ca.TITLE,id:ca.TITLE},{value:da.TITLE,id:da.TITLE}],pa=ua[0],ma=[xt.Logs,xt.Metrics,xt.Traces],ha=(e,t,o)=>e.map(e=>{const{type:i,displayName:n}=e.destinationType,a=e.dataStreamNames?.includes(t),l=o.has(e.id);return{id:e.id,type:i,displayName:n,selected:a||l,fields:[],testConnectionSupported:!1,supportedSignals:{[xt.Logs]:{supported:e.exportedSignals.logs},[xt.Metrics]:{supported:e.exportedSignals.metrics},[xt.Traces]:{supported:e.exportedSignals.traces}}}}),ga=({hidden:o,categories:i,potentialDestinations:n,onSelectNew:a,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=V(),{selectedStreamName:d}=We(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=St(),[m,h]=t(""),[g,y]=t(pa),[v,b]=t(ma),f=l(()=>{const e=Nt(i);return e.unshift({name:da.TITLE,description:da.DESCRIPTION,icon:Io,items:ha(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:ca.TITLE,description:ca.DESCRIPTION,icon:Eo,items:n}),e.map(e=>{const t=e.items.filter(t=>{const o=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),i="all"===g.id||g.id===e.name,n=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return o&&i&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[i,n,c,m,g,v,d,u,p]);return o?null:e.createElement(oa,null,e.createElement(O,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(ia,null,e.createElement(na,null,e.createElement(x,{placeholder:"Search...",icon:Do,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(na,null,e.createElement(nt,{options:ua,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(A,{title:"",selectedSignals:v,setSelectedSignals:b})),e.createElement(le,null),f.length?e.createElement(aa,null,e.createElement(ta,{items:f,onSelectNew:e=>a(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(la,null,e.createElement(Ne,{title:"No destinations found"})))},ya=d.div`
|
|
183
183
|
display: flex;
|
|
184
184
|
`,va=d.div`
|
|
185
185
|
border-right: 1px solid ${({theme:e})=>e.colors.border};
|
|
@@ -188,7 +188,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
188
188
|
@media (max-width: 1050px) {
|
|
189
189
|
display: none;
|
|
190
190
|
}
|
|
191
|
-
`,ba=({isOnboarding:o,categories:i,potentialDestinations:n,createDestination:a,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=V(),{selectedStreamName:d}=
|
|
191
|
+
`,ba=({isOnboarding:o,categories:i,potentialDestinations:n,createDestination:a,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=V(),{selectedStreamName:d}=We(),{currentModal:u,setCurrentModal:m}=Z(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=St(),b=u===B.Destination,[f,x]=t(void 0),{formData:C,formErrors:$,handleFormChange:S,resetFormData:k,validateForm:w,setYamlFields:D,dynamicFields:N,setDynamicFields:T,loadFormWithDrawerItem:I}=Ct({supportedSignals:f?.supportedSignals,preLoadedFields:f?.fields}),[E,O]=t([]),M=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||C.name,disabled:e?.disabled||C.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||C.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:f.type,displayName:f.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},A=async e=>{if(o&&!e){const e=M();h(e)}else if(o&&e){const t=M(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(o||e){if(!o&&e){const t=M(e),o=t.dataStreamNames.some(e=>e===d);O(t=>[...t,e.id]),o?await r(e.id):await l(e.id,I(t)),O(t=>t.filter(t=>t!==e.id))}}else a(C)},F=()=>{k(),x(void 0),m("")},R=()=>{k(),x(void 0)},L=async()=>{if(f){if(!w({withAlert:!o,alertTitle:X.Create}))return null;A()}F()};return q({key:"Enter",active:b},()=>L()),e.createElement(ee,{isOpen:b,onClose:F,header:{title:p.ADD_DESTINATION},actionComponent:e.createElement(te,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:L}];return f&&e.unshift({label:"BACK",icon:Oo,variant:"secondary",onClick:R}),e})()})},e.createElement(ya,null,e.createElement(va,null,e.createElement(Tt,{currentStep:f?2:1,data:[{stepNumber:1,title:p.DESTINATIONS},{stepNumber:2,title:p.CONNECTION}]})),e.createElement(oe,{style:{margin:"32px 24px 12px 24px"}},e.createElement(ga,{hidden:void 0!==f,categories:i,potentialDestinations:n,onSelectNew:(e,t)=>{k(),S("type",e?.type||""),S("currentStreamName",d);const o={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>o[e]=!0),S("exportedSignals",o),D(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&A(t)},isLoadingForDestinationIds:E}),f&&e.createElement(Yn,{categoryItem:f,formData:C,formErrors:$,handleFormChange:S,dynamicFields:N,setDynamicFields:T,validateForm:w,testConnection:s}))))},fa=d.div`
|
|
192
192
|
display: flex;
|
|
193
193
|
flex-direction: column;
|
|
194
194
|
align-items: center;
|
|
@@ -197,7 +197,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
197
197
|
max-height: calc(100vh - 310px);
|
|
198
198
|
height: fit-content;
|
|
199
199
|
overflow-y: scroll;
|
|
200
|
-
`,xa=({categories:t,withDelete:o})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:n}
|
|
200
|
+
`,xa=({categories:t,withDelete:o})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:n}=St();return i.length||n.length?e.createElement(fa,null,i.concat(n).map((a,l)=>e.createElement(Ca,{key:`configured-destination-${a.destinationType.type}-${l}`,"data-id":`configured-destination-${a.destinationType.type}`,item:a,yamlFields:$t(t,a),isLastItem:i.length+n.length===1,withDelete:o}))):e.createElement(De,null,e.createElement(Ne,{title:"No destinations",subTitle:"Please add a destination"}))},Ca=({item:o,yamlFields:i,isLastItem:n,withDelete:a})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=ze(o.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=St(),m=l(()=>yt(o,i).map(e=>({title:e.name,value:e.value})),[o,i]);return e.createElement(e.Fragment,null,e.createElement(wt,{title:o.name||o.destinationType.displayName,subTitle:o.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:He(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(It,{data:m})},renderActions:a?()=>e.createElement(pt,{onClick:()=>s(!0)},e.createElement(ko,null)):void 0}),a&&e.createElement(z,{isOpen:r,name:o.destinationType.displayName||o.name,type:B.Destination,isLastItem:n,onApprove:()=>{o.id?p(o):u(o)},onDeny:()=>s(!1)}))},$a=d(rt)`
|
|
201
201
|
display: flex;
|
|
202
202
|
align-items: center;
|
|
203
203
|
justify-content: center;
|
|
@@ -206,7 +206,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
206
206
|
padding: 32px;
|
|
207
207
|
border-radius: 16px;
|
|
208
208
|
border-style: dashed !important;
|
|
209
|
-
`,Sa=({isSourcesListEmpty:t,goToSources:o,categories:i,potentialDestinations:n,testConnection:a,onClickSummary:l})=>{const r=I.useTheme(),{setCurrentModal:s}=Z(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}
|
|
209
|
+
`,Sa=({isSourcesListEmpty:t,goToSources:o,categories:i,potentialDestinations:n,testConnection:a,onClickSummary:l})=>{const r=I.useTheme(),{setCurrentModal:s}=Z(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=St();return e.createElement(e.Fragment,null,e.createElement(oe,{$isNotModal:!0},e.createElement(Q,{$gap:12},e.createElement(Q,{$gap:24},l&&e.createElement(gt,{onClick:l}),e.createElement(O,{title:p.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:p.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(ie,{type:j.Warning,message:p.NO_SOURCES_GO_BACK,action:{label:p.SELECT_SOURCES,onClick:o}}),e.createElement($a,{variant:"secondary",onClick:()=>s(B.Destination)},e.createElement(Mo,null),e.createElement(T,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},p.ADD_DESTINATION))),e.createElement(xa,{categories:i,withDelete:!0}))),e.createElement(ba,{isOnboarding:!0,categories:i,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:a}))},ka=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"type",title:p.TYPE,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],wa=({metrics:t,maxHeight:o,maxWidth:i})=>{const n=I.useTheme(),a=ge(),{selectedStreamName:r}=We(),{setDrawerType:s,setDrawerEntityId:c}=P(),{destinations:d,destinationsLoading:u}=V(),m=l(()=>_e(d,r),[d,r]),h=l(()=>Mi({instrumentationRules:[],sources:[],actions:[],destinations:Ge(m,a),searchText:a.searchText,selectedCategory:B.Destination}).searchResults.find(({category:e})=>e===B.Destination)?.entities||[],[m,a]),g=l(()=>h.map(o=>{const{hasErrors:i,hasWarnings:a,hasDisableds:l}=re(o.conditions||[]),{icon:r,iconSrc:d}=ze(o.destinationType.type);return{status:i?j.Error:a?j.Warning:void 0,faded:l,onClick:()=>{s(B.Destination),c(o.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ve,{icon:r,src:d})},{columnKey:"name",value:be(o,B.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:o.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:Ae(Me(t,B.Destination,o.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(fe,{withLabels:!0,monitors:He(o.exportedSignals)})},{columnKey:"conditions",component:()=>o.conditions?.length?e.createElement(Ei,{conditions:o.conditions,id:o.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:o.disabled?j.Error:j.Success,title:o.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==m.length?{badge:`${h.length}/${m.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:m.length,badgeTooltip:void 0},[h,m]);return e.createElement(xe,{$maxWidth:i},e.createElement(Ce,null,e.createElement($e,{icon:Se(B.Destination),title:p.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(ke,{$maxHeight:o},e.createElement(we,{columns:ka,rows:g})),!h.length&&e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},Da=e=>{const{type:t,ruleName:o,notes:i,disabled:n,profileName:a,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!n)},{title:p.NAME,value:o},{title:p.NOTES,value:i},{title:p.MANAGED_BY_PROFILE,value:a},{type:m.Divider}];if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[Et.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=c[Ot.Probes]||[],t=e.filter(e=>e.className&&e.methodName).map(e=>`${e.className}.${e.methodName}`).join("\r\n");t&&d.push({title:p.INSTRUMENTED_METHODS,value:t});const o=e.filter(e=>e.symbol).map(e=>e.symbol).join("\r\n");o&&d.push({title:p.INSTRUMENTED_SYMBOLS,value:o})}return d},Na=d.div`
|
|
210
210
|
display: flex;
|
|
211
211
|
flex-direction: column;
|
|
212
212
|
gap: 12px;
|
|
@@ -239,10 +239,10 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
239
239
|
max-height: calc(100vh - 220px);
|
|
240
240
|
overflow: overlay;
|
|
241
241
|
overflow-y: auto;
|
|
242
|
-
`,Ha=({updateInstrumentationRule:o,deleteInstrumentationRule:i})=>{const{instrumentationRules:a}=V(),{addNotification:r}=L(),{drawerType:s,drawerEntityId:c}=P(),d=n(null),u=s!==B.InstrumentationRule,[p,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:b,resetFormData:f,validateForm:x,loadFormWithDrawerItem:C}=Pt(),$=l(()=>{if(u)return f();const e=a?.find(e=>e.ruleId===c);return e?C(e):f(),e},[u,c,a]);if(!$)return null;const S=qt.find(({type:e})=>e===$.type);return e.createElement($i,{ref:d,title:$.ruleName||$.type,icons:[
|
|
242
|
+
`,Ha=({updateInstrumentationRule:o,deleteInstrumentationRule:i})=>{const{instrumentationRules:a}=V(),{addNotification:r}=L(),{drawerType:s,drawerEntityId:c}=P(),d=n(null),u=s!==B.InstrumentationRule,[p,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:b,resetFormData:f,validateForm:x,loadFormWithDrawerItem:C}=Pt(),$=l(()=>{if(u)return f();const e=a?.find(e=>e.ruleId===c);return e?C(e):f(),e},[u,c,a]);if(!$)return null;const S=qt.find(({type:e})=>e===$.type);return e.createElement($i,{ref:d,title:$.ruleName||$.type,icons:[Pe($.type)],isEdit:p,isFormDirty:h,onEdit:e=>{$.mutable||!e&&void 0!==e?m("boolean"!=typeof e||e):r({type:j.Warning,title:ne.FORBIDDEN,message:ne.CANNOT_EDIT_RULE,crdType:B.InstrumentationRule,target:c,hideFromHistory:!0})},onSave:e=>{if(x()){const t=e!==$.type?e:"";b("ruleName",t),o(c,{...y,ruleName:t}),m(!1),g(!1)}},onDelete:()=>{$.mutable?(i(c),m(!1),g(!1),d.current?.closeDrawer()):r({type:j.Warning,title:ne.FORBIDDEN,message:ne.CANNOT_DELETE_RULE,crdType:B.InstrumentationRule,target:c,hideFromHistory:!0})},onCancel:()=>{m(!1),g(!1),C($)}},p&&S?e.createElement(Ka,null,e.createElement(qa,{isUpdate:!0,rule:S,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),b(...e)}})):e.createElement(Y,{title:"Instrumentation Rule Details",data:$?Da($):[]}))},za=d(Q)`
|
|
243
243
|
margin-top: 24px;
|
|
244
244
|
gap: 12px;
|
|
245
|
-
`,Wa=qt,Ba=({isEnterprise:o,createInstrumentationRule:i})=>{const{currentModal:n,setCurrentModal:a}=Z(),l=n===B.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=Pt(),[m,h]=t(void 0),g=()=>{d(),h(void 0),a("")},y=()=>{if(!u())return null;i(r),g()};return q({key:"Enter",active:l},()=>y()),e.createElement(ee,{isOpen:l,onClose:g,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(te,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!o||!m,tooltip:o?"":ne.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(oe,null,e.createElement(O,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(za,null,o?e.createElement(ie,{type:j.Warning,message:ne.DEFINED_FOR_ALL_STREAMS(p.INSTRUMENTATION_RULES)}):e.createElement(ie,{type:j.Default,message:ne.ENTERPRISE_ONLY(p.INSTRUMENTATION_RULES)}),e.createElement(ae,{options:Wa,selectedOption:m,onOptionSelect:e=>{return t=e,d(),void h(t);var t},autoFocus:!m?.type})),m?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(qa,{rule:m,formData:r,formErrors:s,handleFormChange:c})):null))},ja=e=>{const{payloadCollection:t,codeAttributes:o,customInstrumentations:i}=e;let n="";if(t&&(n+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),o&&(n+=Object.entries(o).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i){const e=(i[Ot.Probes]||[]).filter(e=>e.className&&e.methodName).map(e=>`${e.className}.${e.methodName}`).join(", ");e&&(n+=n?`, ${e}`:e)}return n},Va=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"profile",title:p.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:p.STATUS},{key:"source-count",title:"Applicable Source"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],Ua=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),n=ge(),{setDrawerType:a,setDrawerEntityId:r}=P(),{instrumentationRules:s,instrumentationRulesLoading:c}=V(),d=l(()=>Mi({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:n.searchText,selectedCategory:B.InstrumentationRule}).searchResults.find(({category:e})=>e===B.InstrumentationRule)?.entities||[],[s,n]),u=l(()=>d.map(t=>({onClick:()=>{a(B.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(ve,{icon:
|
|
245
|
+
`,Wa=qt,Ba=({isEnterprise:o,createInstrumentationRule:i})=>{const{currentModal:n,setCurrentModal:a}=Z(),l=n===B.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=Pt(),[m,h]=t(void 0),g=()=>{d(),h(void 0),a("")},y=()=>{if(!u())return null;i(r),g()};return q({key:"Enter",active:l},()=>y()),e.createElement(ee,{isOpen:l,onClose:g,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(te,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!o||!m,tooltip:o?"":ne.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(oe,null,e.createElement(O,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(za,null,o?e.createElement(ie,{type:j.Warning,message:ne.DEFINED_FOR_ALL_STREAMS(p.INSTRUMENTATION_RULES)}):e.createElement(ie,{type:j.Default,message:ne.ENTERPRISE_ONLY(p.INSTRUMENTATION_RULES)}),e.createElement(ae,{options:Wa,selectedOption:m,onOptionSelect:e=>{return t=e,d(),void h(t);var t},autoFocus:!m?.type})),m?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(qa,{rule:m,formData:r,formErrors:s,handleFormChange:c})):null))},ja=e=>{const{payloadCollection:t,codeAttributes:o,customInstrumentations:i}=e;let n="";if(t&&(n+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),o&&(n+=Object.entries(o).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i){const e=(i[Ot.Probes]||[]).filter(e=>e.className&&e.methodName).map(e=>`${e.className}.${e.methodName}`).join(", ");e&&(n+=n?`, ${e}`:e)}return n},Va=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"profile",title:p.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:p.STATUS},{key:"source-count",title:"Applicable Source"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],Ua=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),n=ge(),{setDrawerType:a,setDrawerEntityId:r}=P(),{instrumentationRules:s,instrumentationRulesLoading:c}=V(),d=l(()=>Mi({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:n.searchText,selectedCategory:B.InstrumentationRule}).searchResults.find(({category:e})=>e===B.InstrumentationRule)?.entities||[],[s,n]),u=l(()=>d.map(t=>({onClick:()=>{a(B.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(ve,{icon:Pe(t.type)})},{columnKey:"name",value:be(t,B.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:i.text.info},{columnKey:"profile",value:t.profileName,textColor:i.text.info},{columnKey:"notes",value:t.notes,textColor:i.text.info,withTooltip:!0},{columnKey:"spec",value:ja(t),textColor:i.text.info,withTooltip:!0},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?j.Error:j.Success,title:t.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))},{columnKey:"source-count",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:j.Info,title:"all sources",withBorder:!0}))}]})),[d]),{badge:m,badgeTooltip:h}=l(()=>d.length!==s.length?{badge:`${d.length}/${s.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[d,s]);return e.createElement(xe,{$maxWidth:o},e.createElement(Ce,null,e.createElement($e,{icon:Se(B.Action),title:p.INSTRUMENTATION_RULES,badge:m,badgeTooltip:h,loading:c})),e.createElement(ke,{$maxHeight:t},e.createElement(we,{columns:Va,rows:u})),!d.length&&e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},_a=d.div`
|
|
246
246
|
position: fixed;
|
|
247
247
|
bottom: 0;
|
|
248
248
|
left: 50%;
|
|
@@ -255,7 +255,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
255
255
|
border-radius: 32px;
|
|
256
256
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
257
257
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
258
|
-
`,Ga=({totalSourceCount:o,uninstrumentSources:i,restartWorkloads:n})=>{const a=I.useTheme(),s=Kt({container:_a,animateIn:I.animations.slide.in.center,animateOut:I.animations.slide.out.center}),{selectedSources:c,setSelectedSources:d}=Ht(),[u,p]=t(!1),m=l(()=>{let e=0;return Object.values(c).forEach(t=>{e+=t.length}),e},[c]),h=()=>{d({})};return e.createElement(r,null,e.createElement(s,{"data-id":"multi-source-control",enter:!!m},e.createElement(T,null,"Selected sources"),e.createElement(Ie,{label:m,filled:!0}),e.createElement(le,{orientation:"vertical",length:"16px"}),e.createElement(
|
|
258
|
+
`,Ga=({totalSourceCount:o,uninstrumentSources:i,restartWorkloads:n})=>{const a=I.useTheme(),s=Kt({container:_a,animateIn:I.animations.slide.in.center,animateOut:I.animations.slide.out.center}),{selectedSources:c,setSelectedSources:d}=Ht(),[u,p]=t(!1),m=l(()=>{let e=0;return Object.values(c).forEach(t=>{e+=t.length}),e},[c]),h=()=>{d({})};return e.createElement(r,null,e.createElement(s,{"data-id":"multi-source-control",enter:!!m},e.createElement(T,null,"Selected sources"),e.createElement(Ie,{label:m,filled:!0}),e.createElement(le,{orientation:"vertical",length:"16px"}),e.createElement(rt,{variant:"tertiary",onClick:h},e.createElement(T,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(rt,{variant:"tertiary",onClick:()=>{const e=[];Object.values(c).forEach(t=>{const o=t.filter(he);e.push(...o.map(e=>zt(e)))}),n(e),h()}},e.createElement(Ao,null),e.createElement(T,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(rt,{variant:"tertiary",onClick:()=>p(!0)},e.createElement(ko,null),e.createElement(T,{family:"secondary",decoration:"underline",color:a.text.error},"Uninstrument"))),e.createElement(z,{isOpen:u,name:`${m} sources`,type:B.Source,isLastItem:m===o,onApprove:()=>{const e={};Object.entries(c).forEach(([t,o])=>{e[t]=o.map(e=>({...e,selected:!1}))}),i(e),p(!1),h()},onDeny:()=>p(!1)}))},Ja=d.div`
|
|
259
259
|
position: relative;
|
|
260
260
|
width: fit-content;
|
|
261
261
|
`,Ya=d(ce)`
|
|
@@ -280,7 +280,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
280
280
|
border-radius: 32px;
|
|
281
281
|
width: fit-content;
|
|
282
282
|
padding: 2px 8px;
|
|
283
|
-
`,el=()=>{const t=I.useTheme(),{notifications:o,markAsSeen:i}=L(),n=o.filter(({hideFromHistory:e})=>!e),a=n.filter(({seen:e})=>!e),l=a.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=
|
|
283
|
+
`,el=()=>{const t=I.useTheme(),{notifications:o,markAsSeen:i}=L(),n=o.filter(({hideFromHistory:e})=>!e),a=n.filter(({seen:e})=>!e),l=a.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Xe({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&a.forEach(({id:e})=>i(e))}});return e.createElement(Ja,null,e.createElement(pt,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Fo,{size:18})),e.createElement(Qe,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(Ya,null,e.createElement(T,{size:20},"Notifications"),!!l&&e.createElement(Za,{size:12,family:"secondary"},l," new"))},e.createElement(Xa,null,n.length?n.map(t=>e.createElement(ll,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(Ne,{title:"No notifications",subTitle:""})),e.createElement(Qa,null)))},tl=d.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
align-items: flex-start;
|
|
286
286
|
gap: 12px;
|
|
@@ -310,11 +310,11 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
310
310
|
display: flex;
|
|
311
311
|
align-items: center;
|
|
312
312
|
gap: 6px;
|
|
313
|
-
`,ll=({id:t,seen:o,type:i,title:n,message:a,time:l,crdType:r,target:s,onClick:c})=>{const d=I.useTheme(),u=Wt(),{onClickNotification:p}=Bt(),m=!!r&&!!s,h=n?.toLowerCase().includes(X.Delete.toLowerCase())||!1,g=me(i,d);return e.createElement(tl,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(ol,{$type:h?j.Error:i},h?e.createElement(ko,null):e.createElement(g,null)),e.createElement(il,null,e.createElement(nl,null,e.createElement(T,{size:14},a)),e.createElement(al,null,e.createElement(T,{size:10,color:d.text.grey},u.format(new Date(l))),!o&&e.createElement(e.Fragment,null,e.createElement(T,{size:10},"·"),e.createElement(T,{size:10,color:d.colors.orange_soft},"new")))))},rl=(e,t,o)=>{const i=e?.serviceName||(t&&he(t)?t.otelServiceName:void 0)||t?.name,n=o?[Ro]:
|
|
313
|
+
`,ll=({id:t,seen:o,type:i,title:n,message:a,time:l,crdType:r,target:s,onClick:c})=>{const d=I.useTheme(),u=Wt(),{onClickNotification:p}=Bt(),m=!!r&&!!s,h=n?.toLowerCase().includes(X.Delete.toLowerCase())||!1,g=me(i,d);return e.createElement(tl,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(ol,{$type:h?j.Error:i},h?e.createElement(ko,null):e.createElement(g,null)),e.createElement(il,null,e.createElement(nl,null,e.createElement(T,{size:14},a)),e.createElement(al,null,e.createElement(T,{size:10,color:d.text.grey},u.format(new Date(l))),!o&&e.createElement(e.Fragment,null,e.createElement(T,{size:10},"·"),e.createElement(T,{size:10,color:d.colors.orange_soft},"new")))))},rl=(e,t,o)=>{const i=e?.serviceName||(t&&he(t)?t.otelServiceName:void 0)||t?.name,n=o?[Ro]:qe(t&&he(t)&&t.containers||[]),{priorotizedStatus:a}=re(t&&he(t)&&t.conditions||[]);return{id:i,title:i,icons:n.length?n:[Lo],status:a,serviceMapEntry:e}},sl=e=>!!e&&he(e)&&"user"===e.otelServiceName&&!e.namespace&&!e.name&&!e.kind,cl=d.div`
|
|
314
314
|
width: 100%;
|
|
315
315
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
316
316
|
position: relative;
|
|
317
|
-
`,dl={sourceType:jt.K8s,namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},ul=({heightToRemove:t,serviceMap:i})=>{const n=I.useTheme(),{sources:a,sourcesLoading:l}=V(),{containerRef:r,containerHeight:s,containerWidth:c}=
|
|
317
|
+
`,dl={sourceType:jt.K8s,namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},ul=({heightToRemove:t,serviceMap:i})=>{const n=I.useTheme(),{sources:a,sourcesLoading:l}=V(),{containerRef:r,containerHeight:s,containerWidth:c}=je(),[d,u,m]=Yo([]),[h,g,y]=Xo([]);return o(()=>{if(s&&c){const t=(({sources:e,serviceMap:t,containerHeight:o,containerWidth:i})=>{const n=[],a=new Map,l=((e,t)=>{const o=new Map,i=new Map,n=new Map,a=new Set;e.forEach(e=>{a.add(e.serviceName),e.services.forEach(e=>{a.add(e.serviceName)})}),a.forEach(e=>{i.set(e,[]),n.set(e,0)}),e.forEach(e=>{e.services.forEach(t=>{i.get(e.serviceName)?.push(t.serviceName);const o=n.get(t.serviceName)||0;n.set(t.serviceName,o+1)})});const l=[],r=[];for(a.forEach(e=>{0===(n.get(e)||0)&&r.push(e)});r.length>0;){const e=[],t=r.length;for(let o=0;o<t;o++){const t=r.shift();e.push(t),i.get(t)?.forEach(e=>{const t=n.get(e)||0;n.set(e,t-1),t-1==0&&r.push(e)})}e.length>0&&l.push(e)}return a.forEach(e=>{l.flat().includes(e)||(0===l.length?l.push([e]):l[l.length-1].push(e))}),l.forEach((e,i)=>{const n=100+150*i,a=150*(e.length-1),l=(t-a)/2;e.forEach((e,t)=>{const i=l+150*t,a=n;o.set(e,{x:i,y:a})})}),o})(t,i);if(t.length&&e.length){t.forEach(t=>{const o=t.serviceName;if(n.find(e=>e.id===`${B.Source}-${o}-${Oe.MapItem}`))return;const i=e.find(e=>!!he(e)&&o===e.otelServiceName||o===e.name);a.set(o,t),t.services.forEach(e=>a.set(e.serviceName,{serviceName:e.serviceName,services:[]})),n.push({id:`${B.Source}-${o}-${Oe.MapItem}`,type:Oe.MapItem,position:l.get(o),data:rl(t,i,sl(i))})}),a.forEach((t,o)=>{if(n.find(e=>e.id===`${B.Source}-${o}-${Oe.MapItem}`))return;const i=e.find(e=>!!he(e)&&o===e.otelServiceName||o===e.name);n.push({id:`${B.Source}-${o}-${Oe.MapItem}`,type:Oe.MapItem,position:l.get(o),data:rl(t,i,sl(i))})});let o=50;e.forEach(e=>{const t=(he(e)?e.otelServiceName:void 0)||e.name;n.find(e=>e.id===`${B.Source}-${t}-${Oe.MapItem}`)||(n.push({id:`${B.Source}-${t}-${Oe.MapItem}`,type:Oe.MapItem,position:{x:o,y:10},data:rl(void 0,e,sl(e))}),o+=110)})}else n.push({id:`${B.Source}-${Oe.NoData}`,type:Oe.NoData,position:{x:i/2-150,y:o/4},data:{subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({serviceMap:i,sources:[dl].concat(a),sourcesLoading:l,containerHeight:s,containerWidth:c});d.length>1?(e=t,u(t=>{const o=e.map(e=>{const o=t.find(t=>t.id===e.id);return e.position=o?.position||e.position,{id:e.id,item:e,type:o?"replace":"add"}});return t.find(e=>e.id===`${B.Source}-${Oe.NoData}`)&&o.push({id:`${B.Source}-${Oe.NoData}`,type:"remove"}),Qo(o,t)})):u(t)}var e},[i,a,l,s,c]),o(()=>{g((({theme:e,nodes:t,serviceMap:o})=>{const i=[];return t.forEach(({id:t,data:{id:n,status:a}})=>{const{services:l}=o.find(e=>e.serviceName===n)||{services:[]};l.forEach(o=>{const n=t,l=`${B.Source}-${o.serviceName}-${Oe.MapItem}`,r=a===j.Error;i.push({id:`${n}-to-${l}`,source:n,target:l,markerEnd:{type:Zo.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),i})({theme:n,nodes:d,serviceMap:i}))},[n,d,i]),e.createElement(cl,{ref:r,$heightToRemove:t},e.createElement(Je,{nodes:d,edges:h,onNodesChange:m,onEdgesChange:y,zoomOnScroll:!0}))},pl=d.div`
|
|
318
318
|
display: flex;
|
|
319
319
|
flex-direction: column;
|
|
320
320
|
align-items: center;
|
|
@@ -357,7 +357,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
357
357
|
`,fl=d(T)`
|
|
358
358
|
width: 42px;
|
|
359
359
|
text-align: right;
|
|
360
|
-
`,xl=({isModal:t=!1,withInstances:o=!0,isFetchingEachNamespace:i,fetchedNamespaces:n,filteredNamespacesAndSources:a,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const m=I.useTheme(),{namespacesLoading:h}=V(),g=Object.entries(a||{});if(!g?.length)return e.createElement(De,null,h?e.createElement(
|
|
360
|
+
`,xl=({isModal:t=!1,withInstances:o=!0,isFetchingEachNamespace:i,fetchedNamespaces:n,filteredNamespacesAndSources:a,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const m=I.useTheme(),{namespacesLoading:h}=V(),g=Object.entries(a||{});if(!g?.length)return e.createElement(De,null,h?e.createElement(ft,null):e.createElement(Ne,{title:p.NO_SOURCES,subTitle:r?p.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:p.PLEASE_ADD_SOURCE}));const y=Se(B.Namespace);return e.createElement(pl,{$isModal:t},i&&e.createElement(ft,{scale:1.2}),g.map(([t,a])=>{const g=s?.[t]||[],b=d?.[t]?.selected||!1,f=g.filter(({selected:e})=>e),x=g.length>0,C=l===t,$=f.length>0&&f.length===a.length,S=f.length>0&&f.length!==a.length,w=a.length>0,D=1===a.length;return r||w?e.createElement(ml,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:$,$isOpen:C},e.createElement(hl,{$selected:$,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ce,{$gap:12},r&&e.createElement(v,{partiallyChecked:S,value:$,onChange:e=>r(t,e)}),e.createElement(y,null),e.createElement(T,null,t)),e.createElement(ce,{$gap:12},u&&e.createElement(k,{title:p.FUTURE_APPS_TITLE,tooltip:p.FUTURE_APPS_DESCRIPTION,initialValue:b,onChange:e=>u(e,t),flipHorizontally:!0}),i&&!n?.includes(t)?e.createElement(ft,{scale:.8}):e.createElement(fl,{size:10,color:m.text.grey},x?`${f.length}/${a.length}`:null),r&&e.createElement(mt,{extend:C}))),(C||!r)&&(w?e.createElement(yl,{$addPadding:!c},e.createElement(vl,null,e.createElement(le,{orientation:"vertical",length:(D?24:34*a.length)+"px"})),a.map(i=>{const n=f.some(({name:e})=>e===i.name);return e.createElement(Cl,{key:`source-${i.name}`,withInstances:o,source:i,namespace:t,isSelected:n,onSelect:c})})):e.createElement(bl,{$addPadding:!c},h||i&&!n?.includes(t)?e.createElement(ft,null):e.createElement(Ne,{title:p.NO_SOURCES_NAMESPACE,subTitle:p.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null}))},Cl=({withInstances:t,source:o,namespace:i,isSelected:n,onSelect:a})=>e.createElement(gl,{"data-id":`source-${o.name}`,$selected:n,$withClick:!!a,onClick:()=>a?.(o)},e.createElement(ce,{$gap:12},a&&e.createElement(v,{value:n,onChange:()=>a(o,i)}),e.createElement(ce,{$gap:4},e.createElement(T,null,o.name),e.createElement(T,{opacity:.8,size:10},t&&"numberOfInstances"in o?` • ${o.numberOfInstances||0} running instance${1!==o.numberOfInstances?"s":""}`:"",` • ${o.kind}`)))),$l=d.div`
|
|
361
361
|
display: flex;
|
|
362
362
|
flex-direction: column;
|
|
363
363
|
align-items: center;
|
|
@@ -366,16 +366,16 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
366
366
|
max-height: calc(100vh - 200px);
|
|
367
367
|
height: fit-content;
|
|
368
368
|
overflow-y: scroll;
|
|
369
|
-
`,Sl=({onEditStream:t,onEditSources:o,onEditDestinations:i,categories:n})=>{const{selectedStreamName:a}=
|
|
369
|
+
`,Sl=({onEditStream:t,onEditSources:o,onEditDestinations:i,categories:n})=>{const{selectedStreamName:a}=We(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=St(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(oe,{$isNotModal:!0},e.createElement(Q,{$gap:12},e.createElement(O,{title:p.SUMMARY,description:p.STREAM_CONFIRM}),e.createElement($l,null,e.createElement(Y,{title:p.STREAM_NAME,action:()=>e.createElement(Vt,{onClick:t}),data:[{title:"",value:a}]}),e.createElement(Y,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Vt,{onClick:o})},e.createElement(xl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Y,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Vt,{onClick:i})},e.createElement(xa,{categories:n})))))};var kl;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(kl||(kl={}));const wl=({onClickId:o,defaultSelectedId:i,extendedNavIcons:n})=>{const[a,r]=t(i||""),s=l(()=>[{id:kl.Overview,icon:Po,selected:a===kl.Overview,onClick:()=>{r(kl.Overview),o(kl.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:a===e.id,onClick:()=>{r(e.id),e.onClick()}}))],[a]),c=l(()=>[kl.Overview,kl.InstrumentationRules,kl.Sources,kl.Actions,kl.Destinations].includes(a)?[{id:kl.InstrumentationRules,icon:qo,selected:a===kl.InstrumentationRules,onClick:()=>{r(kl.InstrumentationRules),o(kl.InstrumentationRules)},tooltip:"Instrumentation Rules"},{id:kl.Sources,icon:Ko,selected:a===kl.Sources,onClick:()=>{r(kl.Sources),o(kl.Sources)},tooltip:"Sources"},{id:kl.Actions,icon:Ho,selected:a===kl.Actions,onClick:()=>{r(kl.Actions),o(kl.Actions)},tooltip:"Actions"},{id:kl.Destinations,icon:zo,selected:a===kl.Destinations,onClick:()=>{r(kl.Destinations),o(kl.Destinations)},tooltip:"Destinations"}]:[],[a]);return e.createElement(Ut,{orientation:"vertical",mainIcons:s,subIcons:c})},Dl=({})=>e.createElement(pt,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(Wo,null)),Nl=e=>{const{name:t,kind:o}=e,i=he(e)?e.namespace:"N/A";return[{title:p.NAMESPACE,value:i},{title:p.KIND,value:o},{title:p.NAME,value:t,tooltip:"K8s resource name"},{type:m.Divider},{type:m.CopyText,value:`kubectl get ${o} ${t} -n ${i}`.toLowerCase()}]},Tl=d.div`
|
|
370
370
|
display: flex;
|
|
371
371
|
flex-direction: column;
|
|
372
372
|
gap: 24px;
|
|
373
373
|
padding: 4px;
|
|
374
|
-
`,Il=({formData:t,handleFormChange:o})=>e.createElement(Tl,null,e.createElement(x,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:t.otelServiceName,onChange:({target:{value:e}})=>o("otelServiceName",e)})),El=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const o=_t(t.status),i=
|
|
374
|
+
`,Il=({formData:t,handleFormChange:o})=>e.createElement(Tl,null,e.createElement(x,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:t.otelServiceName,onChange:({target:{value:e}})=>o("otelServiceName",e)})),El=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const o=_t(t.status),i=it(t.reasonEnum),n=t.message;return e.createElement(ce,{$alignItems:"center",$justifyContent:"center"},e.createElement(se,{status:o,title:i,subtitle:n,withBackground:o!==pe.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Ol=({source:i,fetchSourceDescribe:n})=>{const[a,l]=t(!1),[r,s]=t(null);return o(()=>{i&&he(i)&&n({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.describeSource?s(e.describeSource):l(!0)})},[n,i]),r||a?e.createElement(Q,{$gap:12},a?e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Could not fetch describe for this source"})):r?.pods?.length?r.pods.map(({podName:t,nodeName:o,phase:n,agentInjected:a,runningLatestWorkloadRevision:l,containers:s})=>{const d=n.status!==j.Success||Gt(s)?j.Error:j.Success,u=[];return u.push(e.createElement(Jt,{value:`kubectl get pod ${t.value} -n ${r?.namespace?.value||(he(i)?i.namespace:"default")}`.toLowerCase()})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Yt,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Yt,{title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Yt,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),l?.name&&(u.push(e.createElement(Yt,{title:l.name,tooltip:l.explain||void 0,value:{status:l.status||void 0,text:l.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"}))),s.forEach(t=>{u.push(e.createElement(Xt,{...t}))}),e.createElement(Y,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:()=>e.createElement(se,{status:d,title:d,withIcon:!0,withBorder:!0})},c.toArray(u))}):e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Check if you have any running pods and try again"}))):e.createElement(De,{$height:"70vh"},e.createElement(ft,null))},Ml=d(ce)`
|
|
375
375
|
width: 100%;
|
|
376
376
|
align-items: center;
|
|
377
377
|
justify-content: space-between;
|
|
378
|
-
`,Al=({source:i,fetchSourceLibraries:n})=>{const a=I.useTheme(),[l,s]=t(!1),[c,d]=t(null);return o(()=>{i&&he(i)&&n({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(
|
|
378
|
+
`,Al=({source:i,fetchSourceLibraries:n})=>{const a=I.useTheme(),[l,s]=t(!1),[c,d]=t(null);return o(()=>{i&&he(i)&&n({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(Nt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[n,i]),he(i)?c||l?e.createElement(Q,{$gap:12},l?e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(Y,{title:"Instrumented Libraries"},c.map(({name:t,nonIdentifyingAttributes:o},i)=>e.createElement(r,{key:`library-${t}`},e.createElement(Ml,null,e.createElement(T,{size:12,color:a.text.grey},t),e.createElement(ce,{$gap:4},o.map(({key:o,value:i})=>Qt(i)&&Zt(i)&&"is_standard_lib"===o?e.createElement(se,{key:`${t}-${o}`,status:j.Default,title:"STANDARD",withBorder:!0}):null))),i!==c.length-1&&e.createElement(le,{length:"100%",margin:"0"})))):e.createElement(De,{$height:"70vh",$gap:12},e.createElement(Ne,{title:"No libraries found",subTitle:""}),e.createElement(ie,{type:j.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(De,{$height:"70vh"},e.createElement(ft,null)):e.createElement(De,{$height:"70vh"},e.createElement(Ne,{title:"Libraries not available",subTitle:"VM sources do not support library detection"}))};var Fl;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Fl||(Fl={}));const Rl=[oo.Deployment,oo.StatefulSet,oo.DaemonSet],Ll=[io.Python],Pl=d.div`
|
|
379
379
|
width: 100%;
|
|
380
380
|
height: 100%;
|
|
381
381
|
max-height: calc(100vh - 220px);
|
|
@@ -385,16 +385,16 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
385
385
|
display: flex;
|
|
386
386
|
flex-direction: column;
|
|
387
387
|
gap: 12px;
|
|
388
|
-
`,Kl=({persistSources:i,updateSource:a,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{sources:u}=V(),{selectedStreamName:m}=
|
|
388
|
+
`,Kl=({persistSources:i,updateSource:a,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{sources:u}=V(),{selectedStreamName:m}=We(),{drawerType:h,drawerEntityId:g}=P(),y=l(()=>Ve(u,m),[u,m]),v=n(null),b=h===B.Source,[f,x]=t(!1),[C,$]=t(!1),[S,k]=t(Fl.Overview),[w,D]=t(null);o(()=>{b&&g&&s(g).then(e=>D(e||null))},[b,g]);const{formData:N,handleFormChange:I,resetFormData:E,loadFormWithDrawerItem:O}=eo(),M=l(()=>{if(!b)return E();const e=(w&&JSON.stringify(zt(w))===JSON.stringify(zt(g))?w:null)||y?.find(e=>{const t=zt(e),o=zt(g);return JSON.stringify(t)===JSON.stringify(o)});return e?O(e):E(),e},[b,g,y,w]),A=l(()=>{if(!M)return{description:void 0,isLoading:!1,containers:[]};const e=he(M)?M.conditions?.find(({type:e})=>"RuntimeDetection"===e):null;return{description:e?.message,isLoading:e?.status===pe.Loading,containers:he(M)&&M.containers||[]}},[M]),F=l(()=>{const e=[{label:Fl.Overview,onClick:()=>k(Fl.Overview),selected:S===Fl.Overview}];return M&&he(M)&&Rl.includes(M.kind)&&e.push({label:Fl.Pods,onClick:()=>k(Fl.Pods),selected:S===Fl.Pods}),M&&he(M)&&M.containers?.some(({language:e})=>Ll.includes(e))&&e.push({label:Fl.Libraries,onClick:()=>k(Fl.Libraries),selected:S===Fl.Libraries}),e},[S,M]);return M?e.createElement($i,{ref:v,onClose:()=>{k(Fl.Overview),D(null)},title:he(M)&&M.otelServiceName||M.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:qe(he(M)?M.containers:null),isEdit:f,isFormDirty:C,onEdit:S===Fl.Overview?e=>{x("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=N.otelServiceName!==M.name?N.otelServiceName:"";I("otelServiceName",e),he(M)&&await a(g,{...N,otelServiceName:e}),D(null),$(!1),x(!1)},onDelete:S===Fl.Overview?async()=>{const e=he(M)?M.namespace:"vm",t={...M,selected:!1,currentStreamName:m,numberOfInstances:he(M)?M.numberOfInstances:0};i({[e]:[t]},{}),D(null),$(!1),x(!1),v.current?.closeDrawer()}:void 0,onCancel:()=>{$(!1),x(!1);const e=he(M)?M.otelServiceName:M.name;I("otelServiceName",e||M.name||"")},isLastItem:1===y.length,tabs:F,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([g]),children:e.createElement(e.Fragment,null,e.createElement(Ao,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},S===Fl.Overview?f?e.createElement(Pl,null,e.createElement(Il,{formData:N,handleFormChange:(...e)=>{$(!0),I(...e),I("currentStreamName",m)}})):e.createElement(ql,null,e.createElement(El,{workloadOdigosHealthStatus:he(M)?M.workloadOdigosHealthStatus:null}),e.createElement(J,{conditions:he(M)&&M.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:M?Nl(M):[]}),e.createElement(Y,{title:p.DETECTED_CONTAINERS,titleBadge:A.isLoading?pe.Loading:A.containers.length,description:A.description||p.DETECTED_CONTAINERS_DESCRIPTION},A.containers.map(t=>e.createElement(to,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await a(g,e)})))):S===Fl.Pods?e.createElement(Ol,{source:M,fetchSourceDescribe:c}):e.createElement(Al,{source:M,fetchSourceLibraries:d})):null},Hl=d.div`
|
|
389
389
|
max-width: 420px;
|
|
390
390
|
width: 100%;
|
|
391
|
-
`,zl=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},n)=>{const l=I.useTheme(),r=no({fetchSingleNamespace:o}),{availableSources:s,selectedSources:c,isFetchingEachNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:C,setShowSelectedOnly:$,showRunningOnly:S,setShowRunningOnly:w}=r;a(n,()=>({getFormValues:()=>({initial:s,apps:h(),futureApps:g()})}));const D=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(oe,{$isNotModal:!t},e.createElement(Q,{$gap:12},e.createElement(Q,{$gap:24},i&&e.createElement(
|
|
391
|
+
`,zl=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},n)=>{const l=I.useTheme(),r=no({fetchSingleNamespace:o}),{availableSources:s,selectedSources:c,isFetchingEachNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:C,setShowSelectedOnly:$,showRunningOnly:S,setShowRunningOnly:w}=r;a(n,()=>({getFormValues:()=>({initial:s,apps:h(),futureApps:g()})}));const D=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(oe,{$isNotModal:!t},e.createElement(Q,{$gap:12},e.createElement(Q,{$gap:24},i&&e.createElement(gt,{onClick:i}),e.createElement(O,{title:p.SELECT_SOURCES,badgeLabel:D,description:p.SELECT_SOURCES_DESCRIPTION}),e.createElement(ce,{$justifyContent:"space-between"},e.createElement(Hl,null,e.createElement(x,{placeholder:b===B.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:Do,value:y,onChange:e=>v(e.target.value.toLowerCase())})),e.createElement(E,{options:[{label:p.SOURCE,value:B.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:p.NAMESPACE,value:B.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:f})),e.createElement(ce,{$gap:36},e.createElement(k,{title:p.SELECT_ALL,initialValue:u,onChange:m,disabled:d}),e.createElement(k,{title:p.ONLY_SELECTED,initialValue:C,onChange:$}),e.createElement(k,{title:p.ONLY_RUNNING_INSTANCES,initialValue:S,onChange:w}))),e.createElement(le,null),e.createElement(xl,{isModal:t,...r})))});zl.displayName=zl.name;const Wl=({fetchSingleNamespace:t,persistSources:o})=>{const{currentModal:i,setCurrentModal:a}=Z(),l=i===B.Source,r=()=>{a("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();o(e,t),r()}},c=n(null);return q({key:"Enter",active:l},s),l?e.createElement(ee,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(zl,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Bl=[{key:"checkbox-and-icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"type",title:"Type",sortable:!0},{key:"namespace",title:p.NAMESPACE,sortable:!0},{key:"containers",title:p.DETECTED_CONTAINERS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],jl=({metrics:t,maxHeight:o,maxWidth:i})=>{const n=I.useTheme(),a=ge(),{isThisPending:r}=R(),{selectedStreamName:c}=We(),{sources:d,sourcesLoading:u}=V(),{setDrawerType:m,setDrawerEntityId:h}=P(),{selectedSources:g,setSelectedSources:y}=Ht(),{isAwaitingInstrumentation:b,sourcesToCreate:f,sourcesCreated:x,sourcesToDelete:C,sourcesDeleted:$}=Be(),S=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return f?e(f,x):C?e(C,$):1},[f,x,C,$]),k=l(()=>Ve(d,c),[d,c]),w=l(()=>Mi({instrumentationRules:[],sources:Ue(k,a),actions:[],destinations:[],searchText:a.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[k,a]),[D,N]=l(()=>{let e=0;return Object.values(g).forEach(t=>{e+=t.length}),[0!==e,e]},[g]),E=s(e=>{if(e){const e={};w.forEach(t=>{const o=zt(t);if(!r({entityType:B.Source,entityId:o})){const o=he(t)?t.namespace:"vm";e[o]?e[o].push(t):e[o]=[t]}}),y(e)}else y({})},[w]),O=s(e=>{const t=he(e)?e.namespace:"vm",{name:o,kind:i}=e,n={...g};n[t]||(n[t]=[]);const a=n[t].findIndex(e=>e.name===o&&e.kind===i);-1===a?n[t].push(e):n[t].splice(a,1),y(n)},[g]),M=l(()=>w.map(o=>{const i=zt(o),a=JSON.stringify(i),{hasErrors:l,hasWarnings:s,hasDisableds:c}=re(he(o)&&o.conditions||[]),d=r({entityType:B.Source,entityId:i}),u=he(o)?o.namespace:"vm",p=!!g[u]?.find(e=>e.name===o.name&&e.kind===o.kind);return{status:l?j.Error:s?j.Warning:void 0,faded:c,onClick:()=>{m(B.Source),h(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ce,{$gap:16},e.createElement(v,{disabled:d,value:p,onChange:()=>O(o)}),e.createElement(ao,{icons:qe(he(o)?o.containers:null),id:a}))},{columnKey:"name",value:be(o,B.Source,{extended:!0})},{columnKey:"type",value:o.kind,textColor:n.text.info},{columnKey:"namespace",value:he(o)?o.namespace:"N/A",textColor:n.text.info},{columnKey:"throughput",value:Ae(Me(t,B.Source,i).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Ei,{conditions:he(o)&&o.conditions||[],id:a})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:j.Info,title:he(o)?lo(o.containers):"N/A",withBorder:!0}))}]}}),[w,g,t,O]),{badge:A,badgeTooltip:F}=l(()=>w.length!==k.length?{badge:`${w.length}/${k.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:k.length,badgeTooltip:void 0},[w,k]);return e.createElement(xe,{$maxWidth:i},e.createElement(Ce,null,e.createElement(v,{partiallyChecked:D&&w?.length!==N,value:D&&w?.length===N,onChange:E,disabled:!w?.length}),e.createElement($e,{icon:Se(B.Source),title:p.SOURCES,badge:A,badgeTooltip:F,loading:u||b})),e.createElement(ke,{$maxHeight:o},e.createElement(we,{columns:Bl,rows:M})),b&&!M.length?e.createElement(De,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Te,{width:420}),e.createElement(ce,{$gap:16},e.createElement(T,{color:n.text.info},f?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Ie,{label:`${S}%`}))):M.length?null:e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},Vl=({expiresAt:t})=>{const o=I.useTheme(),i=Wt().format(t),n=new Date(t).toDateString().split(" ").slice(1).join(" "),a=ro(t,0)?o.text.error:ro(t,6048e5)?o.text.warning:o.text.success;return e.createElement(T,{size:14,color:a},i," (",n,")")},Ul=d.div`
|
|
392
392
|
position: relative;
|
|
393
|
-
`,_l=({token:o,saveToken:i})=>{const n=I.useTheme(),{isCopied:a,clickCopy:l}=so(),{formData:r,handleFormChange:s,resetFormData:c}=co({token:o}),[d,u]=t(!1),p=()=>{u(!1),c()},m=me(j.Success,n);return e.createElement(ce,{$gap:0},e.createElement(
|
|
393
|
+
`,_l=({token:o,saveToken:i})=>{const n=I.useTheme(),{isCopied:a,clickCopy:l}=so(),{formData:r,handleFormChange:s,resetFormData:c}=co({token:o}),[d,u]=t(!1),p=()=>{u(!1),c()},m=me(j.Success,n);return e.createElement(ce,{$gap:0},e.createElement(pt,{size:32,onClick:()=>l(o)},a?e.createElement(m,null):e.createElement(Bo,null)),e.createElement(le,{orientation:"vertical",length:"12px"}),e.createElement(Ul,null,e.createElement(pt,{size:32,onClick:()=>{u(!0)}},e.createElement(So,null)),d&&e.createElement(uo,{flipX:!0,clientX:36,isOpen:d,onClose:p,onSave:()=>{i(r.token).then(p)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement(x,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>s("token",e.target.value)}))))},Gl=({tokens:t,saveToken:o})=>e.createElement(Y,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:m.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:t.map(({name:t,token:i,expiresAt:n})=>({cells:[{columnKey:"icon",icon:jo},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Vl,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(_l,{token:i,saveToken:o})}]}))}}]}),Jl=({fetchDescribeOdigos:i})=>{const[n,a]=t(null);if(o(()=>{i().then(({data:e})=>{a(e?.describeOdigos||null)})},[i]),!n)return e.createElement(De,null,e.createElement(ft,null));const l=t=>t?.name?[e.createElement(le,{key:`divider-${t.name}`}),e.createElement(Yt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(Qt(t.value)?Zt(t.value)?j.Success:j.Error:j.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(Y,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:n?.odigosVersion?.name,value:n?.odigosVersion?.value},{title:n?.kubernetesVersion?.name,value:n?.kubernetesVersion?.value},{title:n?.installationMethod?.name,value:n?.installationMethod?.value},{title:n?.tier?.name,value:n?.tier?.value},{title:"# of sources",value:n?.numberOfSources?.toString()},{title:"# of destinations",value:n?.numberOfDestinations?.toString()}]}),e.createElement(Y,{title:"Cluster Collector",withExtend:!0},Object.values(n?.clusterCollector||{}).map(l)),e.createElement(Y,{title:"Node Collector",withExtend:!0},Object.values(n?.nodeCollector||{}).map(l)))},Yl=d.div`
|
|
394
394
|
display: flex;
|
|
395
395
|
flex-direction: column;
|
|
396
396
|
gap: 12px;
|
|
397
|
-
`,Xl="System Overview",Ql=({tokens:o,saveToken:i,fetchDescribeOdigos:n})=>{const[a,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(
|
|
397
|
+
`,Xl="System Overview",Ql=({tokens:o,saveToken:i,fetchDescribeOdigos:n})=>{const[a,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(pt,{key:Xl,onClick:r,tooltip:Xl},e.createElement(Vo,{size:18})),e.createElement(H,{width:"750px",isOpen:a,onClose:r,header:{icons:[Vo],title:Xl},footer:{isOpen:!1}},e.createElement(Yl,null,!!o?.length&&e.createElement(Gl,{tokens:o,saveToken:i}),e.createElement(Jl,{fetchDescribeOdigos:n}))))};var Zl;!function(e){e.General="General",e.Ui="UI",e.Rollback="Rollback",e.CollectorNode="Collector Node",e.CollectorGateway="Collector Gateway"}(Zl||(Zl={}));const er=d.div`
|
|
398
398
|
align-self: stretch;
|
|
399
399
|
display: flex;
|
|
400
400
|
flex-direction: column;
|
|
@@ -413,7 +413,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
413
413
|
gap: 12px;
|
|
414
414
|
align-items: flex-start;
|
|
415
415
|
justify-content: space-between;
|
|
416
|
-
`,ir=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(er,{ref:n,id:Zl.Ui},e.createElement(or,null,e.createElement(tr,null,"UI")),e.createElement(x,{title:"Central Backend URL",tooltip:'When running the Centralized UI, you need to specify the URL of the central backend. <a href="https://docs.odigos.io/features/central">Learn more</a>.',required:!0,value:o.centralBackendURL||"",onChange:e=>{const{value:t}=e.target;i("centralBackendURL",t||null)}}),e.createElement(x,{title:"OIDC Tenant URL",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the URL of the OIDC tenant. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',required:!0,value:o.oidc?.tenantUrl||"",onChange:e=>{const{value:t}=e.target;i("oidc.tenantUrl",t||null)}}),e.createElement(x,{title:"OIDC Client ID",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the Client ID of the OIDC application. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',required:!0,value:o.oidc?.clientId||"",onChange:e=>{const{value:t}=e.target;i("oidc.clientId",t||null)}}),e.createElement(x,{title:"OIDC Client Secret",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the Client Secret of the OIDC application. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',type:"password",required:!0,value:o.oidc?.clientSecret||"",onChange:e=>{const{value:t}=e.target;i("oidc.clientSecret",t||null)}}),t&&e.createElement(x,{status:j.Warning,title:"(Advanced) UI Pagination Limit",tooltip:"The pagination limit for fetching data from the UI backend. A larger limit means more data will be fetched at once, reducing the number of requests to the backend. This might increase or decrease the performance of the UI - depending on your environment.",type:"number",required:!0,value:o.uiPaginationLimit?.toString()||"",onChange:e=>{const{value:t}=e.target;i("uiPaginationLimit",""===t?null:Number(t))}})));ir.displayName=ir.name;const nr=[{id:po.VirtualDevice,value:"Virtual Device"},{id:po.HostPath,value:"Host Path"},{id:po.InitContainer,value:"Init Container"}],ar=[{id:mo.Loader,value:"Loader"},{id:mo.PodManifest,value:"Pod Manifest"},{id:mo.LoaderFallbackToPodManifest,value:"Loader Fallback to Pod Manifest"}],lr=[{id:ho.CodeAttributes,value:"Code Attributes"},{id:ho.FullPayloadCollection,value:"Full Payload Collection"},{id:ho.DbPayloadCollection,value:"DB Payload Collection"},{id:ho.QueryOperationDetector,value:"Query Operation Detector"},{id:ho.AllowConcurrentAgents,value:"Allow Concurrent Agents"},{id:ho.JavaEbpfInstrumentations,value:"Java EBPF Instrumentations"},{id:ho.JavaNativeInstrumentations,value:"Java Native Instrumentations"},{id:ho.SizeS,value:"Size S"},{id:ho.SizeM,value:"Size M"},{id:ho.SizeL,value:"Size L"}],rr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(er,{ref:n,id:Zl.General},e.createElement(or,null,e.createElement(tr,null,"General")),e.createElement(x,{title:"Cluster Name",tooltip:'Name of the cluster, this is optional, but required in the Centralized UI. <a href="https://docs.odigos.io/features/central">Learn more</a>.',required:!0,value:o.clusterName||"",onChange:e=>{const{value:t}=e.target;i("clusterName",t||null)}}),e.createElement(k,{title:"Enable the Karpenter Integration",tooltip:'<a href="https://docs.odigos.io/setup/odigos-with-karpenter">Learn how to configure Karpenter</a>. Once the Karpenter tainting setup is complete, inform Odigos to disable node affinity and rely on the taint mechanism.',initialValue:o.karpenterEnabled||!1,onChange:e=>i("karpenterEnabled",e)}),e.createElement(k,{title:"Allow Odigos Alongisde Other Agents",tooltip:"By default Odigos does not instrument applications that are already instrumented by other agents. If you want to allow Odigos to instrument applications that are already instrumented by other agents, enable this option. Note: this is not recommended and should be used only if you know what you are doing.",initialValue:o.allowConcurrentAgents||!1,onChange:e=>i("allowConcurrentAgents",e)}),e.createElement(k,{title:"Disable Automatic Rollout",tooltip:"By default, Odigos automatically rolls out the pods after the instrumentation is complete. If you want to disable rollouts and do it manually, toggle this option.",initialValue:o.rollout?.automaticRolloutDisabled||!1,onChange:e=>i("rollout.automaticRolloutDisabled",e)}),e.createElement(x,{title:"Image Prefix",tooltip:"Docker image prefix for all Odigos components. This is disabled because this setting requires a CLI update.",disabled:!0,required:!0,value:o.imagePrefix||"",onChange:e=>{const{value:t}=e.target;i("imagePrefix",t||null)}}),e.createElement(w,{title:"Node Selector",tooltip:"NodeSelector is a map of key-value Kubernetes NodeSelector labels to apply to all Odigos components. Note that Odigos will only be able to instrument applications on the same node. This setting can be applied only via the CLI.",disabled:!0,required:!0,value:Object.entries(o.nodeSelector||{}).map(([e,t])=>({key:e,value:t}))}),e.createElement(it,{title:"Profiles",tooltip:"Enable custom profiles to customize the Odigos instrumentation.",isMulti:!0,options:lr,value:lr.filter(e=>o.profiles?.includes(e.id)),onSelect:e=>i("profiles",[...o.profiles||[],e.id]),onDeselect:e=>i("profiles",o.profiles?.filter(t=>t!==e.id)||[])}),e.createElement(or,null,e.createElement(D,{title:"Ignored Namespaces",tooltip:"List of namespaces to exclude from instrumentation. Note: you cannot remove the default namespaces from the list, but you are able to add more namespaces.",required:!0,value:o.ignoredNamespaces||[],onChange:e=>i("ignoredNamespaces",e)}),e.createElement(D,{title:"Ignored Containers",tooltip:"List of container names to exclude from instrumentation, this is a global setting and will be applied to all applications",required:!0,value:o.ignoredContainers||[],onChange:e=>i("ignoredContainers",e)})),t&&e.createElement(e.Fragment,null,e.createElement(it,{status:j.Warning,title:"(Advanced) Mount Method",tooltip:'For Odigos agents to run inside instrumented pod containers, certain files must be mounted into the container. In Kubernetes, these files are mounted under `/var/odigos` directory, with subdirectories for each agent. <a href="https://docs.odigos.io/instrumentations/configuration/mount-method#agent-mount-method">Learn more</a>.',options:nr,required:!0,value:nr.find(e=>e.id===o.mountMethod)||void 0,onSelect:e=>i("mountMethod",e.id)}),e.createElement(it,{status:j.Warning,title:"(Advanced) Agent Envs Injection Method",tooltip:"In order for Odigos to instrument applications, it needs to inject environment variables into the application. This setting controls how Odigos injects these environment variables.",options:ar,required:!0,value:ar.find(e=>e.id===o.agentEnvVarsInjectionMethod)||void 0,onSelect:e=>i("agentEnvVarsInjectionMethod",e.id)}),e.createElement(x,{status:j.Warning,title:"(Advanced) Odiglet Health Probe Port",tooltip:"If the Odiglet is running with a host network, it may conflict with the port of other processes. This setting allows you to specify a different port for the health probe.",type:"number",required:!0,value:o.odigletHealthProbeBindPort?.toString()||"",onChange:e=>{const{value:t}=e.target;i("odigletHealthProbeBindPort",""===t?null:Number(t))}}),e.createElement(x,{status:j.Warning,title:"(Advanced) Custom Container Runtime Socket Path",tooltip:"If containerd is located in a different path than the default supported path by Odigos, then you can specify the socket path here.",required:!0,value:o.customContainerRuntimeSocketPath||"",onChange:e=>{const{value:t}=e.target;i("customContainerRuntimeSocketPath",t||null)}}))));rr.displayName=rr.name;const sr=i(({formData:t,handleFormChange:o},i)=>e.createElement(er,{ref:i,id:Zl.Rollback},e.createElement(tr,null,"Rollback"),e.createElement(k,{title:"Rollback Disabled",tooltip:"Disable rollback",initialValue:t.rollbackDisabled||!1,onChange:e=>o("rollbackDisabled",e)}),e.createElement(or,null,e.createElement(x,{title:"Rollback Grace Time",tooltip:"This is the amount of time that a pod should be in the `CrashLoopBackoff` state before it is rolled back. Pods that are in the `CrashLoopBackoff` state for longer than this time will be rolled back.",required:!0,value:t.rollbackGraceTime||"",onChange:e=>{const{value:t}=e.target;o("rollbackGraceTime",t||null)}}),e.createElement(x,{title:"Rollback Stability Window",tooltip:"This is the time-window in which the pod should be in the `CrashLoopBackoff` state before it is rolled back. Pods that are in the `CrashLoopBackoff` state after this window will not be rolled back.",required:!0,value:t.rollbackStabilityWindow||"",onChange:e=>{const{value:t}=e.target;o("rollbackStabilityWindow",t||null)}}))));sr.displayName=sr.name;const cr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(er,{ref:n,id:Zl.CollectorNode},e.createElement(or,null,e.createElement(tr,null,"Collector Node")),e.createElement(or,null,e.createElement(x,{title:"Request Memory",tooltip:"You can optionally specify how much memory the collector node should request (in megabytes).",type:"number",required:!0,value:o.collectorNode?.requestMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.requestMemoryMiB",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit Memory",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.limitMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.limitMemoryMiB",""===t?null:Number(t))}})),e.createElement(or,null,e.createElement(x,{title:"Request CPU",tooltip:"You can optionally specify how much CPU the collector node should request (in millicores).",type:"number",required:!0,value:o.collectorNode?.requestCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.requestCPUm",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit CPU",tooltip:"You can optionally specify how much CPU the collector node should limit (in millicores).",type:"number",required:!0,value:o.collectorNode?.limitCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.limitCPUm",""===t?null:Number(t))}})),t&&e.createElement(e.Fragment,null,e.createElement(x,{status:j.Warning,title:"(Advanced) K8s Node Logs Directory",tooltip:"If `/var/log` is a symlink, you can specify the target directory for Kubernetes logs here.",required:!0,value:o.collectorNode?.k8sNodeLogsDirectory||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.k8sNodeLogsDirectory",t||null)}}),e.createElement(x,{status:j.Warning,title:"(Advanced) Own Metrics Port",tooltip:"If the collector node is running with a host network, it may conflict with the port of other processes. This setting allows you to specify a different port for the own metrics.",type:"number",required:!0,value:o.collectorNode?.collectorOwnMetricsPort?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.collectorOwnMetricsPort",""===t?null:Number(t))}}),e.createElement(or,null,e.createElement(x,{status:j.Warning,title:"(Advanced) Memory Limiter Limit",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.memoryLimiterLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.memoryLimiterLimitMiB",""===t?null:Number(t))}}),e.createElement(x,{status:j.Warning,title:"(Advanced) Memory Limiter Spike Limit",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.memoryLimiterSpikeLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.memoryLimiterSpikeLimitMiB",""===t?null:Number(t))}})),e.createElement(x,{status:j.Warning,title:"(Advanced) Go Memory Limit",tooltip:"Sets the GOMEMLIMIT environment variable to control Go runtime memory usage. This soft memory limit helps the garbage collector prevent out-of-memory conditions in Kubernetes by triggering more aggressive garbage collection as memory usage approaches the limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.goMemLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.goMemLimitMiB",""===t?null:Number(t))}}))));cr.displayName=cr.name;const dr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(er,{ref:n,id:Zl.CollectorGateway},e.createElement(or,null,e.createElement(tr,null,"Collector Gateway")),e.createElement(or,null,e.createElement(x,{title:"Autoscaler Min. Replicas",tooltip:"You can optionally specify the minimum number of replicas for the collector gateway.",type:"number",required:!0,value:o.collectorGateway?.minReplicas?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.minReplicas",""===t?null:Number(t))}}),e.createElement(x,{title:"Autoscaler Max. Replicas",tooltip:"You can optionally specify the maximum number of replicas for the collector gateway.",type:"number",required:!0,value:o.collectorGateway?.maxReplicas?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.maxReplicas",""===t?null:Number(t))}})),e.createElement(or,null,e.createElement(x,{title:"Request Memory",tooltip:"You can optionally specify how much memory the collector gateway should request (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.requestMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.requestMemoryMiB",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit Memory",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.limitMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.limitMemoryMiB",""===t?null:Number(t))}})),e.createElement(or,null,e.createElement(x,{title:"Request CPU",tooltip:"You can optionally specify how much CPU the collector gateway should request (in millicores).",type:"number",required:!0,value:o.collectorGateway?.requestCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.requestCPUm",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit CPU",tooltip:"You can optionally specify how much CPU the collector gateway should limit (in millicores).",type:"number",required:!0,value:o.collectorGateway?.limitCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.limitCPUm",""===t?null:Number(t))}})),t&&e.createElement(e.Fragment,null,e.createElement(or,null,e.createElement(x,{status:j.Warning,title:"(Advanced) Memory Limiter Limit",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.memoryLimiterLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.memoryLimiterLimitMiB",""===t?null:Number(t))}}),e.createElement(x,{status:j.Warning,title:"(Advanced) Memory Limiter Spike Limit",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.memoryLimiterSpikeLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.memoryLimiterSpikeLimitMiB",""===t?null:Number(t))}})),e.createElement(x,{status:j.Warning,title:"(Advanced) Go Memory Limit",tooltip:"Sets the GOMEMLIMIT environment variable to control Go runtime memory usage. This soft memory limit helps the garbage collector prevent out-of-memory conditions in Kubernetes by triggering more aggressive garbage collection as memory usage approaches the limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.goMemLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.goMemLimitMiB",""===t?null:Number(t))}}))));dr.displayName=dr.name;const ur=d.div`
|
|
416
|
+
`,ir=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(er,{ref:n,id:Zl.Ui},e.createElement(or,null,e.createElement(tr,null,"UI")),e.createElement(x,{title:"Central Backend URL",tooltip:'When running the Centralized UI, you need to specify the URL of the central backend. <a href="https://docs.odigos.io/features/central">Learn more</a>.',required:!0,value:o.centralBackendURL||"",onChange:e=>{const{value:t}=e.target;i("centralBackendURL",t||null)}}),e.createElement(x,{title:"OIDC Tenant URL",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the URL of the OIDC tenant. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',required:!0,value:o.oidc?.tenantUrl||"",onChange:e=>{const{value:t}=e.target;i("oidc.tenantUrl",t||null)}}),e.createElement(x,{title:"OIDC Client ID",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the Client ID of the OIDC application. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',required:!0,value:o.oidc?.clientId||"",onChange:e=>{const{value:t}=e.target;i("oidc.clientId",t||null)}}),e.createElement(x,{title:"OIDC Client Secret",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the Client Secret of the OIDC application. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',type:"password",required:!0,value:o.oidc?.clientSecret||"",onChange:e=>{const{value:t}=e.target;i("oidc.clientSecret",t||null)}}),t&&e.createElement(x,{status:j.Warning,title:"(Advanced) UI Pagination Limit",tooltip:"The pagination limit for fetching data from the UI backend. A larger limit means more data will be fetched at once, reducing the number of requests to the backend. This might increase or decrease the performance of the UI - depending on your environment.",type:"number",required:!0,value:o.uiPaginationLimit?.toString()||"",onChange:e=>{const{value:t}=e.target;i("uiPaginationLimit",""===t?null:Number(t))}})));ir.displayName=ir.name;const nr=[{id:po.VirtualDevice,value:"Virtual Device"},{id:po.HostPath,value:"Host Path"},{id:po.InitContainer,value:"Init Container"}],ar=[{id:mo.Loader,value:"Loader"},{id:mo.PodManifest,value:"Pod Manifest"},{id:mo.LoaderFallbackToPodManifest,value:"Loader Fallback to Pod Manifest"}],lr=[{id:ho.CodeAttributes,value:"Code Attributes"},{id:ho.FullPayloadCollection,value:"Full Payload Collection"},{id:ho.DbPayloadCollection,value:"DB Payload Collection"},{id:ho.QueryOperationDetector,value:"Query Operation Detector"},{id:ho.AllowConcurrentAgents,value:"Allow Concurrent Agents"},{id:ho.JavaEbpfInstrumentations,value:"Java EBPF Instrumentations"},{id:ho.JavaNativeInstrumentations,value:"Java Native Instrumentations"},{id:ho.SizeS,value:"Size S"},{id:ho.SizeM,value:"Size M"},{id:ho.SizeL,value:"Size L"}],rr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(er,{ref:n,id:Zl.General},e.createElement(or,null,e.createElement(tr,null,"General")),e.createElement(x,{title:"Cluster Name",tooltip:'Name of the cluster, this is optional, but required in the Centralized UI. <a href="https://docs.odigos.io/features/central">Learn more</a>.',required:!0,value:o.clusterName||"",onChange:e=>{const{value:t}=e.target;i("clusterName",t||null)}}),e.createElement(k,{title:"Enable the Karpenter Integration",tooltip:'<a href="https://docs.odigos.io/setup/odigos-with-karpenter">Learn how to configure Karpenter</a>. Once the Karpenter tainting setup is complete, inform Odigos to disable node affinity and rely on the taint mechanism.',initialValue:o.karpenterEnabled||!1,onChange:e=>i("karpenterEnabled",e)}),e.createElement(k,{title:"Allow Odigos Alongisde Other Agents",tooltip:"By default Odigos does not instrument applications that are already instrumented by other agents. If you want to allow Odigos to instrument applications that are already instrumented by other agents, enable this option. Note: this is not recommended and should be used only if you know what you are doing.",initialValue:o.allowConcurrentAgents||!1,onChange:e=>i("allowConcurrentAgents",e)}),e.createElement(k,{title:"Disable Automatic Rollout",tooltip:"By default, Odigos automatically rolls out the pods after the instrumentation is complete. If you want to disable rollouts and do it manually, toggle this option.",initialValue:o.rollout?.automaticRolloutDisabled||!1,onChange:e=>i("rollout.automaticRolloutDisabled",e)}),e.createElement(x,{title:"Image Prefix",tooltip:"Docker image prefix for all Odigos components. This is disabled because this setting requires a CLI update.",disabled:!0,required:!0,value:o.imagePrefix||"",onChange:e=>{const{value:t}=e.target;i("imagePrefix",t||null)}}),e.createElement(w,{title:"Node Selector",tooltip:"NodeSelector is a map of key-value Kubernetes NodeSelector labels to apply to all Odigos components. Note that Odigos will only be able to instrument applications on the same node. This setting can be applied only via the CLI.",disabled:!0,required:!0,value:Object.entries(o.nodeSelector||{}).map(([e,t])=>({key:e,value:t}))}),e.createElement(nt,{title:"Profiles",tooltip:"Enable custom profiles to customize the Odigos instrumentation.",isMulti:!0,options:lr,value:lr.filter(e=>o.profiles?.includes(e.id)),onSelect:e=>i("profiles",[...o.profiles||[],e.id]),onDeselect:e=>i("profiles",o.profiles?.filter(t=>t!==e.id)||[])}),e.createElement(or,null,e.createElement(D,{title:"Ignored Namespaces",tooltip:"List of namespaces to exclude from instrumentation. Note: you cannot remove the default namespaces from the list, but you are able to add more namespaces.",required:!0,value:o.ignoredNamespaces||[],onChange:e=>i("ignoredNamespaces",e)}),e.createElement(D,{title:"Ignored Containers",tooltip:"List of container names to exclude from instrumentation, this is a global setting and will be applied to all applications",required:!0,value:o.ignoredContainers||[],onChange:e=>i("ignoredContainers",e)})),t&&e.createElement(e.Fragment,null,e.createElement(nt,{status:j.Warning,title:"(Advanced) Mount Method",tooltip:'For Odigos agents to run inside instrumented pod containers, certain files must be mounted into the container. In Kubernetes, these files are mounted under `/var/odigos` directory, with subdirectories for each agent. <a href="https://docs.odigos.io/instrumentations/configuration/mount-method#agent-mount-method">Learn more</a>.',options:nr,required:!0,value:nr.find(e=>e.id===o.mountMethod)||void 0,onSelect:e=>i("mountMethod",e.id)}),e.createElement(nt,{status:j.Warning,title:"(Advanced) Agent Envs Injection Method",tooltip:"In order for Odigos to instrument applications, it needs to inject environment variables into the application. This setting controls how Odigos injects these environment variables.",options:ar,required:!0,value:ar.find(e=>e.id===o.agentEnvVarsInjectionMethod)||void 0,onSelect:e=>i("agentEnvVarsInjectionMethod",e.id)}),e.createElement(x,{status:j.Warning,title:"(Advanced) Odiglet Health Probe Port",tooltip:"If the Odiglet is running with a host network, it may conflict with the port of other processes. This setting allows you to specify a different port for the health probe.",type:"number",required:!0,value:o.odigletHealthProbeBindPort?.toString()||"",onChange:e=>{const{value:t}=e.target;i("odigletHealthProbeBindPort",""===t?null:Number(t))}}),e.createElement(x,{status:j.Warning,title:"(Advanced) Custom Container Runtime Socket Path",tooltip:"If containerd is located in a different path than the default supported path by Odigos, then you can specify the socket path here.",required:!0,value:o.customContainerRuntimeSocketPath||"",onChange:e=>{const{value:t}=e.target;i("customContainerRuntimeSocketPath",t||null)}}))));rr.displayName=rr.name;const sr=i(({formData:t,handleFormChange:o},i)=>e.createElement(er,{ref:i,id:Zl.Rollback},e.createElement(tr,null,"Rollback"),e.createElement(k,{title:"Rollback Disabled",tooltip:"Disable rollback",initialValue:t.rollbackDisabled||!1,onChange:e=>o("rollbackDisabled",e)}),e.createElement(or,null,e.createElement(x,{title:"Rollback Grace Time",tooltip:"This is the amount of time that a pod should be in the `CrashLoopBackoff` state before it is rolled back. Pods that are in the `CrashLoopBackoff` state for longer than this time will be rolled back.",required:!0,value:t.rollbackGraceTime||"",onChange:e=>{const{value:t}=e.target;o("rollbackGraceTime",t||null)}}),e.createElement(x,{title:"Rollback Stability Window",tooltip:"This is the time-window in which the pod should be in the `CrashLoopBackoff` state before it is rolled back. Pods that are in the `CrashLoopBackoff` state after this window will not be rolled back.",required:!0,value:t.rollbackStabilityWindow||"",onChange:e=>{const{value:t}=e.target;o("rollbackStabilityWindow",t||null)}}))));sr.displayName=sr.name;const cr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(er,{ref:n,id:Zl.CollectorNode},e.createElement(or,null,e.createElement(tr,null,"Collector Node")),e.createElement(or,null,e.createElement(x,{title:"Request Memory",tooltip:"You can optionally specify how much memory the collector node should request (in megabytes).",type:"number",required:!0,value:o.collectorNode?.requestMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.requestMemoryMiB",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit Memory",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.limitMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.limitMemoryMiB",""===t?null:Number(t))}})),e.createElement(or,null,e.createElement(x,{title:"Request CPU",tooltip:"You can optionally specify how much CPU the collector node should request (in millicores).",type:"number",required:!0,value:o.collectorNode?.requestCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.requestCPUm",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit CPU",tooltip:"You can optionally specify how much CPU the collector node should limit (in millicores).",type:"number",required:!0,value:o.collectorNode?.limitCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.limitCPUm",""===t?null:Number(t))}})),t&&e.createElement(e.Fragment,null,e.createElement(x,{status:j.Warning,title:"(Advanced) K8s Node Logs Directory",tooltip:"If `/var/log` is a symlink, you can specify the target directory for Kubernetes logs here.",required:!0,value:o.collectorNode?.k8sNodeLogsDirectory||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.k8sNodeLogsDirectory",t||null)}}),e.createElement(x,{status:j.Warning,title:"(Advanced) Own Metrics Port",tooltip:"If the collector node is running with a host network, it may conflict with the port of other processes. This setting allows you to specify a different port for the own metrics.",type:"number",required:!0,value:o.collectorNode?.collectorOwnMetricsPort?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.collectorOwnMetricsPort",""===t?null:Number(t))}}),e.createElement(or,null,e.createElement(x,{status:j.Warning,title:"(Advanced) Memory Limiter Limit",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.memoryLimiterLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.memoryLimiterLimitMiB",""===t?null:Number(t))}}),e.createElement(x,{status:j.Warning,title:"(Advanced) Memory Limiter Spike Limit",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.memoryLimiterSpikeLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.memoryLimiterSpikeLimitMiB",""===t?null:Number(t))}})),e.createElement(x,{status:j.Warning,title:"(Advanced) Go Memory Limit",tooltip:"Sets the GOMEMLIMIT environment variable to control Go runtime memory usage. This soft memory limit helps the garbage collector prevent out-of-memory conditions in Kubernetes by triggering more aggressive garbage collection as memory usage approaches the limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.goMemLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.goMemLimitMiB",""===t?null:Number(t))}}))));cr.displayName=cr.name;const dr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(er,{ref:n,id:Zl.CollectorGateway},e.createElement(or,null,e.createElement(tr,null,"Collector Gateway")),e.createElement(or,null,e.createElement(x,{title:"Autoscaler Min. Replicas",tooltip:"You can optionally specify the minimum number of replicas for the collector gateway.",type:"number",required:!0,value:o.collectorGateway?.minReplicas?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.minReplicas",""===t?null:Number(t))}}),e.createElement(x,{title:"Autoscaler Max. Replicas",tooltip:"You can optionally specify the maximum number of replicas for the collector gateway.",type:"number",required:!0,value:o.collectorGateway?.maxReplicas?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.maxReplicas",""===t?null:Number(t))}})),e.createElement(or,null,e.createElement(x,{title:"Request Memory",tooltip:"You can optionally specify how much memory the collector gateway should request (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.requestMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.requestMemoryMiB",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit Memory",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.limitMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.limitMemoryMiB",""===t?null:Number(t))}})),e.createElement(or,null,e.createElement(x,{title:"Request CPU",tooltip:"You can optionally specify how much CPU the collector gateway should request (in millicores).",type:"number",required:!0,value:o.collectorGateway?.requestCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.requestCPUm",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit CPU",tooltip:"You can optionally specify how much CPU the collector gateway should limit (in millicores).",type:"number",required:!0,value:o.collectorGateway?.limitCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.limitCPUm",""===t?null:Number(t))}})),t&&e.createElement(e.Fragment,null,e.createElement(or,null,e.createElement(x,{status:j.Warning,title:"(Advanced) Memory Limiter Limit",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.memoryLimiterLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.memoryLimiterLimitMiB",""===t?null:Number(t))}}),e.createElement(x,{status:j.Warning,title:"(Advanced) Memory Limiter Spike Limit",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.memoryLimiterSpikeLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.memoryLimiterSpikeLimitMiB",""===t?null:Number(t))}})),e.createElement(x,{status:j.Warning,title:"(Advanced) Go Memory Limit",tooltip:"Sets the GOMEMLIMIT environment variable to control Go runtime memory usage. This soft memory limit helps the garbage collector prevent out-of-memory conditions in Kubernetes by triggering more aggressive garbage collection as memory usage approaches the limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.goMemLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.goMemLimitMiB",""===t?null:Number(t))}}))));dr.displayName=dr.name;const ur=d.div`
|
|
417
417
|
display: flex;
|
|
418
418
|
flex-direction: column;
|
|
419
419
|
gap: 12px;
|
|
@@ -421,7 +421,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
421
421
|
overflow-y: auto;
|
|
422
422
|
`,pr=d.div`
|
|
423
423
|
position: relative;
|
|
424
|
-
`,mr="System Settings",hr=({installationMethod:i,fetchSettings:a,onSave:l})=>{const[r,s]=t(void 0),[c,d]=t(!1),[u,p]=t(!1),[m,h]=t(!1),g=()=>h(e=>!e),{popupRef:y,popupOpen:v,setPopupOpen:b}=
|
|
424
|
+
`,mr="System Settings",hr=({installationMethod:i,fetchSettings:a,onSave:l})=>{const[r,s]=t(void 0),[c,d]=t(!1),[u,p]=t(!1),[m,h]=t(!1),g=()=>h(e=>!e),{popupRef:y,popupOpen:v,setPopupOpen:b}=Xe(),{formData:f,handleFormChange:x,resetFormData:C,isFormDirty:$}=co(r);o(()=>{m?a().then(s):s(void 0)},[m]);const[S,w]=t(!1),[D,N]=t(null),I=e=>{$?(w(!0),N(()=>e)):e()},[E,O]=t(Zl.General),M=n(null),A=n(null),F=n(null),R=n(null),L=n(null),P=n(null),q=[A,F,R,L,P],z=[Zl.General,Zl.Ui,Zl.Rollback,Zl.CollectorNode,Zl.CollectorGateway];return e.createElement(e.Fragment,null,e.createElement(pt,{key:mr,onClick:g,tooltip:mr},e.createElement(Uo,{size:18})),e.createElement(H,{width:"750px",isOpen:m,onClose:()=>I(g),header:{icons:[Uo],title:mr,tabs:z.map(e=>({label:e,onClick:()=>(e=>{O(e),(e=>{const t=M.current;if(!t)return;let o=0;for(let i=0;i<q.length;i++){const n=q[i].current;if(n&&n.id===e){const e=t.getBoundingClientRect();o=n.getBoundingClientRect().top-e.top+t.scrollTop;break}}t.scrollTo({top:e===Zl.General?0:o,behavior:"smooth"})})(e)})(e),selected:E===e})),actions:[e.createElement(pr,{key:"actions"},e.createElement(pt,{withBorder:!0,onClick:()=>b(e=>!e)},e.createElement(T,{size:10},"•••")),e.createElement(Qe,{ref:y,isOpen:v,top:36,right:0,padding:"24px",width:"270px"},e.createElement(k,{title:"Enable Advanced Mode",tooltip:"Show advanced settings. Note: these are not recommended to be changed unless you know what you are doing.",initialValue:u,onChange:()=>p(e=>!e),flipHorizontally:!0})))]},footer:{isOpen:$,centerButtons:[{"data-id":"drawer-cancel",variant:"secondary",onClick:()=>I(C),children:K.CANCEL},{"data-id":"drawer-save",variant:"primary",onClick:async()=>{d(!0),await l(f),s(await a()),d(!1),C(),g()},children:K.SAVE}]}},void 0===f?.imagePrefix||c?e.createElement(De,null,e.createElement(ft,{scale:1.2})):e.createElement(ur,{ref:M},i===go.Helm&&e.createElement(ie,{type:j.Warning,title:"Helm",message:"Changes won't persist unless you update the `values.yaml` file"}),e.createElement(rr,{ref:A,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(ir,{ref:F,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(sr,{ref:R,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(cr,{ref:L,isAdvanced:u,formData:f,handleFormChange:x}),e.createElement(dr,{ref:P,isAdvanced:u,formData:f,handleFormChange:x}))),e.createElement(W,{isOpen:S,name:mr,onApprove:()=>{D?.(),w(!1)},onDeny:()=>{w(!1)}}))},gr=d.div`
|
|
425
425
|
position: fixed;
|
|
426
426
|
bottom: 12px;
|
|
427
427
|
left: 12px;
|
|
@@ -500,7 +500,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
500
500
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
501
501
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
502
502
|
white-space: nowrap;
|
|
503
|
-
`,Rr=({span:o,depth:i,indexInMatrix:n,maxDuration:a,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=I.useTheme(),[g,y]=t(!1),v=Tr-12*i-20-(s?12:0),b=s&&(1===i||o.logs.length>0);return e.createElement(Er,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(Or,{$depth:i,className:"span-left"},e.createElement(ce,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(
|
|
503
|
+
`,Rr=({span:o,depth:i,indexInMatrix:n,maxDuration:a,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=I.useTheme(),[g,y]=t(!1),v=Tr-12*i-20-(s?12:0),b=s&&(1===i||o.logs.length>0);return e.createElement(Er,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(Or,{$depth:i,className:"span-left"},e.createElement(ce,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(pt,{onClick:e=>{e.stopPropagation(),p?.()},size:24},e.createElement(mt,{extend:d??!1}))):e.createElement("div",{style:{width:"24px"}}),e.createElement(xo,{maxWidth:v/2,text:o.processID,textSize:14}),e.createElement(T,{size:12,color:h.text.darker_grey},"•"),e.createElement(xo,{maxWidth:v/2,text:o.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(b?e.createElement(ue,{...c},e.createElement(Jo,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(le,{type:j.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(Mr,{className:"span-right"},e.createElement(Ar,{$indexInMatrix:n,$duration:o.duration,$maxDuration:a,$startTime:o.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(Fr,null,vo(o.duration)))))},Lr=({spans:t,logs:o,depth:i,indexInMatrix:n,maxDuration:a,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=I.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=o.length?o:fo(t,"spans","logs"),y=g.length>0,v=y?g.length>1?`(${g.length}) errors`:g[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,b=y?g.length>1?void 0:g[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e.createElement("div",{key:`span-${p}`,style:{borderBottom:1===i?`1px dotted ${d.colors.border}`:"none"}},e.createElement(Rr,{span:t,depth:i,indexInMatrix:n+u+i,maxDuration:a,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Jo,title:v,text:b},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...fo(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(Lr,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:n+u,maxDuration:a,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},Pr=d.div`
|
|
504
504
|
width: 100%;
|
|
505
505
|
`,qr=d.div`
|
|
506
506
|
max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
@@ -530,4 +530,4 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
530
530
|
padding-top: 12px;
|
|
531
531
|
padding-left: 12px;
|
|
532
532
|
white-space: nowrap;
|
|
533
|
-
`,Wr=({heightToRemove:o,traces:i,isLoading:n})=>{const[a,r]=t([]),[s,c]=t(null),d=l(()=>
|
|
533
|
+
`,Wr=({heightToRemove:o,traces:i,isLoading:n})=>{const[a,r]=t([]),[s,c]=t(null),d=l(()=>Nt(i).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:Cr(e)})),[i]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),m=l(()=>{const e=d.find(e=>e.spans.some(e=>e.spanID===s?.spanID)),t=e?.processes.find(e=>e.serviceName===s?.processID);return t},[d,s]);return e.createElement(e.Fragment,null,e.createElement(Pr,{$heightToRemove:o},n?e.createElement(De,{$height:"50vh"},e.createElement(ft,{scale:1.5})):d.length?e.createElement(qr,{$heightToRemove:o},e.createElement(Kr,null,e.createElement(T,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement(Hr,{key:`${i}-divider`,$heightToRemove:o,index:i},e.createElement(zr,null,vo(u/5*i)))),d.map((t,o)=>{const{spans:i}=t,n=i.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),l=i.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return e.createElement(Lr,{key:`recursive-spans-${t.traceID}`,spans:i,logs:[],depth:1,indexInMatrix:o,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:a,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(De,{$height:"50vh"},e.createElement(Ne,{title:p.NO_TRACES_FOUND,subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(Nr,{span:s,process:m,onClose:()=>c(null)}))};export{Di as ActionDrawer,Ci as ActionForm,Ti as ActionModal,Fi as ActionTable,Ki as AwaitPipeline,hn as ConditionDropdown,cn as DataFlow,Kn as DataFlowActionsMenu,In as DataStreamDrawer,Nn as DataStreamForm,Hn as DataStreamSelectionForm,Zn as DestinationDrawer,Yn as DestinationForm,ba as DestinationModal,Sa as DestinationSelectionForm,wa as DestinationTable,gn as ErrorDropdown,Ha as InstrumentationRuleDrawer,qa as InstrumentationRuleForm,Ba as InstrumentationRuleModal,Ua as InstrumentationRuleTable,fn as KindDropdown,yn as LanguageDropdown,vn as MonitorDropdown,Ga as MultiSourceControl,bn as NamespaceDropdown,kl as NavIconIds,el as NotificationManager,$i as OverviewDrawer,ul as ServiceMap,Sl as SetupSummary,wl as SideNav,Dl as SlackInvite,Kl as SourceDrawer,Il as SourceForm,Wl as SourceModal,zl as SourceSelectionForm,jl as SourceTable,Ql as SystemOverview,hr as SystemSettings,Ei as TableCellConditions,yr as ToastList,xr as ToggleDarkMode,Wr as TraceView};
|