@odigos/ui-kit 0.0.210 → 0.0.212
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 +15 -0
- package/lib/chunks/index-CTFaJvLO.js +3 -0
- package/lib/chunks/ui-components-DQ5eBxQh.js +2387 -0
- package/lib/chunks/vendor-C150cdxb.js +1 -0
- package/lib/components/_v2/index.d.ts +1 -0
- package/lib/components/_v2/stepper/index.d.ts +11 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/destinations/index.d.ts +5 -0
- package/lib/constants/strings/index.d.ts +12 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/_drawers/add-action-drawer/index.d.ts +2 -2
- package/lib/containers/_v2/_drawers/add-destination-drawer/form-column/index.d.ts +4 -7
- package/lib/containers/_v2/_drawers/add-destination-drawer/helpers.d.ts +1 -9
- package/lib/containers/_v2/_drawers/add-destination-drawer/index.d.ts +10 -5
- package/lib/containers/_v2/_drawers/add-destination-drawer/lists-column/index.d.ts +3 -5
- package/lib/containers/_v2/_drawers/add-destination-drawer/types.d.ts +1 -6
- package/lib/containers/_v2/_drawers/add-rule-drawer/index.d.ts +2 -2
- package/lib/containers/_v2/_drawers/add-source-drawer/index.d.ts +10 -5
- package/lib/containers/_v2/_drawers/add-source-drawer/namespaces-column/list/index.d.ts +1 -0
- package/lib/containers/_v2/_forms/add-destination-form/context.d.ts +36 -0
- package/lib/containers/_v2/_forms/add-destination-form/dynamic-fields/index.d.ts +1 -0
- package/lib/containers/_v2/_forms/add-destination-form/index.d.ts +4 -5
- package/lib/containers/_v2/central-connections/index.d.ts +2 -1
- package/lib/containers/_v2/index.d.ts +1 -0
- package/lib/containers/_v2/onboarding/background/index.d.ts +7 -0
- package/lib/containers/_v2/onboarding/get-started/index.d.ts +5 -0
- package/lib/containers/_v2/onboarding/index.d.ts +14 -0
- package/lib/containers/_v2/onboarding/summary/index.d.ts +12 -0
- package/lib/containers/_v2/pipeline-collectors/general-info/yaml-drawer/index.d.ts +1 -1
- package/lib/containers/service-map/helpers/aggregate-service-map.d.ts +6 -0
- package/lib/containers/service-map/helpers/build-edges.d.ts +3 -3
- package/lib/containers/service-map/helpers/build-map-nodes.d.ts +4 -3
- package/lib/containers/service-map/service-map-drawer.d.ts +17 -0
- package/lib/containers/v2.js +91 -30
- package/lib/containers.js +152 -129
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/icons.js +1 -1
- package/lib/snippets/_v2/index.d.ts +1 -0
- package/lib/snippets/_v2/odigos-logo-text-by-tier/index.d.ts +5 -0
- package/lib/snippets/react-flow/flow.d.ts +4 -1
- package/lib/snippets/react-flow/nodes/map-item-node.d.ts +3 -2
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/destinations/index.d.ts +9 -8
- package/lib/types/service-map/index.d.ts +22 -0
- package/lib/types/snapshot/index.d.ts +4 -4
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +26 -26
- package/lib/chunks/index-C27kJv0Y.js +0 -3
- package/lib/chunks/ui-components-CxdeQcW1.js +0 -2389
- package/lib/chunks/vendor-D99eCWta.js +0 -1
package/lib/containers.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState as i,useEffect as a,Fragment as o,forwardRef as r,useRef as s,useImperativeHandle as l,useMemo as c,useCallback as d,Children as u}from"react";import p,{css as m,useTheme as h}from"styled-components";import{a9 as g,aV as y,l as v,K as f,A as b,aW as S,aX as x,aY as C,aZ as E,c as N,i as k,a_ as w,a$ as T,b0 as $,b1 as D,D as A,F as I,g as O,b2 as R,b3 as M,k as L,b4 as F,a6 as _,b5 as P,b6 as K,b7 as j,b8 as V,b9 as z,ba as U,au as B,aG as W,bb as H,bc as q,bd as G,ar as J,ay as Y,be as X,bf as Q,bg as Z,bh as ee,bi as te,bj as ne,bk as ie,u as ae,bl as oe,bm as re,bn as se,bo as le,bp as ce,t as de,U as ue,bq as pe,br as me,bs as he,bt as ge,bu as ye,bv as ve,Y as fe,bw as be,bx as Se,by as xe,bz as Ce,bA as Ee,bB as Ne,bC as ke,bD as we,bE as Te,bF as $e,bG as De,bH as Ae,o as Ie,bI as Oe,bJ as Re,bK as Me,bL as Le,aN as Fe,bM as _e,bN as Pe,bO as Ke,bP as je,S as Ve,Q as ze,bQ as Ue,bR as Be,ae as We,bS as He,ao as qe,as as Ge,bT as Je,H as Ye,bU as Xe,bV as Qe,bW as Ze,bX as et,bY as tt,bZ as nt,b_ as it,b$ as at,c0 as ot,c1 as rt,c2 as st,c3 as lt,c4 as ct,a4 as dt,M as ut,c5 as pt,c6 as mt,c7 as ht,c8 as gt,c9 as yt,ca as vt,cb as ft,cc as bt,cd as St,z as xt,G as Ct,P as Et,ce as Nt,cf as kt,cg as wt,O as Tt,ac as $t,n as Dt,ad as At,ch as It,ci as Ot,cj as Rt,ck as Mt,Z as Lt,a0 as Ft,a1 as _t,$ as Pt,X as Kt,_ as jt,a2 as Vt,cl as zt,a5 as Ut,cm as Bt,cn as Wt,ag as Ht,m as qt,co as Gt,cp as Jt,cq as Yt,av as Xt,cr as Qt,cs as Zt,p as en,ct as tn,cu as nn,ai as an,cv as on,cw as rn,cx as sn,cy as ln,cz as cn,cA as dn,cB as un,cC as pn,aD as mn,cD as hn,cE as gn,cF as yn,cG as vn,cH as fn,cI as bn,cJ as Sn,cK as xn,cL as Cn,cM as En,aw as Nn,at as kn,J as wn,ab as Tn,cN as $n,cO as Dn,cP as An,cQ as In,cR as On,cS as Rn}from"./chunks/ui-components-DQ5eBxQh.js";import{TrashIcon as Mn,VSquareIcon as Ln,XSquareIcon as Fn,EditIcon as _n,OdigosLogoText as Pn,PlusIcon as Kn,RefreshIcon as jn,SearchIcon as Vn,FilterIcon as zn,DataStreamIcon as Un,VIcon as Bn,OdigosLogo as Wn,ArrowIcon as Hn,RefreshLeftArrowIcon as qn,NotificationIcon as Gn,UserIcon as Jn,DestinationIcon as Yn,ImageErrorIcon as Xn,ChevronDownIcon as Qn,ChevronRightIcon as Zn,OverviewIcon as ei,SourceIcon as ti,InstrumentationRuleIcon as ni,ActionIcon as ii,SlackLogo as ai,KeyIcon as oi,TerminalIcon as ri,ExclamationTriangleIcon as si,TraceViewIcon as li}from"./icons.js";import{MarkerType as ci,useNodesState as di,useEdgesState as ui}from"@xyflow/react";import{E as pi}from"./chunks/vendor-C150cdxb.js";import{Y as mi}from"./chunks/index-CTFaJvLO.js";import"zustand";import"javascript-time-ago";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const hi=e=>{const{type:t,name:n,notes:i,signals:a,disabled:o,fields:{collectContainerAttributes:r,collectReplicaSetAttributes:s,collectWorkloadId:l,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:m,attributeNamesToDelete:h,renames:b,piiCategories:S,fallbackSamplingRatio:x,samplingPercentage:C,endpointsFilters:E,servicesNameFilters:N,attributeFilters:k,urlTemplatizationRulesGroups:w}}=e,T=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!o)},{type:y.Monitors,title:g.SIGNALS_FOR_PROCESSING,value:a?.join(", ")||""},{title:g.NAME,value:n||""},{title:g.NOTES,value:i||""},{type:y.Divider}];if(t===v.K8sAttributes&&(T.push({title:"Collect Container Attributes",value:String(r)}),T.push({title:"Collect ReplicaSet Attributes",value:String(s)}),T.push({title:"Collect Workload ID",value:String(l)}),T.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&T.push({type:y.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:n,fromSources:i},a)=>{let o="";o+=`Label Key: ${e}\n`,o+=`Attribute Key: ${t}\n`;o+=`From: ${i?.length?i.join(", "):n||f.Pod}\n`,T.push({title:"Label"+(d.length>1?` #${a+1}`:""),value:o})}),u?.length&&T.push({type:y.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:n,fromSources:i},a)=>{let o="";o+=`Annotation Key: ${e}\n`,o+=`Attribute Key: ${t}\n`;o+=`From: ${i?.length?i.join(", "):n||f.Pod}\n`,T.push({title:"Annotation"+(u.length>1?` #${a+1}`:""),value:o})})),t===v.AddClusterInfo){T.push({title:"Overwrite Existing Values",value:String(m||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:n},i)=>{e+=`${t}: ${n}`,i<p.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===v.DeleteAttributes){let e="";h?.forEach((t,n)=>{e+=t,n<h.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===v.RenameAttributes){let e="";const t=Object.entries(b||{});t.forEach(([n,i],a)=>{e+=`${n}: ${i}`,a<t.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===v.PiiMasking){let e="";S?.forEach((t,n)=>{e+=t,n<S.length-1&&(e+=", ")}),T.push({title:"Categories",value:e})}return t===v.ErrorSampler&&T.push({title:"Sampling Ratio",value:String(x)}),t===v.ProbabilisticSampler&&T.push({title:"Sampling Percentage",value:String(C)}),t===v.LatencySampler&&E?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${n}\n`,o+=`Fallback Sampling Ratio: ${i}`,T.push({title:"Endpoint"+(E.length>1?` #${a+1}`:""),value:o})}),t===v.ServiceNameSampler&&N?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n},i)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Sampling Ratio: ${t}\n`,a+=`Fallback Sampling Ratio: ${n}`,T.push({title:"Filter"+(N.length>1?` #${i+1}`:""),value:a})}),t===v.SpanAttributeSampler&&k?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${n}\n`;const r=Object.keys(i)[0];o+=`Condition: ${r}\n`,o+=`Operation: ${i[r]?.operation}\n`,o+=`Expected Value: ${i[r]?.expectedValue}`,"jsonCondition"===r&&(o+=`\nJSON Path: ${i[r].jsonPath}`),T.push({title:"Filter"+(k.length>1?` #${a+1}`:""),value:o})}),t===v.URLTemplatization&&w?.forEach((e,t)=>{let n="";e.filterK8sNamespace&&(n+=`Namespace: ${e.filterK8sNamespace}\n`),e.workloadFilters?.length&&e.workloadFilters.forEach(e=>{const t=[e.kind,e.name].filter(Boolean).join("/");t&&(n+=`Workload: ${t}\n`)});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");n+=`Templates: ${i}`,e.notes&&(n+=`\nNotes: ${e.notes}`),T.push({title:"Group"+(w.length>1?` #${t+1}`:""),value:n})}),T},gi=b.PiiCategories,yi=p.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
gap: 32px;
|
|
5
|
-
${({$hasError:e})=>e&&
|
|
5
|
+
${({$hasError:e})=>e&&m`
|
|
6
6
|
border: 1px solid ${({theme:e})=>e.text.error};
|
|
7
7
|
border-radius: 32px;
|
|
8
8
|
padding: 8px;
|
|
9
9
|
`}
|
|
10
|
-
`,hn=[{id:"CREDIT_CARD",label:"Credit Card"}],mn=b.FallbackSamplingRatio,gn=[{value:f.Pod,id:f.Pod},{value:f.Namespace,id:f.Namespace},{value:f.Node,id:f.Node}],yn=[{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:gn,required:!0,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],vn=[{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:gn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],fn=b.EndpointsFilters,bn=[{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}],xn=b.AttributeNamesToDelete,$n=b.Renames,Sn=b.UrlTemplatizationRulesGroups,Cn=[{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"}],kn=b.ServicesNameFilters,wn=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"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}],Dn=b.SamplingPercentage,Tn=b.AttributeFilters,Nn=[{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}],En={[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(D,{columns:yn,value:n[b.LabelsAttributes]||[],onChange:e=>a(b.LabelsAttributes,e),errorMessage:r[b.LabelsAttributes]}),t(D,{columns:vn,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(T,{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[xn],a=e[xn]||[];return t(E,{title:"Attributes to delete",value:a,onChange:e=>i(xn,e),required:!0,errorMessage:o})},[v.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const o=n[$n],a=Object.entries(e[$n]||{}).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($n,t)},required:!0,errorMessage:o})},[v.PiiMasking]:({value:i,setValue:a,formErrors:r})=>{const l=r[un],s=i[un]||[],[c,d]=n(1===s.length);return o(()=>{if(!s.length){const e=hn.map(({id:e})=>e);a(un,e),d(1===hn.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(pn,{$hasError:!!l,children:hn.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(un,i),d(1===i.length)})(e,t)},e))}),!!l&&t(S,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[mn],a=e[mn];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(mn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[v.ProbabilisticSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[Dn],a=e[Dn];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(Dn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[v.LatencySampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[fn],a=e[fn]||[];return t(D,{columns:bn,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(fn,t)},errorMessage:o})},[v.ServiceNameSampler]:({value:e,setValue:i,formErrors:n})=>{const o=n[kn],a=e[kn]||[];return t(D,{columns:wn,value:a,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i(kn,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(D,{columns:Nn,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[Sn],s=n[Sn]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o(Sn,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(Fi,{})})]}),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(D,{title:"Workload Filters",columns:Cn,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,{})]})}},An=({actionType:e,value:i,setValue:n,formErrors:o})=>{if(!e)return null;const a=En[e];return a?t(a,{value:i,setValue:n,formErrors:o}):null},Fn=p.div`
|
|
10
|
+
`,vi=[{id:"CREDIT_CARD",label:"Credit Card"}],fi=b.FallbackSamplingRatio,bi=[{value:f.Pod,id:f.Pod},{value:f.Namespace,id:f.Namespace},{value:f.Node,id:f.Node}],Si=[{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:bi,required:!0,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],xi=[{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:bi,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],Ci=b.EndpointsFilters,Ei=[{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:N.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:N.Number}],Ni=b.AttributeNamesToDelete,ki=b.Renames,wi=b.UrlTemplatizationRulesGroups,Ti=[{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"}],$i=b.ServicesNameFilters,Di=[{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:N.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:N.Number}],Ai=b.SamplingPercentage,Ii=b.AttributeFilters,Oi=[{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:N.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:L.Dropdown,options:[{id:"stringCondition",value:"String Condition"},{id:"numberCondition",value:"Number Condition"},{id:"booleanCondition",value:"Boolean Condition"},{id:"jsonCondition",value:"JSON Condition"}]},{title:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",required:!0,componentType:L.Dropdown,options:[{id:"exists",value:"Exists"},{id:"equals",value:"Equals"},{id:"not_equals",value:"Not Equals"},{id:"contains",value:"Contains"},{id:"not_contains",value:"Not Contains"},{id:"regex",value:"Regex"},{id:"greater_than",value:"Greater Than"},{id:"less_than",value:"Less Than"},{id:"greater_than_or_equal",value:"Greater Than Or Equal"},{id:"less_than_or_equal",value:"Less Than Or Equal"},{id:"is_valid_json",value:"Is Valid JSON"},{id:"is_invalid_json",value:"Is Invalid JSON"},{id:"jsonpath_exists",value:"JSON Path Exists"},{id:"key_equals",value:"Key Equals"},{id:"key_not_equals",value:"Key Not Equals"}]},{title:"Expected Value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against.",required:!0},{title:"JSON Path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",required:!1,renderCondition:e=>"jsonCondition"===e.condition}],Ri={[v.K8sAttributes]:({value:i,setValue:o,formErrors:r})=>(a(()=>{i[b.CollectContainerAttributes]||i[b.CollectReplicaSetAttributes]||i[b.CollectWorkloadId]||i[b.CollectClusterId]||i[b.LabelsAttributes]?.length||i[b.AnnotationsAttributes]?.length||(o(b.CollectContainerAttributes,!0),o(b.CollectReplicaSetAttributes,!0),o(b.CollectWorkloadId,!0),o(b.CollectClusterId,!0),o(b.LabelsAttributes,[]),o(b.AnnotationsAttributes,[]))},[]),e(n,{children:[t(x,{title:"Collect Container Attributes",value:i[b.CollectContainerAttributes]||!1,onChange:e=>o(b.CollectContainerAttributes,e),errorMessage:r[b.CollectContainerAttributes]}),t(x,{title:"Collect ReplicaSet Attributes",value:i[b.CollectReplicaSetAttributes]||!1,onChange:e=>o(b.CollectReplicaSetAttributes,e),errorMessage:r[b.CollectReplicaSetAttributes]}),t(x,{title:"Collect Workload ID",value:i[b.CollectWorkloadId]||!1,onChange:e=>o(b.CollectWorkloadId,e),errorMessage:r[b.CollectWorkloadId]}),t(x,{title:"Collect Cluster ID",value:i[b.CollectClusterId]||!1,onChange:e=>o(b.CollectClusterId,e),errorMessage:r[b.CollectClusterId]}),t(w,{columns:Si,value:i[b.LabelsAttributes]||[],onChange:e=>o(b.LabelsAttributes,e),errorMessage:r[b.LabelsAttributes]}),t(w,{columns:xi,value:i[b.AnnotationsAttributes]||[],onChange:e=>o(b.AnnotationsAttributes,e),errorMessage:r[b.AnnotationsAttributes]})]})),[v.AddClusterInfo]:({value:i,setValue:a,formErrors:o})=>e(n,{children:[t(T,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:i[b.OverwriteExistingValues]||!1,onChange:e=>a(b.OverwriteExistingValues,e)}),t($,{title:"Resource Attributes",value:i[b.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>a(b.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:o[b.ClusterAttributes]})]}),[v.DeleteAttributes]:({value:e,setValue:n,formErrors:i})=>{const a=i[Ni],o=e[Ni]||[];return t(D,{title:"Attributes to delete",value:o,onChange:e=>n(Ni,e),required:!0,errorMessage:a})},[v.RenameAttributes]:({value:e,setValue:n,formErrors:i})=>{const a=i[ki],o=Object.entries(e[ki]||{}).map(([e,t])=>({key:e,value:t}));return t($,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),n(ki,t)},required:!0,errorMessage:a})},[v.PiiMasking]:({value:n,setValue:o,formErrors:r})=>{const s=r[gi],l=n[gi]||[],[c,d]=i(1===l.length);return a(()=>{if(!l.length){const e=vi.map(({id:e})=>e);o(gi,e),d(1===vi.length)}},[]),e("div",{children:[t(S,{title:"Attributes to mask",required:!0}),t(yi,{$hasError:!!s,children:vi.map(({id:e,label:n})=>t(x,{title:n,disabled:c&&l.includes(e),value:l.includes(e),onChange:t=>((e,t)=>{const n=t?[...l,e]:l.filter(t=>t!==e);o(gi,n),d(1===n.length)})(e,t)},e))}),!!s&&t(C,{children:s})]})},[v.ErrorSampler]:({value:e,setValue:n,formErrors:i})=>{const a=i[fi],o=e[fi];return t(E,{title:"Fallback sampling ratio",required:!0,type:N.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,n(fi,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.ProbabilisticSampler]:({value:e,setValue:n,formErrors:i})=>{const a=i[Ai],o=e[Ai];return t(E,{title:"Sampling percentage",required:!0,type:N.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,n(Ai,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.LatencySampler]:({value:e,setValue:n,formErrors:i})=>{const a=i[Ci],o=e[Ci]||[];return t(w,{columns:Ei,value:o,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(n),fallbackSamplingRatio:Number(i)}));n(Ci,t)},errorMessage:a})},[v.ServiceNameSampler]:({value:e,setValue:n,formErrors:i})=>{const a=i[$i],o=e[$i]||[];return t(w,{columns:Di,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(n)}));n($i,t)},errorMessage:a})},[v.SpanAttributeSampler]:({value:e,setValue:n,formErrors:i})=>{const a=i[Ii],o=(e[Ii]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i})=>{const a=Object.entries(i).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:a,operation:i[a]?.operation,expectedValue:i[a]?.expectedValue,jsonPath:i[a]?.jsonPath}});return t(w,{columns:Oi,value:o,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i,operation:a,expectedValue:o,jsonPath:r})=>{const s={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(n),condition:{[i]:{operation:a,expectedValue:o}}};return r&&(s.condition[i].jsonPath=r),s});n(Ii,t)},errorMessage:a,limitFieldsPerRow:3})},[v.URLTemplatization]:({value:i,setValue:a,formErrors:r})=>{const s=r[wi],l=i[wi]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(wi,e),d=(e,t)=>c(l.map((n,i)=>i===e?{...n,...t}:n));return e(n,{children:[l.map((n,i)=>e(o,{children:[t(A,{}),e(I,{$gap:12,children:[e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(S,{title:`Rule Group ${i+1}`}),l.length>1&&t(R,{size:30,onClick:()=>{return e=i,c(l.filter((t,n)=>n!==e));var e},children:t(Mn,{})})]}),t(E,{title:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(i,{filterK8sNamespace:e.target.value})}),t(w,{title:"Workload Filters",columns:Ti,value:n.workloadFilters||[],onChange:e=>d(i,{workloadFilters:e})}),t(D,{title:"Templates",required:!0,value:n.templatizationRules.map(e=>e.template),onChange:e=>d(i,{templatizationRules:e.map(e=>({template:e}))})})]}),!!s&&t(C,{children:s})]},`url-templatization-group-${i}`)),t(M,{label:"Add Rule Group",onClick:()=>c([...l,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(A,{})]})}},Mi=({actionType:e,value:n,setValue:i,formErrors:a})=>{if(!e)return null;const o=Ri[e];return o?t(o,{value:n,setValue:i,formErrors:a}):null},Li=p.div`
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
gap: 24px;
|
|
14
14
|
padding: 4px;
|
|
15
|
-
`,
|
|
15
|
+
`,Fi=p(z)`
|
|
16
16
|
margin-bottom: 12px;
|
|
17
|
-
`,
|
|
17
|
+
`,_i=({isUpdate:n,action:i,formData:a,formErrors:o,handleFormChange:r})=>{const s=h();return e(Li,{children:[n&&e("div",{children:[t(Fi,{children:"Status"}),t(F,{options:[{icon:Ln,label:g.ENABLED,value:!1,selectedBgColor:s.text.success+_["050"]},{icon:Fn,label:g.DISABLED,value:!0,selectedBgColor:s.text.error+_["050"]}],selected:a.disabled,setSelected:e=>r("disabled",e)})]}),!n&&t(P,{title:"",description:i.docsDescription,actionButton:t(K,{endpoint:i.docsEndpoint})}),t(j,{title:"Signals for Processing",required:!0,allowedSignals:i.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:o.signals}),!n&&t(E,{title:"Action name",placeholder:"Use a name that describes the action",value:a.name||"",onChange:({target:{value:e}})=>r("name",e),errorMessage:o.name}),t(Mi,{actionType:i.type,value:a.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:o}),t(V,{title:"Notes",value:a.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:o.notes})]})},Pi=r(({children:a,width:o=640,title:r,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:p,isEdit:m=!1,isFormDirty:g=!1,isLastItem:y=!1,onClose:v,onEdit:f,onSave:b,onDelete:S,onCancel:x,tabs:C,headerActionButtons:E},N)=>{const k=h(),{drawerType:w,setDrawerType:T,setDrawerEntityId:$}=U();B({key:"Enter",active:m},()=>j());const[D,A]=i(!1),[I,O]=i(!1),R=s(null),M=w===J.Source,L=()=>{A(!1),O(!1)},F=()=>{L(),f&&f(!1),T(null),$(null),v?.()};l(N,()=>({closeDrawer:F}));const _=()=>{R.current?.clearTitle(),x&&x(),L()},P=()=>{const e=R.current?.isTitleDirty();g||e?O(!0):_()},K=()=>{A(!0)},j=()=>{b&&b(R.current?.getTitle()||"")},V=E||[];return f&&!m&&V.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>f(!0),children:e(n,{children:[t(_n,{}),t(z,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),S&&!m&&V.push({"data-id":"drawer-delete",variant:"tertiary",onClick:K,children:e(n,{children:[t(Mn,{}),t(z,{color:k.text.error,size:14,family:"secondary",decoration:"underline",children:M?W.UNINSTRUMENT:W.DELETE})]})}),e(n,{children:[t(H,{isOpen:!0,onClose:m?P:F,closeOnEscape:!D&&!I,width:`${o+64}px`,header:{icons:u,iconSrcs:p,title:r,titleTooltip:c,replaceTitleWith:!d&&m?t(Ki,{ref:R,title:r}):void 0,actionButtons:V,tabs:C},footer:{isOpen:m,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:j,children:W.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:P,children:W.CANCEL}],rightButtons:S?[{"data-id":"drawer-delete",variant:"tertiary",onClick:K,children:e(n,{children:[t(Mn,{}),t(z,{size:14,color:k.text.error,family:"secondary",decoration:"underline",children:W.DELETE})]})}]:[]},children:a}),t(q,{isOpen:D,noOverlay:!0,name:`${w}${r?` (${r})`:""}`,type:w,isLastItem:y,onApprove:()=>{S&&S(),L()},onDeny:L}),t(G,{isOpen:I,noOverlay:!0,name:"edit mode",onApprove:_,onDeny:L})]})}),Ki=r(({title:e},n)=>{const[o,r]=i(e);return a(()=>{r(e)},[e]),l(n,()=>({getTitle:()=>o||e,isTitleDirty:()=>o!==e,clearTitle:()=>r(e)})),t(E,{"data-id":"title",value:o,onChange:e=>r(e.target.value)})});Ki.displayName=Ki.name,Pi.displayName=Pi.name;const ji=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
|
+
`,Vi=p.div`
|
|
24
24
|
display: flex;
|
|
25
25
|
flex-direction: column;
|
|
26
26
|
gap: 12px;
|
|
27
|
-
`,
|
|
27
|
+
`,zi=({updateAction:n,deleteAction:o})=>{const{actions:r}=Y(),{drawerType:l,drawerEntityId:d}=U(),u=s(null),p=l===J.Action,[m,h]=i(!1),[y,v]=i(!1),{formData:f,formErrors:b,handleFormChange:S,resetFormData:x,validateForm:C,loadFormWithDrawerItem:E}=X(),N=c(()=>{if(d)return r?.find(e=>Q(e)===d)},[d,r]);if(a(()=>{p&&N?E(N):x()},[p,N]),!N)return null;const k=Z.find(({type:e})=>e===N.type)||Z.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===N.type)||Z.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===N.type);return t(Pi,{ref:u,title:N.name||N.type,icons:[ne(N.type)],isEdit:m,isFormDirty:y,onEdit:e=>{h("boolean"!=typeof e||e)},onSave:e=>{if(C({withAlert:!0,alertTitle:ie.Update})){const t=e!==N.type?e:"";S("name",t),n(d,{...f,name:t}),h(!1),v(!1)}},onDelete:()=>{o(d,N.type),h(!1),v(!1),u.current?.closeDrawer()},onCancel:()=>{h(!1),v(!1),E(N)},children:m&&k?t(ji,{children:t(_i,{isUpdate:!0,action:k,formData:f,formErrors:b,handleFormChange:(...e)=>{v(!0),S(...e)}})}):e(Vi,{children:[t(ee,{conditions:N.conditions||[]}),t(te,{title:g.ACTION_DETAILS,data:N?hi(N):[]})]})})},Ui=p(I)`
|
|
28
28
|
margin-top: 24px;
|
|
29
29
|
gap: 12px;
|
|
30
|
-
`,
|
|
30
|
+
`,Bi=({createAction:n})=>{const{version:a}=ae(),{currentModal:o,setCurrentModal:r}=oe(),s=o===J.Action,{formData:l,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:m}=X(),h=c(()=>{if(!a)return Z;const e=re(a);return Z.map(t=>({...t,items:t.items?.filter(t=>!t.minVersion||t.minVersion<=e)}))},[a]),[y,v]=i(void 0),f=()=>{p(),v(void 0),r("")},b=()=>{if(!m({withAlert:!0,alertTitle:ie.Create}))return null;n(l),f()};return B({key:"Enter",active:s},()=>b()),t(se,{isOpen:s,onClose:f,header:{title:"Add Action"},actionComponent:t(me,{buttons:[{variant:"primary",label:"DONE",onClick:b,disabled:!y}]}),children:e(le,{children:[t(P,{title:"Select Action",description:"Select an action to modify telemetry data before it`s sent to destinations. Choose an action type and configure its details."}),e(Ui,{children:[t(ce,{type:de.Warning,message:ue.DEFINED_FOR_ALL_STREAMS(g.ACTIONS)}),t(pe,{options:h,selectedOption:y,onOptionSelect:e=>{return t=e,p(),u("type",t?.type||""),void v(t);var t},autoFocus:!y?.type})]}),y?.type?e("div",{children:[t(A,{margin:"16px 0"}),t(_i,{action:y,formData:l,formErrors:d,handleFormChange:u})]}):null]})})},Wi=e=>{const{type:t,fields:{collectContainerAttributes:n,collectReplicaSetAttributes:i,collectWorkloadId:a,collectClusterId:o,labelsAttributes:r,annotationsAttributes:s,clusterAttributes:l,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:h,endpointsFilters:g,attributeFilters:y,servicesNameFilters:b,urlTemplatizationRulesGroups:S}}=e;let x="";if(t===v.K8sAttributes&&(n&&(x+="Container Attributes, "),i&&(x+="ReplicaSet Attributes, "),a&&(x+="Workload ID, "),o&&(x+="Cluster ID, "),r?.forEach(({labelKey:e,attributeKey:t,from:n,fromSources:i},a)=>{const o=i?.length?i.join(","):n||f.Pod;x+=`Label: ${e} ${t} ${o} `,a===r.length-1&&(x+=", ")}),s?.forEach(({annotationKey:e,attributeKey:t,from:n,fromSources:i},a)=>{const o=i?.length?i.join(","):n||f.Pod;x+=`Annotation: ${e} ${t} ${o} `,a===s.length-1&&(x+=", ")})),t===v.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,l?.forEach(({attributeName:e,attributeStringValue:t},n)=>{x+=`${e}: ${t}`,n<l.length-1&&(x+=", ")})),t===v.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===v.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,n],i)=>{x+=`${t}: ${n}`,i<e.length-1&&(x+=", ")})}return t===v.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===v.ErrorSampler&&(x+=String(m)),t===v.ProbabilisticSampler&&(x+=String(h),x+="%"),t===v.LatencySampler&&g?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i},a)=>{x+=`Endpoint${g.length>1?` #${a+1}`:""}=${e}${t}\n`,x+=` Latency=${n}`,x+=` Sampling=${i}`,a<g.length-1&&(x+=", ")}),t===v.ServiceNameSampler&&b?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${n}\n`}),t===v.SpanAttributeSampler&&y?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${n}\n`}),t===v.URLTemplatization&&S?.forEach((e,t)=>{const n=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");x+=`Group ${t+1}: ${n}`,t<S.length-1&&(x+="; ")}),x},Hi=({conditions:e,id:n})=>{const{errors:i,warnings:a,disableds:o,hasLoadings:r}=c(()=>he(e),[e]),s=i.length>0?i:a.length>0?a:o.length>0?o:[];if(s.length>0)return t("div",{style:{lineHeight:1},children:t(qi,{conditions:s,id:n})});const l=r?ye.Loading:de.Success;return t("div",{style:{lineHeight:1},children:t(ge,{status:l,title:l,withBorder:!0,withIcon:!0})})},qi=({conditions:e,id:n})=>{const i=h();return t(O,{children:ve(e).map(({status:e,type:a,reason:o,message:r},s)=>{"loading"!==e&&"disabled"!==e||(e=de.Info);const l=be(e,i);return t(fe,{titleIcon:l,title:a,text:r||o||"",children:t(ge,{status:e,title:o||a,withBorder:!0,withIcon:!0})},`condition-${n}-${e}-${a}-${s}`)})})},Gi=({instrumentationRules:e,sources:t,actions:n,destinations:i,searchText:a,selectedCategory:o})=>{const r=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,s=a?t.filter(e=>e.name?.toLowerCase().includes(a)||e.otelServiceName?.toLowerCase().includes(a)||e.namespace?.toLowerCase().includes(a)):t,l=a?n.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,c=a?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):i,d=[{category:J.Source,label:"Sources",count:s.length,entities:[]},{category:J.Action,label:"Actions",count:l.length,entities:[]},{category:J.Destination,label:"Destinations",count:c.length,entities:[]},{category:J.InstrumentationRule,label:"Instrumentation Rules",count:r.length,entities:[]}];d.unshift({category:"all",label:"All",count:r.length+s.length+l.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(o)).map(e=>({...e,entities:e.category===J.InstrumentationRule?r:e.category===J.Source?s:e.category===J.Action?l:e.category===J.Destination?c:[]}));return{categories:d,searchResults:u}},Ji=[{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}],Yi=({maxHeight:n,maxWidth:i})=>{const a=h(),o=Se(),{actions:r,actionsLoading:s}=Y(),{setDrawerType:l,setDrawerEntityId:d}=U(),u=c(()=>Gi({instrumentationRules:[],sources:[],actions:xe(r,o),destinations:[],searchText:o.searchText,selectedCategory:J.Action}).searchResults.find(({category:e})=>e===J.Action)?.entities||[],[r,o]),p=c(()=>u.map(e=>{const{hasErrors:n,hasWarnings:i,hasDisableds:o}=he(e.conditions||[]);return{status:n?de.Error:i?de.Warning:void 0,faded:o,onClick:()=>{l(J.Action),d(e.id)},cells:[{columnKey:"icon",component:()=>t(Ce,{icon:ne(e.type)})},{columnKey:"name",value:Ee(e,J.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:a.text.info},{columnKey:"notes",value:e.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:Wi(e),textColor:a.text.info,withTooltip:!0},{columnKey:"signals",component:()=>t(Ne,{withLabels:!0,monitors:e.signals||[]})},{columnKey:"conditions",component:()=>t(Hi,{conditions:e.conditions||[],id:e.id})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:e.disabled?de.Error:de.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[u]),{badge:m,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(ke,{$maxWidth:i,children:[t(we,{children:t(Te,{icon:$e(J.Action),title:g.ACTIONS,badge:m,badgeTooltip:y,loading:s})}),t(De,{$maxHeight:n,children:t(Ae,{columns:Ji,rows:p})}),!u.length&&t(Ie,{style:{marginTop:"2rem"},children:t(Oe,{})})]})},Xi=p(I)`
|
|
31
31
|
// width: 100vw;
|
|
32
32
|
// height: 100vh;
|
|
33
33
|
gap: 64px;
|
|
34
34
|
align-items: center;
|
|
35
35
|
justify-content: center;
|
|
36
|
-
`,
|
|
36
|
+
`,Qi=p(I)`
|
|
37
37
|
max-width: 400px;
|
|
38
38
|
gap: 12px;
|
|
39
39
|
align-items: center;
|
|
40
40
|
justify-content: center;
|
|
41
|
-
`,
|
|
41
|
+
`,Zi=p(z)`
|
|
42
42
|
text-align: center;
|
|
43
43
|
font-size: 24px;
|
|
44
|
-
`,
|
|
44
|
+
`,ea=p(z)`
|
|
45
45
|
text-align: center;
|
|
46
46
|
line-height: 26px;
|
|
47
47
|
color: ${({theme:e})=>e.text.info};
|
|
48
|
-
`,
|
|
48
|
+
`,ta=()=>{const[n,o]=i(0);return a(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Le(500),o(e)})()},[]),e(Xi,{children:[t(Pn,{size:100}),t(Re,{width:400}),e(Qi,{children:[e(O,{$gap:16,children:[t(Zi,{children:"Preparing your workspace..."}),t(Me,{label:`${n}%`})]}),t(ea,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},na=p(I)`
|
|
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+_["030"]};
|
|
65
65
|
}
|
|
66
|
-
`,
|
|
66
|
+
`,ia=({entityType:n,description:i})=>{const{setCurrentModal:a}=oe();return e(na,{onClick:()=>a(n),children:[e(O,{$gap:4,children:[t(Kn,{}),e(z,{size:14,weight:600,family:"secondary",decoration:"underline",children:["Add ",n]})]}),t(z,{size:12,align:"center",children:i})]})},aa=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
|
+
`,oa=p(O)`
|
|
75
75
|
margin-left: ${({$marginLeft:e})=>e};
|
|
76
|
-
`,
|
|
76
|
+
`,ra=p(_e)`
|
|
77
77
|
width: 24px;
|
|
78
78
|
height: 24px;
|
|
79
79
|
padding: 0;
|
|
80
|
-
`,
|
|
80
|
+
`,sa=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
|
+
`,la=({entityType:n,badge:i,badgeTooltip:a,isLoading:o,refetch:r,partiallySelected:s,allSelected:l,onSelectAll:c,progressPercent:d})=>{const u=h(),{setCurrentModal:p}=oe(),m=$e(n);return e(aa,{children:[c&&t(oa,{$marginLeft:"28px",children:t(x,{partiallyChecked:s,value:l,onChange:c})}),t(oa,{$marginLeft:n===J.Source?"0":"28px",children:t(Te,{icon:m,title:`${n}s`,badge:i,badgeTooltip:a,loading:!1})}),e(oa,{$marginLeft:"auto",children:[t(ra,{"data-id":`refresh-${n}`,variant:"secondary",onClick:r,disabled:o,children:o?t(Fe,{scale:.8}):t(jn,{fill:u.colors.secondary,size:18})}),t(ra,{"data-id":`add-${n}`,variant:"primary",onClick:()=>p(n),children:t(Kn,{fill:u.colors.primary,size:18})})]}),"number"==typeof d&&t(sa,{percent:d})]})},ca=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
|
+
`,da=({entityId:n,entityType:i,status:a,faded:o,title:r,subTitle:s,tooltip:l,label:c,icon:d,icons:u,iconSrc:p,iconSrcs:m,monitors:g,isActive:y,raw:v})=>{const f=h(),b=i===J.Source,S="boolean"==typeof y,{setDrawerType:x,setDrawerEntityId:C}=U(),{selectedSources:E,setSelectedSources:N}=Pe(),k={...E},{namespace:w,name:T,kind:$}=v;b&&!k[w]&&(k[w]=[]);const D=b?k[w].findIndex(e=>e.name===T&&e.kind===$):-1;return t(Ke,{"data-id":i===J.Source?`${n.namespace}-${n.name}-${n.kind}`:n,title:r,subTitle:s,onClick:()=>{x(i),C(n)},renderActions:()=>{const n=b&&(!v.conditions?.length||v.conditions?.some(({status:e})=>"loading"===e)),i=S&&!y?be(de.Info,f):a?be(a,f):void 0,o=n?t(Fe,{scale:.8}):i?t(i,{size:14}):null;return c?e(ca,{$isError:a===de.Error,children:[t(fe,{text:l||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:c}),o]}):o||null},iconProps:{icon:d,icons:u,iconSrc:p,iconSrcs:m},visualProps:{status:a,faded:o||S&&!y,monitors:g||void 0},checkboxProps:{withCheckbox:b,isChecked:-1!==D,onCheckboxChange:()=>{-1===D?k[w].push(v):k[w].splice(D,1),N(k)}}})};function ua(e){const t=e.conditions?.some(({status:e})=>e===ye.Loading);return t?e:{...e,conditions:[{status:ye.Loading,type:"Pending",message:""}]}}function pa(e){const t=e.conditions?.filter(({status:e})=>e!==ye.Loading);return t?.length===e.conditions?.length?e:{...e,conditions:t?.length?t:[{status:de.Success,type:"Healthy",message:""}]}}const ma=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
|
+
`,ha=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
|
+
`,ga=p.div`
|
|
123
123
|
display: flex;
|
|
124
124
|
align-items: center;
|
|
125
125
|
gap: 8px;
|
|
126
126
|
padding: 4px 8px 0;
|
|
127
|
-
`,
|
|
127
|
+
`,ya=p.div`
|
|
128
128
|
flex: 1;
|
|
129
129
|
height: 1px;
|
|
130
130
|
background: ${({theme:e})=>e.colors.border};
|
|
131
|
-
`,
|
|
131
|
+
`,va=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
|
+
`,fa=({namespace:e})=>t(ma,{children:t(ha,{children:e})}),ba=({namespace:n})=>e(ga,{children:[t(ya,{}),t(va,{children:n}),t(ya,{})]}),Sa=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
|
+
`,xa=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
|
+
`,Ca={[J.Source]:{subTitle:(e,t)=>t?e.kind:`${e.namespace} • ${e.kind}`,icons:e=>({icons:He(e),icon:$e(J.Source)}),withMetrics:!0},[J.Destination]:{subTitle:e=>e.destinationType.displayName,icons:e=>We(e.destinationType.type),withMetrics:!0,withMonitors:!0,withActive:!0},[J.Action]:{subTitle:e=>e.type,icons:e=>({icon:ne(e.type)}),withMonitors:!0,withActive:!0},[J.InstrumentationRule]:{subTitle:e=>e.type,icons:e=>({icon:Be(e.type)}),withActive:!0},[J.Namespace]:{subTitle:()=>"",icons:()=>({icon:$e(J.Namespace)})}};function Ea(e,t,n,i){const a=Q(e);if(!a)return null;const o=Ca[t],r=t===J.Source,s=o.withMonitors?t===J.Destination?ze(e.exportedSignals):e.signals:void 0,l=o.withMetrics?i?.[`${t.toLowerCase()}s`]?.find(e=>JSON.stringify(Q(e))===JSON.stringify(a)):void 0,c=o.withActive?!e.disabled:void 0;let d,u,p=!1,m=e;if(r){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case je.Failure:return{status:de.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case je.Notice:return{status:de.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case je.Pending:case je.Waiting:return{status:void 0,faded:!1,displaySource:ua(e)};case je.Unsupported:case je.Disabled:return{status:void 0,faded:!0,displaySource:e};default:return{status:void 0,faded:!1,displaySource:pa(e)}}}(e);d=t.status,p=t.faded,u=t.tooltip,m=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:n}=he(e.conditions||[]);d=t,p=n}return{entityId:a,namespace:r?e.namespace:void 0,title:Ee(e,t,{extended:r,prioritizeDisplayName:!r}),subTitle:o.subTitle(e,n),status:d,faded:p,tooltip:u,label:o.withMetrics?Ue(l?.throughput):void 0,...o.icons(e),monitors:s,isActive:c,raw:m}}const Na=({height:n,entityType:o,entities:r,metrics:s})=>{const{isVm:l}=ae(),u=o===J.Source,[p,m]=i(""),h=c(()=>r.map(e=>Ea(e,o,l,s)).filter(Boolean),[r,o,s,l]),{elements:g,indexToNamespace:y,multipleNs:v}=c(()=>{const e=[],n=[],i=new Set(h.map(e=>e.namespace).filter(Boolean)).size>1;i&&(n.push(""),e.push(t("div",{style:{height:28}},"ns-spacer")));let a="";for(const i of h)u&&i.namespace&&i.namespace!==a&&(""!==a&&(n.push(i.namespace),e.push(t(ba,{namespace:i.namespace},`ns-divider-${i.namespace}`))),a=i.namespace),n.push(i.namespace||""),e.push(t(da,{entityType:o,entityId:i.entityId,raw:i.raw,title:i.title,subTitle:i.subTitle,faded:i.faded,status:i.status,tooltip:i.tooltip,label:i.label,icons:i.icons,icon:i.icon,iconSrc:i.iconSrc,monitors:i.monitors,isActive:i.isActive},JSON.stringify(i.entityId)));return{elements:e,indexToNamespace:n,multipleNs:i}},[h,o,u]);a(()=>{if(u&&y.length&&!p){const e=y.find(Boolean);e&&m(e)}},[u,y]);const f=d(e=>{if(!y.length)return;const t=y[Math.min(e,y.length-1)];t&&t!==p&&m(t)},[y,p]);return e(Sa,{$height:n,children:[v&&p&&t(fa,{namespace:p}),t(Ve,{gap:8,elements:g,onTopIndexChange:v?f:void 0}),t(xa,{$hide:!0})]})},ka=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
|
+
`,wa=({entityType:n,entities:i,unfilteredCount:a,metrics:o,loading:r,maxHeight:s,refetch:l})=>{const{isVm:d}=ae(),{frameHeight:u,hasFiltersApplied:p,isSources:m}=c(()=>({frameHeight:Math.min(s,80*i.length+12),hasFiltersApplied:i.length!==a,isSources:n===J.Source}),[n,i.length,s,a]),{progress:h}=qe(),y=c(()=>m&&(h[Ge.Instrumenting]||h[Ge.Uninstrumenting])?h[Ge.Instrumenting]?.percentage||h[Ge.Uninstrumenting]?.percentage||0:void 0,[m,h[Ge.Instrumenting],h[Ge.Uninstrumenting]]),{selectedSources:v,setSelectedSources:f}=Pe(),b=c(()=>m?Object.values(v).reduce((e,t)=>e+t.length,0):0,[m,v]);return d&&[J.InstrumentationRule,J.Action].includes(n)?null:e(ka,{$isVm:d,children:[t(la,{entityType:n,badge:"number"==typeof y?`${y}%`:p?`${i.length}/${a}`:a,badgeTooltip:p?g.FILTERED_COUNT_TOOLTIP:void 0,isLoading:r,refetch:l,partiallySelected:b>0&&i?.length!==b,allSelected:b>0&&i?.length===b,onSelectAll:m?e=>{if(m)if(e){const e={};i?.forEach(t=>{const{namespace:n}=t;e[n]?e[n].push(t):e[n]=[t]}),f(e)}else f({})}:void 0,progressPercent:y}),i.length?t(Na,{height:u,entityType:n,entities:i,metrics:o}):r?t(Je,{size:3}):t(ia,{entityType:n,description:g.TO_COLLECT_OTEL_DATA})]})},Ta=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
|
+
`,$a=({height:n,metrics:o,refetchSources:r,refetchDestinations:s,refetchActions:l,refetchInstrumentationRules:d})=>{const u=Se(),{selectedStreamName:p}=Ye(),{containerRef:m,containerHeight:h}=Xe(),{sources:g,sourcesLoading:y,destinations:v,destinationsLoading:f,actions:b,actionsLoading:S,instrumentationRules:x,instrumentationRulesLoading:C}=Y(),E=c(()=>Qe(g,p),[g,p]),N=c(()=>Ze(v,p),[v,p]),[k,w]=i([]),[T,$]=i([]),[D,A]=i([]),[I,O]=i([]);return a(()=>{w(et(E,u))},[E,u]),a(()=>{$(tt(N,u))},[N,u]),a(()=>{A(xe(b,u))},[b,u]),a(()=>{O(x)},[x]),e(Ta,{ref:m,$height:n,children:[t(wa,{entityType:J.InstrumentationRule,entities:I,unfilteredCount:x.length,loading:C,maxHeight:h,refetch:d}),t(wa,{entityType:J.Source,entities:k,unfilteredCount:E.length,metrics:o,loading:y,maxHeight:h,refetch:r}),t(wa,{entityType:J.Action,entities:D,unfilteredCount:b.length,loading:S,maxHeight:h,refetch:l}),t(wa,{entityType:J.Destination,entities:T,unfilteredCount:N.length,metrics:o,loading:f,maxHeight:h,refetch:s})]})},Da=p.div`
|
|
174
174
|
position: relative;
|
|
175
175
|
max-width: 200px;
|
|
176
176
|
`;p.div`
|
|
@@ -184,110 +184,110 @@ 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 Aa=p.div`
|
|
188
188
|
display: flex;
|
|
189
189
|
align-items: center;
|
|
190
190
|
overflow-x: scroll;
|
|
191
|
-
`,
|
|
191
|
+
`,Ia=({onClose:n})=>{const r=h(),{onClickNode:s}=nt(),{searchText:l}=Se(),{selectedStreamName:d}=Ye(),{sources:u,destinations:p,actions:m,instrumentationRules:g}=Y(),{popupRef:y,popupOpen:v,setPopupOpen:f,popupPosition:b,handlePosition:S}=it();a(()=>{v||(S(0,50),f(!0))},[v]);const[x,C]=i("all"),{categories:E,searchResults:N}=c(()=>Gi({instrumentationRules:g,sources:Qe(u,d),actions:m,destinations:Ze(p,d),searchText:l,selectedCategory:x}),[g,u,m,p,d,l,x]);return N.length?t(at,{ref:y,isOpen:v,top:b.top,left:b.left,maxWidth:"420px",header:t(Aa,{children:E.map(({category:e,label:n,count:i})=>!!i&&t(rt,{label:n,badgeLabel:i,isSelected:x===e,onClick:()=>C(e)},`category-select-${e}`))}),children:N.map(({category:i,label:a,entities:l},c)=>!!l.length&&e(o,{children:[e(ot,{style:{maxHeight:"all"!==x?"240px":"140px",padding:"12px 0"},children:[t(z,{size:12,family:"secondary",color:r.text.darker_grey,style:{marginLeft:"16px"},children:a}),l.map((e,a)=>t(rt,{icon:$e(i),label:Ee(e,i,{extended:!0}),onClick:()=>{const t=Q(e);s(null,{data:{type:i,id:t}}),n()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"},`entity-${c}-${a}`))]}),t(A,{thickness:c===N.length-1?0:1,length:"90%",margin:"8px auto"})]},`category-list-${i}`))}):t(at,{ref:y,isOpen:v,top:b.top,left:b.left,children:t(Oe,{})})},Oa=({preventPopup:n=!1})=>{const{searchText:a,setSearchText:o}=Se(),[r,l]=i(!1),c=!!a||r,d=()=>{o(""),l(!1)},u=s(null);return st(u,d),B({key:"Escape",active:c},d),e(Da,{ref:u,children:[t(E,{placeholder:"Search",icon:Vn,value:a,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>l(!0)}),c&&!n?t(Ia,{onClose:d}):null]})},Ra=({sources:e,title:n="Condition",value:i,onSelect:a,onDeselect:o,...r})=>{const s=c(()=>{const t=[];return e.forEach(({conditions:e})=>{e?.forEach(({type:e,reason:n})=>{t.find(t=>t.id===`${e}#${n}`)||t.push({id:`${e}#${n}`,value:`${lt(e)} - ${lt(n)}`})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(ct,{disabled:!s?.length,title:n,placeholder:"All",options:s,value:i,onSelect:a,onDeselect:o,...r})},Ma=({sources:e,title:n="Error Message",value:i,onSelect:a,onDeselect:o,disabled:r,...s})=>{const l=c(()=>{const t=[];return e.forEach(({conditions:e})=>{ve(e||[]).forEach(({status:e,message:n,reason:i})=>{e!==de.Error||t.find(e=>e.id===n)||(n?t.find(e=>e.id===n)||t.push({id:n,value:n}):i&&(t.find(e=>e.id===i)||t.push({id:i,value:i})))})}),t},[e]);return t(ct,{disabled:r||!l?.length,title:n,placeholder:"All",options:l,value:i,onSelect:a,onDeselect:o,...s})},La=({sources:e,title:n="Programming Language",value:i,onSelect:a,onDeselect:o,...r})=>{const s=c(()=>{const t=[];return e.forEach(({containers:e})=>{e?.forEach(({language:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:dt[e]||e})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(ct,{disabled:!s?.length,title:n,placeholder:"All",options:s,value:i,onSelect:a,onDeselect:o,...r})},Fa=({title:e="Monitors",value:n,onSelect:i,onDeselect:a,...o})=>{const r=c(()=>{const e=[];return ut.forEach(({id:t,value:n})=>{e.find(e=>e.id===t)||e.push({id:t,value:n})}),e},[]);return t(ct,{disabled:!r?.length,title:e,placeholder:"All",options:r,value:n,onSelect:i,onDeselect:a,...o})},_a=({namespaces:e,title:n="Namespace",value:i,onSelect:a,onDeselect:o,...r})=>{const s=c(()=>{const t=[];return e?.forEach(({name:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(ct,{disabled:!s?.length,title:n,placeholder:"Select namespace",options:s,value:i,onSelect:a,onDeselect:o,...r})},Pa=({sources:e,title:n="Kind",value:i,onSelect:a,onDeselect:o,...r})=>{const s=c(()=>{const t=[];return e.forEach(({kind:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(ct,{disabled:!s?.length,title:n,placeholder:"All",options:s,value:i,onSelect:a,onDeselect:o,...r})},Ka=({sources:e,title:n="Agent Injection Status",value:i,onSelect:a,onDeselect:o,disabled:r,...s})=>{const l=c(()=>{const t=[];return e.forEach(({podsAgentInjectionStatus:e})=>{const{reasonEnum:n,message:i}=e||{};if(n){t.find(e=>e.id===n)||t.push({id:n,value:lt(n)})}else if(i){t.find(e=>e.id===i)||t.push({id:i,value:i})}}),t},[e]);return t(ct,{disabled:r||!l?.length,title:n,placeholder:"All",options:l,value:i,onSelect:a,onDeselect:o,...s})},ja=p.div`
|
|
192
192
|
display: flex;
|
|
193
193
|
flex-direction: column;
|
|
194
194
|
gap: 12px;
|
|
195
195
|
padding: 12px;
|
|
196
|
-
`,
|
|
196
|
+
`,Va=p.div`
|
|
197
197
|
padding: 12px 6px 6px 6px;
|
|
198
|
-
`,
|
|
198
|
+
`,za=p(_e)`
|
|
199
199
|
font-size: 14px;
|
|
200
200
|
${({$color:e})=>`color: ${e};`}
|
|
201
|
-
`,
|
|
201
|
+
`,Ua=p.div`
|
|
202
202
|
margin-left: auto;
|
|
203
|
-
`,
|
|
203
|
+
`,Ba=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},Wa=()=>{const n=h(),{namespaces:o,sources:r}=Y(),{selectedStreamName:l}=Ye(),{getItemSS:d,setItemSS:u,removeItemSS:p}=mt(),{popupRef:m,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:f}=it(),{namespaces:b,kinds:S,monitors:x,languages:C,conditions:E,errors:N,onlyErrors:k,podsAgentInjectionStatus:w,setAll:$,clearAll:D,getEmptyState:A}=Se(),I=c(()=>Qe(r,l),[r,l]),[R,M]=i({namespaces:b,kinds:S,monitors:x,languages:C,conditions:E,errors:N,onlyErrors:k,podsAgentInjectionStatus:w}),[L,F]=i(Ba(R));a(()=>{const e=d(pt.OVERVIEW_FILTERS,A());$(e)},[]),a(()=>{if(!g){const e={namespaces:b,kinds:S,monitors:x,languages:C,conditions:E,errors:N,onlyErrors:k,podsAgentInjectionStatus:w};M(e),F(Ba(e))}},[g,b,S,x,C,E,N,k,w]);const _=()=>{y(!1)},P=s(null);return st(P,_),B({key:"Escape",active:g},_),e(Da,{ref:P,children:[t(rt,{label:"Filters",icon:zn,badgeLabel:L,badgeFilled:!!L,withBorder:!0,color:"transparent",onClick:()=>{f(0,50),y(!0)}}),t(at,{ref:m,isOpen:g,top:v.top,left:v.left,width:"420px",footer:e(O,{children:[t(za,{variant:"primary",onClick:()=>{u(pt.OVERVIEW_FILTERS,R),$(R),F(Ba(R)),y(!1)},children:"Apply"}),t(za,{variant:"secondary",onClick:_,children:"Cancel"}),t(Ua,{children:t(za,{variant:"tertiary",onClick:()=>{p(pt.OVERVIEW_FILTERS),D(),M(A()),F(0),y(!1)},$color:n.text.error,children:"Reset"})})]}),children:e(ja,{children:[t(_a,{namespaces:o,value:R.namespaces,onSelect:e=>M(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>M(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Pa,{sources:I,value:R.kinds,onSelect:e=>M(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>M(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(La,{sources:I,value:R.languages,onSelect:e=>M(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>M(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Fa,{value:R.monitors,onSelect:e=>M(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>M(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Ra,{sources:I,value:R.conditions,onSelect:e=>M(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>M(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Ka,{sources:I,value:R.podsAgentInjectionStatus,onSelect:e=>M(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>M(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Va,{children:t(T,{title:"Show only sources with errors",initialValue:R.onlyErrors,onChange:e=>M(t=>({...t,errors:[],onlyErrors:e}))})}),t(Ma,{sources:I,value:R.errors,onSelect:e=>M(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>M(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!R.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},Ha=p.div`
|
|
204
204
|
display: flex;
|
|
205
205
|
flex-direction: column;
|
|
206
206
|
gap: 24px;
|
|
207
207
|
padding: 4px;
|
|
208
|
-
`,
|
|
208
|
+
`,qa=({formData:n,handleFormChange:i,formErrors:a,editingStreamName:o})=>{const{dataStreams:r,selectedStreamName:s}=Ye(),l=o||s,d=c(()=>r.find(e=>e.name===n.name&&e.name!==l),[r,n.name,l]);return e(Ha,{children:[t(E,{name:"name",title:g.STREAM_NAME,placeholder:g.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:n.name,onChange:({target:{value:e}})=>i("name",e),errorMessage:a.name}),d&&t(ce,{type:de.Warning,message:g.DATA_STREAM_EXISTS_WARNING(l,d.name)})]})},Ga=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
|
+
`,Ja=({isOpen:e,onClose:n,dataStreamName:a,updateDataStream:o})=>{const{dataStreams:r}=Ye(),l=s(null),[u,p]=i(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:f}=ht({name:a}),b=c(()=>{if(!e)return v();const t=r?.find(e=>e.name===a);return t?f(t):v(),t},[e,r,a]),S=d((e,t)=>{h(e,t),p(!0)},[h]);if(!b)return null;return t(Pi,{ref:l,title:b.name,icons:[Un],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:ie.Update})&&(o(a,m),p(!1),n())},onCancel:()=>{v(),p(!1),n()},children:t(Ga,{children:t(qa,{formData:m,handleFormChange:S,formErrors:g,editingStreamName:a})})})},Ya=p.div`
|
|
215
215
|
position: relative;
|
|
216
|
-
`,
|
|
216
|
+
`,Xa=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
|
+
`,Qa=p(z)`
|
|
224
224
|
text-wrap: nowrap;
|
|
225
|
-
`,
|
|
225
|
+
`,Za=p(ot)`
|
|
226
226
|
max-height: 240px;
|
|
227
227
|
padding: 0px !important;
|
|
228
|
-
`,
|
|
228
|
+
`,eo=p(O)`
|
|
229
229
|
width: 100%;
|
|
230
|
-
`,
|
|
230
|
+
`,to=p.div`
|
|
231
231
|
width: 100%;
|
|
232
|
-
`,
|
|
232
|
+
`,no=({onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const s=h(),{clearStore:l}=gt(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:m,handlePosition:g}=it(),{dataStreams:y,selectedStreamName:v,setSelectedStreamName:f}=Ye(),[b,S]=i(""),[x,C]=i(""),[N,k]=i(""),w=c(()=>y.filter(({name:e})=>!N||e.toLowerCase().includes(N.toLowerCase())).map(({name:n})=>e(eo,{children:[t(to,{children:t(rt,{label:n,isSelected:v===n,onClick:()=>{l(),f(n),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})}),n!==yt&&t(R,{onClick:()=>C(n),tooltip:W.DELETE,children:t(Mn,{})}),t(R,{onClick:()=>S(n),tooltip:W.EDIT,children:t(_n,{})})]},`stream-${n}`)),[y,v,N]);return e(n,{children:[e(Ya,{children:[e(Xa,{$gap:0,children:[e(_e,{variant:"tertiary",onClick:()=>{g(0,50),p(e=>!e)},children:[t(Un,{fill:s.text.info}),e(Qa,{children:["Data Stream: ",v]}),t(vt,{extend:u}),t(Me,{label:y.length})]}),t(A,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),t(M,{onClick:()=>{l(),a()},label:W.NEW})]}),t(at,{ref:d,isOpen:u,top:m.top,left:m.left,header:t(E,{placeholder:"Search...",icon:Vn,value:N,onChange:e=>k(e.target.value)}),children:t(Za,{children:w})})]}),t(q,{isOpen:""!==x,name:x,onApprove:()=>{r(x),C("")},onDeny:()=>{C("")}}),t(Ja,{isOpen:""!==b,onClose:()=>{S("")},dataStreamName:b,updateDataStream:o})]})},io=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
|
+
`,ao=p.div`
|
|
239
239
|
margin-left: auto;
|
|
240
|
-
`,
|
|
240
|
+
`,oo=({addEntity:n,preventSearchPopup:i,onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const{isVm:s}=ae(),{setCurrentModal:l}=oe();return e(io,{children:[!s&&t(no,{onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r}),t(Oa,{preventPopup:i}),t(Wa,{}),n&&t(ao,{children:t(M,{"data-id":`add-${n}`,onClick:()=>l(n),label:`${W.ADD} ${lt(n)}`,variant:"primary",textProps:{weight:900}})})]})},ro=r(({isModal:n,onClickSummary:i},a)=>{const{selectedStreamName:o}=Ye(),{formData:r,handleFormChange:s,formErrors:c,validateForm:d}=ht({name:o});return l(a,()=>({validateForm:d,getFormValues:()=>r})),t(le,{$isNotModal:!n,children:e(I,{$gap:24,children:[i&&t(ft,{onClick:i}),t(P,{title:g.NAME_YOUR_STREAM,description:g.STREAM_DESCRIPTION}),t(qa,{formData:r,handleFormChange:s,formErrors:c})]})})});ro.displayName=ro.name;const so=({createDataStream:e})=>{const{currentModal:n,setCurrentModal:i}=oe(),{addDataStreams:a,setSelectedStreamName:o}=Ye(),r=n===bt.DataStream,l=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const t=d.current.getFormValues();e?e(t):(a([t]),o(t.name)),l()}},d=s(null);return B({key:"Enter",active:r},c),t(se,{isOpen:r,onClose:l,header:{title:"Add Data Stream"},actionComponent:t(me,{buttons:[{label:"DONE",variant:"primary",onClick:c}]}),children:t(ro,{ref:d,isModal:!0})})},lo=(e,t)=>{const{destinationType:n,disabled:i,exportedSignals:a}=e,o=[{title:g.TYPE,value:n.type},{type:y.ActiveStatus,title:g.STATUS,value:String(!i)},{type:y.Monitors,title:g.MONITORS,value:ze(a).join(", ")},{title:g.NAME,value:n.displayName}],r=St(e,t),s=r.map(e=>({name:e.key,value:e.value}));return r.map(({key:e,name:n,value:i})=>{const{secret:r,componentProperties:l,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!(!!c?.length&&xt(c,ze(a),s))){const{type:e}=Ct(l,{type:""}),t=(r||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";o.push({type:y.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&o.push({title:t.title,value:t.value})}):o.push({title:n,value:t||i})}}),o},co=({signals:e,fields:n,onChange:i,formErrors:a})=>n?.map(o=>{const{componentType:r,renderCondition:s,...l}=o;if(!(!s||xt(s,e,n)))return null;switch(r){case L.Input:return t(E,{...l,onChange:e=>i(o.name,e.target.value),errorMessage:a[o.name]},o.name);case L.Dropdown:return t(ct,{...l,showSearch:!0,value:{id:l.value||"",value:l.value||""},options:l.options||[],onSelect:e=>i(o.name,e.id),errorMessage:a[o.name]},o.name);case L.MultiInput:return t(D,{...l,value:"string"==typeof l.value?Ct(l.value,[]):l.value,onChange:e=>i(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case L.KeyValuePair:return t($,{...l,value:"string"==typeof l.value?Ct(l.value,[]):l.value,onChange:e=>i(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case L.TextArea:return t(V,{...l,onChange:e=>i(o.name,e.target.value),errorMessage:a[o.name]},o.name);case L.Checkbox:return t(x,{...l,value:"true"==l.value,onChange:e=>i(o.name,String(e)),errorMessage:a[o.name]},o.name);default:return null}}),uo=p(_e)`
|
|
241
241
|
display: flex;
|
|
242
242
|
align-items: center;
|
|
243
243
|
gap: 8px;
|
|
244
244
|
|
|
245
|
-
${({$status:e,theme:t})=>e===de.Success?
|
|
245
|
+
${({$status:e,theme:t})=>e===de.Success?m`
|
|
246
246
|
border-color: transparent;
|
|
247
247
|
background-color: ${t.colors.success};
|
|
248
|
-
`:"error"===e?
|
|
248
|
+
`:"error"===e?m`
|
|
249
249
|
border-color: transparent;
|
|
250
250
|
background-color: ${t.colors.error};
|
|
251
|
-
`:
|
|
251
|
+
`:m`
|
|
252
252
|
background-color: transparent;
|
|
253
253
|
`}
|
|
254
|
-
`,
|
|
254
|
+
`,po=({destination:n,validateForm:a,status:o,testConnection:r,onSuccess:s,onError:l})=>{const c=h(),{selectedStreamName:d}=Ye(),[u,p]=i(!1),m=o?be(o,c):void 0;return e(uo,{$status:o,variant:"secondary",onClick:async()=>{if(a()){p(!0);const e=await r({...n,currentStreamName:d});e&&(e.succeeded?s(e):l(e)),p(!1)}},children:[u?t(Fe,{}):m?t(m,{}):null,t(z,{family:"secondary",decoration:"underline",size:14,color:o?c.text[o]:void 0,children:u?"Checking":o===de.Success?"Connection OK":"error"===o?"Connection Failed":"Test Connection"})]})},mo=p(I)`
|
|
255
255
|
align-items: unset;
|
|
256
256
|
padding: 0 4px;
|
|
257
|
-
`,
|
|
257
|
+
`,ho=p.div`
|
|
258
258
|
display: flex;
|
|
259
259
|
flex-direction: column;
|
|
260
260
|
gap: 12px;
|
|
261
|
-
`,
|
|
261
|
+
`,go=p(O)`
|
|
262
262
|
justify-content: space-between;
|
|
263
|
-
`,
|
|
263
|
+
`,yo=p(z)`
|
|
264
264
|
margin-bottom: 12px;
|
|
265
|
-
`,
|
|
265
|
+
`,vo=({isUpdate:n,categoryItem:o,formData:r,formErrors:l,validateForm:d,handleFormChange:u,dynamicFields:p,setDynamicFields:m,testConnection:y})=>{const{type:v,displayName:f,supportedSignals:b,testConnectionSupported:S}=o||{},x=h(),[C,N]=i(!1),[k,w]=i(!1),[T,$]=i(void 0),D=s(!1);a(()=>{if(p.length&&!D.current){D.current=!0;let e=!1;for(let t=0;t<p.length;t++){const{required:n,value:i}=p[t];if(n){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}N(e)}},[p,k]);const I=c(()=>{const{logs:e,metrics:t,traces:n}=b||{},i=[];return e?.supported&&i.push(Et.Logs),t?.supported&&i.push(Et.Metrics),n?.supported&&i.push(Et.Traces),i},[b]),O=c(()=>{const{logs:e,metrics:t,traces:n}=r.exportedSignals||{},i=[];return e&&i.push(Et.Logs),t&&i.push(Et.Metrics),n&&i.push(Et.Traces),i},[r.exportedSignals]),R=()=>{N(!1),w(!0),$(void 0)};return e(mo,{$gap:24,children:[e(mo,{$gap:12,children:[t(P,{title:n?"Update destination":"Create destination",description:`Connect ${f} with Odigos.`,actionButton:S&&t(po,{destination:r,validateForm:d,status:T?.type,testConnection:y,onError:e=>{w(!1),$({type:de.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{w(!1),$({type:de.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e(ho,{children:[S&&T&&t(ce,{type:T.type,title:T.title,message:T.message}),C&&!T&&!n&&t(ce,{type:de.Default,message:`Odigos autocompleted ${f} destination details.`})]}),t(A,{})]}),e(go,{children:[t(j,{title:n?"":"This connection will monitor:",required:!0,allowedSignals:I,selectedSignals:O,setSelectedSignals:e=>{R(),u("exportedSignals",{logs:e.includes(Et.Logs),metrics:e.includes(Et.Metrics),traces:e.includes(Et.Traces)})},errorMessage:l.exportedSignals}),!n&&t(K,{endpoint:`/backends/${v}`})]}),n&&e("div",{children:[t(yo,{children:"Status"}),t(F,{options:[{icon:Ln,label:g.ENABLED,value:!1,selectedBgColor:x.text.success+_["050"]},{icon:Fn,label:g.DISABLED,value:!0,selectedBgColor:x.text.error+_["050"]}],selected:r.disabled,setSelected:e=>u("disabled",e)})]}),!n&&t(E,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),u("name",e.target.value)},errorMessage:l.name}),t(co,{signals:O,fields:p,onChange:(e,t)=>{R(),m(n=>{const i=[...n],a=i.findIndex(t=>t.name===e);return-1!==a&&(i[a]={...i[a],value:t}),i})},formErrors:l})]})},fo=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
|
+
`,bo=p.div`
|
|
272
272
|
display: flex;
|
|
273
273
|
flex-direction: column;
|
|
274
274
|
gap: 12px;
|
|
275
|
-
`,
|
|
275
|
+
`,So=({categories:n,updateDestination:o,deleteDestination:r,testConnection:l})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ye(),{drawerType:p,drawerEntityId:m}=U(),h=c(()=>Ze(d,u),[d,u]),y=s(null),v=p===J.Destination,[f,b]=i(!1),[S,x]=i(!1),{formData:C,formErrors:E,handleFormChange:N,resetFormData:k,validateForm:w,loadFormWithDrawerItem:T,yamlFields:$,setYamlFields:D,dynamicFields:A,setDynamicFields:I}=Nt({}),O=c(()=>{if(m)return h?.find(e=>Q(e)===m)},[m,h]);if(a(()=>{v&&O?(D(kt(n,O)),T(O)):k()},[v,O,n]),!O)return null;const R=n.flatMap(e=>e.items).find(e=>e.type===O.destinationType.type),{icon:M,iconSrc:L}=R?We(R?.type):{icon:void 0,iconSrc:void 0};return t(Pi,{ref:y,title:O.name||O.destinationType.displayName,icons:M?[M]:void 0,iconSrcs:L?[L]:void 0,isEdit:f,isFormDirty:S,onEdit:e=>{b("boolean"!=typeof e||e)},onSave:async e=>{if(w({withAlert:!0,alertTitle:ie.Update})){const t=e!==O.destinationType.displayName?e:"";N("name",t),o(m,{...C,name:t}),b(!1),x(!1)}},onDelete:async()=>{r(m),b(!1),x(!1),y.current?.closeDrawer()},onCancel:()=>{b(!1),x(!1),T(O)},isLastItem:1===h.length,children:f?t(fo,{children:t(vo,{isUpdate:!0,categoryItem:R,formData:C,formErrors:E,handleFormChange:(...e)=>{x(!0),N(...e)},dynamicFields:A,setDynamicFields:(...e)=>{x(!0),I(...e)},validateForm:w,testConnection:l})}):e(bo,{children:[O.conditions?.length?t(ee,{conditions:O.conditions}):null,t(te,{title:g.DESTINATION_DETAILS,data:O?lo(O,$):[]})]})})},xo=p.div`
|
|
276
276
|
display: flex;
|
|
277
277
|
flex-direction: column;
|
|
278
278
|
gap: 12px;
|
|
279
|
-
`,
|
|
279
|
+
`,Co=({items:n,onSelectNew:i,onSelectConfigured:a,isLoadingForDestinationIds:o})=>{const{configuredDestinationsUpdateOnly:r}=gt();return n.map(n=>{const s=n.name===$t.EXISTS;return e(xo,{children:[t(P,{size:"small",icon:n.icon,title:wt(n.name),description:n.description}),n.items.map(e=>{const l=`select-${n.name.replaceAll(" ","")}-destination-${e.type}-${e.id||""}`,c=Tt(e.supportedSignals),{icon:d,iconSrc:u}=We(e.type),p=e.selected||r.some(t=>t.id===e.id),m=!!o.find(t=>t===e.id),h=s?()=>a(e.id):()=>i(e);return t(Ke,{"data-id":l,title:e.displayName,hoverText:W.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:s,isChecked:p,isLoading:m,onCheckboxChange:()=>a(e.id)}},l)})]},`category-${n.name}`)})},Eo=p.div`
|
|
280
280
|
display: flex;
|
|
281
281
|
flex-direction: column;
|
|
282
282
|
gap: 24px;
|
|
283
|
-
`,
|
|
283
|
+
`,No=p.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
align-items: center;
|
|
286
286
|
gap: 12px;
|
|
287
|
-
`,
|
|
287
|
+
`,ko=p.div`
|
|
288
288
|
width: 170px;
|
|
289
289
|
margin-right: 8px;
|
|
290
|
-
|
|
290
|
+
`,wo=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
|
+
`,To=p(Eo)`
|
|
302
302
|
margin-top: 80px;
|
|
303
|
-
|
|
303
|
+
`,$o=Object.values($t).map(e=>({value:At[e].TITLE,id:e})),Do=$o[0],Ao=[Et.Logs,Et.Metrics,Et.Traces],Io=(e,t,n)=>e.map(e=>{const{type:i,displayName:a}=e.destinationType,o=e.dataStreamNames?.includes(t),r=n.has(e.id);return{id:e.id,type:i,displayName:a,selected:o||r,fields:[],testConnectionSupported:!1,supportedSignals:{logs:{supported:e.exportedSignals.logs},metrics:{supported:e.exportedSignals.metrics},traces:{supported:e.exportedSignals.traces}}}}),Oo=({hidden:n,categories:a,potentialDestinations:o,onSelectNew:r,onSelectConfigured:s,isLoadingForDestinationIds:l})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ye(),{configuredDestinations:p,configuredDestinationsUpdateOnly:m}=gt(),[h,g]=i(""),[y,v]=i(Do),[f,b]=i(Ao),S=c(()=>{const e=Dt(a);return e.unshift({name:$t.EXISTS,description:At[$t.EXISTS].DESCRIPTION,icon:Bn,items:Io(d,u,new Set(p.concat(m).map(e=>e.id)))}),e.unshift({name:$t.DETECTED,description:At[$t.DETECTED].DESCRIPTION,icon:Wn,items:o}),e.map(e=>{const t=e.items.filter(t=>{const n=!h||t.displayName.toLowerCase().includes(h.toLowerCase()),i="all"===y.id||y.id?.toLowerCase()?.replaceAll("-"," ")===e.name.toLowerCase()?.replaceAll("-"," "),a=f.some(e=>t.supportedSignals[It[e]]?.supported);return n&&i&&a});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[a,o,d,h,y,f,u,p,m]);return n?null:e(Eo,{children:[t(P,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(No,{children:[t(ko,{children:t(E,{placeholder:"Search...",icon:Vn,value:h,onChange:({target:{value:e}})=>g(e)})}),t(ko,{children:t(ct,{options:$o,value:y,onSelect:v,onDeselect:()=>{}})}),t(j,{title:"",selectedSignals:f,setSelectedSignals:b})]}),t(A,{}),S.length?t(wo,{children:t(Co,{items:S,onSelectNew:e=>r(e,f),onSelectConfigured:s,isLoadingForDestinationIds:l})}):t(To,{children:t(Oe,{title:"No destinations found"})})]})},Ro=p.div`
|
|
304
304
|
display: flex;
|
|
305
|
-
`,
|
|
305
|
+
`,Mo=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
|
+
`,Lo=({isOnboarding:n,categories:a,potentialDestinations:o,createDestination:r,updateDestination:s,deleteDestination:l,testConnection:c})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ye(),{currentModal:p,setCurrentModal:m}=oe(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:y,removeConfiguredDestinationUpdateOnly:v,configuredDestinationsUpdateOnly:f}=gt(),b=p===J.Destination,[S,x]=i(void 0),{formData:C,formErrors:E,handleFormChange:N,resetFormData:k,validateForm:w,setYamlFields:T,dynamicFields:$,setDynamicFields:D,loadFormWithDrawerItem:A}=Nt({supportedSignals:S?.supportedSignals,preLoadedFields:S?.fields}),[I,O]=i([]),R=e=>{const t={};return e||$.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||C.name,disabled:e?.disabled||C.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||C.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:S.type,displayName:S.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},M=async e=>{if(n&&!e){const e=R();h(e)}else if(n&&e){const t=R(e);f.some(t=>t.id===e.id)?v(e):y(t)}else if(n||e){if(!n&&e){const t=R(e),n=t.dataStreamNames.some(e=>e===u);O(t=>[...t,e.id]),n?await l(e.id):await s(e.id,A(t)),O(t=>t.filter(t=>t!==e.id))}}else r(C)},L=()=>{k(),x(void 0),m("")},F=()=>{k(),x(void 0)},_=async()=>{if(S){if(!w({withAlert:!n,alertTitle:ie.Create}))return null;M()}L()};return B({key:"Enter",active:b},()=>_()),t(se,{isOpen:b,onClose:L,header:{title:g.ADD_DESTINATION},actionComponent:t(me,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:_}];return S&&e.unshift({label:"BACK",icon:()=>t(Hn,{rotate:-90}),variant:"secondary",onClick:F}),e})()}),children:e(Ro,{children:[t(Mo,{children:t(Ot,{currentStep:S?2:1,data:[{stepNumber:1,title:g.DESTINATIONS},{stepNumber:2,title:g.CONNECTION}]})}),e(le,{style:{margin:"32px 24px 12px 24px"},children:[t(Oo,{hidden:void 0!==S,categories:a,potentialDestinations:o,onSelectNew:(e,t)=>{k(),N("type",e?.type||""),N("currentStreamName",u);const n={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[It[t]].supported).forEach(e=>n[It[e]]=!0),N("exportedSignals",n),T(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=d.find(t=>t.id===e);t&&M(t)},isLoadingForDestinationIds:I}),S&&t(vo,{categoryItem:S,formData:C,formErrors:E,handleFormChange:N,dynamicFields:$,setDynamicFields:D,validateForm:w,testConnection:c})]})]})})},Fo=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
|
+
`,_o=({categories:e,withDelete:n})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:a}=gt();return i.length||a.length?t(Fo,{children:i.concat(a).map((o,r)=>t(Po,{"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:kt(e,o),isLastItem:i.length+a.length===1,withDelete:n},`configured-destination-${o.destinationType.type}-${r}`))}):t(Ie,{children:t(Oe,{title:"No destinations",subTitle:"Please add a destination"})})},Po=({item:a,yamlFields:o,isLastItem:r,withDelete:s})=>{const[l,d]=i(!1),{icon:u,iconSrc:p}=We(a.destinationType.type),{removeConfiguredDestination:m,removeConfiguredDestinationUpdateOnly:h}=gt(),g=c(()=>St(a,o).map(e=>({title:e.name,value:e.value})),[a,o]);return e(n,{children:[t(Ke,{title:a.name||a.destinationType.displayName,subTitle:a.destinationType.type,iconProps:{icon:u,iconSrc:p},visualProps:{monitors:ze(a.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>t(Rt,{data:g})},renderActions:s?()=>t(R,{onClick:()=>d(!0),children:t(Mn,{})}):void 0}),s&&t(q,{isOpen:l,name:a.destinationType.displayName||a.name,type:J.Destination,isLastItem:r,onApprove:()=>{a.id?h(a):m(a)},onDeny:()=>d(!1)})]})},Ko=p(_e)`
|
|
322
322
|
display: flex;
|
|
323
323
|
align-items: center;
|
|
324
324
|
justify-content: center;
|
|
@@ -327,47 +327,47 @@ 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
|
+
`,jo=({isSourcesListEmpty:i,goToSources:a,categories:o,potentialDestinations:r,testConnection:s,onClickSummary:l})=>{const c=h(),{setCurrentModal:d}=oe(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=gt();return e(n,{children:[t(le,{$isNotModal:!0,children:e(I,{$gap:12,children:[e(I,{$gap:24,children:[l&&t(ft,{onClick:l}),t(P,{title:g.ADD_DESTINATIONS,badgeLabel:u.length+p.length,description:g.ADD_DESTINATION_DESCRIPTION}),i&&t(ce,{type:de.Warning,message:g.NO_SOURCES_GO_BACK,action:{label:g.SELECT_SOURCES,onClick:a}}),e(Ko,{variant:"secondary",onClick:()=>d(J.Destination),children:[t(Kn,{}),t(z,{color:c.colors.secondary,size:14,decoration:"underline",family:"secondary",children:g.ADD_DESTINATION})]})]}),t(_o,{categories:o,withDelete:!0})]})}),t(Lo,{isOnboarding:!0,categories:o,potentialDestinations:r,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:s})]})},Vo=[{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}],zo=({metrics:n,maxHeight:i,maxWidth:a})=>{const o=h(),r=Se(),{selectedStreamName:s}=Ye(),{setDrawerType:l,setDrawerEntityId:d}=U(),{destinations:u,destinationsLoading:p}=Y(),m=c(()=>Ze(u,s),[u,s]),y=c(()=>Gi({instrumentationRules:[],sources:[],actions:[],destinations:tt(m,r),searchText:r.searchText,selectedCategory:J.Destination}).searchResults.find(({category:e})=>e===J.Destination)?.entities||[],[m,r]),v=c(()=>y.map(e=>{const{hasErrors:i,hasWarnings:a,hasDisableds:r}=he(e.conditions||[]),{icon:s,iconSrc:c}=We(e.destinationType.type);return{status:i?de.Error:a?de.Warning:void 0,faded:r,onClick:()=>{l(J.Destination),d(e.id)},cells:[{columnKey:"icon",component:()=>t(Ce,{icon:s,src:c})},{columnKey:"name",value:Ee(e,J.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.destinationType.type,textColor:o.text.info},{columnKey:"throughput",value:Ue(Mt(n,J.Destination,e.id).throughput),textColor:o.text.info},{columnKey:"signals",component:()=>t(Ne,{withLabels:!0,monitors:ze(e.exportedSignals)})},{columnKey:"conditions",component:()=>e.conditions?.length?t(Hi,{conditions:e.conditions,id:e.id}):null},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:e.disabled?de.Error:de.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[y,n]),{badge:f,badgeTooltip:b}=c(()=>y.length!==m.length?{badge:`${y.length}/${m.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:m.length,badgeTooltip:void 0},[y,m]);return e(ke,{$maxWidth:a,children:[t(we,{children:t(Te,{icon:$e(J.Destination),title:g.DESTINATIONS,badge:f,badgeTooltip:b,loading:p})}),t(De,{$maxHeight:i,children:t(Ae,{columns:Vo,rows:v})}),!y.length&&t(Ie,{style:{marginTop:"2rem"},children:t(Oe,{})})]})},Uo=e=>{const{type:t,ruleName:n,notes:i,disabled:a,profileName:o,payloadCollection:r,codeAttributes:s,headersCollection:l,customInstrumentations:c}=e,d=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!a)},{title:g.NAME,value:n},{title:g.NOTES,value:i},{title:g.MANAGED_BY_PROFILE,value:o},{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(s){const e=Object.entries(s).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(l){const e=(l[Lt.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[_t.Java]||[]).map(e=>new Ft(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:g.JAVA_CUSTOM_PROBES,value:e});const t=(c[_t.Golang]||[]).map(e=>new Pt(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},Bo=p.div`
|
|
331
331
|
display: flex;
|
|
332
332
|
flex-direction: column;
|
|
333
333
|
gap: 12px;
|
|
334
334
|
margin-top: 8px;
|
|
335
|
-
${({$hasError:e})=>e&&
|
|
335
|
+
${({$hasError:e})=>e&&m`
|
|
336
336
|
border: 1px solid ${({theme:e})=>e.text.error};
|
|
337
337
|
border-radius: 16px;
|
|
338
338
|
padding: 8px;
|
|
339
339
|
`}
|
|
340
|
-
`,
|
|
340
|
+
`,Wo=[{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."}],Ho=[{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."}],qo={[_t.Java]:[new Ft("","")],[_t.Golang]:[new Pt("")]},Go=["*"],Jo=p.div`
|
|
341
341
|
display: flex;
|
|
342
342
|
flex-direction: column;
|
|
343
343
|
gap: 12px;
|
|
344
344
|
margin-top: 8px;
|
|
345
|
-
${({$hasError:e})=>e&&
|
|
345
|
+
${({$hasError:e})=>e&&m`
|
|
346
346
|
border: 1px solid ${({theme:e})=>e.text.error};
|
|
347
347
|
border-radius: 16px;
|
|
348
348
|
padding: 8px;
|
|
349
349
|
`}
|
|
350
|
-
`,
|
|
350
|
+
`,Yo=[{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"}],Xo={[Vt.CodeAttributes]:({value:o,setValue:r,formErrors:s})=>{const l=s.codeAttributes,d=c(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]),[u,p]=i(1===d.length);a(()=>{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 m=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),i=Object.values(Kt).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});r("codeAttributes",i),p(1===n.length)};return e(n,{children:[e("div",{children:[t(S,{title:"Recommended data to collect",required:!0}),t(Bo,{$hasError:!!l,children:Wo.map(({id:e,label:n,tooltip:i})=>t(fe,{text:i,withIcon:!0,children:t(x,{title:n,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>m(e,t)})},e))}),!!l&&t(C,{children:l})]}),e("div",{children:[t(S,{title:"Verbose data to collect",required:!0}),t(Bo,{$hasError:!!l,children:Ho.map(({id:e,label:n,tooltip:i})=>t(fe,{text:i,withIcon:!0,children:t(x,{title:n,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>m(e,t)})},e))}),!!l&&t(C,{children:l})]})]})},[Vt.CustomInstrumentation]:({value:n,setValue:i,formErrors:o})=>{const r=o.customInstrumentations,s=c(()=>(n?.customInstrumentations?.[_t.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[n]),l=c(()=>(n?.customInstrumentations?.[_t.Golang]||[]).map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),d=(e,t)=>{const n={};switch(t){case"java":n[_t.Java]=e.map(e=>new Ft(e.className,e.methodName)),n[_t.Golang]=l.map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":n[_t.Golang]=e.map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),n[_t.Java]=s.map(({key:e,value:t})=>new Ft(e,t))}i("customInstrumentations",n)};return a(()=>{n?.customInstrumentations||i("customInstrumentations",{[_t.Golang]:qo[_t.Golang],[_t.Java]:qo[_t.Java]})},[i,n]),e("div",{children:[t(w,{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:l,onChange:e=>d(e,"golang"),errorMessage:r,limitFieldsPerRow:2}),t($,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:s,onChange:(e=[])=>d(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:r,keyPlaceholder:"Class name",valuePlaceholder:"Method name"})]})},[Vt.HeadersCollection]:({value:e,setValue:n,formErrors:i})=>{const o=i.headersCollection,r=c(()=>e?.headersCollection?.[Lt.HeaderKeys]||[],[e]),s=e=>{const t={[Lt.HeaderKeys]:e};n("headersCollection",t)};return a(()=>{r.length||s(Go)},[r]),t("div",{children:r.length>0&&t(D,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>s(e),errorMessage:o})})},[Vt.PayloadCollection]:({value:n,setValue:o,formErrors:r})=>{const s=r.payloadCollection,l=c(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]),[d,u]=i(1===l.length);a(()=>{if(!l.length){const e={[jt.HttpRequest]:{},[jt.HttpResponse]:{},[jt.DbQuery]:{},[jt.Messaging]:{}};o("payloadCollection",e),u(!1)}},[]);return e("div",{children:[t(S,{title:"Type of data to collect",required:!0}),t(Jo,{$hasError:!!s,children:Yo.map(({id:e,label:n})=>t(x,{title:n,disabled:d&&l.includes(e),value:l.includes(e),onChange:t=>((e,t)=>{const n=t?[...l,e]:l.filter(t=>t!==e),i={[jt.HttpRequest]:n.includes(jt.HttpRequest)?{}:null,[jt.HttpResponse]:n.includes(jt.HttpResponse)?{}:null,[jt.DbQuery]:n.includes(jt.DbQuery)?{}:null,[jt.Messaging]:n.includes(jt.Messaging)?{}:null};o("payloadCollection",i),u(1===n.length)})(e,t)},e))}),!!s&&t(C,{children:s})]})},[Vt.UnknownType]:null},Qo=({ruleType:e,value:n,setValue:i,formErrors:a})=>{if(!e)return null;const o=Xo[e];return o?t(o,{value:n,setValue:i,formErrors:a}):null},Zo=p.div`
|
|
351
351
|
display: flex;
|
|
352
352
|
flex-direction: column;
|
|
353
353
|
gap: 24px;
|
|
354
354
|
padding: 4px;
|
|
355
|
-
`,
|
|
355
|
+
`,er=p(z)`
|
|
356
356
|
margin-bottom: 12px;
|
|
357
|
-
`,
|
|
357
|
+
`,tr=({isUpdate:i,rule:a,formData:o,formErrors:r,handleFormChange:s})=>{const l=h();return e(Zo,{children:[t(O,{children:a.supportedLanguages.map(e=>t(zt,{icon:Ut(e),type:de.Info,children:dt[e]},e))}),i?e("div",{children:[t(er,{children:"Status"}),t(F,{options:[{icon:Ln,label:g.ENABLED,value:!1,selectedBgColor:l.text.success+_["050"]},{icon:Fn,label:g.DISABLED,value:!0,selectedBgColor:l.text.error+_["050"]}],selected:o.disabled,setSelected:e=>s("disabled",e)})]}):e(n,{children:[t(P,{title:"",description:a.docsDescription,actionButton:t(K,{endpoint:a.docsEndpoint})}),t(E,{title:"Rule name",placeholder:"Use a name that describes the rule",value:o.ruleName,onChange:({target:{value:e}})=>s("ruleName",e),errorMessage:r.ruleName})]}),t(Qo,{ruleType:a.type,value:o,setValue:(e,t)=>s(e,t),formErrors:r}),t(V,{title:"Notes",value:o.notes,onChange:({target:{value:e}})=>s("notes",e),errorMessage:r.notes})]})},nr=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
|
+
`,ir=p.div`
|
|
364
364
|
display: flex;
|
|
365
365
|
flex-direction: column;
|
|
366
366
|
gap: 12px;
|
|
367
|
-
`,
|
|
367
|
+
`,ar=({updateInstrumentationRule:n,deleteInstrumentationRule:o})=>{const{instrumentationRules:r}=Y(),{addNotification:l}=Bt(),{drawerType:d,drawerEntityId:u}=U(),p=s(null),m=d===J.InstrumentationRule,[h,g]=i(!1),[y,v]=i(!1),{formData:f,formErrors:b,handleFormChange:S,resetFormData:x,validateForm:C,loadFormWithDrawerItem:E}=Wt(),N=c(()=>{if(u)return r?.find(e=>Q(e)===u)},[u,r]);if(a(()=>{m&&N?E(N):x()},[m,N]),!N)return null;const k=Ht.find(({type:e})=>e===N.type);return t(Pi,{ref:p,title:N.ruleName||N.type,icons:[Be(N.type)],isEdit:h,isFormDirty:y,onEdit:e=>{N.mutable||!e&&void 0!==e?g("boolean"!=typeof e||e):l({type:de.Warning,title:ue.FORBIDDEN,message:ue.CANNOT_EDIT_RULE,crdType:J.InstrumentationRule,target:u,hideFromHistory:!0})},onSave:e=>{if(C()){const t=e!==N.type?e:"";S("ruleName",t),n(u,{...f,ruleName:t}),g(!1),v(!1)}},onDelete:()=>{N.mutable?(o(u),g(!1),v(!1),p.current?.closeDrawer()):l({type:de.Warning,title:ue.FORBIDDEN,message:ue.CANNOT_DELETE_RULE,crdType:J.InstrumentationRule,target:u,hideFromHistory:!0})},onCancel:()=>{g(!1),v(!1),E(N)},children:h&&k?t(nr,{children:t(tr,{isUpdate:!0,rule:k,formData:f,formErrors:b,handleFormChange:(...e)=>{v(!0),S(...e)}})}):e(ir,{children:[t(ee,{conditions:N.conditions||[]}),t(te,{title:"Instrumentation Rule Details",data:N?Uo(N):[]})]})})},or=p(I)`
|
|
368
368
|
margin-top: 24px;
|
|
369
369
|
gap: 12px;
|
|
370
|
-
`,
|
|
370
|
+
`,rr=Ht,sr=({createInstrumentationRule:n})=>{const{tier:a}=ae(),o=a===qt.Onprem,{currentModal:r,setCurrentModal:s}=oe(),l=r===J.InstrumentationRule,{formData:c,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:m}=Wt(),[h,y]=i(void 0),v=()=>{p(),y(void 0),s("")},f=()=>{if(!m())return null;n(c),v()};return B({key:"Enter",active:l},()=>f()),t(se,{isOpen:l,onClose:v,header:{title:"Add Instrumentation Rule"},actionComponent:t(me,{buttons:[{variant:"primary",label:"DONE",onClick:f,disabled:!o||!h,tooltip:o?"":ue.ENTERPRISE_ONLY("Instrumentation Rules")}]}),children:e(le,{children:[t(P,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e(or,{children:[t(ce,o?{type:de.Warning,message:ue.DEFINED_FOR_ALL_STREAMS(g.INSTRUMENTATION_RULES)}:{type:de.Default,message:ue.ENTERPRISE_ONLY(g.INSTRUMENTATION_RULES)}),t(pe,{options:rr,selectedOption:h,onOptionSelect:e=>{return t=e,p(),void y(t);var t},autoFocus:!h?.type})]}),h?.type?e("div",{children:[t(A,{margin:"16px 0"}),t(tr,{rule:h,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},lr=e=>{const{payloadCollection:t,codeAttributes:n,customInstrumentations:i}=e;let a="";return t&&(a+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),n&&(a+=Object.entries(n).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&Object.values(_t).forEach(e=>{const t=(i[e]||[]).filter(e=>e).join(", ");t&&(a+=a?`, ${t}`:t)}),a},cr=[{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}],dr=({maxHeight:n,maxWidth:i})=>{const a=h(),o=Se(),{setDrawerType:r,setDrawerEntityId:s}=U(),{instrumentationRules:l,instrumentationRulesLoading:d}=Y(),u=c(()=>Gi({instrumentationRules:l,sources:[],actions:[],destinations:[],searchText:o.searchText,selectedCategory:J.InstrumentationRule}).searchResults.find(({category:e})=>e===J.InstrumentationRule)?.entities||[],[l,o]),p=c(()=>u.map(e=>{const{hasErrors:n,hasWarnings:i,hasDisableds:o}=he(e.conditions||[]);return{status:n?de.Error:i?de.Warning:void 0,faded:o,onClick:()=>{r(J.InstrumentationRule),s(e.ruleId)},cells:[{columnKey:"icon",component:()=>t(Ce,{icon:Be(e.type)})},{columnKey:"name",value:Ee(e,J.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:a.text.info},{columnKey:"profile",value:e.profileName,textColor:a.text.info},{columnKey:"notes",value:e.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:lr(e),textColor:a.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>t(Hi,{conditions:e.conditions||[],id:e.ruleId})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:e.disabled?de.Error:de.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})},{columnKey:"source-count",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:de.Info,title:"all sources",withBorder:!0})})}]}}),[u]),{badge:m,badgeTooltip:y}=c(()=>u.length!==l.length?{badge:`${u.length}/${l.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:l.length,badgeTooltip:void 0},[u,l]);return e(ke,{$maxWidth:i,children:[t(we,{children:t(Te,{icon:$e(J.Action),title:g.INSTRUMENTATION_RULES,badge:m,badgeTooltip:y,loading:d})}),t(De,{$maxHeight:n,children:t(Ae,{columns:cr,rows:p})}),!u.length&&t(Ie,{style:{marginTop:"2rem"},children:t(Oe,{})})]})},ur=p.div`
|
|
371
371
|
position: fixed;
|
|
372
372
|
bottom: 0;
|
|
373
373
|
left: 50%;
|
|
@@ -380,18 +380,18 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
380
380
|
border-radius: 32px;
|
|
381
381
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
382
382
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
383
|
-
animation-name: ${
|
|
384
|
-
`,
|
|
383
|
+
animation-name: ${Jt.in.center};
|
|
384
|
+
`,pr=({totalSourceCount:n,uninstrumentSources:a,restartWorkloads:r})=>{const s=h(),{selectedSources:l,setSelectedSources:d}=Pe(),[u,p]=i(!1),[m,g]=i(!1),y=c(()=>{let e=0;return Object.values(l).forEach(t=>{e+=t.length}),e},[l]),v=()=>{d({})};return y?e(o,{children:[e(ur,{"data-id":"multi-source-control",children:[t(z,{children:"Selected sources"}),t(Me,{label:y,filled:!0}),t(A,{orientation:"vertical",length:"16px"}),t(_e,{variant:"tertiary",onClick:v,children:t(z,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(_e,{variant:"tertiary",onClick:()=>g(!0),children:[t(qn,{}),t(z,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(_e,{variant:"tertiary",onClick:()=>p(!0),children:[t(Mn,{}),t(z,{family:"secondary",decoration:"underline",color:s.text.error,children:"Uninstrument"})]})]}),t(q,{isOpen:u,name:`${y} sources`,type:J.Source,isLastItem:y===n,onApprove:()=>{const e={};Object.entries(l).forEach(([t,n])=>{e[t]=n.map(e=>({...e,selected:!1}))}),a(e),p(!1),v()},onDeny:()=>p(!1)}),t(Gt,{isOpen:m,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",approveButton:{text:"Confirm",variant:de.Warning,onClick:()=>{const e=[];Object.values(l).forEach(t=>{e.push(...t.map(e=>Yt(e)))}),r(e),v()}},denyButton:{text:"Go Back",onClick:()=>g(!1)}})]}):null},mr=p.div`
|
|
385
385
|
position: relative;
|
|
386
386
|
width: fit-content;
|
|
387
|
-
`,
|
|
387
|
+
`,hr=p(O)`
|
|
388
388
|
gap: 12px;
|
|
389
389
|
padding: 0 12px;
|
|
390
|
-
`,
|
|
390
|
+
`,gr=p(I)`
|
|
391
391
|
gap: 12px;
|
|
392
392
|
max-height: 400px;
|
|
393
393
|
overflow-y: auto;
|
|
394
|
-
`,
|
|
394
|
+
`,yr=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
|
+
`,vr=p(z)`
|
|
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
|
+
`,fr=()=>{const n=h(),{notifications:i,markAsSeen:a}=Bt(),o=i.filter(({hideFromHistory:e})=>!e),r=o.filter(({seen:e})=>!e),s=r.length,{popupRef:l,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=it({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{s&&r.forEach(({id:e})=>a(e))}});return e(mr,{children:[t(R,{onClick:()=>{p(0,0),d(e=>!e)},tooltip:"Notifications",withPing:!!s,pingColor:n.colors.orange_og,children:t(Gn,{size:18})}),e(at,{ref:l,isOpen:c,right:u.left,maxWidth:"400px",header:e(hr,{children:[t(z,{size:20,children:"Notifications"}),!!s&&e(vr,{size:12,family:"secondary",children:[s," new"]})]}),children:[t(gr,{children:o.length?o.map(e=>t(Nr,{...e,onClick:()=>d(!1)},`notification-${e.id}`)):t(Oe,{title:"No notifications",subTitle:""})}),t(yr,{})]})]})},br=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+_["080"]};
|
|
416
416
|
cursor: not-allowed;
|
|
417
417
|
&.click-enabled {
|
|
418
418
|
cursor: pointer;
|
|
@@ -420,32 +420,55 @@ 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
|
+
`,Sr=p.div`
|
|
424
|
+
background-color: ${({$type:e,theme:t})=>t.text[e]+_["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
|
-
`,
|
|
431
|
+
`,xr=p.div`
|
|
432
432
|
width: 290px;
|
|
433
|
-
`,
|
|
433
|
+
`,Cr=p.div`
|
|
434
434
|
margin-bottom: 6px;
|
|
435
|
-
`,
|
|
435
|
+
`,Er=p.div`
|
|
436
436
|
display: flex;
|
|
437
437
|
align-items: center;
|
|
438
438
|
gap: 6px;
|
|
439
|
-
`,
|
|
439
|
+
`,Nr=({id:i,seen:a,type:o,title:r,message:s,time:l,crdType:c,target:d,onClick:u})=>{const p=h(),{formatTimeAgo:m}=Xt(),{onClickNotification:g}=Qt(),y=!!c&&!!d,v=r?.toLowerCase().includes(ie.Delete.toLowerCase())||!1,f=be(o,p);return e(br,{className:y?"click-enabled":"",onClick:()=>{y&&(u(),g({id:i,crdType:c,target:d}))},children:[t(Sr,{$type:v?de.Error:o,children:t(v?Mn:f,{})}),e(xr,{children:[t(Cr,{children:t(z,{size:14,children:s})}),e(Er,{children:[t(z,{size:10,color:p.text.grey,children:m(l)}),!a&&e(n,{children:[t(z,{size:10,children:"·"}),t(z,{size:10,color:p.colors.orange_soft,children:"new"})]})]})]})]},`notification-${i}`)},kr=e=>`${J.Source}-${e}-${Zt.MapItem}`,wr=(e,t,n)=>{const i=e.isVirtual,a=n?[Jn]:i?[Yn]:t?He(t):[Xn],{priorotizedStatus:o}=i?{priorotizedStatus:void 0}:he(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:a,isVirtual:i,status:o,aggService:e}},Tr=e=>!(!e||"user"!==e.otelServiceName||e.namespace||e.name||e.kind),$r=({theme:e,nodes:t,aggregatedServiceMap:n})=>{const i=[],a=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=kr(t.graphKey),o=a.get(n);if(!o)continue;const r=o.data?.status===de.Error;for(const o of t.connections){const s=kr(o.targetGraphKey);a.has(s)&&i.push({id:`${n}-to-${s}`,type:"smoothstep",source:n,target:s,data:{sourceGraphKey:t.graphKey,targetGraphKey:o.targetGraphKey},markerEnd:{type:ci.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})}}return i},Dr=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},Ar=new pi,Ir=`${J.Source}-user-${Zt.MapItem}`,Or={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},Rr=p.div`
|
|
440
|
+
padding: 8px 0;
|
|
441
|
+
`,Mr=p.div`
|
|
442
|
+
display: flex;
|
|
443
|
+
justify-content: space-between;
|
|
444
|
+
align-items: center;
|
|
445
|
+
padding: 4px 0 4px 16px;
|
|
446
|
+
`,Lr=p.button`
|
|
447
|
+
display: flex;
|
|
448
|
+
align-items: center;
|
|
449
|
+
gap: 4px;
|
|
450
|
+
background: none;
|
|
451
|
+
border: none;
|
|
452
|
+
cursor: pointer;
|
|
453
|
+
padding: 0;
|
|
454
|
+
color: ${({theme:e})=>e.text.info};
|
|
455
|
+
font-size: 12px;
|
|
456
|
+
font-family: ${({theme:e})=>e.font_family.primary};
|
|
457
|
+
&:hover {
|
|
458
|
+
text-decoration: underline;
|
|
459
|
+
}
|
|
460
|
+
`,Fr=p.div`
|
|
461
|
+
padding: 4px 0 8px;
|
|
462
|
+
`,_r=({conn:n,onToggle:i,isExpanded:a})=>{const o=n.details.length>0;return t(Rr,{children:e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(z,{size:14,weight:500,children:n.targetServiceName}),o&&e(Lr,{onClick:i,children:[t(a?Qn:Zn,{size:12}),a?"hide attributes":`${n.details.length} attribute${n.details.length>1?"s":""}`]})]})})},Pr=({conn:e})=>{const i=h();return t(n,{children:e.details.map(e=>t(Mr,{children:t(z,{size:12,color:i.text.secondary,style:{flex:1},children:e.value})},e.value))})},Kr=({connections:a,isVirtual:o})=>{const[r,s]=i(new Set),l=h();return o?t(z,{size:12,color:l.text.info,children:"This service is not instrumented. It was detected from client-side spans of services that communicate with it."}):a.length?e(n,{children:[t(Fr,{children:t(z,{size:11,color:l.text.info,children:"Connected services"})}),a.map(n=>e("div",{children:[t(_r,{conn:n,isExpanded:r.has(n.targetGraphKey),onToggle:()=>{return e=n.targetGraphKey,void s(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});var e}}),r.has(n.targetGraphKey)&&t(Pr,{conn:n}),t(A,{})]},n.targetGraphKey))]}):t(z,{size:12,color:l.text.info,children:"No outgoing connections"})},jr=({conn:i})=>{const a=h();return i?t(n,{children:i.details.length>0?e(n,{children:[t(Fr,{children:t(z,{size:11,color:a.text.info,children:"Attribute breakdown"})}),i.details.map(e=>t(Mr,{children:t(z,{size:12,style:{flex:1},children:e.value})},e.value))]}):t(z,{size:12,color:a.text.info,style:{padding:"8px 0"},children:"No attribute breakdown"})}):t(z,{size:12,color:a.text.info,children:"No data for this connection"})},Vr=({drawerState:e,aggregatedData:n,onClose:i})=>{if(!e)return null;const a=new Map(n.map(e=>[e.graphKey,e]));let o="",r="",s=null;if("node"===e.type){const n=a.get(e.graphKey);o=n?.serviceName||e.graphKey,r=n?.isVirtual?"Virtual service (uninstrumented)":"Outgoing connections",s=t(Kr,{connections:n?.connections||[],isVirtual:n?.isVirtual})}else{const n=a.get(e.sourceKey),i=n?.connections.find(t=>t.targetGraphKey===e.targetKey);o=`${n?.serviceName||e.sourceKey} → ${i?.targetServiceName||e.targetKey}`,r="Connection details",s=t(jr,{conn:i})}return t(en,{isOpen:!0,width:"420px",position:"right",header:{title:o,subTitle:r,onClose:i},children:s})},zr=p.div`
|
|
440
463
|
width: 100%;
|
|
441
464
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
442
465
|
position: relative;
|
|
443
|
-
`,
|
|
466
|
+
`,Ur={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},Br=`${J.Source}-`,Wr=`-${Zt.MapItem}`,Hr=.15,qr=({heightToRemove:n,serviceMap:o})=>{const r=h(),{sources:l}=Y(),[c,u,p]=di([]),[m,y,v]=ui([]),[f,b]=i(0),[S,x]=i(null),C=s([]);C.current=c;const E=s(r);E.current=r;const N=s([]),k=s([]),w=d(()=>b(e=>e+1),[]),T=s(""),{activeNodeId:$,setActiveNodeType:D,setActiveNodeId:A}=tn();a(()=>{if(!$)return;const e=(t=$).startsWith(Br)&&t.endsWith(Wr)?t.slice(Br.length,-Wr.length):null;var t;e&&x({type:"node",graphKey:e})},[$]);const I=d((e,t)=>{const{sourceGraphKey:n,targetGraphKey:i}=t.data||{};n&&i&&(D(null),A(null),x({type:"edge",sourceKey:n,targetKey:i}))},[D,A]),O=d(()=>{x(null),D(null),A(null)},[D,A]),R=d((e,t)=>{const n=t.id;y(e=>e.map(e=>e.source===n||e.target===n?{...e,animated:!0,style:{...e.style,strokeWidth:2.5},labelStyle:{...e.labelStyle,opacity:1},labelBgStyle:{...e.labelBgStyle,opacity:1}}:{...e,style:{...e.style,opacity:Hr},labelStyle:{...e.labelStyle,opacity:Hr},labelBgStyle:{...e.labelBgStyle,opacity:Hr}}))},[y]),M=d(()=>{y(k.current)},[y]);return a(()=>{const e=JSON.stringify(o);if(e===T.current)return;T.current=e;let t=!1;const n=(e=>{const t=new Map,n=new Set,i=(e,n,i=!1)=>{let a=t.get(e);return a||(a={serviceName:n,isVirtual:i,connectionMap:new Map},t.set(e,a)),a};for(const t of e){const{graphKey:e}=Dr(t.nodeId),a=i(e,t.serviceName);for(const e of t.services){const{graphKey:t,detail:i}=Dr(e.nodeId);e.isVirtual&&n.add(t);let o=a.connectionMap.get(t);if(o||(o={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,o)),o.totalRequests+=e.requests,e.dateTime>o.lastDateTime&&(o.lastDateTime=e.dateTime),i){const t=o.details.find(e=>e.value===i);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):o.details.push({value:i,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[a,o]of e)t.has(a)||i(a,o.targetServiceName,n.has(a));const o=[];for(const[e,{serviceName:n,isVirtual:i,connectionMap:a}]of t){const t=[...a.values()];o.push({graphKey:e,serviceName:n,isVirtual:i,connections:t})}return o})(o);N.current=n;const i=[Ur].concat(l),a=(({sources:e,aggregatedServiceMap:t})=>{const n=[],i={x:0,y:0};if(t.length&&e.length)for(const a of t){const t=kr(a.graphKey),o=e.find(e=>a.serviceName===e.otelServiceName||a.serviceName===e.name);n.push({id:t,type:Zt.MapItem,position:i,data:wr(a,o,Tr(o))})}else n.push({id:`${J.Source}-${Zt.NoData}`,type:Zt.NoData,position:i,data:{subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:n,sources:i});if(1===a.length&&a[0].id===`${J.Source}-${Zt.NoData}`)return u(a),y([]),void(k.current=[]);const r=new Map(C.current.map(e=>[e.id,e.position]));if(!a.some(e=>!r.has(e.id))){u(a.map(e=>({...e,position:r.get(e.id)??e.position})));const e=$r({theme:E.current,nodes:a,aggregatedServiceMap:n});return k.current=e,void y(e)}const s=$r({theme:E.current,nodes:a,aggregatedServiceMap:n});return(async(e,t,n={})=>{const i={id:"root",layoutOptions:{...Or,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Ir?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},a=await Ar.layout(i),o=new Map;return a.children?.forEach(e=>{o.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:o.get(e.id)??e.position})),edges:t}})(a,s).then(({nodes:e})=>{if(t)return;const i=new Map(C.current.map(e=>[e.id,e.position]));u(e.map(e=>({...e,position:i.get(e.id)??e.position})));const o=$r({theme:E.current,nodes:a,aggregatedServiceMap:n});k.current=o,y(o),w()}),()=>{t=!0}},[o,l]),a(()=>{if(!C.current.length)return;const e=$r({theme:r,nodes:C.current,aggregatedServiceMap:N.current});k.current=e,y(e)},[r]),e(zr,{$heightToRemove:n,children:[t(nn,{nodes:c,edges:m,onNodesChange:p,onEdgesChange:v,onEdgeClick:I,onNodeMouseEnter:R,onNodeMouseLeave:M,fitViewTrigger:f,zoomOnScroll:!0}),t(Vr,{drawerState:S,aggregatedData:N.current,onClose:O})]})},Gr=p.div`
|
|
444
467
|
width: 100%;
|
|
445
468
|
padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
|
|
446
469
|
border-radius: 16px;
|
|
447
|
-
background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+
|
|
448
|
-
`,
|
|
470
|
+
background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+_["024"]:t.colors.dropdown_bg_2+_["040"]};
|
|
471
|
+
`,Jr=p.div`
|
|
449
472
|
display: flex;
|
|
450
473
|
justify-content: space-between;
|
|
451
474
|
gap: 12px;
|
|
@@ -454,29 +477,29 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
454
477
|
border-radius: 16px;
|
|
455
478
|
cursor: ${({$withClick:e})=>e?"pointer":"unset"};
|
|
456
479
|
&:hover {
|
|
457
|
-
background-color: ${({$withClick:e,$selected:t,theme:
|
|
480
|
+
background-color: ${({$withClick:e,$selected:t,theme:n})=>e&&(t?n.colors.majestic_blue+_["040"]:n.colors.dropdown_bg_2+_["080"])};
|
|
458
481
|
transition: background-color 0.3s;
|
|
459
482
|
}
|
|
460
|
-
`,
|
|
483
|
+
`,Yr=p(Jr)`
|
|
461
484
|
width: calc(100% - 100px);
|
|
462
485
|
margin: 0 auto;
|
|
463
486
|
padding: 8px;
|
|
464
|
-
`,
|
|
487
|
+
`,Xr=p.div`
|
|
465
488
|
position: relative;
|
|
466
489
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
467
|
-
`,
|
|
490
|
+
`,Qr=p.div`
|
|
468
491
|
position: absolute;
|
|
469
492
|
top: 6px;
|
|
470
493
|
left: 18px;
|
|
471
|
-
`,
|
|
494
|
+
`,Zr=p(Ie)`
|
|
472
495
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
473
|
-
`,
|
|
496
|
+
`,es=p.div`
|
|
474
497
|
width: ${({$width:e})=>`${e||42}px`};
|
|
475
498
|
display: flex;
|
|
476
499
|
align-items: center;
|
|
477
500
|
justify-content: flex-end;
|
|
478
501
|
text-align: right;
|
|
479
|
-
`,
|
|
502
|
+
`,ts=$e(J.Namespace),ns=({isModal:n=!1,withInstances:i=!0,loading:a,filteredNamespacesAndSources:o,selectedNamespace:r,onSelectNamespace:s,selectedSources:l,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const p=h(),{isVm:m}=ae(),{namespacesLoading:y}=Y(),v=Object.entries(o||{});return v?.length?t(Ve,{height:n?"calc(100vh - 510px)":"calc(100vh - 310px)",gap:12,noAnimation:!0,elements:v.map(([n,o])=>{const h=l?.[n]||[],v=d?.[n]?.selected||!1,f=h.filter(({selected:e})=>e),b=h.length>0,S=r===n,C=f.length>0&&f.length===o.length,E=f.length>0&&f.length!==o.length,N=o.length>0,k=1===o.length;return s||N?e(Gr,{"data-id":`namespace-${n}`,$selected:C,$isOpen:S,children:[e(Jr,{$selected:C,$withClick:!!s,onClick:()=>s?.(n),children:[e(O,{$gap:12,children:[s&&t(x,{partiallyChecked:E,value:C,onChange:e=>s(n,e)}),t(ts,{}),t(z,{children:n})]}),e(O,{$gap:24,children:[!m&&u&&t(T,{title:g.FUTURE_APPS_TITLE,tooltip:g.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,n),flipHorizontally:!0}),t(es,{children:t(z,{size:10,color:p.text.grey,children:b?`${f.length}/${o.length}`:null})}),s&&t(vt,{extend:S})]})]}),(S||!s)&&(N?e(Xr,{$addPadding:!c,children:[t(Qr,{children:t(A,{orientation:"vertical",length:(k?24:34*o.length)+"px"})}),o.map(e=>{const a=f.some(({name:t})=>t===e.name);return t(is,{withInstances:i,source:e,namespace:n,isSelected:a,onSelect:c},`source-${e.name}`)})]}):t(Zr,{$addPadding:!c,children:y||a?t(Fe,{}):t(Oe,{title:g.NO_SOURCES_NAMESPACE,subTitle:g.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${n}`):null})}):t(Ie,{children:y||a?t(Fe,{}):t(Oe,{title:g.NO_SOURCES,subTitle:!m&&s?g.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:g.PLEASE_ADD_SOURCE})})},is=({withInstances:n,source:i,namespace:a,isSelected:o,onSelect:r})=>{const{tier:s}=ae(),l=s!==qt.Onprem&&!!i.kind&&an.has(i.kind);return t(Yr,{"data-id":`source-${i.name}`,$selected:!l&&o,$withClick:!l&&!!r,onClick:()=>!l&&r?.(i),style:l?{opacity:.5,cursor:"not-allowed"}:void 0,children:e(O,{$gap:12,children:[r&&t(x,{value:!l&&o,onChange:()=>!l&&r(i,a)}),e(O,{$gap:4,children:[t(z,{children:i.name}),e(z,{opacity:.8,size:10,children:[n?` • ${i.numberOfInstances||0} running instance${1!==i.numberOfInstances?"s":""}`:"",` • ${i.kind}`,l?" • Enterprise only":""]})]})]})})},as=p.div`
|
|
480
503
|
display: flex;
|
|
481
504
|
flex-direction: column;
|
|
482
505
|
align-items: center;
|
|
@@ -485,46 +508,46 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
485
508
|
max-height: calc(100vh - 200px);
|
|
486
509
|
height: fit-content;
|
|
487
510
|
overflow-y: scroll;
|
|
488
|
-
`,
|
|
511
|
+
`,os=({onEditStream:n,onEditSources:i,onEditDestinations:a,categories:o})=>{const{selectedStreamName:r}=Ye(),{configuredSources:s,configuredDestinations:l,configuredDestinationsUpdateOnly:d}=gt(),u=c(()=>Object.values(s).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[s]);return t(le,{$isNotModal:!0,children:e(I,{$gap:12,children:[t(P,{title:g.SUMMARY,description:g.STREAM_CONFIRM}),e(as,{children:[t(te,{title:g.STREAM_NAME,action:()=>t(on,{onClick:n}),data:[{title:"",value:r}]}),t(te,{title:g.SELECTED_SOURCES,titleBadge:u,action:()=>t(on,{onClick:i}),children:t(ns,{filteredNamespacesAndSources:s,withInstances:!1})}),t(te,{title:g.SELECTED_DESTINATIONS,titleBadge:l.length+d.length,action:()=>t(on,{onClick:a}),children:t(_o,{categories:o})})]})]})})};var rs;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(rs||(rs={}));const ss=({onClickId:e,defaultSelectedId:n,extendedNavIcons:a})=>{const{isVm:o}=ae(),[r,s]=i(n||""),l=c(()=>[{id:rs.Overview,icon:ei,selected:r===rs.Overview,onClick:()=>{s(rs.Overview),e(rs.Overview)},tooltip:"Overview"},...(a||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=c(()=>{const t=[{id:rs.Sources,icon:ti,selected:r===rs.Sources,onClick:()=>{s(rs.Sources),e(rs.Sources)},tooltip:"Sources"},{id:rs.Destinations,icon:Yn,selected:r===rs.Destinations,onClick:()=>{s(rs.Destinations),e(rs.Destinations)},tooltip:"Destinations"}];return o||(t.push({id:rs.InstrumentationRules,icon:ni,selected:r===rs.InstrumentationRules,onClick:()=>{s(rs.InstrumentationRules),e(rs.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:rs.Actions,icon:ii,selected:r===rs.Actions,onClick:()=>{s(rs.Actions),e(rs.Actions)},tooltip:"Actions"})),t},[o,r]);return t(rn,{orientation:"vertical",mainIcons:l,subIcons:d})},ls=({})=>t(R,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community",children:t(ai,{})}),cs=(e,t)=>{const{name:n,kind:i,namespace:a}=e,o=[{title:g.KIND,value:i},{title:g.NAME,value:n,tooltip:"Resource name"}];return t||(o.unshift({title:g.NAMESPACE,value:a}),o.push({type:y.Divider}),o.push({type:y.CopyText,value:`kubectl get ${i} ${n} -n ${a}`.toLowerCase()})),o},ds=p.div`
|
|
489
512
|
display: flex;
|
|
490
513
|
flex-direction: column;
|
|
491
514
|
gap: 24px;
|
|
492
515
|
padding: 4px;
|
|
493
|
-
`,
|
|
516
|
+
`,us=({formData:e,handleFormChange:n})=>t(ds,{children:t(E,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:e.otelServiceName,onChange:({target:{value:e}})=>n("otelServiceName",e)})}),ps=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const n=sn(e?.status),i=lt(e?.reasonEnum),a=e?.message;return t(O,{$alignItems:"center",$justifyContent:"center",children:t(ge,{status:n,title:i,subtitle:a,withBackground:n!==ye.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},ms=({source:n,fetchSourceDescribe:o,onClickRestartPod:r})=>{const[s,l]=i(!1),[c,d]=i(null);return a(()=>{n&&o({namespace:n.namespace,name:n.name,kind:n.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):l(!0)})},[n.namespace,n.name,n.kind]),c||s?t(I,{$gap:12,children:s?t(Ie,{$height:"70vh",children:t(Oe,{subTitle:"Could not fetch describe for this source"})}):c?.pods?.length?c.pods.map(({podName:i,nodeName:a,phase:o,agentInjected:s,runningLatestWorkloadRevision:l,containers:d,manifestYAML:p})=>{const m=o.status!==de.Success||ln(d)?de.Error:de.Success,h=[];return h.push(t(cn,{value:`kubectl get pod ${i.value} -n ${c?.namespace?.value||n.namespace}`.toLowerCase()},"copy-text")),h.push(t(A,{length:"100%",margin:"0"},"divider-1")),h.push(t(dn,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-1")),h.push(t(A,{length:"100%",margin:"0"},"divider-2")),h.push(t(dn,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-2")),h.push(t(A,{length:"100%",margin:"0"},"divider-3")),h.push(t(dn,{title:s.name,tooltip:s.explain||"",value:{status:s.status||void 0,text:s.value}},"describe-row-3")),h.push(t(A,{length:"100%",margin:"0"},"divider-4")),l?.name&&(h.push(t(dn,{title:l.name,tooltip:l.explain||void 0,value:{status:l.status||void 0,text:l.value}},"describe-row-4")),h.push(t(A,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{h.push(t(un,{...e},`pod-container-${e.containerName.value}`))}),p&&(h.push(t(A,{length:"100%",margin:"0"},"divider-6")),h.push(t(mi,{yaml:p},"yaml-section-card"))),t(te,{title:`Pod: ${i.value}`,withExtend:!0,action:({hovered:a})=>e("div",{style:{position:"relative"},children:[t(ge,{status:m,title:m,withIcon:!0,withBorder:!0},"status"),a&&t(pn,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:mn(),label:"Restart",rightIcon:jn,onClick:()=>r(c?.namespace?.value||n.namespace,i.value)}]:[]},"hover-actions")]}),children:u.toArray(h)},`pod-${i.value}`)}):t(Ie,{$height:"70vh",children:t(Oe,{subTitle:"Check if you have any running pods and try again"})})}):t(Ie,{$height:"70vh",children:t(Fe,{})})},hs=p(O)`
|
|
494
517
|
width: 100%;
|
|
495
518
|
align-items: center;
|
|
496
519
|
justify-content: space-between;
|
|
497
|
-
`,
|
|
520
|
+
`,gs=({source:n,fetchSourceLibraries:r})=>{const s=h(),[l,c]=i(!1),[d,u]=i(null);return a(()=>{n&&r({namespace:n.namespace,name:n.name,kind:n.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?u(Dt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):c(!0)})},[n.namespace,n.name,n.kind]),d||l?t(I,{$gap:12,children:l?t(Ie,{$height:"70vh",children:t(Oe,{subTitle:"Could not fetch libraries for this source"})}):d?.length?t(te,{title:"Instrumented Libraries",children:d.map(({name:n,healthy:i,message:a,nonIdentifyingAttributes:r},l)=>e(o,{children:[e(I,{$gap:4,$width:"100%",children:[e(hs,{$width:"100%",children:[t(z,{size:12,color:s.text.grey,children:n}),e(O,{$gap:4,children:[r.map(({key:e,value:i})=>hn(i)&&gn(i)&&"is_standard_lib"===e?t(ge,{status:de.Default,title:"STANDARD",withBorder:!0},`${n}-${e}`):null),"boolean"==typeof i&&t(ge,{status:i?de.Success:de.Error,title:i?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),a&&t(z,{size:10,color:s.text.error,align:"right",children:a})]}),l!==d.length-1&&t(A,{length:"100%",margin:"0"})]},`library-${n}`))}):e(Ie,{$height:"70vh",$gap:12,children:[t(Oe,{title:"No libraries found",subTitle:""}),t(ce,{type:de.Warning,message:"This feature is in early development, and has very limited support"})]})}):t(Ie,{$height:"70vh",children:t(Fe,{})})},ys="70vh",vs=(e,t)=>e.serviceName.localeCompare(t.serviceName),fs=p(z)`
|
|
498
521
|
cursor: ${({$clickable:e})=>e?"pointer":"default"};
|
|
499
522
|
text-decoration: ${({$clickable:e})=>e?"underline":"none"};
|
|
500
523
|
&:hover {
|
|
501
524
|
opacity: ${({$clickable:e})=>e?.7:1};
|
|
502
525
|
}
|
|
503
|
-
`,
|
|
526
|
+
`,bs=p(O)`
|
|
504
527
|
justify-content: flex-end;
|
|
505
528
|
align-items: center;
|
|
506
529
|
gap: 6px;
|
|
507
530
|
cursor: pointer;
|
|
508
|
-
`,
|
|
531
|
+
`,Ss=({items:i,emptyMessage:a,keyPrefix:r,findSource:s,onNavigate:l})=>{const c=h();return i.length?t(n,{children:i.map(({serviceName:n},a)=>{const d=!!s(n);return e(o,{children:[t(fs,{size:13,color:d?c.text.secondary:c.text.grey,$clickable:d,onClick:()=>l(n),children:n}),a!==i.length-1&&t(A,{length:"100%",margin:"0"})]},`${r}-${n}`)})}):t(z,{size:13,color:c.text.grey,children:a})},xs=({source:n,fetchPeerSources:o})=>{const r=h(),{setDrawerType:l,setDrawerEntityId:c}=U(),u=Y(e=>e.sources),[p,m]=i(!1),[g,y]=i(!1),[v,f]=i(null),b=n.otelServiceName||n.name,S=s(o);S.current=o;const x=d(()=>{b&&(y(!0),m(!1),S.current(b).then(({data:e})=>{e?.peerSources?f(e.peerSources):m(!0)}).finally(()=>y(!1)))},[b]);a(()=>{x()},[x]);const C=d(e=>u.find(t=>t.otelServiceName===e||t.name===e),[u]),E=d(e=>{const t=C(e);t&&(l(J.Source),c({namespace:t.namespace,name:t.name,kind:t.kind}))},[C,l,c]);if(!v&&!p&&g)return t(Ie,{$height:ys,children:t(Fe,{})});if(p)return t(Ie,{$height:ys,children:t(Oe,{subTitle:"Could not fetch peer sources"})});const N=v?.inbound?[...v.inbound].sort(vs):[],k=v?.outbound?[...v.outbound].sort(vs):[];return e(I,{$gap:12,children:[t(te,{title:"Inbound",titleBadge:N.length,description:`Services that send requests to ${b}`,children:t(Ss,{items:N,emptyMessage:"No inbound connections",keyPrefix:"inbound",findSource:C,onNavigate:E})}),t(te,{title:"Outbound",titleBadge:k.length,description:`Services that ${b} sends requests to`,children:t(Ss,{items:k,emptyMessage:"No outbound connections",keyPrefix:"outbound",findSource:C,onNavigate:E})}),e(bs,{onClick:x,children:[t(jn,{size:14}),t(z,{size:12,color:r.text.grey,decoration:"underline",children:"Refresh"})]})]})};var Cs;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries",e.PeerSources="Peer Sources"}(Cs||(Cs={}));const Es=[vn.Deployment,vn.StatefulSet,vn.DaemonSet,vn.DeploymentConfig,vn.Rollout,vn.StaticPod],Ns=[vn.Deployment,vn.StatefulSet,vn.DaemonSet,vn.DeploymentConfig,vn.Rollout,vn.Pod],ks=[fn.Python,fn.Go,fn.Java],ws=p.div`
|
|
509
532
|
width: 100%;
|
|
510
533
|
height: 100%;
|
|
511
534
|
max-height: calc(100vh - 220px);
|
|
512
535
|
overflow: overlay;
|
|
513
536
|
overflow-y: auto;
|
|
514
|
-
`,
|
|
537
|
+
`,Ts=p.div`
|
|
515
538
|
display: flex;
|
|
516
539
|
flex-direction: column;
|
|
517
540
|
gap: 12px;
|
|
518
|
-
`;var
|
|
541
|
+
`;var $s;!function(e){e.Workload="Workload",e.Pod="Pod"}($s||($s={}));const Ds=({persistSources:o,updateSource:r,restartWorkloads:l,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,fetchPeerSources:m,restartPod:h,recoverFromRollback:y})=>{const{isVm:v}=ae(),{sources:f}=Y(),{selectedStreamName:b}=Ye(),{drawerType:S,drawerEntityId:x}=U(),C=c(()=>Qe(f,b),[f,b]),E=s(null),N=S===J.Source,[k,w]=i(!1),[T,$]=i(!1),[D,A]=i(Cs.Overview),[I,O]=i(null);a(()=>{N&&x&&d(x).then(e=>O(e||null))},[N,x]);const{formData:R,handleFormChange:M,resetFormData:L,loadFormWithDrawerItem:F}=yn(),_=c(()=>{if(x)return I&&JSON.stringify(Yt(I))===JSON.stringify(Yt(x))?I:C?.find(e=>JSON.stringify(Yt(e))===JSON.stringify(Yt(x)))},[x,C,I]);a(()=>{N&&_?F(_):L()},[N,_]);const P=c(()=>{const e=_?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ye.Loading,containers:_?.containers||[]}},[_]),K=c(()=>!!_?.rollbackOccurred,[_?.rollbackOccurred]),j=c(()=>{const e=[{label:Cs.Overview,onClick:()=>A(Cs.Overview),selected:D===Cs.Overview}];return v||(Es.includes(_?.kind)&&e.push({label:Cs.Pods,onClick:()=>A(Cs.Pods),selected:D===Cs.Pods}),_?.containers?.some(({language:e})=>ks.includes(e))&&e.push({label:Cs.Libraries,onClick:()=>A(Cs.Libraries),selected:D===Cs.Libraries}),e.push({label:Cs.PeerSources,onClick:()=>A(Cs.PeerSources),selected:D===Cs.PeerSources})),e},[D,_,v]),V=Ns.includes(_?.kind),[B,W]=i({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});if(!_)return null;return e(Pi,{ref:E,onClose:()=>{A(Cs.Overview),O(null)},title:_.otelServiceName||_.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:Sn(_.containers),isEdit:k,isFormDirty:T,onEdit:D===Cs.Overview?e=>{w("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=R.otelServiceName!==_.name?R.otelServiceName:"";M("otelServiceName",e),await r(x,{...R,otelServiceName:e}),O(null),$(!1),w(!1)},onDelete:D===Cs.Overview?async()=>{const{namespace:e}=_;o({[e]:[{..._,selected:!1,currentStreamName:b}]},{}),O(null),$(!1),w(!1),E.current?.closeDrawer()}:void 0,onCancel:()=>{$(!1),w(!1),M("otelServiceName",_.otelServiceName||_.name||"")},isLastItem:1===C.length,tabs:j,headerActionButtons:v?[]:V?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>W({openFor:$s.Workload,workloadId:x}),children:e(n,{children:[t(qn,{}),t(z,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[D===Cs.Overview?k?t(ws,{children:t(us,{formData:R,handleFormChange:(...e)=>{$(!0),M(...e),M("currentStreamName",b)}})}):e(Ts,{children:[t(ps,{workloadOdigosHealthStatus:_.workloadOdigosHealthStatus}),K&&t(ce,{type:de.Warning,message:g.ROLLBACK_OCCURRED_MESSAGE,action:{label:g.ROLLBACK_RECOVER,onClick:async()=>{await y(x);const e=await d(x);e&&O(e)}}}),t(ee,{conditions:_.conditions||[]}),t(te,{title:g.SOURCE_DETAILS,data:_?cs(_,v):[]}),t(te,{title:v?g.DETECTED_PROCESSES:g.DETECTED_CONTAINERS,titleBadge:P.isLoading?ye.Loading:P.containers.length,description:P.description||(v?g.DETECTED_PROCESSES_DESCRIPTION:g.DETECTED_CONTAINERS_DESCRIPTION),children:P.containers.map(e=>t(bn,{...e,callbackRuntimeOverride:e=>r(x,e)},`source-container-${e.containerName}`))}),_.manifestYAML&&t(mi,{title:`${_.kind} YAML`,yaml:_.manifestYAML,defaultOpen:!_.instrumentationConfigYAML}),_.instrumentationConfigYAML&&t(mi,{title:"Instrumentation Config YAML",yaml:_.instrumentationConfigYAML,defaultOpen:!_.manifestYAML})]}):D===Cs.Pods?t(ms,{source:_,fetchSourceDescribe:u,onClickRestartPod:V?(e,t)=>W({openFor:$s.Pod,podNamespace:e,podName:t}):void 0}):D===Cs.PeerSources?t(xs,{source:_,fetchPeerSources:m}):t(gs,{source:_,fetchSourceLibraries:p}),t(Gt,{isOpen:!!B.openFor,title:`Rollout Restart ${B.openFor}`,description:`Are you sure you want to rollout restart this ${B.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:de.Warning,onClick:()=>{B.openFor===$s.Workload&&B.workloadId?l([B.workloadId]):B.openFor===$s.Pod&&B.podNamespace&&B.podName&&h(B.podNamespace,B.podName),W({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{W({openFor:null})}}})]})},As=p.div`
|
|
519
542
|
max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
|
|
520
543
|
width: 100%;
|
|
521
|
-
`,
|
|
544
|
+
`,Is=r(({isModal:n,fetchNamespacesWithWorkloads:i,onClickSummary:a},o)=>{const r=h(),{isVm:s}=ae(),c=xn({fetchNamespacesWithWorkloads:i}),{selectedSources:d,loading:u,selectedAllNamespaces:p,onSelectAllNamespaces:m,getApiSourcesPayload:y,getApiFutureAppsPayload:v,searchText:f,setSearchText:b,searchBy:S,setSearchBy:x,showSelectedOnly:C,setShowSelectedOnly:N,showRunningOnly:k,setShowRunningOnly:w}=c;l(o,()=>({getFormValues:()=>({apps:y(),futureApps:v()})}));const $=Object.values(d).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return t(le,{$isNotModal:!n,children:e(I,{$gap:12,children:[e(I,{$gap:24,children:[a&&t(ft,{onClick:a}),t(P,{title:g.SELECT_SOURCES,badgeLabel:$,description:g.SELECT_SOURCES_DESCRIPTION}),e(O,{$justifyContent:"space-between",children:[t(As,{$fullWidth:s,children:t(E,{placeholder:S===J.Source?g.SEARCH_SOURCES:g.SEARCH_NAMESPACES,icon:Vn,value:f,onChange:e=>b(e.target.value.toLowerCase())})}),!s&&t(F,{options:[{label:g.SOURCE,value:J.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:g.NAMESPACE,value:J.Namespace,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary}],selected:S,setSelected:x})]}),e(O,{$gap:36,children:[t(T,{title:g.SELECT_ALL,initialValue:p,onChange:m,disabled:u}),t(T,{title:g.ONLY_SELECTED,initialValue:C,onChange:N}),t(T,{title:g.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:w})]})]}),t(A,{}),t(ns,{isModal:n,...c})]})})});Is.displayName=Is.name;const Os=({fetchNamespacesWithWorkloads:e,persistSources:n})=>{const{currentModal:i,setCurrentModal:a}=oe(),o=i===J.Source,r=()=>{a("")},l=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();n(e,t),r()}},c=s(null);return B({key:"Enter",active:o},l),o?t(se,{isOpen:o,onClose:r,header:{title:"Add Source"},actionComponent:t(me,{buttons:[{label:"DONE",variant:"primary",onClick:l}]}),children:t(Is,{ref:c,isModal:!0,fetchNamespacesWithWorkloads:e})}):null},Rs=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},Ms=({metrics:n,maxHeight:i,maxWidth:a})=>{const o=h(),{isVm:r}=ae(),s=Se(),{selectedStreamName:l}=Ye(),{sources:u,sourcesLoading:p}=Y(),{setDrawerType:m,setDrawerEntityId:y}=U(),{selectedSources:v,setSelectedSources:f}=Pe(),{progress:b}=qe(),S=c(()=>b[Ge.Instrumenting]||b[Ge.Uninstrumenting]?b[Ge.Instrumenting]?.percentage||b[Ge.Uninstrumenting]?.percentage||0:void 0,[b[Ge.Instrumenting],b[Ge.Uninstrumenting]]),C=c(()=>Qe(u,l),[u,l]),E=c(()=>Gi({instrumentationRules:[],sources:et(C,s),actions:[],destinations:[],searchText:s.searchText,selectedCategory:J.Source}).searchResults.find(({category:e})=>e===J.Source)?.entities||[],[C,s]),[N,k]=c(()=>{let e=0;return Object.values(v).forEach(t=>{e+=t.length}),[0!==e,e]},[v]),w=d(e=>{if(e){const e={};E.forEach(t=>{const{namespace:n}=t;e[n]?e[n].push(t):e[n]=[t]}),f(e)}else f({})},[E]),T=d(e=>{const{namespace:t,name:n,kind:i}=e,a={...v};a[t]||(a[t]=[]);const o=a[t].findIndex(e=>e.name===n&&e.kind===i);-1===o?a[t].push(e):a[t].splice(o,1),f(a)},[v]),$=c(()=>E.map(i=>{const a=Yt(i),r=JSON.stringify(a),{hasErrors:s,hasWarnings:l,hasDisableds:c}=he(i.conditions||[]),d=!!v[a.namespace]?.find(e=>e.namespace===a.namespace&&e.name===a.name&&e.kind===a.kind);return{status:s?de.Error:l?de.Warning:void 0,faded:c,onClick:()=>{m(J.Source),y(a)},cells:[{columnKey:"checkbox-and-icon",component:()=>e(O,{$gap:16,children:[t(x,{value:d,onChange:()=>T(i)}),t(Cn,{icons:He(i),id:r})]})},{columnKey:"name",value:Ee(i,J.Source,{extended:!0})},{columnKey:"kind",value:i.kind,textColor:o.text.info},{columnKey:"namespace",value:i.namespace,textColor:o.text.info},{columnKey:"throughput",value:Ue(Mt(n,J.Source,a).throughput),textColor:o.text.info},{columnKey:"conditions",component:()=>t(Hi,{conditions:i.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:de.Info,title:En(i.containers),withBorder:!0})})}]}}),[E,v,n,T]),{badge:D,badgeTooltip:A}=c(()=>E.length!==C.length?{badge:`${E.length}/${C.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:C.length,badgeTooltip:void 0},[E,C]);return e(ke,{$maxWidth:a,children:[e(we,{children:[t(x,{partiallyChecked:N&&E?.length!==k,value:N&&E?.length===k,onChange:w,disabled:!E?.length}),t(Te,{icon:$e(J.Source),title:g.SOURCES,badge:D,badgeTooltip:A,loading:p||"number"==typeof S})]}),t(De,{$maxHeight:i,children:t(Ae,{columns:Rs(r),rows:$})}),"number"!=typeof S||$.length?$.length?null:t(Ie,{style:{marginTop:"2rem"},children:t(Oe,{})}):e(Ie,{style:{marginTop:"2rem",gap:"24px"},children:[t(Re,{width:420}),e(O,{$gap:16,children:[e(z,{color:o.text.info,children:[b[Ge.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Me,{label:`${S}%`})]})]})]})},Ls=({expiresAt:t})=>{const n=h(),{formatTimeAgo:i}=Xt(),a=i(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),r=Nn(t,0)?n.text.error:Nn(t,6048e5)?n.text.warning:n.text.success;return e(z,{size:14,color:r,children:[a," (",o,")"]})},Fs=p.div`
|
|
522
545
|
position: relative;
|
|
523
|
-
`,
|
|
546
|
+
`,_s=({token:n,saveToken:a})=>{const{CopyButton:o}=kn(),{formData:r,handleFormChange:s,resetFormData:l}=wn({token:n}),[c,d]=i(!1),u=()=>{d(!1),l()};return e(O,{$gap:0,children:[t(o,{value:n,size:Tn.L}),t(A,{orientation:"vertical",length:"12px"}),e(Fs,{children:[t(R,{size:32,onClick:()=>{d(!0)},children:t(_n,{})}),c&&t($n,{flipX:!0,clientX:36,isOpen:c,onClose:u,onSave:()=>{a(r.token).then(u)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one",children:t(E,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>s("token",e.target.value)})})]})]})},Ps=({tokens:e,saveToken:n})=>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:i,expiresAt:a})=>({cells:[{columnKey:"icon",icon:oi},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(Ls,{expiresAt:a})},{columnKey:"actions",component:()=>t(_s,{token:i,saveToken:n})}]}))}}]}),Ks=({fetchDescribeOdigos:o})=>{const[r,s]=i(null);if(a(()=>{o().then(({data:e})=>s(e?.describeOdigos||null))},[]),!r)return t(Ie,{children:t(Fe,{})});const l=e=>e?.name?[t(A,{},`divider-${e.name}`),t(dn,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(hn(e.value)?gn(e.value)?de.Success:de.Error:de.Default),text:e.value}},`describe-row-${e.name}`)]:[];return e(n,{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(l)}),t(te,{title:"Node Collector",withExtend:!0,children:Object.values(r?.nodeCollector||{}).map(l)})]})},js=p.div`
|
|
524
547
|
display: flex;
|
|
525
548
|
flex-direction: column;
|
|
526
549
|
gap: 12px;
|
|
527
|
-
|
|
550
|
+
`,Vs="System Overview",zs=({tokens:a,saveToken:o,fetchDescribeOdigos:r})=>{const[s,l]=i(!1),c=()=>l(e=>!e);return e(n,{children:[t(R,{onClick:c,tooltip:Vs,children:t(ri,{size:18})},Vs),t(H,{width:"750px",isOpen:s,onClose:c,header:{icons:[ri],title:Vs},footer:{isOpen:!1},children:e(js,{children:[!!a?.length&&t(Ps,{tokens:a,saveToken:o}),t(Ks,{fetchDescribeOdigos:r})]})})]})},Us=p.div`
|
|
528
551
|
position: fixed;
|
|
529
552
|
bottom: 12px;
|
|
530
553
|
left: 12px;
|
|
@@ -533,7 +556,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
533
556
|
flex-direction: column-reverse;
|
|
534
557
|
gap: 6px;
|
|
535
558
|
max-width: 600px;
|
|
536
|
-
`,
|
|
559
|
+
`,Bs=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:i}=Bt(),{onClickNotification:a}=Qt();return t(Us,{children:e.filter(({dismissed:e})=>!e).map(({id:e,type:o,title:r,message:s,crdType:l,target:c})=>t(ce,{id:e,type:o,title:r,message:s,action:l&&c?{label:"go to details",onClick:()=>a({id:e,crdType:l,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{n(e),i(e)})({id:e,asSeen:!0})},`toast-${e}`))})},Ws=p.div`
|
|
537
560
|
position: relative;
|
|
538
561
|
display: flex;
|
|
539
562
|
align-items: center;
|
|
@@ -552,7 +575,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
552
575
|
stroke: ${({theme:e})=>e.text.secondary};
|
|
553
576
|
}
|
|
554
577
|
}
|
|
555
|
-
`,
|
|
578
|
+
`,Hs=p.div`
|
|
556
579
|
position: absolute;
|
|
557
580
|
top: 2px;
|
|
558
581
|
left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
|
|
@@ -562,50 +585,50 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
562
585
|
background-color: ${({theme:e})=>e.colors.border};
|
|
563
586
|
border-radius: 100%;
|
|
564
587
|
transition: all 0.3s;
|
|
565
|
-
`,
|
|
588
|
+
`,qs=({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})}),Gs=()=>{const{darkMode:n,setDarkMode:i}=Dn();return e(Ws,{onClick:()=>i(!n),children:[t(qs,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),t(qs,{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(Hs,{$darkMode:n})]})},Js=e=>{const{spans:t}=e,n=new Map;t.forEach(e=>{n.set(e.spanID,{...e,spans:[]})});const i=[];return t.forEach(e=>{const t=n.get(e.spanID);let a=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&n.has(t.spanID)||(a=!0)}else a=!0;if(a)i.push(t);else{const i=e.references.find(e=>"CHILD_OF"===e.refType);if(i){const e=n.get(i.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),i.sort((e,t)=>e.startTime-t.startTime)},Ys=(e,t)=>{const{tags:n}=e,i={},a=[];return n.forEach(e=>{i[e.key]=e.value}),a.push({type:y.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),a},Xs=e=>{const{logs:t}=e,n=[];return t.forEach((e,i)=>{e.fields.forEach(e=>{n.push({title:e.key,value:e.value})}),i!==t.length-1&&n.push({type:y.Divider})}),n},Qs=e=>{const{traceID:t,spanID:n,processID:i,operationName:a,duration:o,startTime:r,warnings:s}=e,l=[];return l.push({type:y.CopyText,title:"Trace ID",value:t}),l.push({type:y.CopyText,title:"Span ID",value:n}),l.push({type:y.Divider}),l.push({title:"Service",value:i}),l.push({title:"Operation",value:a}),l.push({title:"Duration",value:An(o)}),l.push({title:"Start time",value:new Date(r/1e3).toLocaleString()}),s.length&&(l.push({type:y.Divider}),l.push({title:"Warnings",titleIcon:si,value:s})),l},Zs=(e,t)=>{const{tags:n}=e,i={},a=[];return n.forEach(e=>{i[e.key]=e.value}),a.push({type:y.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),a},el=p.div`
|
|
566
589
|
display: flex;
|
|
567
590
|
flex-direction: column;
|
|
568
591
|
gap: 12px;
|
|
569
592
|
max-height: 100vh;
|
|
570
593
|
overflow-y: auto;
|
|
571
|
-
`,
|
|
594
|
+
`,tl=({span:n,process:a,onClose:o})=>{const[r,s]=i(!0),[l,c]=i(!0);return t(H,{width:"750px",isOpen:!0,onClose:o,header:{icons:[li],title:n.operationName},footer:{isOpen:!1},children:e(el,{children:[t(te,{title:"Details",data:Qs(n)}),n.logs.length>0&&t(te,{title:"Errors",titleBadge:n.logs.length,titleIcon:si,data:Xs(n)}),t(te,{title:"Tags",data:Ys(n,r),action:t(In,{isPrettyMode:r,setIsPrettyMode:s})}),a&&t(te,{title:`Process (${a.serviceName})`,data:Zs(a,l),action:t(In,{isPrettyMode:l,setIsPrettyMode:c})})]})})},nl=370,il=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),al=p.div`
|
|
572
595
|
display: flex;
|
|
573
596
|
align-items: center;
|
|
574
|
-
width: ${
|
|
575
|
-
background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+
|
|
597
|
+
width: ${nl}px;
|
|
598
|
+
background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+_["042"]:t.colors.dark_grey};
|
|
576
599
|
&:hover {
|
|
577
|
-
${({$withErrors:e,$preventHover:t,theme:
|
|
600
|
+
${({$withErrors:e,$preventHover:t,theme:n})=>!t&&`background-color: ${e?n.colors.error:n.colors.secondary+_["010"]};`}
|
|
578
601
|
cursor: ${({$preventHover:e})=>e?"default":"pointer"};
|
|
579
602
|
}
|
|
580
|
-
`,
|
|
603
|
+
`,ol=p(O)`
|
|
581
604
|
align-items: center;
|
|
582
605
|
justify-content: space-between;
|
|
583
606
|
gap: 4px;
|
|
584
607
|
padding: 12px;
|
|
585
608
|
padding-left: ${({$depth:e})=>12*e||12}px;
|
|
586
|
-
width: calc(${
|
|
587
|
-
`,
|
|
609
|
+
width: calc(${nl}px - ${({$depth:e})=>12*e}px);
|
|
610
|
+
`,rl=p(O)`
|
|
588
611
|
align-items: center;
|
|
589
612
|
gap: 4px;
|
|
590
613
|
position: absolute;
|
|
591
614
|
right: 56px;
|
|
592
615
|
width: calc(100% - ${434}px);
|
|
593
|
-
`,
|
|
616
|
+
`,sl=p.div`
|
|
594
617
|
position: absolute;
|
|
595
|
-
left: ${({$startTime:e,$minStartTime:t,$maxEndTime:
|
|
618
|
+
left: ${({$startTime:e,$minStartTime:t,$maxEndTime:n})=>(e-t)/(n-t)*100+"%"};
|
|
596
619
|
width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
|
|
597
620
|
height: 12px;
|
|
598
621
|
border-radius: 32px;
|
|
599
|
-
background-color: ${({$indexInMatrix:e})=>
|
|
600
|
-
`,
|
|
622
|
+
background-color: ${({$indexInMatrix:e})=>il[e%il.length]};
|
|
623
|
+
`,ll=p(z)`
|
|
601
624
|
padding-left: calc(100% + 8px);
|
|
602
625
|
font-size: 10px;
|
|
603
626
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
604
627
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
605
628
|
white-space: nowrap;
|
|
606
|
-
`,
|
|
629
|
+
`,cl=({span:n,depth:a,indexInMatrix:o,maxDuration:r,minStartTime:s,maxEndTime:l,withErrors:c,errorTooltip:d,isOpen:u,withToggle:p,onToggleOpen:m,onSelect:g})=>{const y=h(),[v,f]=i(!1),b=nl-12*a-20-(c?12:0),S=c&&(1===a||n.logs.length>0);return e(al,{className:"span-container",$withErrors:c,$preventHover:v,onClick:g,children:[e(ol,{$depth:a,className:"span-left",children:[e(O,{$gap:4,$alignItems:"center",children:[t("div",p?{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:t(R,{onClick:e=>{e.stopPropagation(),m?.()},size:24,children:t(vt,{extend:u??!1})})}:{style:{width:"24px"}}),t(Rn,{maxWidth:b/2,text:n.processID,textSize:14}),t(z,{size:12,color:y.text.darker_grey,children:"•"}),t(Rn,{maxWidth:b/2,text:n.operationName,textSize:12,textColor:y.text.darker_grey})]}),c&&(S?t(fe,{...d,children:t(si,{fill:y.text.error})}):t("div",{style:{position:"relative"},children:t("div",{style:{position:"absolute",top:"-24px",right:"8px"},children:t(A,{type:de.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5})})}))]}),t(rl,{className:"span-right",children:t(sl,{$indexInMatrix:o,$duration:n.duration,$maxDuration:r,$startTime:n.startTime,$minStartTime:s,$maxEndTime:l,children:t(ll,{children:An(n.duration)})})})]})},dl=({spans:n,logs:i,depth:a,indexInMatrix:o,maxDuration:r,minStartTime:s,maxEndTime:l,openSpanIdsState:c,selectedSpanState:d})=>{const u=h();return n.map((n,p)=>{const m=n.spanID,h=c.value.includes(m),g=!!n.spans?.length,y=i.length?i:On(n,"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===a?`1px dotted ${u.colors.border}`:"none"},children:[t(cl,{span:n,depth:a,indexInMatrix:o+p+a,maxDuration:r,minStartTime:s,maxEndTime:l,withErrors:v,errorTooltip:{titleIcon:si,title:f,text:b},isOpen:h,withToggle:g,onToggleOpen:()=>c.set(e=>e.some(e=>e===m)?e.filter(e=>e!=m):[...e,m,...On(n,"spans","spanID")]),onSelect:()=>d.set(e=>e?.spanID===m?null:n)}),h&&g?t(dl,{spans:n.spans||[],logs:y,depth:a+1,indexInMatrix:o+p,maxDuration:r,minStartTime:s,maxEndTime:l,openSpanIdsState:c,selectedSpanState:d}):null]},`span-${m}`)})},ul=p.div`
|
|
607
630
|
width: 100%;
|
|
608
|
-
`,
|
|
631
|
+
`,pl=p.div`
|
|
609
632
|
max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
610
633
|
overflow: auto;
|
|
611
634
|
|
|
@@ -615,22 +638,22 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
615
638
|
border-radius: 24px;
|
|
616
639
|
border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
617
640
|
position: relative;
|
|
618
|
-
`,
|
|
641
|
+
`,ml=p.div`
|
|
619
642
|
padding: 12px 12px 12px 24px;
|
|
620
|
-
width: calc(${
|
|
643
|
+
width: calc(${nl}px - 36px);
|
|
621
644
|
background-color: ${({theme:e})=>e.colors.dark_grey};
|
|
622
|
-
`,
|
|
645
|
+
`,hl=p.div`
|
|
623
646
|
width: 1px;
|
|
624
647
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
625
648
|
background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
|
|
626
649
|
|
|
627
650
|
position: absolute;
|
|
628
|
-
left: calc(${
|
|
629
|
-
`,
|
|
651
|
+
left: calc(${nl}px + ((100% - ${nl}px) / ${5}) * ${({index:e})=>e});
|
|
652
|
+
`,gl=p(z)`
|
|
630
653
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
631
654
|
font-size: 12px;
|
|
632
655
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
633
656
|
padding-top: 12px;
|
|
634
657
|
padding-left: 12px;
|
|
635
658
|
white-space: nowrap;
|
|
636
|
-
`,
|
|
659
|
+
`,yl=({heightToRemove:a,traces:o,isLoading:r})=>{const[s,l]=i([]),[d,u]=i(null),p=c(()=>Dt(o).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:Js(e)})),[o]),m=c(()=>p.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[p]),h=c(()=>{const e=p.find(e=>e.spans.some(e=>e.spanID===d?.spanID)),t=e?.processes.find(e=>e.serviceName===d?.processID);return t},[p,d]);return e(n,{children:[t(ul,{$heightToRemove:a,children:r?t(Ie,{$height:"50vh",children:t(Fe,{scale:1.5})}):p.length?e(pl,{$heightToRemove:a,children:[t(ml,{children:t(z,{children:"Service & operation"})}),new Array(5).fill(null).map((e,n)=>t(hl,{$heightToRemove:a,index:n,children:t(gl,{children:An(m/5*n)})},`${n}-divider`)),p.map((e,n)=>{const{spans:i}=e,a=i.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),o=i.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return t(dl,{spans:i,logs:[],depth:1,indexInMatrix:n,maxDuration:m,minStartTime:a,maxEndTime:o,openSpanIdsState:{value:s,set:l},selectedSpanState:{value:d,set:u}},`recursive-spans-${e.traceID}`)})]}):t(Ie,{$height:"50vh",children:t(Oe,{title:g.NO_TRACES_FOUND,subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC})})}),d&&t(tl,{span:d,process:h,onClose:()=>u(null)})]})};export{zi as ActionDrawer,_i as ActionForm,Bi as ActionModal,Yi as ActionTable,ta as AwaitPipeline,Ra as ConditionDropdown,$a as DataFlow,oo as DataFlowActionsMenu,Ja as DataStreamDrawer,qa as DataStreamForm,so as DataStreamModal,ro as DataStreamSelectionForm,So as DestinationDrawer,vo as DestinationForm,Lo as DestinationModal,jo as DestinationSelectionForm,zo as DestinationTable,Ma as ErrorDropdown,ar as InstrumentationRuleDrawer,tr as InstrumentationRuleForm,sr as InstrumentationRuleModal,dr as InstrumentationRuleTable,Pa as KindDropdown,La as LanguageDropdown,Fa as MonitorDropdown,pr as MultiSourceControl,_a as NamespaceDropdown,rs as NavIconIds,fr as NotificationManager,Pi as OverviewDrawer,Ka as PodsAgentInjectionStatusDropdown,qr as ServiceMap,os as SetupSummary,ss as SideNav,ls as SlackInvite,Ds as SourceDrawer,us as SourceForm,Os as SourceModal,Is as SourceSelectionForm,Ms as SourceTable,zs as SystemOverview,Hi as TableCellConditions,Bs as ToastList,Gs as ToggleDarkMode,yl as TraceView};
|