@odigos/ui-kit 0.0.224 → 0.0.225
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 +17 -0
- package/DEVELOPMENT.md +27 -0
- package/Makefile +7 -0
- package/lib/chunks/index-BMJ_MZzY.js +149 -0
- package/lib/chunks/{index-Au62BabI.js → index-Dlnglk_e.js} +1 -1
- package/lib/chunks/ui-components-BqdkaDt2.js +2543 -0
- package/lib/components/_v2/autocomplete/index.d.ts +13 -3
- package/lib/components/_v2/drawer/header/index.d.ts +2 -0
- package/lib/components/_v2/drop-data/index.d.ts +1 -0
- package/lib/components/_v2/index.d.ts +1 -0
- package/lib/components/_v2/time-input/index.d.ts +24 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/sampling/index.d.ts +9 -4
- package/lib/constants/sources/index.d.ts +1 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/_drawers/index.d.ts +1 -5
- package/lib/containers/_v2/_drawers/sampling-rule-drawer/index.d.ts +50 -0
- package/lib/containers/_v2/_forms/index.d.ts +1 -5
- package/lib/containers/_v2/_forms/sampling-rule-form/index.d.ts +2 -0
- package/lib/containers/_v2/sampling-rules/converters.d.ts +9 -0
- package/lib/containers/_v2/sampling-rules/helpers.d.ts +2 -2
- package/lib/containers/_v2/sampling-rules/rules-table/index.d.ts +1 -1
- package/lib/containers/_v2/sampling-rules/toolbar/index.d.ts +1 -1
- package/lib/containers/_v2/sampling-rules/types.d.ts +1 -42
- package/lib/containers/source-drawer/profiling/index.d.ts +1 -1
- package/lib/containers/v2.js +51 -188
- package/lib/containers.js +47 -47
- package/lib/contexts/index.d.ts +1 -0
- package/lib/contexts/sampling-rules-form-context.d.ts +90 -0
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks/useScrollTo.d.ts +1 -0
- package/lib/hooks.js +1 -1
- package/lib/snippets/_v2/colored-span/index.d.ts +1 -0
- package/lib/snippets/_v2/dynamic-field/index.d.ts +3 -1
- package/lib/snippets/_v2/index.d.ts +1 -0
- package/lib/snippets/_v2/sampling-rule-form-sections/duration-errors.d.ts +13 -0
- package/lib/snippets/_v2/sampling-rule-form-sections/index.d.ts +7 -0
- package/lib/snippets/_v2/sampling-rule-form-sections/operation.d.ts +12 -0
- package/lib/snippets/_v2/sampling-rule-form-sections/percentage.d.ts +12 -0
- package/lib/snippets/_v2/sampling-rule-form-sections/preset-with-custom-input.d.ts +29 -0
- package/lib/snippets/_v2/sampling-rule-form-sections/rule-info.d.ts +12 -0
- package/lib/snippets/_v2/sampling-rule-form-sections/sampling-preview.d.ts +12 -0
- package/lib/{containers/_v2/_forms/create-sampling-rule-form/sections → snippets/_v2/sampling-rule-form-sections}/source-scope.d.ts +8 -4
- package/lib/snippets/_v2/sampling-rule-form-sections/styled.d.ts +2 -0
- package/lib/snippets/v2.js +1 -53
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/common/index.d.ts +2 -1
- package/lib/types/enum/index.d.ts +1 -0
- package/lib/types/sampling.d.ts +77 -0
- package/lib/types/sources/index.d.ts +18 -6
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/ui-components-CI2PiWkX.js +0 -2516
- package/lib/containers/_v2/_drawers/create-sampling-rule-drawer/index.d.ts +0 -20
- package/lib/containers/_v2/_drawers/edit-auto-rule-drawer/index.d.ts +0 -9
- package/lib/containers/_v2/_drawers/edit-cost-reduction-auto-rule-drawer/index.d.ts +0 -9
- package/lib/containers/_v2/_drawers/edit-highly-relevant-auto-rule-drawer/index.d.ts +0 -8
- package/lib/containers/_v2/_drawers/view-sampling-rule-drawer/index.d.ts +0 -21
- package/lib/containers/_v2/_forms/create-sampling-rule-form/context.d.ts +0 -34
- package/lib/containers/_v2/_forms/create-sampling-rule-form/converters.d.ts +0 -5
- package/lib/containers/_v2/_forms/create-sampling-rule-form/form-helpers.d.ts +0 -5
- package/lib/containers/_v2/_forms/create-sampling-rule-form/index.d.ts +0 -3
- package/lib/containers/_v2/_forms/create-sampling-rule-form/sections/duration-errors.d.ts +0 -9
- package/lib/containers/_v2/_forms/create-sampling-rule-form/sections/operation.d.ts +0 -9
- package/lib/containers/_v2/_forms/create-sampling-rule-form/sections/percentage.d.ts +0 -9
- package/lib/containers/_v2/_forms/create-sampling-rule-form/sections/rule-info.d.ts +0 -9
- package/lib/containers/_v2/_forms/create-sampling-rule-form/sections/sampling-preview.d.ts +0 -9
- package/lib/containers/_v2/_forms/create-sampling-rule-form/styled.d.ts +0 -5
- package/lib/containers/_v2/_forms/create-sampling-rule-form/types.d.ts +0 -54
- package/lib/containers/_v2/_forms/edit-auto-rule-form/context.d.ts +0 -21
- package/lib/containers/_v2/_forms/edit-auto-rule-form/index.d.ts +0 -3
- package/lib/containers/_v2/_forms/edit-cost-reduction-auto-rule-form/context.d.ts +0 -21
- package/lib/containers/_v2/_forms/edit-cost-reduction-auto-rule-form/index.d.ts +0 -3
- package/lib/containers/_v2/_forms/edit-highly-relevant-auto-rule-form/context.d.ts +0 -14
- package/lib/containers/_v2/_forms/edit-highly-relevant-auto-rule-form/index.d.ts +0 -3
- package/lib/containers/_v2/_forms/view-sampling-rule-form/context.d.ts +0 -37
- package/lib/containers/_v2/_forms/view-sampling-rule-form/index.d.ts +0 -3
- package/lib/containers/_v2/_forms/view-sampling-rule-form/reverse-converters.d.ts +0 -3
- package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/duration-errors.d.ts +0 -6
- package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/operation-details.d.ts +0 -6
- package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/percentage.d.ts +0 -6
- package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/rule-info.d.ts +0 -6
- package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/sampling-preview.d.ts +0 -6
- package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/source-scopes.d.ts +0 -6
- /package/lib/containers/_v2/{_forms/view-sampling-rule-form/footer.d.ts → _drawers/sampling-rule-drawer/view-footer.d.ts} +0 -0
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{
|
|
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{ap as f,bW as v,s as y,K as b,f as S,bX as x,bY as C,bZ as w,b_ as k,k as T,l as E,b$ as $,c0 as N,c1 as D,c2 as I,D as A,F as R,c as O,c3 as M,c4 as F,r as L,c5 as P,h as _,c6 as z,c7 as K,c8 as j,c9 as V,ca as B,cb as W,b0 as U,b8 as H,cc as q,cd as G,ce as Y,aa as X,ax as J,cf as Z,cg as Q,ch as ee,ci as te,cj as ne,ck as ie,cl as oe,a3 as ae,cm as re,cn as le,co as se,cp as ce,cq as de,Q as ue,O as pe,cr as he,cs as me,ct as ge,cu as fe,cv as ve,cw as ye,V as be,cx as Se,cy as xe,cz as Ce,cA as we,cB as ke,cC as Te,cD as Ee,cE as $e,cF as Ne,cG as De,cH as Ie,cI as Ae,b as Re,cJ as Oe,cK as Me,cL as Fe,cM as Le,bf as Pe,cN as _e,cO as ze,cP as Ke,cQ as je,cR as Ve,cS as Be,cT as We,L as Ue,cU as He,cV as qe,au as Ge,cW as Ye,aD as Xe,aE as Je,cX as Ze,E as Qe,cY as et,cZ as tt,c_ as nt,c$ as it,d0 as ot,d1 as at,d2 as rt,d3 as lt,d4 as st,d5 as ct,d6 as dt,d7 as ut,d8 as pt,a1 as ht,d9 as mt,da as gt,db as ft,dc as vt,dd as yt,de as bt,df as St,dg as xt,dh as Ct,di as wt,z as kt,M as Tt,J as Et,dj as $t,dk as Nt,dl as Dt,H as It,G as At,v as Rt,at as Ot,dm as Mt,dn as Ft,dp as Lt,dq as Pt,W as _t,Z as zt,_ as Kt,Y as jt,U as Vt,X as Bt,$ as Wt,dr as Ut,a2 as Ht,ds as qt,dt as Gt,ay as Yt,a9 as Xt,du as Jt,dv as Zt,dw as Qt,b1 as en,dx as tn,dy as nn,dz as on,aW as an,dA as rn,dB as ln,a6 as sn,dC as cn,dD as dn,dE as un,ba as pn,bb as hn,T as mn,e as gn,q as fn,B as vn,a as yn,x as bn,bN as Sn,aw as xn,as as Cn,dF as wn,N as kn,a0 as Tn,n as En,aA as $n,o as Nn,dG as Dn,dH as In,dI as An,dJ as Rn,dK as On,dL as Mn,g as Fn,dM as Ln,dN as Pn,dO as _n,dP as zn,dQ as Kn,dR as jn,dS as Vn,dT as Bn,dU as Wn,b2 as Un,u as Hn,t as qn,ar as Gn,dV as Yn,dW as Xn,dX as Jn,dY as Zn,dZ as Qn,d_ as ei}from"./chunks/ui-components-BqdkaDt2.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 Ii,DownloadIcon as Ai,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-Dlnglk_e.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,14 +7,14 @@ 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
|
-
`,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,Xi=[{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}],Ji=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[Ji],a=e[Ji]||[];return t(A,{title:"Attributes to delete",value:a,onChange:e=>n(Ji,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:Xi,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`
|
|
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,Xi=[{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}],Ji=S.AttributeNamesToDelete,Zi=S.Renames,Qi=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[Ji],a=e[Ji]||[];return t(I,{title:"Attributes to delete",value:a,onChange:e=>n(Ji,e),required:!0,errorMessage:o})},[y.RenameAttributes]:({value:e,setValue:n,formErrors:i})=>{const o=i[Zi],a=Object.entries(e[Zi]||{}).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(Zi,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:Xi,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[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(A,{}),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(I,{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(A,{})]})}},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
|
-
`,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,
|
|
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,I]=i(!1),[A,R]=i(!1),O=l(null),M=E===X.Source,F=()=>{I(!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=()=>{I(!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&&!A,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:A,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);
|
|
@@ -24,10 +24,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
24
24
|
display: flex;
|
|
25
25
|
flex-direction: column;
|
|
26
26
|
gap: 12px;
|
|
27
|
-
`,fo=({updateAction:n,deleteAction:a})=>{const{actions:r}=J(),{drawerType:s,drawerEntityId:d}=W(),u=l(null),p=s===X.Action,[h,m]=i(!1),[g,v]=i(!1),{formData:y,formErrors:b,handleFormChange:S,resetFormData:x,validateForm:C,loadFormWithDrawerItem:w}=
|
|
27
|
+
`,fo=({updateAction:n,deleteAction:a})=>{const{actions:r}=J(),{drawerType:s,drawerEntityId:d}=W(),u=l(null),p=s===X.Action,[h,m]=i(!1),[g,v]=i(!1),{formData:y,formErrors:b,handleFormChange:S,resetFormData:x,validateForm:C,loadFormWithDrawerItem:w}=Z(),k=c(()=>{if(d)return r?.find(e=>Q(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
|
-
`,yo=({createAction:n})=>{const{version:o}=ae(),{currentModal:a,setCurrentModal:r}=re(),l=a===X.Action,{formData:s,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=
|
|
30
|
+
`,yo=({createAction:n})=>{const{version:o}=ae(),{currentModal:a,setCurrentModal:r}=re(),l=a===X.Action,{formData:s,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=Z(),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(A,{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:X.Source,label:"Sources",count:l.length,entities:[]},{category:X.Action,label:"Actions",count:s.length,entities:[]},{category:X.Destination,label:"Destinations",count:c.length,entities:[]},{category:X.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===X.InstrumentationRule?r:e.category===X.Source?l:e.category===X.Action?s:e.category===X.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}=J(),{setDrawerType:s,setDrawerEntityId:d}=W(),u=c(()=>Co({instrumentationRules:[],sources:[],actions:Ce(r,a),destinations:[],searchText:a.searchText,selectedCategory:X.Action}).searchResults.find(({category:e})=>e===X.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(X.Action),d(e.id)},cells:[{columnKey:"icon",component:()=>t(we,{icon:ie(e.type)})},{columnKey:"name",value:ke(e,X.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(X.Action),title:f.ACTIONS,badge:h,badgeTooltip:m,loading:l})}),t(Ie,{$maxHeight:n,children:t(Ae,{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;
|
|
@@ -45,7 +45,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
45
45
|
text-align: center;
|
|
46
46
|
line-height: 26px;
|
|
47
47
|
color: ${({theme:e})=>e.text.info};
|
|
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!"})]})]})},
|
|
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!"})]})]})},Io=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
|
+
`,Ao=({entityType:n,description:i})=>{const{setCurrentModal:o}=re();return e(Io,{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;
|
|
@@ -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
|
-
`,Xo={[X.Source]:{subTitle:(e,t)=>t?e.kind:`${e.namespace} • ${e.kind}`,icons:e=>({icons:Ye(e),icon:De(X.Source)}),withMetrics:!0},[X.Destination]:{subTitle:e=>e.destinationType.displayName,icons:e=>Ge(e.destinationType.type),withMetrics:!0,withMonitors:!0,withActive:!0},[X.Action]:{subTitle:e=>e.type,icons:e=>({icon:ie(e.type)}),withMonitors:!0,withActive:!0},[X.InstrumentationRule]:{subTitle:e=>e.type,icons:e=>({icon:qe(e.type)}),withActive:!0},[X.Namespace]:{subTitle:()=>"",icons:()=>({icon:De(X.Namespace)})},[X.SamplingRule]:{subTitle:()=>"",icons:()=>({icon:De(X.SamplingRule)})}};function Jo(e,t,n,i){const o=
|
|
162
|
+
`,Xo={[X.Source]:{subTitle:(e,t)=>t?e.kind:`${e.namespace} • ${e.kind}`,icons:e=>({icons:Ye(e),icon:De(X.Source)}),withMetrics:!0},[X.Destination]:{subTitle:e=>e.destinationType.displayName,icons:e=>Ge(e.destinationType.type),withMetrics:!0,withMonitors:!0,withActive:!0},[X.Action]:{subTitle:e=>e.type,icons:e=>({icon:ie(e.type)}),withMonitors:!0,withActive:!0},[X.InstrumentationRule]:{subTitle:e=>e.type,icons:e=>({icon:qe(e.type)}),withActive:!0},[X.Namespace]:{subTitle:()=>"",icons:()=>({icon:De(X.Namespace)})},[X.SamplingRule]:{subTitle:()=>"",icons:()=>({icon:De(X.SamplingRule)})}};function Jo(e,t,n,i){const o=Q(e);if(!o)return null;const a=Xo[t],r=t===X.Source,l=a.withMonitors?t===X.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 Zo=({height:n,entityType:a,entities:r,metrics:l})=>{const{isVm:s}=ae(),u=a===X.Source,[p,h]=i(""),m=c(()=>{if(!l)return;const e=new Map,t=a===X.Source?l.sources:a===X.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=>Jo(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})]})},Qo=h.div`
|
|
163
163
|
width: ${({$isVm:e})=>e?"45vw":"22vw"};
|
|
164
164
|
display: flex;
|
|
165
165
|
flex-direction: column;
|
|
166
166
|
gap: 12px;
|
|
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===X.Source}),[n,i.length,l,o]),{progress:m}=Xe(),g=c(()=>h&&(m[Je.Instrumenting]||m[Je.Uninstrumenting])?m[Je.Instrumenting]?.percentage||m[Je.Uninstrumenting]?.percentage||0:void 0,[h,m[Je.Instrumenting],m[Je.Uninstrumenting]]),{selectedSources:v,setSelectedSources:y}=ze(),b=c(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]);return d&&[X.InstrumentationRule,X.Action].includes(n)?null:e(
|
|
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===X.Source}),[n,i.length,l,o]),{progress:m}=Xe(),g=c(()=>h&&(m[Je.Instrumenting]||m[Je.Uninstrumenting])?m[Je.Instrumenting]?.percentage||m[Je.Uninstrumenting]?.percentage||0:void 0,[h,m[Je.Instrumenting],m[Je.Uninstrumenting]]),{selectedSources:v,setSelectedSources:y}=ze(),b=c(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]);return d&&[X.InstrumentationRule,X.Action].includes(n)?null:e(Qo,{$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(Zo,{height:u,entityType:n,entities:i,metrics:a}):r?t(Ze,{size:3}):t(Ao,{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
|
-
`,na=({height:n,metrics:a,refetchSources:r,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:d})=>{const u=xe(),{selectedStreamName:p}=
|
|
173
|
+
`,na=({height:n,metrics:a,refetchSources:r,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:d})=>{const u=xe(),{selectedStreamName:p}=Qe(),{containerRef:h,containerHeight:m}=et(),g=J(e=>e.sources),f=J(e=>e.sourcesLoading),v=J(e=>e.destinations),y=J(e=>e.destinationsLoading),b=J(e=>e.actions),S=J(e=>e.actionsLoading),x=J(e=>e.instrumentationRules),C=J(e=>e.instrumentationRulesLoading),w=c(()=>tt(g,p),[g,p]),k=c(()=>nt(v,p),[v,p]),[T,E]=i([]),[$,N]=i([]),[D,I]=i([]),[A,R]=i([]);return o(()=>{E(it(w,u))},[w,u]),o(()=>{N(ot(k,u))},[k,u]),o(()=>{I(Ce(b,u))},[b,u]),o(()=>{R(x)},[x]),e(ta,{ref:h,$height:n,children:[t(ea,{entityType:X.InstrumentationRule,entities:A,unfilteredCount:x.length,loading:C,maxHeight:m,refetch:d}),t(ea,{entityType:X.Source,entities:T,unfilteredCount:w.length,metrics:a,loading:f,maxHeight:m,refetch:r}),t(ea,{entityType:X.Action,entities:D,unfilteredCount:b.length,loading:S,maxHeight:m,refetch:s}),t(ea,{entityType:X.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`
|
|
@@ -188,7 +188,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
188
188
|
display: flex;
|
|
189
189
|
align-items: center;
|
|
190
190
|
overflow-x: scroll;
|
|
191
|
-
`,aa=({onClose:n})=>{const r=g(),{onClickNode:l}=at(),{searchText:s}=xe(),{selectedStreamName:d}=
|
|
191
|
+
`,aa=({onClose:n})=>{const r=g(),{onClickNode:l}=at(),{searchText:s}=xe(),{selectedStreamName:d}=Qe(),{popupRef:u,popupOpen:p,setPopupOpen:h,popupPosition:m,handlePosition:f}=rt(),v=J(e=>e.sources),y=J(e=>e.destinations),b=J(e=>e.actions),S=J(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=Q(e);l(null,{data:{type:i,id:t}}),n()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"},`entity-${c}-${o}`))]}),t(A,{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(e=>{const n=e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language;n&&(t.find(e=>e.id===n)||t.push({id:n,value:ht[n]||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})},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;
|
|
@@ -200,18 +200,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
200
200
|
${({$color:e})=>`color: ${e};`}
|
|
201
201
|
`,va=h.div`
|
|
202
202
|
margin-left: auto;
|
|
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=J(e=>e.sources),r=J(e=>e.namespaces),{selectedStreamName:s}=
|
|
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=J(e=>e.sources),r=J(e=>e.namespaces),{selectedStreamName:s}=Qe(),{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:I}=xe(),A=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,I());$(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(I()),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:A,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:A,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:A,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:A,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:A,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
|
-
`,xa=({formData:n,handleFormChange:i,formErrors:o,editingStreamName:a})=>{const{dataStreams:r,selectedStreamName:l}=
|
|
208
|
+
`,xa=({formData:n,handleFormChange:i,formErrors:o,editingStreamName:a})=>{const{dataStreams:r,selectedStreamName:l}=Qe(),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
|
-
`,wa=({isOpen:e,onClose:n,dataStreamName:o,updateDataStream:a})=>{const{dataStreams:r}=
|
|
214
|
+
`,wa=({isOpen:e,onClose:n,dataStreamName:o,updateDataStream:a})=>{const{dataStreams:r}=Qe(),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};
|
|
@@ -229,7 +229,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
229
229
|
width: 100%;
|
|
230
230
|
`,Da=h.div`
|
|
231
231
|
width: 100%;
|
|
232
|
-
`,
|
|
232
|
+
`,Ia=({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}=Qe(),[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(A,{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})]})},Aa=h.div`
|
|
233
233
|
display: flex;
|
|
234
234
|
align-items: center;
|
|
235
235
|
margin: 20px 0;
|
|
@@ -237,7 +237,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
237
237
|
gap: 8px;
|
|
238
238
|
`,Ra=h.div`
|
|
239
239
|
margin-left: auto;
|
|
240
|
-
`,Oa=({addEntity:n,preventSearchPopup:i,onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r})=>{const{isVm:l}=ae(),{setCurrentModal:s}=re();return e(
|
|
240
|
+
`,Oa=({addEntity:n,preventSearchPopup:i,onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r})=>{const{isVm:l}=ae(),{setCurrentModal:s}=re();return e(Aa,{children:[!l&&t(Ia,{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}=Qe(),{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}=Qe(),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(I,{...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,7 +251,7 @@ 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
|
-
`,za=({destination:n,validateForm:o,status:a,testConnection:r,onSuccess:l,onError:s})=>{const c=g(),{selectedStreamName:d}=
|
|
254
|
+
`,za=({destination:n,validateForm:o,status:a,testConnection:r,onSuccess:l,onError:s})=>{const c=g(),{selectedStreamName:d}=Qe(),[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`
|
|
@@ -262,7 +262,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
262
262
|
justify-content: space-between;
|
|
263
263
|
`,Ba=h(B)`
|
|
264
264
|
margin-bottom: 12px;
|
|
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
|
|
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 I=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(A,{})]}),e(Va,{children:[t(j,{title:n?"":"This connection will monitor:",required:!0,allowedSignals:I,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);
|
|
@@ -272,11 +272,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
272
272
|
display: flex;
|
|
273
273
|
flex-direction: column;
|
|
274
274
|
gap: 12px;
|
|
275
|
-
`,qa=({categories:n,updateDestination:a,deleteDestination:r,testConnection:s})=>{const{destinations:d}=J(),{selectedStreamName:u}=
|
|
275
|
+
`,qa=({categories:n,updateDestination:a,deleteDestination:r,testConnection:s})=>{const{destinations:d}=J(),{selectedStreamName:u}=Qe(),{drawerType:p,drawerEntityId:h}=W(),m=c(()=>nt(d,u),[d,u]),g=l(null),v=p===X.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:I,setDynamicFields:A}=$t({}),R=c(()=>{if(h)return m?.find(e=>Q(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:I,setDynamicFields:(...e)=>{x(!0),A(...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
|
-
`,Ya=({items:n,onSelectNew:i,onSelectConfigured:o,isLoadingForDestinationIds:a})=>{const{configuredDestinationsUpdateOnly:r}=yt();return n.map(n=>{const l=n.name===
|
|
279
|
+
`,Ya=({items:n,onSelectNew:i,onSelectConfigured:o,isLoadingForDestinationIds:a})=>{const{configuredDestinationsUpdateOnly:r}=yt();return n.map(n=>{const l=n.name===At.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=It(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}`)})},Xa=h.div`
|
|
280
280
|
display: flex;
|
|
281
281
|
flex-direction: column;
|
|
282
282
|
gap: 24px;
|
|
@@ -284,10 +284,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
284
284
|
display: flex;
|
|
285
285
|
align-items: center;
|
|
286
286
|
gap: 12px;
|
|
287
|
-
`,
|
|
287
|
+
`,Za=h.div`
|
|
288
288
|
width: 170px;
|
|
289
289
|
margin-right: 8px;
|
|
290
|
-
`,
|
|
290
|
+
`,Qa=h.div`
|
|
291
291
|
display: flex;
|
|
292
292
|
flex-direction: column;
|
|
293
293
|
align-self: stretch;
|
|
@@ -300,7 +300,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
300
300
|
}
|
|
301
301
|
`,er=h(Xa)`
|
|
302
302
|
margin-top: 80px;
|
|
303
|
-
`,tr=Object.values(
|
|
303
|
+
`,tr=Object.values(At).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}=J(),{selectedStreamName:u}=Qe(),{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:At.EXISTS,description:Ot[At.EXISTS].DESCRIPTION,icon:ui,items:or(d,u,new Set(p.concat(h).map(e=>e.id)))}),e.unshift({name:At.DETECTED,description:Ot[At.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(Xa,{children:[t(z,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(Ja,{children:[t(Za,{children:t(k,{placeholder:"Search...",icon:si,value:m,onChange:({target:{value:e}})=>g(e)})}),t(Za,{children:t(pt,{options:tr,value:f,onSelect:v,onDeselect:()=>{}})}),t(j,{title:"",selectedSignals:y,setSelectedSignals:b})]}),t(A,{}),S.length?t(Qa,{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};
|
|
@@ -309,7 +309,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
309
309
|
@media (max-width: 1050px) {
|
|
310
310
|
display: none;
|
|
311
311
|
}
|
|
312
|
-
`,sr=({isOnboarding:n,categories:o,potentialDestinations:a,createDestination:r,updateDestination:l,deleteDestination:s,testConnection:c})=>{const{destinations:d}=J(),{selectedStreamName:u}=
|
|
312
|
+
`,sr=({isOnboarding:n,categories:o,potentialDestinations:a,createDestination:r,updateDestination:l,deleteDestination:s,testConnection:c})=>{const{destinations:d}=J(),{selectedStreamName:u}=Qe(),{currentModal:p,setCurrentModal:h}=re(),{addConfiguredDestination:m,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:v,configuredDestinationsUpdateOnly:y}=yt(),b=p===X.Destination,[S,x]=i(void 0),{formData:C,formErrors:w,handleFormChange:k,resetFormData:T,validateForm:E,setYamlFields:$,dynamicFields:N,setDynamicFields:D,loadFormWithDrawerItem:I}=$t({supportedSignals:S?.supportedSignals,preLoadedFields:S?.fields}),[A,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,I(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:A}),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;
|
|
@@ -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
|
-
`,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(X.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}=
|
|
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(X.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}=Qe(),{setDrawerType:s,setDrawerEntityId:d}=W(),{destinations:u,destinationsLoading:p}=J(),h=c(()=>nt(u,l),[u,l]),m=c(()=>Co({instrumentationRules:[],sources:[],actions:[],destinations:ot(h,r),searchText:r.searchText,selectedCategory:X.Destination}).searchResults.find(({category:e})=>e===X.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(X.Destination),d(e.id)},cells:[{columnKey:"icon",component:()=>t(we,{icon:l,src:c})},{columnKey:"name",value:ke(e,X.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.destinationType.type,textColor:a.text.info},{columnKey:"throughput",value:He(Pt(n,X.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(X.Destination),title:f.DESTINATIONS,badge:y,badgeTooltip:b,loading:p})}),t(Ie,{$maxHeight:i,children:t(Ae,{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;
|
|
@@ -347,7 +347,7 @@ 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
|
-
`,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(
|
|
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(I,{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;
|
|
@@ -360,14 +360,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
360
360
|
max-height: calc(100vh - 220px);
|
|
361
361
|
overflow: overlay;
|
|
362
362
|
overflow-y: auto;
|
|
363
|
-
`,
|
|
363
|
+
`,Ir=h.div`
|
|
364
364
|
display: flex;
|
|
365
365
|
flex-direction: column;
|
|
366
366
|
gap: 12px;
|
|
367
|
-
`,
|
|
367
|
+
`,Ar=({updateInstrumentationRule:n,deleteInstrumentationRule:a})=>{const{instrumentationRules:r}=J(),{addNotification:s}=qt(),{drawerType:d,drawerEntityId:u}=W(),p=l(null),h=d===X.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=>Q(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:X.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:X.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(Ir,{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
|
-
`,Or=Yt,Mr=({createInstrumentationRule:n})=>{const{tier:o}=ae(),a=o===Xt.Onprem,{currentModal:r,setCurrentModal:l}=re(),s=r===X.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(
|
|
370
|
+
`,Or=Yt,Mr=({createInstrumentationRule:n})=>{const{tier:o}=ae(),a=o===Xt.Onprem,{currentModal:r,setCurrentModal:l}=re(),s=r===X.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(A,{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}=J(),u=c(()=>Co({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:a.searchText,selectedCategory:X.InstrumentationRule}).searchResults.find(({category:e})=>e===X.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(X.InstrumentationRule),l(e.ruleId)},cells:[{columnKey:"icon",component:()=>t(we,{icon:qe(e.type)})},{columnKey:"name",value:ke(e,X.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(X.Action),title:f.INSTRUMENTATION_RULES,badge:h,badgeTooltip:m,loading:d})}),t(Ie,{$maxHeight:n,children:t(Ae,{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%;
|
|
@@ -380,8 +380,8 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
380
380
|
border-radius: 32px;
|
|
381
381
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
382
382
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
383
|
-
animation-name: ${
|
|
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(
|
|
383
|
+
animation-name: ${Zt.in.center};
|
|
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(A,{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:X.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(Jt,{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=>Qt(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)`
|
|
@@ -436,7 +436,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
436
436
|
display: flex;
|
|
437
437
|
align-items: center;
|
|
438
438
|
gap: 6px;
|
|
439
|
-
`,Jr=({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(Xr,{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}`)},
|
|
439
|
+
`,Jr=({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(Xr,{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}`)},Zr=e=>`${X.Source}-${e}-${nn.MapItem}`,Qr=(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=Zr(t.graphKey),a=o.get(n);if(!a)continue;const r=a.data?.status===ue.Error;for(const a of t.connections){const l=Zr(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=`${X.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;
|
|
@@ -459,11 +459,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
459
459
|
}
|
|
460
460
|
`,cl=h.div`
|
|
461
461
|
padding: 4px 0 8px;
|
|
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(
|
|
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(A,{})]},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
|
-
`,fl={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},vl=`${X.Source}-`,yl=`-${nn.MapItem}`,bl=.15,Sl=({heightToRemove:n,serviceMap:a,onRefresh:r})=>{const s=g(),c=J(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:
|
|
466
|
+
`,fl={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},vl=`${X.Source}-`,yl=`-${nn.MapItem}`,bl=.15,Sl=({heightToRemove:n,serviceMap:a,onRefresh:r})=>{const s=g(),c=J(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:I}=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 A=d((e,t)=>{const{sourceGraphKey:n,targetGraphKey:i}=t.data||{};n&&i&&(D(null),I(null),C({type:"edge",sourceKey:n,targetKey:i}))},[D,I]),R=d(()=>{C(null),D(null),I(null)},[D,I]),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=Zr(o.graphKey),a=e.find(e=>o.serviceName===e.otelServiceName||o.serviceName===e.name);n.push({id:t,type:nn.MapItem,position:i,data:Qr(o,a,el(a)),measured:{width:80,height:80}})}else n.push({id:`${X.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===`${X.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:A,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;
|
|
@@ -499,7 +499,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
499
499
|
align-items: center;
|
|
500
500
|
justify-content: flex-end;
|
|
501
501
|
text-align: right;
|
|
502
|
-
`,Nl=De(X.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}=J(),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(
|
|
502
|
+
`,Nl=De(X.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}=J(),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(A,{orientation:"vertical",length:(T?24:34*a.length)+"px"})}),a.map(e=>{const o=y.some(({name:t})=>t===e.name);return t(Il,{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})})},Il=({withInstances:n,source:i,namespace:o,isSelected:a,onSelect:r})=>{const{tier:l}=ae(),s=l!==Xt.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":""]})]})]})})},Al=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
|
-
`,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 Xl(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}!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=Jl((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=Jl((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=Xl(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)`
|
|
511
|
+
`,Rl=({onEditStream:n,onEditSources:i,onEditDestinations:o,categories:a})=>{const{selectedStreamName:r}=Qe(),{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(Al,{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 Xl(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}!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 Zl=({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,I]=i(Yl.Fit),A=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,A,b.h,a,r,R),[n,a,r,b.h,A,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(A<2||b.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*A,(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,A,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(A<2||b.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*A,(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,A]);u(()=>{const e=f.current;if(!e||A<2||b.h<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1;e.width=Math.floor(A*t),e.height=Math.floor(b.h*t),e.style.width=`${A}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,A,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=Xl(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,A,b.h,M,r,h,w,n.numTicks):(i.fillStyle=h.v2.colors.silver[900],i.fillRect(0,0,A,b.h)))},[M,n.numTicks,w,r,b.h,A,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:I}),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:A||"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 Ql;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Ql||(Ql={}));const es=h(R)`
|
|
512
512
|
width: 100%;
|
|
513
513
|
min-height: 0;
|
|
514
514
|
flex: 1;
|
|
@@ -556,16 +556,16 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
556
556
|
flex-shrink: 0;
|
|
557
557
|
`,ls=h.div`
|
|
558
558
|
padding: 12px;
|
|
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(
|
|
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(Ql.Both),[$,N]=i(""),D=l(null),I=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 I(),e||(D.current=setInterval(I,3e3)))})(),()=>{e=!0,D.current&&clearInterval(D.current),u(f)}},[s,u,I,n.namespace,n.kind,n.name,v]);const A=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(()=>A?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)}(A.flamebearer):[],[A]),M=c(()=>{const e=$.trim().toLowerCase();return e?R.filter(t=>t.name.toLowerCase().includes(e)):R},[R,$]),F=T===Ql.Table||T===Ql.Both,L=T===Ql.Flame||T===Ql.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:Ql.Table,label:"Top table"},{value:Ql.Flame,label:"Flame graph"},{value:Ql.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(Ii,{...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(Ii,{...e,size:8,fill:m.v2.colors.red[500]})})]})]}),t(is,{$gap:F&&L?16:0,children:A?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:Ai,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.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"")})]}),L&&e(as,{$splitWithTable:P,children:[e(rs,{$justifyContent:"space-between",children:[t(Tn,{label:A?`Total samples in view ${Pl(A.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:I}),t(En,{label:"Auto refresh",labelAlign:Nn.Left,size:$n.S,value:v,onChange:y})]})]}),t(Zl,{flamebearer:A.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
|
-
`,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||
|
|
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||In(d)?ue.Error:ue.Success,m=[];return m.push(t(An,{value:`kubectl get pod ${i.value} -n ${c?.namespace?.value||n.namespace}`.toLowerCase()},"copy-text")),m.push(t(A,{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(A,{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(A,{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(A,{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(A,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{m.push(t(On,{...e},`pod-container-${e.containerName.value}`))}),u&&(m.push(t(A,{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
|
-
`,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(
|
|
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(A,{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 {
|
|
@@ -576,7 +576,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
576
576
|
align-items: center;
|
|
577
577
|
gap: 6px;
|
|
578
578
|
cursor: pointer;
|
|
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(
|
|
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(A,{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=J(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(X.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);
|
|
@@ -586,12 +586,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
586
586
|
display: flex;
|
|
587
587
|
flex-direction: column;
|
|
588
588
|
gap: 12px;
|
|
589
|
-
`;var Ds;!function(e){e.Workload="Workload",e.Pod="Pod"}(Ds||(Ds={}));const
|
|
589
|
+
`;var Ds;!function(e){e.Workload="Workload",e.Pod="Pod"}(Ds||(Ds={}));const Is=({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=J(e=>e.sources),{selectedStreamName:w}=Qe(),{drawerType:k,drawerEntityId:T}=W(),E=c(()=>tt(C,w),[C,w]),$=l(null),N=k===X.Source,[D,I]=i(!1),[A,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(Qt(F))===JSON.stringify(Qt(T))?F:E?.find(e=>JSON.stringify(Qt(e))===JSON.stringify(Qt(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(e=>Es.includes(e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language))&&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),[Z,Q]=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:A,onEdit:O===ws.Overview?e=>{I("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),I(!1)},onDelete:O===ws.Overview?async()=>{const{namespace:e}=U;a({[e]:[{...U,selected:!1,currentStreamName:w}]},{}),L(null),R(!1),I(!1),$.current?.closeDrawer()}:void 0,onCancel:()=>{R(!1),I(!1),K("otelServiceName",U.otelServiceName||U.name||"")},isLastItem:1===E.length,tabs:G,headerActionButtons:x?[]:Y?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>Q({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)=>Q({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(Jt,{isOpen:!!Z.openFor,title:`Rollout Restart ${Z.openFor}`,description:`Are you sure you want to rollout restart this ${Z.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:ue.Warning,onClick:()=>{Z.openFor===Ds.Workload&&Z.workloadId?s([Z.workloadId]):Z.openFor===Ds.Pod&&Z.podNamespace&&Z.podName&&m(Z.podNamespace,Z.podName),Q({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{Q({openFor:null})}}})]})},As=h.div`
|
|
590
590
|
max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
|
|
591
591
|
width: 100%;
|
|
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(
|
|
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(As,{$fullWidth:l,children:t(k,{placeholder:S===X.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:X.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:f.NAMESPACE,value:X.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(A,{}),t(Dl,{isModal:n,...c})]})})});Rs.displayName=Rs.name;const Os=({fetchNamespacesWithWorkloads:e,persistSources:n})=>{const{currentModal:i,setCurrentModal:o}=re(),a=i===X.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}=Qe(),u=J(e=>e.sources),p=J(e=>e.sourcesLoading),{setDrawerType:h,setDrawerEntityId:m}=W(),{selectedSources:v,setSelectedSources:y}=ze(),{progress:b}=Xe(),S=c(()=>b[Je.Instrumenting]||b[Je.Uninstrumenting]?b[Je.Instrumenting]?.percentage||b[Je.Uninstrumenting]?.percentage||0:void 0,[b[Je.Instrumenting],b[Je.Uninstrumenting]]),x=c(()=>tt(u,s),[u,s]),w=c(()=>Co({instrumentationRules:[],sources:it(x,l),actions:[],destinations:[],searchText:l.searchText,selectedCategory:X.Source}).searchResults.find(({category:e})=>e===X.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=Qt(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(X.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,X.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,X.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:I}=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(X.Source),title:f.SOURCES,badge:D,badgeTooltip:I,loading:p||"number"==typeof S})]}),t(Ie,{$maxHeight:i,children:t(Ae,{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[Je.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
|
-
`,_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(
|
|
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(A,{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(A,{},`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;
|
|
@@ -633,13 +633,13 @@ 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
|
-
`,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}=Xn();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})]})},Xs=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)},Js=(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},
|
|
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}=Xn();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})]})},Xs=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)},Js=(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},Zs=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},Qs=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:Jn(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
|
-
`,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:
|
|
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:Qs(n)}),n.logs.length>0&&t(ne,{title:"Errors",titleBadge:n.logs.length,titleIcon:Mi,data:Zs(n)}),t(ne,{title:"Tags",data:Js(n,r),action:t(Zn,{isPrettyMode:r,setIsPrettyMode:l})}),o&&t(ne,{title:`Process (${o.serviceName})`,data:ec(o,s),action:t(Zn,{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
645
|
width: ${ic}px;
|
|
@@ -674,7 +674,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
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
|
-
`,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(
|
|
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(A,{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:Jn(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:Qn(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,...Qn(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)`};
|
|
@@ -704,4 +704,4 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
|
|
|
704
704
|
padding-top: 12px;
|
|
705
705
|
padding-left: 12px;
|
|
706
706
|
white-space: nowrap;
|
|
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:Xs(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:Jn(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,
|
|
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:Xs(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:Jn(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,Ar 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,Is 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};
|