@odigos/ui-kit 0.0.234 → 0.0.235
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/lib/chunks/{index-eOSrP07c.js → index-BmuiyBxZ.js} +1 -1
- package/lib/chunks/index-D6lL097V.js +145 -0
- package/lib/chunks/{index-Coer-PRZ.js → index-pkD-mO1h.js} +1 -1
- package/lib/chunks/ui-components-B4It5sfa.js +2696 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/sampling/index.d.ts +1 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/sampling-rules/converters.d.ts +3 -1
- package/lib/containers/_v2/sampling-rules/helpers.d.ts +2 -2
- package/lib/containers/v2.js +4 -4
- package/lib/containers.js +1 -1
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/_v2/sampling-rule-form-sections/source-scope.d.ts +2 -2
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/sampling.d.ts +24 -26
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-EPaudVws.js +0 -145
- package/lib/chunks/ui-components-BogDd0Qc.js +0 -2696
package/lib/components/v2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{gm as Autocomplete,x as Badge,m as Button,B as ButtonSize,hD as ButtonTab,hE as ButtonTabList,a as ButtonVariants,cn as Checkbox,hF as CheckboxList,eL as CheckboxSize,eR as CliCommand,hG as Condition,c_ as Conditions,hH as DEFAULT_TIME_UNITS,D as DataCard,c4 as Drawer,di as DropData,dk as DropDataAlignX,dj as DropDataAlignY,cP as DropDown,co as FieldMessage,cm as FieldTitle,eU as GaugeChart,hI as GaugeChartVariant,hJ as Header,_ as HoverActions,cQ as IconButton,cf as IconButtonSize,cp as Input,cr as InputList,cq as InputTable,eJ as Island,L as Loader,eC as Modal,hK as Navbar,N as NoData,cw as Note,e5 as Radio,hL as RadioGroup,e6 as RadioSize,w as Search,cL as SectionCard,hM as SectionCardSize,S as Segment,s as SegmentSize,r as SegmentVariant,eT as StatusCard,eK as Stepper,t as Table,v as TableVariant,c$ as Tag,cu as TextArea,eV as TextCard,fs as TimeInput,j as Toggle,l as ToggleLabelAlign,hN as ToggleList,k as ToggleSize,hO as ToggleVariant,eM as TruncatableTypography,n as Typography,o as TypographyColor,p as TypographySize,cT as TypographyVariants,cA as WarningModal}from"../chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"../icons.js";import"zustand";import"react";import"javascript-time-ago";import"../chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|
package/lib/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{aJ as AutocompleteInput,a_ as Badge,b0 as Button,i as CancelWarning,b as CenterThis,ai as Checkbox,C as Code,aa as ConditionDetails,Z as DataCard,G as DataCardFieldTypes,bM as DataCardFields,
|
|
1
|
+
export{aJ as AutocompleteInput,a_ as Badge,b0 as Button,i as CancelWarning,b as CenterThis,ai as Checkbox,C as Code,aa as ConditionDetails,Z as DataCard,G as DataCardFieldTypes,bM as DataCardFields,hr as DataFinger,b2 as DataTab,h as DeleteWarning,X as DescribeRow,W as Divider,aw as DocsButton,f as Drawer,hs as DrawerFooter,ht as DrawerHeader,bp as Dropdown,hu as ErrorBoundary,bx as ExtendArrow,M as FadeLoader,aj as FieldError,ah as FieldLabel,y as FlexColumn,F as FlexRow,hv as Header,aq as IconButton,cb as IconGroup,aV as IconTitleBadge,aQ as IconWrapped,c9 as IconsNav,hw as ImageControlled,I as Input,ap as InputList,am as InputTable,aY as InteractiveTable,ao as KeyValueInputsList,hx as LoadingText,aG as Modal,aH as ModalBody,ax as MonitorsCheckboxes,aS as MonitorsIcons,aK as NavigationButtons,Q as NoDataFound,a0 as NotificationNote,hy as Overlay,cZ as Padding,eE as PageContent,bl as Popup,cg as PopupForm,cl as ScrollX,b6 as ScrollY,av as SectionTitle,at as Segment,bn as SelectionButton,be as SkeletonLoader,J as Status,bL as Stepper,hz as TabList,aT as TableContainer,aU as TableTitleWrap,aX as TableWrap,bV as Tag,T as Text,ay as TextArea,an as Toggle,cj as ToggleCodeComponent,q as Tooltip,aZ as TraceLoader,eW as UpgradeRequiredWrapper,bm as VerticalScroll,ac as WarningModal,hA as getLinksFromText,hB as getStrongsFromText,hC as renderText}from"./chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|
|
@@ -43,6 +43,7 @@ export declare const LABEL_DROP_AT_MOST = "Drop at most this percentage of match
|
|
|
43
43
|
export declare const UNNAMED_RULE = "Unnamed rule";
|
|
44
44
|
export declare const SECTION_SAMPLING_PREVIEW = "Sampling Preview";
|
|
45
45
|
export declare const SECTION_SOURCE_SCOPE = "Source Scope";
|
|
46
|
+
export declare const UNKNOWN_SOURCE_LABEL = "Unknown source";
|
|
46
47
|
export declare const SECTION_OPERATION = "Operation";
|
|
47
48
|
export declare const SECTION_DURATION = "Duration";
|
|
48
49
|
export declare const SECTION_ERRORS = "Errors";
|
package/lib/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{cN as ACTION_ATTRIBUTE_OPTIONS,aB as ACTION_OPTIONS,cO as ACTION_SAMPLER_OPTIONS,
|
|
1
|
+
export{cN as ACTION_ATTRIBUTE_OPTIONS,aB as ACTION_OPTIONS,cO as ACTION_SAMPLER_OPTIONS,h5 as ALL_SOURCES,d0 as BTN_CANCEL,e_ as BTN_CREATE_FIRST_RULE,d8 as BTN_CREATE_RULE,d3 as BTN_DELETE_RULE,g7 as BTN_EDIT_AUTO_RULE,d2 as BTN_EDIT_RULE,dg as BTN_SAVE,d1 as BTN_SAVE_RULE,e as BUTTON_TEXTS,d5 as CATEGORY_DESCRIPTIONS,g4 as CATEGORY_LABELS,d9 as CATEGORY_TITLES,h6 as CREATE_COST_REDUCTION_AUTO_RULE_DRAWER_TITLE,h7 as CREATE_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_TITLE,h8 as CREATE_NOISY_AUTO_RULE_DRAWER_TITLE,cY as DEFAULT_CLUSTER_ID,cX as DEFAULT_CLUSTER_NAME,bw as DEFAULT_DATA_STREAM_NAME,cF as DESC_DROP_PERCENTAGE,fy as DESC_DURATION,fx as DESC_ERRORS,fS as DESC_KEEP_PERCENTAGE,fB as DESC_OPERATION,g5 as DESC_RULE_TYPE,gk as DESC_SOURCE_SCOPE,bJ as DESTINATION_CATEGORIES,bq as DISPLAY_LANGUAGES,z as DISPLAY_TITLES,ct as DOCS_BASE_URL,bI as DestinationCategoryTypes,dc as EDIT_COST_REDUCTION_AUTO_RULE_DRAWER_SUBTITLE,dd as EDIT_COST_REDUCTION_AUTO_RULE_DRAWER_TITLE,da as EDIT_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_SUBTITLE,db as EDIT_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_TITLE,de as EDIT_NOISY_AUTO_RULE_DRAWER_SUBTITLE,df as EDIT_NOISY_AUTO_RULE_DRAWER_TITLE,d6 as EDIT_TITLES,fN as EMPTY_VALUE,eY as FILTER_TYPE_ALL,aI as FORM_ALERTS,bZ as INSTRUMENTATION_RULE_OPTIONS,fz as LABEL_CUSTOM_DURATION,cM as LABEL_CUSTOM_PERCENTAGE,cK as LABEL_DISABLED,eX as LABEL_DISABLED_RULE,fY as LABEL_DROP_ALL,cE as LABEL_DROP_AT_MOST,fU as LABEL_DROP_PERCENTAGE,cJ as LABEL_ENABLED,fG as LABEL_HTTP_ROUTE,fI as LABEL_HTTP_ROUTE_PREFIX,fK as LABEL_KAFKA_TOPIC,fZ as LABEL_KEEP_ALL,fV as LABEL_KEEP_AT_LEAST,fW as LABEL_KEEP_AT_MOST,fT as LABEL_KEEP_PERCENTAGE,fw as LABEL_KEEP_TRACES_DURATION,fu as LABEL_KEEP_TRACES_ERRORS,fJ as LABEL_METHOD,g0 as LABEL_NOTE,gc as LABEL_NO_PREVIEW,fM as LABEL_OPERATION_TYPE,h9 as LABEL_RULE_DISABLED,ha as LABEL_RULE_ENABLED,f_ as LABEL_RULE_NAME,f$ as LABEL_RULE_TYPE,fX as LABEL_SAMPLE,fD as LABEL_SERVER_ADDRESS,fF as LABEL_TEMPLATED_PATH,fH as LABEL_TEMPLATED_PATH_PREFIX,hb as LANGUAGE_OPTIONS,br as MONITORS_OPTIONS,gi as NOTE_ENTIRE_CLUSTER,gl as NOTE_SOURCE_SCOPE_LOGIC,hc as OPENTELEMETRY_EBPF_DISTRO_OPTION,fP as OPERATION_ALL,fO as OPERATION_HTTP_CLIENT,fL as OPERATION_HTTP_SERVER,fQ as OPERATION_KAFKA_CONSUMER,fR as OPERATION_KAFKA_PRODUCER,hd as OTEL_DISTRO_NAME_OPTIONS,g2 as PLACEHOLDER_NOTE,fE as PLACEHOLDER_ROUTE,g1 as PLACEHOLDER_RULE_NAME,gn as PLACEHOLDER_SEARCH_SOURCE,fC as PLACEHOLDER_SERVER_ADDRESS,cI as SAMPLING_AUTO_RULE_TITLE,fh as SAMPLING_BTN_CREATE_RULE,ff as SAMPLING_BTN_DOCS,fg as SAMPLING_BTN_REFRESH,cH as SAMPLING_COST_REDUCTION_AUTO_RULE_TITLE,fn as SAMPLING_DELETE_MODAL_APPROVE,fo as SAMPLING_DELETE_MODAL_CANCEL,fp as SAMPLING_DELETE_MODAL_DESCRIPTION,fq as SAMPLING_DELETE_MODAL_TITLE,dh as SAMPLING_DRAWER_WIDTH,fe as SAMPLING_DUPLICATE_RULE_WARNING,cD as SAMPLING_HIGHLY_RELEVANT_AUTO_RULE_TITLE,e8 as SAMPLING_ONBOARDING_ADVANCED_LEFT_BULLET_1,e9 as SAMPLING_ONBOARDING_ADVANCED_LEFT_BULLET_2,ea as SAMPLING_ONBOARDING_ADVANCED_LEFT_BULLET_3,eb as SAMPLING_ONBOARDING_ADVANCED_LEFT_TITLE,ec as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_1,ed as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_2,ee as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_3,ef as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_4,eg as SAMPLING_ONBOARDING_ADVANCED_RIGHT_BULLET_5,eh as SAMPLING_ONBOARDING_ADVANCED_RIGHT_TITLE,ej as SAMPLING_ONBOARDING_ADVANCED_SUBTITLE,ei as SAMPLING_ONBOARDING_ADVANCED_TITLE,eB as SAMPLING_ONBOARDING_AMBIENT_LABEL,dE as SAMPLING_ONBOARDING_BTN_GO_TO,dn as SAMPLING_ONBOARDING_BTN_NEXT,e7 as SAMPLING_ONBOARDING_BTN_READ_MORE,dP as SAMPLING_ONBOARDING_BTN_SKIP,dQ as SAMPLING_ONBOARDING_BTN_START,ek as SAMPLING_ONBOARDING_COMMON_BANNER,eA as SAMPLING_ONBOARDING_COMMON_RULES_SECTION,eo as SAMPLING_ONBOARDING_DROP_DESCRIPTION,en as SAMPLING_ONBOARDING_DROP_SUBTITLE,em as SAMPLING_ONBOARDING_DROP_TITLE,er as SAMPLING_ONBOARDING_ERROR_PRESET_NAME,eq as SAMPLING_ONBOARDING_ERROR_PRESET_TOGGLE_LABEL,eu as SAMPLING_ONBOARDING_KEEP_DESCRIPTION,et as SAMPLING_ONBOARDING_KEEP_SUBTITLE,es as SAMPLING_ONBOARDING_KEEP_TITLE,ev as SAMPLING_ONBOARDING_KEEP_USE_CASE_1,ew as SAMPLING_ONBOARDING_KEEP_USE_CASE_2,ex as SAMPLING_ONBOARDING_KEEP_USE_CASE_3,ey as SAMPLING_ONBOARDING_KEEP_USE_CASE_4,ez as SAMPLING_ONBOARDING_KEEP_USE_CASE_5,dw as SAMPLING_ONBOARDING_NOISY_BANNER,ds as SAMPLING_ONBOARDING_NOISY_DESCRIPTION,dv as SAMPLING_ONBOARDING_NOISY_PRESET_NAME,dt as SAMPLING_ONBOARDING_NOISY_PRESET_SECTION,du as SAMPLING_ONBOARDING_NOISY_PRESET_TOGGLE_LABEL,dr as SAMPLING_ONBOARDING_NOISY_SUBTITLE,dq as SAMPLING_ONBOARDING_NOISY_TITLE,ep as SAMPLING_ONBOARDING_PRESET_RULES_SECTION,dl as SAMPLING_ONBOARDING_RECOMMENDED_BADGE,e2 as SAMPLING_ONBOARDING_STRATEGY_ADVANCED_BADGE,e3 as SAMPLING_ONBOARDING_STRATEGY_ADVANCED_DESC,e4 as SAMPLING_ONBOARDING_STRATEGY_ADVANCED_NAME,d$ as SAMPLING_ONBOARDING_STRATEGY_DROP_BADGE,dZ as SAMPLING_ONBOARDING_STRATEGY_DROP_BULLET_1,d_ as SAMPLING_ONBOARDING_STRATEGY_DROP_BULLET_2,e0 as SAMPLING_ONBOARDING_STRATEGY_DROP_DESC,e1 as SAMPLING_ONBOARDING_STRATEGY_DROP_NAME,dW as SAMPLING_ONBOARDING_STRATEGY_KEEP_BADGE,dU as SAMPLING_ONBOARDING_STRATEGY_KEEP_BULLET_1,dV as SAMPLING_ONBOARDING_STRATEGY_KEEP_BULLET_2,dX as SAMPLING_ONBOARDING_STRATEGY_KEEP_DESC,dY as SAMPLING_ONBOARDING_STRATEGY_KEEP_NAME,dT as SAMPLING_ONBOARDING_STRATEGY_KEEP_WARNING,dS as SAMPLING_ONBOARDING_STRATEGY_SUBTITLE,dR as SAMPLING_ONBOARDING_STRATEGY_TITLE,dB as SAMPLING_ONBOARDING_SUCCESS_BULLET_1,dC as SAMPLING_ONBOARDING_SUCCESS_BULLET_2,dD as SAMPLING_ONBOARDING_SUCCESS_BULLET_3,dA as SAMPLING_ONBOARDING_SUCCESS_INTRO,dz as SAMPLING_ONBOARDING_SUCCESS_SUBTITLE,dy as SAMPLING_ONBOARDING_SUCCESS_TITLE,dO as SAMPLING_ONBOARDING_WELCOME_BANNER,dH as SAMPLING_ONBOARDING_WELCOME_INTRO,dI as SAMPLING_ONBOARDING_WELCOME_STAGE_1_DESC,dJ as SAMPLING_ONBOARDING_WELCOME_STAGE_1_TITLE,dK as SAMPLING_ONBOARDING_WELCOME_STAGE_2_DESC,dL as SAMPLING_ONBOARDING_WELCOME_STAGE_2_TITLE,dM as SAMPLING_ONBOARDING_WELCOME_STAGE_3_DESC,dN as SAMPLING_ONBOARDING_WELCOME_STAGE_3_TITLE,dG as SAMPLING_ONBOARDING_WELCOME_SUBTITLE,dF as SAMPLING_ONBOARDING_WELCOME_TITLE,fi as SAMPLING_PAGE_DESCRIPTION,fj as SAMPLING_PAGE_TITLE,cG as SECTION_DROP_PERCENTAGE,fv as SECTION_DURATION,ft as SECTION_ERRORS,he as SECTION_KEEP_PERCENTAGE,fA as SECTION_OPERATION,gb as SECTION_SAMPLING_PREVIEW,gh as SECTION_SOURCE_SCOPE,bs as STORAGE_KEYS,eZ as TITLE_NO_RESULTS,e$ as TITLE_NO_RULES,hf as TOKEN_ABOUT_TO_EXPIRE,g3 as TOOLTIP_NOTE,gj as UNKNOWN_SOURCE_LABEL,d7 as UNNAMED_RULE,f0 as getNoResultsSubTitle}from"./chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { NoisyOperationRule, HighlyRelevantOperationRule, CostReductionRule, NoisyOperationRuleInput, HighlyRelevantOperationRuleInput, CostReductionRuleInput, SamplingRuleCategory, SamplingRuleFormState, ViewRuleData } from '@/types';
|
|
1
|
+
import type { NoisyOperationRule, HighlyRelevantOperationRule, CostReductionRule, NoisyOperationRuleInput, HighlyRelevantOperationRuleInput, CostReductionRuleInput, SourcesScopes, SamplingRuleCategory, SamplingRuleFormState, ViewRuleData } from '@/types';
|
|
2
|
+
export declare function makeEmptyScopes(): SourcesScopes;
|
|
3
|
+
export declare function isScopesAllEmpty(s: SourcesScopes | null | undefined): boolean;
|
|
2
4
|
export declare function getDefaultFormState(category?: SamplingRuleCategory): SamplingRuleFormState;
|
|
3
5
|
export declare function formStateToPartialNoisy(state: SamplingRuleFormState): NoisyOperationRule;
|
|
4
6
|
export declare function formStateToPartialHighlyRelevant(state: SamplingRuleFormState): HighlyRelevantOperationRule;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ColoredSpanPart } from '@/snippets/_v2/colored-span';
|
|
2
2
|
import type { SamplingRuleItem, SamplingRuleCategory, HighlyRelevantBadgeType, ViewRuleData } from '@/types';
|
|
3
|
-
import type { NoisyOperationRule, HighlyRelevantOperationRule, CostReductionRule,
|
|
3
|
+
import type { NoisyOperationRule, HighlyRelevantOperationRule, CostReductionRule, SourcesScopesInput, HeadSamplingOperationMatcher, TailSamplingOperationMatcher, SamplingRules } from '@/types';
|
|
4
4
|
export declare enum SamplingCategory {
|
|
5
5
|
Noisy = "noisy",
|
|
6
6
|
HighlyRelevant = "highly-relevant",
|
|
@@ -23,7 +23,7 @@ export declare function buildSummaryForRule(category: SamplingRuleCategory, rule
|
|
|
23
23
|
export declare function refreshViewRuleData(groups: SamplingRules[], current: ViewRuleData): ViewRuleData | null;
|
|
24
24
|
export declare function lookupViewRuleData(groups: SamplingRules[], item: SamplingRuleItem): ViewRuleData | null;
|
|
25
25
|
export interface DuplicateCheckInput {
|
|
26
|
-
sourceScopes?:
|
|
26
|
+
sourceScopes?: SourcesScopesInput | null;
|
|
27
27
|
operation?: HeadSamplingOperationMatcher | TailSamplingOperationMatcher | null;
|
|
28
28
|
error?: boolean;
|
|
29
29
|
durationAtLeastMs?: number | null;
|
package/lib/containers/v2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect as n,Fragment as i,forwardRef as o,useState as l,useImperativeHandle as s,useMemo as r,useCallback as c,useRef as d,Children as u}from"react";import p,{useTheme as h,css as m,keyframes as g}from"styled-components";import{ag as b,y as f,cm as v,cn as y,co as S,cp as C,ak as w,al as k,cq as x,af as $,j as T,l as A,cr as N,W as I,F as E,m as D,B as R,a as O,as as P,ae as M,cs as L,N as z,n as F,p as V,ct as B,S as _,cu as X,bB as j,cv as U,cw as W,R as H,bD as G,b7 as K,bH as q,cx as Y,o as J,bS as Q,q as Z,bO as ee,bT as te,bR as ae,bP as ne,bQ as ie,bU as oe,cy as le,x as se,bq as re,bW as ce,cz as de,cA as ue,z as pe,a5 as he,cB as me,cC as ge,cD as be,cE as fe,cF as ve,cG as ye,cH as Se,cI as Ce,cJ as we,cK as ke,s as xe,cL as $e,cM as Te,au as Ae,cN as Ne,cO as Ie,b as Ee,bI as De,cP as Re,cQ as Oe,cf as Pe,L as Me,bJ as Le,ba as ze,$ as Fe,bC as Ve,a3 as Be,bZ as _e,a4 as Xe,cR as je,c7 as Ue,cS as We,b_ as He,k as Ge,cT as Ke,cU as qe,cV as Ye,bc as Je,cW as Qe,E as Ze,bd as et,cX as tt,cY as at,aA as nt,c4 as it,e as ot,cZ as lt,D as st,c_ as rt,aC as ct,ce as dt,bA as ut,bg as pt,bF as ht,H as mt,bX as gt,aI as bt,c$ as ft,b9 as vt,d0 as yt,d1 as St,d2 as Ct,d3 as wt,d4 as kt,d5 as xt,d6 as $t,d7 as Tt,d8 as At,d9 as Nt,da as It,db as Et,dc as Dt,dd as Rt,de as Ot,df as Pt,dg as Mt,dh as Lt,u as zt,d as Ft,c0 as Vt,cd as Bt,di as _t,dj as Xt,dk as jt,g as Ut,dl as Wt,dm as Ht,dn as Gt,dp as Kt,dq as qt,dr as Yt,ds as Jt,dt as Qt,du as Zt,dv as ea,dw as ta,dx as aa,dy as na,dz as ia,dA as oa,dB as la,dC as sa,dD as ra,dE as ca,dF as da,dG as ua,dH as pa,dI as ha,dJ as ma,dK as ga,dL as ba,dM as fa,dN as va,dO as ya,dP as Sa,dQ as Ca,dR as wa,dS as ka,dT as xa,dU as $a,dV as Ta,dW as Aa,dX as Na,dY as Ia,dZ as Ea,d_ as Da,d$ as Ra,e0 as Oa,e1 as Pa,e2 as Ma,e3 as La,e4 as za,e5 as Fa,e6 as Va,e7 as Ba,e8 as _a,e9 as Xa,ea as ja,eb as Ua,ec as Wa,ed as Ha,ee as Ga,ef as Ka,eg as qa,eh as Ya,ei as Ja,ej as Qa,ek as Za,el as en,em as tn,en as an,eo as nn,ep as on,eq as ln,er as sn,es as rn,et as cn,eu as dn,ev as un,ew as pn,ex as hn,ey as mn,ez as gn,eA as bn,eB as fn,eC as vn,eD as yn,A as Sn,eE as Cn,t as wn,v as kn,eF as xn,eG as $n,eH as Tn,eI as An,eJ as Nn,eK as In,aO as En,a6 as Dn,bs as Rn,bo as On,br as Pn,bt as Mn,bj as Ln,w as zn,aR as Fn,aW as Vn,aE as Bn,eL as _n,c as Xn,b1 as jn,eM as Un,aN as Wn,b3 as Hn,O as Gn,b4 as Kn,b6 as qn,be as Yn,aL as Jn,b5 as Qn,b8 as Zn,bb as ei,bf as ti,bh as ai,bi as ni,aP as ii,a9 as oi,a8 as li,bv as si,eN as ri,bw as ci,eO as di,eP as ui,eQ as pi,eR as hi,eS as mi,eT as gi,eU as bi,eV as fi,eW as vi,r as yi,eX as Si,eY as Ci,eZ as wi,e_ as ki,e$ as xi,f0 as $i,f1 as Ti,f2 as Ai,f3 as Ni,f4 as Ii,f5 as Ei,f6 as Di,f7 as Ri,f8 as Oi,f9 as Pi,fa as Mi,fb as Li,fc as zi,fd as Fi,fe as Vi,ff as Bi,fg as _i,fh as Xi,fi as ji,fj as Ui,fk as Wi,fl as Hi,fm as Gi,fn as Ki,fo as qi,fp as Yi,fq as Ji,fr as Qi}from"../chunks/ui-components-BogDd0Qc.js";import{TrashIcon as Zi,PlusIcon as eo,BookIcon as to,VSquareIcon as ao,XSquareIcon as no,DeleteIcon as io,EditIcon as oo,GoLogo as lo,JavaLogo as so,ChevronRightIcon as ro,ActionIcon as co,DestinationIcon as uo,ChevronUpIcon as po,ChevronDownIcon as ho,VIcon as mo,XIcon as go,InstrumentationRuleIcon as bo,SourceIcon as fo,NamespacesIcon as vo,SettingsIcon as yo,SamplingIcon as So,ExclamationTriangleIcon as Co,ExclamationCircleIcon as wo,KeyIcon as ko,DiagnoseIcon as xo,DownloadIcon as $o,TerminalIcon as To,StarIcon as Ao,ArrowIcon as No,QuestionCircleIcon as Io,RefreshIcon as Eo,ConnectionsIcon as Do,OdigosLogo as Ro,ArrowRightIcon as Oo,FilterIcon as Po,RefreshLeftArrowIcon as Mo,DataStreamIcon as Lo,PipelineCollectorIcon as zo,PodIcon as Fo,ArrowDownSquareIcon as Vo,ArrowUpSquareIcon as Bo,GatewayIcon as _o,YamlIcon as Xo}from"../icons.js";import{S as jo,D as Uo,A as Wo,P as Ho,a as Go,b as Ko,R as qo,c as Yo,O as Jo,d as Qo,e as Zo,f as el,W as tl,g as al,C as nl,h as il,i as ol,U as ll}from"../chunks/index-EPaudVws.js";import{S as sl}from"../chunks/index-Coer-PRZ.js";import{Y as rl}from"../chunks/index-eOSrP07c.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const cl=[{id:"CREDIT_CARD",label:"Credit card"}],dl=[{id:b.CollectContainerAttributes,label:"Collect container attributes"},{id:b.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:b.CollectWorkloadId,label:"Collect workload ID"},{id:b.CollectClusterId,label:"Collect cluster ID"}],ul=[{id:$.Pod,label:$.Pod},{id:$.Namespace,label:$.Namespace},{id:$.Node,label:$.Node}],pl=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:ul}],hl=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:ul}],ml=[{label:"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."},{label:"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."},{label:"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.",inputType:w.Number},{label:"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.",inputType:w.Number}],gl=b.UrlTemplatizationRulesGroups,bl=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],fl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans)."},{label:"Sampling ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",inputType:w.Number},{label:"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.",inputType:w.Number}],vl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans)."},{label:"Attribute key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span."},{label:"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.",inputType:w.Number},{label:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",componentType:P.Dropdown,options:[{id:"stringCondition",label:"String condition"},{id:"numberCondition",label:"Number condition"},{id:"booleanCondition",label:"Boolean condition"},{id:"jsonCondition",label:"JSON condition"}]},{label:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",componentType:P.Dropdown,options:[{id:"exists",label:"Exists"},{id:"equals",label:"Equals"},{id:"not_equals",label:"Not equals"},{id:"contains",label:"Contains"},{id:"not_contains",label:"Not contains"},{id:"regex",label:"Regex"},{id:"greater_than",label:"Greater than"},{id:"less_than",label:"Less than"},{id:"greater_than_or_equal",label:"Greater than or equal"},{id:"less_than_or_equal",label:"Less than or equal"},{id:"is_valid_json",label:"Is valid JSON"},{id:"is_invalid_json",label:"Is invalid JSON"},{id:"jsonpath_exists",label:"JSON path exists"},{id:"key_equals",label:"Key equals"},{id:"key_not_equals",label:"Key not equals"}]},{label:"Expected value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against."},{label:"JSON path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",renderCondition:e=>"jsonCondition"===e.condition}],yl={[M.K8sAttributes]:({value:i,setValue:o,formErrors:l})=>(n(()=>{i[b.CollectContainerAttributes]||i[b.CollectReplicaSetAttributes]||i[b.CollectWorkloadId]||i[b.CollectClusterId]||i[b.LabelsAttributes]?.length||i[b.AnnotationsAttributes]?.length||(o(b.CollectContainerAttributes,!0),o(b.CollectReplicaSetAttributes,!0),o(b.CollectWorkloadId,!0),o(b.CollectClusterId,!0),o(b.LabelsAttributes,[]),o(b.AnnotationsAttributes,[]))},[]),e(a,{children:[t(f,{$gap:6,children:dl.map(({id:a,label:n})=>e(f,{children:[t(y,{label:n,value:i[a]||!1,onChange:e=>o(a,e)}),t(S,{errorMessage:l[a]})]},a))}),t(x,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:pl,values:i[b.LabelsAttributes]||[],setValues:e=>o(b.LabelsAttributes,e),errorMessage:l[b.LabelsAttributes]}),t(x,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:hl,values:i[b.AnnotationsAttributes]||[],setValues:e=>o(b.AnnotationsAttributes,e),errorMessage:l[b.AnnotationsAttributes]})]})),[M.AddClusterInfo]:({value:n,setValue:i,formErrors:o})=>{const l=h();return e(a,{children:[t(T,{label:"Overwrite existing values",labelAlign:A.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[b.OverwriteExistingValues]||!1,onChange:e=>i(b.OverwriteExistingValues,e)}),t(x,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value"}],values:n[b.ClusterAttributes]||[],setValues:e=>i(b.ClusterAttributes,e),errorMessage:o[b.ClusterAttributes]})]})},[M.DeleteAttributes]:({value:e,setValue:a,formErrors:n})=>t(N,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[b.AttributeNamesToDelete]||[],setValues:e=>a(b.AttributeNamesToDelete,e),errorMessage:n[b.AttributeNamesToDelete]}),[M.RenameAttributes]:({value:e,setValue:a,formErrors:n})=>t(x,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key"},{keyName:"newKey",label:"New key"}],values:Object.entries(e[b.Renames]||{}).map(([e,t])=>({oldKey:e,newKey:t})),setValues:e=>{const t={};e.forEach(e=>t[e.oldKey]=e.newKey),a(b.Renames,t)},errorMessage:n[b.Renames]}),[M.PiiMasking]:({value:a,setValue:i,formErrors:o})=>(n(()=>{a[b.PiiCategories]?.length||i(b.PiiCategories,cl.map(({id:e})=>e))},[]),e(f,{$gap:12,children:[t(v,{label:"Attributes to mask"}),t(f,{$gap:6,children:cl.map(({id:e,label:n})=>t(y,{label:n,value:a[b.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=a[b.PiiCategories]||[],o=t?[...n,e]:n.filter(t=>t!==e);i(b.PiiCategories,o)}},e))}),t(S,{errorMessage:o[b.PiiCategories]})]})),[M.ErrorSampler]:({value:e,setValue:a,formErrors:n})=>{const i=n[b.FallbackSamplingRatio],o=k(e[b.FallbackSamplingRatio])?"":String(e[b.FallbackSamplingRatio]);return t(C,{name:"fallbackSamplingRatio",label:"Fallback sampling ratio",type:w.Number,min:0,max:100,value:o,placeholder:"0-100",onChange:e=>{return t=e.target.value,a(b.FallbackSamplingRatio,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:i})},[M.ProbabilisticSampler]:({value:e,setValue:a,formErrors:n})=>{const i=n[b.SamplingPercentage],o=k(e[b.SamplingPercentage])?"":String(e[b.SamplingPercentage]);return t(C,{name:"samplingPercentage",label:"Sampling percentage",type:w.Number,min:0,max:100,value:o,placeholder:"0-100",onChange:e=>{return t=e.target.value,a(b.SamplingPercentage,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:i})},[M.LatencySampler]:({value:e,setValue:a,formErrors:n})=>{const i=n[b.EndpointsFilters],o=e[b.EndpointsFilters]||[];return t(x,{name:"endpointsFilters",limitFieldsPerRow:2,columns:ml,values:o,setValues:e=>{a(b.EndpointsFilters,e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:a,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(a),fallbackSamplingRatio:Number(n)})))},errorMessage:i})},[M.ServiceNameSampler]:({value:e,setValue:a,formErrors:n})=>{const i=n[b.ServicesNameFilters],o=e[b.ServicesNameFilters]||[];return t(x,{name:"servicesNameFilters",limitFieldsPerRow:2,columns:fl,values:o,setValues:e=>{a(b.ServicesNameFilters,e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:a})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(a)})))},errorMessage:i})},[M.SpanAttributeSampler]:({value:e,setValue:a,formErrors:n})=>{const i=n[b.AttributeFilters],o=(e[b.AttributeFilters]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:n})=>{const i=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:i,operation:n[i]?.operation,expectedValue:n[i]?.expectedValue,jsonPath:n[i]?.jsonPath}});return t(x,{name:"attributeFilters",limitFieldsPerRow:2,columns:vl,values:o,setValues:e=>{a(b.AttributeFilters,e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:n,operation:i,expectedValue:o,jsonPath:l})=>{const s={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(a),condition:{[n]:{operation:i,expectedValue:o}}};return l&&(s.condition[n].jsonPath=l),s}))},errorMessage:i})},[M.URLTemplatization]:({value:n,setValue:o,formErrors:l})=>{const s=h(),r=n[gl]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o(gl,e),d=(e,t)=>c(r.map((a,n)=>n===e?{...a,...t}:a));return e(a,{children:[r.map((a,n)=>e(i,{children:[t(I,{}),e(f,{$gap:12,children:[e(E,{$justifyContent:"space-between",$alignItems:"center",children:[t(v,{label:`Rule Group ${n+1}`}),t(D,{leftIcon:()=>t(Zi,{fill:s.v2.colors.red[500]}),variant:O.Secondary,size:R.S,onClick:()=>{return e=n,c(r.filter((t,a)=>a!==e));var e},disabled:1===r.length})]}),t(C,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:a.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(x,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:bl,values:a.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(N,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:a.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(S,{errorMessage:l[gl]})]},`url-templatization-group-${n}`)),t(D,{variant:O.Secondary,label:"Add rule group",leftIcon:eo,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(I,{})]})}},Sl=({actionType:e,value:a,setValue:n,formErrors:i})=>{if(!e)return null;const o=yl[e];return o?t(o,{value:a,setValue:n,formErrors:i}):null},Cl=()=>{const a=h(),{selectedOption:n,genericForm:i}=L();if(!i||!n)return t(z,{title:"No active form"});const{formData:o,handleFormChange:l,formErrors:s}=i;return e(f,{$gap:24,children:[e(E,{$gap:12,$justifyContent:"space-between",children:[t(F,{size:V.XXS,children:n.docsDescription}),t(D,{label:"Docs",leftIcon:to,variant:O.Text,size:R.S,onClick:()=>window.open(`${B}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]}),t(_,{options:[{icon:ao,label:"Enabled",value:!1,selectedBgColor:a.v2.colors.green[800]},{icon:no,label:"Disabled",value:!0,selectedBgColor:a.v2.colors.red[800]}],selected:o.disabled,setSelected:e=>l("disabled",e)}),t(jo,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:o.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(C,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:o.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(Sl,{actionType:n.type,value:o.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s}),t(X,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:o.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},wl=({signals:e,fields:a,disabled:n,formData:i,handleFormChange:o,formErrors:l})=>a?.map(({renderCondition:a,componentType:s,type:r,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!a||j(a,e,i.fields)))return null;const b=c,f=i.fields.find(e=>e.key===b),v=f?f.value:h;return t(Uo,{componentType:s,inputType:r,name:b,label:d,tooltip:u,disabled:n,required:m,placeholder:p,errorMessage:l[b],dropdownOptions:g,value:v||"",setValue:e=>o(b,e)},b)}),kl=p(E)`
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect as n,Fragment as i,forwardRef as o,useState as l,useImperativeHandle as s,useMemo as r,useCallback as c,useRef as d,Children as u}from"react";import p,{useTheme as h,css as m,keyframes as g}from"styled-components";import{ag as b,y as f,cm as v,cn as y,co as S,cp as C,ak as w,al as k,cq as x,af as $,j as T,l as A,cr as N,W as I,F as E,m as D,B as R,a as O,as as P,ae as M,cs as L,N as z,n as F,p as V,ct as B,S as _,cu as X,bB as j,cv as U,cw as W,R as H,bD as G,b7 as K,bH as q,cx as Y,o as J,bS as Q,q as Z,bO as ee,bT as te,bR as ae,bP as ne,bQ as ie,bU as oe,cy as le,x as se,bq as re,bW as ce,cz as de,cA as ue,z as pe,a5 as he,cB as me,cC as ge,cD as be,cE as fe,cF as ve,cG as ye,cH as Se,cI as Ce,cJ as we,cK as ke,s as xe,cL as $e,cM as Te,au as Ae,cN as Ne,cO as Ie,b as Ee,bI as De,cP as Re,cQ as Oe,cf as Pe,L as Me,bJ as Le,ba as ze,$ as Fe,bC as Ve,a3 as Be,bZ as _e,a4 as Xe,cR as je,c7 as Ue,cS as We,b_ as He,k as Ge,cT as Ke,cU as qe,cV as Ye,bc as Je,cW as Qe,E as Ze,bd as et,cX as tt,cY as at,aA as nt,c4 as it,e as ot,cZ as lt,D as st,c_ as rt,aC as ct,ce as dt,bA as ut,bg as pt,bF as ht,H as mt,bX as gt,aI as bt,c$ as ft,b9 as vt,d0 as yt,d1 as St,d2 as Ct,d3 as wt,d4 as kt,d5 as xt,d6 as $t,d7 as Tt,d8 as At,d9 as Nt,da as It,db as Et,dc as Dt,dd as Rt,de as Ot,df as Pt,dg as Mt,dh as Lt,u as zt,d as Ft,c0 as Vt,cd as Bt,di as _t,dj as Xt,dk as jt,g as Ut,dl as Wt,dm as Ht,dn as Gt,dp as Kt,dq as qt,dr as Yt,ds as Jt,dt as Qt,du as Zt,dv as ea,dw as ta,dx as aa,dy as na,dz as ia,dA as oa,dB as la,dC as sa,dD as ra,dE as ca,dF as da,dG as ua,dH as pa,dI as ha,dJ as ma,dK as ga,dL as ba,dM as fa,dN as va,dO as ya,dP as Sa,dQ as Ca,dR as wa,dS as ka,dT as xa,dU as $a,dV as Ta,dW as Aa,dX as Na,dY as Ia,dZ as Ea,d_ as Da,d$ as Ra,e0 as Oa,e1 as Pa,e2 as Ma,e3 as La,e4 as za,e5 as Fa,e6 as Va,e7 as Ba,e8 as _a,e9 as Xa,ea as ja,eb as Ua,ec as Wa,ed as Ha,ee as Ga,ef as Ka,eg as qa,eh as Ya,ei as Ja,ej as Qa,ek as Za,el as en,em as tn,en as an,eo as nn,ep as on,eq as ln,er as sn,es as rn,et as cn,eu as dn,ev as un,ew as pn,ex as hn,ey as mn,ez as gn,eA as bn,eB as fn,eC as vn,eD as yn,A as Sn,eE as Cn,t as wn,v as kn,eF as xn,eG as $n,eH as Tn,eI as An,eJ as Nn,eK as In,aO as En,a6 as Dn,bs as Rn,bo as On,br as Pn,bt as Mn,bj as Ln,w as zn,aR as Fn,aW as Vn,aE as Bn,eL as _n,c as Xn,b1 as jn,eM as Un,aN as Wn,b3 as Hn,O as Gn,b4 as Kn,b6 as qn,be as Yn,aL as Jn,b5 as Qn,b8 as Zn,bb as ei,bf as ti,bh as ai,bi as ni,aP as ii,a9 as oi,a8 as li,bv as si,eN as ri,bw as ci,eO as di,eP as ui,eQ as pi,eR as hi,eS as mi,eT as gi,eU as bi,eV as fi,eW as vi,r as yi,eX as Si,eY as Ci,eZ as wi,e_ as ki,e$ as xi,f0 as $i,f1 as Ti,f2 as Ai,f3 as Ni,f4 as Ii,f5 as Ei,f6 as Di,f7 as Ri,f8 as Oi,f9 as Pi,fa as Mi,fb as Li,fc as zi,fd as Fi,fe as Vi,ff as Bi,fg as _i,fh as Xi,fi as ji,fj as Ui,fk as Wi,fl as Hi,fm as Gi,fn as Ki,fo as qi,fp as Yi,fq as Ji,fr as Qi}from"../chunks/ui-components-B4It5sfa.js";import{TrashIcon as Zi,PlusIcon as eo,BookIcon as to,VSquareIcon as ao,XSquareIcon as no,DeleteIcon as io,EditIcon as oo,GoLogo as lo,JavaLogo as so,ChevronRightIcon as ro,ActionIcon as co,DestinationIcon as uo,ChevronUpIcon as po,ChevronDownIcon as ho,VIcon as mo,XIcon as go,InstrumentationRuleIcon as bo,SourceIcon as fo,NamespacesIcon as vo,SettingsIcon as yo,SamplingIcon as So,ExclamationTriangleIcon as Co,ExclamationCircleIcon as wo,KeyIcon as ko,DiagnoseIcon as xo,DownloadIcon as $o,TerminalIcon as To,StarIcon as Ao,ArrowIcon as No,QuestionCircleIcon as Io,RefreshIcon as Eo,ConnectionsIcon as Do,OdigosLogo as Ro,ArrowRightIcon as Oo,FilterIcon as Po,RefreshLeftArrowIcon as Mo,DataStreamIcon as Lo,PipelineCollectorIcon as zo,PodIcon as Fo,ArrowDownSquareIcon as Vo,ArrowUpSquareIcon as Bo,GatewayIcon as _o,YamlIcon as Xo}from"../icons.js";import{S as jo,D as Uo,A as Wo,P as Ho,a as Go,b as Ko,R as qo,c as Yo,O as Jo,d as Qo,e as Zo,f as el,W as tl,g as al,C as nl,h as il,i as ol,U as ll}from"../chunks/index-D6lL097V.js";import{S as sl}from"../chunks/index-pkD-mO1h.js";import{Y as rl}from"../chunks/index-BmuiyBxZ.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const cl=[{id:"CREDIT_CARD",label:"Credit card"}],dl=[{id:b.CollectContainerAttributes,label:"Collect container attributes"},{id:b.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:b.CollectWorkloadId,label:"Collect workload ID"},{id:b.CollectClusterId,label:"Collect cluster ID"}],ul=[{id:$.Pod,label:$.Pod},{id:$.Namespace,label:$.Namespace},{id:$.Node,label:$.Node}],pl=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:ul}],hl=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:ul}],ml=[{label:"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."},{label:"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."},{label:"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.",inputType:w.Number},{label:"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.",inputType:w.Number}],gl=b.UrlTemplatizationRulesGroups,bl=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],fl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans)."},{label:"Sampling ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",inputType:w.Number},{label:"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.",inputType:w.Number}],vl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans)."},{label:"Attribute key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span."},{label:"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.",inputType:w.Number},{label:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",componentType:P.Dropdown,options:[{id:"stringCondition",label:"String condition"},{id:"numberCondition",label:"Number condition"},{id:"booleanCondition",label:"Boolean condition"},{id:"jsonCondition",label:"JSON condition"}]},{label:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",componentType:P.Dropdown,options:[{id:"exists",label:"Exists"},{id:"equals",label:"Equals"},{id:"not_equals",label:"Not equals"},{id:"contains",label:"Contains"},{id:"not_contains",label:"Not contains"},{id:"regex",label:"Regex"},{id:"greater_than",label:"Greater than"},{id:"less_than",label:"Less than"},{id:"greater_than_or_equal",label:"Greater than or equal"},{id:"less_than_or_equal",label:"Less than or equal"},{id:"is_valid_json",label:"Is valid JSON"},{id:"is_invalid_json",label:"Is invalid JSON"},{id:"jsonpath_exists",label:"JSON path exists"},{id:"key_equals",label:"Key equals"},{id:"key_not_equals",label:"Key not equals"}]},{label:"Expected value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against."},{label:"JSON path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",renderCondition:e=>"jsonCondition"===e.condition}],yl={[M.K8sAttributes]:({value:i,setValue:o,formErrors:l})=>(n(()=>{i[b.CollectContainerAttributes]||i[b.CollectReplicaSetAttributes]||i[b.CollectWorkloadId]||i[b.CollectClusterId]||i[b.LabelsAttributes]?.length||i[b.AnnotationsAttributes]?.length||(o(b.CollectContainerAttributes,!0),o(b.CollectReplicaSetAttributes,!0),o(b.CollectWorkloadId,!0),o(b.CollectClusterId,!0),o(b.LabelsAttributes,[]),o(b.AnnotationsAttributes,[]))},[]),e(a,{children:[t(f,{$gap:6,children:dl.map(({id:a,label:n})=>e(f,{children:[t(y,{label:n,value:i[a]||!1,onChange:e=>o(a,e)}),t(S,{errorMessage:l[a]})]},a))}),t(x,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:pl,values:i[b.LabelsAttributes]||[],setValues:e=>o(b.LabelsAttributes,e),errorMessage:l[b.LabelsAttributes]}),t(x,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:hl,values:i[b.AnnotationsAttributes]||[],setValues:e=>o(b.AnnotationsAttributes,e),errorMessage:l[b.AnnotationsAttributes]})]})),[M.AddClusterInfo]:({value:n,setValue:i,formErrors:o})=>{const l=h();return e(a,{children:[t(T,{label:"Overwrite existing values",labelAlign:A.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[b.OverwriteExistingValues]||!1,onChange:e=>i(b.OverwriteExistingValues,e)}),t(x,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value"}],values:n[b.ClusterAttributes]||[],setValues:e=>i(b.ClusterAttributes,e),errorMessage:o[b.ClusterAttributes]})]})},[M.DeleteAttributes]:({value:e,setValue:a,formErrors:n})=>t(N,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[b.AttributeNamesToDelete]||[],setValues:e=>a(b.AttributeNamesToDelete,e),errorMessage:n[b.AttributeNamesToDelete]}),[M.RenameAttributes]:({value:e,setValue:a,formErrors:n})=>t(x,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key"},{keyName:"newKey",label:"New key"}],values:Object.entries(e[b.Renames]||{}).map(([e,t])=>({oldKey:e,newKey:t})),setValues:e=>{const t={};e.forEach(e=>t[e.oldKey]=e.newKey),a(b.Renames,t)},errorMessage:n[b.Renames]}),[M.PiiMasking]:({value:a,setValue:i,formErrors:o})=>(n(()=>{a[b.PiiCategories]?.length||i(b.PiiCategories,cl.map(({id:e})=>e))},[]),e(f,{$gap:12,children:[t(v,{label:"Attributes to mask"}),t(f,{$gap:6,children:cl.map(({id:e,label:n})=>t(y,{label:n,value:a[b.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=a[b.PiiCategories]||[],o=t?[...n,e]:n.filter(t=>t!==e);i(b.PiiCategories,o)}},e))}),t(S,{errorMessage:o[b.PiiCategories]})]})),[M.ErrorSampler]:({value:e,setValue:a,formErrors:n})=>{const i=n[b.FallbackSamplingRatio],o=k(e[b.FallbackSamplingRatio])?"":String(e[b.FallbackSamplingRatio]);return t(C,{name:"fallbackSamplingRatio",label:"Fallback sampling ratio",type:w.Number,min:0,max:100,value:o,placeholder:"0-100",onChange:e=>{return t=e.target.value,a(b.FallbackSamplingRatio,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:i})},[M.ProbabilisticSampler]:({value:e,setValue:a,formErrors:n})=>{const i=n[b.SamplingPercentage],o=k(e[b.SamplingPercentage])?"":String(e[b.SamplingPercentage]);return t(C,{name:"samplingPercentage",label:"Sampling percentage",type:w.Number,min:0,max:100,value:o,placeholder:"0-100",onChange:e=>{return t=e.target.value,a(b.SamplingPercentage,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:i})},[M.LatencySampler]:({value:e,setValue:a,formErrors:n})=>{const i=n[b.EndpointsFilters],o=e[b.EndpointsFilters]||[];return t(x,{name:"endpointsFilters",limitFieldsPerRow:2,columns:ml,values:o,setValues:e=>{a(b.EndpointsFilters,e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:a,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(a),fallbackSamplingRatio:Number(n)})))},errorMessage:i})},[M.ServiceNameSampler]:({value:e,setValue:a,formErrors:n})=>{const i=n[b.ServicesNameFilters],o=e[b.ServicesNameFilters]||[];return t(x,{name:"servicesNameFilters",limitFieldsPerRow:2,columns:fl,values:o,setValues:e=>{a(b.ServicesNameFilters,e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:a})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(a)})))},errorMessage:i})},[M.SpanAttributeSampler]:({value:e,setValue:a,formErrors:n})=>{const i=n[b.AttributeFilters],o=(e[b.AttributeFilters]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:n})=>{const i=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:i,operation:n[i]?.operation,expectedValue:n[i]?.expectedValue,jsonPath:n[i]?.jsonPath}});return t(x,{name:"attributeFilters",limitFieldsPerRow:2,columns:vl,values:o,setValues:e=>{a(b.AttributeFilters,e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:n,operation:i,expectedValue:o,jsonPath:l})=>{const s={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(a),condition:{[n]:{operation:i,expectedValue:o}}};return l&&(s.condition[n].jsonPath=l),s}))},errorMessage:i})},[M.URLTemplatization]:({value:n,setValue:o,formErrors:l})=>{const s=h(),r=n[gl]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o(gl,e),d=(e,t)=>c(r.map((a,n)=>n===e?{...a,...t}:a));return e(a,{children:[r.map((a,n)=>e(i,{children:[t(I,{}),e(f,{$gap:12,children:[e(E,{$justifyContent:"space-between",$alignItems:"center",children:[t(v,{label:`Rule Group ${n+1}`}),t(D,{leftIcon:()=>t(Zi,{fill:s.v2.colors.red[500]}),variant:O.Secondary,size:R.S,onClick:()=>{return e=n,c(r.filter((t,a)=>a!==e));var e},disabled:1===r.length})]}),t(C,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:a.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(x,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:bl,values:a.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(N,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:a.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(S,{errorMessage:l[gl]})]},`url-templatization-group-${n}`)),t(D,{variant:O.Secondary,label:"Add rule group",leftIcon:eo,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(I,{})]})}},Sl=({actionType:e,value:a,setValue:n,formErrors:i})=>{if(!e)return null;const o=yl[e];return o?t(o,{value:a,setValue:n,formErrors:i}):null},Cl=()=>{const a=h(),{selectedOption:n,genericForm:i}=L();if(!i||!n)return t(z,{title:"No active form"});const{formData:o,handleFormChange:l,formErrors:s}=i;return e(f,{$gap:24,children:[e(E,{$gap:12,$justifyContent:"space-between",children:[t(F,{size:V.XXS,children:n.docsDescription}),t(D,{label:"Docs",leftIcon:to,variant:O.Text,size:R.S,onClick:()=>window.open(`${B}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]}),t(_,{options:[{icon:ao,label:"Enabled",value:!1,selectedBgColor:a.v2.colors.green[800]},{icon:no,label:"Disabled",value:!0,selectedBgColor:a.v2.colors.red[800]}],selected:o.disabled,setSelected:e=>l("disabled",e)}),t(jo,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:o.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(C,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:o.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(Sl,{actionType:n.type,value:o.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s}),t(X,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:o.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},wl=({signals:e,fields:a,disabled:n,formData:i,handleFormChange:o,formErrors:l})=>a?.map(({renderCondition:a,componentType:s,type:r,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!a||j(a,e,i.fields)))return null;const b=c,f=i.fields.find(e=>e.key===b),v=f?f.value:h;return t(Uo,{componentType:s,inputType:r,name:b,label:d,tooltip:u,disabled:n,required:m,placeholder:p,errorMessage:l[b],dropdownOptions:g,value:v||"",setValue:e=>o(b,e)},b)}),kl=p(E)`
|
|
2
2
|
position: sticky;
|
|
3
3
|
bottom: 4px;
|
|
4
4
|
align-self: center;
|
|
@@ -19,7 +19,7 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
|
|
|
19
19
|
opacity: ${({$faded:e})=>e?.4:1};
|
|
20
20
|
transition: opacity 0.2s ease;
|
|
21
21
|
}
|
|
22
|
-
`,Fl=({value:e})=>{const a=h();return t(se,e?{status:H.Success,label:we,leftIcon:ao}:{label:ke,leftIcon:no,backgroundColor:a.v2.colors.silver[500],textColor:a.v2.colors.white[500]})},Vl=({value:e,onChange:a})=>{const n=h(),i=r(()=>[{icon:ao,label:we,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:no,label:ke,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(_,{size:xe.S,options:i,selected:e,setSelected:a??(()=>{}),disabled:!a})},Bl=()=>{const e=me();switch(e.formType){case ge.Create:return t(_l,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Vl,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case ge.View:return e.data?e.isEditing?t(_l,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Vl,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Xl,{data:e.data,renderAction:()=>t(Fl,{value:!e.data?.rule.disabled})}):null;case ge.EditAutoNoisy:return t(jl,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Ce,sectionTitle:ye,sectionSubTitle:ve,presetLabel:fe,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Vl,{value:e.localEnabled,onChange:e.setLocalEnabled})});case ge.EditAutoCostReduction:return t(jl,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Se,sectionTitle:ye,sectionSubTitle:ve,presetLabel:fe,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Vl,{value:e.localEnabled,onChange:e.setLocalEnabled})});case ge.EditAutoHighlyRelevant:return t(Ll,{children:t(Wo,{title:e.localEnabled?void 0:be,summary:e.summary,renderAction:()=>t(Vl,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},_l=({category:a,formData:n,onChange:i,sourceOptions:o,namespaceOptions:l,renderAction:s})=>e(Ll,{children:[t(Ko,{category:a,formState:n,renderAction:s}),e(zl,{$faded:!!n.disabled,children:[t(qo,{category:a,formState:n,onChange:i}),t(Yo,{formState:n,onChange:i,sourceOptions:o,namespaceOptions:l}),t(Jo,{category:a,formState:n,onChange:i}),"highlyRelevant"===a&&t(Qo,{formState:n,onChange:i}),"highlyRelevant"===a&&t(Zo,{ruleType:n.ruleType,formState:n,onChange:i}),t(el,{category:a,formState:n,onChange:i})]})]}),Xl=({data:a,renderAction:n})=>e(Ll,{children:[t(Ko,{readOnly:!0,summary:a.summary,renderAction:n}),t(qo,{readOnly:!0,data:a}),t(Yo,{readOnly:!0,scopes:a.rule.sourceScopes??
|
|
22
|
+
`,Fl=({value:e})=>{const a=h();return t(se,e?{status:H.Success,label:we,leftIcon:ao}:{label:ke,leftIcon:no,backgroundColor:a.v2.colors.silver[500],textColor:a.v2.colors.white[500]})},Vl=({value:e,onChange:a})=>{const n=h(),i=r(()=>[{icon:ao,label:we,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:no,label:ke,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(_,{size:xe.S,options:i,selected:e,setSelected:a??(()=>{}),disabled:!a})},Bl=()=>{const e=me();switch(e.formType){case ge.Create:return t(_l,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Vl,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case ge.View:return e.data?e.isEditing?t(_l,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Vl,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Xl,{data:e.data,renderAction:()=>t(Fl,{value:!e.data?.rule.disabled})}):null;case ge.EditAutoNoisy:return t(jl,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Ce,sectionTitle:ye,sectionSubTitle:ve,presetLabel:fe,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Vl,{value:e.localEnabled,onChange:e.setLocalEnabled})});case ge.EditAutoCostReduction:return t(jl,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Se,sectionTitle:ye,sectionSubTitle:ve,presetLabel:fe,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Vl,{value:e.localEnabled,onChange:e.setLocalEnabled})});case ge.EditAutoHighlyRelevant:return t(Ll,{children:t(Wo,{title:e.localEnabled?void 0:be,summary:e.summary,renderAction:()=>t(Vl,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},_l=({category:a,formData:n,onChange:i,sourceOptions:o,namespaceOptions:l,renderAction:s})=>e(Ll,{children:[t(Ko,{category:a,formState:n,renderAction:s}),e(zl,{$faded:!!n.disabled,children:[t(qo,{category:a,formState:n,onChange:i}),t(Yo,{formState:n,onChange:i,sourceOptions:o,namespaceOptions:l}),t(Jo,{category:a,formState:n,onChange:i}),"highlyRelevant"===a&&t(Qo,{formState:n,onChange:i}),"highlyRelevant"===a&&t(Zo,{ruleType:n.ruleType,formState:n,onChange:i}),t(el,{category:a,formState:n,onChange:i})]})]}),Xl=({data:a,renderAction:n})=>e(Ll,{children:[t(Ko,{readOnly:!0,summary:a.summary,renderAction:n}),t(qo,{readOnly:!0,data:a}),t(Yo,{readOnly:!0,scopes:a.rule.sourceScopes??null}),t(Jo,{readOnly:!0,data:a}),t(el,{readOnly:!0,data:a}),"highlyRelevant"===a.category&&t(Zo,{readOnly:!0,rule:a.rule})]}),jl=({enabled:a,summary:n,inactiveTitle:i,sectionTitle:o,sectionSubTitle:l,presetLabel:s,customInputName:r,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:b,renderAction:v})=>{const y=c(e=>p(e),[p]),S=c(e=>m(e),[m]),C=c(e=>b(e.target.value),[b]),w=!d||"sample"===u;return e(Ll,{children:[t(Wo,{title:a?void 0:i,summary:n,renderAction:v}),t(zl,{$faded:!a,children:e($e,{richTitle:{title:o,subTitle:l},children:[d&&t(f,{$alignItems:"flex-start",children:t(_,{size:xe.S,options:Ml,selected:u,setSelected:y})}),w&&t(Ho,{description:s,options:Go,selected:h,onSelect:S,customName:r,customLabel:Te,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},Ul=p.div`
|
|
23
23
|
display: flex;
|
|
24
24
|
align-items: center;
|
|
25
25
|
justify-content: space-between;
|
|
@@ -264,7 +264,7 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
|
|
|
264
264
|
white-space: pre-line;
|
|
265
265
|
`,Dr=p.div`
|
|
266
266
|
width: fit-content;
|
|
267
|
-
`,Rr=["50","25","10","1","0.1"],Or=({value:a,onChange:n,label:i})=>{const o=h(),l=r(()=>Rr.map(e=>({value:e,label:`${e}%`,selectedBgColor:o.v2.colors.purple[900],selectedBorderColor:o.v2.colors.purple[400]})),[o]);return e(f,{$gap:8,children:[t(F,{size:V.XS,color:o.v2.colors.white[500],children:i}),t(Dr,{children:t(_,{"data-id":"sampling-onboarding-ambient",size:xe.L,options:l,selected:a,setSelected:n})})]})},Pr=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:o,onAmbientPercentageChange:l,onBack:s,onNext:c,submitting:d})=>{const u=h(),p=r(()=>en(n?{disabled:!1}:null),[n]);return e(a,{children:[t(Qs,{title:rn,onBack:s}),e(Ks,{$width:854,children:[t(cr,{children:cn}),e(f,{$gap:8,$width:"100%",children:[e(er,{children:[t(Er,{children:t(F,{size:V.XXS,color:u.v2.colors.silver[200],children:dn})}),t(nr,{items:[un,pn,hn,mn,gn]}),t(or,{message:Za})]}),e(lr,{children:[e(sr,{children:[t(F,{size:V.S,weight:500,color:u.v2.colors.white[500],children:bn}),t(Io,{size:16,fill:u.v2.colors.silver[200]})]}),t(rr,{children:t(Us,{name:sn,recommended:!0,toggleLabel:ln,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(rr,{children:t(Or,{value:o,onChange:l,label:fn})})]})]})]}),t(Ys,{onNext:c,nextLoading:d})]})},Mr=({isOpen:e,onClose:a,k8sHealthProbesConfig:i,samplingId:o,docsUrl:s,updateK8sHealthProbesConfig:r,createHighlyRelevantOperationRule:d,createCostReductionRule:u})=>{const[p,h]=l("welcome"),[m,g]=l(!0),[b,f]=l("keep-list"),[v,y]=l(!0),[S,C]=l("25"),[w,k]=l(!1);n(()=>{e&&(h("welcome"),g(i?.enabled??!0),f("keep-list"),y(!0),C("25"),k(!1))},[e,i?.enabled]);const x=c(async()=>{const e=o??"default",t=[];m!==(i?.enabled??!1)&&t.push(r(m,i?.keepPercentage??0)),"advanced"!==b&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:[],operation:null,percentageAtLeast:null})),"keep-list"===b&&t.push(u(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:[],operation:null,percentageAtMost:parseFloat(S)})),k(!0);try{await Promise.all(t),h("success")}catch{}finally{k(!1)}},[o,r,m,i?.enabled,i?.keepPercentage,b,v,S,d,u]);let $=null;switch(p){case"welcome":$=t(br,{onSkip:a,onNext:()=>h("noisy")});break;case"noisy":$=t(ur,{enabled:m,onEnabledChange:g,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":$=t(Tr,{strategy:b,onStrategyChange:f,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===b?"keep-list":"drop-list"===b?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":$=t(Pr,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:S,onAmbientPercentageChange:C,onBack:()=>h("strategy"),onNext:x,submitting:w});break;case"drop-list":$=t(Ir,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:x,submitting:w});break;case"advanced":$=t(Ar,{onBack:()=>h("strategy"),onNext:x,submitting:w});break;case"success":$=t(hr,{onClose:a})}return t(vn,{isOpen:e,onClose:a,children:$})};var Lr,zr;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Lr||(Lr={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(zr||(zr={}));const Fr=[{key:zr.Name,label:"Name"},{key:zr.Type,label:"Type",textAlign:"right"},{key:zr.Status,label:"Status"},{key:zr.OdigosVersion,label:"Odigos Version"},{key:zr.ConnectedSince,label:"Connected Since"},{key:zr.LastActivity,label:"Last Activity"}],Vr=(e,t)=>{const a=e.find(e=>e.key===zr.Id)?.rawValue;return t(a?.toString()||"")},Br=e=>{const{connections:t,configMinSupportedVersion:a,snapshotMinSupportedVersion:n,onDelete:i,onAddSource:o,onAddDestination:l,onAddAction:s,onAddInstrumentationRule:r,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===zr.Status)?.rawValue===H.Success)(e))return[{id:Ut(),label:"Delete Connection",rightIcon:io,onClick:()=>Vr(e,i)}];const d=Vr(e,e=>{const n=t.find(t=>t.id===e);return!!n&&yn(n.odigosVersion,a)}),u=Vr(e,e=>{const a=t.find(t=>t.id===e);return!!a&&yn(a.odigosVersion,n)}),p=[];return o&&p.push({id:Ut(),tooltip:u?pe.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:fo,disabled:!u,onClick:()=>Vr(e,o)}),l&&p.push({id:Ut(),tooltip:pe.ADD_DESTINATION,rightIcon:uo,onClick:()=>Vr(e,l)}),s&&p.push({id:Ut(),tooltip:pe.ADD_ACTION,rightIcon:co,onClick:()=>Vr(e,s)}),r&&p.push({id:Ut(),tooltip:pe.ADD_INSTRUMENTATION_RULE,rightIcon:bo,onClick:()=>Vr(e,r)}),c&&p.push({id:Ut(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${a} or later.`,rightIcon:yo,disabled:!d,onClick:()=>Vr(e,c)}),p}},_r=({tableRowsMaxHeight:a,connections:i,getConnections:o,onClickConnection:s,deleteConnection:d,configMinSupportedVersion:u=0,getEffectiveConfig:p,applyConfigurations:m,snapshotMinSupportedVersion:g=0,getAllClusterSnapshots:b,persistSources:f,getDestinationCategories:v,getPotentialDestinations:y,testConnection:S,createDestination:C,updateDestination:w,createAction:k,createInstrumentationRule:x})=>{const $=h(),{isVm:T}=Xe(),{formatTimeAgo:A}=Vt(),[N,I]=l(!1),[E,D]=l(i||[]),P=c(async()=>{try{I(!0),D(await o()??[])}catch(e){}finally{I(!1)}},[]);n(()=>{E.length||P()},[]);const[M,L]=l(""),[z,F]=l(null),[V,B]=l([]),_=r(()=>z===Lr.BulkConfig?u:z===Lr.BulkSource?g:0,[z,u,g]),{supportedConnections:X,supportedConnectionIds:j}=r(()=>{const e=((e,t)=>e.filter(e=>{const a=e.status===H.Success,n=yn(e.odigosVersion,t);return a&&n}))(E,_);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[E.length,_]);n(()=>{if(!z||z===Lr.Delete)return;const e=V.filter(e=>!j.includes(e));e.length&&B(t=>t.filter(t=>!e.includes(t)))},[z,V.length,j.length]);const U=r(()=>E.filter(e=>!M||e.name.toLowerCase().includes(M.toLowerCase())).map(e=>({cells:[{key:zr.Id,rawValue:e.id},{key:zr.Name,rawValue:e.name},{key:zr.Type,rawValue:e.type},{key:zr.Status,rawValue:e.status,component:()=>(e=>{const a=e===H.Success?"Connection live":"Connection lost",n=e===H.Success?mo:go;return t(se,{status:e,label:a,leftIcon:n})})(e.status)},{key:zr.OdigosVersion,rawValue:e.odigosVersion},{key:zr.ConnectedSince,rawValue:e.connectedAt?A(e.connectedAt):"-"},{key:zr.LastActivity,rawValue:e.lastSeenAt?A(e.lastSeenAt):"-"}],onClick:e.status!==H.Success||z?void 0:()=>s(e),isSelected:V.includes(e.id),onSelect:()=>B(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>B(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==H.Success||z===Lr.BulkConfig&&!yn(e.odigosVersion,u)||z===Lr.BulkSource&&!yn(e.odigosVersion,g)})),[E,V,M,z,u,g]),W=r(()=>{const e=(e,t)=>{B([e]),F(t)};return Br({connections:E,configMinSupportedVersion:u,snapshotMinSupportedVersion:g,onDelete:t=>e(t,Lr.Delete),onAddSource:!T&&b&&f?t=>e(t,Lr.BulkSource):void 0,onAddDestination:!T&&v&&y&&C?t=>e(t,Lr.BulkDestination):void 0,onAddAction:!T&&k?t=>e(t,Lr.BulkAction):void 0,onAddInstrumentationRule:!T&&x?t=>e(t,Lr.BulkInstrumentationRule):void 0,onEditConfiguration:!T&&p&&m?t=>e(t,Lr.BulkConfig):void 0})},[T,E,u,p,m,g,b,f,v,y,C,k,x]),G=r(()=>(e=>{const{onCancel:t,onAddSource:a,onAddDestination:n,onAddAction:i,onAddInstrumentationRule:o,onManageConfigurations:l}=e,s=[];a&&s.push({id:Ut(),type:Sn.Button,buttonProps:{variant:O.Primary,size:R.S,label:"Add Sources",rightIcon:fo,onClick:a}});const r=[n?{id:Lr.BulkDestination,label:pe.ADD_DESTINATION,icon:uo}:null,i?{id:Lr.BulkAction,label:pe.ADD_ACTION,icon:co}:null,o?{id:Lr.BulkInstrumentationRule,label:pe.ADD_INSTRUMENTATION_RULE,icon:bo}:null,l?{id:Lr.BulkConfig,label:"Manage Configurations",icon:yo}:null];return r.some(Boolean)&&s.push({id:Ut(),type:Sn.ButtonDropData,buttonProps:{variant:O.Secondary,size:R.S,label:"Bulk Operations",onClick:e=>{e===Lr.BulkSource?a?.():e===Lr.BulkDestination?n?.():e===Lr.BulkAction?i?.():e===Lr.BulkInstrumentationRule?o?.():e===Lr.BulkConfig&&l?.()}},dropDataProps:{alignX:jt.Left,items:r}}),s.push({id:Ut(),type:Sn.Button,buttonProps:{variant:O.Text,size:R.S,label:ot.CANCEL,onClick:t}}),s})({onCancel:()=>B([]),onAddSource:!T&&b&&f?()=>F(Lr.BulkSource):void 0,onAddDestination:!T&&v&&y&&C?()=>F(Lr.BulkDestination):void 0,onAddAction:!T&&k?()=>F(Lr.BulkAction):void 0,onAddInstrumentationRule:!T&&x?()=>F(Lr.BulkInstrumentationRule):void 0,onManageConfigurations:!T&&p&&m?()=>F(Lr.BulkConfig):void 0}),[T,p,m,b,f,v,y,C,k,x]);return t(Cn,{children:e($e,{richTitle:{icon:Do,title:pe.CONNECTIONS,badge:{label:E.length.toString(),status:We.Unknown}},search:{placeholder:"Search by cluster name",value:M,onChange:e=>L(e),width:"300px"},actions:[{id:Ut(),type:Sn.Button,buttonProps:{variant:O.Secondary,size:R.S,leftIcon:Eo,onClick:P,disabled:N}}],children:[t(wn,{variant:kn.Pretty,maxHeight:a,headerBackgroundColor:$.v2.colors.silver[1e3],isLoading:N,withCheckboxes:!0,columns:Fr,rows:U,rowActionsPushRightPosition:z?`calc(${il} - 24px)`:void 0,getRowActions:W}),z===Lr.BulkConfig&&p&&m&&t(gs,{onClose:()=>F(null),connections:X,selectedConnectionIds:V,setSelectedConnectionIds:B,getEffectiveConfig:p,onApply:m}),z===Lr.BulkSource&&b&&f&&t(xn,{selectedConnectionIds:V,children:t(hs,{onClose:()=>F(null),selectedConnectionIds:V,setSelectedConnectionIds:B,getAllClusterSnapshots:b,persistSources:async e=>await(f?.(e))})}),z===Lr.BulkDestination&&v&&y&&S&&C&&w&&t($n,{children:t(is,{onClose:()=>F(null),selectedConnectionIds:V,setSelectedConnectionIds:B,getDestinationCategories:v,getPotentialDestinations:y,testConnection:e=>S(e,V),createDestination:e=>C(e,V),updateDestination:(e,t)=>w(e,t,V)})}),z===Lr.BulkAction&&k&&t(Tn,{children:t(Kl,{onClose:()=>F(null),selectedConnectionIds:V,setSelectedConnectionIds:B,createAction:e=>k(e,V)})}),z===Lr.BulkInstrumentationRule&&x&&t(An,{children:t(os,{onClose:()=>F(null),selectedConnectionIds:V,setSelectedConnectionIds:B,createInstrumentationRule:e=>x(e,V)})}),t(al,{target:"connection",isOpen:z===Lr.Delete,onClose:()=>{B([]),F(null)},onApprove:async()=>{const e=V[0];e&&(await d(e),await P())}}),t(Nn,{isOpen:!!V.length&&!z,richTitle:{icon:ao,title:"Selected Clusters",badge:{label:V.length}},actions:G})]})})},Xr=p.div`
|
|
267
|
+
`,Rr=["50","25","10","1","0.1"],Or=({value:a,onChange:n,label:i})=>{const o=h(),l=r(()=>Rr.map(e=>({value:e,label:`${e}%`,selectedBgColor:o.v2.colors.purple[900],selectedBorderColor:o.v2.colors.purple[400]})),[o]);return e(f,{$gap:8,children:[t(F,{size:V.XS,color:o.v2.colors.white[500],children:i}),t(Dr,{children:t(_,{"data-id":"sampling-onboarding-ambient",size:xe.L,options:l,selected:a,setSelected:n})})]})},Pr=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:o,onAmbientPercentageChange:l,onBack:s,onNext:c,submitting:d})=>{const u=h(),p=r(()=>en(n?{disabled:!1}:null),[n]);return e(a,{children:[t(Qs,{title:rn,onBack:s}),e(Ks,{$width:854,children:[t(cr,{children:cn}),e(f,{$gap:8,$width:"100%",children:[e(er,{children:[t(Er,{children:t(F,{size:V.XXS,color:u.v2.colors.silver[200],children:dn})}),t(nr,{items:[un,pn,hn,mn,gn]}),t(or,{message:Za})]}),e(lr,{children:[e(sr,{children:[t(F,{size:V.S,weight:500,color:u.v2.colors.white[500],children:bn}),t(Io,{size:16,fill:u.v2.colors.silver[200]})]}),t(rr,{children:t(Us,{name:sn,recommended:!0,toggleLabel:ln,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(rr,{children:t(Or,{value:o,onChange:l,label:fn})})]})]})]}),t(Ys,{onNext:c,nextLoading:d})]})},Mr=({isOpen:e,onClose:a,k8sHealthProbesConfig:i,samplingId:o,docsUrl:s,updateK8sHealthProbesConfig:r,createHighlyRelevantOperationRule:d,createCostReductionRule:u})=>{const[p,h]=l("welcome"),[m,g]=l(!0),[b,f]=l("keep-list"),[v,y]=l(!0),[S,C]=l("25"),[w,k]=l(!1);n(()=>{e&&(h("welcome"),g(i?.enabled??!0),f("keep-list"),y(!0),C("25"),k(!1))},[e,i?.enabled]);const x=c(async()=>{const e=o??"default",t=[];m!==(i?.enabled??!1)&&t.push(r(m,i?.keepPercentage??0)),"advanced"!==b&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null})),"keep-list"===b&&t.push(u(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(S)})),k(!0);try{await Promise.all(t),h("success")}catch{}finally{k(!1)}},[o,r,m,i?.enabled,i?.keepPercentage,b,v,S,d,u]);let $=null;switch(p){case"welcome":$=t(br,{onSkip:a,onNext:()=>h("noisy")});break;case"noisy":$=t(ur,{enabled:m,onEnabledChange:g,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":$=t(Tr,{strategy:b,onStrategyChange:f,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===b?"keep-list":"drop-list"===b?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":$=t(Pr,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:S,onAmbientPercentageChange:C,onBack:()=>h("strategy"),onNext:x,submitting:w});break;case"drop-list":$=t(Ir,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:x,submitting:w});break;case"advanced":$=t(Ar,{onBack:()=>h("strategy"),onNext:x,submitting:w});break;case"success":$=t(hr,{onClose:a})}return t(vn,{isOpen:e,onClose:a,children:$})};var Lr,zr;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Lr||(Lr={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(zr||(zr={}));const Fr=[{key:zr.Name,label:"Name"},{key:zr.Type,label:"Type",textAlign:"right"},{key:zr.Status,label:"Status"},{key:zr.OdigosVersion,label:"Odigos Version"},{key:zr.ConnectedSince,label:"Connected Since"},{key:zr.LastActivity,label:"Last Activity"}],Vr=(e,t)=>{const a=e.find(e=>e.key===zr.Id)?.rawValue;return t(a?.toString()||"")},Br=e=>{const{connections:t,configMinSupportedVersion:a,snapshotMinSupportedVersion:n,onDelete:i,onAddSource:o,onAddDestination:l,onAddAction:s,onAddInstrumentationRule:r,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===zr.Status)?.rawValue===H.Success)(e))return[{id:Ut(),label:"Delete Connection",rightIcon:io,onClick:()=>Vr(e,i)}];const d=Vr(e,e=>{const n=t.find(t=>t.id===e);return!!n&&yn(n.odigosVersion,a)}),u=Vr(e,e=>{const a=t.find(t=>t.id===e);return!!a&&yn(a.odigosVersion,n)}),p=[];return o&&p.push({id:Ut(),tooltip:u?pe.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:fo,disabled:!u,onClick:()=>Vr(e,o)}),l&&p.push({id:Ut(),tooltip:pe.ADD_DESTINATION,rightIcon:uo,onClick:()=>Vr(e,l)}),s&&p.push({id:Ut(),tooltip:pe.ADD_ACTION,rightIcon:co,onClick:()=>Vr(e,s)}),r&&p.push({id:Ut(),tooltip:pe.ADD_INSTRUMENTATION_RULE,rightIcon:bo,onClick:()=>Vr(e,r)}),c&&p.push({id:Ut(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${a} or later.`,rightIcon:yo,disabled:!d,onClick:()=>Vr(e,c)}),p}},_r=({tableRowsMaxHeight:a,connections:i,getConnections:o,onClickConnection:s,deleteConnection:d,configMinSupportedVersion:u=0,getEffectiveConfig:p,applyConfigurations:m,snapshotMinSupportedVersion:g=0,getAllClusterSnapshots:b,persistSources:f,getDestinationCategories:v,getPotentialDestinations:y,testConnection:S,createDestination:C,updateDestination:w,createAction:k,createInstrumentationRule:x})=>{const $=h(),{isVm:T}=Xe(),{formatTimeAgo:A}=Vt(),[N,I]=l(!1),[E,D]=l(i||[]),P=c(async()=>{try{I(!0),D(await o()??[])}catch(e){}finally{I(!1)}},[]);n(()=>{E.length||P()},[]);const[M,L]=l(""),[z,F]=l(null),[V,B]=l([]),_=r(()=>z===Lr.BulkConfig?u:z===Lr.BulkSource?g:0,[z,u,g]),{supportedConnections:X,supportedConnectionIds:j}=r(()=>{const e=((e,t)=>e.filter(e=>{const a=e.status===H.Success,n=yn(e.odigosVersion,t);return a&&n}))(E,_);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[E.length,_]);n(()=>{if(!z||z===Lr.Delete)return;const e=V.filter(e=>!j.includes(e));e.length&&B(t=>t.filter(t=>!e.includes(t)))},[z,V.length,j.length]);const U=r(()=>E.filter(e=>!M||e.name.toLowerCase().includes(M.toLowerCase())).map(e=>({cells:[{key:zr.Id,rawValue:e.id},{key:zr.Name,rawValue:e.name},{key:zr.Type,rawValue:e.type},{key:zr.Status,rawValue:e.status,component:()=>(e=>{const a=e===H.Success?"Connection live":"Connection lost",n=e===H.Success?mo:go;return t(se,{status:e,label:a,leftIcon:n})})(e.status)},{key:zr.OdigosVersion,rawValue:e.odigosVersion},{key:zr.ConnectedSince,rawValue:e.connectedAt?A(e.connectedAt):"-"},{key:zr.LastActivity,rawValue:e.lastSeenAt?A(e.lastSeenAt):"-"}],onClick:e.status!==H.Success||z?void 0:()=>s(e),isSelected:V.includes(e.id),onSelect:()=>B(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>B(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==H.Success||z===Lr.BulkConfig&&!yn(e.odigosVersion,u)||z===Lr.BulkSource&&!yn(e.odigosVersion,g)})),[E,V,M,z,u,g]),W=r(()=>{const e=(e,t)=>{B([e]),F(t)};return Br({connections:E,configMinSupportedVersion:u,snapshotMinSupportedVersion:g,onDelete:t=>e(t,Lr.Delete),onAddSource:!T&&b&&f?t=>e(t,Lr.BulkSource):void 0,onAddDestination:!T&&v&&y&&C?t=>e(t,Lr.BulkDestination):void 0,onAddAction:!T&&k?t=>e(t,Lr.BulkAction):void 0,onAddInstrumentationRule:!T&&x?t=>e(t,Lr.BulkInstrumentationRule):void 0,onEditConfiguration:!T&&p&&m?t=>e(t,Lr.BulkConfig):void 0})},[T,E,u,p,m,g,b,f,v,y,C,k,x]),G=r(()=>(e=>{const{onCancel:t,onAddSource:a,onAddDestination:n,onAddAction:i,onAddInstrumentationRule:o,onManageConfigurations:l}=e,s=[];a&&s.push({id:Ut(),type:Sn.Button,buttonProps:{variant:O.Primary,size:R.S,label:"Add Sources",rightIcon:fo,onClick:a}});const r=[n?{id:Lr.BulkDestination,label:pe.ADD_DESTINATION,icon:uo}:null,i?{id:Lr.BulkAction,label:pe.ADD_ACTION,icon:co}:null,o?{id:Lr.BulkInstrumentationRule,label:pe.ADD_INSTRUMENTATION_RULE,icon:bo}:null,l?{id:Lr.BulkConfig,label:"Manage Configurations",icon:yo}:null];return r.some(Boolean)&&s.push({id:Ut(),type:Sn.ButtonDropData,buttonProps:{variant:O.Secondary,size:R.S,label:"Bulk Operations",onClick:e=>{e===Lr.BulkSource?a?.():e===Lr.BulkDestination?n?.():e===Lr.BulkAction?i?.():e===Lr.BulkInstrumentationRule?o?.():e===Lr.BulkConfig&&l?.()}},dropDataProps:{alignX:jt.Left,items:r}}),s.push({id:Ut(),type:Sn.Button,buttonProps:{variant:O.Text,size:R.S,label:ot.CANCEL,onClick:t}}),s})({onCancel:()=>B([]),onAddSource:!T&&b&&f?()=>F(Lr.BulkSource):void 0,onAddDestination:!T&&v&&y&&C?()=>F(Lr.BulkDestination):void 0,onAddAction:!T&&k?()=>F(Lr.BulkAction):void 0,onAddInstrumentationRule:!T&&x?()=>F(Lr.BulkInstrumentationRule):void 0,onManageConfigurations:!T&&p&&m?()=>F(Lr.BulkConfig):void 0}),[T,p,m,b,f,v,y,C,k,x]);return t(Cn,{children:e($e,{richTitle:{icon:Do,title:pe.CONNECTIONS,badge:{label:E.length.toString(),status:We.Unknown}},search:{placeholder:"Search by cluster name",value:M,onChange:e=>L(e),width:"300px"},actions:[{id:Ut(),type:Sn.Button,buttonProps:{variant:O.Secondary,size:R.S,leftIcon:Eo,onClick:P,disabled:N}}],children:[t(wn,{variant:kn.Pretty,maxHeight:a,headerBackgroundColor:$.v2.colors.silver[1e3],isLoading:N,withCheckboxes:!0,columns:Fr,rows:U,rowActionsPushRightPosition:z?`calc(${il} - 24px)`:void 0,getRowActions:W}),z===Lr.BulkConfig&&p&&m&&t(gs,{onClose:()=>F(null),connections:X,selectedConnectionIds:V,setSelectedConnectionIds:B,getEffectiveConfig:p,onApply:m}),z===Lr.BulkSource&&b&&f&&t(xn,{selectedConnectionIds:V,children:t(hs,{onClose:()=>F(null),selectedConnectionIds:V,setSelectedConnectionIds:B,getAllClusterSnapshots:b,persistSources:async e=>await(f?.(e))})}),z===Lr.BulkDestination&&v&&y&&S&&C&&w&&t($n,{children:t(is,{onClose:()=>F(null),selectedConnectionIds:V,setSelectedConnectionIds:B,getDestinationCategories:v,getPotentialDestinations:y,testConnection:e=>S(e,V),createDestination:e=>C(e,V),updateDestination:(e,t)=>w(e,t,V)})}),z===Lr.BulkAction&&k&&t(Tn,{children:t(Kl,{onClose:()=>F(null),selectedConnectionIds:V,setSelectedConnectionIds:B,createAction:e=>k(e,V)})}),z===Lr.BulkInstrumentationRule&&x&&t(An,{children:t(os,{onClose:()=>F(null),selectedConnectionIds:V,setSelectedConnectionIds:B,createInstrumentationRule:e=>x(e,V)})}),t(al,{target:"connection",isOpen:z===Lr.Delete,onClose:()=>{B([]),F(null)},onApprove:async()=>{const e=V[0];e&&(await d(e),await P())}}),t(Nn,{isOpen:!!V.length&&!z,richTitle:{icon:ao,title:"Selected Clusters",badge:{label:V.length}},actions:G})]})})},Xr=p.div`
|
|
268
268
|
display: flex;
|
|
269
269
|
align-items: center;
|
|
270
270
|
justify-content: space-between;
|
|
@@ -643,7 +643,7 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
|
|
|
643
643
|
gap: 6px;
|
|
644
644
|
align-items: center;
|
|
645
645
|
min-height: 22px;
|
|
646
|
-
`;const Fd=[{key:"content",label:"Content",noSort:!0,noFilter:!0},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Vd=[{value:"all",label:Ci},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Bd=({title:a,items:n,isLoading:i,showTypeFilter:o,tableRowsMaxHeight:s,onRuleClick:d,onCreateRule:u,onEditRule:p,onDeleteRule:m})=>{const g=h(),[b,f]=l(""),[v,y]=l("all"),S=r(()=>{let e=function(e,t,a){return a&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,v,o);return e=function(e,t){if(!t.trim())return e;const a=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(a),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(a)})}(e,b),e},[n,v,o,b]),C=r(()=>S.map(a=>{const n=a.typeBadge?function(e,t){const a=e.v2.colors;switch(t){case"Relevance":return{bg:a.blue[700],text:a.white[500]};case"Duration":return{bg:a.purple[700],text:a.white[500]};case"Error":return{bg:a.red[500],text:a.black[500]}}}(g,a.typeBadge):void 0;return{cells:[{key:"content",rawValue:a.summary.map(e=>e.text).join(""),component:()=>e(Ld,{$disabled:a.disabled,children:[t(Md,{children:t(Ht,{parts:a.summary})}),a.name&&t(F,{size:V.XXS,color:J.Secondary,nowrap:!0,children:a.name})]})},{key:"badges",rawValue:a.typeBadge||"",component:()=>e(zd,{children:[a.disabled&&t(se,{label:Si,textSize:V.XXXS,backgroundColor:g.v2.colors.grey[700],textColor:g.v2.colors.grey[300]}),a.typeBadge&&n&&t(se,{label:a.typeBadge,textSize:V.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>d(a)}}),[S,g,d]),w=r(()=>{const e=e=>t(io,{...e,fill:g.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[g]),k=c(e=>{const t=C.indexOf(e);if(t<0)return[];const a=S[t];return a?[{id:"edit","data-id":"sampling-rule-action-edit",label:Ct,leftIcon:oo,onClick:()=>p(a.ruleId,a.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:w,onClick:()=>m(a.ruleId,a.samplingId)}]:[]},[C,S,p,m,w]);return t($e,{fullHeight:!0,richTitle:{icon:So,title:a,badge:{label:n.length,backgroundColor:g.v2.colors.silver[600],textColor:g.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:b,onChange:f,placeholder:"Search..",width:"500px",...o?{segment:{"data-id":"sampling-segment-type-filter",options:Vd,selected:v,setSelected:y}}:{}},children:t(wn,{variant:kn.Pretty,hideHeader:!0,maxHeight:s,isLoading:i,noDataProps:b.trim()?{hideIcon:!0,title:wi,subTitle:$i(b)}:{hideIcon:!0,title:xi,button:{label:ki,onClick:u}},columns:Fd,rows:C,getRowActions:k})})},_d=({workloads:a,samplingRules:i,k8sHealthProbesConfig:o,loading:s,docsUrl:u,tableRowsMaxHeight:p,fetchSamplingRules:h,createNoisyOperationRule:m,updateNoisyOperationRule:g,createHighlyRelevantOperationRule:b,updateHighlyRelevantOperationRule:v,createCostReductionRule:y,updateCostReductionRule:S,deleteSamplingRule:C,updateK8sHealthProbesConfig:w})=>{const k=r(()=>a.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[a]),x=r(()=>Array.from(new Set(a.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[a]),[$,T]=l(Ti.Noisy),[A,N]=l(null),[I,P]=l(!1),[M,L]=l(!1),[z,F]=l(null),[V,B]=l(!1),[X,j]=l(!1),[U,G]=l(!1),[K,q]=l(!1);n(()=>{q(!i.length)},[i]);const Y=r(()=>Kt(o),[o]),J=r(()=>Ai(i),[i]),Q=r(()=>en(J?.rule??null),[J]),Z=r(()=>Ni(i),[i]),ee=r(()=>Ii(Z?.rule??null),[Z]),te=d(A);te.current=A,n(()=>{const e=te.current;if(!e)return;const t=Ei(i,e);t?N(t):(N(null),P(!1))},[i]);const ae=r(()=>{const e=new Set;return J&&e.add(J.rule.ruleId),Z&&e.add(Z.rule.ruleId),e},[J,Z]),ne=r(()=>Di(i,$,ae),[i,$,ae]),ie=c(()=>L(!0),[]),oe=c(()=>L(!1),[]),le=c(()=>q(!1),[]),se=c(async e=>{const t=i[0]?.id??"default";switch(zi[$]){case"noisy":await m(t,Pi(e));break;case"highlyRelevant":await b(t,Oi(e));break;case"costReduction":await y(t,Ri(e))}L(!1)},[i,$,m,b,y]),re=c(e=>{const t=Mi(i,e);t&&(P(!1),N(t))},[i]),ce=c(()=>{N(null),P(!1)},[]),de=c((e,t)=>{const a=A;if(a&&a.rule.ruleId===e&&a.samplingId===t)P(!0),N({...a});else for(const a of i){if(a.id!==t)continue;const n=[...a.noisyOperations.map(e=>({category:"noisy",rule:e})),...a.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...a.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return P(!0),void N({category:n.category,rule:n.rule,samplingId:t,summary:Li(n.category,n.rule)})}},[A,i]),pe=c(async(e,t,a)=>{const n=A?.category;if(n){switch(n){case"noisy":await g(a,t,Pi(e));break;case"highlyRelevant":await v(a,t,Oi(e));break;case"costReduction":await S(a,t,Ri(e))}P(!1)}},[A,g,v,S]),he=c((e,t)=>{F({ruleId:e,samplingId:t})},[]),me=c(async()=>{if(!z)return;const{ruleId:e,samplingId:t}=z,a=A?.category||zi[$];await C(t,e,a),N(null),P(!1),F(null)},[z,A,$,C]),fe=c(()=>F(null),[]),ve=c(async(e,t)=>{await w(e,t),B(!1)},[w]),ye=c(async e=>{const t=i[0]?.id??"default",a=J;a?await v(a.samplingId,a.rule.ruleId,{name:a.rule.name,disabled:!e,error:!0,sourceScopes:
|
|
646
|
+
`;const Fd=[{key:"content",label:"Content",noSort:!0,noFilter:!0},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Vd=[{value:"all",label:Ci},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Bd=({title:a,items:n,isLoading:i,showTypeFilter:o,tableRowsMaxHeight:s,onRuleClick:d,onCreateRule:u,onEditRule:p,onDeleteRule:m})=>{const g=h(),[b,f]=l(""),[v,y]=l("all"),S=r(()=>{let e=function(e,t,a){return a&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,v,o);return e=function(e,t){if(!t.trim())return e;const a=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(a),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(a)})}(e,b),e},[n,v,o,b]),C=r(()=>S.map(a=>{const n=a.typeBadge?function(e,t){const a=e.v2.colors;switch(t){case"Relevance":return{bg:a.blue[700],text:a.white[500]};case"Duration":return{bg:a.purple[700],text:a.white[500]};case"Error":return{bg:a.red[500],text:a.black[500]}}}(g,a.typeBadge):void 0;return{cells:[{key:"content",rawValue:a.summary.map(e=>e.text).join(""),component:()=>e(Ld,{$disabled:a.disabled,children:[t(Md,{children:t(Ht,{parts:a.summary})}),a.name&&t(F,{size:V.XXS,color:J.Secondary,nowrap:!0,children:a.name})]})},{key:"badges",rawValue:a.typeBadge||"",component:()=>e(zd,{children:[a.disabled&&t(se,{label:Si,textSize:V.XXXS,backgroundColor:g.v2.colors.grey[700],textColor:g.v2.colors.grey[300]}),a.typeBadge&&n&&t(se,{label:a.typeBadge,textSize:V.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>d(a)}}),[S,g,d]),w=r(()=>{const e=e=>t(io,{...e,fill:g.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[g]),k=c(e=>{const t=C.indexOf(e);if(t<0)return[];const a=S[t];return a?[{id:"edit","data-id":"sampling-rule-action-edit",label:Ct,leftIcon:oo,onClick:()=>p(a.ruleId,a.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:w,onClick:()=>m(a.ruleId,a.samplingId)}]:[]},[C,S,p,m,w]);return t($e,{fullHeight:!0,richTitle:{icon:So,title:a,badge:{label:n.length,backgroundColor:g.v2.colors.silver[600],textColor:g.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:b,onChange:f,placeholder:"Search..",width:"500px",...o?{segment:{"data-id":"sampling-segment-type-filter",options:Vd,selected:v,setSelected:y}}:{}},children:t(wn,{variant:kn.Pretty,hideHeader:!0,maxHeight:s,isLoading:i,noDataProps:b.trim()?{hideIcon:!0,title:wi,subTitle:$i(b)}:{hideIcon:!0,title:xi,button:{label:ki,onClick:u}},columns:Fd,rows:C,getRowActions:k})})},_d=({workloads:a,samplingRules:i,k8sHealthProbesConfig:o,loading:s,docsUrl:u,tableRowsMaxHeight:p,fetchSamplingRules:h,createNoisyOperationRule:m,updateNoisyOperationRule:g,createHighlyRelevantOperationRule:b,updateHighlyRelevantOperationRule:v,createCostReductionRule:y,updateCostReductionRule:S,deleteSamplingRule:C,updateK8sHealthProbesConfig:w})=>{const k=r(()=>a.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[a]),x=r(()=>Array.from(new Set(a.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[a]),[$,T]=l(Ti.Noisy),[A,N]=l(null),[I,P]=l(!1),[M,L]=l(!1),[z,F]=l(null),[V,B]=l(!1),[X,j]=l(!1),[U,G]=l(!1),[K,q]=l(!1);n(()=>{q(!i.length)},[i]);const Y=r(()=>Kt(o),[o]),J=r(()=>Ai(i),[i]),Q=r(()=>en(J?.rule??null),[J]),Z=r(()=>Ni(i),[i]),ee=r(()=>Ii(Z?.rule??null),[Z]),te=d(A);te.current=A,n(()=>{const e=te.current;if(!e)return;const t=Ei(i,e);t?N(t):(N(null),P(!1))},[i]);const ae=r(()=>{const e=new Set;return J&&e.add(J.rule.ruleId),Z&&e.add(Z.rule.ruleId),e},[J,Z]),ne=r(()=>Di(i,$,ae),[i,$,ae]),ie=c(()=>L(!0),[]),oe=c(()=>L(!1),[]),le=c(()=>q(!1),[]),se=c(async e=>{const t=i[0]?.id??"default";switch(zi[$]){case"noisy":await m(t,Pi(e));break;case"highlyRelevant":await b(t,Oi(e));break;case"costReduction":await y(t,Ri(e))}L(!1)},[i,$,m,b,y]),re=c(e=>{const t=Mi(i,e);t&&(P(!1),N(t))},[i]),ce=c(()=>{N(null),P(!1)},[]),de=c((e,t)=>{const a=A;if(a&&a.rule.ruleId===e&&a.samplingId===t)P(!0),N({...a});else for(const a of i){if(a.id!==t)continue;const n=[...a.noisyOperations.map(e=>({category:"noisy",rule:e})),...a.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...a.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return P(!0),void N({category:n.category,rule:n.rule,samplingId:t,summary:Li(n.category,n.rule)})}},[A,i]),pe=c(async(e,t,a)=>{const n=A?.category;if(n){switch(n){case"noisy":await g(a,t,Pi(e));break;case"highlyRelevant":await v(a,t,Oi(e));break;case"costReduction":await S(a,t,Ri(e))}P(!1)}},[A,g,v,S]),he=c((e,t)=>{F({ruleId:e,samplingId:t})},[]),me=c(async()=>{if(!z)return;const{ruleId:e,samplingId:t}=z,a=A?.category||zi[$];await C(t,e,a),N(null),P(!1),F(null)},[z,A,$,C]),fe=c(()=>F(null),[]),ve=c(async(e,t)=>{await w(e,t),B(!1)},[w]),ye=c(async e=>{const t=i[0]?.id??"default",a=J;a?await v(a.samplingId,a.rule.ruleId,{name:a.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:a.rule.notes}):e&&await b(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),j(!1)},[i,J,b,v]),we=c(async(e,t)=>{const a=i[0]?.id??"default",n=Z;n?await S(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await y(a,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),G(!1)},[i,Z,y,S]),ke=c(e=>{const t=zi[$];let a=null;switch(t){case"noisy":{const n=Pi(e);a=Fi(i,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=Oi(e);a=Fi(i,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=Ri(e);a=Fi(i,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return a?{message:Vi,ruleId:a}:null},[i,$]),xe=c(e=>{const t=A?.category,a=A?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const o=Pi(e);n=Fi(i,t,{sourceScopes:o.sourceScopes,operation:o.operation},a);break}case"highlyRelevant":{const o=Oi(e);n=Fi(i,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs},a);break}case"costReduction":{const o=Ri(e);n=Fi(i,t,{sourceScopes:o.sourceScopes,operation:o.operation},a);break}}return n?{message:Vi,ruleId:n}:null},[i,A]),$e=c(e=>{L(!1);for(const t of i){const a=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(a)return P(!0),void N({category:a.category,rule:a.rule,samplingId:t.id,summary:Li(a.category,a.rule)})}},[i]),Te=r(()=>{const e=[];return u&&e.push({id:Ut(),type:Sn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Bi,leftIcon:to,size:R.S,variant:O.Text,onClick:()=>window.open(u,"_blank")}}),e.push({id:Ut(),type:Sn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:_i,leftIcon:Eo,size:R.S,variant:O.Text,onClick:h,loading:s}}),e.push({id:Ut(),type:Sn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Xi,rightIcon:eo,size:R.S,variant:O.Primary,onClick:ie}}),e},[u,h,s,ie]);return e(Cn,{children:[e(E,{$gap:12,$justifyContent:"space-between",children:[t(di,{icon:So,title:Ui,subTitle:ji}),t(ui,{actions:Te})]}),e(f,{$gap:12,children:[t(_,{variant:yi.Underline,options:Wi,selected:$,setSelected:T}),e(E,{$justifyContent:"space-between",children:[t(W,{status:H.Default,message:Hi[$]}),u&&t(D,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:to,size:R.S,variant:O.Text,onClick:()=>window.open(u,"_blank")})]}),$===Ti.Noisy?t(Wo,{title:Ce,summary:Y,onEdit:()=>B(!0)}):$===Ti.HighlyRelevant?t(Wo,{title:be,summary:Q,onEdit:()=>j(!0)}):$===Ti.CostReduction?t(Wo,{title:Se,summary:ee,onEdit:()=>G(!0)}):null,t(Bd,{title:Gi[$],items:ne,isLoading:s,showTypeFilter:$===Ti.HighlyRelevant,tableRowsMaxHeight:p,onRuleClick:re,onCreateRule:ie,onEditRule:de,onDeleteRule:he})]}),t(Es,{formType:ge.View,data:A,defaultEditMode:I,onClose:ce,onDelete:he,onSaveEdit:pe,sourceOptions:k,namespaceOptions:x,validateForm:xe,onNavigateToDuplicate:$e}),t(Es,{formType:ge.Create,isOpen:M,category:zi[$],onClose:oe,onSubmit:se,sourceOptions:k,namespaceOptions:x,validateForm:ke,onNavigateToDuplicate:$e}),t(Es,{formType:ge.EditAutoNoisy,isOpen:V,enabled:o?.enabled??!1,keepPercentage:o?.keepPercentage??0,onClose:()=>B(!1),onSave:ve}),t(Es,{formType:ge.EditAutoHighlyRelevant,isOpen:X,enabled:!!J&&!J.rule.disabled,onClose:()=>j(!1),onSave:ye}),t(Es,{formType:ge.EditAutoCostReduction,isOpen:U,enabled:!!Z&&!Z.rule.disabled,dropPercentage:Z?.rule.percentageAtMost??25,onClose:()=>G(!1),onSave:we}),t(ue,{title:Ji,description:Yi,isOpen:!!z,onClose:fe,denyButton:{label:qi,variant:O.Secondary,onClick:fe},approveButton:{label:Ki,variant:O.Primary,onClick:()=>{me(),fe()}}}),t(Mr,{isOpen:K,onClose:le,k8sHealthProbesConfig:o,samplingId:i[0]?.id,docsUrl:u,updateK8sHealthProbesConfig:w,createHighlyRelevantOperationRule:b,createCostReductionRule:y})]})},Xd=p.div`
|
|
647
647
|
display: flex;
|
|
648
648
|
align-items: center;
|
|
649
649
|
justify-content: space-between;
|
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState as i,useEffect as o,Fragment as r,useRef as s,useMemo as l,useCallback as c,forwardRef as d,useImperativeHandle as u}from"react";import p,{css as m,useTheme as h}from"styled-components";import{z as g,G as y,ae as f,af as v,ag as b,ah as x,ai as C,aj as E,I as T,ak as N,al as k,am as w,an as $,ao as D,ap as A,W as I,y as R,F as O,aq as M,ar as F,as as L,at as _,au as P,av as K,aw as j,ax as V,ay as z,T as U,a3 as q,c as W,az as H,aA as B,aB as G,aa as J,Z as Y,aC as X,E as Q,aD as Z,a4 as ee,aE as te,aF as ne,d as ie,aG as ae,aH as oe,a0 as re,R as se,aI as le,aJ as ce,aK as de,aL as ue,J as pe,O as me,aM as he,q as ge,aN as ye,aO as fe,aP as ve,aQ as be,aR as Se,aS as xe,aT as Ce,aU as Ee,aV as Te,aW as Ne,aX as ke,aY as we,b as $e,Q as De,aZ as Ae,a_ as Ie,a$ as Re,M as Oe,b0 as Me,b1 as Fe,b2 as Le,b3 as _e,b4 as Pe,b5 as Ke,b6 as je,b7 as Ve,b8 as ze,b9 as Ue,ba as qe,bb as We,bc as He,bd as Be,be as Ge,a5 as Je,bf as Ye,a6 as Xe,bg as Qe,bh as Ze,bi as et,bj as tt,bk as nt,bl as it,bm as at,bn as ot,bo as rt,H as st,bp as lt,bq as ct,br as dt,bs as ut,bt as pt,bu as mt,bv as ht,bw as gt,e as yt,bx as ft,h as vt,by as bt,bz as St,bA as xt,bB as Ct,bC as Et,bD as Tt,bE as Nt,bF as kt,bG as wt,bH as $t,bI as Dt,$ as At,bJ as It,bK as Rt,bL as Ot,bM as Mt,bN as Ft,bO as Lt,bP as _t,bQ as Pt,bR as Kt,bS as jt,bT as Vt,bU as zt,bV as Ut,bW as qt,bX as Wt,bY as Ht,bZ as Bt,b_ as Gt,ac as Jt,b$ as Yt,a9 as Xt,a8 as Qt,c0 as Zt,c1 as en,c2 as tn,c3 as nn,c4 as an,c5 as on,c6 as rn,c7 as sn,c8 as ln,c9 as cn,ca as dn,cb as un,cc as pn,cd as mn,u as hn,ce as gn,cf as yn,cg as fn,X as vn,a1 as bn,a2 as Sn,f as xn,ch as Cn,ci as En,cj as Tn,ck as Nn,cl as kn}from"./chunks/ui-components-
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState as i,useEffect as o,Fragment as r,useRef as s,useMemo as l,useCallback as c,forwardRef as d,useImperativeHandle as u}from"react";import p,{css as m,useTheme as h}from"styled-components";import{z as g,G as y,ae as f,af as v,ag as b,ah as x,ai as C,aj as E,I as T,ak as N,al as k,am as w,an as $,ao as D,ap as A,W as I,y as R,F as O,aq as M,ar as F,as as L,at as _,au as P,av as K,aw as j,ax as V,ay as z,T as U,a3 as q,c as W,az as H,aA as B,aB as G,aa as J,Z as Y,aC as X,E as Q,aD as Z,a4 as ee,aE as te,aF as ne,d as ie,aG as ae,aH as oe,a0 as re,R as se,aI as le,aJ as ce,aK as de,aL as ue,J as pe,O as me,aM as he,q as ge,aN as ye,aO as fe,aP as ve,aQ as be,aR as Se,aS as xe,aT as Ce,aU as Ee,aV as Te,aW as Ne,aX as ke,aY as we,b as $e,Q as De,aZ as Ae,a_ as Ie,a$ as Re,M as Oe,b0 as Me,b1 as Fe,b2 as Le,b3 as _e,b4 as Pe,b5 as Ke,b6 as je,b7 as Ve,b8 as ze,b9 as Ue,ba as qe,bb as We,bc as He,bd as Be,be as Ge,a5 as Je,bf as Ye,a6 as Xe,bg as Qe,bh as Ze,bi as et,bj as tt,bk as nt,bl as it,bm as at,bn as ot,bo as rt,H as st,bp as lt,bq as ct,br as dt,bs as ut,bt as pt,bu as mt,bv as ht,bw as gt,e as yt,bx as ft,h as vt,by as bt,bz as St,bA as xt,bB as Ct,bC as Et,bD as Tt,bE as Nt,bF as kt,bG as wt,bH as $t,bI as Dt,$ as At,bJ as It,bK as Rt,bL as Ot,bM as Mt,bN as Ft,bO as Lt,bP as _t,bQ as Pt,bR as Kt,bS as jt,bT as Vt,bU as zt,bV as Ut,bW as qt,bX as Wt,bY as Ht,bZ as Bt,b_ as Gt,ac as Jt,b$ as Yt,a9 as Xt,a8 as Qt,c0 as Zt,c1 as en,c2 as tn,c3 as nn,c4 as an,c5 as on,c6 as rn,c7 as sn,c8 as ln,c9 as cn,ca as dn,cb as un,cc as pn,cd as mn,u as hn,ce as gn,cf as yn,cg as fn,X as vn,a1 as bn,a2 as Sn,f as xn,ch as Cn,ci as En,cj as Tn,ck as Nn,cl as kn}from"./chunks/ui-components-B4It5sfa.js";import{TrashIcon as wn,VSquareIcon as $n,XSquareIcon as Dn,OdigosLogoText as An,PlusIcon as In,RefreshIcon as Rn,SearchIcon as On,FilterIcon as Mn,DataStreamIcon as Fn,EditIcon as Ln,VIcon as _n,OdigosLogo as Pn,ArrowIcon as Kn,RefreshLeftArrowIcon as jn,NotificationIcon as Vn,UserIcon as zn,ImageErrorIcon as Un,ChevronDownIcon as qn,ChevronRightIcon as Wn,OverviewIcon as Hn,SourceIcon as Bn,DestinationIcon as Gn,InstrumentationRuleIcon as Jn,ActionIcon as Yn,SlackLogo as Xn,KeyIcon as Qn,TerminalIcon as Zn,ExclamationTriangleIcon as ei,TraceViewIcon as ti}from"./icons.js";import{O as ni}from"./chunks/index-pkD-mO1h.js";export{S as SourceDrawer,a as SourceForm}from"./chunks/index-pkD-mO1h.js";import{MarkerType as ii,useNodesState as ai,useEdgesState as oi}from"@xyflow/react";import{E as ri}from"./chunks/vendor-C150cdxb.js";import"zustand";import"javascript-time-ago";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";import"./chunks/index-BmuiyBxZ.js";const si=e=>{const{type:t,name:n,notes:i,signals:a,disabled:o,fields:{collectContainerAttributes:r,collectReplicaSetAttributes:s,collectWorkloadId:l,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:m,attributeNamesToDelete:h,renames:b,piiCategories:S,fallbackSamplingRatio:x,samplingPercentage:C,endpointsFilters:E,servicesNameFilters:T,attributeFilters:N,urlTemplatizationRulesGroups:k}}=e,w=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!o)},{type:y.Monitors,title:g.SIGNALS_FOR_PROCESSING,value:a?.join(", ")||""},{title:g.NAME,value:n||""},{title:g.NOTES,value:i||""},{type:y.Divider}];if(t===f.K8sAttributes&&(w.push({title:"Collect Container Attributes",value:String(r)}),w.push({title:"Collect ReplicaSet Attributes",value:String(s)}),w.push({title:"Collect Workload ID",value:String(l)}),w.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&w.push({type:y.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:n,fromSources:i},a)=>{let o="";o+=`Label Key: ${e}\n`,o+=`Attribute Key: ${t}\n`;o+=`From: ${i?.length?i.join(", "):n||v.Pod}\n`,w.push({title:"Label"+(d.length>1?` #${a+1}`:""),value:o})}),u?.length&&w.push({type:y.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:n,fromSources:i},a)=>{let o="";o+=`Annotation Key: ${e}\n`,o+=`Attribute Key: ${t}\n`;o+=`From: ${i?.length?i.join(", "):n||v.Pod}\n`,w.push({title:"Annotation"+(u.length>1?` #${a+1}`:""),value:o})})),t===f.AddClusterInfo){w.push({title:"Overwrite Existing Values",value:String(m||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:n},i)=>{e+=`${t}: ${n}`,i<p.length-1&&(e+=", ")}),w.push({title:"Attributes",value:e})}if(t===f.DeleteAttributes){let e="";h?.forEach((t,n)=>{e+=t,n<h.length-1&&(e+=", ")}),w.push({title:"Attributes",value:e})}if(t===f.RenameAttributes){let e="";const t=Object.entries(b||{});t.forEach(([n,i],a)=>{e+=`${n}: ${i}`,a<t.length-1&&(e+=", ")}),w.push({title:"Attributes",value:e})}if(t===f.PiiMasking){let e="";S?.forEach((t,n)=>{e+=t,n<S.length-1&&(e+=", ")}),w.push({title:"Categories",value:e})}return t===f.ErrorSampler&&w.push({title:"Sampling Ratio",value:String(x)}),t===f.ProbabilisticSampler&&w.push({title:"Sampling Percentage",value:String(C)}),t===f.LatencySampler&&E?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${n}\n`,o+=`Fallback Sampling Ratio: ${i}`,w.push({title:"Endpoint"+(E.length>1?` #${a+1}`:""),value:o})}),t===f.ServiceNameSampler&&T?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n},i)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Sampling Ratio: ${t}\n`,a+=`Fallback Sampling Ratio: ${n}`,w.push({title:"Filter"+(T.length>1?` #${i+1}`:""),value:a})}),t===f.SpanAttributeSampler&&N?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${n}\n`;const r=Object.keys(i)[0];o+=`Condition: ${r}\n`,o+=`Operation: ${i[r]?.operation}\n`,o+=`Expected Value: ${i[r]?.expectedValue}`,"jsonCondition"===r&&(o+=`\nJSON Path: ${i[r].jsonPath}`),w.push({title:"Filter"+(N.length>1?` #${a+1}`:""),value:o})}),t===f.URLTemplatization&&k?.forEach((e,t)=>{let n="";e.filterK8sNamespace&&(n+=`Namespace: ${e.filterK8sNamespace}\n`),e.workloadFilters?.length&&e.workloadFilters.forEach(e=>{const t=[e.kind,e.name].filter(Boolean).join("/");t&&(n+=`Workload: ${t}\n`)});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");n+=`Templates: ${i}`,e.notes&&(n+=`\nNotes: ${e.notes}`),w.push({title:"Group"+(k.length>1?` #${t+1}`:""),value:n})}),w},li=b.PiiCategories,ci=p.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
gap: 32px;
|
package/lib/contexts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{eH as ActionFormContextProvider,eN as DataStreamFormContextProvider,eG as DestinationFormContextProvider,
|
|
1
|
+
export{eH as ActionFormContextProvider,eN as DataStreamFormContextProvider,eG as DestinationFormContextProvider,hm as OdigosProvider,eI as RuleFormContextProvider,cC as SamplingRuleFormType,d4 as SamplingRulesFormProvider,eF as SourceInstrumentFormContextProvider,hn as StorybookProvider,eD as checkVersionSupport,cs as useActionFormContext,cz as useDataStreamFormContext,cv as useDestinationFormContext,a4 as useOdigos,cy as useRuleFormContext,cB as useSamplingRulesFormContext,cW as useSourceInstrumentFormContext,ho as useStorybook}from"./chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{bG as capitalizeFirstLetter,
|
|
1
|
+
export{bG as capitalizeFirstLetter,gM as cleanObjectEmptyStringsValues,bB as compareCondition,$ as deepClone,b5 as entityIdKey,aP as filterActions,bi as filterDestinations,bg as filterDestinationsByStream,bh as filterSources,a6 as filterSourcesByStream,gN as flattenObjectKeys,b8 as formatBytes,ci as formatDuration,g as generateId,aC as getActionIcon,aL as getConditionsBooleans,ad as getContainersIcons,cc as getContainersInstrumentedCount,gO as getDeepValue,ba as getDestinationIcon,gP as getDetectedLanguageIcons,aW as getEntityIcon,aA as getEntityId,b4 as getEntityIdKey,aR as getEntityLabel,gQ as getIdFromSseTarget,b9 as getInstrumentationRuleIcon,gR as getMainContainerLanguage,bN as getMetricForEntity,gS as getMonitorIcon,gT as getPlatformIcon,gU as getPlatformLabel,bW as getProgrammingLanguageIcon,ck as getRecursiveValues,bb as getSourceLanguageIcons,gV as getSseTargetFromId,gW as getStatusColor,eQ as getStatusFromPodStatus,aN as getStatusIcon,K as getStatusTypeFromOdigosHealth,gX as getValueForRange,c3 as getVirtualServiceIcon,a8 as getWorkloadId,bF as getYamlFieldsForDestination,U as hasUnhealthyInstances,al as isEmpty,gY as isLegalK8sLabel,cd as isOverTime,a1 as isStringABoolean,gZ as isTimeElapsed,g_ as isValidVersion,aM as mapConditions,bA as mapDestinationFieldsForDisplay,b7 as mapExportedSignals,bH as mapSupportedSignals,g$ as numbersOnly,a2 as parseBooleanFromString,h0 as parseJsonStringToPrettyString,cx as prepareDestinationFormData,h1 as removeEmptyValuesFromObject,bC as safeJsonParse,h2 as safeJsonStringify,h3 as setDeepValue,a$ as sleep,H as splitCamelString,h4 as stringifyNonStringValues,aF as trimVersion}from"./chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{hk as IGNORE_OUTSIDE_CLICK_ATTR,az as useActionFormData,hl as useBodyScroll,bj as useClickNode,c1 as useClickNotification,bf as useContainerSize,u as useCopy,bu as useDataStreamFormData,bE as useDestinationFormData,ce as useGenericForm,bY as useInstrumentationRuleFormData,d as useKeyDown,bo as useOnClickOutside,bk as usePopup,fr as useScrollTo,bt as useSessionStorage,a7 as useSourceFormData,ca as useSourceSelectionFormData,c0 as useTimeAgo}from"./chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type SourcesScopes, type SamplingRuleFormState } from '@/types';
|
|
3
3
|
import { type AutocompleteOption } from '@/components/_v2';
|
|
4
4
|
export type SourceScopeSectionProps = {
|
|
5
5
|
readOnly: true;
|
|
6
|
-
scopes:
|
|
6
|
+
scopes: SourcesScopes | null;
|
|
7
7
|
} | {
|
|
8
8
|
readOnly?: false;
|
|
9
9
|
formState: SamplingRuleFormState;
|
package/lib/snippets/v2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as ActionType,eP as Actions,dm as ColoredSpan,g6 as ColoredSpanVariant,eO as RichTitle}from"../chunks/ui-components-
|
|
1
|
+
export{A as ActionType,eP as Actions,dm as ColoredSpan,g6 as ColoredSpanVariant,eO as RichTitle}from"../chunks/ui-components-B4It5sfa.js";export{C as CancelModal,j as DURATION_OPTIONS,g as DeleteModal,e as DurationErrorsSection,D as DynamicField,N as NOISY_PERCENTAGE_OPTIONS,i as OdigosLogoTextByTier,O as OperationSection,a as PERCENTAGE_OPTIONS,f as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,d as RuleTypeSection,b as SamplingPreviewSection,S as SignalsCheckboxList,c as SourceScopeSection,U as UpgradeModal,h as WIDE_DRAWER_WIDTH,W as WideDrawer}from"../chunks/index-D6lL097V.js";export{Y as YamlSectionCard}from"../chunks/index-BmuiyBxZ.js";import"react/jsx-runtime";import"styled-components";import"../icons.js";import"zustand";import"react";import"javascript-time-ago";import"../chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|
package/lib/snippets.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ar as AddButton,V as CopyText,c8 as EditButton,c6 as Flow,
|
|
1
|
+
export{ar as AddButton,V as CopyText,c8 as EditButton,c6 as Flow,hp as MapItemNode,hq as NoDataNode,by as NoteBackToSummary,Y as PodContainer,ab as SourceContainer}from"./chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|
package/lib/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{bd as ProgressKeys,c5 as useActiveNodeStore,ch as useDarkMode,a5 as useDataStreamStore,c as useDrawerStore,a3 as useEntityStore,aO as useFilterStore,aE as useModalStore,bX as useNotificationStore,bc as useProgressStore,b1 as useSelectedStore,bv as useSetupStore}from"./chunks/ui-components-
|
|
1
|
+
export{bd as ProgressKeys,c5 as useActiveNodeStore,ch as useDarkMode,a5 as useDataStreamStore,c as useDrawerStore,a3 as useEntityStore,aO as useFilterStore,aE as useModalStore,bX as useNotificationStore,bc as useProgressStore,b1 as useSelectedStore,bv as useSetupStore}from"./chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|
package/lib/theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{hg as Provider,hh as animations,hi as opacity,hj as palettes}from"./chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|
package/lib/types/sampling.d.ts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import type { ColoredSpanPart } from '@/snippets/_v2';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import type { K8sResourceKind } from './enum';
|
|
3
|
+
export interface K8sWorkloadId {
|
|
4
|
+
namespace: string;
|
|
5
|
+
name: string;
|
|
6
|
+
kind: K8sResourceKind;
|
|
7
|
+
}
|
|
8
|
+
export type K8sSourceId = K8sWorkloadId;
|
|
9
|
+
export type SamplingWorkloadLanguage = string;
|
|
10
|
+
export interface SourcesScopes {
|
|
11
|
+
sources: K8sWorkloadId[];
|
|
12
|
+
namespaces: string[];
|
|
13
|
+
languages: SamplingWorkloadLanguage[];
|
|
14
|
+
}
|
|
15
|
+
export interface SourcesScopesInput {
|
|
16
|
+
sources: K8sSourceId[];
|
|
17
|
+
namespaces: string[];
|
|
18
|
+
languages: SamplingWorkloadLanguage[];
|
|
7
19
|
}
|
|
8
20
|
export interface HeadSamplingHttpServerMatcher {
|
|
9
21
|
route?: string | null;
|
|
@@ -37,7 +49,7 @@ export interface NoisyOperationRule {
|
|
|
37
49
|
ruleId: string;
|
|
38
50
|
name?: string | null;
|
|
39
51
|
disabled: boolean;
|
|
40
|
-
sourceScopes?:
|
|
52
|
+
sourceScopes?: SourcesScopes | null;
|
|
41
53
|
operation?: HeadSamplingOperationMatcher | null;
|
|
42
54
|
percentageAtMost?: number | null;
|
|
43
55
|
notes?: string | null;
|
|
@@ -46,7 +58,7 @@ export interface HighlyRelevantOperationRule {
|
|
|
46
58
|
ruleId: string;
|
|
47
59
|
name?: string | null;
|
|
48
60
|
disabled: boolean;
|
|
49
|
-
sourceScopes?:
|
|
61
|
+
sourceScopes?: SourcesScopes | null;
|
|
50
62
|
error: boolean;
|
|
51
63
|
durationAtLeastMs?: number | null;
|
|
52
64
|
operation?: TailSamplingOperationMatcher | null;
|
|
@@ -57,7 +69,7 @@ export interface CostReductionRule {
|
|
|
57
69
|
ruleId: string;
|
|
58
70
|
name?: string | null;
|
|
59
71
|
disabled: boolean;
|
|
60
|
-
sourceScopes?:
|
|
72
|
+
sourceScopes?: SourcesScopes | null;
|
|
61
73
|
operation?: TailSamplingOperationMatcher | null;
|
|
62
74
|
percentageAtMost: number;
|
|
63
75
|
notes?: string | null;
|
|
@@ -70,16 +82,10 @@ export interface SamplingRules {
|
|
|
70
82
|
costReductionRules: CostReductionRule[];
|
|
71
83
|
}
|
|
72
84
|
export type SamplingRule = NoisyOperationRule | HighlyRelevantOperationRule | CostReductionRule;
|
|
73
|
-
export interface SourcesScopeInput {
|
|
74
|
-
workloadName?: string | null;
|
|
75
|
-
workloadKind?: string | null;
|
|
76
|
-
workloadNamespace?: string | null;
|
|
77
|
-
workloadLanguage?: string | null;
|
|
78
|
-
}
|
|
79
85
|
export interface NoisyOperationRuleInput {
|
|
80
86
|
name?: string | null;
|
|
81
87
|
disabled?: boolean | null;
|
|
82
|
-
sourceScopes?:
|
|
88
|
+
sourceScopes?: SourcesScopesInput | null;
|
|
83
89
|
operation?: HeadSamplingOperationMatcher | null;
|
|
84
90
|
percentageAtMost?: number | null;
|
|
85
91
|
notes?: string | null;
|
|
@@ -87,7 +93,7 @@ export interface NoisyOperationRuleInput {
|
|
|
87
93
|
export interface HighlyRelevantOperationRuleInput {
|
|
88
94
|
name?: string | null;
|
|
89
95
|
disabled?: boolean | null;
|
|
90
|
-
sourceScopes?:
|
|
96
|
+
sourceScopes?: SourcesScopesInput | null;
|
|
91
97
|
error?: boolean | null;
|
|
92
98
|
durationAtLeastMs?: number | null;
|
|
93
99
|
operation?: TailSamplingOperationMatcher | null;
|
|
@@ -97,7 +103,7 @@ export interface HighlyRelevantOperationRuleInput {
|
|
|
97
103
|
export interface CostReductionRuleInput {
|
|
98
104
|
name?: string | null;
|
|
99
105
|
disabled?: boolean | null;
|
|
100
|
-
sourceScopes?:
|
|
106
|
+
sourceScopes?: SourcesScopesInput | null;
|
|
101
107
|
operation?: TailSamplingOperationMatcher | null;
|
|
102
108
|
percentageAtMost: number;
|
|
103
109
|
notes?: string | null;
|
|
@@ -141,25 +147,17 @@ export interface SamplingRulesK8sHealthConfig {
|
|
|
141
147
|
enabled: boolean | null;
|
|
142
148
|
keepPercentage: number | null;
|
|
143
149
|
}
|
|
144
|
-
export type ScopeType = 'all' | 'source' | 'namespace' | 'language';
|
|
145
150
|
export type OperationType = 'all' | 'httpServer' | 'httpClient' | 'kafkaConsumer' | 'kafkaProducer';
|
|
146
151
|
export type PercentageMode = 'all' | 'sample';
|
|
147
152
|
export type RouteType = 'route' | 'routePrefix';
|
|
148
153
|
export type DurationPreset = '5000' | '1000' | '500' | '100' | '50' | 'custom';
|
|
149
154
|
export type PercentagePreset = '50' | '25' | '10' | '1' | '0.5' | '0.1' | '0' | 'custom';
|
|
150
|
-
export interface SourceScopeEntry {
|
|
151
|
-
scopeType: ScopeType;
|
|
152
|
-
workloadName: string;
|
|
153
|
-
workloadKind: string;
|
|
154
|
-
workloadNamespace: string;
|
|
155
|
-
workloadLanguage: string;
|
|
156
|
-
}
|
|
157
155
|
export interface SamplingRuleFormState {
|
|
158
156
|
name: string;
|
|
159
157
|
notes: string;
|
|
160
158
|
disabled: boolean;
|
|
161
159
|
ruleType: HighlyRelevantBadgeType;
|
|
162
|
-
sourceScopes:
|
|
160
|
+
sourceScopes: SourcesScopes;
|
|
163
161
|
operationType: OperationType;
|
|
164
162
|
routeType: RouteType;
|
|
165
163
|
route: string;
|
package/lib/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{gp as ActionCategory,ag as ActionKeyTypes,ae as ActionType,gq as AddNodeTypes,gr as BooleanOperation,bS as CodeAttributesKeyTypes,aD as Crud,bQ as CustomInstrumentationsKeyTypes,b3 as DesiredStateProgress,gs as DestinationTypes,gt as EdgeTypes,E as EntityTypes,as as FieldTypes,bR as GolangCustomProbe,bO as HeadersCollectionKeyTypes,ak as InputTypes,gu as InstallationMethod,bU as InstrumentationRuleType,gv as IntrumentationStatus,bP as JavaCustomProbe,gw as JsonOperation,af as K8sAttributesFrom,a9 as K8sResourceKind,gx as ListDirection,c2 as NodeTypes,gy as NumberOperation,gz as OtelDistroName,bz as OtherEntityTypes,O as OtherStatus,cS as OtherStatusType,bT as PayloadCollectionKeyTypes,gA as PlatformType,gB as PodContainerLifecycleStatus,gC as PodContainerStatus,gD as PodPhase,gE as Profile,P as ProgrammingLanguages,gF as SIGNAL_KEY_TO_TYPE,bK as SIGNAL_TYPE_TO_KEY,gG as SignalKey,bD as SignalType,gH as SortDirection,R as StatusType,gI as StringOperation,b_ as Tier,eS as WorkloadRolloutStatus}from"./chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|
package/lib/visuals.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{gJ as VISUAL_ODIGOS_LOGO_HEIGHT,gK as VISUAL_ODIGOS_LOGO_WIDTH,go as VisualGreenRings,gL as VisualOdigosLogo,dx as VisualPurpleRings}from"./chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|