@odigos/ui-kit 0.0.207 → 0.0.208
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/lib/chunks/index-Dt6gx0e3.js +3 -0
- package/lib/chunks/{ui-components-BlfhQM0V.js → ui-components-gnCD7JOq.js} +318 -318
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/_drawers/add-source-drawer/utils.d.ts +2 -1
- package/lib/containers/v2.js +27 -26
- package/lib/containers.js +119 -119
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/_v2/wide-drawer/column-list-item/index.d.ts +1 -0
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-BWrHoFMs.js +0 -3
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 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,
|
|
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,aT as y,l as v,K as f,A as b,aU as x,aV as $,aW as S,aX as C,c as k,i as w,aY as T,aZ as D,a_ as N,a$ as E,D as A,F,g as O,b0 as I,b1 as M,k as R,b2 as P,a1 as L,b3 as K,b4 as j,b5 as z,b6 as q,b7 as B,b8 as V,at as H,aF as W,b9 as _,ba as J,bb as U,aq as G,ax as Y,bc as X,bd as Z,be as Q,bf as ee,bg as te,bh as ie,bi as ne,bj as oe,bk as ae,bl as re,bm as le,s as se,a6 as ce,bn as de,bo as ue,bp as pe,bq as he,br as me,bs as ge,O as ye,bt as ve,bu as fe,bv as be,bw as xe,bx as $e,by as Se,bz as Ce,bA as ke,bB as we,bC as Te,bD as De,bE as Ne,n as Ee,bF as Ae,bG as Fe,bH as Oe,bI as Ie,aL as Me,bJ as Re,bK as Pe,bL as Le,bM as Ke,af as je,S as ze,H as qe,bN as Be,bO as Ve,ab as He,bP as We,ao as _e,ar as Je,bQ as Ue,ad as Ge,bR as Ye,bS as Xe,bT as Ze,bU as Qe,bV as et,bW as tt,bX as it,bY as nt,bZ as ot,b_ as at,b$ as rt,c0 as lt,c1 as st,$ as ct,M as dt,c2 as ut,c3 as pt,c4 as ht,c5 as mt,ap as gt,c6 as yt,c7 as vt,c8 as ft,c9 as bt,x as xt,z as $t,G as St,ca as Ct,cb as kt,cc as wt,E as Tt,a9 as Dt,m as Nt,aa as Et,cd as At,ce as Ft,cf as Ot,cg as It,P as Mt,X as Rt,Y as Pt,U as Lt,J as Kt,Q as jt,Z as zt,ch as qt,a0 as Bt,ci as Vt,cj as Ht,ae as Wt,aj as _t,ck as Jt,cl as Ut,cm as Gt,au as Yt,cn as Xt,co as Zt,cp as Qt,ah as ei,cq as ti,cr as ii,cs as ni,ct as oi,cu as ai,cv as ri,cw as li,cx as si,aC as ci,cy as di,cz as ui,cA as pi,cB as hi,cC as mi,cD as gi,cE as yi,cF as vi,cG as fi,cH as bi,av as xi,as as $i,a4 as Si,a8 as Ci,cI as ki,cJ as wi,cK as Ti,cL as Di,cM as Ni,cN as Ei}from"./chunks/ui-components-gnCD7JOq.js";import{TrashIcon as Ai,VSquareIcon as Fi,XSquareIcon as Oi,EditIcon as Ii,OdigosLogoText as Mi,PlusIcon as Ri,RefreshIcon as Pi,SearchIcon as Li,FilterIcon as Ki,DataStreamIcon as ji,VIcon as zi,OdigosLogo as qi,ArrowIcon as Bi,RefreshLeftArrowIcon as Vi,NotificationIcon as Hi,UserIcon as Wi,ImageErrorIcon as _i,OverviewIcon as Ji,SourceIcon as Ui,DestinationIcon as Gi,InstrumentationRuleIcon as Yi,ActionIcon as Xi,SlackLogo as Zi,KeyIcon as Qi,TerminalIcon as en,ExclamationTriangleIcon as tn,TraceViewIcon as nn}from"./icons.js";import{MarkerType as on,useNodesState as an,useEdgesState as rn}from"@xyflow/react";import{E as ln}from"./chunks/vendor-D99eCWta.js";import{Y as sn}from"./chunks/index-Dt6gx0e3.js";import"zustand";import"javascript-time-ago";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const cn=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:$,samplingPercentage:S,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($)}),t===v.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String(S)}),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},dn=b.PiiCategories,un=p.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
gap: 32px;
|
|
@@ -7,45 +7,45 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
7
7
|
border-radius: 32px;
|
|
8
8
|
padding: 8px;
|
|
9
9
|
`}
|
|
10
|
-
`,un=[{id:"CREDIT_CARD",label:"Credit Card"}],pn=b.FallbackSamplingRatio,hn=[{value:f.Pod,id:f.Pod},{value:f.Namespace,id:f.Namespace},{value:f.Node,id:f.Node}],mn=[{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:hn,required:!0,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],gn=[{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:hn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],yn=b.EndpointsFilters,vn=[{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}],fn=b.AttributeNamesToDelete,bn=b.Renames,xn=b.UrlTemplatizationRulesGroups,$n=[{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,Cn=[{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}],kn=b.SamplingPercentage,wn=b.AttributeFilters,Tn=[{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:R.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:R.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}],Dn={[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($,{title:"Collect Container Attributes",value:n[b.CollectContainerAttributes]||!1,onChange:e=>a(b.CollectContainerAttributes,e),errorMessage:r[b.CollectContainerAttributes]}),t($,{title:"Collect ReplicaSet Attributes",value:n[b.CollectReplicaSetAttributes]||!1,onChange:e=>a(b.CollectReplicaSetAttributes,e),errorMessage:r[b.CollectReplicaSetAttributes]}),t($,{title:"Collect Workload ID",value:n[b.CollectWorkloadId]||!1,onChange:e=>a(b.CollectWorkloadId,e),errorMessage:r[b.CollectWorkloadId]}),t($,{title:"Collect Cluster ID",value:n[b.CollectClusterId]||!1,onChange:e=>a(b.CollectClusterId,e),errorMessage:r[b.CollectClusterId]}),t(T,{columns:mn,value:n[b.LabelsAttributes]||[],onChange:e=>a(b.LabelsAttributes,e),errorMessage:r[b.LabelsAttributes]}),t(T,{columns:gn,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[fn],a=e[fn]||[];return t(E,{title:"Attributes to delete",value:a,onChange:e=>i(fn,e),required:!0,errorMessage:o})},[v.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const o=n[bn],a=Object.entries(e[bn]||{}).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(bn,t)},required:!0,errorMessage:o})},[v.PiiMasking]:({value:i,setValue:a,formErrors:r})=>{const l=r[cn],s=i[cn]||[],[c,d]=n(1===s.length);return o(()=>{if(!s.length){const e=un.map(({id:e})=>e);a(cn,e),d(1===un.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(dn,{$hasError:!!l,children:un.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);a(cn,i),d(1===i.length)})(e,t)},e))}),!!l&&t(S,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[pn],a=e[pn];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(pn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[v.ProbabilisticSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[kn],a=e[kn];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(kn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[v.LatencySampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[yn],a=e[yn]||[];return t(T,{columns:vn,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(yn,t)},errorMessage:o})},[v.ServiceNameSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[Sn],a=e[Sn]||[];return t(T,{columns:Cn,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[wn],a=(e[wn]||[]).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:Tn,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(wn,t)},errorMessage:o,limitFieldsPerRow:3})},[v.URLTemplatization]:({value:n,setValue:o,formErrors:r})=>{const l=r[xn],s=n[xn]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o(xn,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(Ei,{})})]}),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:$n,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(M,{label:"Add Rule Group",onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(A,{})]})}},Nn=({actionType:e,value:i,setValue:n,formErrors:o})=>{if(!e)return null;const a=Dn[e];return a?t(a,{value:i,setValue:n,formErrors:o}):null},En=p.div`
|
|
10
|
+
`,pn=[{id:"CREDIT_CARD",label:"Credit Card"}],hn=b.FallbackSamplingRatio,mn=[{value:f.Pod,id:f.Pod},{value:f.Namespace,id:f.Namespace},{value:f.Node,id:f.Node}],gn=[{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:mn,required:!0,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],yn=[{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:mn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],vn=b.EndpointsFilters,fn=[{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}],bn=b.AttributeNamesToDelete,xn=b.Renames,$n=b.UrlTemplatizationRulesGroups,Sn=[{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"}],Cn=b.ServicesNameFilters,kn=[{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}],wn=b.SamplingPercentage,Tn=b.AttributeFilters,Dn=[{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:R.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:R.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}],Nn={[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($,{title:"Collect Container Attributes",value:n[b.CollectContainerAttributes]||!1,onChange:e=>a(b.CollectContainerAttributes,e),errorMessage:r[b.CollectContainerAttributes]}),t($,{title:"Collect ReplicaSet Attributes",value:n[b.CollectReplicaSetAttributes]||!1,onChange:e=>a(b.CollectReplicaSetAttributes,e),errorMessage:r[b.CollectReplicaSetAttributes]}),t($,{title:"Collect Workload ID",value:n[b.CollectWorkloadId]||!1,onChange:e=>a(b.CollectWorkloadId,e),errorMessage:r[b.CollectWorkloadId]}),t($,{title:"Collect Cluster ID",value:n[b.CollectClusterId]||!1,onChange:e=>a(b.CollectClusterId,e),errorMessage:r[b.CollectClusterId]}),t(T,{columns:gn,value:n[b.LabelsAttributes]||[],onChange:e=>a(b.LabelsAttributes,e),errorMessage:r[b.LabelsAttributes]}),t(T,{columns:yn,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[bn],a=e[bn]||[];return t(E,{title:"Attributes to delete",value:a,onChange:e=>i(bn,e),required:!0,errorMessage:o})},[v.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const o=n[xn],a=Object.entries(e[xn]||{}).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(xn,t)},required:!0,errorMessage:o})},[v.PiiMasking]:({value:i,setValue:a,formErrors:r})=>{const l=r[dn],s=i[dn]||[],[c,d]=n(1===s.length);return o(()=>{if(!s.length){const e=pn.map(({id:e})=>e);a(dn,e),d(1===pn.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(un,{$hasError:!!l,children:pn.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);a(dn,i),d(1===i.length)})(e,t)},e))}),!!l&&t(S,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[hn],a=e[hn];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(hn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[v.ProbabilisticSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[wn],a=e[wn];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(wn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[v.LatencySampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[vn],a=e[vn]||[];return t(T,{columns:fn,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(vn,t)},errorMessage:o})},[v.ServiceNameSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[Cn],a=e[Cn]||[];return t(T,{columns:kn,value:a,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i(Cn,t)},errorMessage:o})},[v.SpanAttributeSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[Tn],a=(e[Tn]||[]).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:Dn,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(Tn,t)},errorMessage:o,limitFieldsPerRow:3})},[v.URLTemplatization]:({value:n,setValue:o,formErrors:r})=>{const l=r[$n],s=n[$n]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o($n,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(Ai,{})})]}),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:Sn,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(M,{label:"Add Rule Group",onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(A,{})]})}},En=({actionType:e,value:i,setValue:n,formErrors:o})=>{if(!e)return null;const a=Nn[e];return a?t(a,{value:i,setValue:n,formErrors:o}):null},An=p.div`
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
gap: 24px;
|
|
14
14
|
padding: 4px;
|
|
15
|
-
`,
|
|
15
|
+
`,Fn=p(B)`
|
|
16
16
|
margin-bottom: 12px;
|
|
17
|
-
`,
|
|
17
|
+
`,On=({isUpdate:i,action:n,formData:o,formErrors:a,handleFormChange:r})=>{const l=m();return e(An,{children:[i&&e("div",{children:[t(Fn,{children:"Status"}),t(P,{options:[{icon:Fi,label:g.ENABLED,value:!1,selectedBgColor:l.text.success+L["050"]},{icon:Oi,label:g.DISABLED,value:!0,selectedBgColor:l.text.error+L["050"]}],selected:o.disabled,setSelected:e=>r("disabled",e)})]}),!i&&t(K,{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(En,{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})]})},In=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:$,tabs:S,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),M=T===G.Source,R=()=>{A(!1),O(!1)},P=()=>{R(),f&&f(!1),D(null),N(null),v?.()};s(k,()=>({closeDrawer:P}));const L=()=>{I.current?.clearTitle(),$&&$(),R()},K=()=>{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(Ii,{}),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(Ai,{}),t(B,{color:w.text.error,size:14,family:"secondary",decoration:"underline",children:M?W.UNINSTRUMENT:W.DELETE})]})}),e(i,{children:[t(_,{isOpen:!0,onClose:h?K:P,closeOnEscape:!E&&!F,width:`${a+64}px`,header:{icons:u,iconSrcs:p,title:r,titleTooltip:c,replaceTitleWith:!d&&h?t(Mn,{ref:I,title:r}):void 0,actionButtons:q,tabs:S},footer:{isOpen:h,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:z,children:W.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:K,children:W.CANCEL}],rightButtons:x?[{"data-id":"drawer-delete",variant:"tertiary",onClick:j,children:e(i,{children:[t(Ai,{}),t(B,{size:14,color:w.text.error,family:"secondary",decoration:"underline",children:W.DELETE})]})}]:[]},children:o}),t(J,{isOpen:E,noOverlay:!0,name:`${T}${r?` (${r})`:""}`,type:T,isLastItem:y,onApprove:()=>{x&&x(),R()},onDeny:R}),t(U,{isOpen:F,noOverlay:!0,name:"edit mode",onApprove:L,onDeny:R})]})}),Mn=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)})});Mn.displayName=Mn.name,In.displayName=In.name;const Rn=p.div`
|
|
18
18
|
width: 100%;
|
|
19
19
|
height: 100%;
|
|
20
20
|
max-height: calc(100vh - 220px);
|
|
21
21
|
overflow: overlay;
|
|
22
22
|
overflow-y: auto;
|
|
23
|
-
`,
|
|
23
|
+
`,Pn=p.div`
|
|
24
24
|
display: flex;
|
|
25
25
|
flex-direction: column;
|
|
26
26
|
gap: 12px;
|
|
27
|
-
`,
|
|
27
|
+
`,Ln=({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:$,validateForm:S,loadFormWithDrawerItem:C}=X(),k=c(()=>{if(d)return r?.find(e=>Z(e)===d)},[d,r]);if(o(()=>{p&&k?C(k):$()},[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(In,{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(S({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(Rn,{children:t(On,{isUpdate:!0,action:w,formData:f,formErrors:b,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(Pn,{children:[t(ee,{conditions:k.conditions||[]}),t(te,{title:g.ACTION_DETAILS,data:k?cn(k):[]})]})})},Kn=p(F)`
|
|
28
28
|
margin-top: 24px;
|
|
29
29
|
gap: 12px;
|
|
30
|
-
`,
|
|
30
|
+
`,jn=({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(K,{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(On,{action:p,formData:l,formErrors:s,handleFormChange:c})]}):null]})})},zn=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 $="";if(t===v.K8sAttributes&&(i&&($+="Container Attributes, "),n&&($+="ReplicaSet Attributes, "),o&&($+="Workload ID, "),a&&($+="Cluster ID, "),r?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},o)=>{const a=n?.length?n.join(","):i||f.Pod;$+=`Label: ${e} ${t} ${a} `,o===r.length-1&&($+=", ")}),l?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},o)=>{const a=n?.length?n.join(","):i||f.Pod;$+=`Annotation: ${e} ${t} ${a} `,o===l.length-1&&($+=", ")})),t===v.AddClusterInfo&&($+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},i)=>{$+=`${e}: ${t}`,i<s.length-1&&($+=", ")})),t===v.DeleteAttributes&&d?.forEach((e,t)=>{$+=e,t<d.length-1&&($+=", ")}),t===v.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,i],n)=>{$+=`${t}: ${i}`,n<e.length-1&&($+=", ")})}return t===v.PiiMasking&&p?.forEach((e,t)=>{$+=e,t<p.length-1&&($+=", ")}),t===v.ErrorSampler&&($+=String(h)),t===v.ProbabilisticSampler&&($+=String(m),$+="%"),t===v.LatencySampler&&g?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},o)=>{$+=`Endpoint${g.length>1?` #${o+1}`:""}=${e}${t}\n`,$+=` Latency=${i}`,$+=` Sampling=${n}`,o<g.length-1&&($+=", ")}),t===v.ServiceNameSampler&&b?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>{$+=`Service Name: ${e}, `,$+=`Sampling Ratio: ${t}, `,$+=`Fallback Sampling Ratio: ${i}\n`}),t===v.SpanAttributeSampler&&y?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i})=>{$+=`Service Name: ${e}, `,$+=`Attribute Key: ${t}, `,$+=`Fallback Sampling Ratio: ${i}\n`}),t===v.URLTemplatization&&x?.forEach((e,t)=>{const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");$+=`Group ${t+1}: ${i}`,t<x.length-1&&($+="; ")}),$},qn=({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(Bn,{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})})},Bn=({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}`)})})},Vn=({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}},Hn=[{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}],Wn=({maxHeight:i,maxWidth:n})=>{const o=m(),a=fe(),{actions:r,actionsLoading:l}=Y(),{setDrawerType:s,setDrawerEntityId:d}=V(),u=c(()=>Vn({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:$e(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:zn(e),textColor:o.text.info,withTooltip:!0},{columnKey:"signals",component:()=>t(Se,{withLabels:!0,monitors:e.signals||[]})},{columnKey:"conditions",component:()=>t(qn,{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:Hn,rows:p})}),!u.length&&t(Ee,{style:{marginTop:"2rem"},children:t(Ae,{})})]})},_n=p(F)`
|
|
31
31
|
// width: 100vw;
|
|
32
32
|
// height: 100vh;
|
|
33
33
|
gap: 64px;
|
|
34
34
|
align-items: center;
|
|
35
35
|
justify-content: center;
|
|
36
|
-
`,
|
|
36
|
+
`,Jn=p(F)`
|
|
37
37
|
max-width: 400px;
|
|
38
38
|
gap: 12px;
|
|
39
39
|
align-items: center;
|
|
40
40
|
justify-content: center;
|
|
41
|
-
`,
|
|
41
|
+
`,Un=p(B)`
|
|
42
42
|
text-align: center;
|
|
43
43
|
font-size: 24px;
|
|
44
|
-
`,
|
|
44
|
+
`,Gn=p(B)`
|
|
45
45
|
text-align: center;
|
|
46
46
|
line-height: 26px;
|
|
47
47
|
color: ${({theme:e})=>e.text.info};
|
|
48
|
-
`,
|
|
48
|
+
`,Yn=()=>{const[i,a]=n(0);return o(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ie(500),a(e)})()},[]),e(_n,{children:[t(Mi,{size:100}),t(Fe,{width:400}),e(Jn,{children:[e(O,{$gap:16,children:[t(Un,{children:"Preparing your workspace..."}),t(Oe,{label:`${i}%`})]}),t(Gn,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},Xn=p(F)`
|
|
49
49
|
align-items: center !important;
|
|
50
50
|
justify-content: center !important;
|
|
51
51
|
align-self: stretch;
|
|
@@ -61,9 +61,9 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
61
61
|
cursor: pointer;
|
|
62
62
|
|
|
63
63
|
&:hover {
|
|
64
|
-
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+
|
|
64
|
+
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+L["030"]};
|
|
65
65
|
}
|
|
66
|
-
`,
|
|
66
|
+
`,Zn=({entityType:i,description:n})=>{const{setCurrentModal:o}=oe();return e(Xn,{onClick:()=>o(i),children:[e(O,{$gap:4,children:[t(Ri,{}),e(B,{size:14,weight:600,family:"secondary",decoration:"underline",children:["Add ",i]})]}),t(B,{size:12,align:"center",children:n})]})},Qn=p.div`
|
|
67
67
|
position: relative;
|
|
68
68
|
width: 100%;
|
|
69
69
|
padding: 12px 0;
|
|
@@ -71,13 +71,13 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
71
71
|
display: flex;
|
|
72
72
|
align-items: center;
|
|
73
73
|
border-bottom: 1px solid ${({theme:e})=>e.colors.border};
|
|
74
|
-
`,
|
|
74
|
+
`,eo=p(O)`
|
|
75
75
|
margin-left: ${({$marginLeft:e})=>e};
|
|
76
|
-
`,
|
|
76
|
+
`,to=p(Re)`
|
|
77
77
|
width: 24px;
|
|
78
78
|
height: 24px;
|
|
79
79
|
padding: 0;
|
|
80
|
-
`,
|
|
80
|
+
`,io=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
|
+
`,no=({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(Qn,{children:[c&&t(eo,{$marginLeft:"28px",children:t($,{partiallyChecked:l,value:s,onChange:c})}),t(eo,{$marginLeft:i===G.Source?"0":"28px",children:t(we,{icon:h,title:`${i}s`,badge:n,badgeTooltip:o,loading:!1})}),e(eo,{$marginLeft:"auto",children:[t(to,{"data-id":`refresh-${i}`,variant:"secondary",onClick:r,disabled:a,children:a?t(Me,{scale:.8}):t(Pi,{fill:u.colors.secondary,size:18})}),t(to,{"data-id":`add-${i}`,variant:"primary",onClick:()=>p(i),children:t(Ri,{fill:u.colors.primary,size:18})})]}),"number"==typeof d&&t(io,{percent:d})]})},oo=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
|
+
`,ao=({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:$,setDrawerEntityId:S}=V(),{selectedSources:C,setSelectedSources:k}=Pe(),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:()=>{$(n),S(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(Me,{scale:.8}):n?t(n,{size:14}):null;return c?e(oo,{$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 ro(e){const t=e.conditions?.some(({status:e})=>e===me.Loading);return t?e:{...e,conditions:[{status:me.Loading,type:"Pending",message:"",lastTransitionTime:""}]}}function lo(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 so=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
|
+
`,co=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
|
+
`,uo=p.div`
|
|
123
123
|
display: flex;
|
|
124
124
|
align-items: center;
|
|
125
125
|
gap: 8px;
|
|
126
126
|
padding: 4px 8px 0;
|
|
127
|
-
`,
|
|
127
|
+
`,po=p.div`
|
|
128
128
|
flex: 1;
|
|
129
129
|
height: 1px;
|
|
130
130
|
background: ${({theme:e})=>e.colors.border};
|
|
131
|
-
`,
|
|
131
|
+
`,ho=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
|
+
`,mo=({namespace:e})=>t(so,{children:t(co,{children:e})}),go=({namespace:i})=>e(uo,{children:[t(po,{}),t(ho,{children:i}),t(po,{})]}),yo=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
|
+
`,vo=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
|
+
`,fo={[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 bo=({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=fo[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 Ke.Failure:return{status:se.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case Ke.Notice:return{status:se.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case Ke.Pending:case Ke.Waiting:return{status:void 0,faded:!1,displaySource:ro(e)};case Ke.Unsupported:case Ke.Disabled:return{status:void 0,faded:!0,displaySource:e};default:return{status:void 0,faded:!1,displaySource:lo(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:$e(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(go,{namespace:n.namespace},`ns-divider-${n.namespace}`))),o=n.namespace),i.push(n.namespace||""),e.push(t(ao,{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(yo,{$height:i,children:[v&&p&&t(mo,{namespace:p}),t(ze,{gap:8,elements:g,onTopIndexChange:v?f:void 0}),t(vo,{$hide:!0})]})},xo=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
|
+
`,$o=({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[Je.Instrumenting]||m[Je.Uninstrumenting])?m[Je.Instrumenting]?.percentage||m[Je.Uninstrumenting]?.percentage||0:void 0,[h,m[Je.Instrumenting],m[Je.Uninstrumenting]]),{selectedSources:v,setSelectedSources:f}=Pe(),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(xo,{$isVm:d,children:[t(no,{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(bo,{height:u,entityType:i,entities:n,metrics:a}):r?t(Ue,{size:3}):t(Zn,{entityType:i,description:g.TO_COLLECT_OTEL_DATA})]})},So=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
|
+
`,Co=({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:$,instrumentationRulesLoading:S}=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($)},[$]),e(So,{ref:h,$height:i,children:[t($o,{entityType:G.InstrumentationRule,entities:F,unfilteredCount:$.length,loading:S,maxHeight:m,refetch:d}),t($o,{entityType:G.Source,entities:w,unfilteredCount:C.length,metrics:a,loading:y,maxHeight:m,refetch:r}),t($o,{entityType:G.Action,entities:E,unfilteredCount:b.length,loading:x,maxHeight:m,refetch:s}),t($o,{entityType:G.Destination,entities:D,unfilteredCount:k.length,metrics:a,loading:f,maxHeight:m,refetch:l})]})},ko=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 wo=p.div`
|
|
188
188
|
display: flex;
|
|
189
189
|
align-items: center;
|
|
190
190
|
overflow-x: scroll;
|
|
191
|
-
`,
|
|
191
|
+
`,To=({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(()=>Vn({instrumentationRules:g,sources:Xe(u,d),actions:h,destinations:Ze(p,d),searchText:s,selectedCategory:$}),[g,u,h,p,d,s,$]);return k.length?t(nt,{ref:y,isOpen:v,top:b.top,left:b.left,maxWidth:"420px",header:t(wo,{children:C.map(({category:e,label:i,count:n})=>!!n&&t(at,{label:i,badgeLabel:n,isSelected:$===e,onClick:()=>S(e)},`category-select-${e}`))}),children:k.map(({category:n,label:o,entities:s},c)=>!!s.length&&e(a,{children:[e(ot,{style:{maxHeight:"all"!==$?"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:$e(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,{})})},Do=({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(ko,{ref:u,children:[t(C,{placeholder:"Search",icon:Li,value:o,onChange:e=>a(e.target.value.toLowerCase()),onFocus:()=>s(!0)}),c&&!i?t(To,{onClose:d}):null]})},No=({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})},Eo=({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})},Ao=({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})},Fo=({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})},Oo=({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})},Io=({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})},Mo=({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})},Ro=p.div`
|
|
192
192
|
display: flex;
|
|
193
193
|
flex-direction: column;
|
|
194
194
|
gap: 12px;
|
|
195
195
|
padding: 12px;
|
|
196
|
-
`,
|
|
196
|
+
`,Po=p.div`
|
|
197
197
|
padding: 12px 6px 6px 6px;
|
|
198
|
-
`,
|
|
198
|
+
`,Lo=p(Re)`
|
|
199
199
|
font-size: 14px;
|
|
200
200
|
${({$color:e})=>`color: ${e};`}
|
|
201
201
|
`,Ko=p.div`
|
|
202
202
|
margin-left: auto;
|
|
203
|
-
`,
|
|
203
|
+
`,jo=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},zo=()=>{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:$,languages:S,conditions:C,errors:k,onlyErrors:w,podsAgentInjectionStatus:T,setAll:N,clearAll:E,getEmptyState:A}=fe(),F=c(()=>Xe(r,s),[r,s]),[I,M]=n({namespaces:b,kinds:x,monitors:$,languages:S,conditions:C,errors:k,onlyErrors:w,podsAgentInjectionStatus:T}),[R,P]=n(jo(I));o(()=>{const e=d(ut.OVERVIEW_FILTERS,A());N(e)},[]),o(()=>{if(!g){const e={namespaces:b,kinds:x,monitors:$,languages:S,conditions:C,errors:k,onlyErrors:w,podsAgentInjectionStatus:T};M(e),P(jo(e))}},[g,b,x,$,S,C,k,w,T]);const L=()=>{y(!1)},K=l(null);return rt(K,L),H({key:"Escape",active:g},L),e(ko,{ref:K,children:[t(at,{label:"Filters",icon:Ki,badgeLabel:R,badgeFilled:!!R,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(Lo,{variant:"primary",onClick:()=>{u(ut.OVERVIEW_FILTERS,I),N(I),P(jo(I)),y(!1)},children:"Apply"}),t(Lo,{variant:"secondary",onClick:L,children:"Cancel"}),t(Ko,{children:t(Lo,{variant:"tertiary",onClick:()=>{p(ut.OVERVIEW_FILTERS),E(),M(A()),P(0),y(!1)},$color:i.text.error,children:"Reset"})})]}),children:e(Ro,{children:[t(Oo,{namespaces:a,value:I.namespaces,onSelect:e=>M(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>M(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Io,{sources:F,value:I.kinds,onSelect:e=>M(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>M(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Ao,{sources:F,value:I.languages,onSelect:e=>M(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>M(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Fo,{value:I.monitors,onSelect:e=>M(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>M(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(No,{sources:F,value:I.conditions,onSelect:e=>M(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>M(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Mo,{sources:F,value:I.podsAgentInjectionStatus,onSelect:e=>M(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>M(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Po,{children:t(D,{title:"Show only sources with errors",initialValue:I.onlyErrors,onChange:e=>M(t=>({...t,errors:[],onlyErrors:e}))})}),t(Eo,{sources:F,value:I.errors,onSelect:e=>M(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>M(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!I.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},qo=p.div`
|
|
204
204
|
display: flex;
|
|
205
205
|
flex-direction: column;
|
|
206
206
|
gap: 24px;
|
|
207
207
|
padding: 4px;
|
|
208
|
-
`,
|
|
208
|
+
`,Bo=({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(qo,{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)})]})},Vo=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
|
+
`,Ho=({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(In,{ref:s,title:b.name,icons:[ji],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(Vo,{children:t(Bo,{formData:h,handleFormChange:x,formErrors:g,editingStreamName:o})})}):null},Wo=p.div`
|
|
215
215
|
position: relative;
|
|
216
|
-
`,
|
|
216
|
+
`,_o=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
|
+
`,Jo=p(B)`
|
|
224
224
|
text-wrap: nowrap;
|
|
225
|
-
`,
|
|
225
|
+
`,Uo=p(ot)`
|
|
226
226
|
max-height: 240px;
|
|
227
227
|
padding: 0px !important;
|
|
228
|
-
`,
|
|
228
|
+
`,Go=p(O)`
|
|
229
229
|
width: 100%;
|
|
230
|
-
`,
|
|
230
|
+
`,Yo=p.div`
|
|
231
231
|
width: 100%;
|
|
232
|
-
`,
|
|
232
|
+
`,Xo=({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(Go,{children:[t(Yo,{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:()=>S(i),tooltip:W.DELETE,children:t(Ai,{})}),t(I,{onClick:()=>x(i),tooltip:W.EDIT,children:t(Ii,{})})]},`stream-${i}`)),[y,v,k]);return e(i,{children:[e(Wo,{children:[e(_o,{$gap:0,children:[e(Re,{variant:"tertiary",onClick:()=>{g(0,50),p(e=>!e)},children:[t(ji,{fill:l.text.info}),e(Jo,{children:["Data Stream: ",v]}),t(yt,{extend:u}),t(Oe,{label:y.length})]}),t(A,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),t(M,{onClick:()=>{s(),o()},label:W.NEW})]}),t(nt,{ref:d,isOpen:u,top:h.top,left:h.left,header:t(C,{placeholder:"Search...",icon:Li,value:k,onChange:e=>w(e.target.value)}),children:t(Uo,{children:T})})]}),t(J,{isOpen:""!==$,name:$,onApprove:()=>{r($),S("")},onDeny:()=>{S("")}}),t(Ho,{isOpen:""!==b,onClose:()=>{x("")},dataStreamName:b,updateDataStream:a})]})},Zo=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
|
+
`,Qo=p.div`
|
|
239
239
|
margin-left: auto;
|
|
240
|
-
`,
|
|
240
|
+
`,ea=({addEntity:i,preventSearchPopup:n,onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r})=>{const{isVm:l}=je(),{setCurrentModal:s}=oe();return e(Zo,{children:[!l&&t(Xo,{onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r}),t(Do,{preventPopup:n}),t(zo,{}),i&&t(Qo,{children:t(M,{"data-id":`add-${i}`,onClick:()=>s(i),label:`${W.ADD} ${lt(i)}`,variant:"primary",textProps:{weight:900}})})]})},ta=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(K,{title:g.NAME_YOUR_STREAM,description:g.STREAM_DESCRIPTION}),t(Bo,{formData:r,handleFormChange:l,formErrors:c})]})})});ta.displayName=ta.name;const ia=({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(ta,{ref:d,isModal:!0})})},na=(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}=$t(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},oa=({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 R.Input:return t(C,{...s,onChange:e=>n(a.name,e.target.value),errorMessage:o[a.name]},a.name);case R.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 R.MultiInput:return t(E,{...s,value:"string"==typeof s.value?$t(s.value,[]):s.value,onChange:e=>n(a.name,JSON.stringify(e)),errorMessage:o[a.name]},a.name);case R.KeyValuePair:return t(N,{...s,value:"string"==typeof s.value?$t(s.value,[]):s.value,onChange:e=>n(a.name,JSON.stringify(e)),errorMessage:o[a.name]},a.name);case R.TextArea:return t(q,{...s,onChange:e=>n(a.name,e.target.value),errorMessage:o[a.name]},a.name);case R.Checkbox:return t($,{...s,value:"true"==s.value,onChange:e=>n(a.name,String(e)),errorMessage:o[a.name]},a.name);default:return null}}),aa=p(Re)`
|
|
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
|
+
`,ra=({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(aa,{$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(Me,{}):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"})]})},la=p(F)`
|
|
255
255
|
align-items: unset;
|
|
256
256
|
padding: 0 4px;
|
|
257
|
-
`,
|
|
257
|
+
`,sa=p.div`
|
|
258
258
|
display: flex;
|
|
259
259
|
flex-direction: column;
|
|
260
260
|
gap: 12px;
|
|
261
|
-
`,
|
|
261
|
+
`,ca=p(O)`
|
|
262
262
|
justify-content: space-between;
|
|
263
|
-
`,
|
|
263
|
+
`,da=p(B)`
|
|
264
264
|
margin-bottom: 12px;
|
|
265
|
-
`,
|
|
265
|
+
`,ua=({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||{},$=m(),[S,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(St.Logs),t?.supported&&n.push(St.Metrics),i?.supported&&n.push(St.Traces),n},[b]),O=c(()=>{const{logs:e,metrics:t,traces:i}=r.exportedSignals||{},n=[];return e&&n.push(St.Logs),t&&n.push(St.Metrics),i&&n.push(St.Traces),n},[r.exportedSignals]),I=()=>{k(!1),T(!0),N(void 0)};return e(la,{$gap:24,children:[e(la,{$gap:12,children:[t(K,{title:i?"Update destination":"Create destination",description:`Connect ${f} with Odigos.`,actionButton:x&&t(ra,{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(sa,{children:[x&&D&&t(le,{type:D.type,title:D.title,message:D.message}),S&&!D&&!i&&t(le,{type:se.Default,message:`Odigos autocompleted ${f} destination details.`})]}),t(A,{})]}),e(ca,{children:[t(z,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:F,selectedSignals:O,setSelectedSignals:e=>{I(),u("exportedSignals",{logs:e.includes(St.Logs),metrics:e.includes(St.Metrics),traces:e.includes(St.Traces)})},errorMessage:s.exportedSignals}),!i&&t(j,{endpoint:`/backends/${v}`})]}),i&&e("div",{children:[t(da,{children:"Status"}),t(P,{options:[{icon:Fi,label:g.ENABLED,value:!1,selectedBgColor:$.text.success+L["050"]},{icon:Oi,label:g.DISABLED,value:!0,selectedBgColor:$.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(oa,{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})]})},pa=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
|
+
`,ha=p.div`
|
|
272
272
|
display: flex;
|
|
273
273
|
flex-direction: column;
|
|
274
274
|
gap: 12px;
|
|
275
|
-
`,
|
|
275
|
+
`,ma=({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,$]=n(!1),{formData:S,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:M,iconSrc:R}=I?He(I?.type):{icon:void 0,iconSrc:void 0};return t(In,{ref:y,title:O.name||O.destinationType.displayName,icons:M?[M]:void 0,iconSrcs:R?[R]: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,{...S,name:t}),b(!1),$(!1)}},onDelete:async()=>{r(h),b(!1),$(!1),y.current?.closeDrawer()},onCancel:()=>{b(!1),$(!1),D(O)},isLastItem:1===m.length,children:f?t(pa,{children:t(ua,{isUpdate:!0,categoryItem:I,formData:S,formErrors:C,handleFormChange:(...e)=>{$(!0),k(...e)},dynamicFields:A,setDynamicFields:(...e)=>{$(!0),F(...e)},validateForm:T,testConnection:s})}):e(ha,{children:[O.conditions?.length?t(ee,{conditions:O.conditions}):null,t(te,{title:g.DESTINATION_DETAILS,data:O?na(O,N):[]})]})})},ga=p.div`
|
|
276
276
|
display: flex;
|
|
277
277
|
flex-direction: column;
|
|
278
278
|
gap: 12px;
|
|
279
|
-
`,
|
|
279
|
+
`,ya=({items:i,onSelectNew:n,onSelectConfigured:o,isLoadingForDestinationIds:a})=>{const{configuredDestinationsUpdateOnly:r}=mt();return i.map(i=>{const l=i.name===Dt.EXISTS;return e(ga,{children:[t(K,{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}-${e.id||""}`,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}`)})},va=p.div`
|
|
280
280
|
display: flex;
|
|
281
281
|
flex-direction: column;
|
|
282
282
|
gap: 24px;
|
|
283
|
-
`,
|
|
283
|
+
`,fa=p.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
align-items: center;
|
|
286
286
|
gap: 12px;
|
|
287
|
-
`,
|
|
287
|
+
`,ba=p.div`
|
|
288
288
|
width: 170px;
|
|
289
289
|
margin-right: 8px;
|
|
290
|
-
`,
|
|
290
|
+
`,xa=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
|
+
`,$a=p(va)`
|
|
302
302
|
margin-top: 80px;
|
|
303
|
-
|
|
303
|
+
`,Sa=Object.values(Dt).map(e=>({value:Et[e].TITLE,id:e})),Ca=Sa[0],ka=[St.Logs,St.Metrics,St.Traces],wa=(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}}}}),Ta=({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(Ca),[f,b]=n(ka),x=c(()=>{const e=Nt(o);return e.unshift({name:Dt.EXISTS,description:Et[Dt.EXISTS].DESCRIPTION,icon:zi,items:wa(d,u,new Set(p.concat(h).map(e=>e.id)))}),e.unshift({name:Dt.DETECTED,description:Et[Dt.DETECTED].DESCRIPTION,icon:qi,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(va,{children:[t(K,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(fa,{children:[t(ba,{children:t(C,{placeholder:"Search...",icon:Li,value:m,onChange:({target:{value:e}})=>g(e)})}),t(ba,{children:t(st,{options:Sa,value:y,onSelect:v,onDeselect:()=>{}})}),t(z,{title:"",selectedSignals:f,setSelectedSignals:b})]}),t(A,{}),x.length?t(xa,{children:t(ya,{items:x,onSelectNew:e=>r(e,f),onSelectConfigured:l,isLoadingForDestinationIds:s})}):t($a,{children:t(Ae,{title:"No destinations found"})})]})},Da=p.div`
|
|
304
304
|
display: flex;
|
|
305
|
-
`,
|
|
305
|
+
`,Na=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
|
+
`,Ea=({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,$]=n(void 0),{formData:S,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||S.name,disabled:e?.disabled||S.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||S.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}}}}},M=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(S)},R=()=>{w(),$(void 0),h("")},P=()=>{w(),$(void 0)},L=async()=>{if(x){if(!T({withAlert:!i,alertTitle:ne.Create}))return null;M()}R()};return H({key:"Enter",active:b},()=>L()),t(ae,{isOpen:b,onClose:R,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(Bi,{rotate:-90}),variant:"secondary",onClick:P}),e})()}),children:e(Da,{children:[t(Na,{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(Ta,{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||[]),$(e)},onSelectConfigured:e=>{const t=d.find(t=>t.id===e);t&&M(t)},isLoadingForDestinationIds:F}),x&&t(ua,{categoryItem:x,formData:S,formErrors:C,handleFormChange:k,dynamicFields:N,setDynamicFields:E,validateForm:T,testConnection:c})]})]})})},Aa=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
|
+
`,Fa=({categories:e,withDelete:i})=>{const{configuredDestinations:n,configuredDestinationsUpdateOnly:o}=mt();return n.length||o.length?t(Aa,{children:n.concat(o).map((a,r)=>t(Oa,{"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"})})},Oa=({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(Ai,{})}):void 0}),l&&t(J,{isOpen:s,name:o.destinationType.displayName||o.name,type:G.Destination,isLastItem:r,onApprove:()=>{o.id?m(o):h(o)},onDeny:()=>d(!1)})]})},Ia=p(Re)`
|
|
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
|
+
`,Ma=({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(K,{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(Ia,{variant:"secondary",onClick:()=>d(G.Destination),children:[t(Ri,{}),t(B,{color:c.colors.secondary,size:14,decoration:"underline",family:"secondary",children:g.ADD_DESTINATION})]})]}),t(Fa,{categories:a,withDelete:!0})]})}),t(Ea,{isOnboarding:!0,categories:a,potentialDestinations:r,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:l})]})},Ra=[{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}],Pa=({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(()=>Vn({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:$e(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(Se,{withLabels:!0,monitors:qe(e.exportedSignals)})},{columnKey:"conditions",component:()=>e.conditions?.length?t(qn,{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:Ra,rows:v})}),!y.length&&t(Ee,{style:{marginTop:"2rem"},children:t(Ae,{})})]})},La=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[Mt.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Pt.Java]||[]).map(e=>new Rt(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:g.JAVA_CUSTOM_PROBES,value:e});const t=(c[Pt.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
|
+
`,ja=[{id:Kt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Kt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Kt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],za=[{id:Kt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Kt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Kt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],qa={[Pt.Java]:[new Rt("","")],[Pt.Golang]:[new Lt("")]},Ba=["*"],Va=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
|
+
`,Ha=[{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"}],Wa={[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={[Kt.Column]:null,[Kt.FilePath]:!0,[Kt.Function]:!0,[Kt.LineNumber]:!0,[Kt.Namespace]:null,[Kt.StackTrace]:null};r("codeAttributes",e),p(!1)}},[]);const h=(e,t)=>{const i=t?[...d,e]:d.filter(t=>t!==e),n=Object.values(Kt).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:ja.map(({id:e,label:i,tooltip:n})=>t(ye,{text:n,withIcon:!0,children:t($,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!s&&t(S,{children:s})]}),e("div",{children:[t(x,{title:"Verbose data to collect",required:!0}),t(Ka,{$hasError:!!s,children:za.map(({id:e,label:i,tooltip:n})=>t(ye,{text:n,withIcon:!0,children:t($,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!s&&t(S,{children:s})]})]})},[zt.CustomInstrumentation]:({value:i,setValue:n,formErrors:a})=>{const r=a.customInstrumentations,l=c(()=>(i?.customInstrumentations?.[Pt.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[i]),s=c(()=>(i?.customInstrumentations?.[Pt.Golang]||[]).map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=(e,t)=>{const i={};switch(t){case"java":i[Pt.Java]=e.map(e=>new Rt(e.className,e.methodName)),i[Pt.Golang]=s.map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":i[Pt.Golang]=e.map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),i[Pt.Java]=l.map(({key:e,value:t})=>new Rt(e,t))}n("customInstrumentations",i)};return o(()=>{i?.customInstrumentations||n("customInstrumentations",{[Pt.Golang]:qa[Pt.Golang],[Pt.Java]:qa[Pt.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?.[Mt.HeaderKeys]||[],[e]),l=e=>{const t={[Mt.HeaderKeys]:e};i("headersCollection",t)};return o(()=>{r.length||l(Ba)},[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(Va,{$hasError:!!l,children:Ha.map(({id:e,label:i})=>t($,{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(S,{children:l})]})},[zt.UnknownType]:null},_a=({ruleType:e,value:i,setValue:n,formErrors:o})=>{if(!e)return null;const a=Wa[e];return a?t(a,{value:i,setValue:n,formErrors:o}):null},Ja=p.div`
|
|
351
351
|
display: flex;
|
|
352
352
|
flex-direction: column;
|
|
353
353
|
gap: 24px;
|
|
354
354
|
padding: 4px;
|
|
355
|
-
`,
|
|
355
|
+
`,Ua=p(B)`
|
|
356
356
|
margin-bottom: 12px;
|
|
357
|
-
`,
|
|
357
|
+
`,Ga=({isUpdate:n,rule:o,formData:a,formErrors:r,handleFormChange:l})=>{const s=m();return e(Ja,{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(Ua,{children:"Status"}),t(P,{options:[{icon:Fi,label:g.ENABLED,value:!1,selectedBgColor:s.text.success+L["050"]},{icon:Oi,label:g.DISABLED,value:!0,selectedBgColor:s.text.error+L["050"]}],selected:a.disabled,setSelected:e=>l("disabled",e)})]}):e(i,{children:[t(K,{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(_a,{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})]})},Ya=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
|
+
`,Xa=p.div`
|
|
364
364
|
display: flex;
|
|
365
365
|
flex-direction: column;
|
|
366
366
|
gap: 12px;
|
|
367
|
-
`,
|
|
367
|
+
`,Za=({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:$,validateForm:S,loadFormWithDrawerItem:C}=Ht(),k=c(()=>{if(u)return r?.find(e=>Z(e)===u)},[u,r]);if(o(()=>{h&&k?C(k):$()},[h,k]),!k)return null;const w=Wt.find(({type:e})=>e===k.type);return t(In,{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(S()){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(Ya,{children:t(Ga,{isUpdate:!0,rule:w,formData:f,formErrors:b,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(Xa,{children:[t(ee,{conditions:k.conditions||[]}),t(te,{title:"Instrumentation Rule Details",data:k?La(k):[]})]})})},Qa=p(F)`
|
|
368
368
|
margin-top: 24px;
|
|
369
369
|
gap: 12px;
|
|
370
|
-
`,
|
|
370
|
+
`,er=Wt,tr=({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(K,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e(Qa,{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:er,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(Ga,{rule:m,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},ir=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(Pt).forEach(e=>{const t=(n[e]||[]).filter(e=>e).join(", ");t&&(o+=o?`, ${t}`:t)}),o},nr=[{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}],or=({maxHeight:i,maxWidth:n})=>{const o=m(),a=fe(),{setDrawerType:r,setDrawerEntityId:l}=V(),{instrumentationRules:s,instrumentationRulesLoading:d}=Y(),u=c(()=>Vn({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:$e(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:ir(e),textColor:o.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>t(qn,{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:nr,rows:p})}),!u.length&&t(Ee,{style:{marginTop:"2rem"},children:t(Ae,{})})]})},ar=p.div`
|
|
371
371
|
position: fixed;
|
|
372
372
|
bottom: 0;
|
|
373
373
|
left: 50%;
|
|
@@ -381,17 +381,17 @@ import{jsxs as e,jsx as t,Fragment as 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: ${Ut.in.center};
|
|
384
|
-
`,
|
|
384
|
+
`,rr=({totalSourceCount:i,uninstrumentSources:o,restartWorkloads:r})=>{const l=m(),{selectedSources:s,setSelectedSources:d}=Pe(),[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(ar,{"data-id":"multi-source-control",children:[t(B,{children:"Selected sources"}),t(Oe,{label:y,filled:!0}),t(A,{orientation:"vertical",length:"16px"}),t(Re,{variant:"tertiary",onClick:v,children:t(B,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(Re,{variant:"tertiary",onClick:()=>g(!0),children:[t(Vi,{}),t(B,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(Re,{variant:"tertiary",onClick:()=>p(!0),children:[t(Ai,{}),t(B,{family:"secondary",decoration:"underline",color:l.text.error,children:"Uninstrument"})]})]}),t(J,{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(Jt,{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},lr=p.div`
|
|
385
385
|
position: relative;
|
|
386
386
|
width: fit-content;
|
|
387
|
-
`,
|
|
387
|
+
`,sr=p(O)`
|
|
388
388
|
gap: 12px;
|
|
389
389
|
padding: 0 12px;
|
|
390
|
-
`,
|
|
390
|
+
`,cr=p(F)`
|
|
391
391
|
gap: 12px;
|
|
392
392
|
max-height: 400px;
|
|
393
393
|
overflow-y: auto;
|
|
394
|
-
`,
|
|
394
|
+
`,dr=p.div`
|
|
395
395
|
position: absolute;
|
|
396
396
|
bottom: 0;
|
|
397
397
|
left: 0;
|
|
@@ -400,19 +400,19 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
400
400
|
border-radius: 0 0 24px 24px;
|
|
401
401
|
background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
|
|
402
402
|
pointer-events: none;
|
|
403
|
-
`,
|
|
403
|
+
`,ur=p(B)`
|
|
404
404
|
background-color: ${({theme:e})=>e.colors.orange_soft};
|
|
405
405
|
color: ${({theme:e})=>e.text.primary};
|
|
406
406
|
border-radius: 32px;
|
|
407
407
|
width: fit-content;
|
|
408
408
|
padding: 2px 8px;
|
|
409
|
-
`,
|
|
409
|
+
`,pr=()=>{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(lr,{children:[t(I,{onClick:()=>{p(0,0),d(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:i.colors.orange_og,children:t(Hi,{size:18})}),e(nt,{ref:s,isOpen:c,right:u.left,maxWidth:"400px",header:e(sr,{children:[t(B,{size:20,children:"Notifications"}),!!l&&e(ur,{size:12,family:"secondary",children:[l," new"]})]}),children:[t(cr,{children:a.length?a.map(e=>t(fr,{...e,onClick:()=>d(!1)},`notification-${e.id}`)):t(Ae,{title:"No notifications",subTitle:""})}),t(dr,{})]})]})},hr=p.div`
|
|
410
410
|
display: flex;
|
|
411
411
|
align-items: flex-start;
|
|
412
412
|
gap: 12px;
|
|
413
413
|
padding: 16px;
|
|
414
414
|
border-radius: 16px;
|
|
415
|
-
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+
|
|
415
|
+
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+L["080"]};
|
|
416
416
|
cursor: not-allowed;
|
|
417
417
|
&.click-enabled {
|
|
418
418
|
cursor: pointer;
|
|
@@ -420,32 +420,32 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
420
420
|
background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
`,
|
|
424
|
-
background-color: ${({$type:e,theme:t})=>t.text[e]+
|
|
423
|
+
`,mr=p.div`
|
|
424
|
+
background-color: ${({$type:e,theme:t})=>t.text[e]+L["015"]};
|
|
425
425
|
border-radius: 8px;
|
|
426
426
|
width: 36px;
|
|
427
427
|
height: 36px;
|
|
428
428
|
display: flex;
|
|
429
429
|
align-items: center;
|
|
430
430
|
justify-content: center;
|
|
431
|
-
`,mr=p.div`
|
|
432
|
-
width: 290px;
|
|
433
431
|
`,gr=p.div`
|
|
434
|
-
|
|
432
|
+
width: 290px;
|
|
435
433
|
`,yr=p.div`
|
|
434
|
+
margin-bottom: 6px;
|
|
435
|
+
`,vr=p.div`
|
|
436
436
|
display: flex;
|
|
437
437
|
align-items: center;
|
|
438
438
|
gap: 6px;
|
|
439
|
-
`,
|
|
439
|
+
`,fr=({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(hr,{className:y?"click-enabled":"",onClick:()=>{y&&(u(),g({id:n,crdType:c,target:d}))},children:[t(mr,{$type:v?se.Error:a,children:t(v?Ai:f,{})}),e(gr,{children:[t(yr,{children:t(B,{size:14,children:l})}),e(vr,{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}`)},br=({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:on.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),n},xr=(e,t,i)=>{const n=e?.serviceName||t?.otelServiceName||t?.name,o=i?[Wi]:t?We(t):[],{priorotizedStatus:a}=pe(t?.conditions||[]);return{id:n,title:n,icons:o.length?o:[_i],status:a,serviceMapEntry:e}},$r=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,Sr=new ln,Cr={"elk.algorithm":"layered","elk.direction":"DOWN","elk.layered.spacing.nodeNodeBetweenLayers":"100","elk.spacing.nodeNode":"80"},kr=p.div`
|
|
440
440
|
width: 100%;
|
|
441
441
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
442
442
|
position: relative;
|
|
443
|
-
`,
|
|
443
|
+
`,wr={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},Tr=({heightToRemove:e,serviceMap:i})=>{const n=m(),{sources:a}=Y(),[r,s,c]=an([]),[d,u,p]=rn([]),h=l([]);h.current=r;const y=l(n);return y.current=n,o(()=>{let e=!1;const t=[wr].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:xr(t,s,$r(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:xr(t,l,$r(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:xr(void 0,e,$r(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(br({theme:y.current,nodes:n,serviceMap:i}));const r=br({theme:y.current,nodes:n,serviceMap:i});return(async(e,t,i={})=>{const n={id:"root",layoutOptions:{...Cr,...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 Sr.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(br({theme:y.current,nodes:n,serviceMap:i}))}),()=>{e=!0}},[i,a]),o(()=>{h.current.length&&u(br({theme:n,nodes:h.current,serviceMap:i}))},[n,i]),t(kr,{$heightToRemove:e,children:t(Qt,{nodes:r,edges:d,onNodesChange:c,onEdgesChange:p,zoomOnScroll:!0})})},Dr=p.div`
|
|
444
444
|
width: 100%;
|
|
445
445
|
padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
|
|
446
446
|
border-radius: 16px;
|
|
447
|
-
background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+
|
|
448
|
-
`,
|
|
447
|
+
background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+L["024"]:t.colors.dropdown_bg_2+L["040"]};
|
|
448
|
+
`,Nr=p.div`
|
|
449
449
|
display: flex;
|
|
450
450
|
justify-content: space-between;
|
|
451
451
|
gap: 12px;
|
|
@@ -454,29 +454,29 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
454
454
|
border-radius: 16px;
|
|
455
455
|
cursor: ${({$withClick:e})=>e?"pointer":"unset"};
|
|
456
456
|
&:hover {
|
|
457
|
-
background-color: ${({$withClick:e,$selected:t,theme:i})=>e&&(t?i.colors.majestic_blue+
|
|
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
|
+
`,Er=p(Nr)`
|
|
461
461
|
width: calc(100% - 100px);
|
|
462
462
|
margin: 0 auto;
|
|
463
463
|
padding: 8px;
|
|
464
|
-
`,
|
|
464
|
+
`,Ar=p.div`
|
|
465
465
|
position: relative;
|
|
466
466
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
467
|
-
`,
|
|
467
|
+
`,Fr=p.div`
|
|
468
468
|
position: absolute;
|
|
469
469
|
top: 6px;
|
|
470
470
|
left: 18px;
|
|
471
|
-
`,
|
|
471
|
+
`,Or=p(Ee)`
|
|
472
472
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
473
|
-
`,
|
|
473
|
+
`,Ir=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
|
+
`,Mr=Te(G.Namespace),Rr=({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,S=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(Dr,{"data-id":`namespace-${i}`,$selected:S,$isOpen:x,children:[e(Nr,{$selected:S,$withClick:!!l,onClick:()=>l?.(i),children:[e(O,{$gap:12,children:[l&&t($,{partiallyChecked:C,value:S,onChange:e=>l(i,e)}),t(Mr,{}),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(Ir,{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(Ar,{$addPadding:!c,children:[t(Fr,{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(Pr,{withInstances:n,source:e,namespace:i,isSelected:o,onSelect:c},`source-${e.name}`)})]}):t(Or,{$addPadding:!c,children:y||o?t(Me,{}):t(Ae,{title:g.NO_SOURCES_NAMESPACE,subTitle:g.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${i}`):null})}):t(Ee,{children:y||o?t(Me,{}):t(Ae,{title:g.NO_SOURCES,subTitle:!h&&l?g.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:g.PLEASE_ADD_SOURCE})})},Pr=({withInstances:i,source:n,namespace:o,isSelected:a,onSelect:r})=>{const{tier:l}=je(),s=l!==_t.Onprem&&!!n.kind&&ei.has(n.kind);return t(Er,{"data-id":`source-${n.name}`,$selected:!s&&a,$withClick:!s&&!!r,onClick:()=>!s&&r?.(n),style:s?{opacity:.5,cursor:"not-allowed"}:void 0,children:e(O,{$gap:12,children:[r&&t($,{value:!s&&a,onChange:()=>!s&&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}`,s?" • Enterprise only":""]})]})]})})},Lr=p.div`
|
|
480
480
|
display: flex;
|
|
481
481
|
flex-direction: column;
|
|
482
482
|
align-items: center;
|
|
@@ -485,46 +485,46 @@ 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
|
-
`,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(
|
|
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(K,{title:g.SUMMARY,description:g.STREAM_CONFIRM}),e(Lr,{children:[t(te,{title:g.STREAM_NAME,action:()=>t(ti,{onClick:i}),data:[{title:"",value:r}]}),t(te,{title:g.SELECTED_SOURCES,titleBadge:u,action:()=>t(ti,{onClick:n}),children:t(Rr,{filteredNamespacesAndSources:l,withInstances:!1})}),t(te,{title:g.SELECTED_DESTINATIONS,titleBadge:s.length+d.length,action:()=>t(ti,{onClick:o}),children:t(Fa,{categories:a})})]})]})})};var jr;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(jr||(jr={}));const zr=({onClickId:e,defaultSelectedId:i,extendedNavIcons:o})=>{const{isVm:a}=je(),[r,l]=n(i||""),s=c(()=>[{id:jr.Overview,icon:Ji,selected:r===jr.Overview,onClick:()=>{l(jr.Overview),e(jr.Overview)},tooltip:"Overview"},...(o||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{l(e.id),e.onClick()}}))],[r]),d=c(()=>{const t=[{id:jr.Sources,icon:Ui,selected:r===jr.Sources,onClick:()=>{l(jr.Sources),e(jr.Sources)},tooltip:"Sources"},{id:jr.Destinations,icon:Gi,selected:r===jr.Destinations,onClick:()=>{l(jr.Destinations),e(jr.Destinations)},tooltip:"Destinations"}];return a||(t.push({id:jr.InstrumentationRules,icon:Yi,selected:r===jr.InstrumentationRules,onClick:()=>{l(jr.InstrumentationRules),e(jr.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:jr.Actions,icon:Xi,selected:r===jr.Actions,onClick:()=>{l(jr.Actions),e(jr.Actions)},tooltip:"Actions"})),t},[a,r]);return t(ii,{orientation:"vertical",mainIcons:s,subIcons:d})},qr=({})=>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(Zi,{})}),Br=(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},Vr=p.div`
|
|
489
489
|
display: flex;
|
|
490
490
|
flex-direction: column;
|
|
491
491
|
gap: 24px;
|
|
492
492
|
padding: 4px;
|
|
493
|
-
`,
|
|
493
|
+
`,Hr=({formData:e,handleFormChange:i})=>t(Vr,{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)})}),Wr=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const i=ni(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)"})})},_r=({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||oi(d)?se.Error:se.Success,m=[];return m.push(t(ai,{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(ri,{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(ri,{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(ri,{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(ri,{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(li,{...e},`pod-container-${e.containerName.value}`))}),p&&(m.push(t(A,{length:"100%",margin:"0"},"divider-6")),m.push(t(sn,{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(si,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:ci(),label:"Restart",rightIcon:Pi,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(Me,{})})},Jr=p(O)`
|
|
494
494
|
width: 100%;
|
|
495
495
|
align-items: center;
|
|
496
496
|
justify-content: space-between;
|
|
497
|
-
`,
|
|
497
|
+
`,Ur=({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(Nt(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(Jr,{$width:"100%",children:[t(B,{size:12,color:l.text.grey,children:i}),e(O,{$gap:4,children:[r.map(({key:e,value:n})=>di(n)&&ui(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(Me,{})})},Gr="70vh",Yr=(e,t)=>e.serviceName.localeCompare(t.serviceName),Xr=p(B)`
|
|
498
498
|
cursor: ${({$clickable:e})=>e?"pointer":"default"};
|
|
499
499
|
text-decoration: ${({$clickable:e})=>e?"underline":"none"};
|
|
500
500
|
&:hover {
|
|
501
501
|
opacity: ${({$clickable:e})=>e?.7:1};
|
|
502
502
|
}
|
|
503
|
-
`,
|
|
503
|
+
`,Zr=p(O)`
|
|
504
504
|
justify-content: flex-end;
|
|
505
505
|
align-items: center;
|
|
506
506
|
gap: 6px;
|
|
507
507
|
cursor: pointer;
|
|
508
|
-
`,
|
|
508
|
+
`,Qr=({items:n,emptyMessage:o,keyPrefix:r,findSource:l,onNavigate:s})=>{const c=m();return n.length?t(i,{children:n.map(({serviceName:i},o)=>{const d=!!l(i);return e(a,{children:[t(Xr,{size:13,color:d?c.text.secondary:c.text.grey,$clickable:d,onClick:()=>s(i),children:i}),o!==n.length-1&&t(A,{length:"100%",margin:"0"})]},`${r}-${i}`)})}):t(B,{size:13,color:c.text.grey,children:o})},el=({source:i,fetchPeerSources:a})=>{const r=m(),{setDrawerType:s,setDrawerEntityId:c}=V(),u=Y(e=>e.sources),[p,h]=n(!1),[g,y]=n(!1),[v,f]=n(null),b=i.otelServiceName||i.name,x=l(a);x.current=a;const $=d(()=>{b&&(y(!0),h(!1),x.current(b).then(({data:e})=>{e?.peerSources?f(e.peerSources):h(!0)}).finally(()=>y(!1)))},[b]);o(()=>{$()},[$]);const S=d(e=>u.find(t=>t.otelServiceName===e||t.name===e),[u]),C=d(e=>{const t=S(e);t&&(s(G.Source),c({namespace:t.namespace,name:t.name,kind:t.kind}))},[S,s,c]);if(!v&&!p&&g)return t(Ee,{$height:Gr,children:t(Me,{})});if(p)return t(Ee,{$height:Gr,children:t(Ae,{subTitle:"Could not fetch peer sources"})});const k=v?.inbound?[...v.inbound].sort(Yr):[],w=v?.outbound?[...v.outbound].sort(Yr):[];return e(F,{$gap:12,children:[t(te,{title:"Inbound",titleBadge:k.length,description:`Services that send requests to ${b}`,children:t(Qr,{items:k,emptyMessage:"No inbound connections",keyPrefix:"inbound",findSource:S,onNavigate:C})}),t(te,{title:"Outbound",titleBadge:w.length,description:`Services that ${b} sends requests to`,children:t(Qr,{items:w,emptyMessage:"No outbound connections",keyPrefix:"outbound",findSource:S,onNavigate:C})}),e(Zr,{onClick:$,children:[t(Pi,{size:14}),t(B,{size:12,color:r.text.grey,decoration:"underline",children:"Refresh"})]})]})};var tl;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries",e.PeerSources="Peer Sources"}(tl||(tl={}));const il=[hi.Deployment,hi.StatefulSet,hi.DaemonSet,hi.DeploymentConfig,hi.Rollout,hi.StaticPod],nl=[hi.Deployment,hi.StatefulSet,hi.DaemonSet,hi.DeploymentConfig,hi.Rollout,hi.Pod],ol=[mi.Python,mi.Go,mi.Java],al=p.div`
|
|
509
509
|
width: 100%;
|
|
510
510
|
height: 100%;
|
|
511
511
|
max-height: calc(100vh - 220px);
|
|
512
512
|
overflow: overlay;
|
|
513
513
|
overflow-y: auto;
|
|
514
|
-
`,
|
|
514
|
+
`,rl=p.div`
|
|
515
515
|
display: flex;
|
|
516
516
|
flex-direction: column;
|
|
517
517
|
gap: 12px;
|
|
518
|
-
`;var
|
|
518
|
+
`;var ll;!function(e){e.Workload="Workload",e.Pod="Pod"}(ll||(ll={}));const sl=({persistSources:a,updateSource:r,restartWorkloads:s,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,fetchPeerSources:h,restartPod:m,recoverFromRollback:y})=>{const{isVm:v}=je(),{sources:f}=Y(),{selectedStreamName:b}=Ge(),{drawerType:x,drawerEntityId:$}=V(),S=c(()=>Xe(f,b),[f,b]),C=l(null),k=x===G.Source,[w,T]=n(!1),[D,N]=n(!1),[E,A]=n(tl.Overview),[F,O]=n(null);o(()=>{k&&$&&d($).then(e=>O(e||null))},[k,$]);const{formData:I,handleFormChange:M,resetFormData:R,loadFormWithDrawerItem:P}=pi(),L=c(()=>{if($)return F&&JSON.stringify(Gt(F))===JSON.stringify(Gt($))?F:S?.find(e=>JSON.stringify(Gt(e))===JSON.stringify(Gt($)))},[$,S,F]);o(()=>{k&&L?P(L):R()},[k,L]);const K=c(()=>{const e=L?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===me.Loading,containers:L?.containers||[]}},[L]),j=c(()=>!!L?.rollbackOccurred,[L?.rollbackOccurred]),z=c(()=>{const e=[{label:tl.Overview,onClick:()=>A(tl.Overview),selected:E===tl.Overview}];return v||(il.includes(L?.kind)&&e.push({label:tl.Pods,onClick:()=>A(tl.Pods),selected:E===tl.Pods}),L?.containers?.some(({language:e})=>ol.includes(e))&&e.push({label:tl.Libraries,onClick:()=>A(tl.Libraries),selected:E===tl.Libraries}),e.push({label:tl.PeerSources,onClick:()=>A(tl.PeerSources),selected:E===tl.PeerSources})),e},[E,L,v]),q=nl.includes(L?.kind),[H,W]=n({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});return L?e(In,{ref:C,onClose:()=>{A(tl.Overview),O(null)},title:L.otelServiceName||L.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:yi(L.containers),isEdit:w,isFormDirty:D,onEdit:E===tl.Overview?e=>{T("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=I.otelServiceName!==L.name?I.otelServiceName:"";M("otelServiceName",e),await r($,{...I,otelServiceName:e}),O(null),N(!1),T(!1)},onDelete:E===tl.Overview?async()=>{const{namespace:e}=L;a({[e]:[{...L,selected:!1,currentStreamName:b}]},{}),O(null),N(!1),T(!1),C.current?.closeDrawer()}:void 0,onCancel:()=>{N(!1),T(!1),M("otelServiceName",L.otelServiceName||L.name||"")},isLastItem:1===S.length,tabs:z,headerActionButtons:v?[]:q?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>W({openFor:ll.Workload,workloadId:$}),children:e(i,{children:[t(Vi,{}),t(B,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[E===tl.Overview?w?t(al,{children:t(Hr,{formData:I,handleFormChange:(...e)=>{N(!0),M(...e),M("currentStreamName",b)}})}):e(rl,{children:[t(Wr,{workloadOdigosHealthStatus:L.workloadOdigosHealthStatus}),j&&t(le,{type:se.Warning,message:g.ROLLBACK_OCCURRED_MESSAGE,action:{label:g.ROLLBACK_RECOVER,onClick:async()=>{await y($);const e=await d($);e&&O(e)}}}),t(ee,{conditions:L.conditions||[]}),t(te,{title:g.SOURCE_DETAILS,data:L?Br(L,v):[]}),t(te,{title:v?g.DETECTED_PROCESSES:g.DETECTED_CONTAINERS,titleBadge:K.isLoading?me.Loading:K.containers.length,description:K.description||(v?g.DETECTED_PROCESSES_DESCRIPTION:g.DETECTED_CONTAINERS_DESCRIPTION),children:K.containers.map(e=>t(gi,{...e,callbackRuntimeOverride:e=>r($,e)},`source-container-${e.containerName}`))}),L.manifestYAML&&t(sn,{title:`${L.kind} YAML`,yaml:L.manifestYAML,defaultOpen:!L.instrumentationConfigYAML}),L.instrumentationConfigYAML&&t(sn,{title:"Instrumentation Config YAML",yaml:L.instrumentationConfigYAML,defaultOpen:!L.manifestYAML})]}):E===tl.Pods?t(_r,{source:L,fetchSourceDescribe:u,onClickRestartPod:q?(e,t)=>W({openFor:ll.Pod,podNamespace:e,podName:t}):void 0}):E===tl.PeerSources?t(el,{source:L,fetchPeerSources:h}):t(Ur,{source:L,fetchSourceLibraries:p}),t(Jt,{isOpen:!!H.openFor,title:`Rollout Restart ${H.openFor}`,description:`Are you sure you want to rollout restart this ${H.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:se.Warning,onClick:()=>{H.openFor===ll.Workload&&H.workloadId?s([H.workloadId]):H.openFor===ll.Pod&&H.podNamespace&&H.podName&&m(H.podNamespace,H.podName),W({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{W({openFor:null})}}})]}):null},cl=p.div`
|
|
519
519
|
max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
|
|
520
520
|
width: 100%;
|
|
521
|
-
`,
|
|
521
|
+
`,dl=r(({isModal:i,fetchNamespacesWithWorkloads:n,onClickSummary:o},a)=>{const r=m(),{isVm:l}=je(),c=vi({fetchNamespacesWithWorkloads:n}),{selectedSources:d,loading:u,selectedAllNamespaces:p,onSelectAllNamespaces:h,getApiSourcesPayload:y,getApiFutureAppsPayload:v,searchText:f,setSearchText:b,searchBy:x,setSearchBy:$,showSelectedOnly:S,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(K,{title:g.SELECT_SOURCES,badgeLabel:N,description:g.SELECT_SOURCES_DESCRIPTION}),e(O,{$justifyContent:"space-between",children:[t(cl,{$fullWidth:l,children:t(C,{placeholder:x===G.Source?g.SEARCH_SOURCES:g.SEARCH_NAMESPACES,icon:Li,value:f,onChange:e=>b(e.target.value.toLowerCase())})}),!l&&t(P,{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:$})]}),e(O,{$gap:36,children:[t(D,{title:g.SELECT_ALL,initialValue:p,onChange:h,disabled:u}),t(D,{title:g.ONLY_SELECTED,initialValue:S,onChange:k}),t(D,{title:g.ONLY_RUNNING_INSTANCES,initialValue:w,onChange:T})]})]}),t(A,{}),t(Rr,{isModal:i,...c})]})})});dl.displayName=dl.name;const ul=({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(dl,{ref:c,isModal:!0,fetchNamespacesWithWorkloads:e})}):null},pl=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},hl=({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}=Pe(),{progress:b}=_e(),x=c(()=>b[Je.Instrumenting]||b[Je.Uninstrumenting]?b[Je.Instrumenting]?.percentage||b[Je.Uninstrumenting]?.percentage||0:void 0,[b[Je.Instrumenting],b[Je.Uninstrumenting]]),S=c(()=>Xe(u,s),[u,s]),C=c(()=>Vn({instrumentationRules:[],sources:Qe(S,l),actions:[],destinations:[],searchText:l.searchText,selectedCategory:G.Source}).searchResults.find(({category:e})=>e===G.Source)?.entities||[],[S,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($,{value:d,onChange:()=>D(n)}),t(fi,{icons:We(n),id:r})]})},{columnKey:"name",value:$e(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(qn,{conditions:n.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(he,{status:se.Info,title:bi(n.containers),withBorder:!0})})}]}}),[C,v,i,D]),{badge:E,badgeTooltip:A}=c(()=>C.length!==S.length?{badge:`${C.length}/${S.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:S.length,badgeTooltip:void 0},[C,S]);return e(Ce,{$maxWidth:o,children:[e(ke,{children:[t($,{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:pl(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[Je.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Oe,{label:`${x}%`})]})]})]})},ml=({expiresAt:t})=>{const i=m(),{formatTimeAgo:n}=Yt(),o=n(t),a=new Date(t).toDateString().split(" ").slice(1).join(" "),r=xi(t,0)?i.text.error:xi(t,6048e5)?i.text.warning:i.text.success;return e(B,{size:14,color:r,children:[o," (",a,")"]})},gl=p.div`
|
|
522
522
|
position: relative;
|
|
523
|
-
`,
|
|
523
|
+
`,yl=({token:i,saveToken:o})=>{const{CopyButton:a}=$i(),{formData:r,handleFormChange:l,resetFormData:s}=Si({token:i}),[c,d]=n(!1),u=()=>{d(!1),s()};return e(O,{$gap:0,children:[t(a,{value:i,size:Ci.L}),t(A,{orientation:"vertical",length:"12px"}),e(gl,{children:[t(I,{size:32,onClick:()=>{d(!0)},children:t(Ii,{})}),c&&t(ki,{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)})})]})]})},vl=({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:Qi},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(ml,{expiresAt:o})},{columnKey:"actions",component:()=>t(yl,{token:n,saveToken:i})}]}))}}]}),fl=({fetchDescribeOdigos:a})=>{const[r,l]=n(null);if(o(()=>{a().then(({data:e})=>l(e?.describeOdigos||null))},[]),!r)return t(Ee,{children:t(Me,{})});const s=e=>e?.name?[t(A,{},`divider-${e.name}`),t(ri,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(di(e.value)?ui(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)})]})},bl=p.div`
|
|
524
524
|
display: flex;
|
|
525
525
|
flex-direction: column;
|
|
526
526
|
gap: 12px;
|
|
527
|
-
`,
|
|
527
|
+
`,xl="System Overview",$l=({tokens:o,saveToken:a,fetchDescribeOdigos:r})=>{const[l,s]=n(!1),c=()=>s(e=>!e);return e(i,{children:[t(I,{onClick:c,tooltip:xl,children:t(en,{size:18})},xl),t(_,{width:"750px",isOpen:l,onClose:c,header:{icons:[en],title:xl},footer:{isOpen:!1},children:e(bl,{children:[!!o?.length&&t(vl,{tokens:o,saveToken:a}),t(fl,{fetchDescribeOdigos:r})]})})]})},Sl=p.div`
|
|
528
528
|
position: fixed;
|
|
529
529
|
bottom: 12px;
|
|
530
530
|
left: 12px;
|
|
@@ -533,7 +533,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
533
533
|
flex-direction: column-reverse;
|
|
534
534
|
gap: 6px;
|
|
535
535
|
max-width: 600px;
|
|
536
|
-
`,
|
|
536
|
+
`,Cl=()=>{const{notifications:e,markAsDismissed:i,markAsSeen:n}=Vt(),{onClickNotification:o}=Xt();return t(Sl,{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}`))})},kl=p.div`
|
|
537
537
|
position: relative;
|
|
538
538
|
display: flex;
|
|
539
539
|
align-items: center;
|
|
@@ -552,7 +552,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
552
552
|
stroke: ${({theme:e})=>e.text.secondary};
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
`,
|
|
555
|
+
`,wl=p.div`
|
|
556
556
|
position: absolute;
|
|
557
557
|
top: 2px;
|
|
558
558
|
left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
|
|
@@ -562,19 +562,19 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
562
562
|
background-color: ${({theme:e})=>e.colors.border};
|
|
563
563
|
border-radius: 100%;
|
|
564
564
|
transition: all 0.3s;
|
|
565
|
-
`,
|
|
565
|
+
`,Tl=({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})}),Dl=()=>{const{darkMode:i,setDarkMode:n}=wi();return e(kl,{onClick:()=>n(!i),children:[t(Tl,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),t(Tl,{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(wl,{$darkMode:i})]})},Nl=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)},El=(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},Al=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},Fl=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:Ti(a)}),s.push({title:"Start time",value:new Date(r/1e3).toLocaleString()}),l.length&&(s.push({type:y.Divider}),s.push({title:"Warnings",titleIcon:tn,value:l})),s},Ol=(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},Il=p.div`
|
|
566
566
|
display: flex;
|
|
567
567
|
flex-direction: column;
|
|
568
568
|
gap: 12px;
|
|
569
569
|
max-height: 100vh;
|
|
570
570
|
overflow-y: auto;
|
|
571
|
-
`,
|
|
571
|
+
`,Ml=({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:[nn],title:i.operationName},footer:{isOpen:!1},children:e(Il,{children:[t(te,{title:"Details",data:Fl(i)}),i.logs.length>0&&t(te,{title:"Errors",titleBadge:i.logs.length,titleIcon:tn,data:Al(i)}),t(te,{title:"Tags",data:El(i,r),action:t(Di,{isPrettyMode:r,setIsPrettyMode:l})}),o&&t(te,{title:`Process (${o.serviceName})`,data:Ol(o,s),action:t(Di,{isPrettyMode:s,setIsPrettyMode:c})})]})})},Rl=370,Pl=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),Ll=p.div`
|
|
572
572
|
display: flex;
|
|
573
573
|
align-items: center;
|
|
574
|
-
width: ${
|
|
575
|
-
background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+
|
|
574
|
+
width: ${Rl}px;
|
|
575
|
+
background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+L["042"]:t.colors.dark_grey};
|
|
576
576
|
&:hover {
|
|
577
|
-
${({$withErrors:e,$preventHover:t,theme:i})=>!t&&`background-color: ${e?i.colors.error:i.colors.secondary+
|
|
577
|
+
${({$withErrors:e,$preventHover:t,theme:i})=>!t&&`background-color: ${e?i.colors.error:i.colors.secondary+L["010"]};`}
|
|
578
578
|
cursor: ${({$preventHover:e})=>e?"default":"pointer"};
|
|
579
579
|
}
|
|
580
580
|
`,Kl=p(O)`
|
|
@@ -583,29 +583,29 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
583
583
|
gap: 4px;
|
|
584
584
|
padding: 12px;
|
|
585
585
|
padding-left: ${({$depth:e})=>12*e||12}px;
|
|
586
|
-
width: calc(${
|
|
587
|
-
`,
|
|
586
|
+
width: calc(${Rl}px - ${({$depth:e})=>12*e}px);
|
|
587
|
+
`,jl=p(O)`
|
|
588
588
|
align-items: center;
|
|
589
589
|
gap: 4px;
|
|
590
590
|
position: absolute;
|
|
591
591
|
right: 56px;
|
|
592
592
|
width: calc(100% - ${434}px);
|
|
593
|
-
`,
|
|
593
|
+
`,zl=p.div`
|
|
594
594
|
position: absolute;
|
|
595
595
|
left: ${({$startTime:e,$minStartTime:t,$maxEndTime:i})=>(e-t)/(i-t)*100+"%"};
|
|
596
596
|
width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
|
|
597
597
|
height: 12px;
|
|
598
598
|
border-radius: 32px;
|
|
599
|
-
background-color: ${({$indexInMatrix:e})=>
|
|
600
|
-
`,
|
|
599
|
+
background-color: ${({$indexInMatrix:e})=>Pl[e%Pl.length]};
|
|
600
|
+
`,ql=p(B)`
|
|
601
601
|
padding-left: calc(100% + 8px);
|
|
602
602
|
font-size: 10px;
|
|
603
603
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
604
604
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
605
605
|
white-space: nowrap;
|
|
606
|
-
`,
|
|
606
|
+
`,Bl=({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=Rl-12*o-20-(c?12:0),x=c&&(1===o||i.logs.length>0);return e(Ll,{className:"span-container",$withErrors:c,$preventHover:v,onClick:g,children:[e(Kl,{$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(Ei,{maxWidth:b/2,text:i.processID,textSize:14}),t(B,{size:12,color:y.text.darker_grey,children:"•"}),t(Ei,{maxWidth:b/2,text:i.operationName,textSize:12,textColor:y.text.darker_grey})]}),c&&(x?t(ye,{...d,children:t(tn,{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(jl,{className:"span-right",children:t(zl,{$indexInMatrix:a,$duration:i.duration,$maxDuration:r,$startTime:i.startTime,$minStartTime:l,$maxEndTime:s,children:t(ql,{children:Ti(i.duration)})})})]})},Vl=({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:Ni(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(Bl,{span:i,depth:o,indexInMatrix:a+p+o,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:v,errorTooltip:{titleIcon:tn,title:f,text:b},isOpen:m,withToggle:g,onToggleOpen:()=>c.set(e=>e.some(e=>e===h)?e.filter(e=>e!=h):[...e,h,...Ni(i,"spans","spanID")]),onSelect:()=>d.set(e=>e?.spanID===h?null:i)}),m&&g?t(Vl,{spans:i.spans||[],logs:y,depth:o+1,indexInMatrix:a+p,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d}):null]},`span-${h}`)})},Hl=p.div`
|
|
607
607
|
width: 100%;
|
|
608
|
-
`,
|
|
608
|
+
`,Wl=p.div`
|
|
609
609
|
max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
610
610
|
overflow: auto;
|
|
611
611
|
|
|
@@ -615,22 +615,22 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
615
615
|
border-radius: 24px;
|
|
616
616
|
border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
617
617
|
position: relative;
|
|
618
|
-
`,
|
|
618
|
+
`,_l=p.div`
|
|
619
619
|
padding: 12px 12px 12px 24px;
|
|
620
|
-
width: calc(${
|
|
620
|
+
width: calc(${Rl}px - 36px);
|
|
621
621
|
background-color: ${({theme:e})=>e.colors.dark_grey};
|
|
622
|
-
`,
|
|
622
|
+
`,Jl=p.div`
|
|
623
623
|
width: 1px;
|
|
624
624
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
625
625
|
background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
|
|
626
626
|
|
|
627
627
|
position: absolute;
|
|
628
|
-
left: calc(${
|
|
629
|
-
`,
|
|
628
|
+
left: calc(${Rl}px + ((100% - ${Rl}px) / ${5}) * ${({index:e})=>e});
|
|
629
|
+
`,Ul=p(B)`
|
|
630
630
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
631
631
|
font-size: 12px;
|
|
632
632
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
633
633
|
padding-top: 12px;
|
|
634
634
|
padding-left: 12px;
|
|
635
635
|
white-space: nowrap;
|
|
636
|
-
`,
|
|
636
|
+
`,Gl=({heightToRemove:o,traces:a,isLoading:r})=>{const[l,s]=n([]),[d,u]=n(null),p=c(()=>Nt(a).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:Nl(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(Hl,{$heightToRemove:o,children:r?t(Ee,{$height:"50vh",children:t(Me,{scale:1.5})}):p.length?e(Wl,{$heightToRemove:o,children:[t(_l,{children:t(B,{children:"Service & operation"})}),new Array(5).fill(null).map((e,i)=>t(Jl,{$heightToRemove:o,index:i,children:t(Ul,{children:Ti(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(Vl,{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(Ml,{span:d,process:m,onClose:()=>u(null)})]})};export{Ln as ActionDrawer,On as ActionForm,jn as ActionModal,Wn as ActionTable,Yn as AwaitPipeline,No as ConditionDropdown,Co as DataFlow,ea as DataFlowActionsMenu,Ho as DataStreamDrawer,Bo as DataStreamForm,ia as DataStreamModal,ta as DataStreamSelectionForm,ma as DestinationDrawer,ua as DestinationForm,Ea as DestinationModal,Ma as DestinationSelectionForm,Pa as DestinationTable,Eo as ErrorDropdown,Za as InstrumentationRuleDrawer,Ga as InstrumentationRuleForm,tr as InstrumentationRuleModal,or as InstrumentationRuleTable,Io as KindDropdown,Ao as LanguageDropdown,Fo as MonitorDropdown,rr as MultiSourceControl,Oo as NamespaceDropdown,jr as NavIconIds,pr as NotificationManager,In as OverviewDrawer,Mo as PodsAgentInjectionStatusDropdown,Tr as ServiceMap,Kr as SetupSummary,zr as SideNav,qr as SlackInvite,sl as SourceDrawer,Hr as SourceForm,ul as SourceModal,dl as SourceSelectionForm,hl as SourceTable,$l as SystemOverview,qn as TableCellConditions,Cl as ToastList,Dl as ToggleDarkMode,Gl as TraceView};
|