@odigos/ui-kit 0.0.154 → 0.0.156
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 +16 -0
- package/lib/chunks/{index-64462d3a.js → index-edf5386a.js} +1 -1
- package/lib/chunks/{ui-components-ea48d4a4.js → ui-components-4a2e974a.js} +304 -305
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/source-drawer/describe/index.d.ts +1 -3
- package/lib/containers/source-drawer/libraries/index.d.ts +1 -3
- package/lib/containers/v2.js +1 -1
- package/lib/containers.js +109 -108
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks/index.d.ts +0 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/package.json +1 -1
- package/lib/hooks/useTransition.d.ts +0 -14
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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,useTheme as p}from"styled-components";import{H as m,J as h,K as g,M as y,Q as v,R as b,V as f,X as x,Y as $,Z as k,_ as C,$ as S,a0 as w,a1 as T,a2 as D,a3 as N,a4 as E,t as O,a5 as F,a6 as I,a7 as A,a8 as M,a9 as R,aa as L,ab as P,ac as K,ad as j,ae as V,af as q,ag as z,ah as H,ai as B,h as W,aj as _,ak as J,al as U,am as Y,an as G,ao as X,ap as Z,
|
|
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,useTheme as p}from"styled-components";import{H as m,J as h,K as g,M as y,Q as v,R as b,V as f,X as x,Y as $,Z as k,_ as C,$ as S,a0 as w,a1 as T,a2 as D,a3 as N,a4 as E,t as O,a5 as F,a6 as I,a7 as A,a8 as M,a9 as R,aa as L,ab as P,ac as K,ad as j,ae as V,af as q,ag as z,ah as H,ai as B,h as W,aj as _,ak as J,al as U,am as Y,an as G,ao as X,ap as Z,aq as Q,F as ee,ar as te,as as ie,at as ae,au as ne,av as oe,aw as le,ax as re,ay as se,az as ce,aA as de,i as ue,aB as pe,aC as me,aD as he,aE as ge,aF as ye,aG as ve,aH as be,aI as fe,aJ as xe,aK as $e,aL as ke,aM as Ce,aN as Se,aO as we,aP as Te,c as De,N as Ne,aQ as Ee,aR as Oe,aS as Fe,aT as Ie,aU as Ae,aV as Me,aW as Re,aX as Le,m as Pe,aY as Ke,aZ as je,a_ as Ve,a$ as qe,b0 as ze,b1 as He,b2 as Be,b3 as We,b4 as _e,b5 as Je,b6 as Ue,b7 as Ye,b8 as Ge,b9 as Xe,ba as Ze,bb as Qe,bc as et,bd as tt,be as it,bf as at,bg as nt,bh as ot,bi as lt,bj as rt,bk as st,bl as ct,bm as dt,bn as ut,bo as pt,bp as mt,bq as ht,br as gt,bs as yt,bt as vt,bu as bt,bv as ft,bw as xt,bx as $t,by as kt,bz as Ct,bA as St,bB as wt,bC as Tt,bD as Dt,bE as Nt,bF as Et,bG as Ot,bH as Ft,bI as It,bJ as At,bK as Mt,bL as Rt,bM as Lt,bN as Pt,bO as Kt,bP as jt,bQ as Vt,bR as qt,q as zt,bS as Ht,bT as Bt,bU as Wt,bV as _t,bW as Jt,bX as Ut,bY as Yt,bZ as Gt,b_ as Xt,b$ as Zt,c0 as Qt,g as ei,c1 as ti,c2 as ii,c3 as ai,c4 as ni,c5 as oi,c6 as li,c7 as ri,c8 as si,c9 as ci,ca as di,u as ui,d as pi,cb as mi,cc as hi,cd as gi,ce as yi,cf as vi,cg as bi,ch as fi}from"./chunks/ui-components-4a2e974a.js";import{VSquareIcon as xi,XSquareIcon as $i,EditIcon as ki,TrashIcon as Ci,OdigosLogoText as Si,PlusIcon as wi,SearchIcon as Ti,FilterIcon as Di,DataStreamIcon as Ni,VIcon as Ei,OdigosLogo as Oi,ArrowIcon as Fi,RefreshLeftArrowIcon as Ii,NotificationIcon as Ai,UserIcon as Mi,ImageErrorIcon as Ri,OverviewIcon as Li,InstrumentationRuleIcon as Pi,ActionIcon as Ki,SourceIcon as ji,DestinationIcon as Vi,SlackLogo as qi,RefreshIcon as zi,KeyIcon as Hi,TerminalIcon as Bi,ExclamationTriangleIcon as Wi,TraceViewIcon as _i}from"./icons.js";import{MarkerType as Ji,useNodesState as Ui,useEdgesState as Yi,applyNodeChanges as Gi}from"@xyflow/react";import{Y as Xi}from"./chunks/index-edf5386a.js";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const Zi=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:p,overwriteExistingValues:v,attributeNamesToDelete:b,renames:f,piiCategories:x,fallbackSamplingRatio:$,samplingPercentage:k,endpointsFilters:C,servicesNameFilters:S,attributeFilters:w}}=e,T=[{title:m.TYPE,value:t},{type:h.ActiveStatus,title:m.STATUS,value:String(!o)},{type:h.Monitors,title:m.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:m.NAME,value:i||""},{title:m.NOTES,value:a||""},{type:h.Divider}];if(t===g.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:h.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||y.Pod}\n`,T.push({title:"Label"+(d.length>1?` #${a+1}`:""),value:n})}),u?.length&&T.push({type:h.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||y.Pod}\n`,T.push({title:"Annotation"+(u.length>1?` #${a+1}`:""),value:n})})),t===g.AddClusterInfo){T.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:i},a)=>{e+=`${t}: ${i}`,a<p.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===g.DeleteAttributes){let e="";b?.forEach((t,i)=>{e+=t,i<b.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===g.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===g.PiiMasking){let e="";x?.forEach((t,i)=>{e+=t,i<x.length-1&&(e+=", ")}),T.push({title:"Categories",value:e})}return t===g.ErrorSampler&&T.push({title:"Sampling Ratio",value:String($)}),t===g.ProbabilisticSampler&&T.push({title:"Sampling Percentage",value:String(k)}),t===g.LatencySampler&&C?.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"+(C.length>1?` #${n+1}`:""),value:o})}),t===g.ServiceNameSampler&&S?.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"+(S.length>1?` #${a+1}`:""),value:n})}),t===g.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},Qi=x.PiiCategories,ea=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 i,forwardRef as a,useRef as n,useImperative
|
|
|
7
7
|
border-radius: 32px;
|
|
8
8
|
padding: 8px;
|
|
9
9
|
`}
|
|
10
|
-
`,ia=[{id:"CREDIT_CARD",label:"Credit Card"}],aa=x.FallbackSamplingRatio,na=[{value:y.Pod,id:y.Pod},{value:y.Namespace,id:y.Namespace}],oa=[{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:na[0].value,componentType:"dropdown",options:na,required:!1}],la=[{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:na[0].value,componentType:"dropdown",options:na,required:!1}],ra=x.EndpointsFilters,sa=[{title:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered.",required:!0},{title:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product.",required:!0},{title:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",required:!0,type:k.Number},{title:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",required:!0,type:k.Number}],ca=x.AttributeNamesToDelete,da=x.Renames,ua=x.ServicesNameFilters,pa=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:k.Number},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:k.Number}],ma=x.SamplingPercentage,ha=x.AttributeFilters,ga=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans).",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span.",required:!0},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:k.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType: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}],ya={[g.K8sAttributes]:({value:t,setValue:a,formErrors:n})=>(i(()=>{t[x.CollectContainerAttributes]||t[x.CollectReplicaSetAttributes]||t[x.CollectWorkloadId]||t[x.CollectClusterId]||t[x.LabelsAttributes]?.length||t[x.AnnotationsAttributes]?.length||(a(x.CollectContainerAttributes,!0),a(x.CollectReplicaSetAttributes,!0),a(x.CollectWorkloadId,!0),a(x.CollectClusterId,!0),a(x.LabelsAttributes,[]),a(x.AnnotationsAttributes,[]))},[]),e.createElement(e.Fragment,null,e.createElement(b,{title:"Collect Container Attributes",value:t[x.CollectContainerAttributes]||!1,onChange:e=>a(x.CollectContainerAttributes,e),errorMessage:n[x.CollectContainerAttributes]}),e.createElement(b,{title:"Collect ReplicaSet Attributes",value:t[x.CollectReplicaSetAttributes]||!1,onChange:e=>a(x.CollectReplicaSetAttributes,e),errorMessage:n[x.CollectReplicaSetAttributes]}),e.createElement(b,{title:"Collect Workload ID",value:t[x.CollectWorkloadId]||!1,onChange:e=>a(x.CollectWorkloadId,e),errorMessage:n[x.CollectWorkloadId]}),e.createElement(b,{title:"Collect Cluster ID",value:t[x.CollectClusterId]||!1,onChange:e=>a(x.CollectClusterId,e),errorMessage:n[x.CollectClusterId]}),e.createElement(S,{columns:oa,value:t[x.LabelsAttributes]||[],onChange:e=>a(x.LabelsAttributes,e),errorMessage:n[x.LabelsAttributes]}),e.createElement(S,{columns:la,value:t[x.AnnotationsAttributes]||[],onChange:e=>a(x.AnnotationsAttributes,e),errorMessage:n[x.AnnotationsAttributes]}))),[g.AddClusterInfo]:({value:t,setValue:i,formErrors:a})=>e.createElement(e.Fragment,null,e.createElement(w,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:t[x.OverwriteExistingValues]||!1,onChange:e=>i(x.OverwriteExistingValues,e)}),e.createElement(T,{title:"Resource Attributes",value:t[x.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>i(x.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:a[x.ClusterAttributes]})),[g.DeleteAttributes]:({value:t,setValue:i,formErrors:a})=>{const n=a[ca],o=t[ca]||[];return e.createElement(D,{title:"Attributes to delete",value:o,onChange:e=>i(ca,e),required:!0,errorMessage:n})},[g.RenameAttributes]:({value:t,setValue:i,formErrors:a})=>{const n=a[da],o=Object.entries(t[da]||{}).map(([e,t])=>({key:e,value:t}));return e.createElement(T,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),i(da,t)},required:!0,errorMessage:n})},[g.PiiMasking]:({value:a,setValue:n,formErrors:o})=>{const l=o[ea],r=a[ea]||[],[s,c]=t(1===r.length);return i(()=>{if(!r.length){const e=ia.map(({id:e})=>e);n(ea,e),c(1===ia.length)}},[]),e.createElement("div",null,e.createElement(v,{title:"Attributes to mask",required:!0}),e.createElement(ta,{$hasError:!!l},ia.map(({id:t,label:i})=>e.createElement(b,{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(ea,i),c(1===i.length)})(t,e)}))),!!l&&e.createElement(f,null,l))},[g.ErrorSampler]:({value:t,setValue:i,formErrors:a})=>{const n=a[aa],o=t[aa];return e.createElement($,{title:"Fallback sampling ratio",required:!0,type:k.Number,min:0,max:100,value:C(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(aa,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[g.ProbabilisticSampler]:({value:t,setValue:i,formErrors:a})=>{const n=a[ma],o=t[ma];return e.createElement($,{title:"Sampling percentage",required:!0,type:k.Number,min:0,max:100,value:C(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(ma,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[g.LatencySampler]:({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,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:a})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(i),fallbackSamplingRatio:Number(a)}));i(ra,t)},errorMessage:n})},[g.ServiceNameSampler]:({value:t,setValue:i,formErrors:a})=>{const n=a[ua],o=t[ua]||[];return e.createElement(S,{columns:pa,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i(ua,t)},errorMessage:n})},[g.SpanAttributeSampler]:({value:t,setValue:i,formErrors:a})=>{const n=a[ha],o=(t[ha]||[]).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:ga,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(ha,t)},errorMessage:n,limitFieldsPerRow:3})}},va=({actionType:t,value:i,setValue:a,formErrors:n})=>{if(!t)return null;const o=ya[t];return o?e.createElement(o,{value:i,setValue:a,formErrors:n}):null},ba=d.div`
|
|
10
|
+
`,ta=[{id:"CREDIT_CARD",label:"Credit Card"}],ia=x.FallbackSamplingRatio,aa=[{value:y.Pod,id:y.Pod},{value:y.Namespace,id:y.Namespace}],na=[{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:aa[0].value,componentType:"dropdown",options:aa,required:!1}],oa=[{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:aa[0].value,componentType:"dropdown",options:aa,required:!1}],la=x.EndpointsFilters,ra=[{title:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered.",required:!0},{title:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product.",required:!0},{title:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",required:!0,type:k.Number},{title:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",required:!0,type:k.Number}],sa=x.AttributeNamesToDelete,ca=x.Renames,da=x.ServicesNameFilters,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:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:k.Number},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:k.Number}],pa=x.SamplingPercentage,ma=x.AttributeFilters,ha=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans).",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span.",required:!0},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:k.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType: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}],ga={[g.K8sAttributes]:({value:t,setValue:a,formErrors:n})=>(i(()=>{t[x.CollectContainerAttributes]||t[x.CollectReplicaSetAttributes]||t[x.CollectWorkloadId]||t[x.CollectClusterId]||t[x.LabelsAttributes]?.length||t[x.AnnotationsAttributes]?.length||(a(x.CollectContainerAttributes,!0),a(x.CollectReplicaSetAttributes,!0),a(x.CollectWorkloadId,!0),a(x.CollectClusterId,!0),a(x.LabelsAttributes,[]),a(x.AnnotationsAttributes,[]))},[]),e.createElement(e.Fragment,null,e.createElement(b,{title:"Collect Container Attributes",value:t[x.CollectContainerAttributes]||!1,onChange:e=>a(x.CollectContainerAttributes,e),errorMessage:n[x.CollectContainerAttributes]}),e.createElement(b,{title:"Collect ReplicaSet Attributes",value:t[x.CollectReplicaSetAttributes]||!1,onChange:e=>a(x.CollectReplicaSetAttributes,e),errorMessage:n[x.CollectReplicaSetAttributes]}),e.createElement(b,{title:"Collect Workload ID",value:t[x.CollectWorkloadId]||!1,onChange:e=>a(x.CollectWorkloadId,e),errorMessage:n[x.CollectWorkloadId]}),e.createElement(b,{title:"Collect Cluster ID",value:t[x.CollectClusterId]||!1,onChange:e=>a(x.CollectClusterId,e),errorMessage:n[x.CollectClusterId]}),e.createElement(S,{columns:na,value:t[x.LabelsAttributes]||[],onChange:e=>a(x.LabelsAttributes,e),errorMessage:n[x.LabelsAttributes]}),e.createElement(S,{columns:oa,value:t[x.AnnotationsAttributes]||[],onChange:e=>a(x.AnnotationsAttributes,e),errorMessage:n[x.AnnotationsAttributes]}))),[g.AddClusterInfo]:({value:t,setValue:i,formErrors:a})=>e.createElement(e.Fragment,null,e.createElement(w,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:t[x.OverwriteExistingValues]||!1,onChange:e=>i(x.OverwriteExistingValues,e)}),e.createElement(T,{title:"Resource Attributes",value:t[x.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>i(x.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:a[x.ClusterAttributes]})),[g.DeleteAttributes]:({value:t,setValue:i,formErrors:a})=>{const n=a[sa],o=t[sa]||[];return e.createElement(D,{title:"Attributes to delete",value:o,onChange:e=>i(sa,e),required:!0,errorMessage:n})},[g.RenameAttributes]:({value:t,setValue:i,formErrors:a})=>{const n=a[ca],o=Object.entries(t[ca]||{}).map(([e,t])=>({key:e,value:t}));return e.createElement(T,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),i(ca,t)},required:!0,errorMessage:n})},[g.PiiMasking]:({value:a,setValue:n,formErrors:o})=>{const l=o[Qi],r=a[Qi]||[],[s,c]=t(1===r.length);return i(()=>{if(!r.length){const e=ta.map(({id:e})=>e);n(Qi,e),c(1===ta.length)}},[]),e.createElement("div",null,e.createElement(v,{title:"Attributes to mask",required:!0}),e.createElement(ea,{$hasError:!!l},ta.map(({id:t,label:i})=>e.createElement(b,{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(Qi,i),c(1===i.length)})(t,e)}))),!!l&&e.createElement(f,null,l))},[g.ErrorSampler]:({value:t,setValue:i,formErrors:a})=>{const n=a[ia],o=t[ia];return e.createElement($,{title:"Fallback sampling ratio",required:!0,type:k.Number,min:0,max:100,value:C(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(ia,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[g.ProbabilisticSampler]:({value:t,setValue:i,formErrors:a})=>{const n=a[pa],o=t[pa];return e.createElement($,{title:"Sampling percentage",required:!0,type:k.Number,min:0,max:100,value:C(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(pa,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[g.LatencySampler]:({value:t,setValue:i,formErrors:a})=>{const n=a[la],o=t[la]||[];return e.createElement(S,{columns:ra,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(la,t)},errorMessage:n})},[g.ServiceNameSampler]:({value:t,setValue:i,formErrors:a})=>{const n=a[da],o=t[da]||[];return e.createElement(S,{columns:ua,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i(da,t)},errorMessage:n})},[g.SpanAttributeSampler]:({value:t,setValue:i,formErrors:a})=>{const n=a[ma],o=(t[ma]||[]).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:ha,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(ma,t)},errorMessage:n,limitFieldsPerRow:3})}},ya=({actionType:t,value:i,setValue:a,formErrors:n})=>{if(!t)return null;const o=ga[t];return o?e.createElement(o,{value:i,setValue:a,formErrors:n}):null},va=d.div`
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
gap: 24px;
|
|
14
14
|
padding: 4px;
|
|
15
|
-
`,
|
|
15
|
+
`,ba=d(E)`
|
|
16
16
|
margin-bottom: 12px;
|
|
17
|
-
`,
|
|
17
|
+
`,fa=({isUpdate:t,action:i,formData:a,formErrors:n,handleFormChange:o})=>{const l=O.useTheme();return e.createElement(va,null,t&&e.createElement("div",null,e.createElement(ba,null,"Status"),e.createElement(F,{options:[{icon:xi,label:m.ENABLED,value:!1,selectedBgColor:l.text.success+O.opacity.hex["050"]},{icon:$i,label:m.DISABLED,value:!0,selectedBgColor:l.text.error+O.opacity.hex["050"]}],selected:a.disabled,setSelected:e=>o("disabled",e)})),!t&&e.createElement(I,{title:"",description:i.docsDescription,actionButton:e.createElement(A,{endpoint:i.docsEndpoint})}),e.createElement(M,{title:"Signals for Processing",required:!0,allowedSignals:i.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>o("signals",e),errorMessage:n.signals}),!t&&e.createElement($,{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(ya,{actionType:i.type,value:a.fields,setValue:(e,t)=>o(`fields.${e}`,t),formErrors:n}),e.createElement(R,{title:"Notes",value:a.notes||"",onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},xa=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:$},k)=>{const C=O.useTheme(),{isThisPending:S}=L(),{addNotification:w}=P(),{drawerType:T,drawerEntityId:D,setDrawerType:N,setDrawerEntityId:F}=K();j({key:"Enter",active:p},()=>Q());const[I,A]=t(!1),[M,R]=t(!1),_=n(null),J=T===B.Source,U=()=>{A(!1),R(!1)},Y=()=>{U(),y&&y(!1),N(null),F(null),g?.()};o(k,()=>({closeDrawer:Y}));const G=()=>{_.current?.clearTitle(),f&&f(),U()},X=()=>{const e=_.current?.isTitleDirty();m||e?R(!0):G()},Z=()=>{A(!0)},Q=()=>{v&&v(_.current?.getTitle()||"")},ee=l(()=>!!T&&S({entityType:T,entityId:D}),[T,D]),te=e=>{w({type:W.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(ki,null),e.createElement(E,{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(Ci,null),e.createElement(E,{color:C.text.error,size:14,family:"secondary",decoration:"underline"},J?V.UNINSTRUMENT:V.DELETE))}),e.createElement(e.Fragment,null,e.createElement(q,{isOpen:!0,onClose:p?X:Y,closeOnEscape:!I&&!M,width:`${a+64}px`,header:{icons:d,iconSrcs:u,title:r,titleTooltip:s,replaceTitleWith:!c&&p?e.createElement($a,{ref:_,title:r}):void 0,actionButtons:ie,tabs:x},footer:{isOpen:p,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:Q,children:V.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:X,children:V.CANCEL}],rightButtons:b?[{"data-id":"drawer-delete",variant:"tertiary",onClick:Z,children:e.createElement(e.Fragment,null,e.createElement(Ci,null),e.createElement(E,{size:14,color:C.text.error,family:"secondary",decoration:"underline"},V.DELETE))}]:[]}},i),e.createElement(z,{isOpen:I,noOverlay:!0,name:`${T}${r?` (${r})`:""}`,type:T,isLastItem:h,onApprove:()=>{b&&b(),U()},onDeny:U}),e.createElement(H,{isOpen:M,noOverlay:!0,name:"edit mode",onApprove:G,onDeny:U}))}),$a=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($,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});$a.displayName=$a.name,xa.displayName=xa.name;const ka=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
|
+
`,Ca=d.div`
|
|
24
24
|
display: flex;
|
|
25
25
|
flex-direction: column;
|
|
26
26
|
gap: 12px;
|
|
27
|
-
`,
|
|
27
|
+
`,Sa=({updateAction:a,deleteAction:o})=>{const{actions:r}=_(),{drawerType:s,drawerEntityId:c}=K(),d=n(null),u=s===B.Action,[p,h]=t(!1),[g,y]=t(!1),{formData:v,formErrors:b,handleFormChange:f,resetFormData:x,validateForm:$,loadFormWithDrawerItem:k}=J(),C=l(()=>{if(c)return r?.find(e=>U(e)===c)},[c,r]);if(i(()=>{u&&C?k(C):x()},[u,C]),!C)return null;const S=Y.find(({type:e})=>e===C.type)||Y.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===C.type)||Y.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===C.type);return e.createElement(xa,{ref:d,title:C.name||C.type,icons:[G(C.type)],isEdit:p,isFormDirty:g,onEdit:e=>{h("boolean"!=typeof e||e)},onSave:e=>{if($({withAlert:!0,alertTitle:Q.Update})){const t=e!==C.type?e:"";f("name",t),a(c,{...v,name:t}),h(!1),y(!1)}},onDelete:()=>{o(c,C.type),h(!1),y(!1),d.current?.closeDrawer()},onCancel:()=>{h(!1),y(!1),k(C)}},p&&S?e.createElement(ka,null,e.createElement(fa,{isUpdate:!0,action:S,formData:v,formErrors:b,handleFormChange:(...e)=>{y(!0),f(...e)}})):e.createElement(Ca,null,e.createElement(X,{conditions:C.conditions||[]}),e.createElement(Z,{title:m.ACTION_DETAILS,data:C?Zi(C):[]})))},wa=d(ee)`
|
|
28
28
|
margin-top: 24px;
|
|
29
29
|
gap: 12px;
|
|
30
|
-
`,
|
|
30
|
+
`,Ta=({createAction:i})=>{const{currentModal:a,setCurrentModal:n}=te(),o=a===B.Action,{formData:l,formErrors:r,handleFormChange:s,resetFormData:c,validateForm:d}=J(),[u,p]=t(void 0),h=()=>{c(),p(void 0),n("")},g=()=>{if(!d({withAlert:!0,alertTitle:Q.Create}))return null;i(l),h()};return j({key:"Enter",active:o},()=>g()),e.createElement(ie,{isOpen:o,onClose:h,header:{title:"Add Action"},actionComponent:e.createElement(ae,{buttons:[{variant:"primary",label:"DONE",onClick:g,disabled:!u}]})},e.createElement(ne,null,e.createElement(I,{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(wa,null,e.createElement(oe,{type:W.Warning,message:le.DEFINED_FOR_ALL_STREAMS(m.ACTIONS)}),e.createElement(re,{options:Y,selectedOption:u,onOptionSelect:e=>{return t=e,c(),s("type",t?.type||""),void p(t);var t},autoFocus:!u?.type})),u?.type?e.createElement("div",null,e.createElement(se,{margin:"16px 0"}),e.createElement(fa,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},Da=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:h,endpointsFilters:v,attributeFilters:b,servicesNameFilters:f}}=e;let x="";if(t===g.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||y.Pod} `,a===l.length-1&&(x+=", ")}),r?.forEach(({annotationKey:e,attributeKey:t,from:i},a)=>{x+=`Annotation: ${e} ${t} ${i||y.Pod} `,a===r.length-1&&(x+=", ")})),t===g.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},i)=>{x+=`${e}: ${t}`,i<s.length-1&&(x+=", ")})),t===g.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===g.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,i],a)=>{x+=`${t}: ${i}`,a<e.length-1&&(x+=", ")})}return t===g.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===g.ErrorSampler&&(x+=String(m)),t===g.ProbabilisticSampler&&(x+=String(h),x+="%"),t===g.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===g.ServiceNameSampler&&f?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),t===g.SpanAttributeSampler&&b?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),x},Na=({conditions:t,id:i})=>{const{errors:a,warnings:n,disableds:o,hasLoadings:r}=l(()=>ce(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(Ea,{conditions:s,id:i}));const c=r?he.Loading:W.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:c,title:c,withBorder:!0,withIcon:!0}))},Ea=({conditions:t,id:i})=>{const a=O.useTheme();return e.createElement(ue,null,pe(t).map(({status:t,type:n,reason:o,message:l,lastTransitionTime:r},s)=>{"loading"!==t&&"disabled"!==t||(t=W.Info);const c=ge(t,a);return e.createElement(me,{key:`condition-${i}-${t}-${n}-${s}`,titleIcon:c,title:n,text:l||o||"",timestamp:r},e.createElement(de,{status:t,title:o||n,withBorder:!0,withIcon:!0}))}))},Oa=({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:B.Source,label:"Sources",count:r.length,entities:[]},{category:B.Action,label:"Actions",count:s.length,entities:[]},{category:B.Destination,label:"Destinations",count:c.length,entities:[]},{category:B.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===B.InstrumentationRule?l:e.category===B.Source?r:e.category===B.Action?s:e.category===B.Destination?c:[]}));return{categories:d,searchResults:u}},Fa=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:m.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:m.NOTES,sortable:!0}],Ia=({maxHeight:t,maxWidth:i})=>{const a=O.useTheme(),n=ye(),{actions:o,actionsLoading:r}=_(),{setDrawerType:s,setDrawerEntityId:c}=K(),d=l(()=>Oa({instrumentationRules:[],sources:[],actions:ve(o,n),destinations:[],searchText:n.searchText,selectedCategory:B.Action}).searchResults.find(({category:e})=>e===B.Action)?.entities||[],[o,n]),u=l(()=>d.map(t=>{const{hasErrors:i,hasWarnings:n,hasDisableds:o}=ce(t.conditions||[]);return{status:i?W.Error:n?W.Warning:void 0,faded:o,onClick:()=>{s(B.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(be,{icon:G(t.type)})},{columnKey:"name",value:fe(t,B.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:Da(t),textColor:a.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(xe,{withLabels:!0,monitors:t.signals||[]})},{columnKey:"conditions",component:()=>e.createElement(Na,{conditions:t.conditions||[],id:t.id})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:t.disabled?W.Error:W.Success,title:t.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[d]),{badge:p,badgeTooltip:h}=l(()=>d.length!==o.length?{badge:`${d.length}/${o.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:o.length,badgeTooltip:void 0},[d,o]);return e.createElement($e,{$maxWidth:i},e.createElement(ke,null,e.createElement(Ce,{icon:Se(B.Action),title:m.ACTIONS,badge:p,badgeTooltip:h,loading:r})),e.createElement(we,{$maxHeight:t},e.createElement(Te,{columns:Fa,rows:u})),!d.length&&e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},Aa=d(ee)`
|
|
31
31
|
// width: 100vw;
|
|
32
32
|
// height: 100vh;
|
|
33
33
|
gap: 64px;
|
|
34
34
|
align-items: center;
|
|
35
35
|
justify-content: center;
|
|
36
|
-
`,
|
|
36
|
+
`,Ma=d(ee)`
|
|
37
37
|
max-width: 400px;
|
|
38
38
|
gap: 12px;
|
|
39
39
|
align-items: center;
|
|
40
40
|
justify-content: center;
|
|
41
|
-
`,
|
|
41
|
+
`,Ra=d(E)`
|
|
42
42
|
text-align: center;
|
|
43
43
|
font-size: 24px;
|
|
44
|
-
`,
|
|
44
|
+
`,La=d(E)`
|
|
45
45
|
text-align: center;
|
|
46
46
|
line-height: 26px;
|
|
47
47
|
color: ${({theme:e})=>e.text.info};
|
|
48
|
-
`,
|
|
48
|
+
`,Pa=()=>{const[a,n]=t(0);return i(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Fe(500),n(e)})()},[]),e.createElement(Aa,null,e.createElement(Si,{size:100}),e.createElement(Ee,{width:400}),e.createElement(Ma,null,e.createElement(ue,{$gap:16},e.createElement(Ra,null,"Preparing your workspace..."),e.createElement(Oe,{label:`${a}%`})),e.createElement(La,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},Ka=d(ee)`
|
|
49
49
|
align-items: center !important;
|
|
50
50
|
justify-content: center !important;
|
|
51
51
|
align-self: stretch;
|
|
@@ -63,7 +63,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
63
63
|
&:hover {
|
|
64
64
|
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+O.opacity.hex["030"]};
|
|
65
65
|
}
|
|
66
|
-
`,
|
|
66
|
+
`,ja=({entityType:t,description:i})=>{const{setCurrentModal:a}=te(),{isThisPending:n}=L(),o=n({entityType:t});return e.createElement(Ka,{onClick:()=>a(t)},e.createElement(ue,{$gap:4},e.createElement(wi,null),o?e.createElement(Ie,{size:14,weight:600,family:"secondary"},"Adding ",t):e.createElement(E,{size:14,weight:600,family:"secondary",decoration:"underline"},"Add ",t)),e.createElement(E,{size:12,align:"center"},o?"Just a few more seconds...":i))},Va=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 i,forwardRef as a,useRef as n,useImperative
|
|
|
71
71
|
display: flex;
|
|
72
72
|
align-items: center;
|
|
73
73
|
border-bottom: 1px solid ${({theme:e})=>e.colors.border};
|
|
74
|
-
`,
|
|
74
|
+
`,qa=d(ue)`
|
|
75
75
|
margin-left: ${({$marginLeft:e})=>e};
|
|
76
|
-
`,
|
|
76
|
+
`,za=d(Ae)`
|
|
77
77
|
width: 24px;
|
|
78
78
|
height: 24px;
|
|
79
79
|
padding: 0;
|
|
80
|
-
`,
|
|
80
|
+
`,Ha=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 i,forwardRef as a,useRef as n,useImperative
|
|
|
86
86
|
height: 4px;
|
|
87
87
|
width: ${({percent:e})=>`${e}%`};
|
|
88
88
|
transition: width 0.3s;
|
|
89
|
-
`,
|
|
89
|
+
`,Ba=({entityType:t,badge:i,badgeTooltip:a,isLoading:n})=>{const o=O.useTheme(),{sources:r}=_(),{isThisPending:s}=L(),{setCurrentModal:c}=te(),{selectedSources:d,setSelectedSources:u}=Me(),{isAwaitingInstrumentation:p,sourcesToCreate:m,sourcesCreated:h,sourcesToDelete:g,sourcesDeleted:y}=Re(),v=Se(t),f=t===B.Source&&p,x=(m?Math.floor(100/m*h):g?Math.floor(100/g*y):0)||1,[$,k]=l(()=>{let e=0;return Object.values(d).forEach(t=>e+=t.length),[0!==e,e]},[d]);return e.createElement(Va,null,t===B.Source&&e.createElement(qa,{$marginLeft:"28px"},e.createElement(b,{partiallyChecked:$&&r?.length!==k,value:$&&r?.length===k,onChange:e=>{if(e){const e={};r?.forEach(t=>{const i={namespace:t.namespace,name:t.name,kind:t.kind};s({entityType:B.Source,entityId:i})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),u(e)}else u({})},disabled:!r?.length})),e.createElement(qa,{$marginLeft:t===B.Source?"0":"28px"},e.createElement(Ce,{icon:v,title:`${t}s`,badge:f?`${x}%`:i,badgeTooltip:a,loading:n&&!f})),e.createElement(qa,{$marginLeft:"auto"},e.createElement(za,{"data-id":`add-${t}`,variant:"primary",onClick:()=>c(t)},e.createElement(wi,{fill:o.colors.primary,size:18}))),f&&e.createElement(Ha,{percent:x}))},Wa=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 i,forwardRef as a,useRef as n,useImperative
|
|
|
101
101
|
align-items: center;
|
|
102
102
|
justify-content: center;
|
|
103
103
|
white-space: nowrap;
|
|
104
|
-
`,
|
|
104
|
+
`,_a=({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=O.useTheme(),y=i===B.Source,v="boolean"==typeof m,{setDrawerType:b,setDrawerEntityId:f}=K(),{isThisPending:x}=L(),$=x({entityType:i,entityId:t}),{selectedSources:k,setSelectedSources:C}=Me(),S={...k},{namespace:w,name:T,kind:D}=h;y&&!S[w]&&(S[w]=[]);const N=y?S[w].findIndex(e=>e.name===T&&e.kind===D):-1;return e.createElement(Le,{"data-id":i===B.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?ge(W.Info,g):a?ge(a,g):void 0,n=$||t?e.createElement(Pe,{scale:.8}):i?e.createElement(i,{size:14}):null;return r?e.createElement(Wa,{$isError:a===W.Error},e.createElement(me,{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?S[w].push(h):S[w].splice(N,1),C(S)},isCheckboxDisabled:$}})},Ja=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 i,forwardRef as a,useRef as n,useImperative
|
|
|
109
109
|
border: 1px dashed ${({theme:e})=>e.colors.border};
|
|
110
110
|
border-radius: 24px;
|
|
111
111
|
position: relative;
|
|
112
|
-
`,
|
|
112
|
+
`,Ua=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 i,forwardRef as a,useRef as n,useImperative
|
|
|
124
124
|
justify-content: center;
|
|
125
125
|
|
|
126
126
|
pointer-events: none;
|
|
127
|
-
`,
|
|
127
|
+
`,Ya=({height:t,entityType:i,entities:a,metrics:n,isVm:o})=>{const r=l(()=>a.map(t=>{const a=U(t);if(!a)return null;const l=[B.Source,B.Destination].includes(i),r=[B.Destination,B.Action].includes(i),s=[B.Destination,B.Action,B.InstrumentationRule].includes(i),c=r?i==B.Destination?Ke(t.exportedSignals):t.signals:void 0,d=l?n?.[`${i.toLowerCase()}s`]?.find(e=>JSON.stringify(U(e))===JSON.stringify(a)):void 0,u=s?!t.disabled:void 0,p=fe(t,i,{extended:i===B.Source,prioritizeDisplayName:i!==B.Source}),m=((e,t,i)=>{switch(e){case B.Source:return i?`${t.kind}`:`${t.namespace} • ${t.kind}`;case B.Destination:return t.destinationType.displayName;case B.Action:case B.InstrumentationRule:return t.type;default:return""}})(i,t,o),h=l?je(d?.throughput):void 0,{priorotizedStatus:g,hasDisableds:y}=ce(t.conditions||[]),{icons:v,icon:b,iconSrc:f}=((e,t)=>{switch(e){case B.Source:return{icons:He(t.containers),icon:Se(e)};case B.Destination:return ze(t.destinationType.type);case B.Action:return{icon:G(t.type)};case B.InstrumentationRule:return{icon:qe(t.type)};default:return{icon:Se(e)}}})(i,t);return e.createElement(_a,{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(Ja,{$height:t},e.createElement(Ve,{containerHeight:t-24,elementHeight:80,elements:r}),e.createElement(Ua,{$hide:!0}))},Ga=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
|
+
`,Xa=({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&&[B.InstrumentationRule,B.Action].includes(t)?null:e.createElement(Ga,{$isVm:r},e.createElement(Ba,{entityType:t,badge:s?`${i.length}/${a}`:a,badgeTooltip:s?m.FILTERED_COUNT_TOOLTIP:void 0,isLoading:o}),i.length?e.createElement(Ya,{height:c,entityType:t,entities:i,metrics:n,isVm:r}):o?e.createElement(Be,{size:3}):e.createElement(ja,{entityType:t,description:m.TO_COLLECT_OTEL_DATA}))},Za=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
|
+
`,Qa=({height:a,metrics:n})=>{const{isVm:o}=We(),l=ye(),{selectedStreamName:r}=_e(),{containerRef:s,containerHeight:c}=Je(),{sources:d,sourcesLoading:u,destinations:p,destinationsLoading:m,actions:h,actionsLoading:g,instrumentationRules:y,instrumentationRulesLoading:v}=_(),[b,f]=t([]),[x,$]=t([]),[k,C]=t([]),[S,w]=t([]);return i(()=>{f(Ue(Ye(d,r),l))},[d,r,l]),i(()=>{$(Ge(Xe(p,r),l))},[p,r,l]),i(()=>{C(ve(h,l))},[h,l]),i(()=>{w(y)},[y]),e.createElement(Za,{ref:s,$height:a},e.createElement(Xa,{entityType:B.InstrumentationRule,entities:S,unfilteredCount:y.length,loading:v,maxHeight:c,isVm:o}),e.createElement(Xa,{entityType:B.Source,entities:b,unfilteredCount:d.length,metrics:n,loading:u,maxHeight:c,isVm:o}),e.createElement(Xa,{entityType:B.Action,entities:k,unfilteredCount:h.length,loading:g,maxHeight:c,isVm:o}),e.createElement(Xa,{entityType:B.Destination,entities:x,unfilteredCount:p.length,metrics:n,loading:m,maxHeight:c,isVm:o}))},en=d.div`
|
|
141
141
|
position: relative;
|
|
142
142
|
max-width: 200px;
|
|
143
143
|
`;d.div`
|
|
@@ -151,60 +151,60 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,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 tn=d.div`
|
|
155
155
|
display: flex;
|
|
156
156
|
align-items: center;
|
|
157
157
|
overflow-x: scroll;
|
|
158
|
-
`,
|
|
158
|
+
`,an=({onClose:a})=>{const n=O.useTheme(),{onClickNode:o}=Ze(),{searchText:s}=ye(),{selectedStreamName:c}=_e(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=_(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=Qe();i(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:$,searchResults:k}=l(()=>Oa({instrumentationRules:m,sources:Ye(d,c),actions:p,destinations:Xe(u,c),searchText:s,selectedCategory:f}),[m,d,p,u,c,s,f]);return k.length?e.createElement(et,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(tn,null,$.map(({category:t,label:i,count:a})=>!!a&&e.createElement(tt,{key:`category-select-${t}`,label:i,badgeLabel:a,isSelected:f===t,onClick:()=>x(t)})))},k.map(({category:t,label:i,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(it,{style:{maxHeight:"all"!==f?"240px":"140px",padding:"12px 0"}},e.createElement(E,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},i),l.map((i,n)=>e.createElement(tt,{key:`entity-${s}-${n}`,icon:Se(t),label:fe(i,t,{extended:!0}),onClick:()=>{const e=U(i);o(null,{data:{type:t,id:e}}),a()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(se,{thickness:s===k.length-1?0:1,length:"90%",margin:"8px auto"})))):e.createElement(et,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(Ne,null))},nn=({preventPopup:i=!1})=>{const{searchText:a,setSearchText:o}=ye(),[l,r]=t(!1),s=!!a||l,c=()=>{o(""),r(!1)},d=n(null);return at(d,c),j({key:"Escape",active:s},c),e.createElement(en,{ref:d},e.createElement($,{placeholder:"Search",icon:Ti,value:a,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!i?e.createElement(an,{onClose:c}):null)},on=({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:`${nt(t)} - ${nt(i)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(ot,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},ln=({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})=>{pe(t||[]).forEach(({status:t,message:i,reason:a})=>{t!==W.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(ot,{disabled:r||!c?.length,title:i,placeholder:"All",options:c,value:a,onSelect:n,onDeselect:o,...s})},rn=({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:lt[t]||t})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(ot,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},sn=({title:t="Monitors",value:i,onSelect:a,onDeselect:n,...o})=>{const r=l(()=>{const e=[];return rt.forEach(({id:t,value:i})=>{e.find(e=>e.id===t)||e.push({id:t,value:i})}),e},[]);return e.createElement(ot,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:i,onSelect:a,onDeselect:n,...o})},cn=({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(ot,{disabled:!s?.length,title:i,placeholder:"Select namespace",options:s,value:a,onSelect:n,onDeselect:o,...r})},dn=({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(ot,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},un=d.div`
|
|
159
159
|
display: flex;
|
|
160
160
|
flex-direction: column;
|
|
161
161
|
gap: 12px;
|
|
162
162
|
padding: 12px;
|
|
163
|
-
`,
|
|
163
|
+
`,pn=d.div`
|
|
164
164
|
padding: 12px 6px 6px 6px;
|
|
165
|
-
`,
|
|
165
|
+
`,mn=d(Ae)`
|
|
166
166
|
font-size: 14px;
|
|
167
167
|
${({$color:e})=>`color: ${e};`}
|
|
168
|
-
`,
|
|
168
|
+
`,hn=d.div`
|
|
169
169
|
margin-left: auto;
|
|
170
|
-
`,
|
|
170
|
+
`,gn=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},yn=()=>{const a=O.useTheme(),{isVm:o}=We(),{namespaces:r,sources:s}=_(),{selectedStreamName:c}=_e(),{getItemSS:d,setItemSS:u,removeItemSS:p}=ct(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=Qe(),{namespaces:b,kinds:f,monitors:x,languages:$,conditions:k,errors:C,onlyErrors:S,setAll:T,clearAll:D,getEmptyState:N}=ye(),E=l(()=>Ye(s,c),[s,c]),[F,I]=t({namespaces:b,kinds:f,monitors:x,languages:$,conditions:k,errors:C,onlyErrors:S}),[A,M]=t(gn(F));i(()=>{const e=d(st.OVERVIEW_FILTERS,N());T(e)},[]),i(()=>{if(!h){const e={namespaces:b,kinds:f,monitors:x,languages:$,conditions:k,errors:C,onlyErrors:S};I(e),M(gn(e))}},[h,b,f,x,$,k,C,S]);const R=()=>{g(!1)},L=n(null);return at(L,R),j({key:"Escape",active:h},R),e.createElement(en,{ref:L},e.createElement(tt,{label:"Filters",icon:Di,badgeLabel:A,badgeFilled:!!A,withBorder:!0,color:"transparent",onClick:()=>{v(0,50),g(!0)}}),e.createElement(et,{ref:m,isOpen:h,top:y.top,left:y.left,width:"420px",footer:e.createElement(ue,null,e.createElement(mn,{variant:"primary",onClick:()=>{u(st.OVERVIEW_FILTERS,F),T(F),M(gn(F)),g(!1)}},"Apply"),e.createElement(mn,{variant:"secondary",onClick:R},"Cancel"),e.createElement(hn,null,e.createElement(mn,{variant:"tertiary",onClick:()=>{p(st.OVERVIEW_FILTERS),D(),I(N()),M(0),g(!1)},$color:a.text.error},"Reset")))},e.createElement(un,null,!o&&e.createElement(cn,{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(dn,{sources:E,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(rn,{sources:E,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(sn,{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(on,{sources:E,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(pn,null,e.createElement(w,{title:"Show only sources with errors",initialValue:F.onlyErrors,onChange:e=>I(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(ln,{sources:E,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}))))},vn=d.div`
|
|
171
171
|
display: flex;
|
|
172
172
|
flex-direction: column;
|
|
173
173
|
gap: 24px;
|
|
174
174
|
padding: 4px;
|
|
175
|
-
`,
|
|
175
|
+
`,bn=({formData:t,handleFormChange:i,formErrors:a})=>{const{dataStreams:n,selectedStreamName:o}=_e(),r=l(()=>n.find(e=>e.name===t.name&&e.name!==o),[n,t.name,o]);return e.createElement(vn,null,e.createElement($,{name:"name",title:m.STREAM_NAME,placeholder:m.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:t.name,onChange:({target:{value:e}})=>i("name",e),errorMessage:a.name}),r&&e.createElement(oe,{type:W.Warning,message:m.DATA_STREAM_EXISTS_WARNING(o,r.name)}))},fn=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
|
+
`,xn=({isOpen:i,onClose:a,dataStreamName:o,updateDataStream:r})=>{const{dataStreams:c}=_e(),d=n(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=dt({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(xa,{ref:d,title:f.name,icons:[Ni],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Q.Update})&&(r(o,m),p(!1),a())},onCancel:()=>{v(),p(!1),a()}},e.createElement(fn,null,e.createElement(bn,{formData:m,handleFormChange:x,formErrors:g}))):null},$n=d.div`
|
|
182
182
|
position: relative;
|
|
183
|
-
`,
|
|
183
|
+
`,kn=d(ue)`
|
|
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
|
+
`,Cn=d(E)`
|
|
191
191
|
text-wrap: nowrap;
|
|
192
|
-
`,
|
|
192
|
+
`,Sn=d(it)`
|
|
193
193
|
max-height: 240px;
|
|
194
194
|
padding: 0px !important;
|
|
195
|
-
`,
|
|
195
|
+
`,wn=d(ue)`
|
|
196
196
|
width: 100%;
|
|
197
|
-
`,
|
|
197
|
+
`,Tn=d.div`
|
|
198
198
|
width: 100%;
|
|
199
|
-
`,
|
|
199
|
+
`,Dn=({onClickNewDataStream:i,updateDataStream:a,deleteDataStream:n})=>{const o=O.useTheme(),{clearStore:r}=ut(),{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=Qe(),{dataStreams:m,selectedStreamName:h,setSelectedStreamName:g}=_e(),[y,v]=t(""),[b,f]=t(""),[x,k]=t(""),C=l(()=>m.filter(({name:e})=>!x||e.toLowerCase().includes(x.toLowerCase())).map(({name:t})=>e.createElement(wn,{key:`stream-${t}`},e.createElement(Tn,null,e.createElement(tt,{label:t,isSelected:h===t,onClick:()=>{r(),g(t),d(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==pt&&e.createElement(mt,{onClick:()=>f(t),tooltip:V.DELETE},e.createElement(Ci,null)),e.createElement(mt,{onClick:()=>v(t),tooltip:V.EDIT},e.createElement(ki,null)))),[m,h,x]);return e.createElement(e.Fragment,null,e.createElement($n,null,e.createElement(kn,{$gap:0},e.createElement(Ae,{variant:"tertiary",onClick:()=>{p(0,50),d(e=>!e)}},e.createElement(Ni,{fill:o.text.info}),e.createElement(Cn,null,"Data Stream: ",h),e.createElement(ht,{extend:c}),e.createElement(Oe,{label:m.length})),e.createElement(se,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(gt,{onClick:()=>{r(),i()},label:V.NEW})),e.createElement(et,{ref:s,isOpen:c,top:u.top,left:u.left,header:e.createElement($,{placeholder:"Search...",icon:Ti,value:x,onChange:e=>k(e.target.value)})},e.createElement(Sn,null,C))),e.createElement(z,{isOpen:""!==b,name:b,onApprove:()=>{n(b),f("")},onDeny:()=>{f("")}}),e.createElement(xn,{isOpen:""!==y,onClose:()=>{v("")},dataStreamName:y,updateDataStream:a}))},Nn=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
|
+
`,En=d.div`
|
|
206
206
|
margin-left: auto;
|
|
207
|
-
`,
|
|
207
|
+
`,On=({addEntity:t,preventSearchPopup:i,onClickNewDataStream:a,updateDataStream:n,deleteDataStream:o})=>{const{setCurrentModal:l}=te();return e.createElement(Nn,null,e.createElement(Dn,{onClickNewDataStream:a,updateDataStream:n,deleteDataStream:o}),e.createElement(nn,{preventPopup:i}),e.createElement(yn,null),t&&e.createElement(En,null,e.createElement(gt,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${V.ADD} ${nt(t)}`,variant:"primary",textProps:{weight:900}})))},Fn=a(({isModal:t,onClickSummary:i},a)=>{const{selectedStreamName:n}=_e(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=dt({name:n});return o(a,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(ne,{$isNotModal:!t},e.createElement(ee,{$gap:24},i&&e.createElement(yt,{onClick:i}),e.createElement(I,{title:m.NAME_YOUR_STREAM,description:m.STREAM_DESCRIPTION}),e.createElement(bn,{formData:l,handleFormChange:r,formErrors:s})))});Fn.displayName=Fn.name;const In=({createDataStream:t})=>{const{currentModal:i,setCurrentModal:a}=te(),{addDataStreams:o,setSelectedStreamName:l}=_e(),r=i===vt.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 j({key:"Enter",active:r},c),e.createElement(ie,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:e.createElement(ae,{buttons:[{label:"DONE",variant:"primary",onClick:c}]})},e.createElement(Fn,{ref:d,isModal:!0}))},An=e=>Object.keys(e).filter(t=>e[t]).join(", "),Mn=(e,t)=>{const{destinationType:i,disabled:a,exportedSignals:n}=e,o=[{title:m.TYPE,value:i.type},{type:h.ActiveStatus,title:m.STATUS,value:String(!a)},{type:h.Monitors,title:m.MONITORS,value:An(n)},{title:m.NAME,value:i.displayName}],l=bt(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||!ft(c,Ke(n),r)){const{type:e}=xt(s,{type:""}),t=(l||"password"===e)&&a.length?new Array(10).fill("•").join(""):"";o.push({type:h.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},Rn=({signals:t,fields:i,onChange:a,formErrors:n})=>i?.map(o=>{const{componentType:l,renderCondition:r,...s}=o;if(r&&!ft(r,t,i))return null;switch(l){case N.Input:return e.createElement($,{key:o.name,...s,onChange:e=>a(o.name,e.target.value),errorMessage:n[o.name]});case N.Dropdown:return e.createElement(ot,{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 N.MultiInput:return e.createElement(D,{key:o.name,...s,value:"string"==typeof s.value?xt(s.value,[]):s.value,onChange:e=>a(o.name,JSON.stringify(e)),errorMessage:n[o.name]});case N.KeyValuePair:return e.createElement(T,{key:o.name,...s,value:"string"==typeof s.value?xt(s.value,[]):s.value,onChange:e=>a(o.name,JSON.stringify(e)),errorMessage:n[o.name]});case N.TextArea:return e.createElement(R,{key:o.name,...s,onChange:e=>a(o.name,e.target.value),errorMessage:n[o.name]});case N.Checkbox:return e.createElement(b,{key:o.name,...s,value:"true"==s.value,onChange:e=>a(o.name,String(e)),errorMessage:n[o.name]});default:return null}}),Ln=d(Ae)`
|
|
208
208
|
display: flex;
|
|
209
209
|
align-items: center;
|
|
210
210
|
gap: 8px;
|
|
@@ -218,43 +218,43 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
218
218
|
`:u`
|
|
219
219
|
background-color: transparent;
|
|
220
220
|
`}
|
|
221
|
-
`,
|
|
221
|
+
`,Pn=({destination:i,validateForm:a,status:n,testConnection:o,onSuccess:l,onError:r})=>{const s=O.useTheme(),{selectedStreamName:c}=_e(),[d,u]=t(!1),p=n?ge(n,s):void 0;return e.createElement(Ln,{$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(Pe,null):p?e.createElement(p,null):null,e.createElement(E,{family:"secondary",decoration:"underline",size:14,color:n?s.text[n]:void 0},d?"Checking":n===W.Success?"Connection OK":"error"===n?"Connection Failed":"Test Connection"))},Kn=d(ee)`
|
|
222
222
|
align-items: unset;
|
|
223
223
|
padding: 0 4px;
|
|
224
|
-
`,
|
|
224
|
+
`,jn=d.div`
|
|
225
225
|
display: flex;
|
|
226
226
|
flex-direction: column;
|
|
227
227
|
gap: 12px;
|
|
228
|
-
`,
|
|
228
|
+
`,Vn=d(ue)`
|
|
229
229
|
justify-content: space-between;
|
|
230
|
-
`,
|
|
230
|
+
`,qn=d(E)`
|
|
231
231
|
margin-bottom: 12px;
|
|
232
|
-
`,
|
|
232
|
+
`,zn=({isUpdate:a,categoryItem:o,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:p,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:b}=o||{},f=O.useTheme(),[x,k]=t(!1),[C,S]=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}}k(e)}},[u,C]);const N=l(()=>{const{logs:e,metrics:t,traces:i}=v||{},a=[];return e?.supported&&a.push($t.Logs),t?.supported&&a.push($t.Metrics),i?.supported&&a.push($t.Traces),a},[v]),E=l(()=>{const{logs:e,metrics:t,traces:i}=r.exportedSignals||{},a=[];return e&&a.push($t.Logs),t&&a.push($t.Metrics),i&&a.push($t.Traces),a},[r.exportedSignals]),R=()=>{k(!1),S(!0),T(void 0)};return e.createElement(Kn,{$gap:24},e.createElement(Kn,{$gap:12},e.createElement(I,{title:a?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:b&&e.createElement(Pn,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{S(!1),T({type:W.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{S(!1),T({type:W.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(jn,null,b&&w&&e.createElement(oe,{type:w.type,title:w.title,message:w.message}),x&&!w&&!a&&e.createElement(oe,{type:W.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(se,null)),e.createElement(Vn,null,e.createElement(M,{title:a?"":"This connection will monitor:",required:!0,allowedSignals:N,selectedSignals:E,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes($t.Logs),metrics:e.includes($t.Metrics),traces:e.includes($t.Traces)})},errorMessage:s.exportedSignals}),!a&&e.createElement(A,{endpoint:`/backends/${g}`})),a&&e.createElement("div",null,e.createElement(qn,null,"Status"),e.createElement(F,{options:[{icon:xi,label:m.ENABLED,value:!1,selectedBgColor:f.text.success+O.opacity.hex["050"]},{icon:$i,label:m.DISABLED,value:!0,selectedBgColor:f.text.error+O.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!a&&e.createElement($,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(Rn,{signals:E,fields:u,onChange:(e,t)=>{R(),p(i=>{const a=[...i],n=a.findIndex(t=>t.name===e);return-1!==n&&(a[n]={...a[n],value:t}),a})},formErrors:s}))},Hn=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
|
+
`,Bn=d.div`
|
|
239
239
|
display: flex;
|
|
240
240
|
flex-direction: column;
|
|
241
241
|
gap: 12px;
|
|
242
|
-
`,
|
|
242
|
+
`,Wn=({categories:a,updateDestination:o,deleteDestination:r,testConnection:s})=>{const{destinations:c}=_(),{selectedStreamName:d}=_e(),{drawerType:u,drawerEntityId:p}=K(),h=l(()=>Xe(c,d),[c,d]),g=n(null),y=u===B.Destination,[v,b]=t(!1),[f,x]=t(!1),{formData:$,formErrors:k,handleFormChange:C,resetFormData:S,validateForm:w,loadFormWithDrawerItem:T,yamlFields:D,setYamlFields:N,dynamicFields:E,setDynamicFields:O}=kt({}),F=l(()=>{if(p)return h?.find(e=>U(e)===p)},[p,h]);if(i(()=>{y&&F?(N(Ct(a,F)),T(F)):S()},[y,F,a]),!F)return null;const I=a.flatMap(e=>e.items).find(e=>e.type===F.destinationType.type),{icon:A,iconSrc:M}=I?ze(I?.type):{icon:void 0,iconSrc:void 0};return e.createElement(xa,{ref:g,title:F.name||F.destinationType.displayName,icons:A?[A]:void 0,iconSrcs:M?[M]:void 0,isEdit:v,isFormDirty:f,onEdit:e=>{b("boolean"!=typeof e||e)},onSave:async e=>{if(w({withAlert:!0,alertTitle:Q.Update})){const t=e!==F.destinationType.displayName?e:"";C("name",t),o(p,{...$,name:t}),b(!1),x(!1)}},onDelete:async()=>{r(p),b(!1),x(!1),g.current?.closeDrawer()},onCancel:()=>{b(!1),x(!1),T(F)},isLastItem:1===h.length},v?e.createElement(Hn,null,e.createElement(zn,{isUpdate:!0,categoryItem:I,formData:$,formErrors:k,handleFormChange:(...e)=>{x(!0),C(...e)},dynamicFields:E,setDynamicFields:(...e)=>{x(!0),O(...e)},validateForm:w,testConnection:s})):e.createElement(Bn,null,F.conditions?.length?e.createElement(X,{conditions:F.conditions}):null,e.createElement(Z,{title:m.DESTINATION_DETAILS,data:F?Mn(F,D):[]})))},_n=d.div`
|
|
243
243
|
display: flex;
|
|
244
244
|
flex-direction: column;
|
|
245
245
|
gap: 12px;
|
|
246
|
-
`,
|
|
246
|
+
`,Jn=({items:t,onSelectNew:i,onSelectConfigured:a,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:o}=ut();return t.map(t=>{const l=t.name===wt.EXISTS.TITLE;return e.createElement(_n,{key:`category-${t.name}`},e.createElement(I,{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}=ze(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(Le,{key:s,"data-id":s,title:r.displayName,hoverText:V.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>a(r.id)}})}))})},Un=d.div`
|
|
247
247
|
display: flex;
|
|
248
248
|
flex-direction: column;
|
|
249
249
|
gap: 24px;
|
|
250
|
-
`,
|
|
250
|
+
`,Yn=d.div`
|
|
251
251
|
display: flex;
|
|
252
252
|
align-items: center;
|
|
253
253
|
gap: 12px;
|
|
254
|
-
`,
|
|
254
|
+
`,Gn=d.div`
|
|
255
255
|
width: 170px;
|
|
256
256
|
margin-right: 8px;
|
|
257
|
-
`,
|
|
257
|
+
`,Xn=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 i,forwardRef as a,useRef as n,useImperative
|
|
|
265
265
|
@media (height < 800px) {
|
|
266
266
|
max-height: calc(100vh - 400px);
|
|
267
267
|
}
|
|
268
|
-
`,
|
|
268
|
+
`,Zn=d(Un)`
|
|
269
269
|
margin-top: 80px;
|
|
270
|
-
`,{MANAGED:
|
|
270
|
+
`,{MANAGED:Qn,SELF_HOSTED:eo,DETECTED:to,EXISTS:io}=wt,ao=[{value:"All types",id:"all"},{value:Qn.TITLE,id:Qn.TITLE},{value:eo.TITLE,id:eo.TITLE},{value:to.TITLE,id:to.TITLE},{value:io.TITLE,id:io.TITLE}],no=ao[0],oo=[$t.Logs,$t.Metrics,$t.Traces],lo=(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:{[$t.Logs]:{supported:e.exportedSignals.logs},[$t.Metrics]:{supported:e.exportedSignals.metrics},[$t.Traces]:{supported:e.exportedSignals.traces}}}}),ro=({hidden:i,categories:a,potentialDestinations:n,onSelectNew:o,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=_(),{selectedStreamName:d}=_e(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=ut(),[m,h]=t(""),[g,y]=t(no),[v,b]=t(oo),f=l(()=>{const e=Tt(a);return e.unshift({name:io.TITLE,description:io.DESCRIPTION,icon:Ei,items:lo(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:to.TITLE,description:to.DESCRIPTION,icon:Oi,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(Un,null,e.createElement(I,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(Yn,null,e.createElement(Gn,null,e.createElement($,{placeholder:"Search...",icon:Ti,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(Gn,null,e.createElement(ot,{options:ao,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(M,{title:"",selectedSignals:v,setSelectedSignals:b})),e.createElement(se,null),f.length?e.createElement(Xn,null,e.createElement(Jn,{items:f,onSelectNew:e=>o(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(Zn,null,e.createElement(Ne,{title:"No destinations found"})))},so=d.div`
|
|
271
271
|
display: flex;
|
|
272
|
-
`,
|
|
272
|
+
`,co=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
|
+
`,uo=({isOnboarding:i,categories:a,potentialDestinations:n,createDestination:o,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=_(),{selectedStreamName:d}=_e(),{currentModal:u,setCurrentModal:p}=te(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=ut(),b=u===B.Destination,[f,x]=t(void 0),{formData:$,formErrors:k,handleFormChange:C,resetFormData:S,validateForm:w,setYamlFields:T,dynamicFields:D,setDynamicFields:N,loadFormWithDrawerItem:E}=kt({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=()=>{S(),x(void 0),p("")},R=()=>{S(),x(void 0)},L=async()=>{if(f){if(!w({withAlert:!i,alertTitle:Q.Create}))return null;A()}M()};return j({key:"Enter",active:b},()=>L()),e.createElement(ie,{isOpen:b,onClose:M,header:{title:m.ADD_DESTINATION},actionComponent:e.createElement(ae,{buttons:(()=>{const t=[{label:"DONE",variant:"primary",onClick:L}];return f&&t.unshift({label:"BACK",icon:()=>e.createElement(Fi,{rotate:-90}),variant:"secondary",onClick:R}),t})()})},e.createElement(so,null,e.createElement(co,null,e.createElement(Dt,{currentStep:f?2:1,data:[{stepNumber:1,title:m.DESTINATIONS},{stepNumber:2,title:m.CONNECTION}]})),e.createElement(ne,{style:{margin:"32px 24px 12px 24px"}},e.createElement(ro,{hidden:void 0!==f,categories:a,potentialDestinations:n,onSelectNew:(e,t)=>{S(),C("type",e?.type||""),C("currentStreamName",d);const i={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>i[e]=!0),C("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(zn,{categoryItem:f,formData:$,formErrors:k,handleFormChange:C,dynamicFields:D,setDynamicFields:N,validateForm:w,testConnection:s}))))},po=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 i,forwardRef as a,useRef as n,useImperative
|
|
|
285
285
|
max-height: calc(100vh - 310px);
|
|
286
286
|
height: fit-content;
|
|
287
287
|
overflow-y: scroll;
|
|
288
|
-
`,
|
|
288
|
+
`,mo=({categories:t,withDelete:i})=>{const{configuredDestinations:a,configuredDestinationsUpdateOnly:n}=ut();return a.length||n.length?e.createElement(po,null,a.concat(n).map((o,l)=>e.createElement(ho,{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(De,null,e.createElement(Ne,{title:"No destinations",subTitle:"Please add a destination"}))},ho=({item:i,yamlFields:a,isLastItem:n,withDelete:o})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=ze(i.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=ut(),m=l(()=>bt(i,a).map(e=>({title:e.name,value:e.value})),[i,a]);return e.createElement(e.Fragment,null,e.createElement(Le,{title:i.name||i.destinationType.displayName,subTitle:i.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:Ke(i.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Nt,{data:m})},renderActions:o?()=>e.createElement(mt,{onClick:()=>s(!0)},e.createElement(Ci,null)):void 0}),o&&e.createElement(z,{isOpen:r,name:i.destinationType.displayName||i.name,type:B.Destination,isLastItem:n,onApprove:()=>{i.id?p(i):u(i)},onDeny:()=>s(!1)}))},go=d(Ae)`
|
|
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 i,forwardRef as a,useRef as n,useImperative
|
|
|
294
294
|
padding: 32px;
|
|
295
295
|
border-radius: 16px;
|
|
296
296
|
border-style: dashed !important;
|
|
297
|
-
`,
|
|
297
|
+
`,yo=({isSourcesListEmpty:t,goToSources:i,categories:a,potentialDestinations:n,testConnection:o,onClickSummary:l})=>{const r=O.useTheme(),{setCurrentModal:s}=te(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=ut();return e.createElement(e.Fragment,null,e.createElement(ne,{$isNotModal:!0},e.createElement(ee,{$gap:12},e.createElement(ee,{$gap:24},l&&e.createElement(yt,{onClick:l}),e.createElement(I,{title:m.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:m.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(oe,{type:W.Warning,message:m.NO_SOURCES_GO_BACK,action:{label:m.SELECT_SOURCES,onClick:i}}),e.createElement(go,{variant:"secondary",onClick:()=>s(B.Destination)},e.createElement(wi,null),e.createElement(E,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},m.ADD_DESTINATION))),e.createElement(mo,{categories:a,withDelete:!0}))),e.createElement(uo,{isOnboarding:!0,categories:a,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:o}))},vo=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"type",title:m.TYPE,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],bo=({metrics:t,maxHeight:i,maxWidth:a})=>{const n=O.useTheme(),o=ye(),{selectedStreamName:r}=_e(),{setDrawerType:s,setDrawerEntityId:c}=K(),{destinations:d,destinationsLoading:u}=_(),p=l(()=>Xe(d,r),[d,r]),h=l(()=>Oa({instrumentationRules:[],sources:[],actions:[],destinations:Ge(p,o),searchText:o.searchText,selectedCategory:B.Destination}).searchResults.find(({category:e})=>e===B.Destination)?.entities||[],[p,o]),g=l(()=>h.map(i=>{const{hasErrors:a,hasWarnings:o,hasDisableds:l}=ce(i.conditions||[]),{icon:r,iconSrc:d}=ze(i.destinationType.type);return{status:a?W.Error:o?W.Warning:void 0,faded:l,onClick:()=>{s(B.Destination),c(i.id)},cells:[{columnKey:"icon",component:()=>e.createElement(be,{icon:r,src:d})},{columnKey:"name",value:fe(i,B.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:i.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:je(Et(t,B.Destination,i.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(xe,{withLabels:!0,monitors:Ke(i.exportedSignals)})},{columnKey:"conditions",component:()=>i.conditions?.length?e.createElement(Na,{conditions:i.conditions,id:i.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:i.disabled?W.Error:W.Success,title:i.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==p.length?{badge:`${h.length}/${p.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:p.length,badgeTooltip:void 0},[h,p]);return e.createElement($e,{$maxWidth:a},e.createElement(ke,null,e.createElement(Ce,{icon:Se(B.Destination),title:m.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(we,{$maxHeight:i},e.createElement(Te,{columns:vo,rows:g})),!h.length&&e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},fo=e=>{const{type:t,ruleName:i,notes:a,disabled:n,profileName:o,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:m.TYPE,value:t},{type:h.ActiveStatus,title:m.STATUS,value:String(!n)},{title:m.NAME,value:i},{title:m.NOTES,value:a},{title:m.MANAGED_BY_PROFILE,value:o},{type:h.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[Ot.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[It.Java]||[]).map(e=>new Ft(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:m.JAVA_CUSTOM_PROBES,value:e});const t=(c[It.Golang]||[]).map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:m.GOLANG_CUSTOM_PROBES,value:t})}return d},xo=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 i,forwardRef as a,useRef as n,useImperative
|
|
|
304
304
|
border-radius: 16px;
|
|
305
305
|
padding: 8px;
|
|
306
306
|
`}
|
|
307
|
-
|
|
307
|
+
`,$o=[{id:Mt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Mt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Mt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],ko=[{id:Mt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Mt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Mt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Co={[It.Java]:[new Ft("","")],[It.Golang]:[new At("")]},So=["*"],wo=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 i,forwardRef as a,useRef as n,useImperative
|
|
|
314
314
|
border-radius: 16px;
|
|
315
315
|
padding: 8px;
|
|
316
316
|
`}
|
|
317
|
-
`,
|
|
317
|
+
`,To=[{id:Rt.HttpRequest,label:"Collect HTTP Request"},{id:Rt.HttpResponse,label:"Collect HTTP Response"},{id:Rt.DbQuery,label:"Collect DB Query"},{id:Rt.Messaging,label:"Collect Messaging"}],Do={[Lt.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={[Mt.Column]:null,[Mt.FilePath]:!0,[Mt.Function]:!0,[Mt.LineNumber]:!0,[Mt.Namespace]:null,[Mt.StackTrace]:null};n("codeAttributes",e),d(!1)}},[]);const u=(e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e),a=Object.values(Mt).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(v,{title:"Recommended data to collect",required:!0}),e.createElement(xo,{$hasError:!!r},$o.map(({id:t,label:i,tooltip:a})=>e.createElement(me,{key:t,text:a,withIcon:!0},e.createElement(b,{title:i,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(f,null,r)),e.createElement("div",null,e.createElement(v,{title:"Verbose data to collect",required:!0}),e.createElement(xo,{$hasError:!!r},ko.map(({id:t,label:i,tooltip:a})=>e.createElement(me,{key:t,text:a,withIcon:!0},e.createElement(b,{title:i,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(f,null,r)))},[Lt.CustomInstrumentation]:({value:t,setValue:a,formErrors:n})=>{const o=n.customInstrumentations,r=l(()=>(t?.customInstrumentations?.[It.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[t]),s=l(()=>(t?.customInstrumentations?.[It.Golang]||[]).map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[t]),c=(e,t)=>{const i={};switch(t){case"java":i[It.Java]=e.map(e=>new Ft(e.className,e.methodName)),i[It.Golang]=s.map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":i[It.Golang]=e.map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),i[It.Java]=r.map(({key:e,value:t})=>new Ft(e,t))}a("customInstrumentations",i)};return i(()=>{t?.customInstrumentations||a("customInstrumentations",{[It.Golang]:Co[It.Golang],[It.Java]:Co[It.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(T,{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"}))},[Lt.HeadersCollection]:({value:t,setValue:a,formErrors:n})=>{const o=n.headersCollection,r=l(()=>t?.headersCollection?.[Ot.HeaderKeys]||[],[t]),s=e=>{const t={[Ot.HeaderKeys]:e};a("headersCollection",t)};return i(()=>{r.length||s(So)},[r]),e.createElement("div",null,r.length>0&&e.createElement(D,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>s(e),errorMessage:o}))},[Lt.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={[Rt.HttpRequest]:{},[Rt.HttpResponse]:{},[Rt.DbQuery]:{},[Rt.Messaging]:{}};n("payloadCollection",e),d(!1)}},[]),e.createElement("div",null,e.createElement(v,{title:"Type of data to collect",required:!0}),e.createElement(wo,{$hasError:!!r},To.map(({id:t,label:i})=>e.createElement(b,{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={[Rt.HttpRequest]:i.includes(Rt.HttpRequest)?{}:null,[Rt.HttpResponse]:i.includes(Rt.HttpResponse)?{}:null,[Rt.DbQuery]:i.includes(Rt.DbQuery)?{}:null,[Rt.Messaging]:i.includes(Rt.Messaging)?{}:null};n("payloadCollection",a),d(1===i.length)})(t,e)}))),!!r&&e.createElement(f,null,r))},[Lt.UnknownType]:null},No=({ruleType:t,value:i,setValue:a,formErrors:n})=>{if(!t)return null;const o=Do[t];return o?e.createElement(o,{value:i,setValue:a,formErrors:n}):null},Eo=d.div`
|
|
318
318
|
display: flex;
|
|
319
319
|
flex-direction: column;
|
|
320
320
|
gap: 24px;
|
|
321
321
|
padding: 4px;
|
|
322
|
-
`,
|
|
322
|
+
`,Oo=d(E)`
|
|
323
323
|
margin-bottom: 12px;
|
|
324
|
-
`,
|
|
324
|
+
`,Fo=({isUpdate:t,rule:i,formData:a,formErrors:n,handleFormChange:o})=>{const l=O.useTheme();return e.createElement(Eo,null,e.createElement(ue,null,i.supportedLanguages.map(t=>e.createElement(Pt,{key:t,icon:Kt(t),type:W.Info},lt[t]))),t?e.createElement("div",null,e.createElement(Oo,null,"Status"),e.createElement(F,{options:[{icon:xi,label:m.ENABLED,value:!1,selectedBgColor:l.text.success+O.opacity.hex["050"]},{icon:$i,label:m.DISABLED,value:!0,selectedBgColor:l.text.error+O.opacity.hex["050"]}],selected:a.disabled,setSelected:e=>o("disabled",e)})):e.createElement(e.Fragment,null,e.createElement(I,{title:"",description:i.docsDescription,actionButton:e.createElement(A,{endpoint:i.docsEndpoint})}),e.createElement($,{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(No,{ruleType:i.type,value:a,setValue:(e,t)=>o(e,t),formErrors:n}),e.createElement(R,{title:"Notes",value:a.notes,onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},Io=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
|
+
`,Ao=d.div`
|
|
331
331
|
display: flex;
|
|
332
332
|
flex-direction: column;
|
|
333
333
|
gap: 12px;
|
|
334
|
-
`,
|
|
334
|
+
`,Mo=({updateInstrumentationRule:a,deleteInstrumentationRule:o})=>{const{instrumentationRules:r}=_(),{addNotification:s}=P(),{drawerType:c,drawerEntityId:d}=K(),u=n(null),p=c===B.InstrumentationRule,[m,h]=t(!1),[g,y]=t(!1),{formData:v,formErrors:b,handleFormChange:f,resetFormData:x,validateForm:$,loadFormWithDrawerItem:k}=jt(),C=l(()=>{if(d)return r?.find(e=>U(e)===d)},[d,r]);if(i(()=>{p&&C?k(C):x()},[p,C]),!C)return null;const S=Vt.find(({type:e})=>e===C.type);return e.createElement(xa,{ref:u,title:C.ruleName||C.type,icons:[qe(C.type)],isEdit:m,isFormDirty:g,onEdit:e=>{C.mutable||!e&&void 0!==e?h("boolean"!=typeof e||e):s({type:W.Warning,title:le.FORBIDDEN,message:le.CANNOT_EDIT_RULE,crdType:B.InstrumentationRule,target:d,hideFromHistory:!0})},onSave:e=>{if($()){const t=e!==C.type?e:"";f("ruleName",t),a(d,{...v,ruleName:t}),h(!1),y(!1)}},onDelete:()=>{C.mutable?(o(d),h(!1),y(!1),u.current?.closeDrawer()):s({type:W.Warning,title:le.FORBIDDEN,message:le.CANNOT_DELETE_RULE,crdType:B.InstrumentationRule,target:d,hideFromHistory:!0})},onCancel:()=>{h(!1),y(!1),k(C)}},m&&S?e.createElement(Io,null,e.createElement(Fo,{isUpdate:!0,rule:S,formData:v,formErrors:b,handleFormChange:(...e)=>{y(!0),f(...e)}})):e.createElement(Ao,null,e.createElement(X,{conditions:C.conditions||[]}),e.createElement(Z,{title:"Instrumentation Rule Details",data:C?fo(C):[]})))},Ro=d(ee)`
|
|
335
335
|
margin-top: 24px;
|
|
336
336
|
gap: 12px;
|
|
337
|
-
`,
|
|
337
|
+
`,Lo=Vt,Po=({isEnterprise:i,createInstrumentationRule:a})=>{const{currentModal:n,setCurrentModal:o}=te(),l=n===B.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=jt(),[p,h]=t(void 0),g=()=>{d(),h(void 0),o("")},y=()=>{if(!u())return null;a(r),g()};return j({key:"Enter",active:l},()=>y()),e.createElement(ie,{isOpen:l,onClose:g,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(ae,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!i||!p,tooltip:i?"":le.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(ne,null,e.createElement(I,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(Ro,null,i?e.createElement(oe,{type:W.Warning,message:le.DEFINED_FOR_ALL_STREAMS(m.INSTRUMENTATION_RULES)}):e.createElement(oe,{type:W.Default,message:le.ENTERPRISE_ONLY(m.INSTRUMENTATION_RULES)}),e.createElement(re,{options:Lo,selectedOption:p,onOptionSelect:e=>{return t=e,d(),void h(t);var t},autoFocus:!p?.type})),p?.type?e.createElement("div",null,e.createElement(se,{margin:"16px 0"}),e.createElement(Fo,{rule:p,formData:r,formErrors:s,handleFormChange:c})):null))},Ko=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(It).forEach(e=>{const t=(a[e]||[]).filter(e=>e).join(", ");t&&(n+=n?`, ${t}`:t)}),n},jo=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"profile",title:m.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:m.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:m.NOTES,sortable:!0}],Vo=({maxHeight:t,maxWidth:i})=>{const a=p(),n=ye(),{setDrawerType:o,setDrawerEntityId:r}=K(),{instrumentationRules:s,instrumentationRulesLoading:c}=_(),d=l(()=>Oa({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:n.searchText,selectedCategory:B.InstrumentationRule}).searchResults.find(({category:e})=>e===B.InstrumentationRule)?.entities||[],[s,n]),u=l(()=>d.map(t=>{const{hasErrors:i,hasWarnings:n,hasDisableds:l}=ce(t.conditions||[]);return{status:i?W.Error:n?W.Warning:void 0,faded:l,onClick:()=>{o(B.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(be,{icon:qe(t.type)})},{columnKey:"name",value:fe(t,B.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:Ko(t),textColor:a.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>e.createElement(Na,{conditions:t.conditions||[],id:t.ruleId})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:t.disabled?W.Error:W.Success,title:t.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))},{columnKey:"source-count",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:W.Info,title:"all sources",withBorder:!0}))}]}}),[d]),{badge:h,badgeTooltip:g}=l(()=>d.length!==s.length?{badge:`${d.length}/${s.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[d,s]);return e.createElement($e,{$maxWidth:i},e.createElement(ke,null,e.createElement(Ce,{icon:Se(B.Action),title:m.INSTRUMENTATION_RULES,badge:h,badgeTooltip:g,loading:c})),e.createElement(we,{$maxHeight:t},e.createElement(Te,{columns:jo,rows:u})),!d.length&&e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},qo=d.div`
|
|
338
338
|
position: fixed;
|
|
339
339
|
bottom: 0;
|
|
340
340
|
left: 50%;
|
|
@@ -347,17 +347,18 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,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
|
+
animation-name: ${O.animations.slide.in.center};
|
|
351
|
+
`,zo=({totalSourceCount:i,uninstrumentSources:a,restartWorkloads:n})=>{const o=O.useTheme(),{selectedSources:s,setSelectedSources:c}=Me(),[d,u]=t(!1),p=l(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),m=()=>{c({})};return p?e.createElement(r,null,e.createElement(qo,{"data-id":"multi-source-control"},e.createElement(E,null,"Selected sources"),e.createElement(Oe,{label:p,filled:!0}),e.createElement(se,{orientation:"vertical",length:"16px"}),e.createElement(Ae,{variant:"tertiary",onClick:m},e.createElement(E,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(Ae,{variant:"tertiary",onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.map(e=>qt(e)))}),n(e),m()}},e.createElement(Ii,null),e.createElement(E,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(Ae,{variant:"tertiary",onClick:()=>u(!0)},e.createElement(Ci,null),e.createElement(E,{family:"secondary",decoration:"underline",color:o.text.error},"Uninstrument"))),e.createElement(z,{isOpen:d,name:`${p} sources`,type:B.Source,isLastItem:p===i,onApprove:()=>{const e={};Object.entries(s).forEach(([t,i])=>{e[t]=i.map(e=>({...e,selected:!1}))}),a(e),u(!1),m()},onDeny:()=>u(!1)})):null},Ho=d.div`
|
|
351
352
|
position: relative;
|
|
352
353
|
width: fit-content;
|
|
353
|
-
`,
|
|
354
|
+
`,Bo=d(ue)`
|
|
354
355
|
gap: 12px;
|
|
355
356
|
padding: 0 12px;
|
|
356
|
-
`,
|
|
357
|
+
`,Wo=d(ee)`
|
|
357
358
|
gap: 12px;
|
|
358
359
|
max-height: 400px;
|
|
359
360
|
overflow-y: auto;
|
|
360
|
-
`,
|
|
361
|
+
`,_o=d.div`
|
|
361
362
|
position: absolute;
|
|
362
363
|
bottom: 0;
|
|
363
364
|
left: 0;
|
|
@@ -366,13 +367,13 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
366
367
|
border-radius: 0 0 24px 24px;
|
|
367
368
|
background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
|
|
368
369
|
pointer-events: none;
|
|
369
|
-
`,
|
|
370
|
+
`,Jo=d(E)`
|
|
370
371
|
background-color: ${({theme:e})=>e.colors.orange_soft};
|
|
371
372
|
color: ${({theme:e})=>e.text.primary};
|
|
372
373
|
border-radius: 32px;
|
|
373
374
|
width: fit-content;
|
|
374
375
|
padding: 2px 8px;
|
|
375
|
-
`,
|
|
376
|
+
`,Uo=()=>{const t=O.useTheme(),{notifications:i,markAsSeen:a}=P(),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}=Qe({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&o.forEach(({id:e})=>a(e))}});return e.createElement(Ho,null,e.createElement(mt,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Ai,{size:18})),e.createElement(et,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(Bo,null,e.createElement(E,{size:20},"Notifications"),!!l&&e.createElement(Jo,{size:12,family:"secondary"},l," new"))},e.createElement(Wo,null,n.length?n.map(t=>e.createElement(el,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(Ne,{title:"No notifications",subTitle:""})),e.createElement(_o,null)))},Yo=d.div`
|
|
376
377
|
display: flex;
|
|
377
378
|
align-items: flex-start;
|
|
378
379
|
gap: 12px;
|
|
@@ -386,7 +387,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
386
387
|
background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
387
388
|
}
|
|
388
389
|
}
|
|
389
|
-
`,
|
|
390
|
+
`,Go=d.div`
|
|
390
391
|
background-color: ${({$type:e,theme:t})=>t.text[e]+O.opacity.hex["015"]};
|
|
391
392
|
border-radius: 8px;
|
|
392
393
|
width: 36px;
|
|
@@ -394,19 +395,19 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
394
395
|
display: flex;
|
|
395
396
|
align-items: center;
|
|
396
397
|
justify-content: center;
|
|
397
|
-
`,
|
|
398
|
+
`,Xo=d.div`
|
|
398
399
|
width: 290px;
|
|
399
|
-
`,
|
|
400
|
+
`,Zo=d.div`
|
|
400
401
|
margin-bottom: 6px;
|
|
401
|
-
`,
|
|
402
|
+
`,Qo=d.div`
|
|
402
403
|
display: flex;
|
|
403
404
|
align-items: center;
|
|
404
405
|
gap: 6px;
|
|
405
|
-
`,
|
|
406
|
+
`,el=({id:t,seen:i,type:a,title:n,message:o,time:l,crdType:r,target:s,onClick:c})=>{const d=O.useTheme(),{formatTimeAgo:u}=zt(),{onClickNotification:p}=Ht(),m=!!r&&!!s,h=n?.toLowerCase().includes(Q.Delete.toLowerCase())||!1,g=ge(a,d);return e.createElement(Yo,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(Go,{$type:h?W.Error:a},h?e.createElement(Ci,null):e.createElement(g,null)),e.createElement(Xo,null,e.createElement(Zo,null,e.createElement(E,{size:14},o)),e.createElement(Qo,null,e.createElement(E,{size:10,color:d.text.grey},u(l)),!i&&e.createElement(e.Fragment,null,e.createElement(E,{size:10},"·"),e.createElement(E,{size:10,color:d.colors.orange_soft},"new")))))},tl=(e,t,i)=>{const a=e?.serviceName||t?.otelServiceName||t?.name,n=i?[Mi]:He(t?.containers||[]),{priorotizedStatus:o}=ce(t?.conditions||[]);return{id:a,title:a,icons:n.length?n:[Ri],status:o,serviceMapEntry:e}},il=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,al=d.div`
|
|
406
407
|
width: 100%;
|
|
407
408
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
408
409
|
position: relative;
|
|
409
|
-
`,
|
|
410
|
+
`,nl={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},ol=({heightToRemove:t,serviceMap:a})=>{const n=O.useTheme(),{sources:o,sourcesLoading:l}=_(),{containerRef:r,containerHeight:s,containerWidth:c}=Je(),[d,u,p]=Ui([]),[h,g,y]=Yi([]);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===`${B.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:`${B.Source}-${i}-${Bt.MapItem}`,type:Bt.MapItem,position:l.get(i),data:tl(t,a,il(a))})}),o.forEach((t,i)=>{if(n.find(e=>e.id===`${B.Source}-${i}-${Bt.MapItem}`))return;const a=e.find(e=>i===e.otelServiceName||i===e.name);n.push({id:`${B.Source}-${i}-${Bt.MapItem}`,type:Bt.MapItem,position:l.get(i),data:tl(t,a,il(a))})});let i=50;e.forEach(e=>{const t=e.otelServiceName||e.name;n.find(e=>e.id===`${B.Source}-${t}-${Bt.MapItem}`)||(n.push({id:`${B.Source}-${t}-${Bt.MapItem}`,type:Bt.MapItem,position:{x:i,y:10},data:tl(void 0,e,il(e))}),i+=110)})}else n.push({id:`${B.Source}-${Bt.NoData}`,type:Bt.NoData,position:{x:a/2-150,y:i/4},data:{subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({serviceMap:a,sources:[nl].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===`${B.Source}-${Bt.NoData}`)&&i.push({id:`${B.Source}-${Bt.NoData}`,type:"remove"}),Gi(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=`${B.Source}-${i.serviceName}-${Bt.MapItem}`,r=o===W.Error;a.push({id:`${n}-to-${l}`,source:n,target:l,markerEnd:{type:Ji.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),a})({theme:n,nodes:d,serviceMap:a}))},[n,d,a]),e.createElement(al,{ref:r,$heightToRemove:t},e.createElement(Wt,{nodes:d,edges:h,onNodesChange:p,onEdgesChange:y,zoomOnScroll:!0}))},ll=d.div`
|
|
410
411
|
display: flex;
|
|
411
412
|
flex-direction: column;
|
|
412
413
|
align-items: center;
|
|
@@ -416,12 +417,12 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
416
417
|
max-height: ${({$isModal:e})=>e?"calc(100vh - 510px)":"calc(100vh - 310px)"};
|
|
417
418
|
height: fit-content;
|
|
418
419
|
overflow-y: scroll;
|
|
419
|
-
`,
|
|
420
|
+
`,rl=d.div`
|
|
420
421
|
width: 100%;
|
|
421
422
|
padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
|
|
422
423
|
border-radius: 16px;
|
|
423
424
|
background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+O.opacity.hex["024"]:t.colors.dropdown_bg_2+O.opacity.hex["040"]};
|
|
424
|
-
`,
|
|
425
|
+
`,sl=d.div`
|
|
425
426
|
display: flex;
|
|
426
427
|
justify-content: space-between;
|
|
427
428
|
gap: 12px;
|
|
@@ -433,26 +434,26 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
433
434
|
background-color: ${({$withClick:e,$selected:t,theme:i})=>e&&(t?i.colors.majestic_blue+O.opacity.hex["040"]:i.colors.dropdown_bg_2+O.opacity.hex["080"])};
|
|
434
435
|
transition: background-color 0.3s;
|
|
435
436
|
}
|
|
436
|
-
`,
|
|
437
|
+
`,cl=d(sl)`
|
|
437
438
|
width: calc(100% - 100px);
|
|
438
439
|
margin: 0 auto;
|
|
439
440
|
padding: 8px;
|
|
440
|
-
`,
|
|
441
|
+
`,dl=d.div`
|
|
441
442
|
position: relative;
|
|
442
443
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
443
|
-
`,
|
|
444
|
+
`,ul=d.div`
|
|
444
445
|
position: absolute;
|
|
445
446
|
top: 6px;
|
|
446
447
|
left: 18px;
|
|
447
|
-
`,
|
|
448
|
+
`,pl=d(De)`
|
|
448
449
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
449
|
-
`,
|
|
450
|
+
`,ml=d.div`
|
|
450
451
|
width: ${({$width:e})=>`${e||42}px`};
|
|
451
452
|
display: flex;
|
|
452
453
|
align-items: center;
|
|
453
454
|
justify-content: flex-end;
|
|
454
455
|
text-align: right;
|
|
455
|
-
`,
|
|
456
|
+
`,hl=Se(B.Namespace),gl=({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 p=O.useTheme(),{isVm:h}=We(),{namespacesLoading:g}=_(),y=Object.entries(o||{});return y?.length?e.createElement(ll,{$isModal:t},y.map(([t,o])=>{const y=s?.[t]||[],v=d?.[t]?.selected||!1,f=y.filter(({selected:e})=>e),x=y.length>0,$=l===t,k=f.length>0&&f.length===o.length,C=f.length>0&&f.length!==o.length,S=o.length>0,T=1===o.length;return r||S?e.createElement(rl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:k,$isOpen:$},e.createElement(sl,{$selected:k,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ue,{$gap:12},r&&e.createElement(b,{partiallyChecked:C,value:k,onChange:e=>r(t,e)}),e.createElement(hl,null),e.createElement(E,null,t)),e.createElement(ue,{$gap:24},!h&&u&&e.createElement(w,{title:m.FUTURE_APPS_TITLE,tooltip:m.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,t),flipHorizontally:!0}),e.createElement(ml,{$width:108},a!==t||n?.includes(t)?null:e.createElement(Ie,{size:10},"Retrieving workloads...")),e.createElement(ml,null,e.createElement(E,{size:10,color:p.text.grey},x?`${f.length}/${o.length}`:null)),r&&e.createElement(ht,{extend:$}))),($||!r)&&(S?e.createElement(dl,{$addPadding:!c},e.createElement(ul,null,e.createElement(se,{orientation:"vertical",length:(T?24:34*o.length)+"px"})),o.map(a=>{const n=f.some(({name:e})=>e===a.name);return e.createElement(yl,{key:`source-${a.name}`,withInstances:i,source:a,namespace:t,isSelected:n,onSelect:c})})):e.createElement(pl,{$addPadding:!c},g||a===t&&!n?.includes(t)?e.createElement(Pe,null):e.createElement(Ne,{title:m.NO_SOURCES_NAMESPACE,subTitle:m.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null})):e.createElement(De,null,g||a?e.createElement(Pe,null):e.createElement(Ne,{title:m.NO_SOURCES,subTitle:!h&&r?m.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:m.PLEASE_ADD_SOURCE}))},yl=({withInstances:t,source:i,namespace:a,isSelected:n,onSelect:o})=>e.createElement(cl,{"data-id":`source-${i.name}`,$selected:n,$withClick:!!o,onClick:()=>o?.(i)},e.createElement(ue,{$gap:12},o&&e.createElement(b,{value:n,onChange:()=>o(i,a)}),e.createElement(ue,{$gap:4},e.createElement(E,null,i.name),e.createElement(E,{opacity:.8,size:10},t?` • ${i.numberOfInstances||0} running instance${1!==i.numberOfInstances?"s":""}`:"",` • ${i.kind}`)))),vl=d.div`
|
|
456
457
|
display: flex;
|
|
457
458
|
flex-direction: column;
|
|
458
459
|
align-items: center;
|
|
@@ -461,35 +462,35 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
461
462
|
max-height: calc(100vh - 200px);
|
|
462
463
|
height: fit-content;
|
|
463
464
|
overflow-y: scroll;
|
|
464
|
-
`,
|
|
465
|
+
`,bl=({onEditStream:t,onEditSources:i,onEditDestinations:a,categories:n})=>{const{selectedStreamName:o}=_e(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=ut(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(ne,{$isNotModal:!0},e.createElement(ee,{$gap:12},e.createElement(I,{title:m.SUMMARY,description:m.STREAM_CONFIRM}),e.createElement(vl,null,e.createElement(Z,{title:m.STREAM_NAME,action:()=>e.createElement(_t,{onClick:t}),data:[{title:"",value:o}]}),e.createElement(Z,{title:m.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(_t,{onClick:i})},e.createElement(gl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Z,{title:m.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(_t,{onClick:a})},e.createElement(mo,{categories:n})))))};var fl;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(fl||(fl={}));const xl=({onClickId:i,defaultSelectedId:a,extendedNavIcons:n})=>{const{isVm:o}=We(),[r,s]=t(a||""),c=l(()=>[{id:fl.Overview,icon:Li,selected:r===fl.Overview,onClick:()=>{s(fl.Overview),i(fl.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:fl.Sources,icon:ji,selected:r===fl.Sources,onClick:()=>{s(fl.Sources),i(fl.Sources)},tooltip:"Sources"},{id:fl.Destinations,icon:Vi,selected:r===fl.Destinations,onClick:()=>{s(fl.Destinations),i(fl.Destinations)},tooltip:"Destinations"}];return o||(e.push({id:fl.InstrumentationRules,icon:Pi,selected:r===fl.InstrumentationRules,onClick:()=>{s(fl.InstrumentationRules),i(fl.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:fl.Actions,icon:Ki,selected:r===fl.Actions,onClick:()=>{s(fl.Actions),i(fl.Actions)},tooltip:"Actions"})),e},[o,r]);return e.createElement(Jt,{orientation:"vertical",mainIcons:c,subIcons:d})},$l=({})=>e.createElement(mt,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(qi,null)),kl=(e,t)=>{const{name:i,kind:a,namespace:n}=e,o=[{title:m.KIND,value:a},{title:m.NAME,value:i,tooltip:"Resource name"}];return t||(o.unshift({title:m.NAMESPACE,value:n}),o.push({type:h.Divider}),o.push({type:h.CopyText,value:`kubectl get ${a} ${i} -n ${n}`.toLowerCase()})),o},Cl=d.div`
|
|
465
466
|
display: flex;
|
|
466
467
|
flex-direction: column;
|
|
467
468
|
gap: 24px;
|
|
468
469
|
padding: 4px;
|
|
469
|
-
`,
|
|
470
|
+
`,Sl=({formData:t,handleFormChange:i})=>e.createElement(Cl,null,e.createElement($,{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)})),wl=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const i=Ut(t.status),a=nt(t.reasonEnum),n=t.message;return e.createElement(ue,{$alignItems:"center",$justifyContent:"center"},e.createElement(de,{status:i,title:a,subtitle:n,withBackground:i!==he.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Tl=({source:a,fetchSourceDescribe:n,restartPod:o})=>{const[l,r]=t(!1),[s,d]=t(null);return i(()=>{a&&n({namespace:a.namespace,name:a.name,kind:a.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):r(!0)})},[a.namespace,a.name,a.kind]),s||l?e.createElement(ee,{$gap:12},l?e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Could not fetch describe for this source"})):s?.pods?.length?s.pods.map(({podName:t,nodeName:i,phase:n,agentInjected:l,runningLatestWorkloadRevision:r,containers:d,manifestYAML:u})=>{const p=n.status!==W.Success||Yt(d)?W.Error:W.Success,m=[];return m.push(e.createElement(Gt,{key:"copy-text",value:`kubectl get pod ${t.value} -n ${s?.namespace?.value||a.namespace}`.toLowerCase()})),m.push(e.createElement(se,{key:"divider-1",length:"100%",margin:"0"})),m.push(e.createElement(Xt,{key:"describe-row-1",title:i.name,tooltip:i.explain||"",value:{status:i.status||void 0,text:i.value}})),m.push(e.createElement(se,{key:"divider-2",length:"100%",margin:"0"})),m.push(e.createElement(Xt,{key:"describe-row-2",title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),m.push(e.createElement(se,{key:"divider-3",length:"100%",margin:"0"})),m.push(e.createElement(Xt,{key:"describe-row-3",title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}})),m.push(e.createElement(se,{key:"divider-4",length:"100%",margin:"0"})),r?.name&&(m.push(e.createElement(Xt,{key:"describe-row-4",title:r.name,tooltip:r.explain||void 0,value:{status:r.status||void 0,text:r.value}})),m.push(e.createElement(se,{key:"divider-5",length:"100%",margin:"0"}))),d.forEach(t=>{m.push(e.createElement(Zt,{key:`pod-container-${t.containerName.value}`,...t}))}),u&&(m.push(e.createElement(se,{key:"divider-6",length:"100%",margin:"0"})),m.push(e.createElement(Xi,{key:"yaml-section-card",yaml:u}))),e.createElement(Z,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:({hovered:i})=>e.createElement("div",{style:{position:"relative"}},e.createElement(de,{key:"status",status:p,title:p,withIcon:!0,withBorder:!0}),i&&e.createElement(Qt,{key:"hover-actions",isOpen:!0,positionRight:"calc(100% + 12px)",actions:[{id:ei(),label:"Restart",rightIcon:zi,onClick:()=>o(s?.namespace?.value||a.namespace,t.value)}]}))},c.toArray(m))}):e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Check if you have any running pods and try again"}))):e.createElement(De,{$height:"70vh"},e.createElement(Pe,null))},Dl=d(ue)`
|
|
470
471
|
width: 100%;
|
|
471
472
|
align-items: center;
|
|
472
473
|
justify-content: space-between;
|
|
473
|
-
`,
|
|
474
|
+
`,Nl=({source:a,fetchSourceLibraries:n})=>{const o=O.useTheme(),[l,s]=t(!1),[c,d]=t(null);return i(()=>{a&&n({namespace:a.namespace,name:a.name,kind:a.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(Tt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[a.namespace,a.name,a.kind]),c||l?e.createElement(ee,{$gap:12},l?e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(Z,{title:"Instrumented Libraries"},c.map(({name:t,healthy:i,nonIdentifyingAttributes:a},n)=>e.createElement(r,{key:`library-${t}`},e.createElement(Dl,null,e.createElement(E,{size:12,color:o.text.grey},t),e.createElement(ue,{$gap:4},a.map(({key:i,value:a})=>ti(a)&&ii(a)&&"is_standard_lib"===i?e.createElement(de,{key:`${t}-${i}`,status:W.Default,title:"STANDARD",withBorder:!0}):null),"boolean"==typeof i&&e.createElement(de,{status:i?W.Success:W.Error,title:i?"HEALTHY":"UNHEALTHY",withBorder:!0}))),n!==c.length-1&&e.createElement(se,{length:"100%",margin:"0"})))):e.createElement(De,{$height:"70vh",$gap:12},e.createElement(Ne,{title:"No libraries found",subTitle:""}),e.createElement(oe,{type:W.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(De,{$height:"70vh"},e.createElement(Pe,null))};var El;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(El||(El={}));const Ol=[oi.Deployment,oi.StatefulSet,oi.DaemonSet,oi.DeploymentConfig],Fl=[li.Python,li.Go,li.Java],Il=d.div`
|
|
474
475
|
width: 100%;
|
|
475
476
|
height: 100%;
|
|
476
477
|
max-height: calc(100vh - 220px);
|
|
477
478
|
overflow: overlay;
|
|
478
479
|
overflow-y: auto;
|
|
479
|
-
`,
|
|
480
|
+
`,Al=d.div`
|
|
480
481
|
display: flex;
|
|
481
482
|
flex-direction: column;
|
|
482
483
|
gap: 12px;
|
|
483
|
-
`,
|
|
484
|
+
`,Ml=({persistSources:a,updateSource:o,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d,restartPod:u})=>{const{isVm:p}=We(),{sources:h}=_(),{selectedStreamName:g}=_e(),{drawerType:y,drawerEntityId:v}=K(),b=l(()=>Ye(h,g),[h,g]),f=n(null),x=y===B.Source,[$,k]=t(!1),[C,S]=t(!1),[w,T]=t(El.Overview),[D,N]=t(null);i(()=>{x&&v&&s(v).then(e=>N(e||null))},[x,v]);const{formData:O,handleFormChange:F,resetFormData:I,loadFormWithDrawerItem:A}=ai(),M=l(()=>{if(v)return D&&JSON.stringify(qt(D))===JSON.stringify(qt(v))?D:b?.find(e=>JSON.stringify(qt(e))===JSON.stringify(qt(v)))},[v,b,D]);i(()=>{x&&M?A(M):I()},[x,M]);const R=l(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===he.Loading,containers:M?.containers||[]}},[M]),L=l(()=>{const e=[{label:El.Overview,onClick:()=>T(El.Overview),selected:w===El.Overview}];return Ol.includes(M?.kind)&&e.push({label:El.Pods,onClick:()=>T(El.Pods),selected:w===El.Pods}),M?.containers?.some(({language:e})=>Fl.includes(e))&&e.push({label:El.Libraries,onClick:()=>T(El.Libraries),selected:w===El.Libraries}),e},[w,M]);return M?e.createElement(xa,{ref:f,onClose:()=>{T(El.Overview),N(null)},title:M.otelServiceName||M.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:He(M.containers),isEdit:$,isFormDirty:C,onEdit:w===El.Overview?e=>{k("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=O.otelServiceName!==M.name?O.otelServiceName:"";F("otelServiceName",e),await o(v,{...O,otelServiceName:e}),N(null),S(!1),k(!1)},onDelete:w===El.Overview?async()=>{const{namespace:e}=M;a({[e]:[{...M,selected:!1,currentStreamName:g}]},{}),N(null),S(!1),k(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{S(!1),k(!1),F("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===b.length,tabs:L,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([v]),children:e.createElement(e.Fragment,null,e.createElement(Ii,null),e.createElement(E,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},w===El.Overview?$?e.createElement(Il,null,e.createElement(Sl,{formData:O,handleFormChange:(...e)=>{S(!0),F(...e),F("currentStreamName",g)}})):e.createElement(Al,null,e.createElement(wl,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),e.createElement(X,{conditions:M.conditions||[]}),e.createElement(Z,{title:m.SOURCE_DETAILS,data:M?kl(M,p):[]}),e.createElement(Z,{title:p?m.DETECTED_PROCESSES:m.DETECTED_CONTAINERS,titleBadge:R.isLoading?he.Loading:R.containers.length,description:R.description||(p?m.DETECTED_PROCESSES_DESCRIPTION:m.DETECTED_CONTAINERS_DESCRIPTION)},R.containers.map(t=>e.createElement(ni,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await o(v,e)}))),e.createElement(Xi,{yaml:M.manifestYAML})):w===El.Pods?e.createElement(Tl,{source:M,fetchSourceDescribe:c,restartPod:u}):e.createElement(Nl,{source:M,fetchSourceLibraries:d})):null},Rl=d.div`
|
|
484
485
|
max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
|
|
485
486
|
width: 100%;
|
|
486
|
-
`,
|
|
487
|
+
`,Ll=a(({isModal:t,fetchSingleNamespace:i,onClickSummary:a},n)=>{const l=O.useTheme(),{isVm:r}=We(),s=ri({fetchSingleNamespace:i}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:p,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:x,setShowSelectedOnly:k,showRunningOnly:C,setShowRunningOnly:S}=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(ne,{$isNotModal:!t},e.createElement(ee,{$gap:12},e.createElement(ee,{$gap:24},a&&e.createElement(yt,{onClick:a}),e.createElement(I,{title:m.SELECT_SOURCES,badgeLabel:T,description:m.SELECT_SOURCES_DESCRIPTION}),e.createElement(ue,{$justifyContent:"space-between"},e.createElement(Rl,{$fullWidth:r},e.createElement($,{placeholder:b===B.Source?m.SEARCH_SOURCES:m.SEARCH_NAMESPACES,icon:Ti,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(F,{options:[{label:m.SOURCE,value:B.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:m.NAMESPACE,value:B.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:f})),e.createElement(ue,{$gap:36},e.createElement(w,{title:m.SELECT_ALL,initialValue:u,onChange:p,disabled:!!d}),e.createElement(w,{title:m.ONLY_SELECTED,initialValue:x,onChange:k}),e.createElement(w,{title:m.ONLY_RUNNING_INSTANCES,initialValue:C,onChange:S}))),e.createElement(se,null),e.createElement(gl,{isModal:t,...s})))});Ll.displayName=Ll.name;const Pl=({fetchSingleNamespace:t,persistSources:i})=>{const{currentModal:a,setCurrentModal:o}=te(),l=a===B.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),r()}},c=n(null);return j({key:"Enter",active:l},s),l?e.createElement(ie,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(ae,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(Ll,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Kl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:m.NAMESPACE,sortable:!0}),t.push({key:"containers",title:m.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},jl=({metrics:t,maxHeight:i,maxWidth:a})=>{const n=O.useTheme(),{isVm:o}=We(),r=ye(),{isThisPending:c}=L(),{selectedStreamName:d}=_e(),{sources:u,sourcesLoading:p}=_(),{setDrawerType:h,setDrawerEntityId:g}=K(),{selectedSources:y,setSelectedSources:v}=Me(),{isAwaitingInstrumentation:f,sourcesToCreate:x,sourcesCreated:$,sourcesToDelete:k,sourcesDeleted:C}=Re(),S=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,$):k?e(k,C):1},[x,$,k,C]),w=l(()=>Ye(u,d),[u,d]),T=l(()=>Oa({instrumentationRules:[],sources:Ue(w,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[w,r]),[D,N]=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:B.Source,entityId:i})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),v(e)}else v({})},[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),v(n)},[y]),A=l(()=>T.map(i=>{const a=qt(i),o=JSON.stringify(a),{hasErrors:l,hasWarnings:r,hasDisableds:s}=ce(i.conditions||[]),d=c({entityType:B.Source,entityId:a}),u=!!y[a.namespace]?.find(e=>e.namespace===a.namespace&&e.name===a.name&&e.kind===a.kind);return{status:l?W.Error:r?W.Warning:void 0,faded:s,onClick:()=>{h(B.Source),g(a)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ue,{$gap:16},e.createElement(b,{disabled:d,value:u,onChange:()=>I(i)}),e.createElement(si,{icons:He(i.containers),id:o}))},{columnKey:"name",value:fe(i,B.Source,{extended:!0})},{columnKey:"kind",value:i.kind,textColor:n.text.info},{columnKey:"namespace",value:i.namespace,textColor:n.text.info},{columnKey:"throughput",value:je(Et(t,B.Source,a).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Na,{conditions:i.conditions||[],id:o})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:W.Info,title:ci(i.containers),withBorder:!0}))}]}}),[T,y,t,I]),{badge:M,badgeTooltip:R}=l(()=>T.length!==w.length?{badge:`${T.length}/${w.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:w.length,badgeTooltip:void 0},[T,w]);return e.createElement($e,{$maxWidth:a},e.createElement(ke,null,e.createElement(b,{partiallyChecked:D&&T?.length!==N,value:D&&T?.length===N,onChange:F,disabled:!T?.length}),e.createElement(Ce,{icon:Se(B.Source),title:m.SOURCES,badge:M,badgeTooltip:R,loading:p||f})),e.createElement(we,{$maxHeight:i},e.createElement(Te,{columns:Kl(o),rows:A})),f&&!A.length?e.createElement(De,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Ee,{width:420}),e.createElement(ue,{$gap:16},e.createElement(E,{color:n.text.info},x?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Oe,{label:`${S}%`}))):A.length?null:e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},Vl=({expiresAt:t})=>{const i=O.useTheme(),{formatTimeAgo:a}=zt(),n=a(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),l=di(t,0)?i.text.error:di(t,6048e5)?i.text.warning:i.text.success;return e.createElement(E,{size:14,color:l},n," (",o,")")},ql=d.div`
|
|
487
488
|
position: relative;
|
|
488
|
-
`,
|
|
489
|
+
`,zl=({token:i,saveToken:a})=>{const{CopyButton:n}=ui(),{formData:o,handleFormChange:l,resetFormData:r}=pi({token:i}),[s,c]=t(!1),d=()=>{c(!1),r()};return e.createElement(ue,{$gap:0},e.createElement(n,{value:i,size:mi.L}),e.createElement(se,{orientation:"vertical",length:"12px"}),e.createElement(ql,null,e.createElement(mt,{size:32,onClick:()=>{c(!0)}},e.createElement(ki,null)),s&&e.createElement(hi,{flipX:!0,clientX:36,isOpen:s,onClose:d,onSave:()=>{a(o.token).then(d)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement($,{placeholder:"API Token",type:"password",value:o.token,onChange:e=>l("token",e.target.value)}))))},Hl=({tokens:t,saveToken:i})=>e.createElement(Z,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:h.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:Hi},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Vl,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(zl,{token:a,saveToken:i})}]}))}}]}),Bl=({fetchDescribeOdigos:a})=>{const[n,o]=t(null);if(i(()=>{a().then(({data:e})=>{o(e?.describeOdigos||null)})},[a]),!n)return e.createElement(De,null,e.createElement(Pe,null));const l=t=>t?.name?[e.createElement(se,{key:`divider-${t.name}`}),e.createElement(Xt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(ti(t.value)?ii(t.value)?W.Success:W.Error:W.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(Z,{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(Z,{title:"Cluster Collector",withExtend:!0},Object.values(n?.clusterCollector||{}).map(l)),e.createElement(Z,{title:"Node Collector",withExtend:!0},Object.values(n?.nodeCollector||{}).map(l)))},Wl=d.div`
|
|
489
490
|
display: flex;
|
|
490
491
|
flex-direction: column;
|
|
491
492
|
gap: 12px;
|
|
492
|
-
`,
|
|
493
|
+
`,_l="System Overview",Jl=({tokens:i,saveToken:a,fetchDescribeOdigos:n})=>{const[o,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(mt,{key:_l,onClick:r,tooltip:_l},e.createElement(Bi,{size:18})),e.createElement(q,{width:"750px",isOpen:o,onClose:r,header:{icons:[Bi],title:_l},footer:{isOpen:!1}},e.createElement(Wl,null,!!i?.length&&e.createElement(Hl,{tokens:i,saveToken:a}),e.createElement(Bl,{fetchDescribeOdigos:n}))))},Ul=d.div`
|
|
493
494
|
position: fixed;
|
|
494
495
|
bottom: 12px;
|
|
495
496
|
left: 12px;
|
|
@@ -498,7 +499,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
498
499
|
flex-direction: column-reverse;
|
|
499
500
|
gap: 6px;
|
|
500
501
|
max-width: 600px;
|
|
501
|
-
`,
|
|
502
|
+
`,Yl=()=>{const{notifications:t,markAsDismissed:i,markAsSeen:a}=P(),{onClickNotification:n}=Ht();return e.createElement(Ul,null,t.filter(({dismissed:e})=>!e).map(({id:t,type:o,title:l,message:r,crdType:s,target:c})=>e.createElement(oe,{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})})))},Gl=d.div`
|
|
502
503
|
position: relative;
|
|
503
504
|
display: flex;
|
|
504
505
|
align-items: center;
|
|
@@ -517,7 +518,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
517
518
|
stroke: ${({theme:e})=>e.text.secondary};
|
|
518
519
|
}
|
|
519
520
|
}
|
|
520
|
-
`,
|
|
521
|
+
`,Xl=d.div`
|
|
521
522
|
position: absolute;
|
|
522
523
|
top: 2px;
|
|
523
524
|
left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
|
|
@@ -527,50 +528,50 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
527
528
|
background-color: ${({theme:e})=>e.colors.border};
|
|
528
529
|
border-radius: 100%;
|
|
529
530
|
transition: all 0.3s;
|
|
530
|
-
`,
|
|
531
|
+
`,Zl=({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})),Ql=()=>{const{darkMode:t,setDarkMode:i}=gi();return e.createElement(Gl,{onClick:()=>i(!t)},e.createElement(Zl,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),e.createElement(Zl,{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(Xl,{$darkMode:t}))},er=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)},tr=(e,t)=>{const{tags:i}=e,a={},n=[];return i.forEach(e=>{a[e.key]=e.value}),n.push({type:h.Code,value:{language:"json",code:JSON.stringify(a,null,2),pretty:t}}),n},ir=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:h.Divider})}),i},ar=e=>{const{traceID:t,spanID:i,processID:a,operationName:n,duration:o,startTime:l,warnings:r}=e,s=[];return s.push({type:h.CopyText,title:"Trace ID",value:t}),s.push({type:h.CopyText,title:"Span ID",value:i}),s.push({type:h.Divider}),s.push({title:"Service",value:a}),s.push({title:"Operation",value:n}),s.push({title:"Duration",value:yi(o)}),s.push({title:"Start time",value:new Date(l/1e3).toLocaleString()}),r.length&&(s.push({type:h.Divider}),s.push({title:"Warnings",titleIcon:Wi,value:r})),s},nr=(e,t)=>{const{tags:i}=e,a={},n=[];return i.forEach(e=>{a[e.key]=e.value}),n.push({type:h.Code,value:{language:"json",code:JSON.stringify(a,null,2),pretty:t}}),n},or=d.div`
|
|
531
532
|
display: flex;
|
|
532
533
|
flex-direction: column;
|
|
533
534
|
gap: 12px;
|
|
534
535
|
max-height: 100vh;
|
|
535
536
|
overflow-y: auto;
|
|
536
|
-
`,
|
|
537
|
+
`,lr=({span:i,process:a,onClose:n})=>{const[o,l]=t(!0),[r,s]=t(!0);return e.createElement(q,{width:"750px",isOpen:!0,onClose:n,header:{icons:[_i],title:i.operationName},footer:{isOpen:!1}},e.createElement(or,null,e.createElement(Z,{title:"Details",data:ar(i)}),i.logs.length>0&&e.createElement(Z,{title:"Errors",titleBadge:i.logs.length,titleIcon:Wi,data:ir(i)}),e.createElement(Z,{title:"Tags",data:tr(i,o),action:e.createElement(vi,{isPrettyMode:o,setIsPrettyMode:l})}),a&&e.createElement(Z,{title:`Process (${a.serviceName})`,data:nr(a,r),action:e.createElement(vi,{isPrettyMode:r,setIsPrettyMode:s})})))},rr=370,sr=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),cr=d.div`
|
|
537
538
|
display: flex;
|
|
538
539
|
align-items: center;
|
|
539
|
-
width: ${
|
|
540
|
+
width: ${rr}px;
|
|
540
541
|
background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+O.opacity.hex["042"]:t.colors.dark_grey};
|
|
541
542
|
&:hover {
|
|
542
543
|
${({$withErrors:e,$preventHover:t,theme:i})=>!t&&`background-color: ${e?i.colors.error:i.colors.secondary+O.opacity.hex["010"]};`}
|
|
543
544
|
cursor: ${({$preventHover:e})=>e?"default":"pointer"};
|
|
544
545
|
}
|
|
545
|
-
`,
|
|
546
|
+
`,dr=d(ue)`
|
|
546
547
|
align-items: center;
|
|
547
548
|
justify-content: space-between;
|
|
548
549
|
gap: 4px;
|
|
549
550
|
padding: 12px;
|
|
550
551
|
padding-left: ${({$depth:e})=>12*e||12}px;
|
|
551
|
-
width: calc(${
|
|
552
|
-
`,
|
|
552
|
+
width: calc(${rr}px - ${({$depth:e})=>12*e}px);
|
|
553
|
+
`,ur=d(ue)`
|
|
553
554
|
align-items: center;
|
|
554
555
|
gap: 4px;
|
|
555
556
|
position: absolute;
|
|
556
557
|
right: 56px;
|
|
557
558
|
width: calc(100% - ${434}px);
|
|
558
|
-
`,
|
|
559
|
+
`,pr=d.div`
|
|
559
560
|
position: absolute;
|
|
560
561
|
left: ${({$startTime:e,$minStartTime:t,$maxEndTime:i})=>(e-t)/(i-t)*100+"%"};
|
|
561
562
|
width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
|
|
562
563
|
height: 12px;
|
|
563
564
|
border-radius: 32px;
|
|
564
|
-
background-color: ${({$indexInMatrix:e})=>
|
|
565
|
-
`,
|
|
565
|
+
background-color: ${({$indexInMatrix:e})=>sr[e%sr.length]};
|
|
566
|
+
`,mr=d(E)`
|
|
566
567
|
padding-left: calc(100% + 8px);
|
|
567
568
|
font-size: 10px;
|
|
568
569
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
569
570
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
570
571
|
white-space: nowrap;
|
|
571
|
-
`,
|
|
572
|
+
`,hr=({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=O.useTheme(),[g,y]=t(!1),v=rr-12*a-20-(s?12:0),b=s&&(1===a||i.logs.length>0);return e.createElement(cr,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(dr,{$depth:a,className:"span-left"},e.createElement(ue,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(mt,{onClick:e=>{e.stopPropagation(),p?.()},size:24},e.createElement(ht,{extend:d??!1}))):e.createElement("div",{style:{width:"24px"}}),e.createElement(fi,{maxWidth:v/2,text:i.processID,textSize:14}),e.createElement(E,{size:12,color:h.text.darker_grey},"•"),e.createElement(fi,{maxWidth:v/2,text:i.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(b?e.createElement(me,{...c},e.createElement(Wi,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(se,{type:W.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(ur,{className:"span-right"},e.createElement(pr,{$indexInMatrix:n,$duration:i.duration,$maxDuration:o,$startTime:i.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(mr,null,yi(i.duration)))))},gr=({spans:t,logs:i,depth:a,indexInMatrix:n,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=O.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=i.length?i:bi(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(hr,{span:t,depth:a,indexInMatrix:n+u+a,maxDuration:o,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Wi,title:v,text:b},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...bi(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(gr,{spans:t.spans||[],logs:g,depth:a+1,indexInMatrix:n+u,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},yr=d.div`
|
|
572
573
|
width: 100%;
|
|
573
|
-
`,
|
|
574
|
+
`,vr=d.div`
|
|
574
575
|
max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
575
576
|
overflow: auto;
|
|
576
577
|
|
|
@@ -580,22 +581,22 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
580
581
|
border-radius: 24px;
|
|
581
582
|
border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
582
583
|
position: relative;
|
|
583
|
-
`,
|
|
584
|
+
`,br=d.div`
|
|
584
585
|
padding: 12px 12px 12px 24px;
|
|
585
|
-
width: calc(${
|
|
586
|
+
width: calc(${rr}px - 36px);
|
|
586
587
|
background-color: ${({theme:e})=>e.colors.dark_grey};
|
|
587
|
-
`,
|
|
588
|
+
`,fr=d.div`
|
|
588
589
|
width: 1px;
|
|
589
590
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
590
591
|
background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
|
|
591
592
|
|
|
592
593
|
position: absolute;
|
|
593
|
-
left: calc(${
|
|
594
|
-
|
|
594
|
+
left: calc(${rr}px + ((100% - ${rr}px) / ${5}) * ${({index:e})=>e});
|
|
595
|
+
`,xr=d(E)`
|
|
595
596
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
596
597
|
font-size: 12px;
|
|
597
598
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
598
599
|
padding-top: 12px;
|
|
599
600
|
padding-left: 12px;
|
|
600
601
|
white-space: nowrap;
|
|
601
|
-
|
|
602
|
+
`,$r=({heightToRemove:i,traces:a,isLoading:n})=>{const[o,r]=t([]),[s,c]=t(null),d=l(()=>Tt(a).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:er(e)})),[a]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),p=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(yr,{$heightToRemove:i},n?e.createElement(De,{$height:"50vh"},e.createElement(Pe,{scale:1.5})):d.length?e.createElement(vr,{$heightToRemove:i},e.createElement(br,null,e.createElement(E,null,"Service & operation")),new Array(5).fill(null).map((t,a)=>e.createElement(fr,{key:`${a}-divider`,$heightToRemove:i,index:a},e.createElement(xr,null,yi(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(gr,{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(De,{$height:"50vh"},e.createElement(Ne,{title:m.NO_TRACES_FOUND,subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(lr,{span:s,process:p,onClose:()=>c(null)}))};export{Sa as ActionDrawer,fa as ActionForm,Ta as ActionModal,Ia as ActionTable,Pa as AwaitPipeline,on as ConditionDropdown,Qa as DataFlow,On as DataFlowActionsMenu,xn as DataStreamDrawer,bn as DataStreamForm,In as DataStreamModal,Fn as DataStreamSelectionForm,Wn as DestinationDrawer,zn as DestinationForm,uo as DestinationModal,yo as DestinationSelectionForm,bo as DestinationTable,ln as ErrorDropdown,Mo as InstrumentationRuleDrawer,Fo as InstrumentationRuleForm,Po as InstrumentationRuleModal,Vo as InstrumentationRuleTable,dn as KindDropdown,rn as LanguageDropdown,sn as MonitorDropdown,zo as MultiSourceControl,cn as NamespaceDropdown,fl as NavIconIds,Uo as NotificationManager,xa as OverviewDrawer,ol as ServiceMap,bl as SetupSummary,xl as SideNav,$l as SlackInvite,Ml as SourceDrawer,Sl as SourceForm,Pl as SourceModal,Ll as SourceSelectionForm,jl as SourceTable,Jl as SystemOverview,Na as TableCellConditions,Yl as ToastList,Ql as ToggleDarkMode,$r as TraceView};
|