@odigos/ui-kit 0.0.125 → 0.0.127
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 +14 -0
- package/lib/chunks/ui-components-2d8c514a.js +1655 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/index.d.ts +0 -1
- package/lib/containers.js +117 -144
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/icons.js +1 -1
- package/lib/mock-data/index.d.ts +0 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/common/index.d.ts +12 -0
- package/lib/types/index.d.ts +0 -1
- package/lib/types/instrumentation-instances/index.d.ts +3 -0
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/ui-components-898f30d4.js +0 -1655
- package/lib/containers/system-settings/index.d.ts +0 -9
- package/lib/containers/system-settings/settings/collector-gateway-settings.d.ts +0 -4
- package/lib/containers/system-settings/settings/collector-node-settings.d.ts +0 -4
- package/lib/containers/system-settings/settings/general-settings.d.ts +0 -4
- package/lib/containers/system-settings/settings/options.d.ts +0 -5
- package/lib/containers/system-settings/settings/rollback-settings.d.ts +0 -4
- package/lib/containers/system-settings/settings/styled.d.ts +0 -8
- package/lib/containers/system-settings/settings/types.d.ts +0 -13
- package/lib/containers/system-settings/settings/ui-settings.d.ts +0 -4
- package/lib/mock-data/config/index.d.ts +0 -2
- package/lib/types/config/index.d.ts +0 -80
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e,{useState as t,useEffect as
|
|
1
|
+
import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperativeHandle as o,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{D as p,a as m,A as h,K as g,F as y,C as v,b,c as f,I as x,d as $,i as C,e as S,f as k,g as w,h as T,j as D,k as N,T as E,S as O,l as F,m as I,M as A,n as M,u as R,o as L,p as P,q as K,B as j,r as V,s as q,t as z,E as H,v as B,w as W,x as _,y as J,z as U,G,H as Y,J as X,L as Z,N as Q,O as ee,P as te,Q as ie,R as ae,U as ne,V as oe,W as le,X as re,Y as se,Z as ce,_ as de,$ as ue,a0 as pe,a1 as me,a2 as he,a3 as ge,a4 as ye,a5 as ve,a6 as be,a7 as fe,a8 as xe,a9 as $e,aa as Ce,ab as Se,ac as ke,ad as we,ae as Te,af as De,ag as Ne,ah as Ee,ai as Oe,aj as Fe,ak as Ie,al as Ae,am as Me,an as Re,ao as Le,ap as Pe,aq as Ke,ar as je,as as Ve,at as qe,au as ze,av as He,aw as Be,ax as We,ay as _e,az as Je,aA as Ue,aB as Ge,aC as Ye,aD as Xe,aE as Ze,aF as Qe,aG as et,aH as tt,aI as it,aJ as at,aK as nt,aL as ot,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,aS as pt,aT as mt,aU as ht,aV as gt,aW as yt,aX as vt,aY as bt,aZ as ft,a_ as xt,a$ as $t,b0 as Ct,b1 as St,b2 as kt,b3 as wt,b4 as Tt,b5 as Dt,b6 as Nt,b7 as Et,b8 as Ot,b9 as Ft,ba as It,bb as At,bc as Mt,bd as Rt,be as Lt,bf as Pt,bg as Kt,bh as jt,bi as Vt,bj as qt,bk as zt,bl as Ht,bm as Bt,bn as Wt,bo as _t,bp as Jt,bq as Ut,br as Gt,bs as Yt,bt as Xt,bu as Zt,bv as Qt,bw as ei,bx as ti,by as ii,bz as ai,bA as ni,bB as oi,bC as li,bD as ri,bE as si,bF as ci,bG as di,bH as ui,bI as pi,bJ as mi,bK as hi,bL as gi,bM as yi}from"./chunks/ui-components-2d8c514a.js";import{CheckCircledIcon as vi,CrossCircledIcon as bi,EditIcon as fi,TrashIcon as xi,OdigosLogoText as $i,PlusIcon as Ci,SearchIcon as Si,FilterIcon as ki,DataStreamsIcon as wi,CheckIcon as Ti,OdigosLogo as Di,ArrowIcon as Ni,RefreshLeftArrowIcon as Ei,NotificationIcon as Oi,UserIcon as Fi,ImageErrorIcon as Ii,OverviewIcon as Ai,RulesIcon as Mi,ActionsIcon as Ri,SourcesIcon as Li,DestinationsIcon as Pi,SlackLogo as Ki,CopyIcon as ji,KeyIcon as Vi,TerminalIcon as qi,WarningTriangleIcon as zi,TraceViewIcon as Hi,ErrorTriangleIcon as Bi}from"./icons.js";import{MarkerType as Wi,useNodesState as _i,useEdgesState as Ji,applyNodeChanges as Ui}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-f206ac21.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const Gi=e=>{const{type:t,name:i,notes:a,signals:n,disabled:o,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:y,overwriteExistingValues:v,attributeNamesToDelete:b,renames:f,piiCategories:x,fallbackSamplingRatio:$,samplingPercentage:C,endpointsFilters:S,servicesNameFilters:k,attributeFilters:w}}=e,T=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!o)},{type:m.Monitors,title:p.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:p.NAME,value:i||""},{title:p.NOTES,value:a||""},{type:m.Divider}];if(t===h.K8sAttributes&&(T.push({title:"Collect Container Attributes",value:String(l)}),T.push({title:"Collect ReplicaSet Attributes",value:String(r)}),T.push({title:"Collect Workload ID",value:String(s)}),T.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&T.push({type:m.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:i},a)=>{let n="";n+=`Label Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${i||g.Pod}\n`,T.push({title:"Label"+(d.length>1?` #${a+1}`:""),value:n})}),u?.length&&T.push({type:m.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:i},a)=>{let n="";n+=`Annotation Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${i||g.Pod}\n`,T.push({title:"Annotation"+(u.length>1?` #${a+1}`:""),value:n})})),t===h.AddClusterInfo){T.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";y?.forEach(({attributeName:t,attributeStringValue:i},a)=>{e+=`${t}: ${i}`,a<y.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===h.DeleteAttributes){let e="";b?.forEach((t,i)=>{e+=t,i<b.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([i,a],n)=>{e+=`${i}: ${a}`,n<t.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===h.PiiMasking){let e="";x?.forEach((t,i)=>{e+=t,i<x.length-1&&(e+=", ")}),T.push({title:"Categories",value:e})}return t===h.ErrorSampler&&T.push({title:"Sampling Ratio",value:String($)}),t===h.ProbabilisticSampler&&T.push({title:"Sampling Percentage",value:String(C)}),t===h.LatencySampler&&S?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:a},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${i}\n`,o+=`Fallback Sampling Ratio: ${a}`,T.push({title:"Endpoint"+(S.length>1?` #${n+1}`:""),value:o})}),t===h.ServiceNameSampler&&k?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i},a)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${i}`,T.push({title:"Filter"+(k.length>1?` #${a+1}`:""),value:n})}),t===h.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:a},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${i}\n`;const l=Object.keys(a)[0];o+=`Condition: ${l}\n`,o+=`Operation: ${a[l]?.operation}\n`,o+=`Expected Value: ${a[l]?.expectedValue}`,"jsonCondition"===l&&(o+=`\nJSON Path: ${a[l].jsonPath}`),T.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:o})}),T},Yi=f.PiiCategories,Xi=d.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
gap: 32px;
|
|
@@ -7,45 +7,45 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
7
7
|
border-radius: 32px;
|
|
8
8
|
padding: 8px;
|
|
9
9
|
`}
|
|
10
|
-
`,ai=[{id:"CREDIT_CARD",label:"Credit Card"}],ni=b.FallbackSamplingRatio,li=[{value:g.Pod,id:g.Pod},{value:g.Namespace,id:g.Namespace}],ri=[{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",keyName:"from",placeholder:li[0].value,componentType:"dropdown",options:li,required:!1}],si=[{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",keyName:"from",placeholder:li[0].value,componentType:"dropdown",options:li,required:!1}],ci=b.EndpointsFilters,di=[{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:C.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:C.Number}],ui=b.AttributeNamesToDelete,pi=b.Renames,mi=b.ServicesNameFilters,hi=[{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:C.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:C.Number}],gi=b.SamplingPercentage,yi=b.AttributeFilters,vi=[{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:C.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:N.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:N.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}],fi={[h.K8sAttributes]:({value:t,setValue:i,formErrors:a})=>(o(()=>{t[b.CollectContainerAttributes]||t[b.CollectReplicaSetAttributes]||t[b.CollectWorkloadId]||t[b.CollectClusterId]||t[b.LabelsAttributes]?.length||t[b.AnnotationsAttributes]?.length||(i(b.CollectContainerAttributes,!0),i(b.CollectReplicaSetAttributes,!0),i(b.CollectWorkloadId,!0),i(b.CollectClusterId,!0),i(b.LabelsAttributes,[]),i(b.AnnotationsAttributes,[]))},[]),e.createElement(e.Fragment,null,e.createElement(v,{title:"Collect Container Attributes",value:t[b.CollectContainerAttributes]||!1,onChange:e=>i(b.CollectContainerAttributes,e),errorMessage:a[b.CollectContainerAttributes]}),e.createElement(v,{title:"Collect ReplicaSet Attributes",value:t[b.CollectReplicaSetAttributes]||!1,onChange:e=>i(b.CollectReplicaSetAttributes,e),errorMessage:a[b.CollectReplicaSetAttributes]}),e.createElement(v,{title:"Collect Workload ID",value:t[b.CollectWorkloadId]||!1,onChange:e=>i(b.CollectWorkloadId,e),errorMessage:a[b.CollectWorkloadId]}),e.createElement(v,{title:"Collect Cluster ID",value:t[b.CollectClusterId]||!1,onChange:e=>i(b.CollectClusterId,e),errorMessage:a[b.CollectClusterId]}),e.createElement(w,{columns:ri,value:t[b.LabelsAttributes]||[],onChange:e=>i(b.LabelsAttributes,e),errorMessage:a[b.LabelsAttributes]}),e.createElement(w,{columns:si,value:t[b.AnnotationsAttributes]||[],onChange:e=>i(b.AnnotationsAttributes,e),errorMessage:a[b.AnnotationsAttributes]}))),[h.AddClusterInfo]:({value:t,setValue:o,formErrors:i})=>e.createElement(e.Fragment,null,e.createElement(S,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:t[b.OverwriteExistingValues]||!1,onChange:e=>o(b.OverwriteExistingValues,e)}),e.createElement($,{title:"Resource Attributes",value:t[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:i[b.ClusterAttributes]})),[h.DeleteAttributes]:({value:t,setValue:o,formErrors:i})=>{const a=i[ui],n=t[ui]||[];return e.createElement(D,{title:"Attributes to delete",value:n,onChange:e=>o(ui,e),required:!0,errorMessage:a})},[h.RenameAttributes]:({value:t,setValue:o,formErrors:i})=>{const a=i[pi],n=Object.entries(t[pi]||{}).map(([e,t])=>({key:e,value:t}));return e.createElement($,{title:"Attributes to rename",value:n,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),o(pi,t)},required:!0,errorMessage:a})},[h.PiiMasking]:({value:i,setValue:a,formErrors:n})=>{const l=n[oi],r=i[oi]||[],[s,c]=t(1===r.length);return o(()=>{if(!r.length){const e=ai.map(({id:e})=>e);a(oi,e),c(1===ai.length)}},[]),e.createElement("div",null,e.createElement(y,{title:"Attributes to mask",required:!0}),e.createElement(ii,{$hasError:!!l},ai.map(({id:t,label:o})=>e.createElement(v,{key:t,title:o,disabled:s&&r.includes(t),value:r.includes(t),onChange:e=>((e,t)=>{const o=t?[...r,e]:r.filter(t=>t!==e);a(oi,o),c(1===o.length)})(t,e)}))),!!l&&e.createElement(f,null,l))},[h.ErrorSampler]:({value:t,setValue:o,formErrors:i})=>{const a=i[ni],n=t[ni];return e.createElement(x,{title:"Fallback sampling ratio",required:!0,type:C.Number,min:0,max:100,value:k(n)?"":String(n),onChange:({target:{value:e}})=>{return t=e,o(ni,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[h.ProbabilisticSampler]:({value:t,setValue:o,formErrors:i})=>{const a=i[gi],n=t[gi];return e.createElement(x,{title:"Sampling percentage",required:!0,type:C.Number,min:0,max:100,value:k(n)?"":String(n),onChange:({target:{value:e}})=>{return t=e,o(gi,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[h.LatencySampler]:({value:t,setValue:o,formErrors:i})=>{const a=i[ci],n=t[ci]||[];return e.createElement(w,{columns:di,value:n,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(o),fallbackSamplingRatio:Number(i)}));o(ci,t)},errorMessage:a})},[h.ServiceNameSampler]:({value:t,setValue:o,formErrors:i})=>{const a=i[mi],n=t[mi]||[];return e.createElement(w,{columns:hi,value:n,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(o)}));o(mi,t)},errorMessage:a})},[h.SpanAttributeSampler]:({value:t,setValue:o,formErrors:i})=>{const a=i[yi],n=(t[yi]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i})=>{const a=Object.entries(i).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:a,operation:i[a]?.operation,expectedValue:i[a]?.expectedValue,jsonPath:i[a]?.jsonPath}});return e.createElement(w,{columns:vi,value:n,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i,operation:a,expectedValue:n,jsonPath:l})=>{const r={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(o),condition:{[i]:{operation:a,expectedValue:n}}};return l&&(r.condition[i].jsonPath=l),r});o(yi,t)},errorMessage:a,limitFieldsPerRow:3})}},bi=({actionType:t,value:o,setValue:i,formErrors:a})=>{if(!t)return null;const n=fi[t];return n?e.createElement(n,{value:o,setValue:i,formErrors:a}):null},xi=d.div`
|
|
10
|
+
`,Zi=[{id:"CREDIT_CARD",label:"Credit Card"}],Qi=f.FallbackSamplingRatio,ea=[{value:g.Pod,id:g.Pod},{value:g.Namespace,id:g.Namespace}],ta=[{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",keyName:"from",placeholder:ea[0].value,componentType:"dropdown",options:ea,required:!1}],ia=[{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",keyName:"from",placeholder:ea[0].value,componentType:"dropdown",options:ea,required:!1}],aa=f.EndpointsFilters,na=[{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:$.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:$.Number}],oa=f.AttributeNamesToDelete,la=f.Renames,ra=f.ServicesNameFilters,sa=[{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:$.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:$.Number}],ca=f.SamplingPercentage,da=f.AttributeFilters,ua=[{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:$.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:D.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:D.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}],pa={[h.K8sAttributes]:({value:t,setValue:a,formErrors:n})=>(i(()=>{t[f.CollectContainerAttributes]||t[f.CollectReplicaSetAttributes]||t[f.CollectWorkloadId]||t[f.CollectClusterId]||t[f.LabelsAttributes]?.length||t[f.AnnotationsAttributes]?.length||(a(f.CollectContainerAttributes,!0),a(f.CollectReplicaSetAttributes,!0),a(f.CollectWorkloadId,!0),a(f.CollectClusterId,!0),a(f.LabelsAttributes,[]),a(f.AnnotationsAttributes,[]))},[]),e.createElement(e.Fragment,null,e.createElement(v,{title:"Collect Container Attributes",value:t[f.CollectContainerAttributes]||!1,onChange:e=>a(f.CollectContainerAttributes,e),errorMessage:n[f.CollectContainerAttributes]}),e.createElement(v,{title:"Collect ReplicaSet Attributes",value:t[f.CollectReplicaSetAttributes]||!1,onChange:e=>a(f.CollectReplicaSetAttributes,e),errorMessage:n[f.CollectReplicaSetAttributes]}),e.createElement(v,{title:"Collect Workload ID",value:t[f.CollectWorkloadId]||!1,onChange:e=>a(f.CollectWorkloadId,e),errorMessage:n[f.CollectWorkloadId]}),e.createElement(v,{title:"Collect Cluster ID",value:t[f.CollectClusterId]||!1,onChange:e=>a(f.CollectClusterId,e),errorMessage:n[f.CollectClusterId]}),e.createElement(S,{columns:ta,value:t[f.LabelsAttributes]||[],onChange:e=>a(f.LabelsAttributes,e),errorMessage:n[f.LabelsAttributes]}),e.createElement(S,{columns:ia,value:t[f.AnnotationsAttributes]||[],onChange:e=>a(f.AnnotationsAttributes,e),errorMessage:n[f.AnnotationsAttributes]}))),[h.AddClusterInfo]:({value:t,setValue:i,formErrors:a})=>e.createElement(e.Fragment,null,e.createElement(k,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:t[f.OverwriteExistingValues]||!1,onChange:e=>i(f.OverwriteExistingValues,e)}),e.createElement(w,{title:"Resource Attributes",value:t[f.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>i(f.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:a[f.ClusterAttributes]})),[h.DeleteAttributes]:({value:t,setValue:i,formErrors:a})=>{const n=a[oa],o=t[oa]||[];return e.createElement(T,{title:"Attributes to delete",value:o,onChange:e=>i(oa,e),required:!0,errorMessage:n})},[h.RenameAttributes]:({value:t,setValue:i,formErrors:a})=>{const n=a[la],o=Object.entries(t[la]||{}).map(([e,t])=>({key:e,value:t}));return e.createElement(w,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),i(la,t)},required:!0,errorMessage:n})},[h.PiiMasking]:({value:a,setValue:n,formErrors:o})=>{const l=o[Yi],r=a[Yi]||[],[s,c]=t(1===r.length);return i(()=>{if(!r.length){const e=Zi.map(({id:e})=>e);n(Yi,e),c(1===Zi.length)}},[]),e.createElement("div",null,e.createElement(y,{title:"Attributes to mask",required:!0}),e.createElement(Xi,{$hasError:!!l},Zi.map(({id:t,label:i})=>e.createElement(v,{key:t,title:i,disabled:s&&r.includes(t),value:r.includes(t),onChange:e=>((e,t)=>{const i=t?[...r,e]:r.filter(t=>t!==e);n(Yi,i),c(1===i.length)})(t,e)}))),!!l&&e.createElement(b,null,l))},[h.ErrorSampler]:({value:t,setValue:i,formErrors:a})=>{const n=a[Qi],o=t[Qi];return e.createElement(x,{title:"Fallback sampling ratio",required:!0,type:$.Number,min:0,max:100,value:C(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(Qi,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[h.ProbabilisticSampler]:({value:t,setValue:i,formErrors:a})=>{const n=a[ca],o=t[ca];return e.createElement(x,{title:"Sampling percentage",required:!0,type:$.Number,min:0,max:100,value:C(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(ca,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[h.LatencySampler]:({value:t,setValue:i,formErrors:a})=>{const n=a[aa],o=t[aa]||[];return e.createElement(S,{columns:na,value:o,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:a})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(i),fallbackSamplingRatio:Number(a)}));i(aa,t)},errorMessage:n})},[h.ServiceNameSampler]:({value:t,setValue:i,formErrors:a})=>{const n=a[ra],o=t[ra]||[];return e.createElement(S,{columns:sa,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i(ra,t)},errorMessage:n})},[h.SpanAttributeSampler]:({value:t,setValue:i,formErrors:a})=>{const n=a[da],o=(t[da]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:a})=>{const n=Object.entries(a).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n,operation:a[n]?.operation,expectedValue:a[n]?.expectedValue,jsonPath:a[n]?.jsonPath}});return e.createElement(S,{columns:ua,value:o,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:a,operation:n,expectedValue:o,jsonPath:l})=>{const r={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(i),condition:{[a]:{operation:n,expectedValue:o}}};return l&&(r.condition[a].jsonPath=l),r});i(da,t)},errorMessage:n,limitFieldsPerRow:3})}},ma=({actionType:t,value:i,setValue:a,formErrors:n})=>{if(!t)return null;const o=pa[t];return o?e.createElement(o,{value:i,setValue:a,formErrors:n}):null},ha=d.div`
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
gap: 24px;
|
|
14
14
|
padding: 4px;
|
|
15
|
-
`,
|
|
15
|
+
`,ga=d(N)`
|
|
16
16
|
margin-bottom: 12px;
|
|
17
|
-
`,
|
|
17
|
+
`,ya=({isUpdate:t,action:i,formData:a,formErrors:n,handleFormChange:o})=>{const l=E.useTheme();return e.createElement(ha,null,t&&e.createElement("div",null,e.createElement(ga,null,"Status"),e.createElement(O,{options:[{icon:vi,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+E.opacity.hex["050"]},{icon:bi,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+E.opacity.hex["050"]}],selected:a.disabled,setSelected:e=>o("disabled",e)})),!t&&e.createElement(F,{title:"",description:i.docsDescription,actionButton:e.createElement(I,{endpoint:i.docsEndpoint})}),e.createElement(A,{title:"Signals for Processing",required:!0,allowedSignals:i.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>o("signals",e),errorMessage:n.signals}),!t&&e.createElement(x,{title:"Action name",placeholder:"Use a name that describes the action",value:a.name||"",onChange:({target:{value:e}})=>o("name",e),errorMessage:n.name}),e.createElement(ma,{actionType:i.type,value:a.fields,setValue:(e,t)=>o(`fields.${e}`,t),formErrors:n}),e.createElement(M,{title:"Notes",value:a.notes||"",onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},va=a(({children:i,width:a=640,title:r,titleTooltip:s,hideEditTitleFromEdit:c,icons:d,iconSrcs:u,isEdit:p=!1,isFormDirty:m=!1,isLastItem:h=!1,onClose:g,onEdit:y,onSave:v,onDelete:b,onCancel:f,tabs:x,headerActionButtons:$},C)=>{const S=E.useTheme(),{isThisPending:k}=R(),{addNotification:w}=L(),{drawerType:T,drawerEntityId:D,setDrawerType:O,setDrawerEntityId:F}=P();K({key:"Enter",active:p},()=>Q());const[I,A]=t(!1),[M,W]=t(!1),_=n(null),J=T===H.Source,U=()=>{A(!1),W(!1)},G=()=>{U(),y&&y(!1),O(null),F(null),g?.()};o(C,()=>({closeDrawer:G}));const Y=()=>{_.current?.clearTitle(),f&&f(),U()},X=()=>{const e=_.current?.isTitleDirty();m||e?W(!0):Y()},Z=()=>{A(!0)},Q=()=>{v&&v(_.current?.getTitle()||"")},ee=l(()=>!!T&&k({entityType:T,entityId:D}),[T,D]),te=e=>{w({type:B.Warning,title:"Pending",message:`Cannot click ${e}, ${T} is pending`,hideFromHistory:!0})},ie=$||[];return y&&!p&&ie.push({"data-id":"drawer-edit",variant:"tertiary",onClick:ee?()=>te("edit"):()=>y(!0),children:e.createElement(e.Fragment,null,e.createElement(fi,null),e.createElement(N,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),b&&!p&&ie.push({"data-id":"drawer-delete",variant:"tertiary",onClick:ee?()=>te(J?"uninstrument":"delete"):Z,children:e.createElement(e.Fragment,null,e.createElement(xi,null),e.createElement(N,{color:S.text.error,size:14,family:"secondary",decoration:"underline"},J?j.UNINSTRUMENT:j.DELETE))}),e.createElement(e.Fragment,null,e.createElement(V,{isOpen:!0,onClose:p?X:G,closeOnEscape:!I&&!M,width:`${a+64}px`,header:{icons:d,iconSrcs:u,title:r,titleTooltip:s,replaceTitleWith:!c&&p?e.createElement(ba,{ref:_,title:r}):void 0,actionButtons:ie,tabs:x},footer:{isOpen:p,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:Q,children:j.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:X,children:j.CANCEL}],rightButtons:b?[{"data-id":"drawer-delete",variant:"tertiary",onClick:Z,children:e.createElement(e.Fragment,null,e.createElement(xi,null),e.createElement(N,{size:14,color:S.text.error,family:"secondary",decoration:"underline"},j.DELETE))}]:[]}},i),e.createElement(q,{isOpen:I,noOverlay:!0,name:`${T}${r?` (${r})`:""}`,type:T,isLastItem:h,onApprove:()=>{b&&b(),U()},onDeny:U}),e.createElement(z,{isOpen:M,noOverlay:!0,name:"edit mode",onApprove:Y,onDeny:U}))}),ba=a(({title:a},n)=>{const[l,r]=t(a);return i(()=>{r(a)},[a]),o(n,()=>({getTitle:()=>l||a,isTitleDirty:()=>l!==a,clearTitle:()=>r(a)})),e.createElement(x,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});ba.displayName=ba.name,va.displayName=va.name;const fa=d.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
|
+
`,xa=d.div`
|
|
24
24
|
display: flex;
|
|
25
25
|
flex-direction: column;
|
|
26
26
|
gap: 12px;
|
|
27
|
-
|
|
27
|
+
`,$a=({updateAction:i,deleteAction:a})=>{const{actions:o}=W(),{drawerType:r,drawerEntityId:s}=P(),c=n(null),d=r!==H.Action,[u,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:b,resetFormData:f,validateForm:x,loadFormWithDrawerItem:$}=_(),C=l(()=>{if(d)return f();const e=o?.find(e=>e.id===s);return e?$(e):f(),e},[d,s,o]);if(!C)return null;const S=J.find(({type:e})=>e===C.type)||J.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===C.type)||J.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===C.type);return e.createElement(va,{ref:c,title:C.name||C.type,icons:[U(C.type)],isEdit:u,isFormDirty:h,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if(x({withAlert:!0,alertTitle:X.Update})){const t=e!==C.type?e:"";b("name",t),i(s,{...y,name:t}),m(!1),g(!1)}},onDelete:()=>{a(s,C.type),m(!1),g(!1),c.current?.closeDrawer()},onCancel:()=>{m(!1),g(!1),$(C)}},u&&S?e.createElement(fa,null,e.createElement(ya,{isUpdate:!0,action:S,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),b(...e)}})):e.createElement(xa,null,e.createElement(G,{conditions:C.conditions||[]}),e.createElement(Y,{title:p.ACTION_DETAILS,data:C?Gi(C):[]})))},Ca=d(Z)`
|
|
28
28
|
margin-top: 24px;
|
|
29
29
|
gap: 12px;
|
|
30
|
-
`,
|
|
30
|
+
`,Sa=({createAction:i})=>{const{currentModal:a,setCurrentModal:n}=Q(),o=a===H.Action,{formData:l,formErrors:r,handleFormChange:s,resetFormData:c,validateForm:d}=_(),[u,m]=t(void 0),h=()=>{c(),m(void 0),n("")},g=()=>{if(!d({withAlert:!0,alertTitle:X.Create}))return null;i(l),h()};return K({key:"Enter",active:o},()=>g()),e.createElement(ee,{isOpen:o,onClose:h,header:{title:"Add Action"},actionComponent:e.createElement(te,{buttons:[{variant:"primary",label:"DONE",onClick:g,disabled:!u}]})},e.createElement(ie,null,e.createElement(F,{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.createElement(Ca,null,e.createElement(ae,{type:B.Warning,message:ne.DEFINED_FOR_ALL_STREAMS(p.ACTIONS)}),e.createElement(oe,{options:J,selectedOption:u,onOptionSelect:e=>{return t=e,c(),s("type",t?.type||""),void m(t);var t},autoFocus:!u?.type})),u?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(ya,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},ka=e=>{const{type:t,fields:{collectContainerAttributes:i,collectReplicaSetAttributes:a,collectWorkloadId:n,collectClusterId:o,labelsAttributes:l,annotationsAttributes:r,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:y,endpointsFilters:v,attributeFilters:b,servicesNameFilters:f}}=e;let x="";if(t===h.K8sAttributes&&(i&&(x+="Container Attributes, "),a&&(x+="ReplicaSet Attributes, "),n&&(x+="Workload ID, "),o&&(x+="Cluster ID, "),l?.forEach(({labelKey:e,attributeKey:t,from:i},a)=>{x+=`Label: ${e} ${t} ${i||g.Pod} `,a===l.length-1&&(x+=", ")}),r?.forEach(({annotationKey:e,attributeKey:t,from:i},a)=>{x+=`Annotation: ${e} ${t} ${i||g.Pod} `,a===r.length-1&&(x+=", ")})),t===h.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},i)=>{x+=`${e}: ${t}`,i<s.length-1&&(x+=", ")})),t===h.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===h.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,i],a)=>{x+=`${t}: ${i}`,a<e.length-1&&(x+=", ")})}return t===h.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===h.ErrorSampler&&(x+=String(m)),t===h.ProbabilisticSampler&&(x+=String(y),x+="%"),t===h.LatencySampler&&v?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:a},n)=>{x+=`Endpoint${v.length>1?` #${n+1}`:""}=${e}${t}\n`,x+=` Latency=${i}`,x+=` Sampling=${a}`,n<v.length-1&&(x+=", ")}),t===h.ServiceNameSampler&&f?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),t===h.SpanAttributeSampler&&b?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),x},wa=({conditions:t,id:i})=>{const{errors:a,warnings:n,disableds:o,hasLoadings:r}=l(()=>re(t),[t]),s=a.length>0?a:n.length>0?n:o.length>0?o:[];if(s.length>0)return e.createElement("div",{style:{lineHeight:1}},e.createElement(Ta,{conditions:s,id:i}));const c=r?pe.Loading:B.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:c,title:c,withBorder:!0,withIcon:!0}))},Ta=({conditions:t,id:i})=>{const a=E.useTheme();return e.createElement(ce,null,de(t).map(({status:t,type:n,reason:o,message:l,lastTransitionTime:r},s)=>{"loading"!==t&&"disabled"!==t||(t=B.Info);const c=me(t,a);return e.createElement(ue,{key:`condition-${i}-${t}-${n}-${s}`,titleIcon:c,title:n,text:l||o||"",timestamp:r},e.createElement(se,{status:t,title:o||n,withBorder:!0,withIcon:!0}))}))},Da=({instrumentationRules:e,sources:t,actions:i,destinations:a,searchText:n,selectedCategory:o})=>{const l=n?e.filter(e=>e.type?.toLowerCase().includes(n)||e.ruleName?.toLowerCase().includes(n)):e,r=n?t.filter(e=>e.name?.toLowerCase().includes(n)||e.otelServiceName?.toLowerCase().includes(n)||e.namespace?.toLowerCase().includes(n)):t,s=n?i.filter(e=>e.type?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):i,c=n?a.filter(e=>e.destinationType.displayName?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):a,d=[{category:H.Source,label:"Sources",count:r.length,entities:[]},{category:H.Action,label:"Actions",count:s.length,entities:[]},{category:H.Destination,label:"Destinations",count:c.length,entities:[]},{category:H.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.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===H.InstrumentationRule?l:e.category===H.Source?r:e.category===H.Action?s:e.category===H.Destination?c:[]}));return{categories:d,searchResults:u}},Na=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],Ea=({maxHeight:t,maxWidth:i})=>{const a=E.useTheme(),n=he(),{actions:o,actionsLoading:r}=W(),{setDrawerType:s,setDrawerEntityId:c}=P(),d=l(()=>Da({instrumentationRules:[],sources:[],actions:ge(o,n),destinations:[],searchText:n.searchText,selectedCategory:H.Action}).searchResults.find(({category:e})=>e===H.Action)?.entities||[],[o,n]),u=l(()=>d.map(t=>{const{hasErrors:i,hasWarnings:n,hasDisableds:o}=re(t.conditions||[]);return{status:i?B.Error:n?B.Warning:void 0,faded:o,onClick:()=>{s(H.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:U(t.type)})},{columnKey:"name",value:ve(t,H.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:a.text.info},{columnKey:"notes",value:t.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:ka(t),textColor:a.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(be,{withLabels:!0,monitors:t.signals||[]})},{columnKey:"conditions",component:()=>e.createElement(wa,{conditions:t.conditions||[],id:t.id})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?B.Error:B.Success,title:t.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[d]),{badge:m,badgeTooltip:h}=l(()=>d.length!==o.length?{badge:`${d.length}/${o.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:o.length,badgeTooltip:void 0},[d,o]);return e.createElement(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement($e,{icon:Ce(H.Action),title:p.ACTIONS,badge:m,badgeTooltip:h,loading:r})),e.createElement(Se,{$maxHeight:t},e.createElement(ke,{columns:Na,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(Te,null)))},Oa=d(Z)`
|
|
31
31
|
// width: 100vw;
|
|
32
32
|
// height: 100vh;
|
|
33
33
|
gap: 64px;
|
|
34
34
|
align-items: center;
|
|
35
35
|
justify-content: center;
|
|
36
|
-
`,
|
|
36
|
+
`,Fa=d(Z)`
|
|
37
37
|
max-width: 400px;
|
|
38
38
|
gap: 12px;
|
|
39
39
|
align-items: center;
|
|
40
40
|
justify-content: center;
|
|
41
|
-
`,
|
|
41
|
+
`,Ia=d(N)`
|
|
42
42
|
text-align: center;
|
|
43
43
|
font-size: 24px;
|
|
44
|
-
`,
|
|
44
|
+
`,Aa=d(N)`
|
|
45
45
|
text-align: center;
|
|
46
46
|
line-height: 26px;
|
|
47
47
|
color: ${({theme:e})=>e.text.info};
|
|
48
|
-
`,
|
|
48
|
+
`,Ma=()=>{const[a,n]=t(0);return i(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ee(500),n(e)})()},[]),e.createElement(Oa,null,e.createElement($i,{size:100}),e.createElement(De,{width:400}),e.createElement(Fa,null,e.createElement(ce,{$gap:16},e.createElement(Ia,null,"Preparing your workspace..."),e.createElement(Ne,{label:`${a}%`})),e.createElement(Aa,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},Ra=d(Z)`
|
|
49
49
|
align-items: center !important;
|
|
50
50
|
justify-content: center !important;
|
|
51
51
|
align-self: stretch;
|
|
@@ -61,9 +61,9 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
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+E.opacity.hex["030"]};
|
|
65
65
|
}
|
|
66
|
-
`,
|
|
66
|
+
`,La=({entityType:t,description:i})=>{const{setCurrentModal:a}=Q(),{isThisPending:n}=R(),o=n({entityType:t});return e.createElement(Ra,{onClick:()=>a(t)},e.createElement(ce,{$gap:4},e.createElement(Ci,null),o?e.createElement(Oe,{size:14,weight:600,family:"secondary"},"Adding ",t):e.createElement(N,{size:14,weight:600,family:"secondary",decoration:"underline"},"Add ",t)),e.createElement(N,{size:12,align:"center"},o?"Just a few more seconds...":i))},Pa=d.div`
|
|
67
67
|
position: relative;
|
|
68
68
|
width: 100%;
|
|
69
69
|
padding: 12px 0;
|
|
@@ -71,13 +71,13 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
71
71
|
display: flex;
|
|
72
72
|
align-items: center;
|
|
73
73
|
border-bottom: 1px solid ${({theme:e})=>e.colors.border};
|
|
74
|
-
`,
|
|
74
|
+
`,Ka=d(ce)`
|
|
75
75
|
margin-left: ${({$marginLeft:e})=>e};
|
|
76
|
-
`,
|
|
76
|
+
`,ja=d(Fe)`
|
|
77
77
|
width: 24px;
|
|
78
78
|
height: 24px;
|
|
79
79
|
padding: 0;
|
|
80
|
-
`,
|
|
80
|
+
`,Va=d.div`
|
|
81
81
|
position: absolute;
|
|
82
82
|
bottom: -2px;
|
|
83
83
|
left: 0;
|
|
@@ -86,7 +86,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
86
86
|
height: 4px;
|
|
87
87
|
width: ${({percent:e})=>`${e}%`};
|
|
88
88
|
transition: width 0.3s;
|
|
89
|
-
`,
|
|
89
|
+
`,qa=({entityType:t,badge:i,badgeTooltip:a,isLoading:n})=>{const o=E.useTheme(),{sources:r}=W(),{isThisPending:s}=R(),{setCurrentModal:c}=Q(),{selectedSources:d,setSelectedSources:u}=Ie(),{isAwaitingInstrumentation:p,sourcesToCreate:m,sourcesCreated:h,sourcesToDelete:g,sourcesDeleted:y}=Ae(),b=Ce(t),f=t===H.Source&&p,x=(m?Math.floor(100/m*h):g?Math.floor(100/g*y):0)||1,[$,C]=l(()=>{let e=0;return Object.values(d).forEach(t=>e+=t.length),[0!==e,e]},[d]);return e.createElement(Pa,null,t===H.Source&&e.createElement(Ka,{$marginLeft:"28px"},e.createElement(v,{partiallyChecked:$&&r?.length!==C,value:$&&r?.length===C,onChange:e=>{if(e){const e={};r?.forEach(t=>{const i={namespace:t.namespace,name:t.name,kind:t.kind};s({entityType:H.Source,entityId:i})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),u(e)}else u({})},disabled:!r?.length})),e.createElement(Ka,{$marginLeft:t===H.Source?"0":"28px"},e.createElement($e,{icon:b,title:`${t}s`,badge:f?`${x}%`:i,badgeTooltip:a,loading:n&&!f})),e.createElement(Ka,{$marginLeft:"auto"},e.createElement(ja,{"data-id":`add-${t}`,variant:"primary",onClick:()=>c(t)},e.createElement(Ci,{fill:o.colors.primary,size:18}))),f&&e.createElement(Va,{percent:x}))},za=d.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 e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
101
101
|
align-items: center;
|
|
102
102
|
justify-content: center;
|
|
103
103
|
white-space: nowrap;
|
|
104
|
-
`,
|
|
104
|
+
`,Ha=({entityId:t,entityType:i,status:a,faded:n,title:o,subTitle:l,label:r,icon:s,icons:c,iconSrc:d,iconSrcs:u,monitors:p,isActive:m,raw:h})=>{const g=E.useTheme(),y=i===H.Source,v="boolean"==typeof m,{setDrawerType:b,setDrawerEntityId:f}=P(),{isThisPending:x}=R(),$=x({entityType:i,entityId:t}),{selectedSources:C,setSelectedSources:S}=Ie(),k={...C},{namespace:w,name:T,kind:D}=h;y&&!k[w]&&(k[w]=[]);const N=y?k[w].findIndex(e=>e.name===T&&e.kind===D):-1;return e.createElement(Me,{"data-id":i===H.Source?`${t.namespace}-${t.name}-${t.kind}`:t,title:o,subTitle:l,onClick:()=>{b(i),f(t)},renderActions:()=>{const t=y&&(!h.conditions?.length||h.conditions?.some(({status:e})=>"loading"===e)),i=v&&!m?me(B.Info,g):a?me(a,g):void 0,n=$||t?e.createElement(Re,{scale:.8}):i?e.createElement(i,{size:14}):null;return r?e.createElement(za,{$isError:a===B.Error},e.createElement(ue,{text:"Heads up! The data-flow metrics you see are calculated over 10-second intervals."},r),n):n||null},iconProps:{icon:s,icons:c,iconSrc:d,iconSrcs:u},visualProps:{status:a,faded:n||v&&!m,monitors:p||void 0},checkboxProps:{withCheckbox:y,isChecked:-1!==N,onCheckboxChange:()=>{-1===N?k[w].push(h):k[w].splice(N,1),S(k)},isCheckboxDisabled:$}})},Ba=d.div`
|
|
105
105
|
height: calc(${({$height:e})=>e}px - 24px);
|
|
106
106
|
width: calc(100% - 24px);
|
|
107
107
|
padding: 12px;
|
|
@@ -109,7 +109,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
109
109
|
border: 1px dashed ${({theme:e})=>e.colors.border};
|
|
110
110
|
border-radius: 24px;
|
|
111
111
|
position: relative;
|
|
112
|
-
`,
|
|
112
|
+
`,Wa=d.div`
|
|
113
113
|
position: absolute;
|
|
114
114
|
bottom: 0;
|
|
115
115
|
left: 0;
|
|
@@ -124,20 +124,20 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
124
124
|
justify-content: center;
|
|
125
125
|
|
|
126
126
|
pointer-events: none;
|
|
127
|
-
`,
|
|
127
|
+
`,_a=({height:t,entityType:i,entities:a,metrics:n,isVm:o})=>{const r=l(()=>a.map(t=>{const a=Le(t);if(!a)return null;const l=[H.Source,H.Destination].includes(i),r=[H.Destination,H.Action].includes(i),s=[H.Destination,H.Action,H.InstrumentationRule].includes(i),c=r?i==H.Destination?Pe(t.exportedSignals):t.signals:void 0,d=l?n?.[`${i.toLowerCase()}s`]?.find(e=>JSON.stringify(Le(e))===JSON.stringify(a)):void 0,u=s?!t.disabled:void 0,p=ve(t,i,{extended:i===H.Source,prioritizeDisplayName:i!==H.Source}),m=((e,t,i)=>{switch(e){case H.Source:return i?`${t.kind}`:`${t.namespace} • ${t.kind}`;case H.Destination:return t.destinationType.displayName;case H.Action:case H.InstrumentationRule:return t.type;default:return""}})(i,t,o),h=l?Ke(d?.throughput):void 0,{priorotizedStatus:g,hasDisableds:y}=re(t.conditions||[]),{icons:v,icon:b,iconSrc:f}=((e,t)=>{switch(e){case H.Source:return{icons:ze(t.containers),icon:Ce(e)};case H.Destination:return qe(t.destinationType.type);case H.Action:return{icon:U(t.type)};case H.InstrumentationRule:return{icon:Ve(t.type)};default:return{icon:Ce(e)}}})(i,t);return e.createElement(Ha,{key:JSON.stringify(a),entityType:i,entityId:a,raw:t,title:p,subTitle:m,faded:y,status:g,label:h,icons:v,icon:b,iconSrc:f,monitors:c,isActive:u})}),[a,i,n,o]);return e.createElement(Ba,{$height:t},e.createElement(je,{containerHeight:t-24,elementHeight:80,elements:r}),e.createElement(Wa,{$hide:!0}))},Ja=d.div`
|
|
128
128
|
width: ${({$isVm:e})=>e?"45vw":"22vw"};
|
|
129
129
|
|
|
130
130
|
display: flex;
|
|
131
131
|
flex-direction: column;
|
|
132
132
|
gap: 12px;
|
|
133
|
-
`,
|
|
133
|
+
`,Ua=({entityType:t,entities:i,unfilteredCount:a,metrics:n,loading:o,maxHeight:l,isVm:r})=>{const s=i.length!==a,c=Math.min(l,80*i.length+12);return r&&[H.InstrumentationRule,H.Action].includes(t)?null:e.createElement(Ja,{$isVm:r},e.createElement(qa,{entityType:t,badge:s?`${i.length}/${a}`:a,badgeTooltip:s?p.FILTERED_COUNT_TOOLTIP:void 0,isLoading:o}),i.length?e.createElement(_a,{height:c,entityType:t,entities:i,metrics:n,isVm:r}):o?e.createElement(He,{size:3}):e.createElement(La,{entityType:t,description:p.TO_COLLECT_OTEL_DATA}))},Ga=d.div`
|
|
134
134
|
width: 100%;
|
|
135
135
|
height: ${({$height:e})=>e};
|
|
136
136
|
|
|
137
137
|
display: flex;
|
|
138
138
|
justify-content: space-evenly;
|
|
139
139
|
gap: 24px;
|
|
140
|
-
`,
|
|
140
|
+
`,Ya=({height:a,metrics:n})=>{const{isVm:o}=Be(),l=he(),{selectedStreamName:r}=We(),{containerRef:s,containerHeight:c}=_e(),{sources:d,sourcesLoading:u,destinations:p,destinationsLoading:m,actions:h,actionsLoading:g,instrumentationRules:y,instrumentationRulesLoading:v}=W(),[b,f]=t([]),[x,$]=t([]),[C,S]=t([]),[k,w]=t([]);return i(()=>{f(Je(Ue(d,r),l))},[d,r,l]),i(()=>{$(Ge(Ye(p,r),l))},[p,r,l]),i(()=>{S(ge(h,l))},[h,l]),i(()=>{w(y)},[y]),e.createElement(Ga,{ref:s,$height:a},e.createElement(Ua,{entityType:H.InstrumentationRule,entities:k,unfilteredCount:y.length,loading:v,maxHeight:c,isVm:o}),e.createElement(Ua,{entityType:H.Source,entities:b,unfilteredCount:d.length,metrics:n,loading:u,maxHeight:c,isVm:o}),e.createElement(Ua,{entityType:H.Action,entities:C,unfilteredCount:h.length,loading:g,maxHeight:c,isVm:o}),e.createElement(Ua,{entityType:H.Destination,entities:x,unfilteredCount:p.length,metrics:n,loading:m,maxHeight:c,isVm:o}))},Xa=d.div`
|
|
141
141
|
position: relative;
|
|
142
142
|
max-width: 200px;
|
|
143
143
|
`;d.div`
|
|
@@ -151,65 +151,65 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
151
151
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
152
152
|
border: ${({theme:e})=>`1px solid ${e.colors.border}`};
|
|
153
153
|
border-radius: 24px;
|
|
154
|
-
`;const
|
|
154
|
+
`;const Za=d.div`
|
|
155
155
|
display: flex;
|
|
156
156
|
align-items: center;
|
|
157
157
|
overflow-x: scroll;
|
|
158
|
-
`,
|
|
158
|
+
`,Qa=({onClose:a})=>{const n=E.useTheme(),{onClickNode:o}=Xe(),{searchText:s}=he(),{selectedStreamName:c}=We(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=W(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=Ze();i(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:$,searchResults:C}=l(()=>Da({instrumentationRules:m,sources:Ue(d,c),actions:p,destinations:Ye(u,c),searchText:s,selectedCategory:f}),[m,d,p,u,c,s,f]);return C.length?e.createElement(Qe,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(Za,null,$.map(({category:t,label:i,count:a})=>!!a&&e.createElement(et,{key:`category-select-${t}`,label:i,badgeLabel:a,isSelected:f===t,onClick:()=>x(t)})))},C.map(({category:t,label:i,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(tt,{style:{maxHeight:"all"!==f?"240px":"140px",padding:"12px 0"}},e.createElement(N,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},i),l.map((i,n)=>e.createElement(et,{key:`entity-${s}-${n}`,icon:Ce(t),label:ve(i,t,{extended:!0}),onClick:()=>{const e=Le(i);o(null,{data:{type:t,id:e}}),a()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(le,{thickness:s===C.length-1?0:1,length:"90%",margin:"8px auto"})))):e.createElement(Qe,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(Te,null))},en=({preventPopup:i=!1})=>{const{searchText:a,setSearchText:o}=he(),[l,r]=t(!1),s=!!a||l,c=()=>{o(""),r(!1)},d=n(null);return it(d,c),K({key:"Escape",active:s},c),e.createElement(Xa,{ref:d},e.createElement(x,{placeholder:"Search",icon:Si,value:a,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!i?e.createElement(Qa,{onClose:c}):null)},tn=({sources:t,title:i="Condition",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({conditions:t})=>{t?.forEach(({type:t,reason:i})=>{e.find(e=>e.id===`${t}#${i}`)||e.push({id:`${t}#${i}`,value:`${at(t)} - ${at(i)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(nt,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},an=({sources:t,title:i="Error Message",value:a,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({conditions:t})=>{de(t||[]).forEach(({status:t,message:i,reason:a})=>{t!==B.Error||e.find(e=>e.id===i)||(i?e.find(e=>e.id===i)||e.push({id:i,value:i}):a&&(e.find(e=>e.id===a)||e.push({id:a,value:a})))})}),e},[t]);return e.createElement(nt,{disabled:r||!c?.length,title:i,placeholder:"All",options:c,value:a,onSelect:n,onDeselect:o,...s})},nn=({sources:t,title:i="Programming Language",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({containers:t})=>{t?.forEach(({language:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:ot[t]||t})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(nt,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},on=({title:t="Monitors",value:i,onSelect:a,onDeselect:n,...o})=>{const r=l(()=>{const e=[];return lt.forEach(({id:t,value:i})=>{e.find(e=>e.id===t)||e.push({id:t,value:i})}),e},[]);return e.createElement(nt,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:i,onSelect:a,onDeselect:n,...o})},ln=({namespaces:t,title:i="Namespace",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t?.forEach(({name:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(nt,{disabled:!s?.length,title:i,placeholder:"Select namespace",options:s,value:a,onSelect:n,onDeselect:o,...r})},rn=({sources:t,title:i="Kind",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({kind:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(nt,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},sn=d.div`
|
|
159
159
|
display: flex;
|
|
160
160
|
flex-direction: column;
|
|
161
161
|
gap: 12px;
|
|
162
162
|
padding: 12px;
|
|
163
|
-
`,
|
|
163
|
+
`,cn=d.div`
|
|
164
164
|
padding: 12px 6px 6px 6px;
|
|
165
|
-
`,
|
|
165
|
+
`,dn=d(Fe)`
|
|
166
166
|
font-size: 14px;
|
|
167
167
|
${({$color:e})=>`color: ${e};`}
|
|
168
|
-
`,
|
|
168
|
+
`,un=d.div`
|
|
169
169
|
margin-left: auto;
|
|
170
|
-
`,
|
|
170
|
+
`,pn=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},mn=()=>{const a=E.useTheme(),{isVm:o}=Be(),{namespaces:r,sources:s}=W(),{selectedStreamName:c}=We(),{getItemSS:d,setItemSS:u,removeItemSS:p}=st(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=Ze(),{namespaces:b,kinds:f,monitors:x,languages:$,conditions:C,errors:S,onlyErrors:w,setAll:T,clearAll:D,getEmptyState:N}=he(),O=l(()=>Ue(s,c),[s,c]),[F,I]=t({namespaces:b,kinds:f,monitors:x,languages:$,conditions:C,errors:S,onlyErrors:w}),[A,M]=t(pn(F));i(()=>{const e=d(rt.OVERVIEW_FILTERS,N());T(e)},[]),i(()=>{if(!h){const e={namespaces:b,kinds:f,monitors:x,languages:$,conditions:C,errors:S,onlyErrors:w};I(e),M(pn(e))}},[h,b,f,x,$,C,S,w]);const R=()=>{g(!1)},L=n(null);return it(L,R),K({key:"Escape",active:h},R),e.createElement(Xa,{ref:L},e.createElement(et,{label:"Filters",icon:ki,badgeLabel:A,badgeFilled:!!A,withBorder:!0,color:"transparent",onClick:()=>{v(0,50),g(!0)}}),e.createElement(Qe,{ref:m,isOpen:h,top:y.top,left:y.left,width:"420px",footer:e.createElement(ce,null,e.createElement(dn,{variant:"primary",onClick:()=>{u(rt.OVERVIEW_FILTERS,F),T(F),M(pn(F)),g(!1)}},"Apply"),e.createElement(dn,{variant:"secondary",onClick:R},"Cancel"),e.createElement(un,null,e.createElement(dn,{variant:"tertiary",onClick:()=>{p(rt.OVERVIEW_FILTERS),D(),I(N()),M(0),g(!1)},$color:a.text.error},"Reset")))},e.createElement(sn,null,!o&&e.createElement(ln,{namespaces:r,value:F.namespaces,onSelect:e=>I(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>I(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(rn,{sources:O,value:F.kinds,onSelect:e=>I(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>I(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(nn,{sources:O,value:F.languages,onSelect:e=>I(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>I(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(on,{value:F.monitors,onSelect:e=>I(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>I(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(tn,{sources:O,value:F.conditions,onSelect:e=>I(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>I(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(cn,null,e.createElement(k,{title:"Show only sources with errors",initialValue:F.onlyErrors,onChange:e=>I(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(an,{sources:O,value:F.errors,onSelect:e=>I(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>I(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!F.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},hn=d.div`
|
|
171
171
|
display: flex;
|
|
172
172
|
flex-direction: column;
|
|
173
173
|
gap: 24px;
|
|
174
174
|
padding: 4px;
|
|
175
|
-
`,
|
|
175
|
+
`,gn=({formData:t,handleFormChange:i,formErrors:a})=>{const{dataStreams:n,selectedStreamName:o}=We(),r=l(()=>n.find(e=>e.name===t.name&&e.name!==o),[n,t.name,o]);return e.createElement(hn,null,e.createElement(x,{name:"name",title:p.STREAM_NAME,placeholder:p.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:t.name,onChange:({target:{value:e}})=>i("name",e),errorMessage:a.name}),r&&e.createElement(ae,{type:B.Warning,message:p.DATA_STREAM_EXISTS_WARNING(o,r.name)}))},yn=d.div`
|
|
176
176
|
width: 100%;
|
|
177
177
|
height: 100%;
|
|
178
178
|
max-height: calc(100vh - 220px);
|
|
179
179
|
overflow: overlay;
|
|
180
180
|
overflow-y: auto;
|
|
181
|
-
`,
|
|
181
|
+
`,vn=({isOpen:i,onClose:a,dataStreamName:o,updateDataStream:r})=>{const{dataStreams:c}=We(),d=n(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=ct({name:o}),f=l(()=>{if(!i)return v();const e=c?.find(e=>e.name===o);return e?b(e):v(),e},[i,c,o]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return f?e.createElement(va,{ref:d,title:f.name,icons:[wi],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:X.Update})&&(r(o,m),p(!1),a())},onCancel:()=>{v(),p(!1),a()}},e.createElement(yn,null,e.createElement(gn,{formData:m,handleFormChange:x,formErrors:g}))):null},bn=d.div`
|
|
182
182
|
position: relative;
|
|
183
|
-
`,
|
|
183
|
+
`,fn=d(ce)`
|
|
184
184
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
185
185
|
border-radius: 32px;
|
|
186
186
|
|
|
187
187
|
& button {
|
|
188
188
|
max-height: 28px;
|
|
189
189
|
}
|
|
190
|
-
|
|
190
|
+
`,xn=d(N)`
|
|
191
191
|
text-wrap: nowrap;
|
|
192
|
-
|
|
192
|
+
`,$n=d(tt)`
|
|
193
193
|
max-height: 240px;
|
|
194
194
|
padding: 0px !important;
|
|
195
|
-
`,
|
|
195
|
+
`,Cn=d(ce)`
|
|
196
196
|
width: 100%;
|
|
197
|
-
`,
|
|
197
|
+
`,Sn=d.div`
|
|
198
198
|
width: 100%;
|
|
199
|
-
`,
|
|
199
|
+
`,kn=({onClickNewDataStream:i,updateDataStream:a,deleteDataStream:n})=>{const o=E.useTheme(),{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Ze(),{dataStreams:p,selectedStreamName:m,setSelectedStreamName:h}=We(),{setFetchedAllNamespaces:g,setAvailableSources:y,setConfiguredSources:v,setConfiguredFutureApps:b}=dt(),[f,$]=t(""),[C,S]=t(""),[k,w]=t(""),T=()=>{g(!1),y({}),v({}),b({})},D=l(()=>p.filter(({name:e})=>!k||e.toLowerCase().includes(k.toLowerCase())).map(({name:t})=>e.createElement(Cn,{key:`stream-${t}`},e.createElement(Sn,null,e.createElement(et,{label:t,isSelected:m===t,onClick:()=>{T(),h(t),c(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==ut&&e.createElement(pt,{onClick:()=>S(t),tooltip:j.DELETE},e.createElement(xi,null)),e.createElement(pt,{onClick:()=>$(t),tooltip:j.EDIT},e.createElement(fi,null)))),[p,m,k]);return e.createElement(e.Fragment,null,e.createElement(bn,null,e.createElement(fn,{$gap:0},e.createElement(Fe,{variant:"tertiary",onClick:()=>{u(0,50),c(e=>!e)}},e.createElement(wi,{fill:o.text.info}),e.createElement(xn,null,"Data Stream: ",m),e.createElement(mt,{extend:s}),e.createElement(Ne,{label:p.length})),e.createElement(le,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(ht,{onClick:()=>{T(),i()},label:j.NEW})),e.createElement(Qe,{ref:r,isOpen:s,top:d.top,left:d.left,header:e.createElement(x,{placeholder:"Search...",icon:Si,value:k,onChange:e=>w(e.target.value)})},e.createElement($n,null,D))),e.createElement(q,{isOpen:""!==C,name:C,onApprove:()=>{n(C),S("")},onDeny:()=>{S("")}}),e.createElement(vn,{isOpen:""!==f,onClose:()=>{$("")},dataStreamName:f,updateDataStream:a}))},wn=d.div`
|
|
200
200
|
display: flex;
|
|
201
201
|
align-items: center;
|
|
202
202
|
margin: 20px 0;
|
|
203
203
|
padding: 0 16px;
|
|
204
204
|
gap: 8px;
|
|
205
|
-
`,
|
|
205
|
+
`,Tn=d.div`
|
|
206
206
|
margin-left: auto;
|
|
207
|
-
`,
|
|
207
|
+
`,Dn=({addEntity:t,preventSearchPopup:i,onClickNewDataStream:a,updateDataStream:n,deleteDataStream:o})=>{const{setCurrentModal:l}=Q();return e.createElement(wn,null,e.createElement(kn,{onClickNewDataStream:a,updateDataStream:n,deleteDataStream:o}),e.createElement(en,{preventPopup:i}),e.createElement(mn,null),t&&e.createElement(Tn,null,e.createElement(ht,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${j.ADD} ${at(t)}`,variant:"primary",textProps:{weight:900}})))},Nn=a(({isModal:t,onClickSummary:i},a)=>{const{selectedStreamName:n}=We(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=ct({name:n});return o(a,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(ie,{$isNotModal:!t},e.createElement(Z,{$gap:24},i&&e.createElement(gt,{onClick:i}),e.createElement(F,{title:p.NAME_YOUR_STREAM,description:p.STREAM_DESCRIPTION}),e.createElement(gn,{formData:l,handleFormChange:r,formErrors:s})))});Nn.displayName=Nn.name;const En=({createDataStream:t})=>{const{currentModal:i,setCurrentModal:a}=Q(),{addDataStreams:o,setSelectedStreamName:l}=We(),r=i===yt.DataStream,s=()=>a(""),c=async()=>{if(d.current&&d.current.validateForm()){const e=d.current.getFormValues();t?t(e):(o([e]),l(e.name)),s()}},d=n(null);return K({key:"Enter",active:r},c),e.createElement(ee,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:c}]})},e.createElement(Nn,{ref:d,isModal:!0}))},On=e=>Object.keys(e).filter(t=>e[t]).join(", "),Fn=(e,t)=>{const{destinationType:i,disabled:a,exportedSignals:n}=e,o=[{title:p.TYPE,value:i.type},{type:m.ActiveStatus,title:p.STATUS,value:String(!a)},{type:m.Monitors,title:p.MONITORS,value:On(n)},{title:p.NAME,value:i.displayName}],l=vt(e,t),r=l.map(e=>({name:e.key,value:e.value}));return l.map(({key:e,name:i,value:a})=>{const{secret:l,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!bt(c,Pe(n),r)){const{type:e}=ft(s,{type:""}),t=(l||"password"===e)&&a.length?new Array(10).fill("•").join(""):"";o.push({type:m.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==a&&o.push({title:t.title,value:t.value})}):o.push({title:i,value:t||a})}}),o},In=({signals:t,fields:i,onChange:a,formErrors:n})=>i?.map(o=>{const{componentType:l,renderCondition:r,...s}=o;if(r&&!bt(r,t,i))return null;switch(l){case D.Input:return e.createElement(x,{key:o.name,...s,onChange:e=>a(o.name,e.target.value),errorMessage:n[o.name]});case D.Dropdown:return e.createElement(nt,{key:o.name,...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>a(o.name,e.id),errorMessage:n[o.name]});case D.MultiInput:return e.createElement(T,{key:o.name,...s,value:"string"==typeof s.value?ft(s.value,[]):s.value,onChange:e=>a(o.name,JSON.stringify(e)),errorMessage:n[o.name]});case D.KeyValuePair:return e.createElement(w,{key:o.name,...s,value:"string"==typeof s.value?ft(s.value,[]):s.value,onChange:e=>a(o.name,JSON.stringify(e)),errorMessage:n[o.name]});case D.TextArea:return e.createElement(M,{key:o.name,...s,onChange:e=>a(o.name,e.target.value),errorMessage:n[o.name]});case D.Checkbox:return e.createElement(v,{key:o.name,...s,value:"true"==s.value,onChange:e=>a(o.name,String(e)),errorMessage:n[o.name]});default:return null}}),An=d(Fe)`
|
|
208
208
|
display: flex;
|
|
209
209
|
align-items: center;
|
|
210
210
|
gap: 8px;
|
|
211
211
|
|
|
212
|
-
${({$status:e,theme:t})=>e===
|
|
212
|
+
${({$status:e,theme:t})=>e===B.Success?u`
|
|
213
213
|
border-color: transparent;
|
|
214
214
|
background-color: ${t.colors.success};
|
|
215
215
|
`:"error"===e?u`
|
|
@@ -218,43 +218,43 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
218
218
|
`:u`
|
|
219
219
|
background-color: transparent;
|
|
220
220
|
`}
|
|
221
|
-
`,
|
|
221
|
+
`,Mn=({destination:i,validateForm:a,status:n,testConnection:o,onSuccess:l,onError:r})=>{const s=E.useTheme(),{selectedStreamName:c}=We(),[d,u]=t(!1),p=n?me(n,s):void 0;return e.createElement(An,{$status:n,variant:"secondary",onClick:async()=>{if(a()){u(!0);const e=await o({...i,currentStreamName:c});e&&(e.succeeded?l(e):r(e)),u(!1)}}},d?e.createElement(Re,null):p?e.createElement(p,null):null,e.createElement(N,{family:"secondary",decoration:"underline",size:14,color:n?s.text[n]:void 0},d?"Checking":n===B.Success?"Connection OK":"error"===n?"Connection Failed":"Test Connection"))},Rn=d(Z)`
|
|
222
222
|
align-items: unset;
|
|
223
223
|
padding: 0 4px;
|
|
224
|
-
`,
|
|
224
|
+
`,Ln=d.div`
|
|
225
225
|
display: flex;
|
|
226
226
|
flex-direction: column;
|
|
227
227
|
gap: 12px;
|
|
228
|
-
`,
|
|
228
|
+
`,Pn=d(ce)`
|
|
229
229
|
justify-content: space-between;
|
|
230
|
-
`,
|
|
230
|
+
`,Kn=d(N)`
|
|
231
231
|
margin-bottom: 12px;
|
|
232
|
-
`,
|
|
232
|
+
`,jn=({isUpdate:a,categoryItem:o,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:m,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:b}=o||{},f=E.useTheme(),[$,C]=t(!1),[S,k]=t(!1),[w,T]=t(void 0),D=n(!1);i(()=>{if(u.length&&!D.current){D.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:i,value:a}=u[t];if(i){if([void 0,null,""].includes(a)){e=!1;break}e=!0}}C(e)}},[u,S]);const N=l(()=>{const{logs:e,metrics:t,traces:i}=v||{},a=[];return e?.supported&&a.push(xt.Logs),t?.supported&&a.push(xt.Metrics),i?.supported&&a.push(xt.Traces),a},[v]),M=l(()=>{const{logs:e,metrics:t,traces:i}=r.exportedSignals||{},a=[];return e&&a.push(xt.Logs),t&&a.push(xt.Metrics),i&&a.push(xt.Traces),a},[r.exportedSignals]),R=()=>{C(!1),k(!0),T(void 0)};return e.createElement(Rn,{$gap:24},e.createElement(Rn,{$gap:12},e.createElement(F,{title:a?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:b&&e.createElement(Mn,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{k(!1),T({type:B.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{k(!1),T({type:B.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(Ln,null,b&&w&&e.createElement(ae,{type:w.type,title:w.title,message:w.message}),$&&!w&&!a&&e.createElement(ae,{type:B.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(le,null)),e.createElement(Pn,null,e.createElement(A,{title:a?"":"This connection will monitor:",required:!0,allowedSignals:N,selectedSignals:M,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes(xt.Logs),metrics:e.includes(xt.Metrics),traces:e.includes(xt.Traces)})},errorMessage:s.exportedSignals}),!a&&e.createElement(I,{endpoint:`/backends/${g}`})),a&&e.createElement("div",null,e.createElement(Kn,null,"Status"),e.createElement(O,{options:[{icon:vi,label:p.ENABLED,value:!1,selectedBgColor:f.text.success+E.opacity.hex["050"]},{icon:bi,label:p.DISABLED,value:!0,selectedBgColor:f.text.error+E.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!a&&e.createElement(x,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(In,{signals:M,fields:u,onChange:(e,t)=>{R(),m(i=>{const a=[...i],n=a.findIndex(t=>t.name===e);return-1!==n&&(a[n]={...a[n],value:t}),a})},formErrors:s}))},Vn=d.div`
|
|
233
233
|
width: 100%;
|
|
234
234
|
height: 100%;
|
|
235
235
|
max-height: calc(100vh - 220px);
|
|
236
236
|
overflow: overlay;
|
|
237
237
|
overflow-y: auto;
|
|
238
|
-
`,
|
|
238
|
+
`,qn=d.div`
|
|
239
239
|
display: flex;
|
|
240
240
|
flex-direction: column;
|
|
241
241
|
gap: 12px;
|
|
242
|
-
`,
|
|
242
|
+
`,zn=({categories:i,updateDestination:a,deleteDestination:o,testConnection:r})=>{const{destinations:s}=W(),{selectedStreamName:c}=We(),{drawerType:d,drawerEntityId:u}=P(),m=l(()=>Ye(s,c),[s,c]),h=n(null),g=d!==H.Destination,[y,v]=t(!1),[b,f]=t(!1),{formData:x,formErrors:$,handleFormChange:C,resetFormData:S,validateForm:k,loadFormWithDrawerItem:w,yamlFields:T,setYamlFields:D,dynamicFields:N,setDynamicFields:E}=$t({}),O=l(()=>{if(g)return S();const e=m?.find(e=>e.id===u);return e?(w(e),D(Ct(i,e))):S(),e},[g,u,m]);if(!O)return null;const F=i.flatMap(e=>e.items).find(e=>e.type===O.destinationType.type),{icon:I,iconSrc:A}=F?qe(F?.type):{icon:void 0,iconSrc:void 0};return e.createElement(va,{ref:h,title:O.name||O.destinationType.displayName,icons:I?[I]:void 0,iconSrcs:A?[A]:void 0,isEdit:y,isFormDirty:b,onEdit:e=>{v("boolean"!=typeof e||e)},onSave:async e=>{if(k({withAlert:!0,alertTitle:X.Update})){const t=e!==O.destinationType.displayName?e:"";C("name",t),a(u,{...x,name:t}),v(!1),f(!1)}},onDelete:async()=>{o(u),v(!1),f(!1),h.current?.closeDrawer()},onCancel:()=>{v(!1),f(!1),w(O)},isLastItem:1===m.length},y?e.createElement(Vn,null,e.createElement(jn,{isUpdate:!0,categoryItem:F,formData:x,formErrors:$,handleFormChange:(...e)=>{f(!0),C(...e)},dynamicFields:N,setDynamicFields:(...e)=>{f(!0),E(...e)},validateForm:k,testConnection:r})):e.createElement(qn,null,O.conditions?.length?e.createElement(G,{conditions:O.conditions}):null,e.createElement(Y,{title:p.DESTINATION_DETAILS,data:O?Fn(O,T):[]})))},Hn=d.div`
|
|
243
243
|
display: flex;
|
|
244
244
|
flex-direction: column;
|
|
245
245
|
gap: 12px;
|
|
246
|
-
`,
|
|
246
|
+
`,Bn=({items:t,onSelectNew:i,onSelectConfigured:a,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:o}=dt();return t.map(t=>{const l=t.name===kt.EXISTS.TITLE;return e.createElement(Hn,{key:`category-${t.name}`},e.createElement(F,{size:"small",icon:t.icon,title:St(t.name),description:t.description}),t.items.map(r=>{const s=`select-${t.name.replaceAll(" ","")}-destination-${r.type}`,c=Object.keys(r.supportedSignals).filter(e=>r.supportedSignals[e].supported),{icon:d,iconSrc:u}=qe(r.type),p=r.selected||o.some(e=>e.id===r.id),m=!!n.find(e=>e===r.id),h=l?()=>a(r.id):()=>i(r);return e.createElement(Me,{key:s,"data-id":s,title:r.displayName,hoverText:j.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>a(r.id)}})}))})},Wn=d.div`
|
|
247
247
|
display: flex;
|
|
248
248
|
flex-direction: column;
|
|
249
249
|
gap: 24px;
|
|
250
|
-
`,
|
|
250
|
+
`,_n=d.div`
|
|
251
251
|
display: flex;
|
|
252
252
|
align-items: center;
|
|
253
253
|
gap: 12px;
|
|
254
|
-
`,
|
|
254
|
+
`,Jn=d.div`
|
|
255
255
|
width: 170px;
|
|
256
256
|
margin-right: 8px;
|
|
257
|
-
`,
|
|
257
|
+
`,Un=d.div`
|
|
258
258
|
display: flex;
|
|
259
259
|
flex-direction: column;
|
|
260
260
|
align-self: stretch;
|
|
@@ -265,18 +265,18 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
265
265
|
@media (height < 800px) {
|
|
266
266
|
max-height: calc(100vh - 400px);
|
|
267
267
|
}
|
|
268
|
-
`,
|
|
268
|
+
`,Gn=d(Wn)`
|
|
269
269
|
margin-top: 80px;
|
|
270
|
-
`,{MANAGED:
|
|
270
|
+
`,{MANAGED:Yn,SELF_HOSTED:Xn,DETECTED:Zn,EXISTS:Qn}=kt,eo=[{value:"All types",id:"all"},{value:Yn.TITLE,id:Yn.TITLE},{value:Xn.TITLE,id:Xn.TITLE},{value:Zn.TITLE,id:Zn.TITLE},{value:Qn.TITLE,id:Qn.TITLE}],to=eo[0],io=[xt.Logs,xt.Metrics,xt.Traces],ao=(e,t,i)=>e.map(e=>{const{type:a,displayName:n}=e.destinationType,o=e.dataStreamNames?.includes(t),l=i.has(e.id);return{id:e.id,type:a,displayName:n,selected:o||l,fields:[],testConnectionSupported:!1,supportedSignals:{[xt.Logs]:{supported:e.exportedSignals.logs},[xt.Metrics]:{supported:e.exportedSignals.metrics},[xt.Traces]:{supported:e.exportedSignals.traces}}}}),no=({hidden:i,categories:a,potentialDestinations:n,onSelectNew:o,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=W(),{selectedStreamName:d}=We(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=dt(),[m,h]=t(""),[g,y]=t(to),[v,b]=t(io),f=l(()=>{const e=wt(a);return e.unshift({name:Qn.TITLE,description:Qn.DESCRIPTION,icon:Ti,items:ao(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:Zn.TITLE,description:Zn.DESCRIPTION,icon:Di,items:n}),e.map(e=>{const t=e.items.filter(t=>{const i=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),a="all"===g.id||g.id===e.name,n=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return i&&a&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[a,n,c,m,g,v,d,u,p]);return i?null:e.createElement(Wn,null,e.createElement(F,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(_n,null,e.createElement(Jn,null,e.createElement(x,{placeholder:"Search...",icon:Si,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(Jn,null,e.createElement(nt,{options:eo,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(A,{title:"",selectedSignals:v,setSelectedSignals:b})),e.createElement(le,null),f.length?e.createElement(Un,null,e.createElement(Bn,{items:f,onSelectNew:e=>o(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(Gn,null,e.createElement(Te,{title:"No destinations found"})))},oo=d.div`
|
|
271
271
|
display: flex;
|
|
272
|
-
`,
|
|
272
|
+
`,lo=d.div`
|
|
273
273
|
border-right: 1px solid ${({theme:e})=>e.colors.border};
|
|
274
274
|
padding: 32px;
|
|
275
275
|
width: 200px;
|
|
276
276
|
@media (max-width: 1050px) {
|
|
277
277
|
display: none;
|
|
278
278
|
}
|
|
279
|
-
`,
|
|
279
|
+
`,ro=({isOnboarding:i,categories:a,potentialDestinations:n,createDestination:o,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=W(),{selectedStreamName:d}=We(),{currentModal:u,setCurrentModal:m}=Q(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=dt(),b=u===H.Destination,[f,x]=t(void 0),{formData:$,formErrors:C,handleFormChange:S,resetFormData:k,validateForm:w,setYamlFields:T,dynamicFields:D,setDynamicFields:N,loadFormWithDrawerItem:E}=$t({supportedSignals:f?.supportedSignals,preLoadedFields:f?.fields}),[O,F]=t([]),I=e=>{const t={};return e||D.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||$.name,disabled:e?.disabled||$.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||$.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:f.type,displayName:f.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},A=async e=>{if(i&&!e){const e=I();h(e)}else if(i&&e){const t=I(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(i||e){if(!i&&e){const t=I(e),i=t.dataStreamNames.some(e=>e===d);F(t=>[...t,e.id]),i?await r(e.id):await l(e.id,E(t)),F(t=>t.filter(t=>t!==e.id))}}else o($)},M=()=>{k(),x(void 0),m("")},R=()=>{k(),x(void 0)},L=async()=>{if(f){if(!w({withAlert:!i,alertTitle:X.Create}))return null;A()}M()};return K({key:"Enter",active:b},()=>L()),e.createElement(ee,{isOpen:b,onClose:M,header:{title:p.ADD_DESTINATION},actionComponent:e.createElement(te,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:L}];return f&&e.unshift({label:"BACK",icon:Ni,variant:"secondary",onClick:R}),e})()})},e.createElement(oo,null,e.createElement(lo,null,e.createElement(Tt,{currentStep:f?2:1,data:[{stepNumber:1,title:p.DESTINATIONS},{stepNumber:2,title:p.CONNECTION}]})),e.createElement(ie,{style:{margin:"32px 24px 12px 24px"}},e.createElement(no,{hidden:void 0!==f,categories:a,potentialDestinations:n,onSelectNew:(e,t)=>{k(),S("type",e?.type||""),S("currentStreamName",d);const i={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>i[e]=!0),S("exportedSignals",i),T(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&A(t)},isLoadingForDestinationIds:O}),f&&e.createElement(jn,{categoryItem:f,formData:$,formErrors:C,handleFormChange:S,dynamicFields:D,setDynamicFields:N,validateForm:w,testConnection:s}))))},so=d.div`
|
|
280
280
|
display: flex;
|
|
281
281
|
flex-direction: column;
|
|
282
282
|
align-items: center;
|
|
@@ -285,7 +285,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
285
285
|
max-height: calc(100vh - 310px);
|
|
286
286
|
height: fit-content;
|
|
287
287
|
overflow-y: scroll;
|
|
288
|
-
`,
|
|
288
|
+
`,co=({categories:t,withDelete:i})=>{const{configuredDestinations:a,configuredDestinationsUpdateOnly:n}=dt();return a.length||n.length?e.createElement(so,null,a.concat(n).map((o,l)=>e.createElement(uo,{key:`configured-destination-${o.destinationType.type}-${l}`,"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:Ct(t,o),isLastItem:a.length+n.length===1,withDelete:i}))):e.createElement(we,null,e.createElement(Te,{title:"No destinations",subTitle:"Please add a destination"}))},uo=({item:i,yamlFields:a,isLastItem:n,withDelete:o})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=qe(i.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=dt(),m=l(()=>vt(i,a).map(e=>({title:e.name,value:e.value})),[i,a]);return e.createElement(e.Fragment,null,e.createElement(Me,{title:i.name||i.destinationType.displayName,subTitle:i.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:Pe(i.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Dt,{data:m})},renderActions:o?()=>e.createElement(pt,{onClick:()=>s(!0)},e.createElement(xi,null)):void 0}),o&&e.createElement(q,{isOpen:r,name:i.destinationType.displayName||i.name,type:H.Destination,isLastItem:n,onApprove:()=>{i.id?p(i):u(i)},onDeny:()=>s(!1)}))},po=d(Fe)`
|
|
289
289
|
display: flex;
|
|
290
290
|
align-items: center;
|
|
291
291
|
justify-content: center;
|
|
@@ -294,7 +294,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
294
294
|
padding: 32px;
|
|
295
295
|
border-radius: 16px;
|
|
296
296
|
border-style: dashed !important;
|
|
297
|
-
`,
|
|
297
|
+
`,mo=({isSourcesListEmpty:t,goToSources:i,categories:a,potentialDestinations:n,testConnection:o,onClickSummary:l})=>{const r=E.useTheme(),{setCurrentModal:s}=Q(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=dt();return e.createElement(e.Fragment,null,e.createElement(ie,{$isNotModal:!0},e.createElement(Z,{$gap:12},e.createElement(Z,{$gap:24},l&&e.createElement(gt,{onClick:l}),e.createElement(F,{title:p.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:p.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(ae,{type:B.Warning,message:p.NO_SOURCES_GO_BACK,action:{label:p.SELECT_SOURCES,onClick:i}}),e.createElement(po,{variant:"secondary",onClick:()=>s(H.Destination)},e.createElement(Ci,null),e.createElement(N,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},p.ADD_DESTINATION))),e.createElement(co,{categories:a,withDelete:!0}))),e.createElement(ro,{isOnboarding:!0,categories:a,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:o}))},ho=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"type",title:p.TYPE,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],go=({metrics:t,maxHeight:i,maxWidth:a})=>{const n=E.useTheme(),o=he(),{selectedStreamName:r}=We(),{setDrawerType:s,setDrawerEntityId:c}=P(),{destinations:d,destinationsLoading:u}=W(),m=l(()=>Ye(d,r),[d,r]),h=l(()=>Da({instrumentationRules:[],sources:[],actions:[],destinations:Ge(m,o),searchText:o.searchText,selectedCategory:H.Destination}).searchResults.find(({category:e})=>e===H.Destination)?.entities||[],[m,o]),g=l(()=>h.map(i=>{const{hasErrors:a,hasWarnings:o,hasDisableds:l}=re(i.conditions||[]),{icon:r,iconSrc:d}=qe(i.destinationType.type);return{status:a?B.Error:o?B.Warning:void 0,faded:l,onClick:()=>{s(H.Destination),c(i.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:r,src:d})},{columnKey:"name",value:ve(i,H.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:i.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:Ke(Nt(t,H.Destination,i.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(be,{withLabels:!0,monitors:Pe(i.exportedSignals)})},{columnKey:"conditions",component:()=>i.conditions?.length?e.createElement(wa,{conditions:i.conditions,id:i.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:i.disabled?B.Error:B.Success,title:i.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==m.length?{badge:`${h.length}/${m.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:m.length,badgeTooltip:void 0},[h,m]);return e.createElement(fe,{$maxWidth:a},e.createElement(xe,null,e.createElement($e,{icon:Ce(H.Destination),title:p.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(Se,{$maxHeight:i},e.createElement(ke,{columns:ho,rows:g})),!h.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(Te,null)))},yo=e=>{const{type:t,ruleName:i,notes:a,disabled:n,profileName:o,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!n)},{title:p.NAME,value:i},{title:p.NOTES,value:a},{title:p.MANAGED_BY_PROFILE,value:o},{type:m.Divider}];if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}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=(s[Et.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Ft.Java]||[]).map(e=>new Ot(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:p.JAVA_CUSTOM_PROBES,value:e});const t=(c[Ft.Golang]||[]).map(e=>new It(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:p.GOLANG_CUSTOM_PROBES,value:t})}return d},vo=d.div`
|
|
298
298
|
display: flex;
|
|
299
299
|
flex-direction: column;
|
|
300
300
|
gap: 12px;
|
|
@@ -304,7 +304,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
304
304
|
border-radius: 16px;
|
|
305
305
|
padding: 8px;
|
|
306
306
|
`}
|
|
307
|
-
`,
|
|
307
|
+
`,bo=[{id:At.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:At.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:At.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],fo=[{id:At.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:At.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:At.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],xo={[Ft.Java]:[new Ot("","")],[Ft.Golang]:[new It("")]},$o=["*"],Co=d.div`
|
|
308
308
|
display: flex;
|
|
309
309
|
flex-direction: column;
|
|
310
310
|
gap: 12px;
|
|
@@ -314,27 +314,27 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
314
314
|
border-radius: 16px;
|
|
315
315
|
padding: 8px;
|
|
316
316
|
`}
|
|
317
|
-
`,
|
|
317
|
+
`,So=[{id:Mt.HttpRequest,label:"Collect HTTP Request"},{id:Mt.HttpResponse,label:"Collect HTTP Response"},{id:Mt.DbQuery,label:"Collect DB Query"},{id:Mt.Messaging,label:"Collect Messaging"}],ko={[Rt.CodeAttributes]:({value:a,setValue:n,formErrors:o})=>{const r=o.codeAttributes,s=l(()=>Object.entries(a.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[a]),[c,d]=t(1===s.length);i(()=>{if(!s.length){const e={[At.Column]:null,[At.FilePath]:!0,[At.Function]:!0,[At.LineNumber]:!0,[At.Namespace]:null,[At.StackTrace]:null};n("codeAttributes",e),d(!1)}},[]);const u=(e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e),a=Object.values(At).reduce((e,t)=>(e[t]=!!i.includes(t)||null,e),{});n("codeAttributes",a),d(1===i.length)};return e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(y,{title:"Recommended data to collect",required:!0}),e.createElement(vo,{$hasError:!!r},bo.map(({id:t,label:i,tooltip:a})=>e.createElement(ue,{key:t,text:a,withIcon:!0},e.createElement(v,{title:i,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(b,null,r)),e.createElement("div",null,e.createElement(y,{title:"Verbose data to collect",required:!0}),e.createElement(vo,{$hasError:!!r},fo.map(({id:t,label:i,tooltip:a})=>e.createElement(ue,{key:t,text:a,withIcon:!0},e.createElement(v,{title:i,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(b,null,r)))},[Rt.CustomInstrumentation]:({value:t,setValue:a,formErrors:n})=>{const o=n.customInstrumentations,r=l(()=>(t?.customInstrumentations?.[Ft.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[t]),s=l(()=>(t?.customInstrumentations?.[Ft.Golang]||[]).map(e=>new It(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[t]),c=(e,t)=>{const i={};switch(t){case"java":i[Ft.Java]=e.map(e=>new Ot(e.className,e.methodName)),i[Ft.Golang]=s.map(e=>new It(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":i[Ft.Golang]=e.map(e=>new It(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),i[Ft.Java]=r.map(({key:e,value:t})=>new Ot(e,t))}a("customInstrumentations",i)};return i(()=>{t?.customInstrumentations||a("customInstrumentations",{[Ft.Golang]:xo[Ft.Golang],[Ft.Java]:xo[Ft.Java]})},[a,t]),e.createElement("div",null,e.createElement(S,{title:"Golang Custom Probes",columns:[{title:"",keyName:"packageName",placeholder:"Package name",required:!0,tooltip:"The full import path of the package containing the function or method to be instrumented."},{title:"",keyName:"functionName",placeholder:"Function name",required:!1,tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{title:"",keyName:"receiverName",placeholder:"Receiver name",required:!1,tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{title:"",keyName:"receiverMethodName",placeholder:"Receiver method name",required:!1,tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],value:s,onChange:e=>c(e,"golang"),errorMessage:o,limitFieldsPerRow:2}),e.createElement(w,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:r,onChange:(e=[])=>c(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:o,keyPlaceholder:"Class name",valuePlaceholder:"Method name"}))},[Rt.HeadersCollection]:({value:t,setValue:a,formErrors:n})=>{const o=n.headersCollection,r=l(()=>t?.headersCollection?.[Et.HeaderKeys]||[],[t]),s=e=>{const t={[Et.HeaderKeys]:e};a("headersCollection",t)};return i(()=>{r.length||s($o)},[r]),e.createElement("div",null,r.length>0&&e.createElement(T,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>s(e),errorMessage:o}))},[Rt.PayloadCollection]:({value:a,setValue:n,formErrors:o})=>{const r=o.payloadCollection,s=l(()=>Object.entries(a.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[a]),[c,d]=t(1===s.length);return i(()=>{if(!s.length){const e={[Mt.HttpRequest]:{},[Mt.HttpResponse]:{},[Mt.DbQuery]:{},[Mt.Messaging]:{}};n("payloadCollection",e),d(!1)}},[]),e.createElement("div",null,e.createElement(y,{title:"Type of data to collect",required:!0}),e.createElement(Co,{$hasError:!!r},So.map(({id:t,label:i})=>e.createElement(v,{key:t,title:i,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>((e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e),a={[Mt.HttpRequest]:i.includes(Mt.HttpRequest)?{}:null,[Mt.HttpResponse]:i.includes(Mt.HttpResponse)?{}:null,[Mt.DbQuery]:i.includes(Mt.DbQuery)?{}:null,[Mt.Messaging]:i.includes(Mt.Messaging)?{}:null};n("payloadCollection",a),d(1===i.length)})(t,e)}))),!!r&&e.createElement(b,null,r))},[Rt.UnknownType]:null},wo=({ruleType:t,value:i,setValue:a,formErrors:n})=>{if(!t)return null;const o=ko[t];return o?e.createElement(o,{value:i,setValue:a,formErrors:n}):null},To=d.div`
|
|
318
318
|
display: flex;
|
|
319
319
|
flex-direction: column;
|
|
320
320
|
gap: 24px;
|
|
321
321
|
padding: 4px;
|
|
322
|
-
`,
|
|
322
|
+
`,Do=d(N)`
|
|
323
323
|
margin-bottom: 12px;
|
|
324
|
-
`,
|
|
324
|
+
`,No=({isUpdate:t,rule:i,formData:a,formErrors:n,handleFormChange:o})=>{const l=E.useTheme();return e.createElement(To,null,e.createElement(ce,null,i.supportedLanguages.map(t=>e.createElement(Lt,{key:t,icon:Pt(t),type:B.Info},ot[t]))),t?e.createElement("div",null,e.createElement(Do,null,"Status"),e.createElement(O,{options:[{icon:vi,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+E.opacity.hex["050"]},{icon:bi,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+E.opacity.hex["050"]}],selected:a.disabled,setSelected:e=>o("disabled",e)})):e.createElement(e.Fragment,null,e.createElement(F,{title:"",description:i.docsDescription,actionButton:e.createElement(I,{endpoint:i.docsEndpoint})}),e.createElement(x,{title:"Rule name",placeholder:"Use a name that describes the rule",value:a.ruleName,onChange:({target:{value:e}})=>o("ruleName",e),errorMessage:n.ruleName})),e.createElement(wo,{ruleType:i.type,value:a,setValue:(e,t)=>o(e,t),formErrors:n}),e.createElement(M,{title:"Notes",value:a.notes,onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},Eo=d.div`
|
|
325
325
|
width: 100%;
|
|
326
326
|
height: 100%;
|
|
327
327
|
max-height: calc(100vh - 220px);
|
|
328
328
|
overflow: overlay;
|
|
329
329
|
overflow-y: auto;
|
|
330
|
-
`,
|
|
330
|
+
`,Oo=d.div`
|
|
331
331
|
display: flex;
|
|
332
332
|
flex-direction: column;
|
|
333
333
|
gap: 12px;
|
|
334
|
-
`,
|
|
334
|
+
`,Fo=({updateInstrumentationRule:i,deleteInstrumentationRule:a})=>{const{instrumentationRules:o}=W(),{addNotification:r}=L(),{drawerType:s,drawerEntityId:c}=P(),d=n(null),u=s!==H.InstrumentationRule,[p,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:b,resetFormData:f,validateForm:x,loadFormWithDrawerItem:$}=Kt(),C=l(()=>{if(u)return f();const e=o?.find(e=>e.ruleId===c);return e?$(e):f(),e},[u,c,o]);if(!C)return null;const S=jt.find(({type:e})=>e===C.type);return e.createElement(va,{ref:d,title:C.ruleName||C.type,icons:[Ve(C.type)],isEdit:p,isFormDirty:h,onEdit:e=>{C.mutable||!e&&void 0!==e?m("boolean"!=typeof e||e):r({type:B.Warning,title:ne.FORBIDDEN,message:ne.CANNOT_EDIT_RULE,crdType:H.InstrumentationRule,target:c,hideFromHistory:!0})},onSave:e=>{if(x()){const t=e!==C.type?e:"";b("ruleName",t),i(c,{...y,ruleName:t}),m(!1),g(!1)}},onDelete:()=>{C.mutable?(a(c),m(!1),g(!1),d.current?.closeDrawer()):r({type:B.Warning,title:ne.FORBIDDEN,message:ne.CANNOT_DELETE_RULE,crdType:H.InstrumentationRule,target:c,hideFromHistory:!0})},onCancel:()=>{m(!1),g(!1),$(C)}},p&&S?e.createElement(Eo,null,e.createElement(No,{isUpdate:!0,rule:S,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),b(...e)}})):e.createElement(Oo,null,e.createElement(G,{conditions:C.conditions||[]}),e.createElement(Y,{title:"Instrumentation Rule Details",data:C?yo(C):[]})))},Io=d(Z)`
|
|
335
335
|
margin-top: 24px;
|
|
336
336
|
gap: 12px;
|
|
337
|
-
`,
|
|
337
|
+
`,Ao=jt,Mo=({isEnterprise:i,createInstrumentationRule:a})=>{const{currentModal:n,setCurrentModal:o}=Q(),l=n===H.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=Kt(),[m,h]=t(void 0),g=()=>{d(),h(void 0),o("")},y=()=>{if(!u())return null;a(r),g()};return K({key:"Enter",active:l},()=>y()),e.createElement(ee,{isOpen:l,onClose:g,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(te,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!i||!m,tooltip:i?"":ne.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(ie,null,e.createElement(F,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(Io,null,i?e.createElement(ae,{type:B.Warning,message:ne.DEFINED_FOR_ALL_STREAMS(p.INSTRUMENTATION_RULES)}):e.createElement(ae,{type:B.Default,message:ne.ENTERPRISE_ONLY(p.INSTRUMENTATION_RULES)}),e.createElement(oe,{options:Ao,selectedOption:m,onOptionSelect:e=>{return t=e,d(),void h(t);var t},autoFocus:!m?.type})),m?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(No,{rule:m,formData:r,formErrors:s,handleFormChange:c})):null))},Ro=e=>{const{payloadCollection:t,codeAttributes:i,customInstrumentations:a}=e;let n="";return t&&(n+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&(n+=Object.entries(i).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),a&&Object.values(Ft).forEach(e=>{const t=(a[e]||[]).filter(e=>e).join(", ");t&&(n+=n?`, ${t}`:t)}),n},Lo=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"profile",title:p.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],Po=({maxHeight:t,maxWidth:i})=>{const a=E.useTheme(),n=he(),{setDrawerType:o,setDrawerEntityId:r}=P(),{instrumentationRules:s,instrumentationRulesLoading:c}=W(),d=l(()=>Da({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:n.searchText,selectedCategory:H.InstrumentationRule}).searchResults.find(({category:e})=>e===H.InstrumentationRule)?.entities||[],[s,n]),u=l(()=>d.map(t=>{const{hasErrors:i,hasWarnings:n,hasDisableds:l}=re(t.conditions||[]);return{status:i?B.Error:n?B.Warning:void 0,faded:l,onClick:()=>{o(H.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:Ve(t.type)})},{columnKey:"name",value:ve(t,H.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:a.text.info},{columnKey:"profile",value:t.profileName,textColor:a.text.info},{columnKey:"notes",value:t.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:Ro(t),textColor:a.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>e.createElement(wa,{conditions:t.conditions||[],id:t.ruleId})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?B.Error:B.Success,title:t.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))},{columnKey:"source-count",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:B.Info,title:"all sources",withBorder:!0}))}]}}),[d]),{badge:m,badgeTooltip:h}=l(()=>d.length!==s.length?{badge:`${d.length}/${s.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[d,s]);return e.createElement(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement($e,{icon:Ce(H.Action),title:p.INSTRUMENTATION_RULES,badge:m,badgeTooltip:h,loading:c})),e.createElement(Se,{$maxHeight:t},e.createElement(ke,{columns:Lo,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(Te,null)))},Ko=d.div`
|
|
338
338
|
position: fixed;
|
|
339
339
|
bottom: 0;
|
|
340
340
|
left: 50%;
|
|
@@ -347,17 +347,17 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
347
347
|
border-radius: 32px;
|
|
348
348
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
349
349
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
350
|
-
`,
|
|
350
|
+
`,jo=({totalSourceCount:i,uninstrumentSources:a,restartWorkloads:n})=>{const o=E.useTheme(),s=Vt({container:Ko,animateIn:E.animations.slide.in.center,animateOut:E.animations.slide.out.center}),{selectedSources:c,setSelectedSources:d}=Ie(),[u,p]=t(!1),m=l(()=>{let e=0;return Object.values(c).forEach(t=>{e+=t.length}),e},[c]),h=()=>{d({})};return e.createElement(r,null,e.createElement(s,{"data-id":"multi-source-control",enter:!!m},e.createElement(N,null,"Selected sources"),e.createElement(Ne,{label:m,filled:!0}),e.createElement(le,{orientation:"vertical",length:"16px"}),e.createElement(Fe,{variant:"tertiary",onClick:h},e.createElement(N,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(Fe,{variant:"tertiary",onClick:()=>{const e=[];Object.values(c).forEach(t=>{e.push(...t.map(e=>qt(e)))}),n(e),h()}},e.createElement(Ei,null),e.createElement(N,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(Fe,{variant:"tertiary",onClick:()=>p(!0)},e.createElement(xi,null),e.createElement(N,{family:"secondary",decoration:"underline",color:o.text.error},"Uninstrument"))),e.createElement(q,{isOpen:u,name:`${m} sources`,type:H.Source,isLastItem:m===i,onApprove:()=>{const e={};Object.entries(c).forEach(([t,i])=>{e[t]=i.map(e=>({...e,selected:!1}))}),a(e),p(!1),h()},onDeny:()=>p(!1)}))},Vo=d.div`
|
|
351
351
|
position: relative;
|
|
352
352
|
width: fit-content;
|
|
353
|
-
`,
|
|
353
|
+
`,qo=d(ce)`
|
|
354
354
|
gap: 12px;
|
|
355
355
|
padding: 0 12px;
|
|
356
|
-
`,
|
|
356
|
+
`,zo=d(Z)`
|
|
357
357
|
gap: 12px;
|
|
358
358
|
max-height: 400px;
|
|
359
359
|
overflow-y: auto;
|
|
360
|
-
`,
|
|
360
|
+
`,Ho=d.div`
|
|
361
361
|
position: absolute;
|
|
362
362
|
bottom: 0;
|
|
363
363
|
left: 0;
|
|
@@ -366,19 +366,19 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
366
366
|
border-radius: 0 0 24px 24px;
|
|
367
367
|
background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
|
|
368
368
|
pointer-events: none;
|
|
369
|
-
`,
|
|
369
|
+
`,Bo=d(N)`
|
|
370
370
|
background-color: ${({theme:e})=>e.colors.orange_soft};
|
|
371
371
|
color: ${({theme:e})=>e.text.primary};
|
|
372
372
|
border-radius: 32px;
|
|
373
373
|
width: fit-content;
|
|
374
374
|
padding: 2px 8px;
|
|
375
|
-
`,
|
|
375
|
+
`,Wo=()=>{const t=E.useTheme(),{notifications:i,markAsSeen:a}=L(),n=i.filter(({hideFromHistory:e})=>!e),o=n.filter(({seen:e})=>!e),l=o.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Ze({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&o.forEach(({id:e})=>a(e))}});return e.createElement(Vo,null,e.createElement(pt,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Oi,{size:18})),e.createElement(Qe,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(qo,null,e.createElement(N,{size:20},"Notifications"),!!l&&e.createElement(Bo,{size:12,family:"secondary"},l," new"))},e.createElement(zo,null,n.length?n.map(t=>e.createElement(Xo,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(Te,{title:"No notifications",subTitle:""})),e.createElement(Ho,null)))},_o=d.div`
|
|
376
376
|
display: flex;
|
|
377
377
|
align-items: flex-start;
|
|
378
378
|
gap: 12px;
|
|
379
379
|
padding: 16px;
|
|
380
380
|
border-radius: 16px;
|
|
381
|
-
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+
|
|
381
|
+
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+E.opacity.hex["080"]};
|
|
382
382
|
cursor: not-allowed;
|
|
383
383
|
&.click-enabled {
|
|
384
384
|
cursor: pointer;
|
|
@@ -386,27 +386,27 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
386
386
|
background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
`,
|
|
390
|
-
background-color: ${({$type:e,theme:t})=>t.text[e]+
|
|
389
|
+
`,Jo=d.div`
|
|
390
|
+
background-color: ${({$type:e,theme:t})=>t.text[e]+E.opacity.hex["015"]};
|
|
391
391
|
border-radius: 8px;
|
|
392
392
|
width: 36px;
|
|
393
393
|
height: 36px;
|
|
394
394
|
display: flex;
|
|
395
395
|
align-items: center;
|
|
396
396
|
justify-content: center;
|
|
397
|
-
`,
|
|
397
|
+
`,Uo=d.div`
|
|
398
398
|
width: 290px;
|
|
399
|
-
`,
|
|
399
|
+
`,Go=d.div`
|
|
400
400
|
margin-bottom: 6px;
|
|
401
|
-
`,
|
|
401
|
+
`,Yo=d.div`
|
|
402
402
|
display: flex;
|
|
403
403
|
align-items: center;
|
|
404
404
|
gap: 6px;
|
|
405
|
-
`,
|
|
405
|
+
`,Xo=({id:t,seen:i,type:a,title:n,message:o,time:l,crdType:r,target:s,onClick:c})=>{const d=E.useTheme(),u=zt(),{onClickNotification:p}=Ht(),m=!!r&&!!s,h=n?.toLowerCase().includes(X.Delete.toLowerCase())||!1,g=me(a,d);return e.createElement(_o,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(Jo,{$type:h?B.Error:a},h?e.createElement(xi,null):e.createElement(g,null)),e.createElement(Uo,null,e.createElement(Go,null,e.createElement(N,{size:14},o)),e.createElement(Yo,null,e.createElement(N,{size:10,color:d.text.grey},u.format(new Date(l))),!i&&e.createElement(e.Fragment,null,e.createElement(N,{size:10},"·"),e.createElement(N,{size:10,color:d.colors.orange_soft},"new")))))},Zo=(e,t,i)=>{const a=e?.serviceName||t?.otelServiceName||t?.name,n=i?[Fi]:ze(t?.containers||[]),{priorotizedStatus:o}=re(t?.conditions||[]);return{id:a,title:a,icons:n.length?n:[Ii],status:o,serviceMapEntry:e}},Qo=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,el=d.div`
|
|
406
406
|
width: 100%;
|
|
407
407
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
408
408
|
position: relative;
|
|
409
|
-
`,
|
|
409
|
+
`,tl={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},il=({heightToRemove:t,serviceMap:a})=>{const n=E.useTheme(),{sources:o,sourcesLoading:l}=W(),{containerRef:r,containerHeight:s,containerWidth:c}=_e(),[d,u,m]=_i([]),[h,g,y]=Ji([]);return i(()=>{if(s&&c){const t=(({sources:e,serviceMap:t,containerHeight:i,containerWidth:a})=>{const n=[],o=new Map,l=((e,t)=>{const i=new Map,a=new Map,n=new Map,o=new Set;e.forEach(e=>{o.add(e.serviceName),e.services.forEach(e=>{o.add(e.serviceName)})}),o.forEach(e=>{a.set(e,[]),n.set(e,0)}),e.forEach(e=>{e.services.forEach(t=>{a.get(e.serviceName)?.push(t.serviceName);const i=n.get(t.serviceName)||0;n.set(t.serviceName,i+1)})});const l=[],r=[];for(o.forEach(e=>{0===(n.get(e)||0)&&r.push(e)});r.length>0;){const e=[],t=r.length;for(let i=0;i<t;i++){const t=r.shift();e.push(t),a.get(t)?.forEach(e=>{const t=n.get(e)||0;n.set(e,t-1),t-1==0&&r.push(e)})}e.length>0&&l.push(e)}return o.forEach(e=>{l.flat().includes(e)||(0===l.length?l.push([e]):l[l.length-1].push(e))}),l.forEach((e,a)=>{const n=100+150*a,o=150*(e.length-1),l=(t-o)/2;e.forEach((e,t)=>{const a=l+150*t,o=n;i.set(e,{x:a,y:o})})}),i})(t,a);if(t.length&&e.length){t.forEach(t=>{const i=t.serviceName;if(n.find(e=>e.id===`${H.Source}-${i}-${Bt.MapItem}`))return;const a=e.find(e=>i===e.otelServiceName||i===e.name);o.set(i,t),t.services.forEach(e=>o.set(e.serviceName,{serviceName:e.serviceName,services:[]})),n.push({id:`${H.Source}-${i}-${Bt.MapItem}`,type:Bt.MapItem,position:l.get(i),data:Zo(t,a,Qo(a))})}),o.forEach((t,i)=>{if(n.find(e=>e.id===`${H.Source}-${i}-${Bt.MapItem}`))return;const a=e.find(e=>i===e.otelServiceName||i===e.name);n.push({id:`${H.Source}-${i}-${Bt.MapItem}`,type:Bt.MapItem,position:l.get(i),data:Zo(t,a,Qo(a))})});let i=50;e.forEach(e=>{const t=e.otelServiceName||e.name;n.find(e=>e.id===`${H.Source}-${t}-${Bt.MapItem}`)||(n.push({id:`${H.Source}-${t}-${Bt.MapItem}`,type:Bt.MapItem,position:{x:i,y:10},data:Zo(void 0,e,Qo(e))}),i+=110)})}else n.push({id:`${H.Source}-${Bt.NoData}`,type:Bt.NoData,position:{x:a/2-150,y:i/4},data:{subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({serviceMap:a,sources:[tl].concat(o),sourcesLoading:l,containerHeight:s,containerWidth:c});d.length>1?(e=t,u(t=>{const i=e.map(e=>{const i=t.find(t=>t.id===e.id);return e.position=i?.position||e.position,{id:e.id,item:e,type:i?"replace":"add"}});return t.find(e=>e.id===`${H.Source}-${Bt.NoData}`)&&i.push({id:`${H.Source}-${Bt.NoData}`,type:"remove"}),Ui(i,t)})):u(t)}var e},[a,o,l,s,c]),i(()=>{g((({theme:e,nodes:t,serviceMap:i})=>{const a=[];return t.forEach(({id:t,data:{id:n,status:o}})=>{const{services:l}=i.find(e=>e.serviceName===n)||{services:[]};l.forEach(i=>{const n=t,l=`${H.Source}-${i.serviceName}-${Bt.MapItem}`,r=o===B.Error;a.push({id:`${n}-to-${l}`,source:n,target:l,markerEnd:{type:Wi.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),a})({theme:n,nodes:d,serviceMap:a}))},[n,d,a]),e.createElement(el,{ref:r,$heightToRemove:t},e.createElement(Wt,{nodes:d,edges:h,onNodesChange:m,onEdgesChange:y,zoomOnScroll:!0}))},al=d.div`
|
|
410
410
|
display: flex;
|
|
411
411
|
flex-direction: column;
|
|
412
412
|
align-items: center;
|
|
@@ -416,12 +416,12 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
416
416
|
max-height: ${({$isModal:e})=>e?"calc(100vh - 510px)":"calc(100vh - 310px)"};
|
|
417
417
|
height: fit-content;
|
|
418
418
|
overflow-y: scroll;
|
|
419
|
-
`,
|
|
419
|
+
`,nl=d.div`
|
|
420
420
|
width: 100%;
|
|
421
421
|
padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
|
|
422
422
|
border-radius: 16px;
|
|
423
|
-
background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+
|
|
424
|
-
`,
|
|
423
|
+
background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+E.opacity.hex["024"]:t.colors.dropdown_bg_2+E.opacity.hex["040"]};
|
|
424
|
+
`,ol=d.div`
|
|
425
425
|
display: flex;
|
|
426
426
|
justify-content: space-between;
|
|
427
427
|
gap: 12px;
|
|
@@ -430,29 +430,29 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
430
430
|
border-radius: 16px;
|
|
431
431
|
cursor: ${({$withClick:e})=>e?"pointer":"unset"};
|
|
432
432
|
&:hover {
|
|
433
|
-
background-color: ${({$withClick:e,$selected:t,theme:
|
|
433
|
+
background-color: ${({$withClick:e,$selected:t,theme:i})=>e&&(t?i.colors.majestic_blue+E.opacity.hex["040"]:i.colors.dropdown_bg_2+E.opacity.hex["080"])};
|
|
434
434
|
transition: background-color 0.3s;
|
|
435
435
|
}
|
|
436
|
-
`,
|
|
436
|
+
`,ll=d(ol)`
|
|
437
437
|
width: calc(100% - 100px);
|
|
438
438
|
margin: 0 auto;
|
|
439
439
|
padding: 8px;
|
|
440
|
-
`,
|
|
440
|
+
`,rl=d.div`
|
|
441
441
|
position: relative;
|
|
442
442
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
443
|
-
`,
|
|
443
|
+
`,sl=d.div`
|
|
444
444
|
position: absolute;
|
|
445
445
|
top: 6px;
|
|
446
446
|
left: 18px;
|
|
447
|
-
`,
|
|
447
|
+
`,cl=d(we)`
|
|
448
448
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
449
|
-
`,
|
|
449
|
+
`,dl=d.div`
|
|
450
450
|
width: ${({$width:e})=>`${e||42}px`};
|
|
451
451
|
display: flex;
|
|
452
452
|
align-items: center;
|
|
453
453
|
justify-content: flex-end;
|
|
454
454
|
text-align: right;
|
|
455
|
-
`,
|
|
455
|
+
`,ul=Ce(H.Namespace),pl=({isModal:t=!1,withInstances:i=!0,fetchingNamespace:a,fetchedNamespaces:n,filteredNamespacesAndSources:o,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const m=E.useTheme(),{isVm:h}=Be(),{namespacesLoading:g}=W(),y=Object.entries(o||{});return y?.length?e.createElement(al,{$isModal:t},y.map(([t,o])=>{const y=s?.[t]||[],b=d?.[t]?.selected||!1,f=y.filter(({selected:e})=>e),x=y.length>0,$=l===t,C=f.length>0&&f.length===o.length,S=f.length>0&&f.length!==o.length,w=o.length>0,T=1===o.length;return r||w?e.createElement(nl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:C,$isOpen:$},e.createElement(ol,{$selected:C,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ce,{$gap:12},r&&e.createElement(v,{partiallyChecked:S,value:C,onChange:e=>r(t,e)}),e.createElement(ul,null),e.createElement(N,null,t)),e.createElement(ce,{$gap:24},!h&&u&&e.createElement(k,{title:p.FUTURE_APPS_TITLE,tooltip:p.FUTURE_APPS_DESCRIPTION,initialValue:b,onChange:e=>u(e,t),flipHorizontally:!0}),e.createElement(dl,{$width:108},a!==t||n?.includes(t)?null:e.createElement(Oe,{size:10},"Retrieving workloads...")),e.createElement(dl,null,e.createElement(N,{size:10,color:m.text.grey},x?`${f.length}/${o.length}`:null)),r&&e.createElement(mt,{extend:$}))),($||!r)&&(w?e.createElement(rl,{$addPadding:!c},e.createElement(sl,null,e.createElement(le,{orientation:"vertical",length:(T?24:34*o.length)+"px"})),o.map(a=>{const n=f.some(({name:e})=>e===a.name);return e.createElement(ml,{key:`source-${a.name}`,withInstances:i,source:a,namespace:t,isSelected:n,onSelect:c})})):e.createElement(cl,{$addPadding:!c},g||a===t&&!n?.includes(t)?e.createElement(Re,null):e.createElement(Te,{title:p.NO_SOURCES_NAMESPACE,subTitle:p.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null})):e.createElement(we,null,g||a?e.createElement(Re,null):e.createElement(Te,{title:p.NO_SOURCES,subTitle:!h&&r?p.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:p.PLEASE_ADD_SOURCE}))},ml=({withInstances:t,source:i,namespace:a,isSelected:n,onSelect:o})=>e.createElement(ll,{"data-id":`source-${i.name}`,$selected:n,$withClick:!!o,onClick:()=>o?.(i)},e.createElement(ce,{$gap:12},o&&e.createElement(v,{value:n,onChange:()=>o(i,a)}),e.createElement(ce,{$gap:4},e.createElement(N,null,i.name),e.createElement(N,{opacity:.8,size:10},t?` • ${i.numberOfInstances||0} running instance${1!==i.numberOfInstances?"s":""}`:"",` • ${i.kind}`)))),hl=d.div`
|
|
456
456
|
display: flex;
|
|
457
457
|
flex-direction: column;
|
|
458
458
|
align-items: center;
|
|
@@ -461,62 +461,35 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
461
461
|
max-height: calc(100vh - 200px);
|
|
462
462
|
height: fit-content;
|
|
463
463
|
overflow-y: scroll;
|
|
464
|
-
`,
|
|
464
|
+
`,gl=({onEditStream:t,onEditSources:i,onEditDestinations:a,categories:n})=>{const{selectedStreamName:o}=We(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=dt(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(ie,{$isNotModal:!0},e.createElement(Z,{$gap:12},e.createElement(F,{title:p.SUMMARY,description:p.STREAM_CONFIRM}),e.createElement(hl,null,e.createElement(Y,{title:p.STREAM_NAME,action:()=>e.createElement(_t,{onClick:t}),data:[{title:"",value:o}]}),e.createElement(Y,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(_t,{onClick:i})},e.createElement(pl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Y,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(_t,{onClick:a})},e.createElement(co,{categories:n})))))};var yl;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(yl||(yl={}));const vl=({onClickId:i,defaultSelectedId:a,extendedNavIcons:n})=>{const{isVm:o}=Be(),[r,s]=t(a||""),c=l(()=>[{id:yl.Overview,icon:Ai,selected:r===yl.Overview,onClick:()=>{s(yl.Overview),i(yl.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:yl.Sources,icon:Li,selected:r===yl.Sources,onClick:()=>{s(yl.Sources),i(yl.Sources)},tooltip:"Sources"},{id:yl.Destinations,icon:Pi,selected:r===yl.Destinations,onClick:()=>{s(yl.Destinations),i(yl.Destinations)},tooltip:"Destinations"}];return o||(e.push({id:yl.InstrumentationRules,icon:Mi,selected:r===yl.InstrumentationRules,onClick:()=>{s(yl.InstrumentationRules),i(yl.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:yl.Actions,icon:Ri,selected:r===yl.Actions,onClick:()=>{s(yl.Actions),i(yl.Actions)},tooltip:"Actions"})),e},[o,r]);return e.createElement(Jt,{orientation:"vertical",mainIcons:c,subIcons:d})},bl=({})=>e.createElement(pt,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(Ki,null)),fl=(e,t)=>{const{name:i,kind:a,namespace:n}=e,o=[{title:p.KIND,value:a},{title:p.NAME,value:i,tooltip:"Resource name"}];return t||(o.unshift({title:p.NAMESPACE,value:n}),o.push({type:m.Divider}),o.push({type:m.CopyText,value:`kubectl get ${a} ${i} -n ${n}`.toLowerCase()})),o},xl=d.div`
|
|
465
465
|
display: flex;
|
|
466
466
|
flex-direction: column;
|
|
467
467
|
gap: 24px;
|
|
468
468
|
padding: 4px;
|
|
469
|
-
|
|
469
|
+
`,$l=({formData:t,handleFormChange:i})=>e.createElement(xl,null,e.createElement(x,{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:t.otelServiceName,onChange:({target:{value:e}})=>i("otelServiceName",e)})),Cl=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const i=Ut(t.status),a=at(t.reasonEnum),n=t.message;return e.createElement(ce,{$alignItems:"center",$justifyContent:"center"},e.createElement(se,{status:i,title:a,subtitle:n,withBackground:i!==pe.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Sl=({source:a,fetchSourceDescribe:n})=>{const[o,l]=t(!1),[r,s]=t(null);return i(()=>{a&&n({variables:{namespace:a.namespace,name:a.name,kind:a.kind}}).then(({data:e})=>{e?.describeSource?s(e.describeSource):l(!0)})},[n,a]),r||o?e.createElement(Z,{$gap:12},o?e.createElement(we,{$height:"70vh"},e.createElement(Te,{subTitle:"Could not fetch describe for this source"})):r?.pods?.length?r.pods.map(({podName:t,nodeName:i,phase:n,agentInjected:o,runningLatestWorkloadRevision:l,containers:s})=>{const d=n.status!==B.Success||Gt(s)?B.Error:B.Success,u=[];return u.push(e.createElement(Yt,{value:`kubectl get pod ${t.value} -n ${r?.namespace?.value||a.namespace}`.toLowerCase()})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Xt,{title:i.name,tooltip:i.explain||"",value:{status:i.status||void 0,text:i.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Xt,{title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Xt,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),l?.name&&(u.push(e.createElement(Xt,{title:l.name,tooltip:l.explain||void 0,value:{status:l.status||void 0,text:l.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"}))),s.forEach(t=>{u.push(e.createElement(Zt,{...t}))}),e.createElement(Y,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:()=>e.createElement(se,{status:d,title:d,withIcon:!0,withBorder:!0})},c.toArray(u))}):e.createElement(we,{$height:"70vh"},e.createElement(Te,{subTitle:"Check if you have any running pods and try again"}))):e.createElement(we,{$height:"70vh"},e.createElement(Re,null))},kl=d(ce)`
|
|
470
470
|
width: 100%;
|
|
471
471
|
align-items: center;
|
|
472
472
|
justify-content: space-between;
|
|
473
|
-
`,
|
|
473
|
+
`,wl=({source:a,fetchSourceLibraries:n})=>{const o=E.useTheme(),[l,s]=t(!1),[c,d]=t(null);return i(()=>{a&&n({variables:{namespace:a.namespace,name:a.name,kind:a.kind}}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(wt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[n,a]),c||l?e.createElement(Z,{$gap:12},l?e.createElement(we,{$height:"70vh"},e.createElement(Te,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(Y,{title:"Instrumented Libraries"},c.map(({name:t,healthy:i,nonIdentifyingAttributes:a},n)=>e.createElement(r,{key:`library-${t}`},e.createElement(kl,null,e.createElement(N,{size:12,color:o.text.grey},t),e.createElement(ce,{$gap:4},a.map(({key:i,value:a})=>Qt(a)&&ei(a)&&"is_standard_lib"===i?e.createElement(se,{key:`${t}-${i}`,status:B.Default,title:"STANDARD",withBorder:!0}):null),"boolean"==typeof i&&e.createElement(se,{status:i?B.Success:B.Error,title:i?"HEALTHY":"UNHEALTHY",withBorder:!0}))),n!==c.length-1&&e.createElement(le,{length:"100%",margin:"0"})))):e.createElement(we,{$height:"70vh",$gap:12},e.createElement(Te,{title:"No libraries found",subTitle:""}),e.createElement(ae,{type:B.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(we,{$height:"70vh"},e.createElement(Re,null))};var Tl;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Tl||(Tl={}));const Dl=[ai.Deployment,ai.StatefulSet,ai.DaemonSet,ai.DeploymentConfig],Nl=[ni.Python,ni.Go],El=d.div`
|
|
474
474
|
width: 100%;
|
|
475
475
|
height: 100%;
|
|
476
476
|
max-height: calc(100vh - 220px);
|
|
477
477
|
overflow: overlay;
|
|
478
478
|
overflow-y: auto;
|
|
479
|
-
`,
|
|
479
|
+
`,Ol=d.div`
|
|
480
480
|
display: flex;
|
|
481
481
|
flex-direction: column;
|
|
482
482
|
gap: 12px;
|
|
483
|
-
`,
|
|
483
|
+
`,Fl=({persistSources:a,updateSource:o,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{isVm:u}=Be(),{sources:m}=W(),{selectedStreamName:h}=We(),{drawerType:g,drawerEntityId:y}=P(),v=l(()=>Ue(m,h),[m,h]),b=n(null),f=g===H.Source,[x,$]=t(!1),[C,S]=t(!1),[k,w]=t(Tl.Overview),[T,D]=t(null);i(()=>{f&&y&&s(y).then(e=>D(e||null))},[f,y]);const{formData:E,handleFormChange:O,resetFormData:F,loadFormWithDrawerItem:I}=ti(),A=l(()=>{if(!f)return F();const e=(T&&JSON.stringify(qt(T))===JSON.stringify(qt(y))?T:null)||v?.find(e=>e.namespace===y.namespace&&e.name===y.name&&e.kind===y.kind);return e?I(e):F(),e},[f,y,v,T]),M=l(()=>{const e=A?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===pe.Loading,containers:A?.containers||[]}},[A]),R=l(()=>{const e=[{label:Tl.Overview,onClick:()=>w(Tl.Overview),selected:k===Tl.Overview}];return Dl.includes(A?.kind)&&e.push({label:Tl.Pods,onClick:()=>w(Tl.Pods),selected:k===Tl.Pods}),A?.containers?.some(({language:e})=>Nl.includes(e))&&e.push({label:Tl.Libraries,onClick:()=>w(Tl.Libraries),selected:k===Tl.Libraries}),e},[k,A]);return A?e.createElement(va,{ref:b,onClose:()=>{w(Tl.Overview),D(null)},title:A.otelServiceName||A.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:ze(A.containers),isEdit:x,isFormDirty:C,onEdit:k===Tl.Overview?e=>{$("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=E.otelServiceName!==A.name?E.otelServiceName:"";O("otelServiceName",e),await o(y,{...E,otelServiceName:e}),D(null),S(!1),$(!1)},onDelete:k===Tl.Overview?async()=>{const{namespace:e}=A;a({[e]:[{...A,selected:!1,currentStreamName:h}]},{}),D(null),S(!1),$(!1),b.current?.closeDrawer()}:void 0,onCancel:()=>{S(!1),$(!1),O("otelServiceName",A.otelServiceName||A.name||"")},isLastItem:1===v.length,tabs:R,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([y]),children:e.createElement(e.Fragment,null,e.createElement(Ei,null),e.createElement(N,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},k===Tl.Overview?x?e.createElement(El,null,e.createElement($l,{formData:E,handleFormChange:(...e)=>{S(!0),O(...e),O("currentStreamName",h)}})):e.createElement(Ol,null,e.createElement(Cl,{workloadOdigosHealthStatus:A.workloadOdigosHealthStatus}),e.createElement(G,{conditions:A.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:A?fl(A,u):[]}),e.createElement(Y,{title:u?p.DETECTED_PROCESSES:p.DETECTED_CONTAINERS,titleBadge:M.isLoading?pe.Loading:M.containers.length,description:M.description||(u?p.DETECTED_PROCESSES_DESCRIPTION:p.DETECTED_CONTAINERS_DESCRIPTION)},M.containers.map(t=>e.createElement(ii,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await o(y,e)})))):k===Tl.Pods?e.createElement(Sl,{source:A,fetchSourceDescribe:c}):e.createElement(wl,{source:A,fetchSourceLibraries:d})):null},Il=d.div`
|
|
484
484
|
max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
|
|
485
485
|
width: 100%;
|
|
486
|
-
`,
|
|
486
|
+
`,Al=a(({isModal:t,fetchSingleNamespace:i,onClickSummary:a},n)=>{const l=E.useTheme(),{isVm:r}=Be(),s=oi({fetchSingleNamespace:i}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:$,setShowSelectedOnly:C,showRunningOnly:S,setShowRunningOnly:w}=s;o(n,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const T=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(ie,{$isNotModal:!t},e.createElement(Z,{$gap:12},e.createElement(Z,{$gap:24},a&&e.createElement(gt,{onClick:a}),e.createElement(F,{title:p.SELECT_SOURCES,badgeLabel:T,description:p.SELECT_SOURCES_DESCRIPTION}),e.createElement(ce,{$justifyContent:"space-between"},e.createElement(Il,{$fullWidth:r},e.createElement(x,{placeholder:b===H.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:Si,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(O,{options:[{label:p.SOURCE,value:H.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:p.NAMESPACE,value:H.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:f})),e.createElement(ce,{$gap:36},e.createElement(k,{title:p.SELECT_ALL,initialValue:u,onChange:m,disabled:!!d}),e.createElement(k,{title:p.ONLY_SELECTED,initialValue:$,onChange:C}),e.createElement(k,{title:p.ONLY_RUNNING_INSTANCES,initialValue:S,onChange:w}))),e.createElement(le,null),e.createElement(pl,{isModal:t,...s})))});Al.displayName=Al.name;const Ml=({fetchSingleNamespace:t,persistSources:i})=>{const{currentModal:a,setCurrentModal:o}=Q(),l=a===H.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),r()}},c=n(null);return K({key:"Enter",active:l},s),l?e.createElement(ee,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(Al,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Rl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:p.NAMESPACE,sortable:!0}),t.push({key:"containers",title:p.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Ll=({metrics:t,maxHeight:i,maxWidth:a})=>{const n=E.useTheme(),{isVm:o}=Be(),r=he(),{isThisPending:c}=R(),{selectedStreamName:d}=We(),{sources:u,sourcesLoading:m}=W(),{setDrawerType:h,setDrawerEntityId:g}=P(),{selectedSources:y,setSelectedSources:b}=Ie(),{isAwaitingInstrumentation:f,sourcesToCreate:x,sourcesCreated:$,sourcesToDelete:C,sourcesDeleted:S}=Ae(),k=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,$):C?e(C,S):1},[x,$,C,S]),w=l(()=>Ue(u,d),[u,d]),T=l(()=>Da({instrumentationRules:[],sources:Je(w,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:H.Source}).searchResults.find(({category:e})=>e===H.Source)?.entities||[],[w,r]),[D,O]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),F=s(e=>{if(e){const e={};T.forEach(t=>{const i={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:H.Source,entityId:i})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),b(e)}else b({})},[T]),I=s(e=>{const{namespace:t,name:i,kind:a}=e,n={...y};n[t]||(n[t]=[]);const o=n[t].findIndex(e=>e.name===i&&e.kind===a);-1===o?n[t].push(e):n[t].splice(o,1),b(n)},[y]),A=l(()=>T.map(i=>{const a=qt(i),o=JSON.stringify(a),{hasErrors:l,hasWarnings:r,hasDisableds:s}=re(i.conditions||[]),d=c({entityType:H.Source,entityId:a}),u=!!y[a.namespace]?.find(e=>e.namespace===a.namespace&&e.name===a.name&&e.kind===a.kind);return{status:l?B.Error:r?B.Warning:void 0,faded:s,onClick:()=>{h(H.Source),g(a)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ce,{$gap:16},e.createElement(v,{disabled:d,value:u,onChange:()=>I(i)}),e.createElement(li,{icons:ze(i.containers),id:o}))},{columnKey:"name",value:ve(i,H.Source,{extended:!0})},{columnKey:"kind",value:i.kind,textColor:n.text.info},{columnKey:"namespace",value:i.namespace,textColor:n.text.info},{columnKey:"throughput",value:Ke(Nt(t,H.Source,a).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(wa,{conditions:i.conditions||[],id:o})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:B.Info,title:ri(i.containers),withBorder:!0}))}]}}),[T,y,t,I]),{badge:M,badgeTooltip:L}=l(()=>T.length!==w.length?{badge:`${T.length}/${w.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:w.length,badgeTooltip:void 0},[T,w]);return e.createElement(fe,{$maxWidth:a},e.createElement(xe,null,e.createElement(v,{partiallyChecked:D&&T?.length!==O,value:D&&T?.length===O,onChange:F,disabled:!T?.length}),e.createElement($e,{icon:Ce(H.Source),title:p.SOURCES,badge:M,badgeTooltip:L,loading:m||f})),e.createElement(Se,{$maxHeight:i},e.createElement(ke,{columns:Rl(o),rows:A})),f&&!A.length?e.createElement(we,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(De,{width:420}),e.createElement(ce,{$gap:16},e.createElement(N,{color:n.text.info},x?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Ne,{label:`${k}%`}))):A.length?null:e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(Te,null)))},Pl=({expiresAt:t})=>{const i=E.useTheme(),a=zt().format(t),n=new Date(t).toDateString().split(" ").slice(1).join(" "),o=si(t,0)?i.text.error:si(t,6048e5)?i.text.warning:i.text.success;return e.createElement(N,{size:14,color:o},a," (",n,")")},Kl=d.div`
|
|
487
487
|
position: relative;
|
|
488
|
-
`,
|
|
488
|
+
`,jl=({token:i,saveToken:a})=>{const n=E.useTheme(),{isCopied:o,clickCopy:l}=ci(),{formData:r,handleFormChange:s,resetFormData:c}=di({token:i}),[d,u]=t(!1),p=()=>{u(!1),c()},m=me(B.Success,n);return e.createElement(ce,{$gap:0},e.createElement(pt,{size:32,onClick:()=>l(i)},o?e.createElement(m,null):e.createElement(ji,null)),e.createElement(le,{orientation:"vertical",length:"12px"}),e.createElement(Kl,null,e.createElement(pt,{size:32,onClick:()=>{u(!0)}},e.createElement(fi,null)),d&&e.createElement(ui,{flipX:!0,clientX:36,isOpen:d,onClose:p,onSave:()=>{a(r.token).then(p)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement(x,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>s("token",e.target.value)}))))},Vl=({tokens:t,saveToken:i})=>e.createElement(Y,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:m.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:t.map(({name:t,token:a,expiresAt:n})=>({cells:[{columnKey:"icon",icon:Vi},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Pl,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(jl,{token:a,saveToken:i})}]}))}}]}),ql=({fetchDescribeOdigos:a})=>{const[n,o]=t(null);if(i(()=>{a().then(({data:e})=>{o(e?.describeOdigos||null)})},[a]),!n)return e.createElement(we,null,e.createElement(Re,null));const l=t=>t?.name?[e.createElement(le,{key:`divider-${t.name}`}),e.createElement(Xt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(Qt(t.value)?ei(t.value)?B.Success:B.Error:B.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(Y,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:n?.odigosVersion?.name,value:n?.odigosVersion?.value},{title:n?.kubernetesVersion?.name,value:n?.kubernetesVersion?.value},{title:n?.installationMethod?.name,value:n?.installationMethod?.value},{title:n?.tier?.name,value:n?.tier?.value},{title:"# of sources",value:n?.numberOfSources?.toString()},{title:"# of destinations",value:n?.numberOfDestinations?.toString()}]}),e.createElement(Y,{title:"Cluster Collector",withExtend:!0},Object.values(n?.clusterCollector||{}).map(l)),e.createElement(Y,{title:"Node Collector",withExtend:!0},Object.values(n?.nodeCollector||{}).map(l)))},zl=d.div`
|
|
489
489
|
display: flex;
|
|
490
490
|
flex-direction: column;
|
|
491
491
|
gap: 12px;
|
|
492
|
-
`,
|
|
493
|
-
align-self: stretch;
|
|
494
|
-
display: flex;
|
|
495
|
-
flex-direction: column;
|
|
496
|
-
align-items: flex-start;
|
|
497
|
-
gap: 16px;
|
|
498
|
-
padding: 16px;
|
|
499
|
-
border-radius: 24px;
|
|
500
|
-
background: ${({theme:e})=>e.colors.secondary+I.opacity.hex["004"]};
|
|
501
|
-
`,Xl=d(T)`
|
|
502
|
-
color: ${({theme:e})=>e.text.secondary};
|
|
503
|
-
font-size: 18px;
|
|
504
|
-
font-weight: 600;
|
|
505
|
-
line-height: 20px;
|
|
506
|
-
`,Zl=d(ce)`
|
|
507
|
-
width: 100%;
|
|
508
|
-
gap: 12px;
|
|
509
|
-
align-items: flex-start;
|
|
510
|
-
justify-content: space-between;
|
|
511
|
-
`,er=i(({isAdvanced:t,formData:o,handleFormChange:i},a)=>e.createElement(Ql,{ref:a,id:Yl.Ui},e.createElement(Zl,null,e.createElement(Xl,null,"UI")),e.createElement(x,{title:"Central Backend URL",tooltip:'When running the Centralized UI, you need to specify the URL of the central backend. <a href="https://docs.odigos.io/features/central">Learn more</a>.',required:!0,value:o.centralBackendURL||"",onChange:e=>{const{value:t}=e.target;i("centralBackendURL",t||null)}}),e.createElement(x,{title:"OIDC Tenant URL",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the URL of the OIDC tenant. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',required:!0,value:o.oidc?.tenantUrl||"",onChange:e=>{const{value:t}=e.target;i("oidc.tenantUrl",t||null)}}),e.createElement(x,{title:"OIDC Client ID",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the Client ID of the OIDC application. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',required:!0,value:o.oidc?.clientId||"",onChange:e=>{const{value:t}=e.target;i("oidc.clientId",t||null)}}),e.createElement(x,{title:"OIDC Client Secret",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the Client Secret of the OIDC application. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',type:"password",required:!0,value:o.oidc?.clientSecret||"",onChange:e=>{const{value:t}=e.target;i("oidc.clientSecret",t||null)}}),t&&e.createElement(x,{status:H.Warning,title:"(Advanced) UI Pagination Limit",tooltip:"The pagination limit for fetching data from the UI backend. A larger limit means more data will be fetched at once, reducing the number of requests to the backend. This might increase or decrease the performance of the UI - depending on your environment.",type:"number",required:!0,value:o.uiPaginationLimit?.toString()||"",onChange:e=>{const{value:t}=e.target;i("uiPaginationLimit",""===t?null:Number(t))}})));er.displayName=er.name;const tr=[{id:mo.VirtualDevice,value:"Virtual Device"},{id:mo.HostPath,value:"Host Path"},{id:mo.InitContainer,value:"Init Container"}],or=[{id:ho.Loader,value:"Loader"},{id:ho.PodManifest,value:"Pod Manifest"},{id:ho.LoaderFallbackToPodManifest,value:"Loader Fallback to Pod Manifest"}],ir=[{id:go.CodeAttributes,value:"Code Attributes"},{id:go.FullPayloadCollection,value:"Full Payload Collection"},{id:go.DbPayloadCollection,value:"DB Payload Collection"},{id:go.QueryOperationDetector,value:"Query Operation Detector"},{id:go.AllowConcurrentAgents,value:"Allow Concurrent Agents"},{id:go.JavaEbpfInstrumentations,value:"Java EBPF Instrumentations"},{id:go.JavaNativeInstrumentations,value:"Java Native Instrumentations"},{id:go.SizeS,value:"Size S"},{id:go.SizeM,value:"Size M"},{id:go.SizeL,value:"Size L"}],ar=i(({isAdvanced:t,formData:o,handleFormChange:i},a)=>e.createElement(Ql,{ref:a,id:Yl.General},e.createElement(Zl,null,e.createElement(Xl,null,"General")),e.createElement(x,{title:"Cluster Name",tooltip:'Name of the cluster, this is optional, but required in the Centralized UI. <a href="https://docs.odigos.io/features/central">Learn more</a>.',required:!0,value:o.clusterName||"",onChange:e=>{const{value:t}=e.target;i("clusterName",t||null)}}),e.createElement(S,{title:"Enable the Karpenter Integration",tooltip:'<a href="https://docs.odigos.io/setup/odigos-with-karpenter">Learn how to configure Karpenter</a>. Once the Karpenter tainting setup is complete, inform Odigos to disable node affinity and rely on the taint mechanism.',initialValue:o.karpenterEnabled||!1,onChange:e=>i("karpenterEnabled",e)}),e.createElement(S,{title:"Allow Odigos Alongisde Other Agents",tooltip:"By default Odigos does not instrument applications that are already instrumented by other agents. If you want to allow Odigos to instrument applications that are already instrumented by other agents, enable this option. Note: this is not recommended and should be used only if you know what you are doing.",initialValue:o.allowConcurrentAgents||!1,onChange:e=>i("allowConcurrentAgents",e)}),e.createElement(S,{title:"Disable Automatic Rollout",tooltip:"By default, Odigos automatically rolls out the pods after the instrumentation is complete. If you want to disable rollouts and do it manually, toggle this option.",initialValue:o.rollout?.automaticRolloutDisabled||!1,onChange:e=>i("rollout.automaticRolloutDisabled",e)}),e.createElement(x,{title:"Image Prefix",tooltip:"Docker image prefix for all Odigos components. This is disabled because this setting requires a CLI update.",disabled:!0,required:!0,value:o.imagePrefix||"",onChange:e=>{const{value:t}=e.target;i("imagePrefix",t||null)}}),e.createElement($,{title:"Node Selector",tooltip:"NodeSelector is a map of key-value Kubernetes NodeSelector labels to apply to all Odigos components. Note that Odigos will only be able to instrument applications on the same node. This setting can be applied only via the CLI.",disabled:!0,required:!0,value:Object.entries(o.nodeSelector||{}).map(([e,t])=>({key:e,value:t}))}),e.createElement(at,{title:"Profiles",tooltip:"Enable custom profiles to customize the Odigos instrumentation.",isMulti:!0,options:ir,value:ir.filter(e=>o.profiles?.includes(e.id)),onSelect:e=>i("profiles",[...o.profiles||[],e.id]),onDeselect:e=>i("profiles",o.profiles?.filter(t=>t!==e.id)||[])}),e.createElement(Zl,null,e.createElement(D,{title:"Ignored Namespaces",tooltip:"List of namespaces to exclude from instrumentation. Note: you cannot remove the default namespaces from the list, but you are able to add more namespaces.",required:!0,value:o.ignoredNamespaces||[],onChange:e=>i("ignoredNamespaces",e)}),e.createElement(D,{title:"Ignored Containers",tooltip:"List of container names to exclude from instrumentation, this is a global setting and will be applied to all applications",required:!0,value:o.ignoredContainers||[],onChange:e=>i("ignoredContainers",e)})),t&&e.createElement(e.Fragment,null,e.createElement(at,{status:H.Warning,title:"(Advanced) Mount Method",tooltip:'For Odigos agents to run inside instrumented pod containers, certain files must be mounted into the container. In Kubernetes, these files are mounted under `/var/odigos` directory, with subdirectories for each agent. <a href="https://docs.odigos.io/instrumentations/configuration/mount-method#agent-mount-method">Learn more</a>.',options:tr,required:!0,value:tr.find(e=>e.id===o.mountMethod)||void 0,onSelect:e=>i("mountMethod",e.id)}),e.createElement(at,{status:H.Warning,title:"(Advanced) Agent Envs Injection Method",tooltip:"In order for Odigos to instrument applications, it needs to inject environment variables into the application. This setting controls how Odigos injects these environment variables.",options:or,required:!0,value:or.find(e=>e.id===o.agentEnvVarsInjectionMethod)||void 0,onSelect:e=>i("agentEnvVarsInjectionMethod",e.id)}),e.createElement(x,{status:H.Warning,title:"(Advanced) Odiglet Health Probe Port",tooltip:"If the Odiglet is running with a host network, it may conflict with the port of other processes. This setting allows you to specify a different port for the health probe.",type:"number",required:!0,value:o.odigletHealthProbeBindPort?.toString()||"",onChange:e=>{const{value:t}=e.target;i("odigletHealthProbeBindPort",""===t?null:Number(t))}}),e.createElement(x,{status:H.Warning,title:"(Advanced) Custom Container Runtime Socket Path",tooltip:"If containerd is located in a different path than the default supported path by Odigos, then you can specify the socket path here.",required:!0,value:o.customContainerRuntimeSocketPath||"",onChange:e=>{const{value:t}=e.target;i("customContainerRuntimeSocketPath",t||null)}}))));ar.displayName=ar.name;const nr=i(({formData:t,handleFormChange:o},i)=>e.createElement(Ql,{ref:i,id:Yl.Rollback},e.createElement(Xl,null,"Rollback"),e.createElement(S,{title:"Rollback Disabled",tooltip:"Disable rollback",initialValue:t.rollbackDisabled||!1,onChange:e=>o("rollbackDisabled",e)}),e.createElement(Zl,null,e.createElement(x,{title:"Rollback Grace Time",tooltip:"This is the amount of time that a pod should be in the `CrashLoopBackoff` state before it is rolled back. Pods that are in the `CrashLoopBackoff` state for longer than this time will be rolled back.",required:!0,value:t.rollbackGraceTime||"",onChange:e=>{const{value:t}=e.target;o("rollbackGraceTime",t||null)}}),e.createElement(x,{title:"Rollback Stability Window",tooltip:"This is the time-window in which the pod should be in the `CrashLoopBackoff` state before it is rolled back. Pods that are in the `CrashLoopBackoff` state after this window will not be rolled back.",required:!0,value:t.rollbackStabilityWindow||"",onChange:e=>{const{value:t}=e.target;o("rollbackStabilityWindow",t||null)}}))));nr.displayName=nr.name;const lr=i(({isAdvanced:t,formData:o,handleFormChange:i},a)=>e.createElement(Ql,{ref:a,id:Yl.CollectorNode},e.createElement(Zl,null,e.createElement(Xl,null,"Collector Node")),e.createElement(Zl,null,e.createElement(x,{title:"Request Memory",tooltip:"You can optionally specify how much memory the collector node should request (in megabytes).",type:"number",required:!0,value:o.collectorNode?.requestMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.requestMemoryMiB",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit Memory",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.limitMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.limitMemoryMiB",""===t?null:Number(t))}})),e.createElement(Zl,null,e.createElement(x,{title:"Request CPU",tooltip:"You can optionally specify how much CPU the collector node should request (in millicores).",type:"number",required:!0,value:o.collectorNode?.requestCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.requestCPUm",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit CPU",tooltip:"You can optionally specify how much CPU the collector node should limit (in millicores).",type:"number",required:!0,value:o.collectorNode?.limitCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.limitCPUm",""===t?null:Number(t))}})),t&&e.createElement(e.Fragment,null,e.createElement(x,{status:H.Warning,title:"(Advanced) K8s Node Logs Directory",tooltip:"If `/var/log` is a symlink, you can specify the target directory for Kubernetes logs here.",required:!0,value:o.collectorNode?.k8sNodeLogsDirectory||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.k8sNodeLogsDirectory",t||null)}}),e.createElement(x,{status:H.Warning,title:"(Advanced) Own Metrics Port",tooltip:"If the collector node is running with a host network, it may conflict with the port of other processes. This setting allows you to specify a different port for the own metrics.",type:"number",required:!0,value:o.collectorNode?.collectorOwnMetricsPort?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.collectorOwnMetricsPort",""===t?null:Number(t))}}),e.createElement(Zl,null,e.createElement(x,{status:H.Warning,title:"(Advanced) Memory Limiter Limit",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.memoryLimiterLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.memoryLimiterLimitMiB",""===t?null:Number(t))}}),e.createElement(x,{status:H.Warning,title:"(Advanced) Memory Limiter Spike Limit",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.memoryLimiterSpikeLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.memoryLimiterSpikeLimitMiB",""===t?null:Number(t))}})),e.createElement(x,{status:H.Warning,title:"(Advanced) Go Memory Limit",tooltip:"Sets the GOMEMLIMIT environment variable to control Go runtime memory usage. This soft memory limit helps the garbage collector prevent out-of-memory conditions in Kubernetes by triggering more aggressive garbage collection as memory usage approaches the limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.goMemLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.goMemLimitMiB",""===t?null:Number(t))}}))));lr.displayName=lr.name;const rr=i(({isAdvanced:t,formData:o,handleFormChange:i},a)=>e.createElement(Ql,{ref:a,id:Yl.CollectorGateway},e.createElement(Zl,null,e.createElement(Xl,null,"Collector Gateway")),e.createElement(Zl,null,e.createElement(x,{title:"Autoscaler Min. Replicas",tooltip:"You can optionally specify the minimum number of replicas for the collector gateway.",type:"number",required:!0,value:o.collectorGateway?.minReplicas?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.minReplicas",""===t?null:Number(t))}}),e.createElement(x,{title:"Autoscaler Max. Replicas",tooltip:"You can optionally specify the maximum number of replicas for the collector gateway.",type:"number",required:!0,value:o.collectorGateway?.maxReplicas?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.maxReplicas",""===t?null:Number(t))}})),e.createElement(Zl,null,e.createElement(x,{title:"Request Memory",tooltip:"You can optionally specify how much memory the collector gateway should request (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.requestMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.requestMemoryMiB",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit Memory",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.limitMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.limitMemoryMiB",""===t?null:Number(t))}})),e.createElement(Zl,null,e.createElement(x,{title:"Request CPU",tooltip:"You can optionally specify how much CPU the collector gateway should request (in millicores).",type:"number",required:!0,value:o.collectorGateway?.requestCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.requestCPUm",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit CPU",tooltip:"You can optionally specify how much CPU the collector gateway should limit (in millicores).",type:"number",required:!0,value:o.collectorGateway?.limitCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.limitCPUm",""===t?null:Number(t))}})),t&&e.createElement(e.Fragment,null,e.createElement(Zl,null,e.createElement(x,{status:H.Warning,title:"(Advanced) Memory Limiter Limit",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.memoryLimiterLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.memoryLimiterLimitMiB",""===t?null:Number(t))}}),e.createElement(x,{status:H.Warning,title:"(Advanced) Memory Limiter Spike Limit",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.memoryLimiterSpikeLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.memoryLimiterSpikeLimitMiB",""===t?null:Number(t))}})),e.createElement(x,{status:H.Warning,title:"(Advanced) Go Memory Limit",tooltip:"Sets the GOMEMLIMIT environment variable to control Go runtime memory usage. This soft memory limit helps the garbage collector prevent out-of-memory conditions in Kubernetes by triggering more aggressive garbage collection as memory usage approaches the limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.goMemLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.goMemLimitMiB",""===t?null:Number(t))}}))));rr.displayName=rr.name;const sr=d.div`
|
|
512
|
-
display: flex;
|
|
513
|
-
flex-direction: column;
|
|
514
|
-
gap: 12px;
|
|
515
|
-
max-height: 100vh;
|
|
516
|
-
overflow-y: auto;
|
|
517
|
-
`,cr=d.div`
|
|
518
|
-
position: relative;
|
|
519
|
-
`,dr="System Settings",ur=({installationMethod:i,fetchSettings:n,onSave:l})=>{const[r,s]=t(void 0),[c,d]=t(!1),[u,p]=t(!1),[m,h]=t(!1),g=()=>h(e=>!e),{popupRef:y,popupOpen:v,setPopupOpen:f}=Xe(),{formData:b,handleFormChange:x,resetFormData:C,isFormDirty:k}=uo(r);o(()=>{m?n().then(s):s(void 0)},[m]);const[w,$]=t(!1),[D,N]=t(null),I=e=>{k?($(!0),N(()=>e)):e()},[O,E]=t(Yl.General),A=a(null),M=a(null),F=a(null),R=a(null),L=a(null),P=a(null),q=[M,F,R,L,P],V=[Yl.General,Yl.Ui,Yl.Rollback,Yl.CollectorNode,Yl.CollectorGateway];return e.createElement(e.Fragment,null,e.createElement(pt,{key:dr,onClick:g,tooltip:dr},e.createElement(_o,{size:18})),e.createElement(j,{width:"750px",isOpen:m,onClose:()=>I(g),header:{icons:[_o],title:dr,tabs:V.map(e=>({label:e,onClick:()=>(e=>{E(e),(e=>{const t=A.current;if(!t)return;let o=0;for(let i=0;i<q.length;i++){const a=q[i].current;if(a&&a.id===e){const e=t.getBoundingClientRect();o=a.getBoundingClientRect().top-e.top+t.scrollTop;break}}t.scrollTo({top:e===Yl.General?0:o,behavior:"smooth"})})(e)})(e),selected:O===e})),actions:[e.createElement(cr,{key:"actions"},e.createElement(pt,{withBorder:!0,onClick:()=>f(e=>!e)},e.createElement(T,{size:10},"•••")),e.createElement(Ze,{ref:y,isOpen:v,top:36,right:0,padding:"24px",width:"270px"},e.createElement(S,{title:"Enable Advanced Mode",tooltip:"Show advanced settings. Note: these are not recommended to be changed unless you know what you are doing.",initialValue:u,onChange:()=>p(e=>!e),flipHorizontally:!0})))]},footer:{isOpen:k,centerButtons:[{"data-id":"drawer-cancel",variant:"secondary",onClick:()=>I(C),children:K.CANCEL},{"data-id":"drawer-save",variant:"primary",onClick:async()=>{d(!0),await l(b),s(await n()),d(!1),C(),g()},children:K.SAVE}]}},void 0===b?.imagePrefix||c?e.createElement($e,null,e.createElement(Re,{scale:1.2})):e.createElement(sr,{ref:A},i===yo.Helm&&e.createElement(ie,{type:H.Warning,title:"Helm",message:"Changes won't persist unless you update the `values.yaml` file"}),e.createElement(ar,{ref:M,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(er,{ref:F,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(nr,{ref:R,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(lr,{ref:L,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(rr,{ref:P,isAdvanced:u,formData:b,handleFormChange:x}))),e.createElement(z,{isOpen:w,name:dr,onApprove:()=>{D?.(),$(!1)},onDeny:()=>{$(!1)}}))},pr=d.div`
|
|
492
|
+
`,Hl="System Overview",Bl=({tokens:i,saveToken:a,fetchDescribeOdigos:n})=>{const[o,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(pt,{key:Hl,onClick:r,tooltip:Hl},e.createElement(qi,{size:18})),e.createElement(V,{width:"750px",isOpen:o,onClose:r,header:{icons:[qi],title:Hl},footer:{isOpen:!1}},e.createElement(zl,null,!!i?.length&&e.createElement(Vl,{tokens:i,saveToken:a}),e.createElement(ql,{fetchDescribeOdigos:n}))))},Wl=d.div`
|
|
520
493
|
position: fixed;
|
|
521
494
|
bottom: 12px;
|
|
522
495
|
left: 12px;
|
|
@@ -525,7 +498,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
525
498
|
flex-direction: column-reverse;
|
|
526
499
|
gap: 6px;
|
|
527
500
|
max-width: 600px;
|
|
528
|
-
`,
|
|
501
|
+
`,_l=()=>{const{notifications:t,markAsDismissed:i,markAsSeen:a}=L(),{onClickNotification:n}=Ht();return e.createElement(Wl,null,t.filter(({dismissed:e})=>!e).map(({id:t,type:o,title:l,message:r,crdType:s,target:c})=>e.createElement(ae,{key:`toast-${t}`,id:t,type:o,title:l,message:r,action:s&&c?{label:"go to details",onClick:()=>n({id:t,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{i(e),t&&a(e)})({id:t,asSeen:!0})})))},Jl=d.div`
|
|
529
502
|
position: relative;
|
|
530
503
|
display: flex;
|
|
531
504
|
align-items: center;
|
|
@@ -544,7 +517,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
544
517
|
stroke: ${({theme:e})=>e.text.secondary};
|
|
545
518
|
}
|
|
546
519
|
}
|
|
547
|
-
`,
|
|
520
|
+
`,Ul=d.div`
|
|
548
521
|
position: absolute;
|
|
549
522
|
top: 2px;
|
|
550
523
|
left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
|
|
@@ -554,50 +527,50 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
554
527
|
background-color: ${({theme:e})=>e.colors.border};
|
|
555
528
|
border-radius: 100%;
|
|
556
529
|
transition: all 0.3s;
|
|
557
|
-
`,
|
|
530
|
+
`,Gl=({path:t})=>e.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t})),Yl=()=>{const{darkMode:t,setDarkMode:i}=pi();return e.createElement(Jl,{onClick:()=>i(!t)},e.createElement(Gl,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),e.createElement(Gl,{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"}),e.createElement(Ul,{$darkMode:t}))},Xl=e=>{const{spans:t}=e,i=new Map;t.forEach(e=>{i.set(e.spanID,{...e,spans:[]})});const a=[];return t.forEach(e=>{const t=i.get(e.spanID);let n=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&i.has(t.spanID)||(n=!0)}else n=!0;if(n)a.push(t);else{const a=e.references.find(e=>"CHILD_OF"===e.refType);if(a){const e=i.get(a.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),a.sort((e,t)=>e.startTime-t.startTime)},Zl=(e,t)=>{const{tags:i}=e,a={},n=[];return i.forEach(e=>{a[e.key]=e.value}),n.push({type:m.Code,value:{language:"json",code:JSON.stringify(a,null,2),pretty:t}}),n},Ql=e=>{const{logs:t}=e,i=[];return t.forEach((e,a)=>{e.fields.forEach(e=>{i.push({title:e.key,value:e.value})}),a!==t.length-1&&i.push({type:m.Divider})}),i},er=e=>{const{traceID:t,spanID:i,processID:a,operationName:n,duration:o,startTime:l,warnings:r}=e,s=[];return s.push({type:m.CopyText,title:"Trace ID",value:t}),s.push({type:m.CopyText,title:"Span ID",value:i}),s.push({type:m.Divider}),s.push({title:"Service",value:a}),s.push({title:"Operation",value:n}),s.push({title:"Duration",value:mi(o)}),s.push({title:"Start time",value:new Date(l/1e3).toLocaleString()}),r.length&&(s.push({type:m.Divider}),s.push({title:"Warnings",titleIcon:zi,value:r})),s},tr=(e,t)=>{const{tags:i}=e,a={},n=[];return i.forEach(e=>{a[e.key]=e.value}),n.push({type:m.Code,value:{language:"json",code:JSON.stringify(a,null,2),pretty:t}}),n},ir=d.div`
|
|
558
531
|
display: flex;
|
|
559
532
|
flex-direction: column;
|
|
560
533
|
gap: 12px;
|
|
561
534
|
max-height: 100vh;
|
|
562
535
|
overflow-y: auto;
|
|
563
|
-
`,
|
|
536
|
+
`,ar=({span:i,process:a,onClose:n})=>{const[o,l]=t(!0),[r,s]=t(!0);return e.createElement(V,{width:"750px",isOpen:!0,onClose:n,header:{icons:[Hi],title:i.operationName},footer:{isOpen:!1}},e.createElement(ir,null,e.createElement(Y,{title:"Details",data:er(i)}),i.logs.length>0&&e.createElement(Y,{title:"Errors",titleBadge:i.logs.length,titleIcon:Bi,data:Ql(i)}),e.createElement(Y,{title:"Tags",data:Zl(i,o),action:e.createElement(hi,{isPrettyMode:o,setIsPrettyMode:l})}),a&&e.createElement(Y,{title:`Process (${a.serviceName})`,data:tr(a,r),action:e.createElement(hi,{isPrettyMode:r,setIsPrettyMode:s})})))},nr=370,or=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),lr=d.div`
|
|
564
537
|
display: flex;
|
|
565
538
|
align-items: center;
|
|
566
|
-
width: ${
|
|
567
|
-
background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+
|
|
539
|
+
width: ${nr}px;
|
|
540
|
+
background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+E.opacity.hex["042"]:t.colors.dark_grey};
|
|
568
541
|
&:hover {
|
|
569
|
-
${({$withErrors:e,$preventHover:t,theme:
|
|
542
|
+
${({$withErrors:e,$preventHover:t,theme:i})=>!t&&`background-color: ${e?i.colors.error:i.colors.secondary+E.opacity.hex["010"]};`}
|
|
570
543
|
cursor: ${({$preventHover:e})=>e?"default":"pointer"};
|
|
571
544
|
}
|
|
572
|
-
`,
|
|
545
|
+
`,rr=d(ce)`
|
|
573
546
|
align-items: center;
|
|
574
547
|
justify-content: space-between;
|
|
575
548
|
gap: 4px;
|
|
576
549
|
padding: 12px;
|
|
577
550
|
padding-left: ${({$depth:e})=>12*e||12}px;
|
|
578
|
-
width: calc(${
|
|
579
|
-
`,
|
|
551
|
+
width: calc(${nr}px - ${({$depth:e})=>12*e}px);
|
|
552
|
+
`,sr=d(ce)`
|
|
580
553
|
align-items: center;
|
|
581
554
|
gap: 4px;
|
|
582
555
|
position: absolute;
|
|
583
556
|
right: 56px;
|
|
584
557
|
width: calc(100% - ${434}px);
|
|
585
|
-
`,
|
|
558
|
+
`,cr=d.div`
|
|
586
559
|
position: absolute;
|
|
587
|
-
left: ${({$startTime:e,$minStartTime:t,$maxEndTime:
|
|
560
|
+
left: ${({$startTime:e,$minStartTime:t,$maxEndTime:i})=>(e-t)/(i-t)*100+"%"};
|
|
588
561
|
width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
|
|
589
562
|
height: 12px;
|
|
590
563
|
border-radius: 32px;
|
|
591
|
-
background-color: ${({$indexInMatrix:e})=>
|
|
592
|
-
`,
|
|
564
|
+
background-color: ${({$indexInMatrix:e})=>or[e%or.length]};
|
|
565
|
+
`,dr=d(N)`
|
|
593
566
|
padding-left: calc(100% + 8px);
|
|
594
567
|
font-size: 10px;
|
|
595
568
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
596
569
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
597
570
|
white-space: nowrap;
|
|
598
|
-
`,
|
|
571
|
+
`,ur=({span:i,depth:a,indexInMatrix:n,maxDuration:o,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=E.useTheme(),[g,y]=t(!1),v=nr-12*a-20-(s?12:0),b=s&&(1===a||i.logs.length>0);return e.createElement(lr,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(rr,{$depth:a,className:"span-left"},e.createElement(ce,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(pt,{onClick:e=>{e.stopPropagation(),p?.()},size:24},e.createElement(mt,{extend:d??!1}))):e.createElement("div",{style:{width:"24px"}}),e.createElement(yi,{maxWidth:v/2,text:i.processID,textSize:14}),e.createElement(N,{size:12,color:h.text.darker_grey},"•"),e.createElement(yi,{maxWidth:v/2,text:i.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(b?e.createElement(ue,{...c},e.createElement(Bi,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(le,{type:B.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(sr,{className:"span-right"},e.createElement(cr,{$indexInMatrix:n,$duration:i.duration,$maxDuration:o,$startTime:i.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(dr,null,mi(i.duration)))))},pr=({spans:t,logs:i,depth:a,indexInMatrix:n,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=E.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=i.length?i:gi(t,"spans","logs"),y=g.length>0,v=y?g.length>1?`(${g.length}) errors`:g[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,b=y?g.length>1?void 0:g[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e.createElement("div",{key:`span-${p}`,style:{borderBottom:1===a?`1px dotted ${d.colors.border}`:"none"}},e.createElement(ur,{span:t,depth:a,indexInMatrix:n+u+a,maxDuration:o,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Bi,title:v,text:b},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...gi(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(pr,{spans:t.spans||[],logs:g,depth:a+1,indexInMatrix:n+u,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},mr=d.div`
|
|
599
572
|
width: 100%;
|
|
600
|
-
`,
|
|
573
|
+
`,hr=d.div`
|
|
601
574
|
max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
602
575
|
overflow: auto;
|
|
603
576
|
|
|
@@ -607,22 +580,22 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperative
|
|
|
607
580
|
border-radius: 24px;
|
|
608
581
|
border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
609
582
|
position: relative;
|
|
610
|
-
`,
|
|
583
|
+
`,gr=d.div`
|
|
611
584
|
padding: 12px 12px 12px 24px;
|
|
612
|
-
width: calc(${
|
|
585
|
+
width: calc(${nr}px - 36px);
|
|
613
586
|
background-color: ${({theme:e})=>e.colors.dark_grey};
|
|
614
|
-
`,
|
|
587
|
+
`,yr=d.div`
|
|
615
588
|
width: 1px;
|
|
616
589
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
617
590
|
background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
|
|
618
591
|
|
|
619
592
|
position: absolute;
|
|
620
|
-
left: calc(${
|
|
621
|
-
`,
|
|
593
|
+
left: calc(${nr}px + ((100% - ${nr}px) / ${5}) * ${({index:e})=>e});
|
|
594
|
+
`,vr=d(N)`
|
|
622
595
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
623
596
|
font-size: 12px;
|
|
624
597
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
625
598
|
padding-top: 12px;
|
|
626
599
|
padding-left: 12px;
|
|
627
600
|
white-space: nowrap;
|
|
628
|
-
`,
|
|
601
|
+
`,br=({heightToRemove:i,traces:a,isLoading:n})=>{const[o,r]=t([]),[s,c]=t(null),d=l(()=>wt(a).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:Xl(e)})),[a]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),m=l(()=>{const e=d.find(e=>e.spans.some(e=>e.spanID===s?.spanID)),t=e?.processes.find(e=>e.serviceName===s?.processID);return t},[d,s]);return e.createElement(e.Fragment,null,e.createElement(mr,{$heightToRemove:i},n?e.createElement(we,{$height:"50vh"},e.createElement(Re,{scale:1.5})):d.length?e.createElement(hr,{$heightToRemove:i},e.createElement(gr,null,e.createElement(N,null,"Service & operation")),new Array(5).fill(null).map((t,a)=>e.createElement(yr,{key:`${a}-divider`,$heightToRemove:i,index:a},e.createElement(vr,null,mi(u/5*a)))),d.map((t,i)=>{const{spans:a}=t,n=a.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),l=a.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return e.createElement(pr,{key:`recursive-spans-${t.traceID}`,spans:a,logs:[],depth:1,indexInMatrix:i,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:o,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(we,{$height:"50vh"},e.createElement(Te,{title:p.NO_TRACES_FOUND,subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(ar,{span:s,process:m,onClose:()=>c(null)}))};export{$a as ActionDrawer,ya as ActionForm,Sa as ActionModal,Ea as ActionTable,Ma as AwaitPipeline,tn as ConditionDropdown,Ya as DataFlow,Dn as DataFlowActionsMenu,vn as DataStreamDrawer,gn as DataStreamForm,En as DataStreamModal,Nn as DataStreamSelectionForm,zn as DestinationDrawer,jn as DestinationForm,ro as DestinationModal,mo as DestinationSelectionForm,go as DestinationTable,an as ErrorDropdown,Fo as InstrumentationRuleDrawer,No as InstrumentationRuleForm,Mo as InstrumentationRuleModal,Po as InstrumentationRuleTable,rn as KindDropdown,nn as LanguageDropdown,on as MonitorDropdown,jo as MultiSourceControl,ln as NamespaceDropdown,yl as NavIconIds,Wo as NotificationManager,va as OverviewDrawer,il as ServiceMap,gl as SetupSummary,vl as SideNav,bl as SlackInvite,Fl as SourceDrawer,$l as SourceForm,Ml as SourceModal,Al as SourceSelectionForm,Ll as SourceTable,Bl as SystemOverview,wa as TableCellConditions,_l as ToastList,Yl as ToggleDarkMode,br as TraceView};
|