@odigos/ui-kit 0.0.201 → 0.0.203
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 +19 -0
- package/lib/chunks/{index-Bi_rpSHV.js → index-CmIINVHt.js} +1 -1
- package/lib/chunks/{ui-components-BxG2GlHM.js → ui-components-Ci6lJdLr.js} +3 -3
- package/lib/chunks/vendor-D99eCWta.js +1 -0
- package/lib/components/_v2/checkbox/index.d.ts +1 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/service-map/helpers/build-map-nodes.d.ts +1 -4
- package/lib/containers/service-map/helpers/elk-layout.d.ts +5 -0
- package/lib/containers/v2.js +2 -2
- package/lib/containers.js +97 -97
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +2 -1
- package/lib/chunks/vendor-DUWBN0Mg.js +0 -1
- package/lib/containers/service-map/helpers/generate-dag-positions.d.ts +0 -5
- package/lib/containers/service-map/helpers/generate-spiral-grid-position.d.ts +0 -2
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as n,useEffect as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as n,useEffect as o,Fragment as a,forwardRef as r,useRef as l,useImperativeHandle as s,useMemo as c,useCallback as d,Children as u}from"react";import p,{css as h,useTheme as m}from"styled-components";import{a5 as g,aO as y,l as v,K as f,A as b,aP as x,aQ as S,aR as $,aS as C,c as k,i as w,aT as T,aU as D,aV as N,aW as E,D as A,F,g as O,aX as I,aY as R,k as M,aZ as K,a1 as L,a_ as P,a$ as j,b0 as z,b1 as q,b2 as B,b3 as V,an as H,aA as W,b4 as _,b5 as U,b6 as J,ak as G,ar as Y,b7 as X,b8 as Z,b9 as Q,ba as ee,bb as te,bc as ie,bd as ne,be as oe,bf as ae,bg as re,bh as le,s as se,a6 as ce,bi as de,bj as ue,bk as pe,bl as he,bm as me,bn as ge,O as ye,bo as ve,bp as fe,bq as be,br as xe,bs as Se,bt as $e,bu as Ce,bv as ke,bw as we,bx as Te,by as De,bz as Ne,n as Ee,bA as Ae,bB as Fe,bC as Oe,bD as Ie,aG as Re,bE as Me,bF as Ke,bG as Le,bH as Pe,av as je,S as ze,H as qe,bI as Be,bJ as Ve,ab as He,bK as We,ai as _e,al as Ue,bL as Je,ad as Ge,bM as Ye,bN as Xe,bO as Ze,bP as Qe,bQ as et,bR as tt,bS as it,bT as nt,bU as ot,bV as at,bW as rt,bX as lt,bY as st,$ as ct,M as dt,bZ as ut,b_ as pt,b$ as ht,c0 as mt,aj as gt,c1 as yt,c2 as vt,c3 as ft,c4 as bt,x as xt,z as St,G as $t,c5 as Ct,c6 as kt,c7 as wt,E as Tt,aa as Dt,a9 as Nt,m as Et,c8 as At,c9 as Ft,ca as Ot,cb as It,P as Rt,X as Mt,Y as Kt,U as Lt,J as Pt,Q as jt,Z as zt,cc as qt,a0 as Bt,cd as Vt,ce as Ht,ae as Wt,cf as _t,cg as Ut,ch as Jt,ci as Gt,ao as Yt,cj as Xt,ck as Zt,cl as Qt,cm as ei,cn as ti,co as ii,cp as ni,cq as oi,cr as ai,cs as ri,ct as li,ax as si,cu as ci,cv as di,cw as ui,cx as pi,cy as hi,cz as mi,cA as gi,cB as yi,cC as vi,ap as fi,am as bi,a4 as xi,a8 as Si,cD as $i,cE as Ci,cF as ki,cG as wi,cH as Ti,cI as Di}from"./chunks/ui-components-Ci6lJdLr.js";import{TrashIcon as Ni,VSquareIcon as Ei,XSquareIcon as Ai,EditIcon as Fi,OdigosLogoText as Oi,PlusIcon as Ii,RefreshIcon as Ri,SearchIcon as Mi,FilterIcon as Ki,DataStreamIcon as Li,VIcon as Pi,OdigosLogo as ji,ArrowIcon as zi,RefreshLeftArrowIcon as qi,NotificationIcon as Bi,UserIcon as Vi,ImageErrorIcon as Hi,OverviewIcon as Wi,SourceIcon as _i,DestinationIcon as Ui,InstrumentationRuleIcon as Ji,ActionIcon as Gi,SlackLogo as Yi,KeyIcon as Xi,TerminalIcon as Zi,ExclamationTriangleIcon as Qi,TraceViewIcon as en}from"./icons.js";import{MarkerType as tn,useNodesState as nn,useEdgesState as on}from"@xyflow/react";import{E as an}from"./chunks/vendor-D99eCWta.js";import{Y as rn}from"./chunks/index-CmIINVHt.js";import"zustand";import"javascript-time-ago";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const ln=e=>{const{type:t,name:i,notes:n,signals:o,disabled:a,fields:{collectContainerAttributes:r,collectReplicaSetAttributes:l,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:h,attributeNamesToDelete:m,renames:b,piiCategories:x,fallbackSamplingRatio:S,samplingPercentage:$,endpointsFilters:C,servicesNameFilters:k,attributeFilters:w,urlTemplatizationRulesGroups:T}}=e,D=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!a)},{type:y.Monitors,title:g.SIGNALS_FOR_PROCESSING,value:o?.join(", ")||""},{title:g.NAME,value:i||""},{title:g.NOTES,value:n||""},{type:y.Divider}];if(t===v.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(r)}),D.push({title:"Collect ReplicaSet Attributes",value:String(l)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:y.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},o)=>{let a="";a+=`Label Key: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`From: ${n?.length?n.join(", "):i||f.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${o+1}`:""),value:a})}),u?.length&&D.push({type:y.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},o)=>{let a="";a+=`Annotation Key: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`From: ${n?.length?n.join(", "):i||f.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${o+1}`:""),value:a})})),t===v.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(h||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:i},n)=>{e+=`${t}: ${i}`,n<p.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.DeleteAttributes){let e="";m?.forEach((t,i)=>{e+=t,i<m.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.RenameAttributes){let e="";const t=Object.entries(b||{});t.forEach(([i,n],o)=>{e+=`${i}: ${n}`,o<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.PiiMasking){let e="";x?.forEach((t,i)=>{e+=t,i<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===v.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(S)}),t===v.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String($)}),t===v.LatencySampler&&C?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},o)=>{let a="";a+=`Service Name: ${e}\n`,a+=`HTTP Route: ${t}\n`,a+=`Min. Latency: ${i}\n`,a+=`Fallback Sampling Ratio: ${n}`,D.push({title:"Endpoint"+(C.length>1?` #${o+1}`:""),value:a})}),t===v.ServiceNameSampler&&k?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Sampling Ratio: ${t}\n`,o+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Filter"+(k.length>1?` #${n+1}`:""),value:o})}),t===v.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n},o)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`Fallback Sampling Ratio: ${i}\n`;const r=Object.keys(n)[0];a+=`Condition: ${r}\n`,a+=`Operation: ${n[r]?.operation}\n`,a+=`Expected Value: ${n[r]?.expectedValue}`,"jsonCondition"===r&&(a+=`\nJSON Path: ${n[r].jsonPath}`),D.push({title:"Filter"+(w.length>1?` #${o+1}`:""),value:a})}),t===v.URLTemplatization&&T?.forEach((e,t)=>{let i="";e.filterK8sNamespace&&(i+=`Namespace: ${e.filterK8sNamespace}\n`),e.workloadFilters?.length&&e.workloadFilters.forEach(e=>{const t=[e.kind,e.name].filter(Boolean).join("/");t&&(i+=`Workload: ${t}\n`)});const n=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i+=`Templates: ${n}`,e.notes&&(i+=`\nNotes: ${e.notes}`),D.push({title:"Group"+(T.length>1?` #${t+1}`:""),value:i})}),D},sn=b.PiiCategories,cn=p.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 i}from"react/jsx-runtime";import{useState
|
|
|
7
7
|
border-radius: 32px;
|
|
8
8
|
padding: 8px;
|
|
9
9
|
`}
|
|
10
|
-
`,dn=[{id:"CREDIT_CARD",label:"Credit Card"}],un=b.FallbackSamplingRatio,pn=[{value:f.Pod,id:f.Pod},{value:f.Namespace,id:f.Namespace},{value:f.Node,id:f.Node}],hn=[{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:pn,required:!0,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],mn=[{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:pn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],gn=b.EndpointsFilters,yn=[{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:k.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:k.Number}],vn=b.AttributeNamesToDelete,fn=b.Renames,bn=b.UrlTemplatizationRulesGroups,xn=[{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"}],$n=b.ServicesNameFilters,Sn=[{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:k.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:k.Number}],Cn=b.SamplingPercentage,kn=b.AttributeFilters,wn=[{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:k.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:M.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:M.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}],Tn={[v.K8sAttributes]:({value:n,setValue:o,formErrors:r})=>(a(()=>{n[b.CollectContainerAttributes]||n[b.CollectReplicaSetAttributes]||n[b.CollectWorkloadId]||n[b.CollectClusterId]||n[b.LabelsAttributes]?.length||n[b.AnnotationsAttributes]?.length||(o(b.CollectContainerAttributes,!0),o(b.CollectReplicaSetAttributes,!0),o(b.CollectWorkloadId,!0),o(b.CollectClusterId,!0),o(b.LabelsAttributes,[]),o(b.AnnotationsAttributes,[]))},[]),e(i,{children:[t($,{title:"Collect Container Attributes",value:n[b.CollectContainerAttributes]||!1,onChange:e=>o(b.CollectContainerAttributes,e),errorMessage:r[b.CollectContainerAttributes]}),t($,{title:"Collect ReplicaSet Attributes",value:n[b.CollectReplicaSetAttributes]||!1,onChange:e=>o(b.CollectReplicaSetAttributes,e),errorMessage:r[b.CollectReplicaSetAttributes]}),t($,{title:"Collect Workload ID",value:n[b.CollectWorkloadId]||!1,onChange:e=>o(b.CollectWorkloadId,e),errorMessage:r[b.CollectWorkloadId]}),t($,{title:"Collect Cluster ID",value:n[b.CollectClusterId]||!1,onChange:e=>o(b.CollectClusterId,e),errorMessage:r[b.CollectClusterId]}),t(T,{columns:hn,value:n[b.LabelsAttributes]||[],onChange:e=>o(b.LabelsAttributes,e),errorMessage:r[b.LabelsAttributes]}),t(T,{columns:mn,value:n[b.AnnotationsAttributes]||[],onChange:e=>o(b.AnnotationsAttributes,e),errorMessage:r[b.AnnotationsAttributes]})]})),[v.AddClusterInfo]:({value:n,setValue:a,formErrors:o})=>e(i,{children:[t(D,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:n[b.OverwriteExistingValues]||!1,onChange:e=>a(b.OverwriteExistingValues,e)}),t(N,{title:"Resource Attributes",value:n[b.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>a(b.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:o[b.ClusterAttributes]})]}),[v.DeleteAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=n[vn],o=e[vn]||[];return t(E,{title:"Attributes to delete",value:o,onChange:e=>i(vn,e),required:!0,errorMessage:a})},[v.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=n[fn],o=Object.entries(e[fn]||{}).map(([e,t])=>({key:e,value:t}));return t(N,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),i(fn,t)},required:!0,errorMessage:a})},[v.PiiMasking]:({value:i,setValue:o,formErrors:r})=>{const l=r[sn],s=i[sn]||[],[c,d]=n(1===s.length);return a(()=>{if(!s.length){const e=dn.map(({id:e})=>e);o(sn,e),d(1===dn.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(cn,{$hasError:!!l,children:dn.map(({id:e,label:i})=>t($,{title:i,disabled:c&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e);o(sn,i),d(1===i.length)})(e,t)},e))}),!!l&&t(S,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[un],o=e[un];return t(C,{title:"Fallback sampling ratio",required:!0,type:k.Number,min:0,max:100,value:w(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(un,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.ProbabilisticSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[Cn],o=e[Cn];return t(C,{title:"Sampling percentage",required:!0,type:k.Number,min:0,max:100,value:w(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(Cn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.LatencySampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[gn],o=e[gn]||[];return t(T,{columns:yn,value:o,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(i),fallbackSamplingRatio:Number(n)}));i(gn,t)},errorMessage:a})},[v.ServiceNameSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[$n],o=e[$n]||[];return t(T,{columns:Sn,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i($n,t)},errorMessage:a})},[v.SpanAttributeSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[kn],o=(e[kn]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n})=>{const a=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:a,operation:n[a]?.operation,expectedValue:n[a]?.expectedValue,jsonPath:n[a]?.jsonPath}});return t(T,{columns:wn,value:o,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n,operation:a,expectedValue:o,jsonPath:r})=>{const l={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(i),condition:{[n]:{operation:a,expectedValue:o}}};return r&&(l.condition[n].jsonPath=r),l});i(kn,t)},errorMessage:a,limitFieldsPerRow:3})},[v.URLTemplatization]:({value:n,setValue:a,formErrors:r})=>{const l=r[bn],s=n[bn]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(bn,e),d=(e,t)=>c(s.map((i,n)=>n===e?{...i,...t}:i));return e(i,{children:[s.map((i,n)=>e(o,{children:[t(A,{}),e(F,{$gap:12,children:[e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(x,{title:`Rule Group ${n+1}`}),s.length>1&&t(I,{size:30,onClick:()=>{return e=n,c(s.filter((t,i)=>i!==e));var e},children:t(Ni,{})})]}),t(C,{title:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:i.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(T,{title:"Workload Filters",columns:xn,value:i.workloadFilters||[],onChange:e=>d(n,{workloadFilters:e})}),t(E,{title:"Templates",required:!0,value:i.templatizationRules.map(e=>e.template),onChange:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),!!l&&t(S,{children:l})]},`url-templatization-group-${n}`)),t(R,{label:"Add Rule Group",onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(A,{})]})}},Dn=({actionType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=Tn[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},Nn=p.div`
|
|
10
|
+
`,dn=[{id:"CREDIT_CARD",label:"Credit Card"}],un=b.FallbackSamplingRatio,pn=[{value:f.Pod,id:f.Pod},{value:f.Namespace,id:f.Namespace},{value:f.Node,id:f.Node}],hn=[{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:pn,required:!0,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],mn=[{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:pn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],gn=b.EndpointsFilters,yn=[{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:k.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:k.Number}],vn=b.AttributeNamesToDelete,fn=b.Renames,bn=b.UrlTemplatizationRulesGroups,xn=[{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"}],Sn=b.ServicesNameFilters,$n=[{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:k.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:k.Number}],Cn=b.SamplingPercentage,kn=b.AttributeFilters,wn=[{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:k.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:M.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:M.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}],Tn={[v.K8sAttributes]:({value:n,setValue:a,formErrors:r})=>(o(()=>{n[b.CollectContainerAttributes]||n[b.CollectReplicaSetAttributes]||n[b.CollectWorkloadId]||n[b.CollectClusterId]||n[b.LabelsAttributes]?.length||n[b.AnnotationsAttributes]?.length||(a(b.CollectContainerAttributes,!0),a(b.CollectReplicaSetAttributes,!0),a(b.CollectWorkloadId,!0),a(b.CollectClusterId,!0),a(b.LabelsAttributes,[]),a(b.AnnotationsAttributes,[]))},[]),e(i,{children:[t(S,{title:"Collect Container Attributes",value:n[b.CollectContainerAttributes]||!1,onChange:e=>a(b.CollectContainerAttributes,e),errorMessage:r[b.CollectContainerAttributes]}),t(S,{title:"Collect ReplicaSet Attributes",value:n[b.CollectReplicaSetAttributes]||!1,onChange:e=>a(b.CollectReplicaSetAttributes,e),errorMessage:r[b.CollectReplicaSetAttributes]}),t(S,{title:"Collect Workload ID",value:n[b.CollectWorkloadId]||!1,onChange:e=>a(b.CollectWorkloadId,e),errorMessage:r[b.CollectWorkloadId]}),t(S,{title:"Collect Cluster ID",value:n[b.CollectClusterId]||!1,onChange:e=>a(b.CollectClusterId,e),errorMessage:r[b.CollectClusterId]}),t(T,{columns:hn,value:n[b.LabelsAttributes]||[],onChange:e=>a(b.LabelsAttributes,e),errorMessage:r[b.LabelsAttributes]}),t(T,{columns:mn,value:n[b.AnnotationsAttributes]||[],onChange:e=>a(b.AnnotationsAttributes,e),errorMessage:r[b.AnnotationsAttributes]})]})),[v.AddClusterInfo]:({value:n,setValue:o,formErrors:a})=>e(i,{children:[t(D,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:n[b.OverwriteExistingValues]||!1,onChange:e=>o(b.OverwriteExistingValues,e)}),t(N,{title:"Resource Attributes",value:n[b.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>o(b.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:a[b.ClusterAttributes]})]}),[v.DeleteAttributes]:({value:e,setValue:i,formErrors:n})=>{const o=n[vn],a=e[vn]||[];return t(E,{title:"Attributes to delete",value:a,onChange:e=>i(vn,e),required:!0,errorMessage:o})},[v.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const o=n[fn],a=Object.entries(e[fn]||{}).map(([e,t])=>({key:e,value:t}));return t(N,{title:"Attributes to rename",value:a,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),i(fn,t)},required:!0,errorMessage:o})},[v.PiiMasking]:({value:i,setValue:a,formErrors:r})=>{const l=r[sn],s=i[sn]||[],[c,d]=n(1===s.length);return o(()=>{if(!s.length){const e=dn.map(({id:e})=>e);a(sn,e),d(1===dn.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(cn,{$hasError:!!l,children:dn.map(({id:e,label:i})=>t(S,{title:i,disabled:c&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e);a(sn,i),d(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[un],a=e[un];return t(C,{title:"Fallback sampling ratio",required:!0,type:k.Number,min:0,max:100,value:w(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,i(un,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[v.ProbabilisticSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[Cn],a=e[Cn];return t(C,{title:"Sampling percentage",required:!0,type:k.Number,min:0,max:100,value:w(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,i(Cn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[v.LatencySampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[gn],a=e[gn]||[];return t(T,{columns:yn,value:a,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(i),fallbackSamplingRatio:Number(n)}));i(gn,t)},errorMessage:o})},[v.ServiceNameSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[Sn],a=e[Sn]||[];return t(T,{columns:$n,value:a,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i(Sn,t)},errorMessage:o})},[v.SpanAttributeSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[kn],a=(e[kn]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n})=>{const o=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:o,operation:n[o]?.operation,expectedValue:n[o]?.expectedValue,jsonPath:n[o]?.jsonPath}});return t(T,{columns:wn,value:a,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n,operation:o,expectedValue:a,jsonPath:r})=>{const l={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(i),condition:{[n]:{operation:o,expectedValue:a}}};return r&&(l.condition[n].jsonPath=r),l});i(kn,t)},errorMessage:o,limitFieldsPerRow:3})},[v.URLTemplatization]:({value:n,setValue:o,formErrors:r})=>{const l=r[bn],s=n[bn]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o(bn,e),d=(e,t)=>c(s.map((i,n)=>n===e?{...i,...t}:i));return e(i,{children:[s.map((i,n)=>e(a,{children:[t(A,{}),e(F,{$gap:12,children:[e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(x,{title:`Rule Group ${n+1}`}),s.length>1&&t(I,{size:30,onClick:()=>{return e=n,c(s.filter((t,i)=>i!==e));var e},children:t(Ni,{})})]}),t(C,{title:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:i.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(T,{title:"Workload Filters",columns:xn,value:i.workloadFilters||[],onChange:e=>d(n,{workloadFilters:e})}),t(E,{title:"Templates",required:!0,value:i.templatizationRules.map(e=>e.template),onChange:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),!!l&&t($,{children:l})]},`url-templatization-group-${n}`)),t(R,{label:"Add Rule Group",onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(A,{})]})}},Dn=({actionType:e,value:i,setValue:n,formErrors:o})=>{if(!e)return null;const a=Tn[e];return a?t(a,{value:i,setValue:n,formErrors:o}):null},Nn=p.div`
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
gap: 24px;
|
|
14
14
|
padding: 4px;
|
|
15
15
|
`,En=p(B)`
|
|
16
16
|
margin-bottom: 12px;
|
|
17
|
-
`,An=({isUpdate:i,action:n,formData:
|
|
17
|
+
`,An=({isUpdate:i,action:n,formData:o,formErrors:a,handleFormChange:r})=>{const l=m();return e(Nn,{children:[i&&e("div",{children:[t(En,{children:"Status"}),t(K,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:l.text.success+L["050"]},{icon:Ai,label:g.DISABLED,value:!0,selectedBgColor:l.text.error+L["050"]}],selected:o.disabled,setSelected:e=>r("disabled",e)})]}),!i&&t(P,{title:"",description:n.docsDescription,actionButton:t(j,{endpoint:n.docsEndpoint})}),t(z,{title:"Signals for Processing",required:!0,allowedSignals:n.allowedSignals,selectedSignals:o.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:a.signals}),!i&&t(C,{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(Dn,{actionType:n.type,value:o.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:a}),t(q,{title:"Notes",value:o.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:a.notes})]})},Fn=r(({children:o,width:a=640,title:r,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:p,isEdit:h=!1,isFormDirty:g=!1,isLastItem:y=!1,onClose:v,onEdit:f,onSave:b,onDelete:x,onCancel:S,tabs:$,headerActionButtons:C},k)=>{const w=m(),{drawerType:T,setDrawerType:D,setDrawerEntityId:N}=V();H({key:"Enter",active:h},()=>z());const[E,A]=n(!1),[F,O]=n(!1),I=l(null),R=T===G.Source,M=()=>{A(!1),O(!1)},K=()=>{M(),f&&f(!1),D(null),N(null),v?.()};s(k,()=>({closeDrawer:K}));const L=()=>{I.current?.clearTitle(),S&&S(),M()},P=()=>{const e=I.current?.isTitleDirty();g||e?O(!0):L()},j=()=>{A(!0)},z=()=>{b&&b(I.current?.getTitle()||"")},q=C||[];return f&&!h&&q.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>f(!0),children:e(i,{children:[t(Fi,{}),t(B,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),x&&!h&&q.push({"data-id":"drawer-delete",variant:"tertiary",onClick:j,children:e(i,{children:[t(Ni,{}),t(B,{color:w.text.error,size:14,family:"secondary",decoration:"underline",children:R?W.UNINSTRUMENT:W.DELETE})]})}),e(i,{children:[t(_,{isOpen:!0,onClose:h?P:K,closeOnEscape:!E&&!F,width:`${a+64}px`,header:{icons:u,iconSrcs:p,title:r,titleTooltip:c,replaceTitleWith:!d&&h?t(On,{ref:I,title:r}):void 0,actionButtons:q,tabs:$},footer:{isOpen:h,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:z,children:W.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:P,children:W.CANCEL}],rightButtons:x?[{"data-id":"drawer-delete",variant:"tertiary",onClick:j,children:e(i,{children:[t(Ni,{}),t(B,{size:14,color:w.text.error,family:"secondary",decoration:"underline",children:W.DELETE})]})}]:[]},children:o}),t(U,{isOpen:E,noOverlay:!0,name:`${T}${r?` (${r})`:""}`,type:T,isLastItem:y,onApprove:()=>{x&&x(),M()},onDeny:M}),t(J,{isOpen:F,noOverlay:!0,name:"edit mode",onApprove:L,onDeny:M})]})}),On=r(({title:e},i)=>{const[a,r]=n(e);return o(()=>{r(e)},[e]),s(i,()=>({getTitle:()=>a||e,isTitleDirty:()=>a!==e,clearTitle:()=>r(e)})),t(C,{"data-id":"title",value:a,onChange:e=>r(e.target.value)})});On.displayName=On.name,Fn.displayName=Fn.name;const In=p.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 i}from"react/jsx-runtime";import{useState
|
|
|
24
24
|
display: flex;
|
|
25
25
|
flex-direction: column;
|
|
26
26
|
gap: 12px;
|
|
27
|
-
`,Mn=({updateAction:i,deleteAction:
|
|
27
|
+
`,Mn=({updateAction:i,deleteAction:a})=>{const{actions:r}=Y(),{drawerType:s,drawerEntityId:d}=V(),u=l(null),p=s===G.Action,[h,m]=n(!1),[y,v]=n(!1),{formData:f,formErrors:b,handleFormChange:x,resetFormData:S,validateForm:$,loadFormWithDrawerItem:C}=X(),k=c(()=>{if(d)return r?.find(e=>Z(e)===d)},[d,r]);if(o(()=>{p&&k?C(k):S()},[p,k]),!k)return null;const w=Q.find(({type:e})=>e===k.type)||Q.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===k.type)||Q.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===k.type);return t(Fn,{ref:u,title:k.name||k.type,icons:[ie(k.type)],isEdit:h,isFormDirty:y,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if($({withAlert:!0,alertTitle:ne.Update})){const t=e!==k.type?e:"";x("name",t),i(d,{...f,name:t}),m(!1),v(!1)}},onDelete:()=>{a(d,k.type),m(!1),v(!1),u.current?.closeDrawer()},onCancel:()=>{m(!1),v(!1),C(k)},children:h&&w?t(In,{children:t(An,{isUpdate:!0,action:w,formData:f,formErrors:b,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(Rn,{children:[t(ee,{conditions:k.conditions||[]}),t(te,{title:g.ACTION_DETAILS,data:k?ln(k):[]})]})})},Kn=p(F)`
|
|
28
28
|
margin-top: 24px;
|
|
29
29
|
gap: 12px;
|
|
30
|
-
`,Ln=({createAction:i})=>{const{currentModal:
|
|
30
|
+
`,Ln=({createAction:i})=>{const{currentModal:o,setCurrentModal:a}=oe(),r=o===G.Action,{formData:l,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=X(),[p,h]=n(void 0),m=()=>{d(),h(void 0),a("")},y=()=>{if(!u({withAlert:!0,alertTitle:ne.Create}))return null;i(l),m()};return H({key:"Enter",active:r},()=>y()),t(ae,{isOpen:r,onClose:m,header:{title:"Add Action"},actionComponent:t(ue,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!p}]}),children:e(re,{children:[t(P,{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(Kn,{children:[t(le,{type:se.Warning,message:ce.DEFINED_FOR_ALL_STREAMS(g.ACTIONS)}),t(de,{options:Q,selectedOption:p,onOptionSelect:e=>{return t=e,d(),c("type",t?.type||""),void h(t);var t},autoFocus:!p?.type})]}),p?.type?e("div",{children:[t(A,{margin:"16px 0"}),t(An,{action:p,formData:l,formErrors:s,handleFormChange:c})]}):null]})})},Pn=e=>{const{type:t,fields:{collectContainerAttributes:i,collectReplicaSetAttributes:n,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:y,servicesNameFilters:b,urlTemplatizationRulesGroups:x}}=e;let S="";if(t===v.K8sAttributes&&(i&&(S+="Container Attributes, "),n&&(S+="ReplicaSet Attributes, "),o&&(S+="Workload ID, "),a&&(S+="Cluster ID, "),r?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},o)=>{const a=n?.length?n.join(","):i||f.Pod;S+=`Label: ${e} ${t} ${a} `,o===r.length-1&&(S+=", ")}),l?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},o)=>{const a=n?.length?n.join(","):i||f.Pod;S+=`Annotation: ${e} ${t} ${a} `,o===l.length-1&&(S+=", ")})),t===v.AddClusterInfo&&(S+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},i)=>{S+=`${e}: ${t}`,i<s.length-1&&(S+=", ")})),t===v.DeleteAttributes&&d?.forEach((e,t)=>{S+=e,t<d.length-1&&(S+=", ")}),t===v.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,i],n)=>{S+=`${t}: ${i}`,n<e.length-1&&(S+=", ")})}return t===v.PiiMasking&&p?.forEach((e,t)=>{S+=e,t<p.length-1&&(S+=", ")}),t===v.ErrorSampler&&(S+=String(h)),t===v.ProbabilisticSampler&&(S+=String(m),S+="%"),t===v.LatencySampler&&g?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},o)=>{S+=`Endpoint${g.length>1?` #${o+1}`:""}=${e}${t}\n`,S+=` Latency=${i}`,S+=` Sampling=${n}`,o<g.length-1&&(S+=", ")}),t===v.ServiceNameSampler&&b?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>{S+=`Service Name: ${e}, `,S+=`Sampling Ratio: ${t}, `,S+=`Fallback Sampling Ratio: ${i}\n`}),t===v.SpanAttributeSampler&&y?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i})=>{S+=`Service Name: ${e}, `,S+=`Attribute Key: ${t}, `,S+=`Fallback Sampling Ratio: ${i}\n`}),t===v.URLTemplatization&&x?.forEach((e,t)=>{const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");S+=`Group ${t+1}: ${i}`,t<x.length-1&&(S+="; ")}),S},jn=({conditions:e,id:i})=>{const{errors:n,warnings:o,disableds:a,hasLoadings:r}=c(()=>pe(e),[e]),l=n.length>0?n:o.length>0?o:a.length>0?a:[];if(l.length>0)return t("div",{style:{lineHeight:1},children:t(zn,{conditions:l,id:i})});const s=r?me.Loading:se.Success;return t("div",{style:{lineHeight:1},children:t(he,{status:s,title:s,withBorder:!0,withIcon:!0})})},zn=({conditions:e,id:i})=>{const n=m();return t(O,{children:ge(e).map(({status:e,type:o,reason:a,message:r,lastTransitionTime:l},s)=>{"loading"!==e&&"disabled"!==e||(e=se.Info);const c=ve(e,n);return t(ye,{titleIcon:c,title:o,text:r||a||"",timestamp:l,children:t(he,{status:e,title:a||o,withBorder:!0,withIcon:!0})},`condition-${i}-${e}-${o}-${s}`)})})},qn=({instrumentationRules:e,sources:t,actions:i,destinations:n,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?i.filter(e=>e.type?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):i,c=o?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):n,d=[{category:G.Source,label:"Sources",count:l.length,entities:[]},{category:G.Action,label:"Actions",count:s.length,entities:[]},{category:G.Destination,label:"Destinations",count:c.length,entities:[]},{category:G.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===G.InstrumentationRule?r:e.category===G.Source?l:e.category===G.Action?s:e.category===G.Destination?c:[]}));return{categories:d,searchResults:u}},Bn=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"signals",title:g.MONITORS},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:g.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:g.NOTES,sortable:!0}],Vn=({maxHeight:i,maxWidth:n})=>{const o=m(),a=fe(),{actions:r,actionsLoading:l}=Y(),{setDrawerType:s,setDrawerEntityId:d}=V(),u=c(()=>qn({instrumentationRules:[],sources:[],actions:be(r,a),destinations:[],searchText:a.searchText,selectedCategory:G.Action}).searchResults.find(({category:e})=>e===G.Action)?.entities||[],[r,a]),p=c(()=>u.map(e=>{const{hasErrors:i,hasWarnings:n,hasDisableds:a}=pe(e.conditions||[]);return{status:i?se.Error:n?se.Warning:void 0,faded:a,onClick:()=>{s(G.Action),d(e.id)},cells:[{columnKey:"icon",component:()=>t(xe,{icon:ie(e.type)})},{columnKey:"name",value:Se(e,G.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:Pn(e),textColor:o.text.info,withTooltip:!0},{columnKey:"signals",component:()=>t($e,{withLabels:!0,monitors:e.signals||[]})},{columnKey:"conditions",component:()=>t(jn,{conditions:e.conditions||[],id:e.id})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(he,{status:e.disabled?se.Error:se.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:y}=c(()=>u.length!==r.length?{badge:`${u.length}/${r.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:r.length,badgeTooltip:void 0},[u,r]);return e(Ce,{$maxWidth:n,children:[t(ke,{children:t(we,{icon:Te(G.Action),title:g.ACTIONS,badge:h,badgeTooltip:y,loading:l})}),t(De,{$maxHeight:i,children:t(Ne,{columns:Bn,rows:p})}),!u.length&&t(Ee,{style:{marginTop:"2rem"},children:t(Ae,{})})]})},Hn=p(F)`
|
|
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 i}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
|
-
`,Jn=()=>{const[i,
|
|
48
|
+
`,Jn=()=>{const[i,a]=n(0);return o(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ie(500),a(e)})()},[]),e(Hn,{children:[t(Oi,{size:100}),t(Fe,{width:400}),e(Wn,{children:[e(O,{$gap:16,children:[t(_n,{children:"Preparing your workspace..."}),t(Oe,{label:`${i}%`})]}),t(Un,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},Gn=p(F)`
|
|
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 i}from"react/jsx-runtime";import{useState
|
|
|
63
63
|
&:hover {
|
|
64
64
|
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+L["030"]};
|
|
65
65
|
}
|
|
66
|
-
`,Yn=({entityType:i,description:n})=>{const{setCurrentModal:
|
|
66
|
+
`,Yn=({entityType:i,description:n})=>{const{setCurrentModal:o}=oe();return e(Gn,{onClick:()=>o(i),children:[e(O,{$gap:4,children:[t(Ii,{}),e(B,{size:14,weight:600,family:"secondary",decoration:"underline",children:["Add ",i]})]}),t(B,{size:12,align:"center",children:n})]})},Xn=p.div`
|
|
67
67
|
position: relative;
|
|
68
68
|
width: 100%;
|
|
69
69
|
padding: 12px 0;
|
|
@@ -77,7 +77,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
77
77
|
width: 24px;
|
|
78
78
|
height: 24px;
|
|
79
79
|
padding: 0;
|
|
80
|
-
`,
|
|
80
|
+
`,eo=p.div`
|
|
81
81
|
position: absolute;
|
|
82
82
|
bottom: -2px;
|
|
83
83
|
left: 0;
|
|
@@ -86,7 +86,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
86
86
|
height: 4px;
|
|
87
87
|
width: ${({percent:e})=>`${e}%`};
|
|
88
88
|
transition: width 0.3s;
|
|
89
|
-
`,
|
|
89
|
+
`,to=({entityType:i,badge:n,badgeTooltip:o,isLoading:a,refetch:r,partiallySelected:l,allSelected:s,onSelectAll:c,progressPercent:d})=>{const u=m(),{setCurrentModal:p}=oe(),h=Te(i);return e(Xn,{children:[c&&t(Zn,{$marginLeft:"28px",children:t(S,{partiallyChecked:l,value:s,onChange:c})}),t(Zn,{$marginLeft:i===G.Source?"0":"28px",children:t(we,{icon:h,title:`${i}s`,badge:n,badgeTooltip:o,loading:!1})}),e(Zn,{$marginLeft:"auto",children:[t(Qn,{"data-id":`refresh-${i}`,variant:"secondary",onClick:r,disabled:a,children:a?t(Re,{scale:.8}):t(Ri,{fill:u.colors.secondary,size:18})}),t(Qn,{"data-id":`add-${i}`,variant:"primary",onClick:()=>p(i),children:t(Ii,{fill:u.colors.primary,size:18})})]}),"number"==typeof d&&t(eo,{percent:d})]})},io=p.div`
|
|
90
90
|
padding: 2px 6px;
|
|
91
91
|
background-color: ${({theme:e})=>e.colors.primary};
|
|
92
92
|
border-radius: 360px;
|
|
@@ -101,7 +101,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
101
101
|
align-items: center;
|
|
102
102
|
justify-content: center;
|
|
103
103
|
white-space: nowrap;
|
|
104
|
-
`,
|
|
104
|
+
`,no=({entityId:i,entityType:n,status:o,faded:a,title:r,subTitle:l,tooltip:s,label:c,icon:d,icons:u,iconSrc:p,iconSrcs:h,monitors:g,isActive:y,raw:v})=>{const f=m(),b=n===G.Source,x="boolean"==typeof y,{setDrawerType:S,setDrawerEntityId:$}=V(),{selectedSources:C,setSelectedSources:k}=Ke(),w={...C},{namespace:T,name:D,kind:N}=v;b&&!w[T]&&(w[T]=[]);const E=b?w[T].findIndex(e=>e.name===D&&e.kind===N):-1;return t(Le,{"data-id":n===G.Source?`${i.namespace}-${i.name}-${i.kind}`:i,title:r,subTitle:l,onClick:()=>{S(n),$(i)},renderActions:()=>{const i=b&&(!v.conditions?.length||v.conditions?.some(({status:e})=>"loading"===e)),n=x&&!y?ve(se.Info,f):o?ve(o,f):void 0,a=i?t(Re,{scale:.8}):n?t(n,{size:14}):null;return c?e(io,{$isError:o===se.Error,children:[t(ye,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:c}),a]}):a||null},iconProps:{icon:d,icons:u,iconSrc:p,iconSrcs:h},visualProps:{status:o,faded:a||x&&!y,monitors:g||void 0},checkboxProps:{withCheckbox:b,isChecked:-1!==E,onCheckboxChange:()=>{-1===E?w[T].push(v):w[T].splice(E,1),k(w)}}})};function oo(e){const t=e.conditions?.some(({status:e})=>e===me.Loading);return t?e:{...e,conditions:[{status:me.Loading,type:"Pending",message:"",lastTransitionTime:""}]}}function ao(e){const t=e.conditions?.filter(({status:e})=>e!==me.Loading);return t?.length===e.conditions?.length?e:{...e,conditions:t?.length?t:[{status:se.Success,type:"Healthy",message:"",lastTransitionTime:""}]}}const ro=p.div`
|
|
105
105
|
position: absolute;
|
|
106
106
|
top: 12px;
|
|
107
107
|
left: 12px;
|
|
@@ -112,23 +112,23 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
112
112
|
border-bottom: 1px solid ${({theme:e})=>e.colors.border};
|
|
113
113
|
border-radius: 12px 12px 0 0;
|
|
114
114
|
pointer-events: none;
|
|
115
|
-
`,
|
|
115
|
+
`,lo=p.span`
|
|
116
116
|
font-family: ${({theme:e})=>e.font_family.primary};
|
|
117
117
|
font-size: 11px;
|
|
118
118
|
font-weight: 600;
|
|
119
119
|
color: ${({theme:e})=>e.text.grey};
|
|
120
120
|
text-transform: uppercase;
|
|
121
121
|
letter-spacing: 0.5px;
|
|
122
|
-
`,
|
|
122
|
+
`,so=p.div`
|
|
123
123
|
display: flex;
|
|
124
124
|
align-items: center;
|
|
125
125
|
gap: 8px;
|
|
126
126
|
padding: 4px 8px 0;
|
|
127
|
-
`,
|
|
127
|
+
`,co=p.div`
|
|
128
128
|
flex: 1;
|
|
129
129
|
height: 1px;
|
|
130
130
|
background: ${({theme:e})=>e.colors.border};
|
|
131
|
-
`,
|
|
131
|
+
`,uo=p.span`
|
|
132
132
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
133
133
|
font-size: 10px;
|
|
134
134
|
font-weight: 600;
|
|
@@ -136,7 +136,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
136
136
|
text-transform: uppercase;
|
|
137
137
|
letter-spacing: 0.5px;
|
|
138
138
|
white-space: nowrap;
|
|
139
|
-
`,
|
|
139
|
+
`,po=({namespace:e})=>t(ro,{children:t(lo,{children:e})}),ho=({namespace:i})=>e(so,{children:[t(co,{}),t(uo,{children:i}),t(co,{})]}),mo=p.div`
|
|
140
140
|
height: calc(${({$height:e})=>e}px - 24px);
|
|
141
141
|
width: calc(100% - 24px);
|
|
142
142
|
padding: 12px;
|
|
@@ -144,7 +144,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
144
144
|
border: 1px dashed ${({theme:e})=>e.colors.border};
|
|
145
145
|
border-radius: 24px;
|
|
146
146
|
position: relative;
|
|
147
|
-
`,
|
|
147
|
+
`,go=p.div`
|
|
148
148
|
position: absolute;
|
|
149
149
|
bottom: 0;
|
|
150
150
|
left: 0;
|
|
@@ -159,18 +159,18 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
159
159
|
justify-content: center;
|
|
160
160
|
|
|
161
161
|
pointer-events: none;
|
|
162
|
-
`,
|
|
162
|
+
`,yo={[G.Source]:{subTitle:(e,t)=>t?e.kind:`${e.namespace} • ${e.kind}`,icons:e=>({icons:We(e),icon:Te(G.Source)}),withMetrics:!0},[G.Destination]:{subTitle:e=>e.destinationType.displayName,icons:e=>He(e.destinationType.type),withMetrics:!0,withMonitors:!0,withActive:!0},[G.Action]:{subTitle:e=>e.type,icons:e=>({icon:ie(e.type)}),withMonitors:!0,withActive:!0},[G.InstrumentationRule]:{subTitle:e=>e.type,icons:e=>({icon:Ve(e.type)}),withActive:!0},[G.Namespace]:{subTitle:()=>"",icons:()=>({icon:Te(G.Namespace)})}};const vo=({height:i,entityType:a,entities:r,metrics:l})=>{const{isVm:s}=je(),u=a===G.Source,[p,h]=n(""),m=c(()=>r.map(e=>function(e,t,i,n){const o=Z(e);if(!o)return null;const a=yo[t],r=t===G.Source,l=a.withMonitors?t===G.Destination?qe(e.exportedSignals):e.signals:void 0,s=a.withMetrics?n?.[`${t.toLowerCase()}s`]?.find(e=>JSON.stringify(Z(e))===JSON.stringify(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 Pe.Failure:return{status:se.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case Pe.Notice:return{status:se.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case Pe.Pending:case Pe.Waiting:return{status:void 0,faded:!1,displaySource:oo(e)};case Pe.Unsupported:case Pe.Disabled:return{status:void 0,faded:!0,displaySource:e};default:return{status:void 0,faded:!1,displaySource:ao(e)}}}(e);d=t.status,p=t.faded,u=t.tooltip,h=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:i}=pe(e.conditions||[]);d=t,p=i}return{entityId:o,namespace:r?e.namespace:void 0,title:Se(e,t,{extended:r,prioritizeDisplayName:!r}),subTitle:a.subTitle(e,i),status:d,faded:p,tooltip:u,label:a.withMetrics?Be(s?.throughput):void 0,...a.icons(e),monitors:l,isActive:c,raw:h}}(e,a,s,l)).filter(Boolean),[r,a,l,s]),{elements:g,indexToNamespace:y,multipleNs:v}=c(()=>{const e=[],i=[],n=new Set(m.map(e=>e.namespace).filter(Boolean)).size>1;n&&(i.push(""),e.push(t("div",{style:{height:28}},"ns-spacer")));let o="";for(const n of m)u&&n.namespace&&n.namespace!==o&&(""!==o&&(i.push(n.namespace),e.push(t(ho,{namespace:n.namespace},`ns-divider-${n.namespace}`))),o=n.namespace),i.push(n.namespace||""),e.push(t(no,{entityType:a,entityId:n.entityId,raw:n.raw,title:n.title,subTitle:n.subTitle,faded:n.faded,status:n.status,tooltip:n.tooltip,label:n.label,icons:n.icons,icon:n.icon,iconSrc:n.iconSrc,monitors:n.monitors,isActive:n.isActive},JSON.stringify(n.entityId)));return{elements:e,indexToNamespace:i,multipleNs:n}},[m,a,u]);o(()=>{if(u&&y.length&&!p){const e=y.find(Boolean);e&&h(e)}},[u,y]);const f=d(e=>{if(!y.length)return;const t=y[Math.min(e,y.length-1)];t&&t!==p&&h(t)},[y,p]);return e(mo,{$height:i,children:[v&&p&&t(po,{namespace:p}),t(ze,{gap:8,elements:g,onTopIndexChange:v?f:void 0}),t(go,{$hide:!0})]})},fo=p.div`
|
|
163
163
|
width: ${({$isVm:e})=>e?"45vw":"22vw"};
|
|
164
164
|
display: flex;
|
|
165
165
|
flex-direction: column;
|
|
166
166
|
gap: 12px;
|
|
167
|
-
`,
|
|
167
|
+
`,bo=({entityType:i,entities:n,unfilteredCount:o,metrics:a,loading:r,maxHeight:l,refetch:s})=>{const{isVm:d}=je(),{frameHeight:u,hasFiltersApplied:p,isSources:h}=c(()=>({frameHeight:Math.min(l,80*n.length+12),hasFiltersApplied:n.length!==o,isSources:i===G.Source}),[i,n.length,l,o]),{progress:m}=_e(),y=c(()=>h&&(m[Ue.Instrumenting]||m[Ue.Uninstrumenting])?m[Ue.Instrumenting]?.percentage||m[Ue.Uninstrumenting]?.percentage||0:void 0,[h,m[Ue.Instrumenting],m[Ue.Uninstrumenting]]),{selectedSources:v,setSelectedSources:f}=Ke(),b=c(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]);return d&&[G.InstrumentationRule,G.Action].includes(i)?null:e(fo,{$isVm:d,children:[t(to,{entityType:i,badge:"number"==typeof y?`${y}%`:p?`${n.length}/${o}`:o,badgeTooltip:p?g.FILTERED_COUNT_TOOLTIP:void 0,isLoading:r,refetch:s,partiallySelected:b>0&&n?.length!==b,allSelected:b>0&&n?.length===b,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),f(e)}else f({})}:void 0,progressPercent:y}),n.length?t(vo,{height:u,entityType:i,entities:n,metrics:a}):r?t(Je,{size:3}):t(Yn,{entityType:i,description:g.TO_COLLECT_OTEL_DATA})]})},xo=p.div`
|
|
168
168
|
width: 100%;
|
|
169
169
|
height: ${({$height:e})=>e};
|
|
170
170
|
display: flex;
|
|
171
171
|
justify-content: space-evenly;
|
|
172
172
|
gap: 24px;
|
|
173
|
-
`,
|
|
173
|
+
`,So=({height:i,metrics:a,refetchSources:r,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:d})=>{const u=fe(),{selectedStreamName:p}=Ge(),{containerRef:h,containerHeight:m}=Ye(),{sources:g,sourcesLoading:y,destinations:v,destinationsLoading:f,actions:b,actionsLoading:x,instrumentationRules:S,instrumentationRulesLoading:$}=Y(),C=c(()=>Xe(g,p),[g,p]),k=c(()=>Ze(v,p),[v,p]),[w,T]=n([]),[D,N]=n([]),[E,A]=n([]),[F,O]=n([]);return o(()=>{T(Qe(C,u))},[C,u]),o(()=>{N(et(k,u))},[k,u]),o(()=>{A(be(b,u))},[b,u]),o(()=>{O(S)},[S]),e(xo,{ref:h,$height:i,children:[t(bo,{entityType:G.InstrumentationRule,entities:F,unfilteredCount:S.length,loading:$,maxHeight:m,refetch:d}),t(bo,{entityType:G.Source,entities:w,unfilteredCount:C.length,metrics:a,loading:y,maxHeight:m,refetch:r}),t(bo,{entityType:G.Action,entities:E,unfilteredCount:b.length,loading:x,maxHeight:m,refetch:s}),t(bo,{entityType:G.Destination,entities:D,unfilteredCount:k.length,metrics:a,loading:f,maxHeight:m,refetch:l})]})},$o=p.div`
|
|
174
174
|
position: relative;
|
|
175
175
|
max-width: 200px;
|
|
176
176
|
`;p.div`
|
|
@@ -184,60 +184,60 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
184
184
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
185
185
|
border: ${({theme:e})=>`1px solid ${e.colors.border}`};
|
|
186
186
|
border-radius: 24px;
|
|
187
|
-
`;const
|
|
187
|
+
`;const Co=p.div`
|
|
188
188
|
display: flex;
|
|
189
189
|
align-items: center;
|
|
190
190
|
overflow-x: scroll;
|
|
191
|
-
`,
|
|
191
|
+
`,ko=({onClose:i})=>{const r=m(),{onClickNode:l}=tt(),{searchText:s}=fe(),{selectedStreamName:d}=Ge(),{sources:u,destinations:p,actions:h,instrumentationRules:g}=Y(),{popupRef:y,popupOpen:v,setPopupOpen:f,popupPosition:b,handlePosition:x}=it();o(()=>{v||(x(0,50),f(!0))},[v]);const[S,$]=n("all"),{categories:C,searchResults:k}=c(()=>qn({instrumentationRules:g,sources:Xe(u,d),actions:h,destinations:Ze(p,d),searchText:s,selectedCategory:S}),[g,u,h,p,d,s,S]);return k.length?t(nt,{ref:y,isOpen:v,top:b.top,left:b.left,maxWidth:"420px",header:t(Co,{children:C.map(({category:e,label:i,count:n})=>!!n&&t(at,{label:i,badgeLabel:n,isSelected:S===e,onClick:()=>$(e)},`category-select-${e}`))}),children:k.map(({category:n,label:o,entities:s},c)=>!!s.length&&e(a,{children:[e(ot,{style:{maxHeight:"all"!==S?"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(at,{icon:Te(n),label:Se(e,n,{extended:!0}),onClick:()=>{const t=Z(e);l(null,{data:{type:n,id:t}}),i()},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-${n}`))}):t(nt,{ref:y,isOpen:v,top:b.top,left:b.left,children:t(Ae,{})})},wo=({preventPopup:i=!1})=>{const{searchText:o,setSearchText:a}=fe(),[r,s]=n(!1),c=!!o||r,d=()=>{a(""),s(!1)},u=l(null);return rt(u,d),H({key:"Escape",active:c},d),e($o,{ref:u,children:[t(C,{placeholder:"Search",icon:Mi,value:o,onChange:e=>a(e.target.value.toLowerCase()),onFocus:()=>s(!0)}),c&&!i?t(ko,{onClose:d}):null]})},To=({sources:e,title:i="Condition",value:n,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e.forEach(({conditions:e})=>{e?.forEach(({type:e,reason:i})=>{t.find(t=>t.id===`${e}#${i}`)||t.push({id:`${e}#${i}`,value:`${lt(e)} - ${lt(i)}`})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(st,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:o,onDeselect:a,...r})},Do=({sources:e,title:i="Error Message",value:n,onSelect:o,onDeselect:a,disabled:r,...l})=>{const s=c(()=>{const t=[];return e.forEach(({conditions:e})=>{ge(e||[]).forEach(({status:e,message:i,reason:n})=>{e!==se.Error||t.find(e=>e.id===i)||(i?t.find(e=>e.id===i)||t.push({id:i,value:i}):n&&(t.find(e=>e.id===n)||t.push({id:n,value:n})))})}),t},[e]);return t(st,{disabled:r||!s?.length,title:i,placeholder:"All",options:s,value:n,onSelect:o,onDeselect:a,...l})},No=({sources:e,title:i="Programming Language",value:n,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e.forEach(({containers:e})=>{e?.forEach(({language:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:ct[e]||e})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(st,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:o,onDeselect:a,...r})},Eo=({title:e="Monitors",value:i,onSelect:n,onDeselect:o,...a})=>{const r=c(()=>{const e=[];return dt.forEach(({id:t,value:i})=>{e.find(e=>e.id===t)||e.push({id:t,value:i})}),e},[]);return t(st,{disabled:!r?.length,title:e,placeholder:"All",options:r,value:i,onSelect:n,onDeselect:o,...a})},Ao=({namespaces:e,title:i="Namespace",value:n,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(st,{disabled:!l?.length,title:i,placeholder:"Select namespace",options:l,value:n,onSelect:o,onDeselect:a,...r})},Fo=({sources:e,title:i="Kind",value:n,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(st,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:o,onDeselect:a,...r})},Oo=({sources:e,title:i="Agent Injection Status",value:n,onSelect:o,onDeselect:a,disabled:r,...l})=>{const s=c(()=>{const t=[];return e.forEach(({podsAgentInjectionStatus:e})=>{const{reasonEnum:i,message:n}=e||{};i?t.find(e=>e.id===i)||t.push({id:i,value:lt(i)}):n&&(t.find(e=>e.id===n)||t.push({id:n,value:n}))}),t},[e]);return t(st,{disabled:r||!s?.length,title:i,placeholder:"All",options:s,value:n,onSelect:o,onDeselect:a,...l})},Io=p.div`
|
|
192
192
|
display: flex;
|
|
193
193
|
flex-direction: column;
|
|
194
194
|
gap: 12px;
|
|
195
195
|
padding: 12px;
|
|
196
|
-
`,
|
|
196
|
+
`,Ro=p.div`
|
|
197
197
|
padding: 12px 6px 6px 6px;
|
|
198
|
-
`,
|
|
198
|
+
`,Mo=p(Me)`
|
|
199
199
|
font-size: 14px;
|
|
200
200
|
${({$color:e})=>`color: ${e};`}
|
|
201
|
-
`,
|
|
201
|
+
`,Ko=p.div`
|
|
202
202
|
margin-left: auto;
|
|
203
|
-
`,
|
|
203
|
+
`,Lo=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},Po=()=>{const i=m(),{namespaces:a,sources:r}=Y(),{selectedStreamName:s}=Ge(),{getItemSS:d,setItemSS:u,removeItemSS:p}=pt(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:f}=it(),{namespaces:b,kinds:x,monitors:S,languages:$,conditions:C,errors:k,onlyErrors:w,podsAgentInjectionStatus:T,setAll:N,clearAll:E,getEmptyState:A}=fe(),F=c(()=>Xe(r,s),[r,s]),[I,R]=n({namespaces:b,kinds:x,monitors:S,languages:$,conditions:C,errors:k,onlyErrors:w,podsAgentInjectionStatus:T}),[M,K]=n(Lo(I));o(()=>{const e=d(ut.OVERVIEW_FILTERS,A());N(e)},[]),o(()=>{if(!g){const e={namespaces:b,kinds:x,monitors:S,languages:$,conditions:C,errors:k,onlyErrors:w,podsAgentInjectionStatus:T};R(e),K(Lo(e))}},[g,b,x,S,$,C,k,w,T]);const L=()=>{y(!1)},P=l(null);return rt(P,L),H({key:"Escape",active:g},L),e($o,{ref:P,children:[t(at,{label:"Filters",icon:Ki,badgeLabel:M,badgeFilled:!!M,withBorder:!0,color:"transparent",onClick:()=>{f(0,50),y(!0)}}),t(nt,{ref:h,isOpen:g,top:v.top,left:v.left,width:"420px",footer:e(O,{children:[t(Mo,{variant:"primary",onClick:()=>{u(ut.OVERVIEW_FILTERS,I),N(I),K(Lo(I)),y(!1)},children:"Apply"}),t(Mo,{variant:"secondary",onClick:L,children:"Cancel"}),t(Ko,{children:t(Mo,{variant:"tertiary",onClick:()=>{p(ut.OVERVIEW_FILTERS),E(),R(A()),K(0),y(!1)},$color:i.text.error,children:"Reset"})})]}),children:e(Io,{children:[t(Ao,{namespaces:a,value:I.namespaces,onSelect:e=>R(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>R(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Fo,{sources:F,value:I.kinds,onSelect:e=>R(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>R(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(No,{sources:F,value:I.languages,onSelect:e=>R(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>R(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Eo,{value:I.monitors,onSelect:e=>R(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>R(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(To,{sources:F,value:I.conditions,onSelect:e=>R(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>R(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Oo,{sources:F,value:I.podsAgentInjectionStatus,onSelect:e=>R(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>R(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Ro,{children:t(D,{title:"Show only sources with errors",initialValue:I.onlyErrors,onChange:e=>R(t=>({...t,errors:[],onlyErrors:e}))})}),t(Do,{sources:F,value:I.errors,onSelect:e=>R(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>R(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!I.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},jo=p.div`
|
|
204
204
|
display: flex;
|
|
205
205
|
flex-direction: column;
|
|
206
206
|
gap: 24px;
|
|
207
207
|
padding: 4px;
|
|
208
|
-
`,
|
|
208
|
+
`,zo=({formData:i,handleFormChange:n,formErrors:o,editingStreamName:a})=>{const{dataStreams:r,selectedStreamName:l}=Ge(),s=a||l,d=c(()=>r.find(e=>e.name===i.name&&e.name!==s),[r,i.name,s]);return e(jo,{children:[t(C,{name:"name",title:g.STREAM_NAME,placeholder:g.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:i.name,onChange:({target:{value:e}})=>n("name",e),errorMessage:o.name}),d&&t(le,{type:se.Warning,message:g.DATA_STREAM_EXISTS_WARNING(s,d.name)})]})},qo=p.div`
|
|
209
209
|
width: 100%;
|
|
210
210
|
height: 100%;
|
|
211
211
|
max-height: calc(100vh - 220px);
|
|
212
212
|
overflow: overlay;
|
|
213
213
|
overflow-y: auto;
|
|
214
|
-
`,
|
|
214
|
+
`,Bo=({isOpen:e,onClose:i,dataStreamName:o,updateDataStream:a})=>{const{dataStreams:r}=Ge(),s=l(null),[u,p]=n(!1),{formData:h,handleFormChange:m,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:f}=ht({name:o}),b=c(()=>{if(!e)return v();const t=r?.find(e=>e.name===o);return t?f(t):v(),t},[e,r,o]),x=d((e,t)=>{m(e,t),p(!0)},[m]);return b?t(Fn,{ref:s,title:b.name,icons:[Li],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:ne.Update})&&(a(o,h),p(!1),i())},onCancel:()=>{v(),p(!1),i()},children:t(qo,{children:t(zo,{formData:h,handleFormChange:x,formErrors:g,editingStreamName:o})})}):null},Vo=p.div`
|
|
215
215
|
position: relative;
|
|
216
|
-
`,
|
|
216
|
+
`,Ho=p(O)`
|
|
217
217
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
218
218
|
border-radius: 32px;
|
|
219
219
|
|
|
220
220
|
& button {
|
|
221
221
|
max-height: 28px;
|
|
222
222
|
}
|
|
223
|
-
`,
|
|
223
|
+
`,Wo=p(B)`
|
|
224
224
|
text-wrap: nowrap;
|
|
225
|
-
`,
|
|
225
|
+
`,_o=p(ot)`
|
|
226
226
|
max-height: 240px;
|
|
227
227
|
padding: 0px !important;
|
|
228
|
-
`,
|
|
228
|
+
`,Uo=p(O)`
|
|
229
229
|
width: 100%;
|
|
230
|
-
`,
|
|
230
|
+
`,Jo=p.div`
|
|
231
231
|
width: 100%;
|
|
232
|
-
`,
|
|
232
|
+
`,Go=({onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r})=>{const l=m(),{clearStore:s}=mt(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:h,handlePosition:g}=it(),{dataStreams:y,selectedStreamName:v,setSelectedStreamName:f}=Ge(),[b,x]=n(""),[S,$]=n(""),[k,w]=n(""),T=c(()=>y.filter(({name:e})=>!k||e.toLowerCase().includes(k.toLowerCase())).map(({name:i})=>e(Uo,{children:[t(Jo,{children:t(at,{label:i,isSelected:v===i,onClick:()=>{s(),f(i),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})}),i!==gt&&t(I,{onClick:()=>$(i),tooltip:W.DELETE,children:t(Ni,{})}),t(I,{onClick:()=>x(i),tooltip:W.EDIT,children:t(Fi,{})})]},`stream-${i}`)),[y,v,k]);return e(i,{children:[e(Vo,{children:[e(Ho,{$gap:0,children:[e(Me,{variant:"tertiary",onClick:()=>{g(0,50),p(e=>!e)},children:[t(Li,{fill:l.text.info}),e(Wo,{children:["Data Stream: ",v]}),t(yt,{extend:u}),t(Oe,{label:y.length})]}),t(A,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),t(R,{onClick:()=>{s(),o()},label:W.NEW})]}),t(nt,{ref:d,isOpen:u,top:h.top,left:h.left,header:t(C,{placeholder:"Search...",icon:Mi,value:k,onChange:e=>w(e.target.value)}),children:t(_o,{children:T})})]}),t(U,{isOpen:""!==S,name:S,onApprove:()=>{r(S),$("")},onDeny:()=>{$("")}}),t(Bo,{isOpen:""!==b,onClose:()=>{x("")},dataStreamName:b,updateDataStream:a})]})},Yo=p.div`
|
|
233
233
|
display: flex;
|
|
234
234
|
align-items: center;
|
|
235
235
|
margin: 20px 0;
|
|
236
236
|
padding: 0 16px;
|
|
237
237
|
gap: 8px;
|
|
238
|
-
`,
|
|
238
|
+
`,Xo=p.div`
|
|
239
239
|
margin-left: auto;
|
|
240
|
-
`,
|
|
240
|
+
`,Zo=({addEntity:i,preventSearchPopup:n,onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r})=>{const{isVm:l}=je(),{setCurrentModal:s}=oe();return e(Yo,{children:[!l&&t(Go,{onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r}),t(wo,{preventPopup:n}),t(Po,{}),i&&t(Xo,{children:t(R,{"data-id":`add-${i}`,onClick:()=>s(i),label:`${W.ADD} ${lt(i)}`,variant:"primary",textProps:{weight:900}})})]})},Qo=r(({isModal:i,onClickSummary:n},o)=>{const{selectedStreamName:a}=Ge(),{formData:r,handleFormChange:l,formErrors:c,validateForm:d}=ht({name:a});return s(o,()=>({validateForm:d,getFormValues:()=>r})),t(re,{$isNotModal:!i,children:e(F,{$gap:24,children:[n&&t(vt,{onClick:n}),t(P,{title:g.NAME_YOUR_STREAM,description:g.STREAM_DESCRIPTION}),t(zo,{formData:r,handleFormChange:l,formErrors:c})]})})});Qo.displayName=Qo.name;const ea=({createDataStream:e})=>{const{currentModal:i,setCurrentModal:n}=oe(),{addDataStreams:o,setSelectedStreamName:a}=Ge(),r=i===ft.DataStream,s=()=>n(""),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 H({key:"Enter",active:r},c),t(ae,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:t(ue,{buttons:[{label:"DONE",variant:"primary",onClick:c}]}),children:t(Qo,{ref:d,isModal:!0})})},ta=(e,t)=>{const{destinationType:i,disabled:n,exportedSignals:o}=e,a=[{title:g.TYPE,value:i.type},{type:y.ActiveStatus,title:g.STATUS,value:String(!n)},{type:y.Monitors,title:g.MONITORS,value:qe(o).join(", ")},{title:g.NAME,value:i.displayName}],r=bt(e,t),l=r.map(e=>({name:e.key,value:e.value}));return r.map(({key:e,name:i,value:n})=>{const{secret:r,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!xt(c,qe(o),l)){const{type:e}=St(s,{type:""}),t=(r||"password"===e)&&n.length?new Array(10).fill("•").join(""):"";a.push({type:y.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==n&&a.push({title:t.title,value:t.value})}):a.push({title:i,value:t||n})}}),a},ia=({signals:e,fields:i,onChange:n,formErrors:o})=>i?.map(a=>{const{componentType:r,renderCondition:l,...s}=a;if(l&&!xt(l,e,i))return null;switch(r){case M.Input:return t(C,{...s,onChange:e=>n(a.name,e.target.value),errorMessage:o[a.name]},a.name);case M.Dropdown:return t(st,{...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>n(a.name,e.id),errorMessage:o[a.name]},a.name);case M.MultiInput:return t(E,{...s,value:"string"==typeof s.value?St(s.value,[]):s.value,onChange:e=>n(a.name,JSON.stringify(e)),errorMessage:o[a.name]},a.name);case M.KeyValuePair:return t(N,{...s,value:"string"==typeof s.value?St(s.value,[]):s.value,onChange:e=>n(a.name,JSON.stringify(e)),errorMessage:o[a.name]},a.name);case M.TextArea:return t(q,{...s,onChange:e=>n(a.name,e.target.value),errorMessage:o[a.name]},a.name);case M.Checkbox:return t(S,{...s,value:"true"==s.value,onChange:e=>n(a.name,String(e)),errorMessage:o[a.name]},a.name);default:return null}}),na=p(Me)`
|
|
241
241
|
display: flex;
|
|
242
242
|
align-items: center;
|
|
243
243
|
gap: 8px;
|
|
@@ -251,43 +251,43 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
251
251
|
`:h`
|
|
252
252
|
background-color: transparent;
|
|
253
253
|
`}
|
|
254
|
-
`,
|
|
254
|
+
`,oa=({destination:i,validateForm:o,status:a,testConnection:r,onSuccess:l,onError:s})=>{const c=m(),{selectedStreamName:d}=Ge(),[u,p]=n(!1),h=a?ve(a,c):void 0;return e(na,{$status:a,variant:"secondary",onClick:async()=>{if(o()){p(!0);const e=await r({...i,currentStreamName:d});e&&(e.succeeded?l(e):s(e)),p(!1)}},children:[u?t(Re,{}):h?t(h,{}):null,t(B,{family:"secondary",decoration:"underline",size:14,color:a?c.text[a]:void 0,children:u?"Checking":a===se.Success?"Connection OK":"error"===a?"Connection Failed":"Test Connection"})]})},aa=p(F)`
|
|
255
255
|
align-items: unset;
|
|
256
256
|
padding: 0 4px;
|
|
257
|
-
`,
|
|
257
|
+
`,ra=p.div`
|
|
258
258
|
display: flex;
|
|
259
259
|
flex-direction: column;
|
|
260
260
|
gap: 12px;
|
|
261
|
-
`,
|
|
261
|
+
`,la=p(O)`
|
|
262
262
|
justify-content: space-between;
|
|
263
|
-
`,
|
|
263
|
+
`,sa=p(B)`
|
|
264
264
|
margin-bottom: 12px;
|
|
265
|
-
`,
|
|
265
|
+
`,ca=({isUpdate:i,categoryItem:a,formData:r,formErrors:s,validateForm:d,handleFormChange:u,dynamicFields:p,setDynamicFields:h,testConnection:y})=>{const{type:v,displayName:f,supportedSignals:b,testConnectionSupported:x}=a||{},S=m(),[$,k]=n(!1),[w,T]=n(!1),[D,N]=n(void 0),E=l(!1);o(()=>{if(p.length&&!E.current){E.current=!0;let e=!1;for(let t=0;t<p.length;t++){const{required:i,value:n}=p[t];if(i){if([void 0,null,""].includes(n)){e=!1;break}e=!0}}k(e)}},[p,w]);const F=c(()=>{const{logs:e,metrics:t,traces:i}=b||{},n=[];return e?.supported&&n.push($t.Logs),t?.supported&&n.push($t.Metrics),i?.supported&&n.push($t.Traces),n},[b]),O=c(()=>{const{logs:e,metrics:t,traces:i}=r.exportedSignals||{},n=[];return e&&n.push($t.Logs),t&&n.push($t.Metrics),i&&n.push($t.Traces),n},[r.exportedSignals]),I=()=>{k(!1),T(!0),N(void 0)};return e(aa,{$gap:24,children:[e(aa,{$gap:12,children:[t(P,{title:i?"Update destination":"Create destination",description:`Connect ${f} with Odigos.`,actionButton:x&&t(oa,{destination:r,validateForm:d,status:D?.type,testConnection:y,onError:e=>{T(!1),N({type:se.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{T(!1),N({type:se.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e(ra,{children:[x&&D&&t(le,{type:D.type,title:D.title,message:D.message}),$&&!D&&!i&&t(le,{type:se.Default,message:`Odigos autocompleted ${f} destination details.`})]}),t(A,{})]}),e(la,{children:[t(z,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:F,selectedSignals:O,setSelectedSignals:e=>{I(),u("exportedSignals",{logs:e.includes($t.Logs),metrics:e.includes($t.Metrics),traces:e.includes($t.Traces)})},errorMessage:s.exportedSignals}),!i&&t(j,{endpoint:`/backends/${v}`})]}),i&&e("div",{children:[t(sa,{children:"Status"}),t(K,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:S.text.success+L["050"]},{icon:Ai,label:g.DISABLED,value:!0,selectedBgColor:S.text.error+L["050"]}],selected:r.disabled,setSelected:e=>u("disabled",e)})]}),!i&&t(C,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{I(),u("name",e.target.value)},errorMessage:s.name}),t(ia,{signals:O,fields:p,onChange:(e,t)=>{I(),h(i=>{const n=[...i],o=n.findIndex(t=>t.name===e);return-1!==o&&(n[o]={...n[o],value:t}),n})},formErrors:s})]})},da=p.div`
|
|
266
266
|
width: 100%;
|
|
267
267
|
height: 100%;
|
|
268
268
|
max-height: calc(100vh - 220px);
|
|
269
269
|
overflow: overlay;
|
|
270
270
|
overflow-y: auto;
|
|
271
|
-
`,
|
|
271
|
+
`,ua=p.div`
|
|
272
272
|
display: flex;
|
|
273
273
|
flex-direction: column;
|
|
274
274
|
gap: 12px;
|
|
275
|
-
`,
|
|
275
|
+
`,pa=({categories:i,updateDestination:a,deleteDestination:r,testConnection:s})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ge(),{drawerType:p,drawerEntityId:h}=V(),m=c(()=>Ze(d,u),[d,u]),y=l(null),v=p===G.Destination,[f,b]=n(!1),[x,S]=n(!1),{formData:$,formErrors:C,handleFormChange:k,resetFormData:w,validateForm:T,loadFormWithDrawerItem:D,yamlFields:N,setYamlFields:E,dynamicFields:A,setDynamicFields:F}=Ct({}),O=c(()=>{if(h)return m?.find(e=>Z(e)===h)},[h,m]);if(o(()=>{v&&O?(E(kt(i,O)),D(O)):w()},[v,O,i]),!O)return null;const I=i.flatMap(e=>e.items).find(e=>e.type===O.destinationType.type),{icon:R,iconSrc:M}=I?He(I?.type):{icon:void 0,iconSrc:void 0};return t(Fn,{ref:y,title:O.name||O.destinationType.displayName,icons:R?[R]:void 0,iconSrcs:M?[M]:void 0,isEdit:f,isFormDirty:x,onEdit:e=>{b("boolean"!=typeof e||e)},onSave:async e=>{if(T({withAlert:!0,alertTitle:ne.Update})){const t=e!==O.destinationType.displayName?e:"";k("name",t),a(h,{...$,name:t}),b(!1),S(!1)}},onDelete:async()=>{r(h),b(!1),S(!1),y.current?.closeDrawer()},onCancel:()=>{b(!1),S(!1),D(O)},isLastItem:1===m.length,children:f?t(da,{children:t(ca,{isUpdate:!0,categoryItem:I,formData:$,formErrors:C,handleFormChange:(...e)=>{S(!0),k(...e)},dynamicFields:A,setDynamicFields:(...e)=>{S(!0),F(...e)},validateForm:T,testConnection:s})}):e(ua,{children:[O.conditions?.length?t(ee,{conditions:O.conditions}):null,t(te,{title:g.DESTINATION_DETAILS,data:O?ta(O,N):[]})]})})},ha=p.div`
|
|
276
276
|
display: flex;
|
|
277
277
|
flex-direction: column;
|
|
278
278
|
gap: 12px;
|
|
279
|
-
`,
|
|
279
|
+
`,ma=({items:i,onSelectNew:n,onSelectConfigured:o,isLoadingForDestinationIds:a})=>{const{configuredDestinationsUpdateOnly:r}=mt();return i.map(i=>{const l=i.name===Dt[Nt.EXISTS].TITLE;return e(ha,{children:[t(P,{size:"small",icon:i.icon,title:wt(i.name),description:i.description}),i.items.map(e=>{const s=`select-${i.name.replaceAll(" ","")}-destination-${e.type}`,c=Tt(e.supportedSignals),{icon:d,iconSrc:u}=He(e.type),p=e.selected||r.some(t=>t.id===e.id),h=!!a.find(t=>t===e.id),m=l?()=>o(e.id):()=>n(e);return t(Le,{"data-id":s,title:e.displayName,hoverText:W.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-${i.name}`)})},ga=p.div`
|
|
280
280
|
display: flex;
|
|
281
281
|
flex-direction: column;
|
|
282
282
|
gap: 24px;
|
|
283
|
-
`,
|
|
283
|
+
`,ya=p.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
align-items: center;
|
|
286
286
|
gap: 12px;
|
|
287
|
-
`,
|
|
287
|
+
`,va=p.div`
|
|
288
288
|
width: 170px;
|
|
289
289
|
margin-right: 8px;
|
|
290
|
-
`,
|
|
290
|
+
`,fa=p.div`
|
|
291
291
|
display: flex;
|
|
292
292
|
flex-direction: column;
|
|
293
293
|
align-self: stretch;
|
|
@@ -298,18 +298,18 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
298
298
|
@media (height < 800px) {
|
|
299
299
|
max-height: calc(100vh - 400px);
|
|
300
300
|
}
|
|
301
|
-
`,
|
|
301
|
+
`,ba=p(ga)`
|
|
302
302
|
margin-top: 80px;
|
|
303
|
-
`,
|
|
303
|
+
`,xa=Object.values(Nt).map(e=>({value:Dt[e].TITLE,id:e})),Sa=xa[0],$a=[$t.Logs,$t.Metrics,$t.Traces],Ca=(e,t,i)=>e.map(e=>{const{type:n,displayName:o}=e.destinationType,a=e.dataStreamNames?.includes(t),r=i.has(e.id);return{id:e.id,type:n,displayName:o,selected:a||r,fields:[],testConnectionSupported:!1,supportedSignals:{logs:{supported:e.exportedSignals.logs},metrics:{supported:e.exportedSignals.metrics},traces:{supported:e.exportedSignals.traces}}}}),ka=({hidden:i,categories:o,potentialDestinations:a,onSelectNew:r,onSelectConfigured:l,isLoadingForDestinationIds:s})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ge(),{configuredDestinations:p,configuredDestinationsUpdateOnly:h}=mt(),[m,g]=n(""),[y,v]=n(Sa),[f,b]=n($a),x=c(()=>{const e=Et(o);return e.unshift({name:Nt.EXISTS,description:Dt[Nt.EXISTS].DESCRIPTION,icon:Pi,items:Ca(d,u,new Set(p.concat(h).map(e=>e.id)))}),e.unshift({name:Nt.DETECTED,description:Dt[Nt.DETECTED].DESCRIPTION,icon:ji,items:a}),e.map(e=>{const t=e.items.filter(t=>{const i=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),n="all"===y.id||y.id?.toLowerCase()?.replaceAll("-"," ")===e.name.toLowerCase()?.replaceAll("-"," "),o=f.some(e=>t.supportedSignals[At[e]]?.supported);return i&&n&&o});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[o,a,d,m,y,f,u,p,h]);return i?null:e(ga,{children:[t(P,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(ya,{children:[t(va,{children:t(C,{placeholder:"Search...",icon:Mi,value:m,onChange:({target:{value:e}})=>g(e)})}),t(va,{children:t(st,{options:xa,value:y,onSelect:v,onDeselect:()=>{}})}),t(z,{title:"",selectedSignals:f,setSelectedSignals:b})]}),t(A,{}),x.length?t(fa,{children:t(ma,{items:x,onSelectNew:e=>r(e,f),onSelectConfigured:l,isLoadingForDestinationIds:s})}):t(ba,{children:t(Ae,{title:"No destinations found"})})]})},wa=p.div`
|
|
304
304
|
display: flex;
|
|
305
|
-
`,
|
|
305
|
+
`,Ta=p.div`
|
|
306
306
|
border-right: 1px solid ${({theme:e})=>e.colors.border};
|
|
307
307
|
padding: 32px;
|
|
308
308
|
width: 200px;
|
|
309
309
|
@media (max-width: 1050px) {
|
|
310
310
|
display: none;
|
|
311
311
|
}
|
|
312
|
-
`,
|
|
312
|
+
`,Da=({isOnboarding:i,categories:o,potentialDestinations:a,createDestination:r,updateDestination:l,deleteDestination:s,testConnection:c})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ge(),{currentModal:p,setCurrentModal:h}=oe(),{addConfiguredDestination:m,addConfiguredDestinationUpdateOnly:y,removeConfiguredDestinationUpdateOnly:v,configuredDestinationsUpdateOnly:f}=mt(),b=p===G.Destination,[x,S]=n(void 0),{formData:$,formErrors:C,handleFormChange:k,resetFormData:w,validateForm:T,setYamlFields:D,dynamicFields:N,setDynamicFields:E,loadFormWithDrawerItem:A}=Ct({supportedSignals:x?.supportedSignals,preLoadedFields:x?.fields}),[F,O]=n([]),I=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||$.name,disabled:e?.disabled||$.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||$.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:x.type,displayName:x.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},R=async e=>{if(i&&!e){const e=I();m(e)}else if(i&&e){const t=I(e);f.some(t=>t.id===e.id)?v(e):y(t)}else if(i||e){if(!i&&e){const t=I(e),i=t.dataStreamNames.some(e=>e===u);O(t=>[...t,e.id]),i?await s(e.id):await l(e.id,A(t)),O(t=>t.filter(t=>t!==e.id))}}else r($)},M=()=>{w(),S(void 0),h("")},K=()=>{w(),S(void 0)},L=async()=>{if(x){if(!T({withAlert:!i,alertTitle:ne.Create}))return null;R()}M()};return H({key:"Enter",active:b},()=>L()),t(ae,{isOpen:b,onClose:M,header:{title:g.ADD_DESTINATION},actionComponent:t(ue,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:L}];return x&&e.unshift({label:"BACK",icon:()=>t(zi,{rotate:-90}),variant:"secondary",onClick:K}),e})()}),children:e(wa,{children:[t(Ta,{children:t(Ft,{currentStep:x?2:1,data:[{stepNumber:1,title:g.DESTINATIONS},{stepNumber:2,title:g.CONNECTION}]})}),e(re,{style:{margin:"32px 24px 12px 24px"},children:[t(ka,{hidden:void 0!==x,categories:o,potentialDestinations:a,onSelectNew:(e,t)=>{w(),k("type",e?.type||""),k("currentStreamName",u);const i={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[At[t]].supported).forEach(e=>i[At[e]]=!0),k("exportedSignals",i),D(e?.fields||[]),S(e)},onSelectConfigured:e=>{const t=d.find(t=>t.id===e);t&&R(t)},isLoadingForDestinationIds:F}),x&&t(ca,{categoryItem:x,formData:$,formErrors:C,handleFormChange:k,dynamicFields:N,setDynamicFields:E,validateForm:T,testConnection:c})]})]})})},Na=p.div`
|
|
313
313
|
display: flex;
|
|
314
314
|
flex-direction: column;
|
|
315
315
|
align-items: center;
|
|
@@ -318,7 +318,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
318
318
|
max-height: calc(100vh - 310px);
|
|
319
319
|
height: fit-content;
|
|
320
320
|
overflow-y: scroll;
|
|
321
|
-
`,
|
|
321
|
+
`,Ea=({categories:e,withDelete:i})=>{const{configuredDestinations:n,configuredDestinationsUpdateOnly:o}=mt();return n.length||o.length?t(Na,{children:n.concat(o).map((a,r)=>t(Aa,{"data-id":`configured-destination-${a.destinationType.type}`,item:a,yamlFields:kt(e,a),isLastItem:n.length+o.length===1,withDelete:i},`configured-destination-${a.destinationType.type}-${r}`))}):t(Ee,{children:t(Ae,{title:"No destinations",subTitle:"Please add a destination"})})},Aa=({item:o,yamlFields:a,isLastItem:r,withDelete:l})=>{const[s,d]=n(!1),{icon:u,iconSrc:p}=He(o.destinationType.type),{removeConfiguredDestination:h,removeConfiguredDestinationUpdateOnly:m}=mt(),g=c(()=>bt(o,a).map(e=>({title:e.name,value:e.value})),[o,a]);return e(i,{children:[t(Le,{title:o.name||o.destinationType.displayName,subTitle:o.destinationType.type,iconProps:{icon:u,iconSrc:p},visualProps:{monitors:qe(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>t(Ot,{data:g})},renderActions:l?()=>t(I,{onClick:()=>d(!0),children:t(Ni,{})}):void 0}),l&&t(U,{isOpen:s,name:o.destinationType.displayName||o.name,type:G.Destination,isLastItem:r,onApprove:()=>{o.id?m(o):h(o)},onDeny:()=>d(!1)})]})},Fa=p(Me)`
|
|
322
322
|
display: flex;
|
|
323
323
|
align-items: center;
|
|
324
324
|
justify-content: center;
|
|
@@ -327,7 +327,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
327
327
|
padding: 32px;
|
|
328
328
|
border-radius: 16px;
|
|
329
329
|
border-style: dashed !important;
|
|
330
|
-
`,
|
|
330
|
+
`,Oa=({isSourcesListEmpty:n,goToSources:o,categories:a,potentialDestinations:r,testConnection:l,onClickSummary:s})=>{const c=m(),{setCurrentModal:d}=oe(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=mt();return e(i,{children:[t(re,{$isNotModal:!0,children:e(F,{$gap:12,children:[e(F,{$gap:24,children:[s&&t(vt,{onClick:s}),t(P,{title:g.ADD_DESTINATIONS,badgeLabel:u.length+p.length,description:g.ADD_DESTINATION_DESCRIPTION}),n&&t(le,{type:se.Warning,message:g.NO_SOURCES_GO_BACK,action:{label:g.SELECT_SOURCES,onClick:o}}),e(Fa,{variant:"secondary",onClick:()=>d(G.Destination),children:[t(Ii,{}),t(B,{color:c.colors.secondary,size:14,decoration:"underline",family:"secondary",children:g.ADD_DESTINATION})]})]}),t(Ea,{categories:a,withDelete:!0})]})}),t(Da,{isOnboarding:!0,categories:a,potentialDestinations:r,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:l})]})},Ia=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"type",title:g.TYPE,sortable:!0},{key:"signals",title:g.MONITORS},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],Ra=({metrics:i,maxHeight:n,maxWidth:o})=>{const a=m(),r=fe(),{selectedStreamName:l}=Ge(),{setDrawerType:s,setDrawerEntityId:d}=V(),{destinations:u,destinationsLoading:p}=Y(),h=c(()=>Ze(u,l),[u,l]),y=c(()=>qn({instrumentationRules:[],sources:[],actions:[],destinations:et(h,r),searchText:r.searchText,selectedCategory:G.Destination}).searchResults.find(({category:e})=>e===G.Destination)?.entities||[],[h,r]),v=c(()=>y.map(e=>{const{hasErrors:n,hasWarnings:o,hasDisableds:r}=pe(e.conditions||[]),{icon:l,iconSrc:c}=He(e.destinationType.type);return{status:n?se.Error:o?se.Warning:void 0,faded:r,onClick:()=>{s(G.Destination),d(e.id)},cells:[{columnKey:"icon",component:()=>t(xe,{icon:l,src:c})},{columnKey:"name",value:Se(e,G.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.destinationType.type,textColor:a.text.info},{columnKey:"throughput",value:Be(It(i,G.Destination,e.id).throughput),textColor:a.text.info},{columnKey:"signals",component:()=>t($e,{withLabels:!0,monitors:qe(e.exportedSignals)})},{columnKey:"conditions",component:()=>e.conditions?.length?t(jn,{conditions:e.conditions,id:e.id}):null},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(he,{status:e.disabled?se.Error:se.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[y,i]),{badge:f,badgeTooltip:b}=c(()=>y.length!==h.length?{badge:`${y.length}/${h.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:h.length,badgeTooltip:void 0},[y,h]);return e(Ce,{$maxWidth:o,children:[t(ke,{children:t(we,{icon:Te(G.Destination),title:g.DESTINATIONS,badge:f,badgeTooltip:b,loading:p})}),t(De,{$maxHeight:n,children:t(Ne,{columns:Ia,rows:v})}),!y.length&&t(Ee,{style:{marginTop:"2rem"},children:t(Ae,{})})]})},Ma=e=>{const{type:t,ruleName:i,notes:n,disabled:o,profileName:a,payloadCollection:r,codeAttributes:l,headersCollection:s,customInstrumentations:c}=e,d=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!o)},{title:g.NAME,value:i},{title:g.NOTES,value:n},{title:g.MANAGED_BY_PROFILE,value:a},{type:y.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[Rt.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Kt.Java]||[]).map(e=>new Mt(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:g.JAVA_CUSTOM_PROBES,value:e});const t=(c[Kt.Golang]||[]).map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:g.GOLANG_CUSTOM_PROBES,value:t})}return d},Ka=p.div`
|
|
331
331
|
display: flex;
|
|
332
332
|
flex-direction: column;
|
|
333
333
|
gap: 12px;
|
|
@@ -337,7 +337,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
337
337
|
border-radius: 16px;
|
|
338
338
|
padding: 8px;
|
|
339
339
|
`}
|
|
340
|
-
`,
|
|
340
|
+
`,La=[{id:Pt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Pt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Pt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Pa=[{id:Pt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Pt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Pt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],ja={[Kt.Java]:[new Mt("","")],[Kt.Golang]:[new Lt("")]},za=["*"],qa=p.div`
|
|
341
341
|
display: flex;
|
|
342
342
|
flex-direction: column;
|
|
343
343
|
gap: 12px;
|
|
@@ -347,27 +347,27 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
347
347
|
border-radius: 16px;
|
|
348
348
|
padding: 8px;
|
|
349
349
|
`}
|
|
350
|
-
`,
|
|
350
|
+
`,Ba=[{id:jt.HttpRequest,label:"Collect HTTP Request"},{id:jt.HttpResponse,label:"Collect HTTP Response"},{id:jt.DbQuery,label:"Collect DB Query"},{id:jt.Messaging,label:"Collect Messaging"}],Va={[zt.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]=n(1===d.length);o(()=>{if(!d.length){const e={[Pt.Column]:null,[Pt.FilePath]:!0,[Pt.Function]:!0,[Pt.LineNumber]:!0,[Pt.Namespace]:null,[Pt.StackTrace]:null};r("codeAttributes",e),p(!1)}},[]);const h=(e,t)=>{const i=t?[...d,e]:d.filter(t=>t!==e),n=Object.values(Pt).reduce((e,t)=>(e[t]=!!i.includes(t)||null,e),{});r("codeAttributes",n),p(1===i.length)};return e(i,{children:[e("div",{children:[t(x,{title:"Recommended data to collect",required:!0}),t(Ka,{$hasError:!!s,children:La.map(({id:e,label:i,tooltip:n})=>t(ye,{text:n,withIcon:!0,children:t(S,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!s&&t($,{children:s})]}),e("div",{children:[t(x,{title:"Verbose data to collect",required:!0}),t(Ka,{$hasError:!!s,children:Pa.map(({id:e,label:i,tooltip:n})=>t(ye,{text:n,withIcon:!0,children:t(S,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!s&&t($,{children:s})]})]})},[zt.CustomInstrumentation]:({value:i,setValue:n,formErrors:a})=>{const r=a.customInstrumentations,l=c(()=>(i?.customInstrumentations?.[Kt.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[i]),s=c(()=>(i?.customInstrumentations?.[Kt.Golang]||[]).map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=(e,t)=>{const i={};switch(t){case"java":i[Kt.Java]=e.map(e=>new Mt(e.className,e.methodName)),i[Kt.Golang]=s.map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":i[Kt.Golang]=e.map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),i[Kt.Java]=l.map(({key:e,value:t})=>new Mt(e,t))}n("customInstrumentations",i)};return o(()=>{i?.customInstrumentations||n("customInstrumentations",{[Kt.Golang]:ja[Kt.Golang],[Kt.Java]:ja[Kt.Java]})},[n,i]),e("div",{children:[t(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(N,{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"})]})},[zt.HeadersCollection]:({value:e,setValue:i,formErrors:n})=>{const a=n.headersCollection,r=c(()=>e?.headersCollection?.[Rt.HeaderKeys]||[],[e]),l=e=>{const t={[Rt.HeaderKeys]:e};i("headersCollection",t)};return o(()=>{r.length||l(za)},[r]),t("div",{children:r.length>0&&t(E,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>l(e),errorMessage:a})})},[zt.PayloadCollection]:({value:i,setValue:a,formErrors:r})=>{const l=r.payloadCollection,s=c(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[d,u]=n(1===s.length);return o(()=>{if(!s.length){const e={[jt.HttpRequest]:{},[jt.HttpResponse]:{},[jt.DbQuery]:{},[jt.Messaging]:{}};a("payloadCollection",e),u(!1)}},[]),e("div",{children:[t(x,{title:"Type of data to collect",required:!0}),t(qa,{$hasError:!!l,children:Ba.map(({id:e,label:i})=>t(S,{title:i,disabled:d&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e),n={[jt.HttpRequest]:i.includes(jt.HttpRequest)?{}:null,[jt.HttpResponse]:i.includes(jt.HttpResponse)?{}:null,[jt.DbQuery]:i.includes(jt.DbQuery)?{}:null,[jt.Messaging]:i.includes(jt.Messaging)?{}:null};a("payloadCollection",n),u(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[zt.UnknownType]:null},Ha=({ruleType:e,value:i,setValue:n,formErrors:o})=>{if(!e)return null;const a=Va[e];return a?t(a,{value:i,setValue:n,formErrors:o}):null},Wa=p.div`
|
|
351
351
|
display: flex;
|
|
352
352
|
flex-direction: column;
|
|
353
353
|
gap: 24px;
|
|
354
354
|
padding: 4px;
|
|
355
|
-
`,
|
|
355
|
+
`,_a=p(B)`
|
|
356
356
|
margin-bottom: 12px;
|
|
357
|
-
`,
|
|
357
|
+
`,Ua=({isUpdate:n,rule:o,formData:a,formErrors:r,handleFormChange:l})=>{const s=m();return e(Wa,{children:[t(O,{children:o.supportedLanguages.map(e=>t(qt,{icon:Bt(e),type:se.Info,children:ct[e]},e))}),n?e("div",{children:[t(_a,{children:"Status"}),t(K,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:s.text.success+L["050"]},{icon:Ai,label:g.DISABLED,value:!0,selectedBgColor:s.text.error+L["050"]}],selected:a.disabled,setSelected:e=>l("disabled",e)})]}):e(i,{children:[t(P,{title:"",description:o.docsDescription,actionButton:t(j,{endpoint:o.docsEndpoint})}),t(C,{title:"Rule name",placeholder:"Use a name that describes the rule",value:a.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:r.ruleName})]}),t(Ha,{ruleType:o.type,value:a,setValue:(e,t)=>l(e,t),formErrors:r}),t(q,{title:"Notes",value:a.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Ja=p.div`
|
|
358
358
|
width: 100%;
|
|
359
359
|
height: 100%;
|
|
360
360
|
max-height: calc(100vh - 220px);
|
|
361
361
|
overflow: overlay;
|
|
362
362
|
overflow-y: auto;
|
|
363
|
-
`,
|
|
363
|
+
`,Ga=p.div`
|
|
364
364
|
display: flex;
|
|
365
365
|
flex-direction: column;
|
|
366
366
|
gap: 12px;
|
|
367
|
-
`,
|
|
367
|
+
`,Ya=({updateInstrumentationRule:i,deleteInstrumentationRule:a})=>{const{instrumentationRules:r}=Y(),{addNotification:s}=Vt(),{drawerType:d,drawerEntityId:u}=V(),p=l(null),h=d===G.InstrumentationRule,[m,g]=n(!1),[y,v]=n(!1),{formData:f,formErrors:b,handleFormChange:x,resetFormData:S,validateForm:$,loadFormWithDrawerItem:C}=Ht(),k=c(()=>{if(u)return r?.find(e=>Z(e)===u)},[u,r]);if(o(()=>{h&&k?C(k):S()},[h,k]),!k)return null;const w=Wt.find(({type:e})=>e===k.type);return t(Fn,{ref:p,title:k.ruleName||k.type,icons:[Ve(k.type)],isEdit:m,isFormDirty:y,onEdit:e=>{k.mutable||!e&&void 0!==e?g("boolean"!=typeof e||e):s({type:se.Warning,title:ce.FORBIDDEN,message:ce.CANNOT_EDIT_RULE,crdType:G.InstrumentationRule,target:u,hideFromHistory:!0})},onSave:e=>{if($()){const t=e!==k.type?e:"";x("ruleName",t),i(u,{...f,ruleName:t}),g(!1),v(!1)}},onDelete:()=>{k.mutable?(a(u),g(!1),v(!1),p.current?.closeDrawer()):s({type:se.Warning,title:ce.FORBIDDEN,message:ce.CANNOT_DELETE_RULE,crdType:G.InstrumentationRule,target:u,hideFromHistory:!0})},onCancel:()=>{g(!1),v(!1),C(k)},children:m&&w?t(Ja,{children:t(Ua,{isUpdate:!0,rule:w,formData:f,formErrors:b,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(Ga,{children:[t(ee,{conditions:k.conditions||[]}),t(te,{title:"Instrumentation Rule Details",data:k?Ma(k):[]})]})})},Xa=p(F)`
|
|
368
368
|
margin-top: 24px;
|
|
369
369
|
gap: 12px;
|
|
370
|
-
`,
|
|
370
|
+
`,Za=Wt,Qa=({createInstrumentationRule:i})=>{const{tier:o}=je(),a=o===_t.Onprem,{currentModal:r,setCurrentModal:l}=oe(),s=r===G.InstrumentationRule,{formData:c,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=Ht(),[m,y]=n(void 0),v=()=>{p(),y(void 0),l("")},f=()=>{if(!h())return null;i(c),v()};return H({key:"Enter",active:s},()=>f()),t(ae,{isOpen:s,onClose:v,header:{title:"Add Instrumentation Rule"},actionComponent:t(ue,{buttons:[{variant:"primary",label:"DONE",onClick:f,disabled:!a||!m,tooltip:a?"":ce.ENTERPRISE_ONLY("Instrumentation Rules")}]}),children:e(re,{children:[t(P,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e(Xa,{children:[t(le,a?{type:se.Warning,message:ce.DEFINED_FOR_ALL_STREAMS(g.INSTRUMENTATION_RULES)}:{type:se.Default,message:ce.ENTERPRISE_ONLY(g.INSTRUMENTATION_RULES)}),t(de,{options:Za,selectedOption:m,onOptionSelect:e=>{return t=e,p(),void y(t);var t},autoFocus:!m?.type})]}),m?.type?e("div",{children:[t(A,{margin:"16px 0"}),t(Ua,{rule:m,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},er=e=>{const{payloadCollection:t,codeAttributes:i,customInstrumentations:n}=e;let o="";return t&&(o+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&(o+=Object.entries(i).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),n&&Object.values(Kt).forEach(e=>{const t=(n[e]||[]).filter(e=>e).join(", ");t&&(o+=o?`, ${t}`:t)}),o},tr=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"profile",title:g.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:g.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:g.NOTES,sortable:!0}],ir=({maxHeight:i,maxWidth:n})=>{const o=m(),a=fe(),{setDrawerType:r,setDrawerEntityId:l}=V(),{instrumentationRules:s,instrumentationRulesLoading:d}=Y(),u=c(()=>qn({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:a.searchText,selectedCategory:G.InstrumentationRule}).searchResults.find(({category:e})=>e===G.InstrumentationRule)?.entities||[],[s,a]),p=c(()=>u.map(e=>{const{hasErrors:i,hasWarnings:n,hasDisableds:a}=pe(e.conditions||[]);return{status:i?se.Error:n?se.Warning:void 0,faded:a,onClick:()=>{r(G.InstrumentationRule),l(e.ruleId)},cells:[{columnKey:"icon",component:()=>t(xe,{icon:Ve(e.type)})},{columnKey:"name",value:Se(e,G.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:er(e),textColor:o.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>t(jn,{conditions:e.conditions||[],id:e.ruleId})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(he,{status:e.disabled?se.Error:se.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})},{columnKey:"source-count",component:()=>t("div",{style:{lineHeight:1},children:t(he,{status:se.Info,title:"all sources",withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:y}=c(()=>u.length!==s.length?{badge:`${u.length}/${s.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[u,s]);return e(Ce,{$maxWidth:n,children:[t(ke,{children:t(we,{icon:Te(G.Action),title:g.INSTRUMENTATION_RULES,badge:h,badgeTooltip:y,loading:d})}),t(De,{$maxHeight:i,children:t(Ne,{columns:tr,rows:p})}),!u.length&&t(Ee,{style:{marginTop:"2rem"},children:t(Ae,{})})]})},nr=p.div`
|
|
371
371
|
position: fixed;
|
|
372
372
|
bottom: 0;
|
|
373
373
|
left: 50%;
|
|
@@ -381,7 +381,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
381
381
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
382
382
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
383
383
|
animation-name: ${Jt.in.center};
|
|
384
|
-
`,
|
|
384
|
+
`,or=({totalSourceCount:i,uninstrumentSources:o,restartWorkloads:r})=>{const l=m(),{selectedSources:s,setSelectedSources:d}=Ke(),[u,p]=n(!1),[h,g]=n(!1),y=c(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),v=()=>{d({})};return y?e(a,{children:[e(nr,{"data-id":"multi-source-control",children:[t(B,{children:"Selected sources"}),t(Oe,{label:y,filled:!0}),t(A,{orientation:"vertical",length:"16px"}),t(Me,{variant:"tertiary",onClick:v,children:t(B,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(Me,{variant:"tertiary",onClick:()=>g(!0),children:[t(qi,{}),t(B,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(Me,{variant:"tertiary",onClick:()=>p(!0),children:[t(Ni,{}),t(B,{family:"secondary",decoration:"underline",color:l.text.error,children:"Uninstrument"})]})]}),t(U,{isOpen:u,name:`${y} sources`,type:G.Source,isLastItem:y===i,onApprove:()=>{const e={};Object.entries(s).forEach(([t,i])=>{e[t]=i.map(e=>({...e,selected:!1}))}),o(e),p(!1),v()},onDeny:()=>p(!1)}),t(Ut,{isOpen:h,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",approveButton:{text:"Confirm",variant:se.Warning,onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.map(e=>Gt(e)))}),r(e),v()}},denyButton:{text:"Go Back",onClick:()=>g(!1)}})]}):null},ar=p.div`
|
|
385
385
|
position: relative;
|
|
386
386
|
width: fit-content;
|
|
387
387
|
`,rr=p(O)`
|
|
@@ -406,7 +406,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
406
406
|
border-radius: 32px;
|
|
407
407
|
width: fit-content;
|
|
408
408
|
padding: 2px 8px;
|
|
409
|
-
`,dr=()=>{const i=m(),{notifications:n,markAsSeen:
|
|
409
|
+
`,dr=()=>{const i=m(),{notifications:n,markAsSeen:o}=Vt(),a=n.filter(({hideFromHistory:e})=>!e),r=a.filter(({seen:e})=>!e),l=r.length,{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=it({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&r.forEach(({id:e})=>o(e))}});return e(ar,{children:[t(I,{onClick:()=>{p(0,0),d(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:i.colors.orange_og,children:t(Bi,{size:18})}),e(nt,{ref:s,isOpen:c,right:u.left,maxWidth:"400px",header:e(rr,{children:[t(B,{size:20,children:"Notifications"}),!!l&&e(cr,{size:12,family:"secondary",children:[l," new"]})]}),children:[t(lr,{children:a.length?a.map(e=>t(yr,{...e,onClick:()=>d(!1)},`notification-${e.id}`)):t(Ae,{title:"No notifications",subTitle:""})}),t(sr,{})]})]})},ur=p.div`
|
|
410
410
|
display: flex;
|
|
411
411
|
align-items: flex-start;
|
|
412
412
|
gap: 12px;
|
|
@@ -436,16 +436,16 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
436
436
|
display: flex;
|
|
437
437
|
align-items: center;
|
|
438
438
|
gap: 6px;
|
|
439
|
-
`,yr=({id:n,seen:
|
|
439
|
+
`,yr=({id:n,seen:o,type:a,title:r,message:l,time:s,crdType:c,target:d,onClick:u})=>{const p=m(),{formatTimeAgo:h}=Yt(),{onClickNotification:g}=Xt(),y=!!c&&!!d,v=r?.toLowerCase().includes(ne.Delete.toLowerCase())||!1,f=ve(a,p);return e(ur,{className:y?"click-enabled":"",onClick:()=>{y&&(u(),g({id:n,crdType:c,target:d}))},children:[t(pr,{$type:v?se.Error:a,children:t(v?Ni:f,{})}),e(hr,{children:[t(mr,{children:t(B,{size:14,children:l})}),e(gr,{children:[t(B,{size:10,color:p.text.grey,children:h(s)}),!o&&e(i,{children:[t(B,{size:10,children:"·"}),t(B,{size:10,color:p.colors.orange_soft,children:"new"})]})]})]})]},`notification-${n}`)},vr=({theme:e,nodes:t,serviceMap:i})=>{const n=[],o=new Map(i.map(e=>[e.serviceName,e]));return t.forEach(({id:t,data:{id:i,status:a}})=>{const{services:r}=o.get(i)??{services:[]};r.forEach(i=>{const o=`${G.Source}-${i.serviceName}-${Zt.MapItem}`,r=a===se.Error;n.push({id:`${t}-to-${o}`,source:t,target:o,markerEnd:{type:tn.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),n},fr=(e,t,i)=>{const n=e?.serviceName||t?.otelServiceName||t?.name,o=i?[Vi]:t?We(t):[],{priorotizedStatus:a}=pe(t?.conditions||[]);return{id:n,title:n,icons:o.length?o:[Hi],status:a,serviceMapEntry:e}},br=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,xr=new an,Sr={"elk.algorithm":"layered","elk.direction":"DOWN","elk.layered.spacing.nodeNodeBetweenLayers":"100","elk.spacing.nodeNode":"80"},$r=p.div`
|
|
440
440
|
width: 100%;
|
|
441
441
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
442
442
|
position: relative;
|
|
443
|
-
`,
|
|
443
|
+
`,Cr={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},kr=({heightToRemove:e,serviceMap:i})=>{const n=m(),{sources:a}=Y(),[r,s,c]=nn([]),[d,u,p]=on([]),h=l([]);h.current=r;const y=l(n);return y.current=n,o(()=>{let e=!1;const t=[Cr].concat(a),n=(({sources:e,serviceMap:t})=>{const i=[],n=new Set,o=new Map,a={x:0,y:0};return t.length&&e.length?(t.forEach(t=>{const r=t.serviceName,l=`${G.Source}-${r}-${Zt.MapItem}`;if(n.has(l))return;const s=e.find(e=>r===e.otelServiceName||r===e.name);o.set(r,t),t.services.forEach(e=>o.set(e.serviceName,{serviceName:e.serviceName,services:[]})),n.add(l),i.push({id:l,type:Zt.MapItem,position:a,data:fr(t,s,br(s))})}),o.forEach((t,o)=>{const r=`${G.Source}-${o}-${Zt.MapItem}`;if(n.has(r))return;const l=e.find(e=>o===e.otelServiceName||o===e.name);n.add(r),i.push({id:r,type:Zt.MapItem,position:a,data:fr(t,l,br(l))})}),e.forEach(e=>{const t=e.otelServiceName||e.name,o=`${G.Source}-${t}-${Zt.MapItem}`;n.has(o)||(n.add(o),i.push({id:o,type:Zt.MapItem,position:a,data:fr(void 0,e,br(e))}))})):i.push({id:`${G.Source}-${Zt.NoData}`,type:Zt.NoData,position:a,data:{subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}}),i})({serviceMap:i,sources:t});if(1===n.length&&n[0].id===`${G.Source}-${Zt.NoData}`)return s(n),void u([]);const o=new Map(h.current.map(e=>[e.id,e.position]));if(!n.some(e=>!o.has(e.id)))return s(n.map(e=>({...e,position:o.get(e.id)??e.position}))),void u(vr({theme:y.current,nodes:n,serviceMap:i}));const r=vr({theme:y.current,nodes:n,serviceMap:i});return(async(e,t,i={})=>{const n={id:"root",layoutOptions:{...Sr,...i},children:e.map(e=>({id:e.id,width:80,height:80})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},o=await xr.layout(n),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,r).then(({nodes:t})=>{if(e)return;const o=new Map(h.current.map(e=>[e.id,e.position]));s(t.map(e=>({...e,position:o.get(e.id)??e.position}))),u(vr({theme:y.current,nodes:n,serviceMap:i}))}),()=>{e=!0}},[i,a]),o(()=>{h.current.length&&u(vr({theme:n,nodes:h.current,serviceMap:i}))},[n,i]),t($r,{$heightToRemove:e,children:t(Qt,{nodes:r,edges:d,onNodesChange:c,onEdgesChange:p,zoomOnScroll:!0})})},wr=p.div`
|
|
444
444
|
width: 100%;
|
|
445
445
|
padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
|
|
446
446
|
border-radius: 16px;
|
|
447
447
|
background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+L["024"]:t.colors.dropdown_bg_2+L["040"]};
|
|
448
|
-
`,
|
|
448
|
+
`,Tr=p.div`
|
|
449
449
|
display: flex;
|
|
450
450
|
justify-content: space-between;
|
|
451
451
|
gap: 12px;
|
|
@@ -457,26 +457,26 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
457
457
|
background-color: ${({$withClick:e,$selected:t,theme:i})=>e&&(t?i.colors.majestic_blue+L["040"]:i.colors.dropdown_bg_2+L["080"])};
|
|
458
458
|
transition: background-color 0.3s;
|
|
459
459
|
}
|
|
460
|
-
`,
|
|
460
|
+
`,Dr=p(Tr)`
|
|
461
461
|
width: calc(100% - 100px);
|
|
462
462
|
margin: 0 auto;
|
|
463
463
|
padding: 8px;
|
|
464
|
-
`,
|
|
464
|
+
`,Nr=p.div`
|
|
465
465
|
position: relative;
|
|
466
466
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
467
|
-
`,
|
|
467
|
+
`,Er=p.div`
|
|
468
468
|
position: absolute;
|
|
469
469
|
top: 6px;
|
|
470
470
|
left: 18px;
|
|
471
|
-
`,
|
|
471
|
+
`,Ar=p(Ee)`
|
|
472
472
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
473
|
-
`,
|
|
473
|
+
`,Fr=p.div`
|
|
474
474
|
width: ${({$width:e})=>`${e||42}px`};
|
|
475
475
|
display: flex;
|
|
476
476
|
align-items: center;
|
|
477
477
|
justify-content: flex-end;
|
|
478
478
|
text-align: right;
|
|
479
|
-
`,
|
|
479
|
+
`,Or=Te(G.Namespace),Ir=({isModal:i=!1,withInstances:n=!0,loading:o,filteredNamespacesAndSources:a,selectedNamespace:r,onSelectNamespace:l,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const p=m(),{isVm:h}=je(),{namespacesLoading:y}=Y(),v=Object.entries(a||{});return v?.length?t(ze,{height:i?"calc(100vh - 510px)":"calc(100vh - 310px)",gap:12,noAnimation:!0,elements:v.map(([i,a])=>{const m=s?.[i]||[],v=d?.[i]?.selected||!1,f=m.filter(({selected:e})=>e),b=m.length>0,x=r===i,$=f.length>0&&f.length===a.length,C=f.length>0&&f.length!==a.length,k=a.length>0,w=1===a.length;return l||k?e(wr,{"data-id":`namespace-${i}`,$selected:$,$isOpen:x,children:[e(Tr,{$selected:$,$withClick:!!l,onClick:()=>l?.(i),children:[e(O,{$gap:12,children:[l&&t(S,{partiallyChecked:C,value:$,onChange:e=>l(i,e)}),t(Or,{}),t(B,{children:i})]}),e(O,{$gap:24,children:[!h&&u&&t(D,{title:g.FUTURE_APPS_TITLE,tooltip:g.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,i),flipHorizontally:!0}),t(Fr,{children:t(B,{size:10,color:p.text.grey,children:b?`${f.length}/${a.length}`:null})}),l&&t(yt,{extend:x})]})]}),(x||!l)&&(k?e(Nr,{$addPadding:!c,children:[t(Er,{children:t(A,{orientation:"vertical",length:(w?24:34*a.length)+"px"})}),a.map(e=>{const o=f.some(({name:t})=>t===e.name);return t(Rr,{withInstances:n,source:e,namespace:i,isSelected:o,onSelect:c},`source-${e.name}`)})]}):t(Ar,{$addPadding:!c,children:y||o?t(Re,{}):t(Ae,{title:g.NO_SOURCES_NAMESPACE,subTitle:g.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${i}`):null})}):t(Ee,{children:y||o?t(Re,{}):t(Ae,{title:g.NO_SOURCES,subTitle:!h&&l?g.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:g.PLEASE_ADD_SOURCE})})},Rr=({withInstances:i,source:n,namespace:o,isSelected:a,onSelect:r})=>t(Dr,{"data-id":`source-${n.name}`,$selected:a,$withClick:!!r,onClick:()=>r?.(n),children:e(O,{$gap:12,children:[r&&t(S,{value:a,onChange:()=>r(n,o)}),e(O,{$gap:4,children:[t(B,{children:n.name}),e(B,{opacity:.8,size:10,children:[i?` • ${n.numberOfInstances||0} running instance${1!==n.numberOfInstances?"s":""}`:"",` • ${n.kind}`]})]})]})}),Mr=p.div`
|
|
480
480
|
display: flex;
|
|
481
481
|
flex-direction: column;
|
|
482
482
|
align-items: center;
|
|
@@ -485,35 +485,35 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
485
485
|
max-height: calc(100vh - 200px);
|
|
486
486
|
height: fit-content;
|
|
487
487
|
overflow-y: scroll;
|
|
488
|
-
`,
|
|
488
|
+
`,Kr=({onEditStream:i,onEditSources:n,onEditDestinations:o,categories:a})=>{const{selectedStreamName:r}=Ge(),{configuredSources:l,configuredDestinations:s,configuredDestinationsUpdateOnly:d}=mt(),u=c(()=>Object.values(l).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[l]);return t(re,{$isNotModal:!0,children:e(F,{$gap:12,children:[t(P,{title:g.SUMMARY,description:g.STREAM_CONFIRM}),e(Mr,{children:[t(te,{title:g.STREAM_NAME,action:()=>t(ei,{onClick:i}),data:[{title:"",value:r}]}),t(te,{title:g.SELECTED_SOURCES,titleBadge:u,action:()=>t(ei,{onClick:n}),children:t(Ir,{filteredNamespacesAndSources:l,withInstances:!1})}),t(te,{title:g.SELECTED_DESTINATIONS,titleBadge:s.length+d.length,action:()=>t(ei,{onClick:o}),children:t(Ea,{categories:a})})]})]})})};var Lr;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(Lr||(Lr={}));const Pr=({onClickId:e,defaultSelectedId:i,extendedNavIcons:o})=>{const{isVm:a}=je(),[r,l]=n(i||""),s=c(()=>[{id:Lr.Overview,icon:Wi,selected:r===Lr.Overview,onClick:()=>{l(Lr.Overview),e(Lr.Overview)},tooltip:"Overview"},...(o||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{l(e.id),e.onClick()}}))],[r]),d=c(()=>{const t=[{id:Lr.Sources,icon:_i,selected:r===Lr.Sources,onClick:()=>{l(Lr.Sources),e(Lr.Sources)},tooltip:"Sources"},{id:Lr.Destinations,icon:Ui,selected:r===Lr.Destinations,onClick:()=>{l(Lr.Destinations),e(Lr.Destinations)},tooltip:"Destinations"}];return a||(t.push({id:Lr.InstrumentationRules,icon:Ji,selected:r===Lr.InstrumentationRules,onClick:()=>{l(Lr.InstrumentationRules),e(Lr.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:Lr.Actions,icon:Gi,selected:r===Lr.Actions,onClick:()=>{l(Lr.Actions),e(Lr.Actions)},tooltip:"Actions"})),t},[a,r]);return t(ti,{orientation:"vertical",mainIcons:s,subIcons:d})},jr=({})=>t(I,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community",children:t(Yi,{})}),zr=(e,t)=>{const{name:i,kind:n,namespace:o}=e,a=[{title:g.KIND,value:n},{title:g.NAME,value:i,tooltip:"Resource name"}];return t||(a.unshift({title:g.NAMESPACE,value:o}),a.push({type:y.Divider}),a.push({type:y.CopyText,value:`kubectl get ${n} ${i} -n ${o}`.toLowerCase()})),a},qr=p.div`
|
|
489
489
|
display: flex;
|
|
490
490
|
flex-direction: column;
|
|
491
491
|
gap: 24px;
|
|
492
492
|
padding: 4px;
|
|
493
|
-
`,
|
|
493
|
+
`,Br=({formData:e,handleFormChange:i})=>t(qr,{children:t(C,{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}})=>i("otelServiceName",e)})}),Vr=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const i=ii(e?.status),n=lt(e?.reasonEnum),o=e?.message;return t(O,{$alignItems:"center",$justifyContent:"center",children:t(he,{status:i,title:n,subtitle:o,withBackground:i!==me.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},Hr=({source:i,fetchSourceDescribe:a,onClickRestartPod:r})=>{const[l,s]=n(!1),[c,d]=n(null);return o(()=>{i&&a({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):s(!0)})},[i.namespace,i.name,i.kind]),c||l?t(F,{$gap:12,children:l?t(Ee,{$height:"70vh",children:t(Ae,{subTitle:"Could not fetch describe for this source"})}):c?.pods?.length?c.pods.map(({podName:n,nodeName:o,phase:a,agentInjected:l,runningLatestWorkloadRevision:s,containers:d,manifestYAML:p})=>{const h=a.status!==se.Success||ni(d)?se.Error:se.Success,m=[];return m.push(t(oi,{value:`kubectl get pod ${n.value} -n ${c?.namespace?.value||i.namespace}`.toLowerCase()},"copy-text")),m.push(t(A,{length:"100%",margin:"0"},"divider-1")),m.push(t(ai,{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(ai,{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(ai,{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(ai,{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(ri,{...e},`pod-container-${e.containerName.value}`))}),p&&(m.push(t(A,{length:"100%",margin:"0"},"divider-6")),m.push(t(rn,{yaml:p},"yaml-section-card"))),t(te,{title:`Pod: ${n.value}`,withExtend:!0,action:({hovered:o})=>e("div",{style:{position:"relative"},children:[t(he,{status:h,title:h,withIcon:!0,withBorder:!0},"status"),o&&t(li,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:si(),label:"Restart",rightIcon:Ri,onClick:()=>r(c?.namespace?.value||i.namespace,n.value)}]:[]},"hover-actions")]}),children:u.toArray(m)},`pod-${n.value}`)}):t(Ee,{$height:"70vh",children:t(Ae,{subTitle:"Check if you have any running pods and try again"})})}):t(Ee,{$height:"70vh",children:t(Re,{})})},Wr=p(O)`
|
|
494
494
|
width: 100%;
|
|
495
495
|
align-items: center;
|
|
496
496
|
justify-content: space-between;
|
|
497
|
-
`,
|
|
497
|
+
`,_r=({source:i,fetchSourceLibraries:r})=>{const l=m(),[s,c]=n(!1),[d,u]=n(null);return o(()=>{i&&r({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?u(Et(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):c(!0)})},[i.namespace,i.name,i.kind]),d||s?t(F,{$gap:12,children:s?t(Ee,{$height:"70vh",children:t(Ae,{subTitle:"Could not fetch libraries for this source"})}):d?.length?t(te,{title:"Instrumented Libraries",children:d.map(({name:i,healthy:n,message:o,nonIdentifyingAttributes:r},s)=>e(a,{children:[e(F,{$gap:4,$width:"100%",children:[e(Wr,{$width:"100%",children:[t(B,{size:12,color:l.text.grey,children:i}),e(O,{$gap:4,children:[r.map(({key:e,value:n})=>ci(n)&&di(n)&&"is_standard_lib"===e?t(he,{status:se.Default,title:"STANDARD",withBorder:!0},`${i}-${e}`):null),"boolean"==typeof n&&t(he,{status:n?se.Success:se.Error,title:n?"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-${i}`))}):e(Ee,{$height:"70vh",$gap:12,children:[t(Ae,{title:"No libraries found",subTitle:""}),t(le,{type:se.Warning,message:"This feature is in early development, and has very limited support"})]})}):t(Ee,{$height:"70vh",children:t(Re,{})})};var Ur;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Ur||(Ur={}));const Jr=[pi.Deployment,pi.StatefulSet,pi.DaemonSet,pi.DeploymentConfig,pi.Rollout,pi.StaticPod],Gr=[pi.Deployment,pi.StatefulSet,pi.DaemonSet,pi.DeploymentConfig,pi.Rollout,pi.Pod],Yr=[hi.Python,hi.Go,hi.Java],Xr=p.div`
|
|
498
498
|
width: 100%;
|
|
499
499
|
height: 100%;
|
|
500
500
|
max-height: calc(100vh - 220px);
|
|
501
501
|
overflow: overlay;
|
|
502
502
|
overflow-y: auto;
|
|
503
|
-
`,
|
|
503
|
+
`,Zr=p.div`
|
|
504
504
|
display: flex;
|
|
505
505
|
flex-direction: column;
|
|
506
506
|
gap: 12px;
|
|
507
|
-
`;var
|
|
507
|
+
`;var Qr;!function(e){e.Workload="Workload",e.Pod="Pod"}(Qr||(Qr={}));const el=({persistSources:a,updateSource:r,restartWorkloads:s,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,restartPod:h,recoverFromRollback:m})=>{const{isVm:y}=je(),{sources:v}=Y(),{selectedStreamName:f}=Ge(),{drawerType:b,drawerEntityId:x}=V(),S=c(()=>Xe(v,f),[v,f]),$=l(null),C=b===G.Source,[k,w]=n(!1),[T,D]=n(!1),[N,E]=n(Ur.Overview),[A,F]=n(null);o(()=>{C&&x&&d(x).then(e=>F(e||null))},[C,x]);const{formData:O,handleFormChange:I,resetFormData:R,loadFormWithDrawerItem:M}=ui(),K=c(()=>{if(x)return A&&JSON.stringify(Gt(A))===JSON.stringify(Gt(x))?A:S?.find(e=>JSON.stringify(Gt(e))===JSON.stringify(Gt(x)))},[x,S,A]);o(()=>{C&&K?M(K):R()},[C,K]);const L=c(()=>{const e=K?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===me.Loading,containers:K?.containers||[]}},[K]),P=c(()=>!!K?.rollbackOccurred,[K?.rollbackOccurred]),j=c(()=>{const e=[{label:Ur.Overview,onClick:()=>E(Ur.Overview),selected:N===Ur.Overview}];return y||(Jr.includes(K?.kind)&&e.push({label:Ur.Pods,onClick:()=>E(Ur.Pods),selected:N===Ur.Pods}),K?.containers?.some(({language:e})=>Yr.includes(e))&&e.push({label:Ur.Libraries,onClick:()=>E(Ur.Libraries),selected:N===Ur.Libraries})),e},[N,K,y]),z=Gr.includes(K?.kind),[q,H]=n({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});return K?e(Fn,{ref:$,onClose:()=>{E(Ur.Overview),F(null)},title:K.otelServiceName||K.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:We(K),isEdit:k,isFormDirty:T,onEdit:N===Ur.Overview?e=>{w("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=O.otelServiceName!==K.name?O.otelServiceName:"";I("otelServiceName",e),await r(x,{...O,otelServiceName:e}),F(null),D(!1),w(!1)},onDelete:N===Ur.Overview?async()=>{const{namespace:e}=K;a({[e]:[{...K,selected:!1,currentStreamName:f}]},{}),F(null),D(!1),w(!1),$.current?.closeDrawer()}:void 0,onCancel:()=>{D(!1),w(!1),I("otelServiceName",K.otelServiceName||K.name||"")},isLastItem:1===S.length,tabs:j,headerActionButtons:y?[]:z?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>H({openFor:Qr.Workload,workloadId:x}),children:e(i,{children:[t(qi,{}),t(B,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[N===Ur.Overview?k?t(Xr,{children:t(Br,{formData:O,handleFormChange:(...e)=>{D(!0),I(...e),I("currentStreamName",f)}})}):e(Zr,{children:[t(Vr,{workloadOdigosHealthStatus:K.workloadOdigosHealthStatus}),P&&t(le,{type:se.Warning,message:g.ROLLBACK_OCCURRED_MESSAGE,action:{label:g.ROLLBACK_RECOVER,onClick:async()=>{await m(x);const e=await d(x);e&&F(e)}}}),t(ee,{conditions:K.conditions||[]}),t(te,{title:g.SOURCE_DETAILS,data:K?zr(K,y):[]}),t(te,{title:y?g.DETECTED_PROCESSES:g.DETECTED_CONTAINERS,titleBadge:L.isLoading?me.Loading:L.containers.length,description:L.description||(y?g.DETECTED_PROCESSES_DESCRIPTION:g.DETECTED_CONTAINERS_DESCRIPTION),children:L.containers.map(e=>t(mi,{...e,callbackRuntimeOverride:e=>r(x,e)},`source-container-${e.containerName}`))}),K.manifestYAML&&t(rn,{title:`${K.kind} YAML`,yaml:K.manifestYAML,defaultOpen:!K.instrumentationConfigYAML}),K.instrumentationConfigYAML&&t(rn,{title:"Instrumentation Config YAML",yaml:K.instrumentationConfigYAML,defaultOpen:!K.manifestYAML})]}):N===Ur.Pods?t(Hr,{source:K,fetchSourceDescribe:u,onClickRestartPod:z?(e,t)=>H({openFor:Qr.Pod,podNamespace:e,podName:t}):void 0}):t(_r,{source:K,fetchSourceLibraries:p}),t(Ut,{isOpen:!!q.openFor,title:`Rollout Restart ${q.openFor}`,description:`Are you sure you want to rollout restart this ${q.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:se.Warning,onClick:()=>{q.openFor===Qr.Workload&&q.workloadId?s([q.workloadId]):q.openFor===Qr.Pod&&q.podNamespace&&q.podName&&h(q.podNamespace,q.podName),H({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{H({openFor:null})}}})]}):null},tl=p.div`
|
|
508
508
|
max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
|
|
509
509
|
width: 100%;
|
|
510
|
-
`,
|
|
510
|
+
`,il=r(({isModal:i,fetchNamespacesWithWorkloads:n,onClickSummary:o},a)=>{const r=m(),{isVm:l}=je(),c=gi({fetchNamespacesWithWorkloads:n}),{selectedSources:d,loading:u,selectedAllNamespaces:p,onSelectAllNamespaces:h,getApiSourcesPayload:y,getApiFutureAppsPayload:v,searchText:f,setSearchText:b,searchBy:x,setSearchBy:S,showSelectedOnly:$,setShowSelectedOnly:k,showRunningOnly:w,setShowRunningOnly:T}=c;s(a,()=>({getFormValues:()=>({apps:y(),futureApps:v()})}));const N=Object.values(d).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return t(re,{$isNotModal:!i,children:e(F,{$gap:12,children:[e(F,{$gap:24,children:[o&&t(vt,{onClick:o}),t(P,{title:g.SELECT_SOURCES,badgeLabel:N,description:g.SELECT_SOURCES_DESCRIPTION}),e(O,{$justifyContent:"space-between",children:[t(tl,{$fullWidth:l,children:t(C,{placeholder:x===G.Source?g.SEARCH_SOURCES:g.SEARCH_NAMESPACES,icon:Mi,value:f,onChange:e=>b(e.target.value.toLowerCase())})}),!l&&t(K,{options:[{label:g.SOURCE,value:G.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:g.NAMESPACE,value:G.Namespace,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary}],selected:x,setSelected:S})]}),e(O,{$gap:36,children:[t(D,{title:g.SELECT_ALL,initialValue:p,onChange:h,disabled:u}),t(D,{title:g.ONLY_SELECTED,initialValue:$,onChange:k}),t(D,{title:g.ONLY_RUNNING_INSTANCES,initialValue:w,onChange:T})]})]}),t(A,{}),t(Ir,{isModal:i,...c})]})})});il.displayName=il.name;const nl=({fetchNamespacesWithWorkloads:e,persistSources:i})=>{const{currentModal:n,setCurrentModal:o}=oe(),a=n===G.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),r()}},c=l(null);return H({key:"Enter",active:a},s),a?t(ae,{isOpen:a,onClose:r,header:{title:"Add Source"},actionComponent:t(ue,{buttons:[{label:"DONE",variant:"primary",onClick:s}]}),children:t(il,{ref:c,isModal:!0,fetchNamespacesWithWorkloads:e})}):null},ol=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:g.NAMESPACE,sortable:!0}),t.push({key:"containers",title:g.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},al=({metrics:i,maxHeight:n,maxWidth:o})=>{const a=m(),{isVm:r}=je(),l=fe(),{selectedStreamName:s}=Ge(),{sources:u,sourcesLoading:p}=Y(),{setDrawerType:h,setDrawerEntityId:y}=V(),{selectedSources:v,setSelectedSources:f}=Ke(),{progress:b}=_e(),x=c(()=>b[Ue.Instrumenting]||b[Ue.Uninstrumenting]?b[Ue.Instrumenting]?.percentage||b[Ue.Uninstrumenting]?.percentage||0:void 0,[b[Ue.Instrumenting],b[Ue.Uninstrumenting]]),$=c(()=>Xe(u,s),[u,s]),C=c(()=>qn({instrumentationRules:[],sources:Qe($,l),actions:[],destinations:[],searchText:l.searchText,selectedCategory:G.Source}).searchResults.find(({category:e})=>e===G.Source)?.entities||[],[$,l]),[k,w]=c(()=>{let e=0;return Object.values(v).forEach(t=>{e+=t.length}),[0!==e,e]},[v]),T=d(e=>{if(e){const e={};C.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),f(e)}else f({})},[C]),D=d(e=>{const{namespace:t,name:i,kind:n}=e,o={...v};o[t]||(o[t]=[]);const a=o[t].findIndex(e=>e.name===i&&e.kind===n);-1===a?o[t].push(e):o[t].splice(a,1),f(o)},[v]),N=c(()=>C.map(n=>{const o=Gt(n),r=JSON.stringify(o),{hasErrors:l,hasWarnings:s,hasDisableds:c}=pe(n.conditions||[]),d=!!v[o.namespace]?.find(e=>e.namespace===o.namespace&&e.name===o.name&&e.kind===o.kind);return{status:l?se.Error:s?se.Warning:void 0,faded:c,onClick:()=>{h(G.Source),y(o)},cells:[{columnKey:"checkbox-and-icon",component:()=>e(O,{$gap:16,children:[t(S,{value:d,onChange:()=>D(n)}),t(yi,{icons:We(n),id:r})]})},{columnKey:"name",value:Se(n,G.Source,{extended:!0})},{columnKey:"kind",value:n.kind,textColor:a.text.info},{columnKey:"namespace",value:n.namespace,textColor:a.text.info},{columnKey:"throughput",value:Be(It(i,G.Source,o).throughput),textColor:a.text.info},{columnKey:"conditions",component:()=>t(jn,{conditions:n.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(he,{status:se.Info,title:vi(n.containers),withBorder:!0})})}]}}),[C,v,i,D]),{badge:E,badgeTooltip:A}=c(()=>C.length!==$.length?{badge:`${C.length}/${$.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:$.length,badgeTooltip:void 0},[C,$]);return e(Ce,{$maxWidth:o,children:[e(ke,{children:[t(S,{partiallyChecked:k&&C?.length!==w,value:k&&C?.length===w,onChange:T,disabled:!C?.length}),t(we,{icon:Te(G.Source),title:g.SOURCES,badge:E,badgeTooltip:A,loading:p||"number"==typeof x})]}),t(De,{$maxHeight:n,children:t(Ne,{columns:ol(r),rows:N})}),"number"!=typeof x||N.length?N.length?null:t(Ee,{style:{marginTop:"2rem"},children:t(Ae,{})}):e(Ee,{style:{marginTop:"2rem",gap:"24px"},children:[t(Fe,{width:420}),e(O,{$gap:16,children:[e(B,{color:a.text.info,children:[b[Ue.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Oe,{label:`${x}%`})]})]})]})},rl=({expiresAt:t})=>{const i=m(),{formatTimeAgo:n}=Yt(),o=n(t),a=new Date(t).toDateString().split(" ").slice(1).join(" "),r=fi(t,0)?i.text.error:fi(t,6048e5)?i.text.warning:i.text.success;return e(B,{size:14,color:r,children:[o," (",a,")"]})},ll=p.div`
|
|
511
511
|
position: relative;
|
|
512
|
-
`,
|
|
512
|
+
`,sl=({token:i,saveToken:o})=>{const{CopyButton:a}=bi(),{formData:r,handleFormChange:l,resetFormData:s}=xi({token:i}),[c,d]=n(!1),u=()=>{d(!1),s()};return e(O,{$gap:0,children:[t(a,{value:i,size:Si.L}),t(A,{orientation:"vertical",length:"12px"}),e(ll,{children:[t(I,{size:32,onClick:()=>{d(!0)},children:t(Fi,{})}),c&&t($i,{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(C,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>l("token",e.target.value)})})]})]})},cl=({tokens:e,saveToken:i})=>t(te,{title:"Authorization Tokens",titleBadge:e.length,data:[{type:y.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:n,expiresAt:o})=>({cells:[{columnKey:"icon",icon:Xi},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(rl,{expiresAt:o})},{columnKey:"actions",component:()=>t(sl,{token:n,saveToken:i})}]}))}}]}),dl=({fetchDescribeOdigos:a})=>{const[r,l]=n(null);if(o(()=>{a().then(({data:e})=>l(e?.describeOdigos||null))},[]),!r)return t(Ee,{children:t(Re,{})});const s=e=>e?.name?[t(A,{},`divider-${e.name}`),t(ai,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(ci(e.value)?di(e.value)?se.Success:se.Error:se.Default),text:e.value}},`describe-row-${e.name}`)]:[];return e(i,{children:[t(te,{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(te,{title:"Cluster Collector",withExtend:!0,children:Object.values(r?.clusterCollector||{}).map(s)}),t(te,{title:"Node Collector",withExtend:!0,children:Object.values(r?.nodeCollector||{}).map(s)})]})},ul=p.div`
|
|
513
513
|
display: flex;
|
|
514
514
|
flex-direction: column;
|
|
515
515
|
gap: 12px;
|
|
516
|
-
`,
|
|
516
|
+
`,pl="System Overview",hl=({tokens:o,saveToken:a,fetchDescribeOdigos:r})=>{const[l,s]=n(!1),c=()=>s(e=>!e);return e(i,{children:[t(I,{onClick:c,tooltip:pl,children:t(Zi,{size:18})},pl),t(_,{width:"750px",isOpen:l,onClose:c,header:{icons:[Zi],title:pl},footer:{isOpen:!1},children:e(ul,{children:[!!o?.length&&t(cl,{tokens:o,saveToken:a}),t(dl,{fetchDescribeOdigos:r})]})})]})},ml=p.div`
|
|
517
517
|
position: fixed;
|
|
518
518
|
bottom: 12px;
|
|
519
519
|
left: 12px;
|
|
@@ -522,7 +522,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
522
522
|
flex-direction: column-reverse;
|
|
523
523
|
gap: 6px;
|
|
524
524
|
max-width: 600px;
|
|
525
|
-
`,
|
|
525
|
+
`,gl=()=>{const{notifications:e,markAsDismissed:i,markAsSeen:n}=Vt(),{onClickNotification:o}=Xt();return t(ml,{children:e.filter(({dismissed:e})=>!e).map(({id:e,type:a,title:r,message:l,crdType:s,target:c})=>t(le,{id:e,type:a,title:r,message:l,action:s&&c?{label:"go to details",onClick:()=>o({id:e,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{i(e),n(e)})({id:e,asSeen:!0})},`toast-${e}`))})},yl=p.div`
|
|
526
526
|
position: relative;
|
|
527
527
|
display: flex;
|
|
528
528
|
align-items: center;
|
|
@@ -541,7 +541,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
541
541
|
stroke: ${({theme:e})=>e.text.secondary};
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
`,
|
|
544
|
+
`,vl=p.div`
|
|
545
545
|
position: absolute;
|
|
546
546
|
top: 2px;
|
|
547
547
|
left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
|
|
@@ -551,50 +551,50 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
551
551
|
background-color: ${({theme:e})=>e.colors.border};
|
|
552
552
|
border-radius: 100%;
|
|
553
553
|
transition: all 0.3s;
|
|
554
|
-
`,
|
|
554
|
+
`,fl=({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})}),bl=()=>{const{darkMode:i,setDarkMode:n}=Ci();return e(yl,{onClick:()=>n(!i),children:[t(fl,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),t(fl,{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(vl,{$darkMode:i})]})},xl=e=>{const{spans:t}=e,i=new Map;t.forEach(e=>{i.set(e.spanID,{...e,spans:[]})});const n=[];return t.forEach(e=>{const t=i.get(e.spanID);let o=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&i.has(t.spanID)||(o=!0)}else o=!0;if(o)n.push(t);else{const n=e.references.find(e=>"CHILD_OF"===e.refType);if(n){const e=i.get(n.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),n.sort((e,t)=>e.startTime-t.startTime)},Sl=(e,t)=>{const{tags:i}=e,n={},o=[];return i.forEach(e=>{n[e.key]=e.value}),o.push({type:y.Code,value:{language:"json",code:JSON.stringify(n,null,2),pretty:t}}),o},$l=e=>{const{logs:t}=e,i=[];return t.forEach((e,n)=>{e.fields.forEach(e=>{i.push({title:e.key,value:e.value})}),n!==t.length-1&&i.push({type:y.Divider})}),i},Cl=e=>{const{traceID:t,spanID:i,processID:n,operationName:o,duration:a,startTime:r,warnings:l}=e,s=[];return s.push({type:y.CopyText,title:"Trace ID",value:t}),s.push({type:y.CopyText,title:"Span ID",value:i}),s.push({type:y.Divider}),s.push({title:"Service",value:n}),s.push({title:"Operation",value:o}),s.push({title:"Duration",value:ki(a)}),s.push({title:"Start time",value:new Date(r/1e3).toLocaleString()}),l.length&&(s.push({type:y.Divider}),s.push({title:"Warnings",titleIcon:Qi,value:l})),s},kl=(e,t)=>{const{tags:i}=e,n={},o=[];return i.forEach(e=>{n[e.key]=e.value}),o.push({type:y.Code,value:{language:"json",code:JSON.stringify(n,null,2),pretty:t}}),o},wl=p.div`
|
|
555
555
|
display: flex;
|
|
556
556
|
flex-direction: column;
|
|
557
557
|
gap: 12px;
|
|
558
558
|
max-height: 100vh;
|
|
559
559
|
overflow-y: auto;
|
|
560
|
-
`,
|
|
560
|
+
`,Tl=({span:i,process:o,onClose:a})=>{const[r,l]=n(!0),[s,c]=n(!0);return t(_,{width:"750px",isOpen:!0,onClose:a,header:{icons:[en],title:i.operationName},footer:{isOpen:!1},children:e(wl,{children:[t(te,{title:"Details",data:Cl(i)}),i.logs.length>0&&t(te,{title:"Errors",titleBadge:i.logs.length,titleIcon:Qi,data:$l(i)}),t(te,{title:"Tags",data:Sl(i,r),action:t(wi,{isPrettyMode:r,setIsPrettyMode:l})}),o&&t(te,{title:`Process (${o.serviceName})`,data:kl(o,s),action:t(wi,{isPrettyMode:s,setIsPrettyMode:c})})]})})},Dl=370,Nl=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),El=p.div`
|
|
561
561
|
display: flex;
|
|
562
562
|
align-items: center;
|
|
563
|
-
width: ${
|
|
563
|
+
width: ${Dl}px;
|
|
564
564
|
background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+L["042"]:t.colors.dark_grey};
|
|
565
565
|
&:hover {
|
|
566
566
|
${({$withErrors:e,$preventHover:t,theme:i})=>!t&&`background-color: ${e?i.colors.error:i.colors.secondary+L["010"]};`}
|
|
567
567
|
cursor: ${({$preventHover:e})=>e?"default":"pointer"};
|
|
568
568
|
}
|
|
569
|
-
`,
|
|
569
|
+
`,Al=p(O)`
|
|
570
570
|
align-items: center;
|
|
571
571
|
justify-content: space-between;
|
|
572
572
|
gap: 4px;
|
|
573
573
|
padding: 12px;
|
|
574
574
|
padding-left: ${({$depth:e})=>12*e||12}px;
|
|
575
|
-
width: calc(${
|
|
576
|
-
`,
|
|
575
|
+
width: calc(${Dl}px - ${({$depth:e})=>12*e}px);
|
|
576
|
+
`,Fl=p(O)`
|
|
577
577
|
align-items: center;
|
|
578
578
|
gap: 4px;
|
|
579
579
|
position: absolute;
|
|
580
580
|
right: 56px;
|
|
581
581
|
width: calc(100% - ${434}px);
|
|
582
|
-
`,
|
|
582
|
+
`,Ol=p.div`
|
|
583
583
|
position: absolute;
|
|
584
584
|
left: ${({$startTime:e,$minStartTime:t,$maxEndTime:i})=>(e-t)/(i-t)*100+"%"};
|
|
585
585
|
width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
|
|
586
586
|
height: 12px;
|
|
587
587
|
border-radius: 32px;
|
|
588
|
-
background-color: ${({$indexInMatrix:e})=>
|
|
589
|
-
`,
|
|
588
|
+
background-color: ${({$indexInMatrix:e})=>Nl[e%Nl.length]};
|
|
589
|
+
`,Il=p(B)`
|
|
590
590
|
padding-left: calc(100% + 8px);
|
|
591
591
|
font-size: 10px;
|
|
592
592
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
593
593
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
594
594
|
white-space: nowrap;
|
|
595
|
-
`,
|
|
595
|
+
`,Rl=({span:i,depth:o,indexInMatrix:a,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:c,errorTooltip:d,isOpen:u,withToggle:p,onToggleOpen:h,onSelect:g})=>{const y=m(),[v,f]=n(!1),b=Dl-12*o-20-(c?12:0),x=c&&(1===o||i.logs.length>0);return e(El,{className:"span-container",$withErrors:c,$preventHover:v,onClick:g,children:[e(Al,{$depth:o,className:"span-left",children:[e(O,{$gap:4,$alignItems:"center",children:[t("div",p?{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:t(I,{onClick:e=>{e.stopPropagation(),h?.()},size:24,children:t(yt,{extend:u??!1})})}:{style:{width:"24px"}}),t(Di,{maxWidth:b/2,text:i.processID,textSize:14}),t(B,{size:12,color:y.text.darker_grey,children:"•"}),t(Di,{maxWidth:b/2,text:i.operationName,textSize:12,textColor:y.text.darker_grey})]}),c&&(x?t(ye,{...d,children:t(Qi,{fill:y.text.error})}):t("div",{style:{position:"relative"},children:t("div",{style:{position:"absolute",top:"-24px",right:"8px"},children:t(A,{type:se.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5})})}))]}),t(Fl,{className:"span-right",children:t(Ol,{$indexInMatrix:a,$duration:i.duration,$maxDuration:r,$startTime:i.startTime,$minStartTime:l,$maxEndTime:s,children:t(Il,{children:ki(i.duration)})})})]})},Ml=({spans:i,logs:n,depth:o,indexInMatrix:a,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d})=>{const u=m();return i.map((i,p)=>{const h=i.spanID,m=c.value.includes(h),g=!!i.spans?.length,y=n.length?n:Ti(i,"spans","logs"),v=y.length>0,f=v?y.length>1?`(${y.length}) errors`:y[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,b=v?y.length>1?void 0:y[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(Rl,{span:i,depth:o,indexInMatrix:a+p+o,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:v,errorTooltip:{titleIcon:Qi,title:f,text:b},isOpen:m,withToggle:g,onToggleOpen:()=>c.set(e=>e.some(e=>e===h)?e.filter(e=>e!=h):[...e,h,...Ti(i,"spans","spanID")]),onSelect:()=>d.set(e=>e?.spanID===h?null:i)}),m&&g?t(Ml,{spans:i.spans||[],logs:y,depth:o+1,indexInMatrix:a+p,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d}):null]},`span-${h}`)})},Kl=p.div`
|
|
596
596
|
width: 100%;
|
|
597
|
-
`,
|
|
597
|
+
`,Ll=p.div`
|
|
598
598
|
max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
599
599
|
overflow: auto;
|
|
600
600
|
|
|
@@ -604,22 +604,22 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
604
604
|
border-radius: 24px;
|
|
605
605
|
border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
606
606
|
position: relative;
|
|
607
|
-
`,
|
|
607
|
+
`,Pl=p.div`
|
|
608
608
|
padding: 12px 12px 12px 24px;
|
|
609
|
-
width: calc(${
|
|
609
|
+
width: calc(${Dl}px - 36px);
|
|
610
610
|
background-color: ${({theme:e})=>e.colors.dark_grey};
|
|
611
|
-
`,
|
|
611
|
+
`,jl=p.div`
|
|
612
612
|
width: 1px;
|
|
613
613
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
614
614
|
background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
|
|
615
615
|
|
|
616
616
|
position: absolute;
|
|
617
|
-
left: calc(${
|
|
618
|
-
`,
|
|
617
|
+
left: calc(${Dl}px + ((100% - ${Dl}px) / ${5}) * ${({index:e})=>e});
|
|
618
|
+
`,zl=p(B)`
|
|
619
619
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
620
620
|
font-size: 12px;
|
|
621
621
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
622
622
|
padding-top: 12px;
|
|
623
623
|
padding-left: 12px;
|
|
624
624
|
white-space: nowrap;
|
|
625
|
-
`,
|
|
625
|
+
`,ql=({heightToRemove:o,traces:a,isLoading:r})=>{const[l,s]=n([]),[d,u]=n(null),p=c(()=>Et(a).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:xl(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(i,{children:[t(Kl,{$heightToRemove:o,children:r?t(Ee,{$height:"50vh",children:t(Re,{scale:1.5})}):p.length?e(Ll,{$heightToRemove:o,children:[t(Pl,{children:t(B,{children:"Service & operation"})}),new Array(5).fill(null).map((e,i)=>t(jl,{$heightToRemove:o,index:i,children:t(zl,{children:ki(h/5*i)})},`${i}-divider`)),p.map((e,i)=>{const{spans:n}=e,o=n.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),a=n.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return t(Ml,{spans:n,logs:[],depth:1,indexInMatrix:i,maxDuration:h,minStartTime:o,maxEndTime:a,openSpanIdsState:{value:l,set:s},selectedSpanState:{value:d,set:u}},`recursive-spans-${e.traceID}`)})]}):t(Ee,{$height:"50vh",children:t(Ae,{title:g.NO_TRACES_FOUND,subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC})})}),d&&t(Tl,{span:d,process:m,onClose:()=>u(null)})]})};export{Mn as ActionDrawer,An as ActionForm,Ln as ActionModal,Vn as ActionTable,Jn as AwaitPipeline,To as ConditionDropdown,So as DataFlow,Zo as DataFlowActionsMenu,Bo as DataStreamDrawer,zo as DataStreamForm,ea as DataStreamModal,Qo as DataStreamSelectionForm,pa as DestinationDrawer,ca as DestinationForm,Da as DestinationModal,Oa as DestinationSelectionForm,Ra as DestinationTable,Do as ErrorDropdown,Ya as InstrumentationRuleDrawer,Ua as InstrumentationRuleForm,Qa as InstrumentationRuleModal,ir as InstrumentationRuleTable,Fo as KindDropdown,No as LanguageDropdown,Eo as MonitorDropdown,or as MultiSourceControl,Ao as NamespaceDropdown,Lr as NavIconIds,dr as NotificationManager,Fn as OverviewDrawer,Oo as PodsAgentInjectionStatusDropdown,kr as ServiceMap,Kr as SetupSummary,Pr as SideNav,jr as SlackInvite,el as SourceDrawer,Br as SourceForm,nl as SourceModal,il as SourceSelectionForm,al as SourceTable,hl as SystemOverview,jn as TableCellConditions,gl as ToastList,bl as ToggleDarkMode,ql as TraceView};
|