@odigos/ui-kit 0.0.221 → 0.0.222
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/lib/chunks/{index-B0bRHrR6.js → index-CIq3IoU4.js} +1 -1
- package/lib/chunks/{ui-components-BRgXOh8V.js → ui-components-DmCQvtmV.js} +184 -184
- package/lib/components/_v2/button/index.d.ts +1 -0
- package/lib/components/_v2/table/table-columns/filter/index.d.ts +2 -1
- package/lib/components/_v2/table/types.d.ts +17 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/overview-drawer/index.d.ts +2 -1
- package/lib/containers/source-drawer/profiling/flame-graph-canvas.d.ts +2 -0
- package/lib/containers/source-drawer/profiling/flamebearer.d.ts +9 -0
- package/lib/containers/source-drawer/profiling/index.d.ts +2 -0
- package/lib/containers/source-drawer/profiling/symbol-table.d.ts +2 -0
- package/lib/containers/v2.js +1 -1
- package/lib/containers.js +126 -126
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState as i,useEffect as o,Fragment as a,forwardRef as r,useRef as l,useImperativeHandle as s,useMemo as c,useCallback as d,useLayoutEffect as u,Children as p}from"react";import h,{css as m,useTheme as g}from"styled-components";import{bb as f,ci as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState as i,useEffect as o,Fragment as a,forwardRef as r,useRef as l,useImperativeHandle as s,useMemo as c,useCallback as d,useLayoutEffect as u,Children as p}from"react";import h,{css as m,useTheme as g}from"styled-components";import{bb as f,ci as v,s as y,K as b,f as S,cj as x,ck as C,cl as w,cm as k,k as T,l as E,cn as $,co as N,cp as D,cq as A,D as I,F as R,c as O,cr as M,cs as F,r as L,ct as P,h as _,cu as z,cv as K,cw as j,cx as V,cy as B,cz as W,bD as U,bO as H,cA as q,cB as G,cC as Y,a9 as J,bi as X,cD as Q,cE as Z,cF as ee,cG as te,cH as ne,cI as ie,cJ as oe,a2 as ae,cK as re,cL as le,cM as se,cN as ce,cO as de,Q as ue,O as pe,cP as he,cQ as me,cR as ge,cS as fe,cT as ve,cU as ye,U as be,cV as Se,cW as xe,cX as Ce,cY as we,cZ as ke,c_ as Te,c$ as Ee,d0 as $e,d1 as Ne,d2 as De,d3 as Ae,d4 as Ie,b as Re,d5 as Oe,d6 as Me,d7 as Fe,d8 as Le,bV as Pe,d9 as _e,da as ze,db as Ke,dc as je,dd as Ve,de as Be,df as We,L as Ue,dg as He,dh as qe,bg as Ge,di as Ye,bn as Je,bo as Xe,dj as Qe,E as Ze,dk as et,dl as tt,dm as nt,dn as it,dp as ot,dq as at,dr as rt,ds as lt,dt as st,du as ct,dv as dt,dw as ut,dx as pt,a0 as ht,dy as mt,dz as gt,dA as ft,dB as vt,dC as yt,dD as bt,dE as St,dF as xt,dG as Ct,dH as wt,z as kt,M as Tt,J as Et,dI as $t,dJ as Nt,dK as Dt,H as At,G as It,v as Rt,bf as Ot,dL as Mt,dM as Ft,dN as Lt,dO as Pt,V as _t,Y as zt,Z as Kt,X as jt,R as Vt,W as Bt,_ as Wt,dP as Ut,a1 as Ht,dQ as qt,dR as Gt,bj as Yt,a8 as Jt,dS as Xt,dT as Qt,dU as Zt,bE as en,dV as tn,dW as nn,dX as on,bp as an,dY as rn,dZ as ln,a5 as sn,d_ as cn,d$ as dn,aG as un,bQ as pn,bR as hn,T as mn,e as gn,q as fn,B as vn,a as yn,x as bn,cb as Sn,ad as xn,be as Cn,e0 as wn,N as kn,$ as Tn,n as En,aO as $n,o as Nn,e1 as Dn,e2 as An,e3 as In,e4 as Rn,e5 as On,e6 as Mn,g as Fn,e7 as Ln,e8 as Pn,e9 as _n,ea as zn,eb as Kn,ec as jn,ed as Vn,ee as Bn,ef as Wn,bF as Un,u as Hn,t as qn,bd as Gn,eg as Yn,eh as Jn,ei as Xn,ej as Qn,ek as Zn,el as ei}from"./chunks/ui-components-DmCQvtmV.js";import{TrashIcon as ti,VSquareIcon as ni,XSquareIcon as ii,EditIcon as oi,OdigosLogoText as ai,PlusIcon as ri,RefreshIcon as li,SearchIcon as si,FilterIcon as ci,DataStreamIcon as di,VIcon as ui,OdigosLogo as pi,ArrowIcon as hi,RefreshLeftArrowIcon as mi,NotificationIcon as gi,UserIcon as fi,ImageErrorIcon as vi,ChevronDownIcon as yi,ChevronRightIcon as bi,OverviewIcon as Si,SourceIcon as xi,DestinationIcon as Ci,InstrumentationRuleIcon as wi,ActionIcon as ki,SlackLogo as Ti,CopyIcon as Ei,MinusIcon as $i,XIcon as Ni,ExpandIcon as Di,DotIcon as Ai,DownloadIcon as Ii,KeyIcon as Ri,TerminalIcon as Oi,ExclamationTriangleIcon as Mi,TraceViewIcon as Fi}from"./icons.js";import{MarkerType as Li,useNodesState as Pi,useEdgesState as _i}from"@xyflow/react";import{E as zi}from"./chunks/vendor-C150cdxb.js";import{Y as Ki}from"./chunks/index-CIq3IoU4.js";import"zustand";import"javascript-time-ago";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const ji=e=>{const{type:t,name:n,notes:i,signals:o,disabled:a,fields:{collectContainerAttributes:r,collectReplicaSetAttributes:l,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:h,attributeNamesToDelete:m,renames:g,piiCategories:S,fallbackSamplingRatio:x,samplingPercentage:C,endpointsFilters:w,servicesNameFilters:k,attributeFilters:T,urlTemplatizationRulesGroups:E}}=e,$=[{title:f.TYPE,value:t},{type:v.ActiveStatus,title:f.STATUS,value:String(!a)},{type:v.Monitors,title:f.SIGNALS_FOR_PROCESSING,value:o?.join(", ")||""},{title:f.NAME,value:n||""},{title:f.NOTES,value:i||""},{type:v.Divider}];if(t===y.K8sAttributes&&($.push({title:"Collect Container Attributes",value:String(r)}),$.push({title:"Collect ReplicaSet Attributes",value:String(l)}),$.push({title:"Collect Workload ID",value:String(s)}),$.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&$.push({type:v.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:n,fromSources:i},o)=>{let a="";a+=`Label Key: ${e}\n`,a+=`Attribute Key: ${t}\n`;a+=`From: ${i?.length?i.join(", "):n||b.Pod}\n`,$.push({title:"Label"+(d.length>1?` #${o+1}`:""),value:a})}),u?.length&&$.push({type:v.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:n,fromSources:i},o)=>{let a="";a+=`Annotation Key: ${e}\n`,a+=`Attribute Key: ${t}\n`;a+=`From: ${i?.length?i.join(", "):n||b.Pod}\n`,$.push({title:"Annotation"+(u.length>1?` #${o+1}`:""),value:a})})),t===y.AddClusterInfo){$.push({title:"Overwrite Existing Values",value:String(h||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:n},i)=>{e+=`${t}: ${n}`,i<p.length-1&&(e+=", ")}),$.push({title:"Attributes",value:e})}if(t===y.DeleteAttributes){let e="";m?.forEach((t,n)=>{e+=t,n<m.length-1&&(e+=", ")}),$.push({title:"Attributes",value:e})}if(t===y.RenameAttributes){let e="";const t=Object.entries(g||{});t.forEach(([n,i],o)=>{e+=`${n}: ${i}`,o<t.length-1&&(e+=", ")}),$.push({title:"Attributes",value:e})}if(t===y.PiiMasking){let e="";S?.forEach((t,n)=>{e+=t,n<S.length-1&&(e+=", ")}),$.push({title:"Categories",value:e})}return t===y.ErrorSampler&&$.push({title:"Sampling Ratio",value:String(x)}),t===y.ProbabilisticSampler&&$.push({title:"Sampling Percentage",value:String(C)}),t===y.LatencySampler&&w?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i},o)=>{let a="";a+=`Service Name: ${e}\n`,a+=`HTTP Route: ${t}\n`,a+=`Min. Latency: ${n}\n`,a+=`Fallback Sampling Ratio: ${i}`,$.push({title:"Endpoint"+(w.length>1?` #${o+1}`:""),value:a})}),t===y.ServiceNameSampler&&k?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n},i)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Sampling Ratio: ${t}\n`,o+=`Fallback Sampling Ratio: ${n}`,$.push({title:"Filter"+(k.length>1?` #${i+1}`:""),value:o})}),t===y.SpanAttributeSampler&&T?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i},o)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`Fallback Sampling Ratio: ${n}\n`;const r=Object.keys(i)[0];a+=`Condition: ${r}\n`,a+=`Operation: ${i[r]?.operation}\n`,a+=`Expected Value: ${i[r]?.expectedValue}`,"jsonCondition"===r&&(a+=`\nJSON Path: ${i[r].jsonPath}`),$.push({title:"Filter"+(T.length>1?` #${o+1}`:""),value:a})}),t===y.URLTemplatization&&E?.forEach((e,t)=>{let n="";e.filterK8sNamespace&&(n+=`Namespace: ${e.filterK8sNamespace}\n`),e.workloadFilters?.length&&e.workloadFilters.forEach(e=>{const t=[e.kind,e.name].filter(Boolean).join("/");t&&(n+=`Workload: ${t}\n`)});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");n+=`Templates: ${i}`,e.notes&&(n+=`\nNotes: ${e.notes}`),$.push({title:"Group"+(E.length>1?` #${t+1}`:""),value:n})}),$},Vi=S.PiiCategories,Bi=h.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
gap: 32px;
|
|
@@ -7,45 +7,45 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
7
7
|
border-radius: 32px;
|
|
8
8
|
padding: 8px;
|
|
9
9
|
`}
|
|
10
|
-
`,_i=[{id:"CREDIT_CARD",label:"Credit Card"}],Ki=S.FallbackSamplingRatio,zi=[{value:b.Pod,id:b.Pod},{value:b.Namespace,id:b.Namespace},{value:b.Node,id:b.Node}],ji=[{title:"Label Key",keyName:"labelKey",placeholder:"app.kubernetes.io/name",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"app.kubernetes.name",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:zi,required:!0,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],Bi=[{title:"Annotation Key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:zi,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],Vi=S.EndpointsFilters,Wi=[{title:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered.",required:!0},{title:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product.",required:!0},{title:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",required:!0,type:E.Number},{title:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",required:!0,type:E.Number}],Ui=S.AttributeNamesToDelete,Hi=S.Renames,qi=S.UrlTemplatizationRulesGroups,Gi=[{keyName:"kind",title:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",value:"Deployment"},{id:"StatefulSet",value:"StatefulSet"},{id:"DaemonSet",value:"DaemonSet"}]},{keyName:"name",title:"Name",placeholder:"Any name"}],Yi=S.ServicesNameFilters,Ji=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:E.Number},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:E.Number}],Xi=S.SamplingPercentage,Qi=S.AttributeFilters,Zi=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans).",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span.",required:!0},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:E.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:F.Dropdown,options:[{id:"stringCondition",value:"String Condition"},{id:"numberCondition",value:"Number Condition"},{id:"booleanCondition",value:"Boolean Condition"},{id:"jsonCondition",value:"JSON Condition"}]},{title:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",required:!0,componentType:F.Dropdown,options:[{id:"exists",value:"Exists"},{id:"equals",value:"Equals"},{id:"not_equals",value:"Not Equals"},{id:"contains",value:"Contains"},{id:"not_contains",value:"Not Contains"},{id:"regex",value:"Regex"},{id:"greater_than",value:"Greater Than"},{id:"less_than",value:"Less Than"},{id:"greater_than_or_equal",value:"Greater Than Or Equal"},{id:"less_than_or_equal",value:"Less Than Or Equal"},{id:"is_valid_json",value:"Is Valid JSON"},{id:"is_invalid_json",value:"Is Invalid JSON"},{id:"jsonpath_exists",value:"JSON Path Exists"},{id:"key_equals",value:"Key Equals"},{id:"key_not_equals",value:"Key Not Equals"}]},{title:"Expected Value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against.",required:!0},{title:"JSON Path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",required:!1,renderCondition:e=>"jsonCondition"===e.condition}],eo={[v.K8sAttributes]:({value:i,setValue:a,formErrors:r})=>(o(()=>{i[S.CollectContainerAttributes]||i[S.CollectReplicaSetAttributes]||i[S.CollectWorkloadId]||i[S.CollectClusterId]||i[S.LabelsAttributes]?.length||i[S.AnnotationsAttributes]?.length||(a(S.CollectContainerAttributes,!0),a(S.CollectReplicaSetAttributes,!0),a(S.CollectWorkloadId,!0),a(S.CollectClusterId,!0),a(S.LabelsAttributes,[]),a(S.AnnotationsAttributes,[]))},[]),e(n,{children:[t(C,{title:"Collect Container Attributes",value:i[S.CollectContainerAttributes]||!1,onChange:e=>a(S.CollectContainerAttributes,e),errorMessage:r[S.CollectContainerAttributes]}),t(C,{title:"Collect ReplicaSet Attributes",value:i[S.CollectReplicaSetAttributes]||!1,onChange:e=>a(S.CollectReplicaSetAttributes,e),errorMessage:r[S.CollectReplicaSetAttributes]}),t(C,{title:"Collect Workload ID",value:i[S.CollectWorkloadId]||!1,onChange:e=>a(S.CollectWorkloadId,e),errorMessage:r[S.CollectWorkloadId]}),t(C,{title:"Collect Cluster ID",value:i[S.CollectClusterId]||!1,onChange:e=>a(S.CollectClusterId,e),errorMessage:r[S.CollectClusterId]}),t($,{columns:ji,value:i[S.LabelsAttributes]||[],onChange:e=>a(S.LabelsAttributes,e),errorMessage:r[S.LabelsAttributes]}),t($,{columns:Bi,value:i[S.AnnotationsAttributes]||[],onChange:e=>a(S.AnnotationsAttributes,e),errorMessage:r[S.AnnotationsAttributes]})]})),[v.AddClusterInfo]:({value:i,setValue:o,formErrors:a})=>e(n,{children:[t(N,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:i[S.OverwriteExistingValues]||!1,onChange:e=>o(S.OverwriteExistingValues,e)}),t(D,{title:"Resource Attributes",value:i[S.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>o(S.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:a[S.ClusterAttributes]})]}),[v.DeleteAttributes]:({value:e,setValue:n,formErrors:i})=>{const o=i[Ui],a=e[Ui]||[];return t(A,{title:"Attributes to delete",value:a,onChange:e=>n(Ui,e),required:!0,errorMessage:o})},[v.RenameAttributes]:({value:e,setValue:n,formErrors:i})=>{const o=i[Hi],a=Object.entries(e[Hi]||{}).map(([e,t])=>({key:e,value:t}));return t(D,{title:"Attributes to rename",value:a,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),n(Hi,t)},required:!0,errorMessage:o})},[v.PiiMasking]:({value:n,setValue:a,formErrors:r})=>{const l=r[Fi],s=n[Fi]||[],[c,d]=i(1===s.length);return o(()=>{if(!s.length){const e=_i.map(({id:e})=>e);a(Fi,e),d(1===_i.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(Pi,{$hasError:!!l,children:_i.map(({id:e,label:n})=>t(C,{title:n,disabled:c&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const n=t?[...s,e]:s.filter(t=>t!==e);a(Fi,n),d(1===n.length)})(e,t)},e))}),!!l&&t(w,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:n,formErrors:i})=>{const o=i[Ki],a=e[Ki];return t(k,{title:"Fallback sampling ratio",required:!0,type:E.Number,min:0,max:100,value:T(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,n(Ki,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[v.ProbabilisticSampler]:({value:e,setValue:n,formErrors:i})=>{const o=i[Xi],a=e[Xi];return t(k,{title:"Sampling percentage",required:!0,type:E.Number,min:0,max:100,value:T(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,n(Xi,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[v.LatencySampler]:({value:e,setValue:n,formErrors:i})=>{const o=i[Vi],a=e[Vi]||[];return t($,{columns:Wi,value:a,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(n),fallbackSamplingRatio:Number(i)}));n(Vi,t)},errorMessage:o})},[v.ServiceNameSampler]:({value:e,setValue:n,formErrors:i})=>{const o=i[Yi],a=e[Yi]||[];return t($,{columns:Ji,value:a,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(n)}));n(Yi,t)},errorMessage:o})},[v.SpanAttributeSampler]:({value:e,setValue:n,formErrors:i})=>{const o=i[Qi],a=(e[Qi]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i})=>{const o=Object.entries(i).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:o,operation:i[o]?.operation,expectedValue:i[o]?.expectedValue,jsonPath:i[o]?.jsonPath}});return t($,{columns:Zi,value:a,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i,operation:o,expectedValue:a,jsonPath:r})=>{const l={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(n),condition:{[i]:{operation:o,expectedValue:a}}};return r&&(l.condition[i].jsonPath=r),l});n(Qi,t)},errorMessage:o,limitFieldsPerRow:3})},[v.URLTemplatization]:({value:i,setValue:o,formErrors:r})=>{const l=r[qi],s=i[qi]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o(qi,e),d=(e,t)=>c(s.map((n,i)=>i===e?{...n,...t}:n));return e(n,{children:[s.map((n,i)=>e(a,{children:[t(I,{}),e(R,{$gap:12,children:[e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(x,{title:`Rule Group ${i+1}`}),s.length>1&&t(M,{size:30,onClick:()=>{return e=i,c(s.filter((t,n)=>n!==e));var e},children:t(Qn,{})})]}),t(k,{title:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(i,{filterK8sNamespace:e.target.value})}),t($,{title:"Workload Filters",columns:Gi,value:n.workloadFilters||[],onChange:e=>d(i,{workloadFilters:e})}),t(A,{title:"Templates",required:!0,value:n.templatizationRules.map(e=>e.template),onChange:e=>d(i,{templatizationRules:e.map(e=>({template:e}))})})]}),!!l&&t(w,{children:l})]},`url-templatization-group-${i}`)),t(L,{label:"Add Rule Group",onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(I,{})]})}},to=({actionType:e,value:n,setValue:i,formErrors:o})=>{if(!e)return null;const a=eo[e];return a?t(a,{value:n,setValue:i,formErrors:o}):null},no=h.div`
|
|
10
|
+
`,Wi=[{id:"CREDIT_CARD",label:"Credit Card"}],Ui=S.FallbackSamplingRatio,Hi=[{value:b.Pod,id:b.Pod},{value:b.Namespace,id:b.Namespace},{value:b.Node,id:b.Node}],qi=[{title:"Label Key",keyName:"labelKey",placeholder:"app.kubernetes.io/name",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"app.kubernetes.name",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:Hi,required:!0,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],Gi=[{title:"Annotation Key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:Hi,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],Yi=S.EndpointsFilters,Ji=[{title:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered.",required:!0},{title:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product.",required:!0},{title:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",required:!0,type:T.Number},{title:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",required:!0,type:T.Number}],Xi=S.AttributeNamesToDelete,Qi=S.Renames,Zi=S.UrlTemplatizationRulesGroups,eo=[{keyName:"kind",title:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",value:"Deployment"},{id:"StatefulSet",value:"StatefulSet"},{id:"DaemonSet",value:"DaemonSet"}]},{keyName:"name",title:"Name",placeholder:"Any name"}],to=S.ServicesNameFilters,no=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:T.Number},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:T.Number}],io=S.SamplingPercentage,oo=S.AttributeFilters,ao=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans).",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span.",required:!0},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:T.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:L.Dropdown,options:[{id:"stringCondition",value:"String Condition"},{id:"numberCondition",value:"Number Condition"},{id:"booleanCondition",value:"Boolean Condition"},{id:"jsonCondition",value:"JSON Condition"}]},{title:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",required:!0,componentType:L.Dropdown,options:[{id:"exists",value:"Exists"},{id:"equals",value:"Equals"},{id:"not_equals",value:"Not Equals"},{id:"contains",value:"Contains"},{id:"not_contains",value:"Not Contains"},{id:"regex",value:"Regex"},{id:"greater_than",value:"Greater Than"},{id:"less_than",value:"Less Than"},{id:"greater_than_or_equal",value:"Greater Than Or Equal"},{id:"less_than_or_equal",value:"Less Than Or Equal"},{id:"is_valid_json",value:"Is Valid JSON"},{id:"is_invalid_json",value:"Is Invalid JSON"},{id:"jsonpath_exists",value:"JSON Path Exists"},{id:"key_equals",value:"Key Equals"},{id:"key_not_equals",value:"Key Not Equals"}]},{title:"Expected Value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against.",required:!0},{title:"JSON Path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",required:!1,renderCondition:e=>"jsonCondition"===e.condition}],ro={[y.K8sAttributes]:({value:i,setValue:a,formErrors:r})=>(o(()=>{i[S.CollectContainerAttributes]||i[S.CollectReplicaSetAttributes]||i[S.CollectWorkloadId]||i[S.CollectClusterId]||i[S.LabelsAttributes]?.length||i[S.AnnotationsAttributes]?.length||(a(S.CollectContainerAttributes,!0),a(S.CollectReplicaSetAttributes,!0),a(S.CollectWorkloadId,!0),a(S.CollectClusterId,!0),a(S.LabelsAttributes,[]),a(S.AnnotationsAttributes,[]))},[]),e(n,{children:[t(C,{title:"Collect Container Attributes",value:i[S.CollectContainerAttributes]||!1,onChange:e=>a(S.CollectContainerAttributes,e),errorMessage:r[S.CollectContainerAttributes]}),t(C,{title:"Collect ReplicaSet Attributes",value:i[S.CollectReplicaSetAttributes]||!1,onChange:e=>a(S.CollectReplicaSetAttributes,e),errorMessage:r[S.CollectReplicaSetAttributes]}),t(C,{title:"Collect Workload ID",value:i[S.CollectWorkloadId]||!1,onChange:e=>a(S.CollectWorkloadId,e),errorMessage:r[S.CollectWorkloadId]}),t(C,{title:"Collect Cluster ID",value:i[S.CollectClusterId]||!1,onChange:e=>a(S.CollectClusterId,e),errorMessage:r[S.CollectClusterId]}),t($,{columns:qi,value:i[S.LabelsAttributes]||[],onChange:e=>a(S.LabelsAttributes,e),errorMessage:r[S.LabelsAttributes]}),t($,{columns:Gi,value:i[S.AnnotationsAttributes]||[],onChange:e=>a(S.AnnotationsAttributes,e),errorMessage:r[S.AnnotationsAttributes]})]})),[y.AddClusterInfo]:({value:i,setValue:o,formErrors:a})=>e(n,{children:[t(N,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:i[S.OverwriteExistingValues]||!1,onChange:e=>o(S.OverwriteExistingValues,e)}),t(D,{title:"Resource Attributes",value:i[S.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>o(S.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:a[S.ClusterAttributes]})]}),[y.DeleteAttributes]:({value:e,setValue:n,formErrors:i})=>{const o=i[Xi],a=e[Xi]||[];return t(A,{title:"Attributes to delete",value:a,onChange:e=>n(Xi,e),required:!0,errorMessage:o})},[y.RenameAttributes]:({value:e,setValue:n,formErrors:i})=>{const o=i[Qi],a=Object.entries(e[Qi]||{}).map(([e,t])=>({key:e,value:t}));return t(D,{title:"Attributes to rename",value:a,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),n(Qi,t)},required:!0,errorMessage:o})},[y.PiiMasking]:({value:n,setValue:a,formErrors:r})=>{const l=r[Vi],s=n[Vi]||[],[c,d]=i(1===s.length);return o(()=>{if(!s.length){const e=Wi.map(({id:e})=>e);a(Vi,e),d(1===Wi.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(Bi,{$hasError:!!l,children:Wi.map(({id:e,label:n})=>t(C,{title:n,disabled:c&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const n=t?[...s,e]:s.filter(t=>t!==e);a(Vi,n),d(1===n.length)})(e,t)},e))}),!!l&&t(w,{children:l})]})},[y.ErrorSampler]:({value:e,setValue:n,formErrors:i})=>{const o=i[Ui],a=e[Ui];return t(k,{title:"Fallback sampling ratio",required:!0,type:T.Number,min:0,max:100,value:E(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,n(Ui,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[y.ProbabilisticSampler]:({value:e,setValue:n,formErrors:i})=>{const o=i[io],a=e[io];return t(k,{title:"Sampling percentage",required:!0,type:T.Number,min:0,max:100,value:E(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,n(io,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[y.LatencySampler]:({value:e,setValue:n,formErrors:i})=>{const o=i[Yi],a=e[Yi]||[];return t($,{columns:Ji,value:a,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(n),fallbackSamplingRatio:Number(i)}));n(Yi,t)},errorMessage:o})},[y.ServiceNameSampler]:({value:e,setValue:n,formErrors:i})=>{const o=i[to],a=e[to]||[];return t($,{columns:no,value:a,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(n)}));n(to,t)},errorMessage:o})},[y.SpanAttributeSampler]:({value:e,setValue:n,formErrors:i})=>{const o=i[oo],a=(e[oo]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i})=>{const o=Object.entries(i).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:o,operation:i[o]?.operation,expectedValue:i[o]?.expectedValue,jsonPath:i[o]?.jsonPath}});return t($,{columns:ao,value:a,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i,operation:o,expectedValue:a,jsonPath:r})=>{const l={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(n),condition:{[i]:{operation:o,expectedValue:a}}};return r&&(l.condition[i].jsonPath=r),l});n(oo,t)},errorMessage:o,limitFieldsPerRow:3})},[y.URLTemplatization]:({value:i,setValue:o,formErrors:r})=>{const l=r[Zi],s=i[Zi]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o(Zi,e),d=(e,t)=>c(s.map((n,i)=>i===e?{...n,...t}:n));return e(n,{children:[s.map((n,i)=>e(a,{children:[t(I,{}),e(R,{$gap:12,children:[e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(x,{title:`Rule Group ${i+1}`}),s.length>1&&t(M,{size:30,onClick:()=>{return e=i,c(s.filter((t,n)=>n!==e));var e},children:t(ti,{})})]}),t(k,{title:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(i,{filterK8sNamespace:e.target.value})}),t($,{title:"Workload Filters",columns:eo,value:n.workloadFilters||[],onChange:e=>d(i,{workloadFilters:e})}),t(A,{title:"Templates",required:!0,value:n.templatizationRules.map(e=>e.template),onChange:e=>d(i,{templatizationRules:e.map(e=>({template:e}))})})]}),!!l&&t(w,{children:l})]},`url-templatization-group-${i}`)),t(F,{label:"Add Rule Group",onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(I,{})]})}},lo=({actionType:e,value:n,setValue:i,formErrors:o})=>{if(!e)return null;const a=ro[e];return a?t(a,{value:n,setValue:i,formErrors:o}):null},so=h.div`
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
gap: 24px;
|
|
14
14
|
padding: 4px;
|
|
15
|
-
`,
|
|
15
|
+
`,co=h(B)`
|
|
16
16
|
margin-bottom: 12px;
|
|
17
|
-
`,
|
|
17
|
+
`,uo=({isUpdate:n,action:i,formData:o,formErrors:a,handleFormChange:r})=>{const l=g();return e(so,{children:[n&&e("div",{children:[t(co,{children:"Status"}),t(P,{options:[{icon:ni,label:f.ENABLED,value:!1,selectedBgColor:l.text.success+_["050"]},{icon:ii,label:f.DISABLED,value:!0,selectedBgColor:l.text.error+_["050"]}],selected:o.disabled,setSelected:e=>r("disabled",e)})]}),!n&&t(z,{title:"",description:i.docsDescription,actionButton:t(K,{endpoint:i.docsEndpoint})}),t(j,{title:"Signals for Processing",required:!0,allowedSignals:i.allowedSignals,selectedSignals:o.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:a.signals}),!n&&t(k,{title:"Action name",placeholder:"Use a name that describes the action",value:o.name||"",onChange:({target:{value:e}})=>r("name",e),errorMessage:a.name}),t(lo,{actionType:i.type,value:o.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:a}),t(V,{title:"Notes",value:o.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:a.notes})]})},po=r(({children:o,width:a=640,title:r,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:p,isEdit:h=!1,isFormDirty:m=!1,isLastItem:f=!1,onClose:v,onEdit:y,onSave:b,onDelete:S,onCancel:x,tabs:C,headerActionButtons:w},k)=>{const T=g(),{drawerType:E,setDrawerType:$,setDrawerEntityId:N}=W();U({key:"Enter",active:h},()=>K());const[D,A]=i(!1),[I,R]=i(!1),O=l(null),M=E===J.Source,F=()=>{A(!1),R(!1)},L=()=>{F(),y&&y(!1),$(null),N(null),v?.()};s(k,()=>({closeDrawer:L}));const P=()=>{O.current?.clearTitle(),x&&x(),F()},_=()=>{const e=O.current?.isTitleDirty();m||e?R(!0):P()},z=()=>{A(!0)},K=()=>{b&&b(O.current?.getTitle()||"")},j=w||[];return y&&!h&&j.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>y(!0),children:e(n,{children:[t(oi,{}),t(B,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),S&&!h&&j.push({"data-id":"drawer-delete",variant:"tertiary",onClick:z,children:e(n,{children:[t(ti,{}),t(B,{color:T.text.error,size:14,family:"secondary",decoration:"underline",children:M?H.UNINSTRUMENT:H.DELETE})]})}),e(n,{children:[t(q,{isOpen:!0,onClose:h?_:L,closeOnEscape:!D&&!I,width:"number"==typeof a?`${a+64}px`:a,header:{icons:u,iconSrcs:p,title:r,titleTooltip:c,replaceTitleWith:!d&&h?t(ho,{ref:O,title:r}):void 0,actionButtons:j,tabs:C},footer:{isOpen:h,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:K,children:H.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:_,children:H.CANCEL}],rightButtons:S?[{"data-id":"drawer-delete",variant:"tertiary",onClick:z,children:e(n,{children:[t(ti,{}),t(B,{size:14,color:T.text.error,family:"secondary",decoration:"underline",children:H.DELETE})]})}]:[]},children:o}),t(G,{isOpen:D,noOverlay:!0,name:`${E}${r?` (${r})`:""}`,type:E,isLastItem:f,onApprove:()=>{S&&S(),F()},onDeny:F}),t(Y,{isOpen:I,noOverlay:!0,name:"edit mode",onApprove:P,onDeny:F})]})}),ho=r(({title:e},n)=>{const[a,r]=i(e);return o(()=>{r(e)},[e]),s(n,()=>({getTitle:()=>a||e,isTitleDirty:()=>a!==e,clearTitle:()=>r(e)})),t(k,{"data-id":"title",value:a,onChange:e=>r(e.target.value)})});ho.displayName=ho.name,po.displayName=po.name;const mo=h.div`
|
|
18
18
|
width: 100%;
|
|
19
19
|
height: 100%;
|
|
20
20
|
max-height: calc(100vh - 220px);
|
|
21
21
|
overflow: overlay;
|
|
22
22
|
overflow-y: auto;
|
|
23
|
-
`,
|
|
23
|
+
`,go=h.div`
|
|
24
24
|
display: flex;
|
|
25
25
|
flex-direction: column;
|
|
26
26
|
gap: 12px;
|
|
27
|
-
`,
|
|
27
|
+
`,fo=({updateAction:n,deleteAction:a})=>{const{actions:r}=X(),{drawerType:s,drawerEntityId:d}=W(),u=l(null),p=s===J.Action,[h,m]=i(!1),[g,v]=i(!1),{formData:y,formErrors:b,handleFormChange:S,resetFormData:x,validateForm:C,loadFormWithDrawerItem:w}=Q(),k=c(()=>{if(d)return r?.find(e=>Z(e)===d)},[d,r]);if(o(()=>{p&&k?w(k):x()},[p,k]),!k)return null;const T=ee.find(({type:e})=>e===k.type)||ee.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===k.type)||ee.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===k.type);return t(po,{ref:u,title:k.name||k.type,icons:[ie(k.type)],isEdit:h,isFormDirty:g,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if(C({withAlert:!0,alertTitle:oe.Update})){const t=e!==k.type?e:"";S("name",t),n(d,{...y,name:t}),m(!1),v(!1)}},onDelete:()=>{a(d,k.type),m(!1),v(!1),u.current?.closeDrawer()},onCancel:()=>{m(!1),v(!1),w(k)},children:h&&T?t(mo,{children:t(uo,{isUpdate:!0,action:T,formData:y,formErrors:b,handleFormChange:(...e)=>{v(!0),S(...e)}})}):e(go,{children:[t(te,{conditions:k.conditions||[]}),t(ne,{title:f.ACTION_DETAILS,data:k?ji(k):[]})]})})},vo=h(R)`
|
|
28
28
|
margin-top: 24px;
|
|
29
29
|
gap: 12px;
|
|
30
|
-
`,
|
|
30
|
+
`,yo=({createAction:n})=>{const{version:o}=ae(),{currentModal:a,setCurrentModal:r}=re(),l=a===J.Action,{formData:s,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=Q(),m=c(()=>{if(!o)return ee;const e=le(o);return ee.map(t=>({...t,items:t.items?.filter(t=>!t.minVersion||t.minVersion<=e)}))},[o]),[g,v]=i(void 0),y=()=>{p(),v(void 0),r("")},b=()=>{if(!h({withAlert:!0,alertTitle:oe.Create}))return null;n(s),y()};return U({key:"Enter",active:l},()=>b()),t(se,{isOpen:l,onClose:y,header:{title:"Add Action"},actionComponent:t(me,{buttons:[{variant:"primary",label:"DONE",onClick:b,disabled:!g}]}),children:e(ce,{children:[t(z,{title:"Select Action",description:"Select an action to modify telemetry data before it`s sent to destinations. Choose an action type and configure its details."}),e(vo,{children:[t(de,{type:ue.Warning,message:pe.DEFINED_FOR_ALL_STREAMS(f.ACTIONS)}),t(he,{options:m,selectedOption:g,onOptionSelect:e=>{return t=e,p(),u("type",t?.type||""),void v(t);var t},autoFocus:!g?.type})]}),g?.type?e("div",{children:[t(I,{margin:"16px 0"}),t(uo,{action:g,formData:s,formErrors:d,handleFormChange:u})]}):null]})})},bo=e=>{const{type:t,fields:{collectContainerAttributes:n,collectReplicaSetAttributes:i,collectWorkloadId:o,collectClusterId:a,labelsAttributes:r,annotationsAttributes:l,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:h,samplingPercentage:m,endpointsFilters:g,attributeFilters:f,servicesNameFilters:v,urlTemplatizationRulesGroups:S}}=e;let x="";if(t===y.K8sAttributes&&(n&&(x+="Container Attributes, "),i&&(x+="ReplicaSet Attributes, "),o&&(x+="Workload ID, "),a&&(x+="Cluster ID, "),r?.forEach(({labelKey:e,attributeKey:t,from:n,fromSources:i},o)=>{const a=i?.length?i.join(","):n||b.Pod;x+=`Label: ${e} ${t} ${a} `,o===r.length-1&&(x+=", ")}),l?.forEach(({annotationKey:e,attributeKey:t,from:n,fromSources:i},o)=>{const a=i?.length?i.join(","):n||b.Pod;x+=`Annotation: ${e} ${t} ${a} `,o===l.length-1&&(x+=", ")})),t===y.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},n)=>{x+=`${e}: ${t}`,n<s.length-1&&(x+=", ")})),t===y.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===y.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,n],i)=>{x+=`${t}: ${n}`,i<e.length-1&&(x+=", ")})}return t===y.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===y.ErrorSampler&&(x+=String(h)),t===y.ProbabilisticSampler&&(x+=String(m),x+="%"),t===y.LatencySampler&&g?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i},o)=>{x+=`Endpoint${g.length>1?` #${o+1}`:""}=${e}${t}\n`,x+=` Latency=${n}`,x+=` Sampling=${i}`,o<g.length-1&&(x+=", ")}),t===y.ServiceNameSampler&&v?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${n}\n`}),t===y.SpanAttributeSampler&&f?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${n}\n`}),t===y.URLTemplatization&&S?.forEach((e,t)=>{const n=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");x+=`Group ${t+1}: ${n}`,t<S.length-1&&(x+="; ")}),x},So=({conditions:e,id:n})=>{const{errors:i,warnings:o,disableds:a,hasLoadings:r}=c(()=>ge(e),[e]),l=i.length>0?i:o.length>0?o:a.length>0?a:[];if(l.length>0)return t("div",{style:{lineHeight:1},children:t(xo,{conditions:l,id:n})});const s=r?ve.Loading:ue.Success;return t("div",{style:{lineHeight:1},children:t(fe,{status:s,title:s,withBorder:!0,withIcon:!0})})},xo=({conditions:e,id:n})=>{const i=g();return t(O,{children:ye(e).map(({status:e,type:o,reason:a,message:r},l)=>{"loading"!==e&&"disabled"!==e||(e=ue.Info);const s=Se(e,i);return t(be,{titleIcon:s,title:o,text:r||a||"",children:t(fe,{status:e,title:a||o,withBorder:!0,withIcon:!0})},`condition-${n}-${e}-${o}-${l}`)})})},Co=({instrumentationRules:e,sources:t,actions:n,destinations:i,searchText:o,selectedCategory:a})=>{const r=o?e.filter(e=>e.type?.toLowerCase().includes(o)||e.ruleName?.toLowerCase().includes(o)):e,l=o?t.filter(e=>e.name?.toLowerCase().includes(o)||e.otelServiceName?.toLowerCase().includes(o)||e.namespace?.toLowerCase().includes(o)):t,s=o?n.filter(e=>e.type?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):n,c=o?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):i,d=[{category:J.Source,label:"Sources",count:l.length,entities:[]},{category:J.Action,label:"Actions",count:s.length,entities:[]},{category:J.Destination,label:"Destinations",count:c.length,entities:[]},{category:J.InstrumentationRule,label:"Instrumentation Rules",count:r.length,entities:[]}];d.unshift({category:"all",label:"All",count:r.length+l.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===J.InstrumentationRule?r:e.category===J.Source?l:e.category===J.Action?s:e.category===J.Destination?c:[]}));return{categories:d,searchResults:u}},wo=[{key:"icon",title:""},{key:"name",title:f.NAME,sortable:!0},{key:"signals",title:f.MONITORS},{key:"active-status",title:f.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:f.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:f.NOTES,sortable:!0}],ko=({maxHeight:n,maxWidth:i})=>{const o=g(),a=xe(),{actions:r,actionsLoading:l}=X(),{setDrawerType:s,setDrawerEntityId:d}=W(),u=c(()=>Co({instrumentationRules:[],sources:[],actions:Ce(r,a),destinations:[],searchText:a.searchText,selectedCategory:J.Action}).searchResults.find(({category:e})=>e===J.Action)?.entities||[],[r,a]),p=c(()=>u.map(e=>{const{hasErrors:n,hasWarnings:i,hasDisableds:a}=ge(e.conditions||[]);return{status:n?ue.Error:i?ue.Warning:void 0,faded:a,onClick:()=>{s(J.Action),d(e.id)},cells:[{columnKey:"icon",component:()=>t(we,{icon:ie(e.type)})},{columnKey:"name",value:ke(e,J.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:o.text.info},{columnKey:"notes",value:e.notes,textColor:o.text.info,withTooltip:!0},{columnKey:"spec",value:bo(e),textColor:o.text.info,withTooltip:!0},{columnKey:"signals",component:()=>t(Te,{withLabels:!0,monitors:e.signals||[]})},{columnKey:"conditions",component:()=>t(So,{conditions:e.conditions||[],id:e.id})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(fe,{status:e.disabled?ue.Error:ue.Success,title:e.disabled?f.DISABLED:f.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:m}=c(()=>u.length!==r.length?{badge:`${u.length}/${r.length}`,badgeTooltip:f.FILTERED_COUNT_TOOLTIP}:{badge:r.length,badgeTooltip:void 0},[u,r]);return e(Ee,{$maxWidth:i,children:[t($e,{children:t(Ne,{icon:De(J.Action),title:f.ACTIONS,badge:h,badgeTooltip:m,loading:l})}),t(Ae,{$maxHeight:n,children:t(Ie,{columns:wo,rows:p})}),!u.length&&t(Re,{style:{marginTop:"2rem"},children:t(Oe,{})})]})},To=h(R)`
|
|
31
31
|
// width: 100vw;
|
|
32
32
|
// height: 100vh;
|
|
33
33
|
gap: 64px;
|
|
34
34
|
align-items: center;
|
|
35
35
|
justify-content: center;
|
|
36
|
-
`,
|
|
36
|
+
`,Eo=h(R)`
|
|
37
37
|
max-width: 400px;
|
|
38
38
|
gap: 12px;
|
|
39
39
|
align-items: center;
|
|
40
40
|
justify-content: center;
|
|
41
|
-
|
|
41
|
+
`,$o=h(B)`
|
|
42
42
|
text-align: center;
|
|
43
43
|
font-size: 24px;
|
|
44
|
-
`,
|
|
44
|
+
`,No=h(B)`
|
|
45
45
|
text-align: center;
|
|
46
46
|
line-height: 26px;
|
|
47
47
|
color: ${({theme:e})=>e.text.info};
|
|
48
|
-
`,
|
|
48
|
+
`,Do=()=>{const[n,a]=i(0);return o(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Le(500),a(e)})()},[]),e(To,{children:[t(ai,{size:100}),t(Me,{width:400}),e(Eo,{children:[e(O,{$gap:16,children:[t($o,{children:"Preparing your workspace..."}),t(Fe,{label:`${n}%`})]}),t(No,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},Ao=h(R)`
|
|
49
49
|
align-items: center !important;
|
|
50
50
|
justify-content: center !important;
|
|
51
51
|
align-self: stretch;
|
|
@@ -63,7 +63,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
63
63
|
&:hover {
|
|
64
64
|
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+_["030"]};
|
|
65
65
|
}
|
|
66
|
-
`,
|
|
66
|
+
`,Io=({entityType:n,description:i})=>{const{setCurrentModal:o}=re();return e(Ao,{onClick:()=>o(n),children:[e(O,{$gap:4,children:[t(ri,{}),e(B,{size:14,weight:600,family:"secondary",decoration:"underline",children:["Add ",n]})]}),t(B,{size:12,align:"center",children:i})]})},Ro=h.div`
|
|
67
67
|
position: relative;
|
|
68
68
|
width: 100%;
|
|
69
69
|
padding: 12px 0;
|
|
@@ -71,13 +71,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
71
71
|
display: flex;
|
|
72
72
|
align-items: center;
|
|
73
73
|
border-bottom: 1px solid ${({theme:e})=>e.colors.border};
|
|
74
|
-
|
|
74
|
+
`,Oo=h(O)`
|
|
75
75
|
margin-left: ${({$marginLeft:e})=>e};
|
|
76
|
-
`,
|
|
76
|
+
`,Mo=h(_e)`
|
|
77
77
|
width: 24px;
|
|
78
78
|
height: 24px;
|
|
79
79
|
padding: 0;
|
|
80
|
-
`,
|
|
80
|
+
`,Fo=h.div`
|
|
81
81
|
position: absolute;
|
|
82
82
|
bottom: -2px;
|
|
83
83
|
left: 0;
|
|
@@ -86,7 +86,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
86
86
|
height: 4px;
|
|
87
87
|
width: ${({percent:e})=>`${e}%`};
|
|
88
88
|
transition: width 0.3s;
|
|
89
|
-
`,
|
|
89
|
+
`,Lo=({entityType:n,badge:i,badgeTooltip:o,isLoading:a,refetch:r,partiallySelected:l,allSelected:s,onSelectAll:c,progressPercent:d})=>{const u=g(),{setCurrentModal:p}=re(),h=De(n);return e(Ro,{children:[c&&t(Oo,{$marginLeft:"28px",children:t(C,{partiallyChecked:l,value:s,onChange:c})}),t(Oo,{$marginLeft:n===J.Source?"0":"28px",children:t(Ne,{icon:h,title:`${n}s`,badge:i,badgeTooltip:o,loading:!1})}),e(Oo,{$marginLeft:"auto",children:[t(Mo,{"data-id":`refresh-${n}`,variant:"secondary",onClick:r,disabled:a,children:a?t(Pe,{scale:.8}):t(li,{fill:u.colors.secondary,size:18})}),t(Mo,{"data-id":`add-${n}`,variant:"primary",onClick:()=>p(n),children:t(ri,{fill:u.colors.primary,size:18})})]}),"number"==typeof d&&t(Fo,{percent:d})]})},Po=h.div`
|
|
90
90
|
padding: 2px 6px;
|
|
91
91
|
background-color: ${({theme:e})=>e.colors.primary};
|
|
92
92
|
border-radius: 360px;
|
|
@@ -101,7 +101,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
101
101
|
align-items: center;
|
|
102
102
|
justify-content: center;
|
|
103
103
|
white-space: nowrap;
|
|
104
|
-
`,
|
|
104
|
+
`,_o=({entityId:n,entityType:i,status:o,faded:a,title:r,subTitle:l,tooltip:s,label:c,icon:d,icons:u,iconSrc:p,iconSrcs:h,monitors:m,isActive:f,raw:v})=>{const y=g(),b=i===J.Source,S="boolean"==typeof f,{setDrawerType:x,setDrawerEntityId:C}=W(),{selectedSources:w,setSelectedSources:k}=ze(),T={...w},{namespace:E,name:$,kind:N}=v;b&&!T[E]&&(T[E]=[]);const D=b?T[E].findIndex(e=>e.name===$&&e.kind===N):-1;return t(Ke,{"data-id":i===J.Source?`${n.namespace}-${n.name}-${n.kind}`:n,title:r,subTitle:l,onClick:()=>{x(i),C(n)},renderActions:()=>{const n=b&&(!v.conditions?.length||v.conditions?.some(({status:e})=>"loading"===e)),i=S&&!f?Se(ue.Info,y):o?Se(o,y):void 0,a=n?t(Pe,{scale:.8}):i?t(i,{size:14}):null;return c?e(Po,{$isError:o===ue.Error,children:[t(be,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:c}),a]}):a||null},iconProps:{icon:d,icons:u,iconSrc:p,iconSrcs:h},visualProps:{status:o,faded:a||S&&!f,monitors:m||void 0},checkboxProps:{withCheckbox:b,isChecked:-1!==D,onCheckboxChange:()=>{-1===D?T[E].push(v):T[E].splice(D,1),k(T)}}})};function zo(e){const t=e.conditions?.some(({status:e})=>e===ve.Loading);return t?e:{...e,conditions:[{status:ve.Loading,type:"Pending",message:""}]}}function Ko(e){const t=e.conditions?.filter(({status:e})=>e!==ve.Loading);return t?.length===e.conditions?.length?e:{...e,conditions:t?.length?t:[{status:ue.Success,type:"Healthy",message:""}]}}const jo=h.div`
|
|
105
105
|
position: absolute;
|
|
106
106
|
top: 12px;
|
|
107
107
|
left: 12px;
|
|
@@ -112,23 +112,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
112
112
|
border-bottom: 1px solid ${({theme:e})=>e.colors.border};
|
|
113
113
|
border-radius: 12px 12px 0 0;
|
|
114
114
|
pointer-events: none;
|
|
115
|
-
`,
|
|
115
|
+
`,Vo=h.span`
|
|
116
116
|
font-family: ${({theme:e})=>e.font_family.primary};
|
|
117
117
|
font-size: 11px;
|
|
118
118
|
font-weight: 600;
|
|
119
119
|
color: ${({theme:e})=>e.text.grey};
|
|
120
120
|
text-transform: uppercase;
|
|
121
121
|
letter-spacing: 0.5px;
|
|
122
|
-
`,
|
|
122
|
+
`,Bo=h.div`
|
|
123
123
|
display: flex;
|
|
124
124
|
align-items: center;
|
|
125
125
|
gap: 8px;
|
|
126
126
|
padding: 4px 8px 0;
|
|
127
|
-
`,
|
|
127
|
+
`,Wo=h.div`
|
|
128
128
|
flex: 1;
|
|
129
129
|
height: 1px;
|
|
130
130
|
background: ${({theme:e})=>e.colors.border};
|
|
131
|
-
`,
|
|
131
|
+
`,Uo=h.span`
|
|
132
132
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
133
133
|
font-size: 10px;
|
|
134
134
|
font-weight: 600;
|
|
@@ -136,7 +136,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
136
136
|
text-transform: uppercase;
|
|
137
137
|
letter-spacing: 0.5px;
|
|
138
138
|
white-space: nowrap;
|
|
139
|
-
`,
|
|
139
|
+
`,Ho=({namespace:e})=>t(jo,{children:t(Vo,{children:e})}),qo=({namespace:n})=>e(Bo,{children:[t(Wo,{}),t(Uo,{children:n}),t(Wo,{})]}),Go=h.div`
|
|
140
140
|
height: calc(${({$height:e})=>e}px - 24px);
|
|
141
141
|
width: calc(100% - 24px);
|
|
142
142
|
padding: 12px;
|
|
@@ -144,7 +144,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
144
144
|
border: 1px dashed ${({theme:e})=>e.colors.border};
|
|
145
145
|
border-radius: 24px;
|
|
146
146
|
position: relative;
|
|
147
|
-
`,
|
|
147
|
+
`,Yo=h.div`
|
|
148
148
|
position: absolute;
|
|
149
149
|
bottom: 0;
|
|
150
150
|
left: 0;
|
|
@@ -159,18 +159,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
159
159
|
justify-content: center;
|
|
160
160
|
|
|
161
161
|
pointer-events: none;
|
|
162
|
-
`,
|
|
162
|
+
`,Jo={[J.Source]:{subTitle:(e,t)=>t?e.kind:`${e.namespace} • ${e.kind}`,icons:e=>({icons:Ye(e),icon:De(J.Source)}),withMetrics:!0},[J.Destination]:{subTitle:e=>e.destinationType.displayName,icons:e=>Ge(e.destinationType.type),withMetrics:!0,withMonitors:!0,withActive:!0},[J.Action]:{subTitle:e=>e.type,icons:e=>({icon:ie(e.type)}),withMonitors:!0,withActive:!0},[J.InstrumentationRule]:{subTitle:e=>e.type,icons:e=>({icon:qe(e.type)}),withActive:!0},[J.Namespace]:{subTitle:()=>"",icons:()=>({icon:De(J.Namespace)})},[J.SamplingRule]:{subTitle:()=>"",icons:()=>({icon:De(J.SamplingRule)})}};function Xo(e,t,n,i){const o=Z(e);if(!o)return null;const a=Jo[t],r=t===J.Source,l=a.withMonitors?t===J.Destination?Ue(e.exportedSignals):e.signals:void 0,s=a.withMetrics?i?.get(Be(o)):void 0,c=a.withActive?!e.disabled:void 0;let d,u,p=!1,h=e;if(r){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case je.Failure:return{status:ue.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case je.Notice:return{status:ue.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case je.Pending:case je.Waiting:return{status:void 0,faded:!1,displaySource:zo(e)};case je.Unsupported:case je.Disabled:return{status:void 0,faded:!0,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Ko(e)}}}(e);d=t.status,p=t.faded,u=t.tooltip,h=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:n}=ge(e.conditions||[]);d=t,p=n}return{entityId:o,namespace:r?e.namespace:void 0,title:ke(e,t,{extended:r,prioritizeDisplayName:!r}),subTitle:a.subTitle(e,n),status:d,faded:p,tooltip:u,label:a.withMetrics?He(s):void 0,...a.icons(e),monitors:l,isActive:c,raw:h}}const Qo=({height:n,entityType:a,entities:r,metrics:l})=>{const{isVm:s}=ae(),u=a===J.Source,[p,h]=i(""),m=c(()=>{if(!l)return;const e=new Map,t=a===J.Source?l.sources:a===J.Destination?l.destinations:void 0;if(t)for(const n of t)e.set(Ve(n),n.throughput);return e},[l,a]),g=c(()=>r.map(e=>Xo(e,a,s,m)).filter(Boolean),[r,a,m,s]),{elements:f,indexToNamespace:v,multipleNs:y}=c(()=>{const e=[],n=[],i=new Set(g.map(e=>e.namespace).filter(Boolean)).size>1;i&&(n.push(""),e.push(t("div",{style:{height:28}},"ns-spacer")));let o="";for(const i of g)u&&i.namespace&&i.namespace!==o&&(""!==o&&(n.push(i.namespace),e.push(t(qo,{namespace:i.namespace},`ns-divider-${i.namespace}`))),o=i.namespace),n.push(i.namespace||""),e.push(t(_o,{entityType:a,entityId:i.entityId,raw:i.raw,title:i.title,subTitle:i.subTitle,faded:i.faded,status:i.status,tooltip:i.tooltip,label:i.label,icons:i.icons,icon:i.icon,iconSrc:i.iconSrc,monitors:i.monitors,isActive:i.isActive},Be(i.entityId)));return{elements:e,indexToNamespace:n,multipleNs:i}},[g,a,u]);o(()=>{if(u&&v.length&&!p){const e=v.find(Boolean);e&&h(e)}},[u,v]);const b=d(e=>{if(!v.length)return;const t=v[Math.min(e,v.length-1)];t&&t!==p&&h(t)},[v,p]);return e(Go,{$height:n,children:[y&&p&&t(Ho,{namespace:p}),t(We,{gap:8,elements:f,onTopIndexChange:y?b:void 0}),t(Yo,{$hide:!0})]})},Zo=h.div`
|
|
163
163
|
width: ${({$isVm:e})=>e?"45vw":"22vw"};
|
|
164
164
|
display: flex;
|
|
165
165
|
flex-direction: column;
|
|
166
166
|
gap: 12px;
|
|
167
|
-
`,
|
|
167
|
+
`,ea=({entityType:n,entities:i,unfilteredCount:o,metrics:a,loading:r,maxHeight:l,refetch:s})=>{const{isVm:d}=ae(),{frameHeight:u,hasFiltersApplied:p,isSources:h}=c(()=>({frameHeight:Math.min(l,80*i.length+12),hasFiltersApplied:i.length!==o,isSources:n===J.Source}),[n,i.length,l,o]),{progress:m}=Je(),g=c(()=>h&&(m[Xe.Instrumenting]||m[Xe.Uninstrumenting])?m[Xe.Instrumenting]?.percentage||m[Xe.Uninstrumenting]?.percentage||0:void 0,[h,m[Xe.Instrumenting],m[Xe.Uninstrumenting]]),{selectedSources:v,setSelectedSources:y}=ze(),b=c(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]);return d&&[J.InstrumentationRule,J.Action].includes(n)?null:e(Zo,{$isVm:d,children:[t(Lo,{entityType:n,badge:"number"==typeof g?`${g}%`:p?`${i.length}/${o}`:o,badgeTooltip:p?f.FILTERED_COUNT_TOOLTIP:void 0,isLoading:r,refetch:s,partiallySelected:b>0&&i?.length!==b,allSelected:b>0&&i?.length===b,onSelectAll:h?e=>{if(h)if(e){const e={};i?.forEach(t=>{const{namespace:n}=t;e[n]?e[n].push(t):e[n]=[t]}),y(e)}else y({})}:void 0,progressPercent:g}),i.length?t(Qo,{height:u,entityType:n,entities:i,metrics:a}):r?t(Qe,{size:3}):t(Io,{entityType:n,description:f.TO_COLLECT_OTEL_DATA})]})},ta=h.div`
|
|
168
168
|
width: 100%;
|
|
169
169
|
height: ${({$height:e})=>e};
|
|
170
170
|
display: flex;
|
|
171
171
|
justify-content: space-evenly;
|
|
172
172
|
gap: 24px;
|
|
173
|
-
`,
|
|
173
|
+
`,na=({height:n,metrics:a,refetchSources:r,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:d})=>{const u=xe(),{selectedStreamName:p}=Ze(),{containerRef:h,containerHeight:m}=et(),g=X(e=>e.sources),f=X(e=>e.sourcesLoading),v=X(e=>e.destinations),y=X(e=>e.destinationsLoading),b=X(e=>e.actions),S=X(e=>e.actionsLoading),x=X(e=>e.instrumentationRules),C=X(e=>e.instrumentationRulesLoading),w=c(()=>tt(g,p),[g,p]),k=c(()=>nt(v,p),[v,p]),[T,E]=i([]),[$,N]=i([]),[D,A]=i([]),[I,R]=i([]);return o(()=>{E(it(w,u))},[w,u]),o(()=>{N(ot(k,u))},[k,u]),o(()=>{A(Ce(b,u))},[b,u]),o(()=>{R(x)},[x]),e(ta,{ref:h,$height:n,children:[t(ea,{entityType:J.InstrumentationRule,entities:I,unfilteredCount:x.length,loading:C,maxHeight:m,refetch:d}),t(ea,{entityType:J.Source,entities:T,unfilteredCount:w.length,metrics:a,loading:f,maxHeight:m,refetch:r}),t(ea,{entityType:J.Action,entities:D,unfilteredCount:b.length,loading:S,maxHeight:m,refetch:s}),t(ea,{entityType:J.Destination,entities:$,unfilteredCount:k.length,metrics:a,loading:y,maxHeight:m,refetch:l})]})},ia=h.div`
|
|
174
174
|
position: relative;
|
|
175
175
|
max-width: 200px;
|
|
176
176
|
`;h.div`
|
|
@@ -184,60 +184,60 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
184
184
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
185
185
|
border: ${({theme:e})=>`1px solid ${e.colors.border}`};
|
|
186
186
|
border-radius: 24px;
|
|
187
|
-
`;const
|
|
187
|
+
`;const oa=h.div`
|
|
188
188
|
display: flex;
|
|
189
189
|
align-items: center;
|
|
190
190
|
overflow-x: scroll;
|
|
191
|
-
`,
|
|
191
|
+
`,aa=({onClose:n})=>{const r=g(),{onClickNode:l}=at(),{searchText:s}=xe(),{selectedStreamName:d}=Ze(),{popupRef:u,popupOpen:p,setPopupOpen:h,popupPosition:m,handlePosition:f}=rt(),v=X(e=>e.sources),y=X(e=>e.destinations),b=X(e=>e.actions),S=X(e=>e.instrumentationRules);o(()=>{p||(f(0,50),h(!0))},[p]);const[x,C]=i("all"),{categories:w,searchResults:k}=c(()=>Co({instrumentationRules:S,sources:tt(v,d),actions:b,destinations:nt(y,d),searchText:s,selectedCategory:x}),[S,v,b,y,d,s,x]);return k.length?t(lt,{ref:u,isOpen:p,top:m.top,left:m.left,maxWidth:"420px",header:t(oa,{children:w.map(({category:e,label:n,count:i})=>!!i&&t(ct,{label:n,badgeLabel:i,isSelected:x===e,onClick:()=>C(e)},`category-select-${e}`))}),children:k.map(({category:i,label:o,entities:s},c)=>!!s.length&&e(a,{children:[e(st,{style:{maxHeight:"all"!==x?"240px":"140px",padding:"12px 0"},children:[t(B,{size:12,family:"secondary",color:r.text.darker_grey,style:{marginLeft:"16px"},children:o}),s.map((e,o)=>t(ct,{icon:De(i),label:ke(e,i,{extended:!0}),onClick:()=>{const t=Z(e);l(null,{data:{type:i,id:t}}),n()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"},`entity-${c}-${o}`))]}),t(I,{thickness:c===k.length-1?0:1,length:"90%",margin:"8px auto"})]},`category-list-${i}`))}):t(lt,{ref:u,isOpen:p,top:m.top,left:m.left,children:t(Oe,{})})},ra=({preventPopup:n=!1})=>{const{searchText:o,setSearchText:a}=xe(),[r,s]=i(!1),c=!!o||r,d=()=>{a(""),s(!1)},u=l(null);return dt(u,d),U({key:"Escape",active:c},d),e(ia,{ref:u,children:[t(k,{placeholder:"Search",icon:si,value:o,onChange:e=>a(e.target.value.toLowerCase()),onFocus:()=>s(!0)}),c&&!n?t(aa,{onClose:d}):null]})},la=({sources:e,title:n="Condition",value:i,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e.forEach(({conditions:e})=>{e?.forEach(({type:e,reason:n})=>{t.find(t=>t.id===`${e}#${n}`)||t.push({id:`${e}#${n}`,value:`${ut(e)} - ${ut(n)}`})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(pt,{disabled:!l?.length,title:n,placeholder:"All",options:l,value:i,onSelect:o,onDeselect:a,...r})},sa=({sources:e,title:n="Error Message",value:i,onSelect:o,onDeselect:a,disabled:r,...l})=>{const s=c(()=>{const t=[];return e.forEach(({conditions:e})=>{ye(e||[]).forEach(({status:e,message:n,reason:i})=>{e!==ue.Error||t.find(e=>e.id===n)||(n?t.find(e=>e.id===n)||t.push({id:n,value:n}):i&&(t.find(e=>e.id===i)||t.push({id:i,value:i})))})}),t},[e]);return t(pt,{disabled:r||!s?.length,title:n,placeholder:"All",options:s,value:i,onSelect:o,onDeselect:a,...l})},ca=({sources:e,title:n="Programming Language",value:i,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e.forEach(({containers:e})=>{e?.forEach(({language:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:ht[e]||e})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(pt,{disabled:!l?.length,title:n,placeholder:"All",options:l,value:i,onSelect:o,onDeselect:a,...r})},da=({title:e="Monitors",value:n,onSelect:i,onDeselect:o,...a})=>{const r=c(()=>{const e=[];return mt.forEach(({id:t,value:n})=>{e.find(e=>e.id===t)||e.push({id:t,value:n})}),e},[]);return t(pt,{disabled:!r?.length,title:e,placeholder:"All",options:r,value:n,onSelect:i,onDeselect:o,...a})},ua=({namespaces:e,title:n="Namespace",value:i,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e?.forEach(({name:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(pt,{disabled:!l?.length,title:n,placeholder:"Select namespace",options:l,value:i,onSelect:o,onDeselect:a,...r})},pa=({sources:e,title:n="Kind",value:i,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e.forEach(({kind:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(pt,{disabled:!l?.length,title:n,placeholder:"All",options:l,value:i,onSelect:o,onDeselect:a,...r})},ha=({sources:e,title:n="Agent Injection Status",value:i,onSelect:o,onDeselect:a,disabled:r,...l})=>{const s=c(()=>{const t=[];return e.forEach(({podsAgentInjectionStatus:e})=>{const{reasonEnum:n,message:i}=e||{};if(n){t.find(e=>e.id===n)||t.push({id:n,value:ut(n)})}else if(i){t.find(e=>e.id===i)||t.push({id:i,value:i})}}),t},[e]);return t(pt,{disabled:r||!s?.length,title:n,placeholder:"All",options:s,value:i,onSelect:o,onDeselect:a,...l})},ma=h.div`
|
|
192
192
|
display: flex;
|
|
193
193
|
flex-direction: column;
|
|
194
194
|
gap: 12px;
|
|
195
195
|
padding: 12px;
|
|
196
|
-
`,
|
|
196
|
+
`,ga=h.div`
|
|
197
197
|
padding: 12px 6px 6px 6px;
|
|
198
|
-
`,
|
|
198
|
+
`,fa=h(_e)`
|
|
199
199
|
font-size: 14px;
|
|
200
200
|
${({$color:e})=>`color: ${e};`}
|
|
201
|
-
`,
|
|
201
|
+
`,va=h.div`
|
|
202
202
|
margin-left: auto;
|
|
203
|
-
`,
|
|
203
|
+
`,ya=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},ba=()=>{const n=g(),a=X(e=>e.sources),r=X(e=>e.namespaces),{selectedStreamName:s}=Ze(),{getItemSS:d,setItemSS:u,removeItemSS:p}=ft(),{popupRef:h,popupOpen:m,setPopupOpen:f,popupPosition:v,handlePosition:y}=rt(),{namespaces:b,kinds:S,monitors:x,languages:C,conditions:w,errors:k,onlyErrors:T,podsAgentInjectionStatus:E,setAll:$,clearAll:D,getEmptyState:A}=xe(),I=c(()=>tt(a,s),[a,s]),[R,M]=i({namespaces:b,kinds:S,monitors:x,languages:C,conditions:w,errors:k,onlyErrors:T,podsAgentInjectionStatus:E}),[F,L]=i(ya(R));o(()=>{const e=d(gt.OVERVIEW_FILTERS,A());$(e)},[]),o(()=>{if(!m){const e={namespaces:b,kinds:S,monitors:x,languages:C,conditions:w,errors:k,onlyErrors:T,podsAgentInjectionStatus:E};M(e),L(ya(e))}},[m,b,S,x,C,w,k,T,E]);const P=()=>{f(!1)},_=l(null);return dt(_,P),U({key:"Escape",active:m},P),e(ia,{ref:_,children:[t(ct,{label:"Filters",icon:ci,badgeLabel:F,badgeFilled:!!F,withBorder:!0,color:"transparent",onClick:()=>{y(0,50),f(!0)}}),t(lt,{ref:h,isOpen:m,top:v.top,left:v.left,width:"420px",footer:e(O,{children:[t(fa,{variant:"primary",onClick:()=>{u(gt.OVERVIEW_FILTERS,R),$(R),L(ya(R)),f(!1)},children:"Apply"}),t(fa,{variant:"secondary",onClick:P,children:"Cancel"}),t(va,{children:t(fa,{variant:"tertiary",onClick:()=>{p(gt.OVERVIEW_FILTERS),D(),M(A()),L(0),f(!1)},$color:n.text.error,children:"Reset"})})]}),children:e(ma,{children:[t(ua,{namespaces:r,value:R.namespaces,onSelect:e=>M(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>M(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(pa,{sources:I,value:R.kinds,onSelect:e=>M(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>M(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ca,{sources:I,value:R.languages,onSelect:e=>M(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>M(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(da,{value:R.monitors,onSelect:e=>M(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>M(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(la,{sources:I,value:R.conditions,onSelect:e=>M(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>M(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ha,{sources:I,value:R.podsAgentInjectionStatus,onSelect:e=>M(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>M(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ga,{children:t(N,{title:"Show only sources with errors",initialValue:R.onlyErrors,onChange:e=>M(t=>({...t,errors:[],onlyErrors:e}))})}),t(sa,{sources:I,value:R.errors,onSelect:e=>M(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>M(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!R.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},Sa=h.div`
|
|
204
204
|
display: flex;
|
|
205
205
|
flex-direction: column;
|
|
206
206
|
gap: 24px;
|
|
207
207
|
padding: 4px;
|
|
208
|
-
`,
|
|
208
|
+
`,xa=({formData:n,handleFormChange:i,formErrors:o,editingStreamName:a})=>{const{dataStreams:r,selectedStreamName:l}=Ze(),s=a||l,d=c(()=>r.find(e=>e.name===n.name&&e.name!==s),[r,n.name,s]);return e(Sa,{children:[t(k,{name:"name",title:f.STREAM_NAME,placeholder:f.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:n.name,onChange:({target:{value:e}})=>i("name",e),errorMessage:o.name}),d&&t(de,{type:ue.Warning,message:f.DATA_STREAM_EXISTS_WARNING(s,d.name)})]})},Ca=h.div`
|
|
209
209
|
width: 100%;
|
|
210
210
|
height: 100%;
|
|
211
211
|
max-height: calc(100vh - 220px);
|
|
212
212
|
overflow: overlay;
|
|
213
213
|
overflow-y: auto;
|
|
214
|
-
`,
|
|
214
|
+
`,wa=({isOpen:e,onClose:n,dataStreamName:o,updateDataStream:a})=>{const{dataStreams:r}=Ze(),s=l(null),[u,p]=i(!1),{formData:h,handleFormChange:m,formErrors:g,validateForm:f,resetFormData:v,loadFormWithDrawerItem:y}=vt({name:o}),b=c(()=>{if(!e)return v();const t=r?.find(e=>e.name===o);return t?y(t):v(),t},[e,r,o]),S=d((e,t)=>{m(e,t),p(!0)},[m]);if(!b)return null;return t(po,{ref:s,title:b.name,icons:[di],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{f({withAlert:!0,alertTitle:oe.Update})&&(a(o,h),p(!1),n())},onCancel:()=>{v(),p(!1),n()},children:t(Ca,{children:t(xa,{formData:h,handleFormChange:S,formErrors:g,editingStreamName:o})})})},ka=h.div`
|
|
215
215
|
position: relative;
|
|
216
|
-
`,
|
|
216
|
+
`,Ta=h(O)`
|
|
217
217
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
218
218
|
border-radius: 32px;
|
|
219
219
|
|
|
220
220
|
& button {
|
|
221
221
|
max-height: 28px;
|
|
222
222
|
}
|
|
223
|
-
`,
|
|
223
|
+
`,Ea=h(B)`
|
|
224
224
|
text-wrap: nowrap;
|
|
225
|
-
|
|
225
|
+
`,$a=h(st)`
|
|
226
226
|
max-height: 240px;
|
|
227
227
|
padding: 0px !important;
|
|
228
|
-
`,
|
|
228
|
+
`,Na=h(O)`
|
|
229
229
|
width: 100%;
|
|
230
|
-
`,
|
|
230
|
+
`,Da=h.div`
|
|
231
231
|
width: 100%;
|
|
232
|
-
`,
|
|
232
|
+
`,Aa=({onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r})=>{const l=g(),{clearStore:s}=yt(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:h,handlePosition:m}=rt(),{dataStreams:f,selectedStreamName:v,setSelectedStreamName:y}=Ze(),[b,S]=i(""),[x,C]=i(""),[w,T]=i(""),E=c(()=>f.filter(({name:e})=>!w||e.toLowerCase().includes(w.toLowerCase())).map(({name:n})=>e(Na,{children:[t(Da,{children:t(ct,{label:n,isSelected:v===n,onClick:()=>{s(),y(n),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})}),n!==bt&&t(M,{onClick:()=>C(n),tooltip:H.DELETE,children:t(ti,{})}),t(M,{onClick:()=>S(n),tooltip:H.EDIT,children:t(oi,{})})]},`stream-${n}`)),[f,v,w]);return e(n,{children:[e(ka,{children:[e(Ta,{$gap:0,children:[e(_e,{variant:"tertiary",onClick:()=>{m(0,50),p(e=>!e)},children:[t(di,{fill:l.text.info}),e(Ea,{children:["Data Stream: ",v]}),t(St,{extend:u}),t(Fe,{label:f.length})]}),t(I,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),t(F,{onClick:()=>{s(),o()},label:H.NEW})]}),t(lt,{ref:d,isOpen:u,top:h.top,left:h.left,header:t(k,{placeholder:"Search...",icon:si,value:w,onChange:e=>T(e.target.value)}),children:t($a,{children:E})})]}),t(G,{isOpen:""!==x,name:x,onApprove:()=>{r(x),C("")},onDeny:()=>{C("")}}),t(wa,{isOpen:""!==b,onClose:()=>{S("")},dataStreamName:b,updateDataStream:a})]})},Ia=h.div`
|
|
233
233
|
display: flex;
|
|
234
234
|
align-items: center;
|
|
235
235
|
margin: 20px 0;
|
|
236
236
|
padding: 0 16px;
|
|
237
237
|
gap: 8px;
|
|
238
|
-
`,
|
|
238
|
+
`,Ra=h.div`
|
|
239
239
|
margin-left: auto;
|
|
240
|
-
|
|
240
|
+
`,Oa=({addEntity:n,preventSearchPopup:i,onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r})=>{const{isVm:l}=ae(),{setCurrentModal:s}=re();return e(Ia,{children:[!l&&t(Aa,{onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r}),t(ra,{preventPopup:i}),t(ba,{}),n&&t(Ra,{children:t(F,{"data-id":`add-${n}`,onClick:()=>s(n),label:`${H.ADD} ${ut(n)}`,variant:"primary",textProps:{weight:900}})})]})},Ma=r(({isModal:n,onClickSummary:i},o)=>{const{selectedStreamName:a}=Ze(),{formData:r,handleFormChange:l,formErrors:c,validateForm:d}=vt({name:a});return s(o,()=>({validateForm:d,getFormValues:()=>r})),t(ce,{$isNotModal:!n,children:e(R,{$gap:24,children:[i&&t(xt,{onClick:i}),t(z,{title:f.NAME_YOUR_STREAM,description:f.STREAM_DESCRIPTION}),t(xa,{formData:r,handleFormChange:l,formErrors:c})]})})});Ma.displayName=Ma.name;const Fa=({createDataStream:e})=>{const{currentModal:n,setCurrentModal:i}=re(),{addDataStreams:o,setSelectedStreamName:a}=Ze(),r=n===Ct.DataStream,s=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const t=d.current.getFormValues();e?e(t):(o([t]),a(t.name)),s()}},d=l(null);return U({key:"Enter",active:r},c),t(se,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:t(me,{buttons:[{label:"DONE",variant:"primary",onClick:c}]}),children:t(Ma,{ref:d,isModal:!0})})},La=(e,t)=>{const{destinationType:n,disabled:i,exportedSignals:o}=e,a=[{title:f.TYPE,value:n.type},{type:v.ActiveStatus,title:f.STATUS,value:String(!i)},{type:v.Monitors,title:f.MONITORS,value:Ue(o).join(", ")},{title:f.NAME,value:n.displayName}],r=wt(e,t),l=r.map(e=>({name:e.key,value:e.value}));return r.map(({key:e,name:n,value:i})=>{const{secret:r,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!(!!c?.length&&kt(c,Ue(o),l))){const{type:e}=Tt(s,{type:""}),t=(r||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";a.push({type:v.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&a.push({title:t.title,value:t.value})}):a.push({title:n,value:t||i})}}),a},Pa=({signals:e,fields:n,onChange:i,formErrors:o})=>n?.map(a=>{const{componentType:r,renderCondition:l,...s}=a;if(!(!l||kt(l,e,n)))return null;switch(r){case L.Input:return t(k,{...s,onChange:e=>i(a.name,e.target.value),errorMessage:o[a.name]},a.name);case L.Dropdown:return t(pt,{...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>i(a.name,e.id),errorMessage:o[a.name]},a.name);case L.MultiInput:return t(A,{...s,value:"string"==typeof s.value?Tt(s.value,[]):s.value,onChange:e=>i(a.name,JSON.stringify(e)),errorMessage:o[a.name]},a.name);case L.KeyValuePair:return t(D,{...s,value:"string"==typeof s.value?Tt(s.value,[]):s.value,onChange:e=>i(a.name,JSON.stringify(e)),errorMessage:o[a.name]},a.name);case L.TextArea:return t(V,{...s,onChange:e=>i(a.name,e.target.value),errorMessage:o[a.name]},a.name);case L.Checkbox:return t(C,{...s,value:"true"==s.value,onChange:e=>i(a.name,String(e)),errorMessage:o[a.name]},a.name);default:return null}}),_a=h(_e)`
|
|
241
241
|
display: flex;
|
|
242
242
|
align-items: center;
|
|
243
243
|
gap: 8px;
|
|
@@ -251,43 +251,43 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
251
251
|
`:m`
|
|
252
252
|
background-color: transparent;
|
|
253
253
|
`}
|
|
254
|
-
`,
|
|
254
|
+
`,za=({destination:n,validateForm:o,status:a,testConnection:r,onSuccess:l,onError:s})=>{const c=g(),{selectedStreamName:d}=Ze(),[u,p]=i(!1),h=a?Se(a,c):void 0;return e(_a,{$status:a,variant:"secondary",onClick:async()=>{if(o()){p(!0);const e=await r({...n,currentStreamName:d});e&&(e.succeeded?l(e):s(e)),p(!1)}},children:[u?t(Pe,{}):h?t(h,{}):null,t(B,{family:"secondary",decoration:"underline",size:14,color:a?c.text[a]:void 0,children:u?"Checking":a===ue.Success?"Connection OK":"error"===a?"Connection Failed":"Test Connection"})]})},Ka=h(R)`
|
|
255
255
|
align-items: unset;
|
|
256
256
|
padding: 0 4px;
|
|
257
|
-
`,
|
|
257
|
+
`,ja=h.div`
|
|
258
258
|
display: flex;
|
|
259
259
|
flex-direction: column;
|
|
260
260
|
gap: 12px;
|
|
261
|
-
`,
|
|
261
|
+
`,Va=h(O)`
|
|
262
262
|
justify-content: space-between;
|
|
263
|
-
`,
|
|
263
|
+
`,Ba=h(B)`
|
|
264
264
|
margin-bottom: 12px;
|
|
265
|
-
`,
|
|
265
|
+
`,Wa=({isUpdate:n,categoryItem:a,formData:r,formErrors:s,validateForm:d,handleFormChange:u,dynamicFields:p,setDynamicFields:h,testConnection:m})=>{const{type:v,displayName:y,supportedSignals:b,testConnectionSupported:S}=a||{},x=g(),[C,w]=i(!1),[T,E]=i(!1),[$,N]=i(void 0),D=l(!1);o(()=>{if(p.length&&!D.current){D.current=!0;let e=!1;for(let t=0;t<p.length;t++){const{required:n,value:i}=p[t];if(n){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}w(e)}},[p,T]);const A=c(()=>{const{logs:e,metrics:t,traces:n}=b||{},i=[];return e?.supported&&i.push(Et.Logs),t?.supported&&i.push(Et.Metrics),n?.supported&&i.push(Et.Traces),i},[b]),R=c(()=>{const{logs:e,metrics:t,traces:n}=r.exportedSignals||{},i=[];return e&&i.push(Et.Logs),t&&i.push(Et.Metrics),n&&i.push(Et.Traces),i},[r.exportedSignals]),O=()=>{w(!1),E(!0),N(void 0)};return e(Ka,{$gap:24,children:[e(Ka,{$gap:12,children:[t(z,{title:n?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:S&&t(za,{destination:r,validateForm:d,status:$?.type,testConnection:m,onError:e=>{E(!1),N({type:ue.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{E(!1),N({type:ue.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e(ja,{children:[S&&$&&t(de,{type:$.type,title:$.title,message:$.message}),C&&!$&&!n&&t(de,{type:ue.Default,message:`Odigos autocompleted ${y} destination details.`})]}),t(I,{})]}),e(Va,{children:[t(j,{title:n?"":"This connection will monitor:",required:!0,allowedSignals:A,selectedSignals:R,setSelectedSignals:e=>{O(),u("exportedSignals",{logs:e.includes(Et.Logs),metrics:e.includes(Et.Metrics),traces:e.includes(Et.Traces)})},errorMessage:s.exportedSignals}),!n&&t(K,{endpoint:`/backends/${v}`})]}),n&&e("div",{children:[t(Ba,{children:"Status"}),t(P,{options:[{icon:ni,label:f.ENABLED,value:!1,selectedBgColor:x.text.success+_["050"]},{icon:ii,label:f.DISABLED,value:!0,selectedBgColor:x.text.error+_["050"]}],selected:r.disabled,setSelected:e=>u("disabled",e)})]}),!n&&t(k,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{O(),u("name",e.target.value)},errorMessage:s.name}),t(Pa,{signals:R,fields:p,onChange:(e,t)=>{O(),h(n=>{const i=[...n],o=i.findIndex(t=>t.name===e);return-1!==o&&(i[o]={...i[o],value:t}),i})},formErrors:s})]})},Ua=h.div`
|
|
266
266
|
width: 100%;
|
|
267
267
|
height: 100%;
|
|
268
268
|
max-height: calc(100vh - 220px);
|
|
269
269
|
overflow: overlay;
|
|
270
270
|
overflow-y: auto;
|
|
271
|
-
`,
|
|
271
|
+
`,Ha=h.div`
|
|
272
272
|
display: flex;
|
|
273
273
|
flex-direction: column;
|
|
274
274
|
gap: 12px;
|
|
275
|
-
`,
|
|
275
|
+
`,qa=({categories:n,updateDestination:a,deleteDestination:r,testConnection:s})=>{const{destinations:d}=X(),{selectedStreamName:u}=Ze(),{drawerType:p,drawerEntityId:h}=W(),m=c(()=>nt(d,u),[d,u]),g=l(null),v=p===J.Destination,[y,b]=i(!1),[S,x]=i(!1),{formData:C,formErrors:w,handleFormChange:k,resetFormData:T,validateForm:E,loadFormWithDrawerItem:$,yamlFields:N,setYamlFields:D,dynamicFields:A,setDynamicFields:I}=$t({}),R=c(()=>{if(h)return m?.find(e=>Z(e)===h)},[h,m]);if(o(()=>{v&&R?(D(Nt(n,R)),$(R)):T()},[v,R,n]),!R)return null;const O=n.flatMap(e=>e.items).find(e=>e.type===R.destinationType.type),{icon:M,iconSrc:F}=O?Ge(O?.type):{icon:void 0,iconSrc:void 0};return t(po,{ref:g,title:R.name||R.destinationType.displayName,icons:M?[M]:void 0,iconSrcs:F?[F]:void 0,isEdit:y,isFormDirty:S,onEdit:e=>{b("boolean"!=typeof e||e)},onSave:async e=>{if(E({withAlert:!0,alertTitle:oe.Update})){const t=e!==R.destinationType.displayName?e:"";k("name",t),a(h,{...C,name:t}),b(!1),x(!1)}},onDelete:async()=>{r(h),b(!1),x(!1),g.current?.closeDrawer()},onCancel:()=>{b(!1),x(!1),$(R)},isLastItem:1===m.length,children:y?t(Ua,{children:t(Wa,{isUpdate:!0,categoryItem:O,formData:C,formErrors:w,handleFormChange:(...e)=>{x(!0),k(...e)},dynamicFields:A,setDynamicFields:(...e)=>{x(!0),I(...e)},validateForm:E,testConnection:s})}):e(Ha,{children:[R.conditions?.length?t(te,{conditions:R.conditions}):null,t(ne,{title:f.DESTINATION_DETAILS,data:R?La(R,N):[]})]})})},Ga=h.div`
|
|
276
276
|
display: flex;
|
|
277
277
|
flex-direction: column;
|
|
278
278
|
gap: 12px;
|
|
279
|
-
`,
|
|
279
|
+
`,Ya=({items:n,onSelectNew:i,onSelectConfigured:o,isLoadingForDestinationIds:a})=>{const{configuredDestinationsUpdateOnly:r}=yt();return n.map(n=>{const l=n.name===It.EXISTS;return e(Ga,{children:[t(z,{size:"small",icon:n.icon,title:Dt(n.name),description:n.description}),n.items.map(e=>{const s=`select-${n.name.replaceAll(" ","")}-destination-${e.type}-${e.id||""}`,c=At(e.supportedSignals),{icon:d,iconSrc:u}=Ge(e.type),p=e.selected||r.some(t=>t.id===e.id),h=!!a.find(t=>t===e.id),m=l?()=>o(e.id):()=>i(e);return t(Ke,{"data-id":s,title:e.displayName,hoverText:H.SELECT,onClick:m,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:h,onCheckboxChange:()=>o(e.id)}},s)})]},`category-${n.name}`)})},Ja=h.div`
|
|
280
280
|
display: flex;
|
|
281
281
|
flex-direction: column;
|
|
282
282
|
gap: 24px;
|
|
283
|
-
`,
|
|
283
|
+
`,Xa=h.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
align-items: center;
|
|
286
286
|
gap: 12px;
|
|
287
|
-
`,
|
|
287
|
+
`,Qa=h.div`
|
|
288
288
|
width: 170px;
|
|
289
289
|
margin-right: 8px;
|
|
290
|
-
`,
|
|
290
|
+
`,Za=h.div`
|
|
291
291
|
display: flex;
|
|
292
292
|
flex-direction: column;
|
|
293
293
|
align-self: stretch;
|
|
@@ -298,18 +298,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
298
298
|
@media (height < 800px) {
|
|
299
299
|
max-height: calc(100vh - 400px);
|
|
300
300
|
}
|
|
301
|
-
`,
|
|
301
|
+
`,er=h(Ja)`
|
|
302
302
|
margin-top: 80px;
|
|
303
|
-
`,
|
|
303
|
+
`,tr=Object.values(It).map(e=>({value:Ot[e].TITLE,id:e})),nr=tr[0],ir=[Et.Logs,Et.Metrics,Et.Traces],or=(e,t,n)=>e.map(e=>{const{type:i,displayName:o}=e.destinationType,a=e.dataStreamNames?.includes(t),r=n.has(e.id);return{id:e.id,type:i,displayName:o,selected:a||r,fields:[],testConnectionSupported:!1,supportedSignals:{logs:{supported:e.exportedSignals.logs},metrics:{supported:e.exportedSignals.metrics},traces:{supported:e.exportedSignals.traces}}}}),ar=({hidden:n,categories:o,potentialDestinations:a,onSelectNew:r,onSelectConfigured:l,isLoadingForDestinationIds:s})=>{const{destinations:d}=X(),{selectedStreamName:u}=Ze(),{configuredDestinations:p,configuredDestinationsUpdateOnly:h}=yt(),[m,g]=i(""),[f,v]=i(nr),[y,b]=i(ir),S=c(()=>{const e=Rt(o);return e.unshift({name:It.EXISTS,description:Ot[It.EXISTS].DESCRIPTION,icon:ui,items:or(d,u,new Set(p.concat(h).map(e=>e.id)))}),e.unshift({name:It.DETECTED,description:Ot[It.DETECTED].DESCRIPTION,icon:pi,items:a}),e.map(e=>{const t=e.items.filter(t=>{const n=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),i="all"===f.id||f.id?.toLowerCase()?.replaceAll("-"," ")===e.name.toLowerCase()?.replaceAll("-"," "),o=y.some(e=>t.supportedSignals[Mt[e]]?.supported);return n&&i&&o});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[o,a,d,m,f,y,u,p,h]);return n?null:e(Ja,{children:[t(z,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(Xa,{children:[t(Qa,{children:t(k,{placeholder:"Search...",icon:si,value:m,onChange:({target:{value:e}})=>g(e)})}),t(Qa,{children:t(pt,{options:tr,value:f,onSelect:v,onDeselect:()=>{}})}),t(j,{title:"",selectedSignals:y,setSelectedSignals:b})]}),t(I,{}),S.length?t(Za,{children:t(Ya,{items:S,onSelectNew:e=>r(e,y),onSelectConfigured:l,isLoadingForDestinationIds:s})}):t(er,{children:t(Oe,{title:"No destinations found"})})]})},rr=h.div`
|
|
304
304
|
display: flex;
|
|
305
|
-
`,
|
|
305
|
+
`,lr=h.div`
|
|
306
306
|
border-right: 1px solid ${({theme:e})=>e.colors.border};
|
|
307
307
|
padding: 32px;
|
|
308
308
|
width: 200px;
|
|
309
309
|
@media (max-width: 1050px) {
|
|
310
310
|
display: none;
|
|
311
311
|
}
|
|
312
|
-
`,
|
|
312
|
+
`,sr=({isOnboarding:n,categories:o,potentialDestinations:a,createDestination:r,updateDestination:l,deleteDestination:s,testConnection:c})=>{const{destinations:d}=X(),{selectedStreamName:u}=Ze(),{currentModal:p,setCurrentModal:h}=re(),{addConfiguredDestination:m,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:v,configuredDestinationsUpdateOnly:y}=yt(),b=p===J.Destination,[S,x]=i(void 0),{formData:C,formErrors:w,handleFormChange:k,resetFormData:T,validateForm:E,setYamlFields:$,dynamicFields:N,setDynamicFields:D,loadFormWithDrawerItem:A}=$t({supportedSignals:S?.supportedSignals,preLoadedFields:S?.fields}),[I,R]=i([]),O=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:S.type,displayName:S.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},M=async e=>{if(n&&!e){const e=O();m(e)}else if(n&&e){const t=O(e);y.some(t=>t.id===e.id)?v(e):g(t)}else if(n||e){if(!n&&e){const t=O(e),n=t.dataStreamNames.some(e=>e===u);R(t=>[...t,e.id]),n?await s(e.id):await l(e.id,A(t)),R(t=>t.filter(t=>t!==e.id))}}else r(C)},F=()=>{T(),x(void 0),h("")},L=()=>{T(),x(void 0)},P=async()=>{if(S){if(!E({withAlert:!n,alertTitle:oe.Create}))return null;M()}F()};return U({key:"Enter",active:b},()=>P()),t(se,{isOpen:b,onClose:F,header:{title:f.ADD_DESTINATION},actionComponent:t(me,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:P}];return S&&e.unshift({label:"BACK",icon:()=>t(hi,{rotate:-90}),variant:"secondary",onClick:L}),e})()}),children:e(rr,{children:[t(lr,{children:t(Ft,{currentStep:S?2:1,data:[{stepNumber:1,title:f.DESTINATIONS},{stepNumber:2,title:f.CONNECTION}]})}),e(ce,{style:{margin:"32px 24px 12px 24px"},children:[t(ar,{hidden:void 0!==S,categories:o,potentialDestinations:a,onSelectNew:(e,t)=>{T(),k("type",e?.type||""),k("currentStreamName",u);const n={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[Mt[t]].supported).forEach(e=>n[Mt[e]]=!0),k("exportedSignals",n),$(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=d.find(t=>t.id===e);t&&M(t)},isLoadingForDestinationIds:I}),S&&t(Wa,{categoryItem:S,formData:C,formErrors:w,handleFormChange:k,dynamicFields:N,setDynamicFields:D,validateForm:E,testConnection:c})]})]})})},cr=h.div`
|
|
313
313
|
display: flex;
|
|
314
314
|
flex-direction: column;
|
|
315
315
|
align-items: center;
|
|
@@ -318,7 +318,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
318
318
|
max-height: calc(100vh - 310px);
|
|
319
319
|
height: fit-content;
|
|
320
320
|
overflow-y: scroll;
|
|
321
|
-
`,
|
|
321
|
+
`,dr=({categories:e,withDelete:n})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:o}=yt();return i.length||o.length?t(cr,{children:i.concat(o).map((a,r)=>t(ur,{"data-id":`configured-destination-${a.destinationType.type}`,item:a,yamlFields:Nt(e,a),isLastItem:i.length+o.length===1,withDelete:n},`configured-destination-${a.destinationType.type}-${r}`))}):t(Re,{children:t(Oe,{title:"No destinations",subTitle:"Please add a destination"})})},ur=({item:o,yamlFields:a,isLastItem:r,withDelete:l})=>{const[s,d]=i(!1),{icon:u,iconSrc:p}=Ge(o.destinationType.type),{removeConfiguredDestination:h,removeConfiguredDestinationUpdateOnly:m}=yt(),g=c(()=>wt(o,a).map(e=>({title:e.name,value:e.value})),[o,a]);return e(n,{children:[t(Ke,{title:o.name||o.destinationType.displayName,subTitle:o.destinationType.type,iconProps:{icon:u,iconSrc:p},visualProps:{monitors:Ue(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>t(Lt,{data:g})},renderActions:l?()=>t(M,{onClick:()=>d(!0),children:t(ti,{})}):void 0}),l&&t(G,{isOpen:s,name:o.destinationType.displayName||o.name,type:J.Destination,isLastItem:r,onApprove:()=>{o.id?m(o):h(o)},onDeny:()=>d(!1)})]})},pr=h(_e)`
|
|
322
322
|
display: flex;
|
|
323
323
|
align-items: center;
|
|
324
324
|
justify-content: center;
|
|
@@ -327,7 +327,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
327
327
|
padding: 32px;
|
|
328
328
|
border-radius: 16px;
|
|
329
329
|
border-style: dashed !important;
|
|
330
|
-
`,
|
|
330
|
+
`,hr=({isSourcesListEmpty:i,goToSources:o,categories:a,potentialDestinations:r,testConnection:l,onClickSummary:s})=>{const c=g(),{setCurrentModal:d}=re(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=yt();return e(n,{children:[t(ce,{$isNotModal:!0,children:e(R,{$gap:12,children:[e(R,{$gap:24,children:[s&&t(xt,{onClick:s}),t(z,{title:f.ADD_DESTINATIONS,badgeLabel:u.length+p.length,description:f.ADD_DESTINATION_DESCRIPTION}),i&&t(de,{type:ue.Warning,message:f.NO_SOURCES_GO_BACK,action:{label:f.SELECT_SOURCES,onClick:o}}),e(pr,{variant:"secondary",onClick:()=>d(J.Destination),children:[t(ri,{}),t(B,{color:c.colors.secondary,size:14,decoration:"underline",family:"secondary",children:f.ADD_DESTINATION})]})]}),t(dr,{categories:a,withDelete:!0})]})}),t(sr,{isOnboarding:!0,categories:a,potentialDestinations:r,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:l})]})},mr=[{key:"icon",title:""},{key:"name",title:f.NAME,sortable:!0},{key:"type",title:f.TYPE,sortable:!0},{key:"signals",title:f.MONITORS},{key:"active-status",title:f.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],gr=({metrics:n,maxHeight:i,maxWidth:o})=>{const a=g(),r=xe(),{selectedStreamName:l}=Ze(),{setDrawerType:s,setDrawerEntityId:d}=W(),{destinations:u,destinationsLoading:p}=X(),h=c(()=>nt(u,l),[u,l]),m=c(()=>Co({instrumentationRules:[],sources:[],actions:[],destinations:ot(h,r),searchText:r.searchText,selectedCategory:J.Destination}).searchResults.find(({category:e})=>e===J.Destination)?.entities||[],[h,r]),v=c(()=>m.map(e=>{const{hasErrors:i,hasWarnings:o,hasDisableds:r}=ge(e.conditions||[]),{icon:l,iconSrc:c}=Ge(e.destinationType.type);return{status:i?ue.Error:o?ue.Warning:void 0,faded:r,onClick:()=>{s(J.Destination),d(e.id)},cells:[{columnKey:"icon",component:()=>t(we,{icon:l,src:c})},{columnKey:"name",value:ke(e,J.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.destinationType.type,textColor:a.text.info},{columnKey:"throughput",value:He(Pt(n,J.Destination,e.id).throughput),textColor:a.text.info},{columnKey:"signals",component:()=>t(Te,{withLabels:!0,monitors:Ue(e.exportedSignals)})},{columnKey:"conditions",component:()=>e.conditions?.length?t(So,{conditions:e.conditions,id:e.id}):null},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(fe,{status:e.disabled?ue.Error:ue.Success,title:e.disabled?f.DISABLED:f.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[m,n]),{badge:y,badgeTooltip:b}=c(()=>m.length!==h.length?{badge:`${m.length}/${h.length}`,badgeTooltip:f.FILTERED_COUNT_TOOLTIP}:{badge:h.length,badgeTooltip:void 0},[m,h]);return e(Ee,{$maxWidth:o,children:[t($e,{children:t(Ne,{icon:De(J.Destination),title:f.DESTINATIONS,badge:y,badgeTooltip:b,loading:p})}),t(Ae,{$maxHeight:i,children:t(Ie,{columns:mr,rows:v})}),!m.length&&t(Re,{style:{marginTop:"2rem"},children:t(Oe,{})})]})},fr=e=>{const{type:t,ruleName:n,notes:i,disabled:o,profileName:a,payloadCollection:r,codeAttributes:l,headersCollection:s,customInstrumentations:c}=e,d=[{title:f.TYPE,value:t},{type:v.ActiveStatus,title:f.STATUS,value:String(!o)},{title:f.NAME,value:n},{title:f.NOTES,value:i},{title:f.MANAGED_BY_PROFILE,value:a},{type:v.Divider}];if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[_t.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Kt.Java]||[]).map(e=>new zt(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:f.JAVA_CUSTOM_PROBES,value:e});const t=(c[Kt.Golang]||[]).map(e=>new jt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:f.GOLANG_CUSTOM_PROBES,value:t})}return d},vr=h.div`
|
|
331
331
|
display: flex;
|
|
332
332
|
flex-direction: column;
|
|
333
333
|
gap: 12px;
|
|
@@ -337,7 +337,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
337
337
|
border-radius: 16px;
|
|
338
338
|
padding: 8px;
|
|
339
339
|
`}
|
|
340
|
-
`,
|
|
340
|
+
`,yr=[{id:Vt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Vt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Vt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],br=[{id:Vt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Vt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Vt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Sr={[Kt.Java]:[new zt("","")],[Kt.Golang]:[new jt("")]},xr=["*"],Cr=h.div`
|
|
341
341
|
display: flex;
|
|
342
342
|
flex-direction: column;
|
|
343
343
|
gap: 12px;
|
|
@@ -347,27 +347,27 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
347
347
|
border-radius: 16px;
|
|
348
348
|
padding: 8px;
|
|
349
349
|
`}
|
|
350
|
-
`,
|
|
350
|
+
`,wr=[{id:Bt.HttpRequest,label:"Collect HTTP Request"},{id:Bt.HttpResponse,label:"Collect HTTP Response"},{id:Bt.DbQuery,label:"Collect DB Query"},{id:Bt.Messaging,label:"Collect Messaging"}],kr={[Wt.CodeAttributes]:({value:a,setValue:r,formErrors:l})=>{const s=l.codeAttributes,d=c(()=>Object.entries(a.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[a]),[u,p]=i(1===d.length);o(()=>{if(!d.length){const e={[Vt.Column]:null,[Vt.FilePath]:!0,[Vt.Function]:!0,[Vt.LineNumber]:!0,[Vt.Namespace]:null,[Vt.StackTrace]:null};r("codeAttributes",e),p(!1)}},[]);const h=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),i=Object.values(Vt).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});r("codeAttributes",i),p(1===n.length)};return e(n,{children:[e("div",{children:[t(x,{title:"Recommended data to collect",required:!0}),t(vr,{$hasError:!!s,children:yr.map(({id:e,label:n,tooltip:i})=>t(be,{text:i,withIcon:!0,children:t(C,{title:n,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!s&&t(w,{children:s})]}),e("div",{children:[t(x,{title:"Verbose data to collect",required:!0}),t(vr,{$hasError:!!s,children:br.map(({id:e,label:n,tooltip:i})=>t(be,{text:i,withIcon:!0,children:t(C,{title:n,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!s&&t(w,{children:s})]})]})},[Wt.CustomInstrumentation]:({value:n,setValue:i,formErrors:a})=>{const r=a.customInstrumentations,l=c(()=>(n?.customInstrumentations?.[Kt.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[n]),s=c(()=>(n?.customInstrumentations?.[Kt.Golang]||[]).map(e=>new jt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),d=(e,t)=>{const n={};switch(t){case"java":n[Kt.Java]=e.map(e=>new zt(e.className,e.methodName)),n[Kt.Golang]=s.map(e=>new jt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":n[Kt.Golang]=e.map(e=>new jt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),n[Kt.Java]=l.map(({key:e,value:t})=>new zt(e,t))}i("customInstrumentations",n)};return o(()=>{n?.customInstrumentations||i("customInstrumentations",{[Kt.Golang]:Sr[Kt.Golang],[Kt.Java]:Sr[Kt.Java]})},[i,n]),e("div",{children:[t($,{title:"Golang Custom Probes",columns:[{title:"",keyName:"packageName",placeholder:"Package name",required:!0,tooltip:"The full import path of the package containing the function or method to be instrumented."},{title:"",keyName:"functionName",placeholder:"Function name",required:!1,tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{title:"",keyName:"receiverName",placeholder:"Receiver name",required:!1,tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{title:"",keyName:"receiverMethodName",placeholder:"Receiver method name",required:!1,tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],value:s,onChange:e=>d(e,"golang"),errorMessage:r,limitFieldsPerRow:2}),t(D,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:l,onChange:(e=[])=>d(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:r,keyPlaceholder:"Class name",valuePlaceholder:"Method name"})]})},[Wt.HeadersCollection]:({value:e,setValue:n,formErrors:i})=>{const a=i.headersCollection,r=c(()=>e?.headersCollection?.[_t.HeaderKeys]||[],[e]),l=e=>{const t={[_t.HeaderKeys]:e};n("headersCollection",t)};return o(()=>{r.length||l(xr)},[r]),t("div",{children:r.length>0&&t(A,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>l(e),errorMessage:a})})},[Wt.PayloadCollection]:({value:n,setValue:a,formErrors:r})=>{const l=r.payloadCollection,s=c(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]),[d,u]=i(1===s.length);o(()=>{if(!s.length){const e={[Bt.HttpRequest]:{},[Bt.HttpResponse]:{},[Bt.DbQuery]:{},[Bt.Messaging]:{}};a("payloadCollection",e),u(!1)}},[]);return e("div",{children:[t(x,{title:"Type of data to collect",required:!0}),t(Cr,{$hasError:!!l,children:wr.map(({id:e,label:n})=>t(C,{title:n,disabled:d&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const n=t?[...s,e]:s.filter(t=>t!==e),i={[Bt.HttpRequest]:n.includes(Bt.HttpRequest)?{}:null,[Bt.HttpResponse]:n.includes(Bt.HttpResponse)?{}:null,[Bt.DbQuery]:n.includes(Bt.DbQuery)?{}:null,[Bt.Messaging]:n.includes(Bt.Messaging)?{}:null};a("payloadCollection",i),u(1===n.length)})(e,t)},e))}),!!l&&t(w,{children:l})]})},[Wt.UnknownType]:null},Tr=({ruleType:e,value:n,setValue:i,formErrors:o})=>{if(!e)return null;const a=kr[e];return a?t(a,{value:n,setValue:i,formErrors:o}):null},Er=h.div`
|
|
351
351
|
display: flex;
|
|
352
352
|
flex-direction: column;
|
|
353
353
|
gap: 24px;
|
|
354
354
|
padding: 4px;
|
|
355
|
-
|
|
355
|
+
`,$r=h(B)`
|
|
356
356
|
margin-bottom: 12px;
|
|
357
|
-
`,
|
|
357
|
+
`,Nr=({isUpdate:i,rule:o,formData:a,formErrors:r,handleFormChange:l})=>{const s=g();return e(Er,{children:[t(O,{children:o.supportedLanguages.map(e=>t(Ut,{icon:Ht(e),type:ue.Info,children:ht[e]},e))}),i?e("div",{children:[t($r,{children:"Status"}),t(P,{options:[{icon:ni,label:f.ENABLED,value:!1,selectedBgColor:s.text.success+_["050"]},{icon:ii,label:f.DISABLED,value:!0,selectedBgColor:s.text.error+_["050"]}],selected:a.disabled,setSelected:e=>l("disabled",e)})]}):e(n,{children:[t(z,{title:"",description:o.docsDescription,actionButton:t(K,{endpoint:o.docsEndpoint})}),t(k,{title:"Rule name",placeholder:"Use a name that describes the rule",value:a.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:r.ruleName})]}),t(Tr,{ruleType:o.type,value:a,setValue:(e,t)=>l(e,t),formErrors:r}),t(V,{title:"Notes",value:a.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Dr=h.div`
|
|
358
358
|
width: 100%;
|
|
359
359
|
height: 100%;
|
|
360
360
|
max-height: calc(100vh - 220px);
|
|
361
361
|
overflow: overlay;
|
|
362
362
|
overflow-y: auto;
|
|
363
|
-
`,
|
|
363
|
+
`,Ar=h.div`
|
|
364
364
|
display: flex;
|
|
365
365
|
flex-direction: column;
|
|
366
366
|
gap: 12px;
|
|
367
|
-
`,
|
|
367
|
+
`,Ir=({updateInstrumentationRule:n,deleteInstrumentationRule:a})=>{const{instrumentationRules:r}=X(),{addNotification:s}=qt(),{drawerType:d,drawerEntityId:u}=W(),p=l(null),h=d===J.InstrumentationRule,[m,g]=i(!1),[f,v]=i(!1),{formData:y,formErrors:b,handleFormChange:S,resetFormData:x,validateForm:C,loadFormWithDrawerItem:w}=Gt(),k=c(()=>{if(u)return r?.find(e=>Z(e)===u)},[u,r]);if(o(()=>{h&&k?w(k):x()},[h,k]),!k)return null;const T=Yt.find(({type:e})=>e===k.type);return t(po,{ref:p,title:k.ruleName||k.type,icons:[qe(k.type)],isEdit:m,isFormDirty:f,onEdit:e=>{k.mutable||!e&&void 0!==e?g("boolean"!=typeof e||e):s({type:ue.Warning,title:pe.FORBIDDEN,message:pe.CANNOT_EDIT_RULE,crdType:J.InstrumentationRule,target:u,hideFromHistory:!0})},onSave:e=>{if(C()){const t=e!==k.type?e:"";S("ruleName",t),n(u,{...y,ruleName:t}),g(!1),v(!1)}},onDelete:()=>{k.mutable?(a(u),g(!1),v(!1),p.current?.closeDrawer()):s({type:ue.Warning,title:pe.FORBIDDEN,message:pe.CANNOT_DELETE_RULE,crdType:J.InstrumentationRule,target:u,hideFromHistory:!0})},onCancel:()=>{g(!1),v(!1),w(k)},children:m&&T?t(Dr,{children:t(Nr,{isUpdate:!0,rule:T,formData:y,formErrors:b,handleFormChange:(...e)=>{v(!0),S(...e)}})}):e(Ar,{children:[t(te,{conditions:k.conditions||[]}),t(ne,{title:"Instrumentation Rule Details",data:k?fr(k):[]})]})})},Rr=h(R)`
|
|
368
368
|
margin-top: 24px;
|
|
369
369
|
gap: 12px;
|
|
370
|
-
|
|
370
|
+
`,Or=Yt,Mr=({createInstrumentationRule:n})=>{const{tier:o}=ae(),a=o===Jt.Onprem,{currentModal:r,setCurrentModal:l}=re(),s=r===J.InstrumentationRule,{formData:c,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=Gt(),[m,g]=i(void 0),v=()=>{p(),g(void 0),l("")},y=()=>{if(!h())return null;n(c),v()};return U({key:"Enter",active:s},()=>y()),t(se,{isOpen:s,onClose:v,header:{title:"Add Instrumentation Rule"},actionComponent:t(me,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!a||!m,tooltip:a?"":pe.ENTERPRISE_ONLY("Instrumentation Rules")}]}),children:e(ce,{children:[t(z,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e(Rr,{children:[t(de,a?{type:ue.Warning,message:pe.DEFINED_FOR_ALL_STREAMS(f.INSTRUMENTATION_RULES)}:{type:ue.Default,message:pe.ENTERPRISE_ONLY(f.INSTRUMENTATION_RULES)}),t(he,{options:Or,selectedOption:m,onOptionSelect:e=>{return t=e,p(),void g(t);var t},autoFocus:!m?.type})]}),m?.type?e("div",{children:[t(I,{margin:"16px 0"}),t(Nr,{rule:m,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},Fr=e=>{const{payloadCollection:t,codeAttributes:n,customInstrumentations:i}=e;let o="";return t&&(o+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),n&&(o+=Object.entries(n).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&Object.values(Kt).forEach(e=>{const t=(i[e]||[]).filter(e=>e).join(", ");t&&(o+=o?`, ${t}`:t)}),o},Lr=[{key:"icon",title:""},{key:"name",title:f.NAME,sortable:!0},{key:"profile",title:f.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:f.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:f.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:f.NOTES,sortable:!0}],Pr=({maxHeight:n,maxWidth:i})=>{const o=g(),a=xe(),{setDrawerType:r,setDrawerEntityId:l}=W(),{instrumentationRules:s,instrumentationRulesLoading:d}=X(),u=c(()=>Co({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:a.searchText,selectedCategory:J.InstrumentationRule}).searchResults.find(({category:e})=>e===J.InstrumentationRule)?.entities||[],[s,a]),p=c(()=>u.map(e=>{const{hasErrors:n,hasWarnings:i,hasDisableds:a}=ge(e.conditions||[]);return{status:n?ue.Error:i?ue.Warning:void 0,faded:a,onClick:()=>{r(J.InstrumentationRule),l(e.ruleId)},cells:[{columnKey:"icon",component:()=>t(we,{icon:qe(e.type)})},{columnKey:"name",value:ke(e,J.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:o.text.info},{columnKey:"profile",value:e.profileName,textColor:o.text.info},{columnKey:"notes",value:e.notes,textColor:o.text.info,withTooltip:!0},{columnKey:"spec",value:Fr(e),textColor:o.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>t(So,{conditions:e.conditions||[],id:e.ruleId})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(fe,{status:e.disabled?ue.Error:ue.Success,title:e.disabled?f.DISABLED:f.ENABLED,withIcon:!0,withBorder:!0})})},{columnKey:"source-count",component:()=>t("div",{style:{lineHeight:1},children:t(fe,{status:ue.Info,title:"all sources",withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:m}=c(()=>u.length!==s.length?{badge:`${u.length}/${s.length}`,badgeTooltip:f.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[u,s]);return e(Ee,{$maxWidth:i,children:[t($e,{children:t(Ne,{icon:De(J.Action),title:f.INSTRUMENTATION_RULES,badge:h,badgeTooltip:m,loading:d})}),t(Ae,{$maxHeight:n,children:t(Ie,{columns:Lr,rows:p})}),!u.length&&t(Re,{style:{marginTop:"2rem"},children:t(Oe,{})})]})},_r=h.div`
|
|
371
371
|
position: fixed;
|
|
372
372
|
bottom: 0;
|
|
373
373
|
left: 50%;
|
|
@@ -381,17 +381,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
381
381
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
382
382
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
383
383
|
animation-name: ${Qt.in.center};
|
|
384
|
-
`,
|
|
384
|
+
`,zr=({totalSourceCount:n,uninstrumentSources:o,restartWorkloads:r})=>{const l=g(),{selectedSources:s,setSelectedSources:d}=ze(),[u,p]=i(!1),[h,m]=i(!1),f=c(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),v=()=>{d({})};return f?e(a,{children:[e(_r,{"data-id":"multi-source-control",children:[t(B,{children:"Selected sources"}),t(Fe,{label:f,filled:!0}),t(I,{orientation:"vertical",length:"16px"}),t(_e,{variant:"tertiary",onClick:v,children:t(B,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(_e,{variant:"tertiary",onClick:()=>m(!0),children:[t(mi,{}),t(B,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(_e,{variant:"tertiary",onClick:()=>p(!0),children:[t(ti,{}),t(B,{family:"secondary",decoration:"underline",color:l.text.error,children:"Uninstrument"})]})]}),t(G,{isOpen:u,name:`${f} sources`,type:J.Source,isLastItem:f===n,onApprove:()=>{const e={};Object.entries(s).forEach(([t,n])=>{e[t]=n.map(e=>({...e,selected:!1}))}),o(e),p(!1),v()},onDeny:()=>p(!1)}),t(Xt,{isOpen:h,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",approveButton:{text:"Confirm",variant:ue.Warning,onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.map(e=>Zt(e)))}),r(e),v()}},denyButton:{text:"Go Back",onClick:()=>m(!1)}})]}):null},Kr=h.div`
|
|
385
385
|
position: relative;
|
|
386
386
|
width: fit-content;
|
|
387
|
-
`,
|
|
387
|
+
`,jr=h(O)`
|
|
388
388
|
gap: 12px;
|
|
389
389
|
padding: 0 12px;
|
|
390
|
-
`,
|
|
390
|
+
`,Vr=h(R)`
|
|
391
391
|
gap: 12px;
|
|
392
392
|
max-height: 400px;
|
|
393
393
|
overflow-y: auto;
|
|
394
|
-
`,
|
|
394
|
+
`,Br=h.div`
|
|
395
395
|
position: absolute;
|
|
396
396
|
bottom: 0;
|
|
397
397
|
left: 0;
|
|
@@ -400,13 +400,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
400
400
|
border-radius: 0 0 24px 24px;
|
|
401
401
|
background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
|
|
402
402
|
pointer-events: none;
|
|
403
|
-
`,
|
|
403
|
+
`,Wr=h(B)`
|
|
404
404
|
background-color: ${({theme:e})=>e.colors.orange_soft};
|
|
405
405
|
color: ${({theme:e})=>e.text.primary};
|
|
406
406
|
border-radius: 32px;
|
|
407
407
|
width: fit-content;
|
|
408
408
|
padding: 2px 8px;
|
|
409
|
-
`,
|
|
409
|
+
`,Ur=()=>{const n=g(),{notifications:i,markAsSeen:o}=qt(),a=i.filter(({hideFromHistory:e})=>!e),r=a.filter(({seen:e})=>!e),l=r.length,{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=rt({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&r.forEach(({id:e})=>o(e))}});return e(Kr,{children:[t(M,{onClick:()=>{p(0,0),d(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:n.colors.orange_og,children:t(gi,{size:18})}),e(lt,{ref:s,isOpen:c,right:u.left,maxWidth:"400px",header:e(jr,{children:[t(B,{size:20,children:"Notifications"}),!!l&&e(Wr,{size:12,family:"secondary",children:[l," new"]})]}),children:[t(Vr,{children:a.length?a.map(e=>t(Xr,{...e,onClick:()=>d(!1)},`notification-${e.id}`)):t(Oe,{title:"No notifications",subTitle:""})}),t(Br,{})]})]})},Hr=h.div`
|
|
410
410
|
display: flex;
|
|
411
411
|
align-items: flex-start;
|
|
412
412
|
gap: 12px;
|
|
@@ -420,7 +420,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
420
420
|
background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
`,
|
|
423
|
+
`,qr=h.div`
|
|
424
424
|
background-color: ${({$type:e,theme:t})=>t.text[e]+_["015"]};
|
|
425
425
|
border-radius: 8px;
|
|
426
426
|
width: 36px;
|
|
@@ -428,22 +428,22 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
428
428
|
display: flex;
|
|
429
429
|
align-items: center;
|
|
430
430
|
justify-content: center;
|
|
431
|
-
`,
|
|
431
|
+
`,Gr=h.div`
|
|
432
432
|
width: 290px;
|
|
433
|
-
`,
|
|
433
|
+
`,Yr=h.div`
|
|
434
434
|
margin-bottom: 6px;
|
|
435
|
-
`,
|
|
435
|
+
`,Jr=h.div`
|
|
436
436
|
display: flex;
|
|
437
437
|
align-items: center;
|
|
438
438
|
gap: 6px;
|
|
439
|
-
`,
|
|
439
|
+
`,Xr=({id:i,seen:o,type:a,title:r,message:l,time:s,crdType:c,target:d,onClick:u})=>{const p=g(),{formatTimeAgo:h}=en(),{onClickNotification:m}=tn(),f=!!c&&!!d,v=r?.toLowerCase().includes(oe.Delete.toLowerCase())||!1,y=Se(a,p);return e(Hr,{className:f?"click-enabled":"",onClick:()=>{f&&(u(),m({id:i,crdType:c,target:d}))},children:[t(qr,{$type:v?ue.Error:a,children:t(v?ti:y,{})}),e(Gr,{children:[t(Yr,{children:t(B,{size:14,children:l})}),e(Jr,{children:[t(B,{size:10,color:p.text.grey,children:h(s)}),!o&&e(n,{children:[t(B,{size:10,children:"·"}),t(B,{size:10,color:p.colors.orange_soft,children:"new"})]})]})]})]},`notification-${i}`)},Qr=e=>`${J.Source}-${e}-${nn.MapItem}`,Zr=(e,t,n)=>{const i=e.isVirtual,o=n?[fi]:i?[on(e)]:t?Ye(t):[vi],{priorotizedStatus:a}=i?{priorotizedStatus:void 0}:ge(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:o,isVirtual:i,status:a,aggService:e}},el=e=>!(!e||"user"!==e.otelServiceName||e.namespace||e.name||e.kind),tl=({theme:e,nodes:t,aggregatedServiceMap:n})=>{const i=[],o=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=Qr(t.graphKey),a=o.get(n);if(!a)continue;const r=a.data?.status===ue.Error;for(const a of t.connections){const l=Qr(a.targetGraphKey);o.has(l)&&i.push({id:`${n}-to-${l}`,type:"smoothstep",source:n,target:l,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Li.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})}}return i},nl=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},il=new zi,ol=`${J.Source}-user-${nn.MapItem}`,al={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},rl=h.div`
|
|
440
440
|
padding: 8px 0;
|
|
441
|
-
`,
|
|
441
|
+
`,ll=h.div`
|
|
442
442
|
display: flex;
|
|
443
443
|
gap: 12px;
|
|
444
444
|
align-items: center;
|
|
445
445
|
padding: 4px 0 4px 16px;
|
|
446
|
-
`,
|
|
446
|
+
`,sl=h.button`
|
|
447
447
|
display: flex;
|
|
448
448
|
align-items: center;
|
|
449
449
|
gap: 4px;
|
|
@@ -457,18 +457,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
457
457
|
&:hover {
|
|
458
458
|
text-decoration: underline;
|
|
459
459
|
}
|
|
460
|
-
`,
|
|
460
|
+
`,cl=h.div`
|
|
461
461
|
padding: 4px 0 8px;
|
|
462
|
-
`,
|
|
462
|
+
`,dl=({conn:n,onToggle:i,isExpanded:o})=>{const a=n.details.length>0;return t(rl,{children:e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(B,{size:14,weight:500,children:n.targetServiceName}),a&&e(sl,{onClick:i,children:[t(o?yi:bi,{size:12}),o?"hide attributes":`${n.details.length} attribute${n.details.length>1?"s":""}`]})]})})},ul=({conn:e})=>{const i=g();return t(n,{children:e.details.map(e=>t(ll,{children:t(B,{size:12,color:i.text.secondary,style:{flex:1},children:e.value})},e.value))})},pl=({connections:o,isVirtual:a,attributes:r})=>{const[l,s]=i(new Set),c=g();if(a){const i=Object.entries(r||{});return e(n,{children:[t(B,{size:12,color:c.text.info,children:"This service is not instrumented. It was detected from client-side spans of services that communicate with it."}),i.length>0&&e(n,{children:[t(cl,{style:{paddingTop:16},children:t(B,{size:11,color:c.text.info,children:"Attributes"})}),i.map(([n,i])=>e(ll,{children:[t(B,{size:12,color:c.text.secondary,children:n}),t(B,{size:12,children:i})]},n))]})]})}return o.length?e(n,{children:[t(cl,{children:t(B,{size:11,color:c.text.info,children:"Connected services"})}),o.map(n=>e("div",{children:[t(dl,{conn:n,isExpanded:l.has(n.targetGraphKey),onToggle:()=>{return e=n.targetGraphKey,void s(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});var e}}),l.has(n.targetGraphKey)&&t(ul,{conn:n}),t(I,{})]},n.targetGraphKey))]}):t(B,{size:12,color:c.text.info,children:"No outgoing connections"})},hl=({conn:i})=>{const o=g();return i?t(n,{children:i.details.length>0?e(n,{children:[t(cl,{children:t(B,{size:11,color:o.text.info,children:"Attribute breakdown"})}),i.details.map(e=>t(ll,{children:t(B,{size:12,style:{flex:1},children:e.value})},e.value))]}):t(B,{size:12,color:o.text.info,style:{padding:"8px 0"},children:"No attribute breakdown"})}):t(B,{size:12,color:o.text.info,children:"No data for this connection"})},ml=({drawerState:e,aggregatedData:n,onClose:i})=>{if(!e)return null;const o=new Map(n.map(e=>[e.graphKey,e]));let a="",r="",l=null;if("node"===e.type){const n=o.get(e.graphKey);a=n?.serviceName||e.graphKey,r=n?.isVirtual?"Virtual service (uninstrumented)":"Outgoing connections",l=t(pl,{connections:n?.connections||[],isVirtual:n?.isVirtual,attributes:n?.attributes})}else{const n=o.get(e.sourceKey),i=n?.connections.find(t=>t.targetGraphKey===e.targetKey);a=`${n?.serviceName||e.sourceKey} → ${i?.targetServiceName||e.targetKey}`,r="Connection details",l=t(hl,{conn:i})}return t(an,{isOpen:!0,width:"420px",position:"right",header:{title:a,subTitle:r,onClose:i},children:l})},gl=h.div`
|
|
463
463
|
width: 100%;
|
|
464
464
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
465
465
|
position: relative;
|
|
466
|
-
`,
|
|
466
|
+
`,fl={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},vl=`${J.Source}-`,yl=`-${nn.MapItem}`,bl=.15,Sl=({heightToRemove:n,serviceMap:a,onRefresh:r})=>{const s=g(),c=X(e=>e.sources),[u,p,h]=Pi([]),[m,v,y]=_i([]),[b,S]=i(0),[x,C]=i(null),w=l([]);w.current=u;const k=l(s);k.current=s;const T=l([]),E=l([]),$=d(()=>S(e=>e+1),[]),{activeNodeId:N,setActiveNodeType:D,setActiveNodeId:A}=rn();o(()=>{if(!N)return;const e=(t=N).startsWith(vl)&&t.endsWith(yl)?t.slice(vl.length,-yl.length):null;var t;e&&C({type:"node",graphKey:e})},[N]);const I=d((e,t)=>{const{sourceGraphKey:n,targetGraphKey:i}=t.data||{};n&&i&&(D(null),A(null),C({type:"edge",sourceKey:n,targetKey:i}))},[D,A]),R=d(()=>{C(null),D(null),A(null)},[D,A]),O=d((e,t)=>{const n=t.id;v(e=>e.map(e=>e.source===n||e.target===n?{...e,animated:!0,style:{...e.style,strokeWidth:2.5},labelStyle:{...e.labelStyle,opacity:1},labelBgStyle:{...e.labelBgStyle,opacity:1}}:{...e,style:{...e.style,opacity:bl},labelStyle:{...e.labelStyle,opacity:bl},labelBgStyle:{...e.labelBgStyle,opacity:bl}}))},[v]),M=d(()=>{v(E.current)},[v]);return o(()=>{let e=!1;const t=(e=>{const t=new Map,n=new Set,i=(e,n,i=!1)=>{let o=t.get(e);return o||(o={serviceName:n,isVirtual:i,attributes:{},connectionMap:new Map},t.set(e,o)),o},o=(e,t)=>{if(t)for(const{key:n,value:i}of t)n in e||(e[n]=i)};for(const t of e){const{graphKey:e}=nl(t.nodeId),a=i(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:r}=nl(e.nodeId);e.isVirtual&&(n.add(t),o(i(t,e.serviceName,!0).attributes,e.nodeAttributes));let l=a.connectionMap.get(t);if(l||(l={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,l)),l.totalRequests+=e.requests,e.dateTime>l.lastDateTime&&(l.lastDateTime=e.dateTime),r){const t=l.details.find(e=>e.value===r);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):l.details.push({value:r,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[o,a]of e)t.has(o)||i(o,a.targetServiceName,n.has(o));const r=[];for(const[e,{serviceName:n,isVirtual:i,attributes:o,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),r.push({graphKey:e,serviceName:n,isVirtual:i,connections:t,attributes:o})}return r.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),r})(a);T.current=t;const n=(({sources:e,aggregatedServiceMap:t})=>{const n=[],i={x:0,y:0};if(t.length&&e.length)for(const o of t){const t=Qr(o.graphKey),a=e.find(e=>o.serviceName===e.otelServiceName||o.serviceName===e.name);n.push({id:t,type:nn.MapItem,position:i,data:Zr(o,a,el(a)),measured:{width:80,height:80}})}else n.push({id:`${J.Source}-${nn.NoData}`,type:nn.NoData,position:i,data:{subTitle:f.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:t,sources:[fl].concat(c)});if(1===n.length&&n[0].id===`${J.Source}-${nn.NoData}`)return p(n),v([]),void(E.current=[]);const i=new Set(w.current.map(e=>e.id)),o=new Set(n.map(e=>e.id)),r=n.some(e=>!i.has(e.id)),l=w.current.some(e=>!o.has(e.id));if(!(r||l)){const e=new Map(w.current.map(e=>[e.id,e.position]));p(n.map(t=>({...t,position:e.get(t.id)??t.position})));const i=tl({theme:k.current,nodes:n,aggregatedServiceMap:t});return E.current=i,void v(i)}return(async(e,t,n={})=>{const i={id:"root",layoutOptions:{...al,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===ol?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},o=await il.layout(i),a=new Map;return o.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(n,tl({theme:k.current,nodes:n,aggregatedServiceMap:t})).then(({nodes:t})=>{if(e)return;p(t);const n=tl({theme:k.current,nodes:t,aggregatedServiceMap:T.current});E.current=n,v(n),$()}),()=>{e=!0}},[a,c]),o(()=>{if(!w.current.length)return;const e=tl({theme:s,nodes:w.current,aggregatedServiceMap:T.current});E.current=e,v(e)},[s]),e(gl,{$heightToRemove:n,children:[t(ln,{nodes:u,edges:m,onNodesChange:h,onEdgesChange:y,onEdgeClick:I,onNodeMouseEnter:O,onNodeMouseLeave:M,onRefresh:r,fitViewTrigger:b,zoomOnScroll:!0}),t(ml,{drawerState:x,aggregatedData:T.current,onClose:R})]})},xl=h.div`
|
|
467
467
|
width: 100%;
|
|
468
468
|
padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
|
|
469
469
|
border-radius: 16px;
|
|
470
470
|
background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+_["024"]:t.colors.dropdown_bg_2+_["040"]};
|
|
471
|
-
`,
|
|
471
|
+
`,Cl=h.div`
|
|
472
472
|
display: flex;
|
|
473
473
|
justify-content: space-between;
|
|
474
474
|
gap: 12px;
|
|
@@ -480,26 +480,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
480
480
|
background-color: ${({$withClick:e,$selected:t,theme:n})=>e&&(t?n.colors.majestic_blue+_["040"]:n.colors.dropdown_bg_2+_["080"])};
|
|
481
481
|
transition: background-color 0.3s;
|
|
482
482
|
}
|
|
483
|
-
`,
|
|
483
|
+
`,wl=h(Cl)`
|
|
484
484
|
width: calc(100% - 100px);
|
|
485
485
|
margin: 0 auto;
|
|
486
486
|
padding: 8px;
|
|
487
|
-
`,
|
|
487
|
+
`,kl=h.div`
|
|
488
488
|
position: relative;
|
|
489
489
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
490
|
-
`,
|
|
490
|
+
`,Tl=h.div`
|
|
491
491
|
position: absolute;
|
|
492
492
|
top: 6px;
|
|
493
493
|
left: 18px;
|
|
494
|
-
`,
|
|
494
|
+
`,El=h(Re)`
|
|
495
495
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
496
|
-
|
|
496
|
+
`,$l=h.div`
|
|
497
497
|
width: ${({$width:e})=>`${e||42}px`};
|
|
498
498
|
display: flex;
|
|
499
499
|
align-items: center;
|
|
500
500
|
justify-content: flex-end;
|
|
501
501
|
text-align: right;
|
|
502
|
-
`,
|
|
502
|
+
`,Nl=De(J.Namespace),Dl=({isModal:n=!1,withInstances:i=!0,loading:o,filteredNamespacesAndSources:a,selectedNamespace:r,onSelectNamespace:l,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const p=g(),{isVm:h}=ae(),{namespacesLoading:m}=X(),v=Object.entries(a||{});return v?.length?t(We,{height:n?"calc(100vh - 510px)":"calc(100vh - 310px)",gap:12,noAnimation:!0,elements:v.map(([n,a])=>{const g=s?.[n]||[],v=d?.[n]?.selected||!1,y=g.filter(({selected:e})=>e),b=g.length>0,S=r===n,x=y.length>0&&y.length===a.length,w=y.length>0&&y.length!==a.length,k=a.length>0,T=1===a.length;return l||k?e(xl,{"data-id":`namespace-${n}`,$selected:x,$isOpen:S,children:[e(Cl,{$selected:x,$withClick:!!l,onClick:()=>l?.(n),children:[e(O,{$gap:12,children:[l&&t(C,{partiallyChecked:w,value:x,onChange:e=>l(n,e)}),t(Nl,{}),t(B,{children:n})]}),e(O,{$gap:24,children:[!h&&u&&t(N,{title:f.FUTURE_APPS_TITLE,tooltip:f.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,n),flipHorizontally:!0}),t($l,{children:t(B,{size:10,color:p.text.grey,children:b?`${y.length}/${a.length}`:null})}),l&&t(St,{extend:S})]})]}),(S||!l)&&(k?e(kl,{$addPadding:!c,children:[t(Tl,{children:t(I,{orientation:"vertical",length:(T?24:34*a.length)+"px"})}),a.map(e=>{const o=y.some(({name:t})=>t===e.name);return t(Al,{withInstances:i,source:e,namespace:n,isSelected:o,onSelect:c},`source-${e.name}`)})]}):t(El,{$addPadding:!c,children:m||o?t(Pe,{}):t(Oe,{title:f.NO_SOURCES_NAMESPACE,subTitle:f.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${n}`):null})}):t(Re,{children:m||o?t(Pe,{}):t(Oe,{title:f.NO_SOURCES,subTitle:!h&&l?f.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:f.PLEASE_ADD_SOURCE})})},Al=({withInstances:n,source:i,namespace:o,isSelected:a,onSelect:r})=>{const{tier:l}=ae(),s=l!==Jt.Onprem&&!!i.kind&&sn.has(i.kind);return t(wl,{"data-id":`source-${i.name}`,$selected:!s&&a,$withClick:!s&&!!r,onClick:()=>!s&&r?.(i),style:s?{opacity:.5,cursor:"not-allowed"}:void 0,children:e(O,{$gap:12,children:[r&&t(C,{value:!s&&a,onChange:()=>!s&&r(i,o)}),e(O,{$gap:4,children:[t(B,{children:i.name}),e(B,{opacity:.8,size:10,children:[n?` • ${i.numberOfInstances||0} running instance${1!==i.numberOfInstances?"s":""}`:"",` • ${i.kind}`,s?" • Enterprise only":""]})]})]})})},Il=h.div`
|
|
503
503
|
display: flex;
|
|
504
504
|
flex-direction: column;
|
|
505
505
|
align-items: center;
|
|
@@ -508,7 +508,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
508
508
|
max-height: calc(100vh - 200px);
|
|
509
509
|
height: fit-content;
|
|
510
510
|
overflow-y: scroll;
|
|
511
|
-
`,Tl=({onEditStream:n,onEditSources:i,onEditDestinations:o,categories:a})=>{const{selectedStreamName:r}=Ze(),{configuredSources:l,configuredDestinations:s,configuredDestinationsUpdateOnly:d}=vt(),u=c(()=>Object.values(l).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[l]);return t(ce,{$isNotModal:!0,children:e(R,{$gap:12,children:[t(K,{title:f.SUMMARY,description:f.STREAM_CONFIRM}),e(El,{children:[t(ne,{title:f.STREAM_NAME,action:()=>t(cn,{onClick:n}),data:[{title:"",value:r}]}),t(ne,{title:f.SELECTED_SOURCES,titleBadge:u,action:()=>t(cn,{onClick:i}),children:t(wl,{filteredNamespacesAndSources:l,withInstances:!1})}),t(ne,{title:f.SELECTED_DESTINATIONS,titleBadge:s.length+d.length,action:()=>t(cn,{onClick:o}),children:t(or,{categories:a})})]})]})})};var $l;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}($l||($l={}));const Nl=({onClickId:e,defaultSelectedId:n,extendedNavIcons:o})=>{const{isVm:a}=ae(),[r,l]=i(n||""),s=c(()=>[{id:$l.Overview,icon:yi,selected:r===$l.Overview,onClick:()=>{l($l.Overview),e($l.Overview)},tooltip:"Overview"},...(o||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{l(e.id),e.onClick()}}))],[r]),d=c(()=>{const t=[{id:$l.Sources,icon:vi,selected:r===$l.Sources,onClick:()=>{l($l.Sources),e($l.Sources)},tooltip:"Sources"},{id:$l.Destinations,icon:bi,selected:r===$l.Destinations,onClick:()=>{l($l.Destinations),e($l.Destinations)},tooltip:"Destinations"}];return a||(t.push({id:$l.InstrumentationRules,icon:Si,selected:r===$l.InstrumentationRules,onClick:()=>{l($l.InstrumentationRules),e($l.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:$l.Actions,icon:xi,selected:r===$l.Actions,onClick:()=>{l($l.Actions),e($l.Actions)},tooltip:"Actions"})),t},[a,r]);return t(dn,{orientation:"vertical",mainIcons:s,subIcons:d})},Dl=({})=>t(M,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community",children:t(Ci,{})});function Al(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function Il(e){const t=Math.abs(e);return t>=1e9?`${Rl(e/1e9)} Bil`:t>=1e6?`${Rl(e/1e6)} Mil`:t>=1e3?`${Rl(e/1e3)}K`:String(Math.round(e))}function Rl(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Ol(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Ml(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Ll(e,t,n,i,o,a=null){if(0===e.levels.length||t<2||n<2)return null;const r=function(e){const t=[];for(let n=0;n<e.levels.length;n++){const i=e.levels[n];for(let e=0;e+3<i.length;e+=4)t.push({level:n,offset:i[e],size:i[e+1],self:i[e+2],nameIndex:i[e+3]})}return t}(e),l=a?function(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),i=new Map;for(const t of e){const e=i.get(t.level);e?e.push(t):i.set(t.level,[t])}const o=[t];for(let e=t.level+1;e<=n;e++){const t=o.filter(t=>t.level===e-1);if(0===t.length)break;const n=i.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){o.push(e);break}}return o}(r,a):r;if(0===l.length)return null;const s=a?.level??0,c=a?.offset??0,d=a?.size??e.numTicks;if(d<=0)return null;const u=a?Math.max(...l.map(e=>e.level-s))+1:e.levels.length,p=i??Number.POSITIVE_INFINITY,h=Math.max(1,Math.min(n/u,p)),m=o.trim(),g=h>8?1:0;return l.map(n=>{const i=n.level-s,o=(n.offset-c)/d*t,r=Math.max(n.size/d*t,1),l=(a?i:n.level)*h,u=Math.max(h-g,1),p=Al(e,n.nameIndex);return{...n,x:o,y:l,w:r,h:u,name:p,matchesSearch:Ml(p,m)}})}function Fl(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const i=t.v2.colors.black[500],o=[{fill:t.v2.colors.purple[300],text:i},{fill:t.v2.colors.green[300],text:i},{fill:t.v2.colors.red[300],text:i},{fill:t.v2.colors.blue[300],text:i},{fill:t.v2.colors.yellow[300],text:i}];return o[n%o.length]}var Pl;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Pl||(Pl={}));const _l=[{key:Pl.Symbol,label:"Symbol",flex:"0 0 160px"},{key:Pl.Self,label:"Self",textAlign:"right",noFilter:!0},{key:Pl.Total,label:"Total",textAlign:"right",noFilter:!0}],Kl=({rows:e})=>{const n=c(()=>e.map(e=>({cells:[{key:Pl.Symbol,rawValue:e.name},{key:Pl.Self,rawValue:Il(e.self)},{key:Pl.Total,rawValue:Il(e.total)}]})),[e]);return t(un,{variant:pn.Data,maxHeight:"calc(100vh - 340px)",columns:_l,rows:n,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:wi,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};function zl(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function jl(e,t,n){for(const i of n)if(e>=i.x&&e<i.x+i.w&&t>=i.y&&t<i.y+i.h)return i;return null}const Bl=({flamebearer:n,maxRowPx:a,searchQuery:r="",minHostHeight:s=200})=>{const p=g(),h=l(null),m=l(null),f=l({x:0,y:0}),y=l(n.numTicks),[v,b]=i({w:0,h:0}),[S,x]=i(""),[C,w]=i(null),[k,E]=i([]),T=k.length>0?k[k.length-1]:null,$=T?.size??n.numTicks;o(()=>{y.current!==n.numTicks&&(y.current=n.numTicks,E([]))},[n.numTicks]),u(()=>{const e=h.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();b({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),o(()=>{if(0===k.length)return;const e=e=>{"Escape"===e.key&&(e.preventDefault(),E(e=>e.slice(0,-1)))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[k.length]);const N=c(()=>Ll(n,v.w,v.h,a,r,T),[n,a,r,v.h,v.w,T]),D=c(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(N?.length?r.trim()?N.filter(e=>e.matchesSearch):N:[]),[N,r]),A=d(e=>{if(v.w<2||v.h<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const i=jl((e.clientX-t.left)/t.width*v.w,(e.clientY-t.top)/t.height*v.h,D);if(i){const e=Ol(i);w(e);const t=$>0?(100*i.size/$).toFixed(1):"0",o=n.numTicks>0?(100*i.size/n.numTicks).toFixed(1):"0";x(`${i.name}\ntotal ${Il(i.size)} (${t}% of view, ${o}% of profile) · self ${Il(i.self)}`)}else w(null),x("")},[D,n.numTicks,v.h,v.w,$]),I=d(e=>{A(e)},[A]),R=d(()=>{w(null),x("")},[]),O=d(e=>{f.current={x:e.clientX,y:e.clientY}},[]),M=d(e=>{const{x:t,y:n}=f.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(v.w<2||v.h<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=jl((e.clientX-i.left)/i.width*v.w,(e.clientY-i.top)/i.height*v.h,D);if(!o)return;const a=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(o);E(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(a,t)?e.slice(0,-1):[...e,a]})},[D,v.h,v.w]);u(()=>{const e=m.current;if(!e||v.w<2||v.h<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1;e.width=Math.floor(v.w*t),e.height=Math.floor(v.h*t),e.style.width=`${v.w}px`,e.style.height=`${v.h}px`;const i=e.getContext("2d");i&&(i.setTransform(t,0,0,t,0,0),i.clearRect(0,0,v.w,v.h),N?.length?function(e,t,n,i,o,a,r,l){const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=o.trim().length>0;for(const t of i){const{x:n,y:i,w:o,h:r,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Fl(s,a);e.fillStyle=p,e.fillRect(n,i,o,r),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,i+.5),e.lineTo(n+o-.5,i+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,i+.5,Math.max(o-1,0),Math.max(r-1,0));const m=zl(d,l),g=`${s} (${Il(d)}, ${m}%)`,f=a.v2.text.size.xxs,y=3,v=22,b=Math.min(f,Math.floor(r-2));if(o>=v&&b>=5){e.font=`${b}px ${a.font_family.code}, ui-monospace, monospace`,e.textBaseline="middle",e.textAlign="left",e.fillStyle=h;let t=g;for(;t.length>2&&e.measureText(t).width>o-2*y;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*y&&e.fillText(t,n+y,i+r/2)}}if(r)for(const t of i){if(Ol(t)!==r)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:i,w:o,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,i+1,Math.max(o-2,0),Math.max(a-2,0));break}}(i,v.w,v.h,N,r,p,C,n.numTicks):(i.fillStyle=p.v2.colors.silver[900],i.fillRect(0,0,v.w,v.h)))},[N,n.numTicks,C,r,v.h,v.w,p]);const L=T?Al(n,T.nameIndex):"",F=d(()=>E([]),[]),P=d(()=>E(e=>e.slice(0,-1)),[]);return e("div",{style:{flex:1,minHeight:s,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",minHeight:32,flexShrink:0,padding:"0 2px"},children:[t("div",{style:{flex:"1 1 120px",minWidth:0},children:t(hn,T?{size:mn.XXS,color:p.v2.colors.silver[200],nowrap:!0,children:`Zoomed: ${L} • ${Il($)} samples in view`}:{size:mn.XXS,color:p.v2.colors.silver[200],children:"Click a frame to zoom into its subtree (pprof-style). Click the top bar again or press Esc to step back."})}),k.length>0&&e("div",{style:{display:"flex",gap:8,flexShrink:0},children:[k.length>1&&t(gn,{variant:yn.Secondary,size:fn.S,label:"Back",onClick:P}),t(gn,{variant:yn.Secondary,size:fn.S,label:"Reset zoom",onClick:F})]})]}),t(be,{fullWidth:!0,keepAlive:!0,text:S,children:t("div",{ref:h,style:{flex:1,minWidth:0,width:"100%",height:"calc(100vh - 370px)",position:"relative"},children:t("canvas",{ref:m,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:C?"pointer":"default"},onPointerDown:O,onPointerMove:I,onPointerLeave:R,onClick:M})})})]})};var Vl;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Vl||(Vl={}));const Wl=h(R)`
|
|
511
|
+
`,Rl=({onEditStream:n,onEditSources:i,onEditDestinations:o,categories:a})=>{const{selectedStreamName:r}=Ze(),{configuredSources:l,configuredDestinations:s,configuredDestinationsUpdateOnly:d}=yt(),u=c(()=>Object.values(l).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[l]);return t(ce,{$isNotModal:!0,children:e(R,{$gap:12,children:[t(z,{title:f.SUMMARY,description:f.STREAM_CONFIRM}),e(Il,{children:[t(ne,{title:f.STREAM_NAME,action:()=>t(cn,{onClick:n}),data:[{title:"",value:r}]}),t(ne,{title:f.SELECTED_SOURCES,titleBadge:u,action:()=>t(cn,{onClick:i}),children:t(Dl,{filteredNamespacesAndSources:l,withInstances:!1})}),t(ne,{title:f.SELECTED_DESTINATIONS,titleBadge:s.length+d.length,action:()=>t(cn,{onClick:o}),children:t(dr,{categories:a})})]})]})})};var Ol;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(Ol||(Ol={}));const Ml=({onClickId:e,defaultSelectedId:n,extendedNavIcons:o})=>{const{isVm:a}=ae(),[r,l]=i(n||""),s=c(()=>[{id:Ol.Overview,icon:Si,selected:r===Ol.Overview,onClick:()=>{l(Ol.Overview),e(Ol.Overview)},tooltip:"Overview"},...(o||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{l(e.id),e.onClick()}}))],[r]),d=c(()=>{const t=[{id:Ol.Sources,icon:xi,selected:r===Ol.Sources,onClick:()=>{l(Ol.Sources),e(Ol.Sources)},tooltip:"Sources"},{id:Ol.Destinations,icon:Ci,selected:r===Ol.Destinations,onClick:()=>{l(Ol.Destinations),e(Ol.Destinations)},tooltip:"Destinations"}];return a||(t.push({id:Ol.InstrumentationRules,icon:wi,selected:r===Ol.InstrumentationRules,onClick:()=>{l(Ol.InstrumentationRules),e(Ol.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:Ol.Actions,icon:ki,selected:r===Ol.Actions,onClick:()=>{l(Ol.Actions),e(Ol.Actions)},tooltip:"Actions"})),t},[a,r]);return t(dn,{orientation:"vertical",mainIcons:s,subIcons:d})},Fl=({})=>t(M,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community",children:t(Ti,{})});function Ll(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function Pl(e){const t=Math.abs(e);return t>=1e9?`${_l(e/1e9)} Bil`:t>=1e6?`${_l(e/1e6)} Mil`:t>=1e3?`${_l(e/1e3)}K`:String(Math.round(e))}function _l(e){return e.toFixed(2).replace(/\.?0+$/,"")}function zl(e){const t=[];for(let n=0;n<e.levels.length;n++){const i=e.levels[n];for(let e=0;e+3<i.length;e+=4)t.push({level:n,offset:i[e],size:i[e+1],self:i[e+2],nameIndex:i[e+3]})}return t}function Kl(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function jl(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Vl(e,t,n,i,o,a=null){if(0===e.levels.length||t<2||n<2)return null;const r=zl(e),l=a?function(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),i=new Map;for(const t of e){const e=i.get(t.level);e?e.push(t):i.set(t.level,[t])}const o=[t];for(let e=t.level+1;e<=n;e++){const t=o.filter(t=>t.level===e-1);if(0===t.length)break;const n=i.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){o.push(e);break}}return o}(r,a):r;if(0===l.length)return null;const s=a?.level??0,c=a?.offset??0,d=a?.size??e.numTicks;if(d<=0)return null;const u=a?Math.max(...l.map(e=>e.level-s))+1:e.levels.length,p=i??Number.POSITIVE_INFINITY,h=Math.max(1,Math.min(n/u,p)),m=o.trim(),g=h>8?1:0;return l.map(n=>{const i=n.level-s,o=(n.offset-c)/d*t,r=Math.max(n.size/d*t,1),l=(a?i:n.level)*h,u=Math.max(h-g,1),p=Ll(e,n.nameIndex);return{...n,x:o,y:l,w:r,h:u,name:p,matchesSearch:jl(p,m)}})}function Bl(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const i=t.v2.colors.black[500],o=[{fill:t.v2.colors.purple[300],text:i},{fill:t.v2.colors.green[300],text:i},{fill:t.v2.colors.red[300],text:i},{fill:t.v2.colors.blue[300],text:i},{fill:t.v2.colors.yellow[300],text:i}];return o[n%o.length]}var Wl,Ul;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Wl||(Wl={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Ul||(Ul={}));const Hl=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;const ql={options:[{id:Ul.FilterOutVoid,label:"Filter out void symbols"},{id:Ul.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>{const n=e.cells.find(e=>e.key===Wl.Symbol)?.rawValue?.toString()??"",i=function(e){return e.split(" ")[0]??""}(n);if(t.includes(Ul.FilterOutVoid)&&"void"===i)return!1;if(t.includes(Ul.OnlyWithReturnValues)){if(!(n.includes(" ")&&"void"!==i&&Hl.test(i)))return!1}return!0}},Gl=({rows:e,languages:n})=>{const i=c(()=>[{key:Wl.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:n?.includes(un.Java)?ql:void 0,noFilter:!n?.includes(un.Java)},{key:Wl.Self,label:"Self",tooltip:"Samples where this function was running directly, excluding any functions it called.",textAlign:"right",noFilter:!0},{key:Wl.Total,label:"Total",tooltip:"Samples where this function appeared anywhere on the stack, including functions it called.",textAlign:"right",noFilter:!0}],[n]),o=c(()=>e.map(e=>({cells:[{key:Wl.Symbol,rawValue:e.name},{key:Wl.Self,rawValue:Pl(e.self)},{key:Wl.Total,rawValue:Pl(e.total)}]})),[e]);return t(pn,{variant:hn.Data,maxHeight:"calc(100vh - 340px)",columns:i,rows:o,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Ei,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var Yl;function Jl(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Xl(e,t,n){for(const i of n)if(e>=i.x&&e<i.x+i.w&&t>=i.y&&t<i.y+i.h)return i;return null}!function(e){e[e.Fit=1]="Fit",e[e.X2=2]="X2",e[e.X3=3]="X3",e[e.X5=5]="X5"}(Yl||(Yl={}));const Ql=({flamebearer:n,maxRowPx:a,searchQuery:r="",minHostHeight:s=200,onFullscreenChange:p})=>{const h=g(),m=l(null),f=l(null),v=l({x:0,y:0}),y=l(n.numTicks),[b,S]=i({w:0,h:0}),[x,C]=i(""),[w,k]=i(null),[T,E]=i([]),[$,N]=i(!1),[D,A]=i(Yl.Fit),I=Math.max(1,Math.floor(b.w*D)),R=T.length>0?T[T.length-1]:null,O=R?.size??n.numTicks;o(()=>{y.current!==n.numTicks&&(y.current=n.numTicks,E([]))},[n.numTicks]),u(()=>{const e=m.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();S({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),o(()=>{if(!$)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[$]),o(()=>(p?.($),()=>{$&&p?.(!1)}),[$,p]);const M=c(()=>Vl(n,I,b.h,a,r,R),[n,a,r,b.h,I,R]),F=c(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(M?.length?r.trim()?M.filter(e=>e.matchesSearch):M:[]),[M,r]),L=d(e=>{if(I<2||b.h<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const i=Xl((e.clientX-t.left)/t.width*I,(e.clientY-t.top)/t.height*b.h,F);if(i){const e=Kl(i);k(e);const t=O>0?(100*i.size/O).toFixed(1):"0",o=n.numTicks>0?(100*i.size/n.numTicks).toFixed(1):"0";C(`${i.name}\ntotal ${Pl(i.size)} (${t}% of view, ${o}% of profile) · self ${Pl(i.self)}`)}else k(null),C("")},[F,n.numTicks,b.h,I,O]),P=d(e=>{L(e)},[L]),_=d(()=>{k(null),C("")},[]),z=d(e=>{v.current={x:e.clientX,y:e.clientY}},[]),K=d(e=>{const{x:t,y:n}=v.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(I<2||b.h<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=Xl((e.clientX-i.left)/i.width*I,(e.clientY-i.top)/i.height*b.h,F);if(!o)return;const a=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(o);E(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(a,t)?e.slice(0,-1):[...e,a]})},[F,b.h,I]);u(()=>{const e=f.current;if(!e||I<2||b.h<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1;e.width=Math.floor(I*t),e.height=Math.floor(b.h*t),e.style.width=`${I}px`,e.style.height=`${b.h}px`;const i=e.getContext("2d");i&&(i.setTransform(t,0,0,t,0,0),i.clearRect(0,0,I,b.h),M?.length?function(e,t,n,i,o,a,r,l){const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=o.trim().length>0;for(const t of i){const{x:n,y:i,w:o,h:r,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Bl(s,a);e.fillStyle=p,e.fillRect(n,i,o,r),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,i+.5),e.lineTo(n+o-.5,i+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,i+.5,Math.max(o-1,0),Math.max(r-1,0));const m=Jl(d,l),g=`${s} (${Pl(d)}, ${m}%)`,f=a.v2.text.size.xxs,v=3,y=22,b=Math.min(f,Math.floor(r-2));if(o>=y&&b>=5){e.font=`${b}px ${a.font_family.code}, ui-monospace, monospace`,e.textBaseline="middle",e.textAlign="left",e.fillStyle=h;let t=g;for(;t.length>2&&e.measureText(t).width>o-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*v&&e.fillText(t,n+v,i+r/2)}}if(r)for(const t of i){if(Kl(t)!==r)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:i,w:o,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,i+1,Math.max(o-2,0),Math.max(a-2,0));break}}(i,I,b.h,M,r,h,w,n.numTicks):(i.fillStyle=h.v2.colors.silver[900],i.fillRect(0,0,I,b.h)))},[M,n.numTicks,w,r,b.h,I,h]);const j=d(()=>N(e=>!e),[]),V=n.numTicks>0?Math.max(0,Math.min(100,Math.round(O/n.numTicks*100))):100,B=c(()=>function(e,t){const n=zl(e),i=t?.offset??0,o=i+(t?.size??e.numTicks),a=(t?.level??-1)+1,r=t?.size??e.numTicks;let l=null;for(const e of n)e.level<a||e.offset<i||e.offset+e.size>o||e.size>=r||(!l||e.size>l.size||e.size===l.size&&e.level<l.level)&&(l=e);return l}(n,R),[n,R]),W=null!==B,U=T.length>0,H=R?Ll(n,R.nameIndex):"",q=d(()=>E([]),[]),G=d(()=>E(e=>e.slice(0,-1)),[]),Y=d(()=>{B&&E(e=>[...e,B])},[B]);return e("div",{style:$?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:h.v2.colors.silver[900]}:{flex:1,minHeight:s,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",minHeight:32,flexShrink:0,padding:"0 2px"},children:[t("div",{style:{flex:"1 1 120px",minWidth:0},children:t(mn,R?{size:gn.XXS,color:h.v2.colors.silver[200],nowrap:!0,children:`Zoomed: ${H} • ${Pl(O)} samples in view`}:{size:gn.XXS,color:h.v2.colors.silver[200],children:"Click a frame to zoom into its subtree (pprof-style)."})}),e("div",{style:{display:"flex",gap:8,flexShrink:0,alignItems:"center"},children:[T.length>0&&t(fn,{variant:yn.Secondary,size:vn.S,label:"Reset zoom",leftIcon:si,onClick:q}),t(fn,{variant:yn.Secondary,size:vn.S,iconSize:20,leftIcon:$i,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!U,onClick:G}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(mn,{size:gn.XXS,color:h.v2.colors.silver[200],nowrap:!0,align:"center",children:`${V}%`})}),t(fn,{variant:yn.Secondary,size:vn.S,iconSize:20,leftIcon:ri,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!W,onClick:Y}),t(bn,{size:xn.S,variant:Sn.Filled,options:[{value:Yl.Fit,label:"Fit"},{value:Yl.X2,label:"2x"},{value:Yl.X3,label:"3x"},{value:Yl.X5,label:"5x"}],selected:D,setSelected:A}),t(fn,{variant:yn.Secondary,size:vn.S,iconSize:24,leftIcon:$?Ni:Di,tooltip:$?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:j})]})]}),t(be,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:m,style:{flex:1,minWidth:0,width:"100%",height:$?"calc(100vh - 80px)":"calc(100vh - 370px)",position:"relative",overflowX:D>1?"auto":"hidden",overflowY:"hidden"},children:t("div",{style:{width:I||"100%",height:"100%",position:"relative"},children:t("canvas",{ref:f,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:w?"pointer":"default"},onPointerDown:z,onPointerMove:P,onPointerLeave:_,onClick:K})})})})]})};var Zl;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Zl||(Zl={}));const es=h(R)`
|
|
512
512
|
width: 100%;
|
|
513
513
|
min-height: 0;
|
|
514
514
|
flex: 1;
|
|
@@ -516,7 +516,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
516
516
|
overflow: hidden;
|
|
517
517
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
518
518
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
519
|
-
`,
|
|
519
|
+
`,ts=h.div`
|
|
520
520
|
display: flex;
|
|
521
521
|
align-items: center;
|
|
522
522
|
gap: 10px;
|
|
@@ -524,11 +524,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
524
524
|
padding: 12px 12px 8px;
|
|
525
525
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
526
526
|
border-radius: 16px 16px 0 0;
|
|
527
|
-
`,
|
|
527
|
+
`,ns=h(O)`
|
|
528
528
|
flex-shrink: 0;
|
|
529
529
|
align-items: center;
|
|
530
530
|
gap: 4px;
|
|
531
|
-
`,
|
|
531
|
+
`,is=h.div`
|
|
532
532
|
display: flex;
|
|
533
533
|
flex: 1;
|
|
534
534
|
align-items: stretch;
|
|
@@ -537,65 +537,65 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
537
537
|
min-height: 0;
|
|
538
538
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
539
539
|
border-radius: 0 0 16px 16px;
|
|
540
|
-
`,
|
|
540
|
+
`,os=h(R)`
|
|
541
541
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
542
542
|
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
543
543
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
544
544
|
min-width: 0;
|
|
545
545
|
min-height: 0;
|
|
546
546
|
gap: 10px;
|
|
547
|
-
`,
|
|
547
|
+
`,as=h(R)`
|
|
548
548
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
549
549
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
550
550
|
min-width: 0;
|
|
551
551
|
min-height: 0;
|
|
552
552
|
gap: 10px;
|
|
553
|
-
`,
|
|
553
|
+
`,rs=h(O)`
|
|
554
554
|
width: 100%;
|
|
555
555
|
min-height: 32px;
|
|
556
556
|
flex-shrink: 0;
|
|
557
|
-
`,
|
|
557
|
+
`,ls=h.div`
|
|
558
558
|
padding: 12px;
|
|
559
|
-
`;function
|
|
559
|
+
`;function ss(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const cs=({source:n,fetchProfilingSlots:r,enableProfiling:s,releaseProfiling:u,fetchSourceProfiling:p,onFlameFullscreenChange:h})=>{const m=g(),f={namespace:n.namespace,kind:n.kind,name:n.name},[v,y]=i(!0),[b,S]=i(null),[x,C]=i(null),[w,k]=i(0),[T,E]=i(Zl.Both),[$,N]=i(""),D=l(null),A=d(async()=>{try{const[e,t]=await Promise.all([r(),p(f)]);e&&S(e),t?.profileJson&&C(t.profileJson)}finally{k(e=>e+1)}},[r,p,n.namespace,n.kind,n.name]);o(()=>{if(!v)return;let e=!1;return(async()=>{await s(f),e||(await A(),e||(D.current=setInterval(A,3e3)))})(),()=>{e=!0,D.current&&clearInterval(D.current),u(f)}},[s,u,A,n.namespace,n.kind,n.name,v]);const I=c(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),n=t.flamebearer;return!n?.names?.length||!Array.isArray(n.levels)||"number"!=typeof n.numTicks||n.numTicks<=0?null:{flamebearer:n,units:t.metadata?.units}}catch{return null}}(x),[x]),R=c(()=>I?function(e){const t=new Map;for(let n=0;n<e.levels.length;n++){const i=e.levels[n];for(let n=0;n+3<i.length;n+=4){const o=i[n+1],a=i[n+2],r=Ll(e,i[n+3]);if(!r)continue;const l=t.get(r);(!l||o>l.total)&&t.set(r,{self:a,total:o})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(I.flamebearer):[],[I]),M=c(()=>{const e=$.trim().toLowerCase();return e?R.filter(t=>t.name.toLowerCase().includes(e)):R},[R,$]),F=T===Zl.Table||T===Zl.Both,L=T===Zl.Flame||T===Zl.Both,P=F&&L;return w<2?t(Re,{$height:"70vh",children:t(Cn,{withSpinner:!0})}):e(es,{$gap:0,$width:"100%",children:[e(ts,{children:[t(be,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(ns,{children:t(mn,{size:gn.S,weight:500,color:m.v2.colors.white[500],nowrap:!0,children:"CPU Profiling"})})}),e(O,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(wn,{value:$,onChange:N,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:m.v2.colors.silver[900],emphasizeBackgroundColor:m.v2.colors.silver[800]})}),t(bn,{size:xn.S,variant:Sn.Filled,options:[{value:Zl.Table,label:"Top table"},{value:Zl.Flame,label:"Flame graph"},{value:Zl.Both,label:"Both"}],selected:T,setSelected:E}),t(fn,v?{variant:yn.Secondary,size:vn.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(Ai,{...e,size:8,fill:m.v2.colors.green[500]})}:{variant:yn.Secondary,size:vn.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Ai,{...e,size:8,fill:m.v2.colors.red[500]})})]})]}),t(is,{$gap:F&&L?16:0,children:I?e(a,{children:[F&&e(os,{$splitWithFlame:P,children:[t(rs,{$justifyContent:"flex-end",children:t(fn,{variant:yn.Secondary,size:vn.S,label:"Download Snapshot",rightIcon:Ii,onClick:()=>{if(!x)return;const e=new Blob([x],{type:"application/json"}),t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download=`cpu-profile-${n.namespace}-${n.kind}-${n.name}.json`,i.click(),URL.revokeObjectURL(t)},disabled:!x})}),t(Gl,{rows:M,languages:n.detectedLanguages||n.containers?.map(e=>e.language)})]}),L&&e(as,{$splitWithTable:P,children:[e(rs,{$justifyContent:"space-between",children:[t(Tn,{label:I?`Total samples in view ${Pl(I.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:m.v2.colors.silver[750],textColor:m.v2.colors.silver[200],textSize:gn.XXS}),e(O,{$gap:12,children:[!v&&t(fn,{variant:yn.Secondary,size:vn.S,label:"Refresh",leftIcon:li,onClick:A}),t(En,{label:"Auto refresh",labelAlign:Nn.Left,size:$n.S,value:v,onChange:y})]})]}),t(Ql,{flamebearer:I.flamebearer,maxRowPx:22,searchQuery:$,minHostHeight:280,onFullscreenChange:h},T)]})]}):t(Re,{children:t(kn,{title:"No profile samples yet",subTitle:"Keep this tab open while the agent collects a sample."})})}),b&&t(ls,{children:t(mn,{size:gn.XXXS,color:m.v2.colors.silver[300],children:`${b.activeKeys.length} / ${b.maxSlots} profiling slots · ${ss(b.totalBytesUsed)} / ${ss(b.maxTotalBytesBudget)} budget · TTL ${b.slotTtlSeconds}s`})})]})},ds=(e,t)=>{const{name:n,kind:i,namespace:o}=e,a=[{title:f.KIND,value:i},{title:f.NAME,value:n,tooltip:"Resource name"}];return t||(a.unshift({title:f.NAMESPACE,value:o}),a.push({type:v.Divider}),a.push({type:v.CopyText,value:`kubectl get ${i} ${n} -n ${o}`.toLowerCase()})),a},us=h.div`
|
|
560
560
|
display: flex;
|
|
561
561
|
flex-direction: column;
|
|
562
562
|
gap: 24px;
|
|
563
563
|
padding: 4px;
|
|
564
|
-
`,
|
|
564
|
+
`,ps=({formData:e,handleFormChange:n})=>t(us,{children:t(k,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:e.otelServiceName,onChange:({target:{value:e}})=>n("otelServiceName",e)})}),hs=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const n=Dn(e?.status),i=ut(e?.reasonEnum),o=e?.message;return t(O,{$alignItems:"center",$justifyContent:"center",children:t(fe,{status:n,title:i,subtitle:o,withBackground:n!==ve.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},ms=({source:n,fetchSourceDescribe:a,onClickRestartPod:r})=>{const[l,s]=i(!1),[c,d]=i(null);return o(()=>{n&&a({namespace:n.namespace,name:n.name,kind:n.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):s(!0)})},[n.namespace,n.name,n.kind]),c||l?t(R,{$gap:12,children:l?t(Re,{$height:"70vh",children:t(Oe,{subTitle:"Could not fetch describe for this source"})}):c?.pods?.length?c.pods.map(({podName:i,nodeName:o,phase:a,agentInjected:l,runningLatestWorkloadRevision:s,containers:d,manifestYAML:u})=>{const h=a.status!==ue.Success||An(d)?ue.Error:ue.Success,m=[];return m.push(t(In,{value:`kubectl get pod ${i.value} -n ${c?.namespace?.value||n.namespace}`.toLowerCase()},"copy-text")),m.push(t(I,{length:"100%",margin:"0"},"divider-1")),m.push(t(Rn,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-1")),m.push(t(I,{length:"100%",margin:"0"},"divider-2")),m.push(t(Rn,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-2")),m.push(t(I,{length:"100%",margin:"0"},"divider-3")),m.push(t(Rn,{title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}},"describe-row-3")),m.push(t(I,{length:"100%",margin:"0"},"divider-4")),s?.name&&(m.push(t(Rn,{title:s.name,tooltip:s.explain||void 0,value:{status:s.status||void 0,text:s.value}},"describe-row-4")),m.push(t(I,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{m.push(t(On,{...e},`pod-container-${e.containerName.value}`))}),u&&(m.push(t(I,{length:"100%",margin:"0"},"divider-6")),m.push(t(Ki,{yaml:u},"yaml-section-card"))),t(ne,{title:`Pod: ${i.value}`,withExtend:!0,action:({hovered:o})=>e("div",{style:{position:"relative"},children:[t(fe,{status:h,title:h,withIcon:!0,withBorder:!0},"status"),o&&t(Mn,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:Fn(),label:"Restart",rightIcon:li,onClick:()=>r(c?.namespace?.value||n.namespace,i.value)}]:[]},"hover-actions")]}),children:p.toArray(m)},`pod-${i.value}`)}):t(Re,{$height:"70vh",children:t(Oe,{subTitle:"Check if you have any running pods and try again"})})}):t(Re,{$height:"70vh",children:t(Pe,{})})},gs=h(O)`
|
|
565
565
|
width: 100%;
|
|
566
566
|
align-items: center;
|
|
567
567
|
justify-content: space-between;
|
|
568
|
-
`,
|
|
568
|
+
`,fs=({source:n,fetchSourceLibraries:r})=>{const l=g(),[s,c]=i(!1),[d,u]=i(null);return o(()=>{n&&r({namespace:n.namespace,name:n.name,kind:n.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?u(Rt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):c(!0)})},[n.namespace,n.name,n.kind]),d||s?t(R,{$gap:12,children:s?t(Re,{$height:"70vh",children:t(Oe,{subTitle:"Could not fetch libraries for this source"})}):d?.length?t(ne,{title:"Instrumented Libraries",children:d.map(({name:n,healthy:i,message:o,nonIdentifyingAttributes:r},s)=>e(a,{children:[e(R,{$gap:4,$width:"100%",children:[e(gs,{$width:"100%",children:[t(B,{size:12,color:l.text.grey,children:n}),e(O,{$gap:4,children:[r.map(({key:e,value:i})=>Ln(i)&&Pn(i)&&"is_standard_lib"===e?t(fe,{status:ue.Default,title:"STANDARD",withBorder:!0},`${n}-${e}`):null),"boolean"==typeof i&&t(fe,{status:i?ue.Success:ue.Error,title:i?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),o&&t(B,{size:10,color:l.text.error,align:"right",children:o})]}),s!==d.length-1&&t(I,{length:"100%",margin:"0"})]},`library-${n}`))}):e(Re,{$height:"70vh",$gap:12,children:[t(Oe,{title:"No libraries found",subTitle:""}),t(de,{type:ue.Warning,message:"This feature is in early development, and has very limited support"})]})}):t(Re,{$height:"70vh",children:t(Pe,{})})},vs="70vh",ys=(e,t)=>e.serviceName.localeCompare(t.serviceName),bs=h(B)`
|
|
569
569
|
cursor: ${({$clickable:e})=>e?"pointer":"default"};
|
|
570
570
|
text-decoration: ${({$clickable:e})=>e?"underline":"none"};
|
|
571
571
|
&:hover {
|
|
572
572
|
opacity: ${({$clickable:e})=>e?.7:1};
|
|
573
573
|
}
|
|
574
|
-
`,
|
|
574
|
+
`,Ss=h(O)`
|
|
575
575
|
justify-content: flex-end;
|
|
576
576
|
align-items: center;
|
|
577
577
|
gap: 6px;
|
|
578
578
|
cursor: pointer;
|
|
579
|
-
`,
|
|
579
|
+
`,xs=({items:i,emptyMessage:o,keyPrefix:r,findSource:l,onNavigate:s})=>{const c=g();return i.length?t(n,{children:i.map(({serviceName:n},o)=>{const d=!!l(n);return e(a,{children:[t(bs,{size:13,color:d?c.text.secondary:c.text.grey,$clickable:d,onClick:()=>s(n),children:n}),o!==i.length-1&&t(I,{length:"100%",margin:"0"})]},`${r}-${n}`)})}):t(B,{size:13,color:c.text.grey,children:o})},Cs=({source:n,fetchPeerSources:a})=>{const r=g(),{setDrawerType:l,setDrawerEntityId:s}=W(),c=X(e=>e.sources),[u,p]=i(!1),[h,m]=i(!1),[f,v]=i(null),y=n.otelServiceName||n.name,b=d(()=>{y&&(m(!0),p(!1),a(y).then(({data:e})=>{e?.peerSources?v(e.peerSources):p(!0)}).finally(()=>m(!1)))},[y]);o(()=>{b()},[b]);const S=d(e=>c.find(t=>t.otelServiceName===e||t.name===e),[c]),x=d(e=>{const t=S(e);t&&(l(J.Source),s({namespace:t.namespace,name:t.name,kind:t.kind}))},[S,l,s]);if(!f&&!u&&h)return t(Re,{$height:vs,children:t(Pe,{})});if(u)return t(Re,{$height:vs,children:t(Oe,{subTitle:"Could not fetch peer sources"})});const C=f?.inbound?[...f.inbound].sort(ys):[],w=f?.outbound?[...f.outbound].sort(ys):[];return e(R,{$gap:12,children:[t(ne,{title:"Inbound",titleBadge:C.length,description:`Services that send requests to ${y}`,children:t(xs,{items:C,emptyMessage:"No inbound connections",keyPrefix:"inbound",findSource:S,onNavigate:x})}),t(ne,{title:"Outbound",titleBadge:w.length,description:`Services that ${y} sends requests to`,children:t(xs,{items:w,emptyMessage:"No outbound connections",keyPrefix:"outbound",findSource:S,onNavigate:x})}),e(Ss,{onClick:b,children:[t(li,{size:14}),t(B,{size:12,color:r.text.grey,decoration:"underline",children:"Refresh"})]})]})};var ws;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries",e.PeerSources="Peer Sources",e.Profiling="Profiling"}(ws||(ws={}));const ks=[zn.Deployment,zn.StatefulSet,zn.DaemonSet,zn.DeploymentConfig,zn.Rollout,zn.StaticPod],Ts=[zn.Deployment,zn.StatefulSet,zn.DaemonSet,zn.DeploymentConfig,zn.Rollout,zn.Pod],Es=[un.Python,un.Go,un.Java],$s=h.div`
|
|
580
580
|
width: 100%;
|
|
581
581
|
height: 100%;
|
|
582
582
|
max-height: calc(100vh - 220px);
|
|
583
583
|
overflow: overlay;
|
|
584
584
|
overflow-y: auto;
|
|
585
|
-
`,
|
|
585
|
+
`,Ns=h.div`
|
|
586
586
|
display: flex;
|
|
587
587
|
flex-direction: column;
|
|
588
588
|
gap: 12px;
|
|
589
|
-
`;var
|
|
589
|
+
`;var Ds;!function(e){e.Workload="Workload",e.Pod="Pod"}(Ds||(Ds={}));const As=({persistSources:a,updateSource:r,restartWorkloads:s,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,fetchPeerSources:h,restartPod:m,recoverFromRollback:g,fetchProfilingSlots:v,enableProfiling:y,releaseProfiling:b,fetchSourceProfiling:S})=>{const{isVm:x}=ae(),C=X(e=>e.sources),{selectedStreamName:w}=Ze(),{drawerType:k,drawerEntityId:T}=W(),E=c(()=>tt(C,w),[C,w]),$=l(null),N=k===J.Source,[D,A]=i(!1),[I,R]=i(!1),[O,M]=i(ws.Overview),[F,L]=i(null),[P,_]=i(!1);o(()=>{N&&T&&d(T).then(e=>L(e||null))},[N,T]);const{formData:z,handleFormChange:K,resetFormData:j,loadFormWithDrawerItem:V}=_n(),U=c(()=>{if(T)return F&&JSON.stringify(Zt(F))===JSON.stringify(Zt(T))?F:E?.find(e=>JSON.stringify(Zt(e))===JSON.stringify(Zt(T)))},[T,E,F]);o(()=>{N&&U?V(U):j()},[N,U]);const H=c(()=>{const e=U?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ve.Loading,containers:U?.containers||[]}},[U]),q=c(()=>!!U?.rollbackOccurred,[U?.rollbackOccurred]),G=c(()=>{const e=[{label:ws.Overview,onClick:()=>M(ws.Overview),selected:O===ws.Overview}];return x||(ks.includes(U?.kind)&&e.push({label:ws.Pods,onClick:()=>M(ws.Pods),selected:O===ws.Pods}),U?.containers?.some(({language:e})=>Es.includes(e))&&e.push({label:ws.Libraries,onClick:()=>M(ws.Libraries),selected:O===ws.Libraries}),e.push({label:ws.PeerSources,onClick:()=>M(ws.PeerSources),selected:O===ws.PeerSources}),v&&y&&b&&S&&e.push({label:ws.Profiling,onClick:()=>M(ws.Profiling),selected:O===ws.Profiling})),e},[O,U,x,v,y,b,S]),Y=Ts.includes(U?.kind),[Q,Z]=i({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});if(!U)return null;return e(po,{ref:$,width:P?"95vw":O===ws.Profiling?"80vw":void 0,onClose:()=>{M(ws.Overview),L(null),_(!1)},title:U.otelServiceName||U.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:jn(U.containers),isEdit:D,isFormDirty:I,onEdit:O===ws.Overview?e=>{A("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=z.otelServiceName!==U.name?z.otelServiceName:"";K("otelServiceName",e),await r(T,{...z,otelServiceName:e}),L(null),R(!1),A(!1)},onDelete:O===ws.Overview?async()=>{const{namespace:e}=U;a({[e]:[{...U,selected:!1,currentStreamName:w}]},{}),L(null),R(!1),A(!1),$.current?.closeDrawer()}:void 0,onCancel:()=>{R(!1),A(!1),K("otelServiceName",U.otelServiceName||U.name||"")},isLastItem:1===E.length,tabs:G,headerActionButtons:x?[]:Y?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>Z({openFor:Ds.Workload,workloadId:T}),children:e(n,{children:[t(mi,{}),t(B,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[O===ws.Overview?D?t($s,{children:t(ps,{formData:z,handleFormChange:(...e)=>{R(!0),K(...e),K("currentStreamName",w)}})}):e(Ns,{children:[t(hs,{workloadOdigosHealthStatus:U.workloadOdigosHealthStatus}),q&&t(de,{type:ue.Warning,message:f.ROLLBACK_OCCURRED_MESSAGE,action:{label:f.ROLLBACK_RECOVER,onClick:async()=>{await g(T);const e=await d(T);e&&L(e)}}}),t(te,{conditions:U.conditions||[]}),t(ne,{title:f.SOURCE_DETAILS,data:U?ds(U,x):[]}),t(ne,{title:x?f.DETECTED_PROCESSES:f.DETECTED_CONTAINERS,titleBadge:H.isLoading?ve.Loading:H.containers.length,description:H.description||(x?f.DETECTED_PROCESSES_DESCRIPTION:f.DETECTED_CONTAINERS_DESCRIPTION),children:H.containers.map(e=>t(Kn,{...e,callbackRuntimeOverride:e=>r(T,e)},`source-container-${e.containerName}`))}),U.manifestYAML&&t(Ki,{title:`${U.kind} YAML`,yaml:U.manifestYAML,defaultOpen:!U.instrumentationConfigYAML}),U.instrumentationConfigYAML&&t(Ki,{title:"Instrumentation Config YAML",yaml:U.instrumentationConfigYAML,defaultOpen:!U.manifestYAML})]}):O===ws.Pods?t(ms,{source:U,fetchSourceDescribe:u,onClickRestartPod:Y?(e,t)=>Z({openFor:Ds.Pod,podNamespace:e,podName:t}):void 0}):O===ws.Libraries?t(fs,{source:U,fetchSourceLibraries:p}):O===ws.PeerSources?t(Cs,{source:U,fetchPeerSources:h}):O===ws.Profiling&&v&&y&&b&&S?t(cs,{source:U,fetchProfilingSlots:v,enableProfiling:y,releaseProfiling:b,fetchSourceProfiling:S,onFlameFullscreenChange:_}):null,t(Xt,{isOpen:!!Q.openFor,title:`Rollout Restart ${Q.openFor}`,description:`Are you sure you want to rollout restart this ${Q.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:ue.Warning,onClick:()=>{Q.openFor===Ds.Workload&&Q.workloadId?s([Q.workloadId]):Q.openFor===Ds.Pod&&Q.podNamespace&&Q.podName&&m(Q.podNamespace,Q.podName),Z({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{Z({openFor:null})}}})]})},Is=h.div`
|
|
590
590
|
max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
|
|
591
591
|
width: 100%;
|
|
592
|
-
`,
|
|
592
|
+
`,Rs=r(({isModal:n,fetchNamespacesWithWorkloads:i,onClickSummary:o},a)=>{const r=g(),{isVm:l}=ae(),c=Vn({fetchNamespacesWithWorkloads:i}),{selectedSources:d,loading:u,selectedAllNamespaces:p,onSelectAllNamespaces:h,getApiSourcesPayload:m,getApiFutureAppsPayload:v,searchText:y,setSearchText:b,searchBy:S,setSearchBy:x,showSelectedOnly:C,setShowSelectedOnly:w,showRunningOnly:T,setShowRunningOnly:E}=c;s(a,()=>({getFormValues:()=>({apps:m(),futureApps:v()})}));const $=Object.values(d).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return t(ce,{$isNotModal:!n,children:e(R,{$gap:12,children:[e(R,{$gap:24,children:[o&&t(xt,{onClick:o}),t(z,{title:f.SELECT_SOURCES,badgeLabel:$,description:f.SELECT_SOURCES_DESCRIPTION}),e(O,{$justifyContent:"space-between",children:[t(Is,{$fullWidth:l,children:t(k,{placeholder:S===J.Source?f.SEARCH_SOURCES:f.SEARCH_NAMESPACES,icon:si,value:y,onChange:e=>b(e.target.value.toLowerCase())})}),!l&&t(P,{options:[{label:f.SOURCE,value:J.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:f.NAMESPACE,value:J.Namespace,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary}],selected:S,setSelected:x})]}),e(O,{$gap:36,children:[t(N,{title:f.SELECT_ALL,initialValue:p,onChange:h,disabled:u}),t(N,{title:f.ONLY_SELECTED,initialValue:C,onChange:w}),t(N,{title:f.ONLY_RUNNING_INSTANCES,initialValue:T,onChange:E})]})]}),t(I,{}),t(Dl,{isModal:n,...c})]})})});Rs.displayName=Rs.name;const Os=({fetchNamespacesWithWorkloads:e,persistSources:n})=>{const{currentModal:i,setCurrentModal:o}=re(),a=i===J.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();n(e,t),r()}},c=l(null);return U({key:"Enter",active:a},s),a?t(se,{isOpen:a,onClose:r,header:{title:"Add Source"},actionComponent:t(me,{buttons:[{label:"DONE",variant:"primary",onClick:s}]}),children:t(Rs,{ref:c,isModal:!0,fetchNamespacesWithWorkloads:e})}):null},Ms=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:f.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:f.NAMESPACE,sortable:!0}),t.push({key:"containers",title:f.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Fs=({metrics:n,maxHeight:i,maxWidth:o})=>{const a=g(),{isVm:r}=ae(),l=xe(),{selectedStreamName:s}=Ze(),u=X(e=>e.sources),p=X(e=>e.sourcesLoading),{setDrawerType:h,setDrawerEntityId:m}=W(),{selectedSources:v,setSelectedSources:y}=ze(),{progress:b}=Je(),S=c(()=>b[Xe.Instrumenting]||b[Xe.Uninstrumenting]?b[Xe.Instrumenting]?.percentage||b[Xe.Uninstrumenting]?.percentage||0:void 0,[b[Xe.Instrumenting],b[Xe.Uninstrumenting]]),x=c(()=>tt(u,s),[u,s]),w=c(()=>Co({instrumentationRules:[],sources:it(x,l),actions:[],destinations:[],searchText:l.searchText,selectedCategory:J.Source}).searchResults.find(({category:e})=>e===J.Source)?.entities||[],[x,l]),[k,T]=c(()=>{let e=0;return Object.values(v).forEach(t=>{e+=t.length}),[0!==e,e]},[v]),E=d(e=>{if(e){const e={};w.forEach(t=>{const{namespace:n}=t;e[n]?e[n].push(t):e[n]=[t]}),y(e)}else y({})},[w]),$=d(e=>{const{namespace:t,name:n,kind:i}=e,o={...v};o[t]||(o[t]=[]);const a=o[t].findIndex(e=>e.name===n&&e.kind===i);-1===a?o[t].push(e):o[t].splice(a,1),y(o)},[v]),N=c(()=>w.map(i=>{const o=Zt(i),r=Be(o),{hasErrors:l,hasWarnings:s,hasDisableds:c}=ge(i.conditions||[]),d=!!v[o.namespace]?.find(e=>e.namespace===o.namespace&&e.name===o.name&&e.kind===o.kind);return{status:l?ue.Error:s?ue.Warning:void 0,faded:c,onClick:()=>{h(J.Source),m(o)},cells:[{columnKey:"checkbox-and-icon",component:()=>e(O,{$gap:16,children:[t(C,{value:d,onChange:()=>$(i)}),t(Bn,{icons:Ye(i),id:r})]})},{columnKey:"name",value:ke(i,J.Source,{extended:!0})},{columnKey:"kind",value:i.kind,textColor:a.text.info},{columnKey:"namespace",value:i.namespace,textColor:a.text.info},{columnKey:"throughput",value:He(Pt(n,J.Source,o).throughput),textColor:a.text.info},{columnKey:"conditions",component:()=>t(So,{conditions:i.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(fe,{status:ue.Info,title:Wn(i.containers),withBorder:!0})})}]}}),[w,v,n,$]),{badge:D,badgeTooltip:A}=c(()=>w.length!==x.length?{badge:`${w.length}/${x.length}`,badgeTooltip:f.FILTERED_COUNT_TOOLTIP}:{badge:x.length,badgeTooltip:void 0},[w,x]);return e(Ee,{$maxWidth:o,children:[e($e,{children:[t(C,{partiallyChecked:k&&w?.length!==T,value:k&&w?.length===T,onChange:E,disabled:!w?.length}),t(Ne,{icon:De(J.Source),title:f.SOURCES,badge:D,badgeTooltip:A,loading:p||"number"==typeof S})]}),t(Ae,{$maxHeight:i,children:t(Ie,{columns:Ms(r),rows:N})}),"number"!=typeof S||N.length?N.length?null:t(Re,{style:{marginTop:"2rem"},children:t(Oe,{})}):e(Re,{style:{marginTop:"2rem",gap:"24px"},children:[t(Me,{width:420}),e(O,{$gap:16,children:[e(B,{color:a.text.info,children:[b[Xe.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Fe,{label:`${S}%`})]})]})]})},Ls=({expiresAt:t})=>{const n=g(),{formatTimeAgo:i}=en(),o=i(t),a=new Date(t).toDateString().split(" ").slice(1).join(" "),r=Un(t,0)?n.text.error:Un(t,6048e5)?n.text.warning:n.text.success;return e(B,{size:14,color:r,children:[o," (",a,")"]})},Ps=h.div`
|
|
593
593
|
position: relative;
|
|
594
|
-
`,
|
|
594
|
+
`,_s=({token:n,saveToken:o})=>{const{CopyButton:a}=Hn(),{formData:r,handleFormChange:l,resetFormData:s}=qn({token:n}),[c,d]=i(!1),u=()=>{d(!1),s()};return e(O,{$gap:0,children:[t(a,{value:n,size:Gn.L}),t(I,{orientation:"vertical",length:"12px"}),e(Ps,{children:[t(M,{size:32,onClick:()=>{d(!0)},children:t(oi,{})}),c&&t(Yn,{flipX:!0,clientX:36,isOpen:c,onClose:u,onSave:()=>{o(r.token).then(u)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one",children:t(k,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>l("token",e.target.value)})})]})]})},zs=({tokens:e,saveToken:n})=>t(ne,{title:"Authorization Tokens",titleBadge:e.length,data:[{type:v.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:e.map(({name:e,token:i,expiresAt:o})=>({cells:[{columnKey:"icon",icon:Ri},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(Ls,{expiresAt:o})},{columnKey:"actions",component:()=>t(_s,{token:i,saveToken:n})}]}))}}]}),Ks=({fetchDescribeOdigos:a})=>{const[r,l]=i(null);if(o(()=>{a().then(({data:e})=>l(e?.describeOdigos||null))},[]),!r)return t(Re,{children:t(Pe,{})});const s=e=>e?.name?[t(I,{},`divider-${e.name}`),t(Rn,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(Ln(e.value)?Pn(e.value)?ue.Success:ue.Error:ue.Default),text:e.value}},`describe-row-${e.name}`)]:[];return e(n,{children:[t(ne,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:r?.odigosVersion?.name,value:r?.odigosVersion?.value},{title:r?.kubernetesVersion?.name,value:r?.kubernetesVersion?.value},{title:r?.installationMethod?.name,value:r?.installationMethod?.value},{title:r?.tier?.name,value:r?.tier?.value},{title:"# of sources",value:r?.numberOfSources?.toString()},{title:"# of destinations",value:r?.numberOfDestinations?.toString()}]}),t(ne,{title:"Cluster Collector",withExtend:!0,children:Object.values(r?.clusterCollector||{}).map(s)}),t(ne,{title:"Node Collector",withExtend:!0,children:Object.values(r?.nodeCollector||{}).map(s)})]})},js=h.div`
|
|
595
595
|
display: flex;
|
|
596
596
|
flex-direction: column;
|
|
597
597
|
gap: 12px;
|
|
598
|
-
`,
|
|
598
|
+
`,Vs="System Overview",Bs=({tokens:o,saveToken:a,fetchDescribeOdigos:r})=>{const[l,s]=i(!1),c=()=>s(e=>!e);return e(n,{children:[t(M,{onClick:c,tooltip:Vs,children:t(Oi,{size:18})},Vs),t(q,{width:"750px",isOpen:l,onClose:c,header:{icons:[Oi],title:Vs},footer:{isOpen:!1},children:e(js,{children:[!!o?.length&&t(zs,{tokens:o,saveToken:a}),t(Ks,{fetchDescribeOdigos:r})]})})]})},Ws=h.div`
|
|
599
599
|
position: fixed;
|
|
600
600
|
bottom: 12px;
|
|
601
601
|
left: 12px;
|
|
@@ -604,7 +604,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
604
604
|
flex-direction: column-reverse;
|
|
605
605
|
gap: 6px;
|
|
606
606
|
max-width: 600px;
|
|
607
|
-
`,
|
|
607
|
+
`,Us=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:i}=qt(),{onClickNotification:o}=tn();return t(Ws,{children:e.filter(({dismissed:e})=>!e).map(({id:e,type:a,title:r,message:l,crdType:s,target:c})=>t(de,{id:e,type:a,title:r,message:l,action:s&&c?{label:"go to details",onClick:()=>o({id:e,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{n(e),i(e)})({id:e,asSeen:!0})},`toast-${e}`))})},Hs=h.div`
|
|
608
608
|
position: relative;
|
|
609
609
|
display: flex;
|
|
610
610
|
align-items: center;
|
|
@@ -623,7 +623,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
623
623
|
stroke: ${({theme:e})=>e.text.secondary};
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
|
-
`,
|
|
626
|
+
`,qs=h.div`
|
|
627
627
|
position: absolute;
|
|
628
628
|
top: 2px;
|
|
629
629
|
left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
|
|
@@ -633,50 +633,50 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
633
633
|
background-color: ${({theme:e})=>e.colors.border};
|
|
634
634
|
border-radius: 100%;
|
|
635
635
|
transition: all 0.3s;
|
|
636
|
-
`,
|
|
636
|
+
`,Gs=({path:e})=>t("svg",{width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),Ys=()=>{const{darkMode:n,setDarkMode:i}=Jn();return e(Hs,{onClick:()=>i(!n),children:[t(Gs,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),t(Gs,{path:"M8 15.333v-.666m-5.185-1.482.471-.471M.666 8h.667m1.482-5.185.471.47M8 1.334V.667m4.714 2.619.471-.471M14.667 8h.666m-2.619 4.714.471.471M12 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}),t(qs,{$darkMode:n})]})},Js=e=>{const{spans:t}=e,n=new Map;t.forEach(e=>{n.set(e.spanID,{...e,spans:[]})});const i=[];return t.forEach(e=>{const t=n.get(e.spanID);let o=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&n.has(t.spanID)||(o=!0)}else o=!0;if(o)i.push(t);else{const i=e.references.find(e=>"CHILD_OF"===e.refType);if(i){const e=n.get(i.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),i.sort((e,t)=>e.startTime-t.startTime)},Xs=(e,t)=>{const{tags:n}=e,i={},o=[];return n.forEach(e=>{i[e.key]=e.value}),o.push({type:v.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),o},Qs=e=>{const{logs:t}=e,n=[];return t.forEach((e,i)=>{e.fields.forEach(e=>{n.push({title:e.key,value:e.value})}),i!==t.length-1&&n.push({type:v.Divider})}),n},Zs=e=>{const{traceID:t,spanID:n,processID:i,operationName:o,duration:a,startTime:r,warnings:l}=e,s=[];return s.push({type:v.CopyText,title:"Trace ID",value:t}),s.push({type:v.CopyText,title:"Span ID",value:n}),s.push({type:v.Divider}),s.push({title:"Service",value:i}),s.push({title:"Operation",value:o}),s.push({title:"Duration",value:Xn(a)}),s.push({title:"Start time",value:new Date(r/1e3).toLocaleString()}),l.length&&(s.push({type:v.Divider}),s.push({title:"Warnings",titleIcon:Mi,value:l})),s},ec=(e,t)=>{const{tags:n}=e,i={},o=[];return n.forEach(e=>{i[e.key]=e.value}),o.push({type:v.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),o},tc=h.div`
|
|
637
637
|
display: flex;
|
|
638
638
|
flex-direction: column;
|
|
639
639
|
gap: 12px;
|
|
640
640
|
max-height: 100vh;
|
|
641
641
|
overflow-y: auto;
|
|
642
|
-
`,
|
|
642
|
+
`,nc=({span:n,process:o,onClose:a})=>{const[r,l]=i(!0),[s,c]=i(!0);return t(q,{width:"750px",isOpen:!0,onClose:a,header:{icons:[Fi],title:n.operationName},footer:{isOpen:!1},children:e(tc,{children:[t(ne,{title:"Details",data:Zs(n)}),n.logs.length>0&&t(ne,{title:"Errors",titleBadge:n.logs.length,titleIcon:Mi,data:Qs(n)}),t(ne,{title:"Tags",data:Xs(n,r),action:t(Qn,{isPrettyMode:r,setIsPrettyMode:l})}),o&&t(ne,{title:`Process (${o.serviceName})`,data:ec(o,s),action:t(Qn,{isPrettyMode:s,setIsPrettyMode:c})})]})})},ic=370,oc=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),ac=h.div`
|
|
643
643
|
display: flex;
|
|
644
644
|
align-items: center;
|
|
645
|
-
width: ${
|
|
645
|
+
width: ${ic}px;
|
|
646
646
|
background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+_["042"]:t.colors.dark_grey};
|
|
647
647
|
&:hover {
|
|
648
648
|
${({$withErrors:e,$preventHover:t,theme:n})=>!t&&`background-color: ${e?n.colors.error:n.colors.secondary+_["010"]};`}
|
|
649
649
|
cursor: ${({$preventHover:e})=>e?"default":"pointer"};
|
|
650
650
|
}
|
|
651
|
-
`,
|
|
651
|
+
`,rc=h(O)`
|
|
652
652
|
align-items: center;
|
|
653
653
|
justify-content: space-between;
|
|
654
654
|
gap: 4px;
|
|
655
655
|
padding: 12px;
|
|
656
656
|
padding-left: ${({$depth:e})=>12*e||12}px;
|
|
657
|
-
width: calc(${
|
|
658
|
-
`,
|
|
657
|
+
width: calc(${ic}px - ${({$depth:e})=>12*e}px);
|
|
658
|
+
`,lc=h(O)`
|
|
659
659
|
align-items: center;
|
|
660
660
|
gap: 4px;
|
|
661
661
|
position: absolute;
|
|
662
662
|
right: 56px;
|
|
663
663
|
width: calc(100% - ${434}px);
|
|
664
|
-
`,
|
|
664
|
+
`,sc=h.div`
|
|
665
665
|
position: absolute;
|
|
666
666
|
left: ${({$startTime:e,$minStartTime:t,$maxEndTime:n})=>(e-t)/(n-t)*100+"%"};
|
|
667
667
|
width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
|
|
668
668
|
height: 12px;
|
|
669
669
|
border-radius: 32px;
|
|
670
|
-
background-color: ${({$indexInMatrix:e})=>
|
|
671
|
-
`,
|
|
670
|
+
background-color: ${({$indexInMatrix:e})=>oc[e%oc.length]};
|
|
671
|
+
`,cc=h(B)`
|
|
672
672
|
padding-left: calc(100% + 8px);
|
|
673
673
|
font-size: 10px;
|
|
674
674
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
675
675
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
676
676
|
white-space: nowrap;
|
|
677
|
-
`,
|
|
677
|
+
`,dc=({span:n,depth:o,indexInMatrix:a,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:c,errorTooltip:d,isOpen:u,withToggle:p,onToggleOpen:h,onSelect:m})=>{const f=g(),[v,y]=i(!1),b=ic-12*o-20-(c?12:0),S=c&&(1===o||n.logs.length>0);return e(ac,{className:"span-container",$withErrors:c,$preventHover:v,onClick:m,children:[e(rc,{$depth:o,className:"span-left",children:[e(O,{$gap:4,$alignItems:"center",children:[t("div",p?{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:t(M,{onClick:e=>{e.stopPropagation(),h?.()},size:24,children:t(St,{extend:u??!1})})}:{style:{width:"24px"}}),t(ei,{maxWidth:b/2,text:n.processID,textSize:14}),t(B,{size:12,color:f.text.darker_grey,children:"•"}),t(ei,{maxWidth:b/2,text:n.operationName,textSize:12,textColor:f.text.darker_grey})]}),c&&(S?t(be,{...d,children:t(Mi,{fill:f.text.error})}):t("div",{style:{position:"relative"},children:t("div",{style:{position:"absolute",top:"-24px",right:"8px"},children:t(I,{type:ue.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5})})}))]}),t(lc,{className:"span-right",children:t(sc,{$indexInMatrix:a,$duration:n.duration,$maxDuration:r,$startTime:n.startTime,$minStartTime:l,$maxEndTime:s,children:t(cc,{children:Xn(n.duration)})})})]})},uc=({spans:n,logs:i,depth:o,indexInMatrix:a,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d})=>{const u=g();return n.map((n,p)=>{const h=n.spanID,m=c.value.includes(h),g=!!n.spans?.length,f=i.length?i:Zn(n,"spans","logs"),v=f.length>0,y=v?f.length>1?`(${f.length}) errors`:f[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,b=v?f.length>1?void 0:f[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e("div",{style:{borderBottom:1===o?`1px dotted ${u.colors.border}`:"none"},children:[t(dc,{span:n,depth:o,indexInMatrix:a+p+o,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:v,errorTooltip:{titleIcon:Mi,title:y,text:b},isOpen:m,withToggle:g,onToggleOpen:()=>c.set(e=>e.some(e=>e===h)?e.filter(e=>e!=h):[...e,h,...Zn(n,"spans","spanID")]),onSelect:()=>d.set(e=>e?.spanID===h?null:n)}),m&&g?t(uc,{spans:n.spans||[],logs:f,depth:o+1,indexInMatrix:a+p,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d}):null]},`span-${h}`)})},pc=h.div`
|
|
678
678
|
width: 100%;
|
|
679
|
-
`,
|
|
679
|
+
`,hc=h.div`
|
|
680
680
|
max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
681
681
|
overflow: auto;
|
|
682
682
|
|
|
@@ -686,22 +686,22 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
686
686
|
border-radius: 24px;
|
|
687
687
|
border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
688
688
|
position: relative;
|
|
689
|
-
`,
|
|
689
|
+
`,mc=h.div`
|
|
690
690
|
padding: 12px 12px 12px 24px;
|
|
691
|
-
width: calc(${
|
|
691
|
+
width: calc(${ic}px - 36px);
|
|
692
692
|
background-color: ${({theme:e})=>e.colors.dark_grey};
|
|
693
|
-
`,
|
|
693
|
+
`,gc=h.div`
|
|
694
694
|
width: 1px;
|
|
695
695
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
696
696
|
background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
|
|
697
697
|
|
|
698
698
|
position: absolute;
|
|
699
|
-
left: calc(${
|
|
700
|
-
`,
|
|
699
|
+
left: calc(${ic}px + ((100% - ${ic}px) / ${5}) * ${({index:e})=>e});
|
|
700
|
+
`,fc=h(B)`
|
|
701
701
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
702
702
|
font-size: 12px;
|
|
703
703
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
704
704
|
padding-top: 12px;
|
|
705
705
|
padding-left: 12px;
|
|
706
706
|
white-space: nowrap;
|
|
707
|
-
`,
|
|
707
|
+
`,vc=({heightToRemove:o,traces:a,isLoading:r})=>{const[l,s]=i([]),[d,u]=i(null),p=c(()=>Rt(a).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:Js(e)})),[a]),h=c(()=>p.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[p]),m=c(()=>{const e=p.find(e=>e.spans.some(e=>e.spanID===d?.spanID)),t=e?.processes.find(e=>e.serviceName===d?.processID);return t},[p,d]);return e(n,{children:[t(pc,{$heightToRemove:o,children:r?t(Re,{$height:"50vh",children:t(Pe,{scale:1.5})}):p.length?e(hc,{$heightToRemove:o,children:[t(mc,{children:t(B,{children:"Service & operation"})}),new Array(5).fill(null).map((e,n)=>t(gc,{$heightToRemove:o,index:n,children:t(fc,{children:Xn(h/5*n)})},`${n}-divider`)),p.map((e,n)=>{const{spans:i}=e,o=i.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),a=i.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return t(uc,{spans:i,logs:[],depth:1,indexInMatrix:n,maxDuration:h,minStartTime:o,maxEndTime:a,openSpanIdsState:{value:l,set:s},selectedSpanState:{value:d,set:u}},`recursive-spans-${e.traceID}`)})]}):t(Re,{$height:"50vh",children:t(Oe,{title:f.NO_TRACES_FOUND,subTitle:f.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC})})}),d&&t(nc,{span:d,process:m,onClose:()=>u(null)})]})};export{fo as ActionDrawer,uo as ActionForm,yo as ActionModal,ko as ActionTable,Do as AwaitPipeline,la as ConditionDropdown,na as DataFlow,Oa as DataFlowActionsMenu,wa as DataStreamDrawer,xa as DataStreamForm,Fa as DataStreamModal,Ma as DataStreamSelectionForm,qa as DestinationDrawer,Wa as DestinationForm,sr as DestinationModal,hr as DestinationSelectionForm,gr as DestinationTable,sa as ErrorDropdown,Ir as InstrumentationRuleDrawer,Nr as InstrumentationRuleForm,Mr as InstrumentationRuleModal,Pr as InstrumentationRuleTable,pa as KindDropdown,ca as LanguageDropdown,da as MonitorDropdown,zr as MultiSourceControl,ua as NamespaceDropdown,Ol as NavIconIds,Ur as NotificationManager,po as OverviewDrawer,ha as PodsAgentInjectionStatusDropdown,Sl as ServiceMap,Rl as SetupSummary,Ml as SideNav,Fl as SlackInvite,As as SourceDrawer,ps as SourceForm,Os as SourceModal,Rs as SourceSelectionForm,Fs as SourceTable,Bs as SystemOverview,So as TableCellConditions,Us as ToastList,Ys as ToggleDarkMode,vc as TraceView};
|