@odigos/ui-kit 0.0.249 → 0.0.250
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/helpers-TT5Y1hFq.js +19 -0
- package/lib/chunks/{index-CRKgHzab.js → index-Cgdz0gvj.js} +1 -1
- package/lib/chunks/{source-instrument-form-context-DjIHPYQJ.js → source-instrument-form-context-BGxM25wP.js} +1 -1
- package/lib/chunks/{ui-components-DODwSdKu.js → ui-components-B2A1-SuV.js} +73 -73
- package/lib/chunks/vendor-IfqYyoNb.js +1 -0
- package/lib/components/_v2/segment/index.d.ts +4 -2
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/strings/index.d.ts +7 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/_drawers/add-destination-drawer/lists-filters/index.d.ts +2 -1
- package/lib/containers/_v2/_drawers/edit-source-drawer/index.d.ts +2 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/sampling/index.d.ts +8 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/sampling/rule-row.d.ts +8 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/tabs.d.ts +1 -0
- package/lib/containers/_v2/overview/drawers/index.d.ts +2 -0
- package/lib/containers/_v2/sampling-rules/helpers.d.ts +2 -0
- package/lib/containers/v2.js +166 -135
- package/lib/containers.js +1 -1
- package/lib/contexts/odigos-context.d.ts +2 -2
- package/lib/contexts/storybook-context.d.ts +2 -2
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/icons/destinations/open-telemetry-logo/index.d.ts +2 -1
- package/lib/mock-data/sources/sampling.d.ts +7 -0
- package/lib/snippets/_v2/sampling-rule-form-sections/preset-with-custom-input.d.ts +1 -1
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store/useDrawerStore.d.ts +6 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/workload/index.d.ts +46 -15
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +22 -22
- package/lib/chunks/helpers-IEFhGXc7.js +0 -19
- package/lib/chunks/vendor-Be0cOokr.js +0 -1
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as n,useRef as i,useCallback as a,useEffect as o}from"react";import{MarkerType as s,useNodesState as c,useEdgesState as d}from"@xyflow/react";import{N as l,D as p,E as u,g,d as h,e as m,S as y,f,h as v,i as x,F as S,j as N,k as b,l as K,m as w,n as k}from"./chunks/ui-components-
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as n,useRef as i,useCallback as a,useEffect as o}from"react";import{MarkerType as s,useNodesState as c,useEdgesState as d}from"@xyflow/react";import{N as l,D as p,E as u,g,d as h,e as m,S as y,f,h as v,i as x,F as S,j as N,k as b,l as K,m as w,n as k}from"./chunks/ui-components-B2A1-SuV.js";import{UserIcon as T,ImageErrorIcon as M,ChevronDownIcon as $,ChevronRightIcon as C}from"./icons.js";import I,{useTheme as z}from"styled-components";import{E}from"./chunks/vendor-IfqYyoNb.js";import{Flow as G}from"./snippets.js";import"zustand";import"javascript-time-ago";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";const V=e=>`${u.Source}-${e}-${l.MapItem}`,D=(e,t,r)=>{const n=e.isVirtual,i=r?[T]:n?[g(e)]:t?h(t):[M],{priorotizedStatus:a}=n?{priorotizedStatus:void 0}:m(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:i,isVirtual:n,status:a,aggService:e}},R=e=>!(!e||"user"!==e.serviceName||e.id.namespace||e.id.name||e.id.kind),A=({theme:e,nodes:t,aggregatedServiceMap:r})=>{const n=[],i=new Map(t.map(e=>[e.id,e]));for(const t of r){const r=V(t.graphKey),a=i.get(r);if(!a)continue;const o=a.data?.status===y.Error;for(const a of t.connections){const c=V(a.targetGraphKey);i.has(c)&&n.push({id:`${r}-to-${c}`,type:"smoothstep",source:r,target:c,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:s.ArrowClosed},style:{stroke:o?e?.colors.dark_red:e?.colors.border}})}}return n},j=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},O=new E,_=`${u.Source}-user-${l.MapItem}`,q={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},B=I.div`
|
|
2
2
|
padding: 8px 0;
|
|
3
3
|
`,F=I.div`
|
|
4
4
|
display: flex;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type PropsWithChildren } from 'react';
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
2
|
import { PlatformType, Tier } from '@/types';
|
|
3
3
|
interface ContextProps extends PropsWithChildren {
|
|
4
4
|
platformType: PlatformType;
|
|
5
5
|
tier: Tier;
|
|
6
6
|
version: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const OdigosProvider: ({ children, platformType, tier, version }: ContextProps) =>
|
|
8
|
+
export declare const OdigosProvider: ({ children, platformType, tier, version }: ContextProps) => React.JSX.Element;
|
|
9
9
|
export declare const checkVersionSupport: (currentVersion: string, minSupportedVersion?: number) => boolean;
|
|
10
10
|
export declare const useOdigos: (minSupportedVersion?: number) => {
|
|
11
11
|
isVersionSupported: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type PropsWithChildren } from 'react';
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
2
|
interface ContextProps extends PropsWithChildren {
|
|
3
3
|
formType?: string;
|
|
4
4
|
}
|
|
5
5
|
type ContextValues = Omit<ContextProps, 'children'>;
|
|
6
|
-
export declare const StorybookProvider: ({ children, formType }: ContextProps) =>
|
|
6
|
+
export declare const StorybookProvider: ({ children, formType }: ContextProps) => React.JSX.Element;
|
|
7
7
|
export declare const useStorybook: () => ContextValues;
|
|
8
8
|
export {};
|
package/lib/contexts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as ActionFormContextProvider,D as DataStreamFormContextProvider,a as DestinationFormContextProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,b as SamplingRulesFormProvider,c as SourceEditFormContextProvider,d as SourceInstrumentFormContextProvider,u as useActionFormContext,e as useDataStreamFormContext,f as useDestinationFormContext,g as useRuleFormContext,h as useSamplingRulesFormContext,i as useSourceEditFormContext,j as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-
|
|
1
|
+
export{A as ActionFormContextProvider,D as DataStreamFormContextProvider,a as DestinationFormContextProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,b as SamplingRulesFormProvider,c as SourceEditFormContextProvider,d as SourceInstrumentFormContextProvider,u as useActionFormContext,e as useDataStreamFormContext,f as useDestinationFormContext,g as useRuleFormContext,h as useSamplingRulesFormContext,i as useSourceEditFormContext,j as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-BGxM25wP.js";export{O as OdigosProvider,c as checkVersionSupport,u as useOdigos}from"./chunks/helpers-TT5Y1hFq.js";import{jsx as r}from"react/jsx-runtime";import{useMemo as o,useContext as t,createContext as s}from"react";import"./chunks/ui-components-B2A1-SuV.js";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"./chunks/vendor-IfqYyoNb.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";const m=s({formType:void 0}),n=({children:e,formType:t})=>{const s=o(()=>({formType:t}),[t]);return r(m.Provider,{value:s,children:e})},p=()=>t(m);export{n as StorybookProvider,p as useStorybook};
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{fa as adaptInstrumentationRuleFromWire,fb as adaptInstrumentationRuleInputForWire,b1 as buildBadgeForDesiredStatus,fc as capitalizeFirstLetter,fd as cleanObjectEmptyStringsValues,ah as compareCondition,fe as decimalsOnly,p as deepClone,dh as entityIdKey,dl as filterActions,dk as filterDestinations,aW as filterDestinationsByStream,dj as filterSources,d6 as filterSourcesByStream,ff as flattenObjectKeys,bh as formatBytes,fg as formatDuration,bQ as generateId,aU as getActionIcon,e as getConditionsBooleans,bt as getContainersIcons,fh as getContainersInstrumentedCount,fi as getDeepValue,aH as getDestinationIcon,fj as getDetectedLanguageIcons,b6 as getEffectiveLanguage,bo as getEffectiveRuntimeVersion,dc as getEntityIcon,aP as getEntityId,dg as getEntityIdKey,db as getEntityLabel,fk as getHealthBadgeLabel,fl as getIdFromSseTarget,a_ as getInstrumentationRuleIcon,fm as getMainContainerLanguage,fn as getMetricForEntity,fo as getMonitorIcon,fp as getPlatformIcon,fq as getPlatformLabel,ao as getProgrammingLanguageIcon,fr as getRecursiveValues,d as getSourceLanguageIcons,fs as getSseTargetFromId,ft as getStatusColor,dr as getStatusFromPodStatus,df as getStatusIcon,bj as getStatusTypeFromOdigosHealth,fu as getValueForRange,g as getVirtualServiceIcon,be as getWorkloadId,aX as getYamlFieldsForDestination,fv as hasUnhealthyInstances,fw as instrumentationRuleSourceScopesFromWire,fx as instrumentationRuleSourceScopesToWire,s as isEmpty,x as isLegalK8sLabel,bM as isOverTime,fy as isStringABoolean,fz as isTimeElapsed,bn as isValidVersion,fA as mapConditions,b4 as mapDesiredStatusToConditionStatus,aV as mapDestinationFieldsForDisplay,G as mapExportedSignals,z as mapSupportedSignals,fB as numbersOnly,fC as parseBooleanFromString,fD as parseJsonStringToPrettyString,ai as prepareDestinationFormData,fE as removeEmptyValuesFromObject,C as safeJsonParse,fF as safeJsonStringify,fG as setDeepValue,fH as sleep,aY as splitCamelString,fI as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-
|
|
1
|
+
export{fa as adaptInstrumentationRuleFromWire,fb as adaptInstrumentationRuleInputForWire,b1 as buildBadgeForDesiredStatus,fc as capitalizeFirstLetter,fd as cleanObjectEmptyStringsValues,ah as compareCondition,fe as decimalsOnly,p as deepClone,dh as entityIdKey,dl as filterActions,dk as filterDestinations,aW as filterDestinationsByStream,dj as filterSources,d6 as filterSourcesByStream,ff as flattenObjectKeys,bh as formatBytes,fg as formatDuration,bQ as generateId,aU as getActionIcon,e as getConditionsBooleans,bt as getContainersIcons,fh as getContainersInstrumentedCount,fi as getDeepValue,aH as getDestinationIcon,fj as getDetectedLanguageIcons,b6 as getEffectiveLanguage,bo as getEffectiveRuntimeVersion,dc as getEntityIcon,aP as getEntityId,dg as getEntityIdKey,db as getEntityLabel,fk as getHealthBadgeLabel,fl as getIdFromSseTarget,a_ as getInstrumentationRuleIcon,fm as getMainContainerLanguage,fn as getMetricForEntity,fo as getMonitorIcon,fp as getPlatformIcon,fq as getPlatformLabel,ao as getProgrammingLanguageIcon,fr as getRecursiveValues,d as getSourceLanguageIcons,fs as getSseTargetFromId,ft as getStatusColor,dr as getStatusFromPodStatus,df as getStatusIcon,bj as getStatusTypeFromOdigosHealth,fu as getValueForRange,g as getVirtualServiceIcon,be as getWorkloadId,aX as getYamlFieldsForDestination,fv as hasUnhealthyInstances,fw as instrumentationRuleSourceScopesFromWire,fx as instrumentationRuleSourceScopesToWire,s as isEmpty,x as isLegalK8sLabel,bM as isOverTime,fy as isStringABoolean,fz as isTimeElapsed,bn as isValidVersion,fA as mapConditions,b4 as mapDesiredStatusToConditionStatus,aV as mapDestinationFieldsForDisplay,G as mapExportedSignals,z as mapSupportedSignals,fB as numbersOnly,fC as parseBooleanFromString,fD as parseJsonStringToPrettyString,ai as prepareDestinationFormData,fE as removeEmptyValuesFromObject,C as safeJsonParse,fF as safeJsonStringify,fG as setDeepValue,fH as sleep,aY as splitCamelString,fI as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-B2A1-SuV.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-IfqYyoNb.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{fT as IGNORE_OUTSIDE_CLICK_ATTR,fU as useActionFormData,fV as useBodyScroll,da as useClickNode,m as useClickNotification,di as useContainerSize,bi as useCopy,fW as useDataStreamFormData,fX as useDestinationFormData,o as useGenericForm,fY as useInstrumentationRuleFormData,bL as useKeyDown,bk as useOnClickOutside,fZ as useOverflow,u as usePopup,b0 as useScrollIntoViewWhen,dN as useScrollTo,d9 as useSessionStorage,f_ as useSourceFormData,a$ as useTimeAgo}from"./chunks/ui-components-
|
|
1
|
+
export{fT as IGNORE_OUTSIDE_CLICK_ATTR,fU as useActionFormData,fV as useBodyScroll,da as useClickNode,m as useClickNotification,di as useContainerSize,bi as useCopy,fW as useDataStreamFormData,fX as useDestinationFormData,o as useGenericForm,fY as useInstrumentationRuleFormData,bL as useKeyDown,bk as useOnClickOutside,fZ as useOverflow,u as usePopup,b0 as useScrollIntoViewWhen,dN as useScrollTo,d9 as useSessionStorage,f_ as useSourceFormData,a$ as useTimeAgo}from"./chunks/ui-components-B2A1-SuV.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-IfqYyoNb.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { SVG } from '@/types';
|
|
2
|
-
export declare const OpenTelemetryLogoStripped: () =>
|
|
3
|
+
export declare const OpenTelemetryLogoStripped: () => React.JSX.Element;
|
|
3
4
|
export declare const OpenTelemetryLogo: SVG;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type K8sWorkloadContainerAgentConfig, type K8sWorkloadContainerCollectorConfig } from '@/types';
|
|
2
|
+
export declare const MOCK_HEAD_SAMPLING_EMPTY: K8sWorkloadContainerAgentConfig;
|
|
3
|
+
export declare const MOCK_HEAD_SAMPLING_CLUSTER: K8sWorkloadContainerAgentConfig;
|
|
4
|
+
export declare const MOCK_HEAD_SAMPLING_MEMBERSHIP_GO: K8sWorkloadContainerAgentConfig;
|
|
5
|
+
export declare const MOCK_TAIL_SAMPLING_CLUSTER_HEAD_NOISY: K8sWorkloadContainerCollectorConfig;
|
|
6
|
+
export declare const MOCK_TAIL_SAMPLING_CLUSTER_ALL: K8sWorkloadContainerCollectorConfig;
|
|
7
|
+
export declare const MOCK_TAIL_SAMPLING_MEMBERSHIP_GO: K8sWorkloadContainerCollectorConfig;
|
|
@@ -29,4 +29,4 @@ export interface PresetWithCustomInputProps<T extends string = string> {
|
|
|
29
29
|
customMin?: number;
|
|
30
30
|
customMax?: number;
|
|
31
31
|
}
|
|
32
|
-
export declare const PresetWithCustomInput: <T extends string>({ description, options, selected, onSelect, customName, customLabel, customPlaceholder, customValue, onCustomChange, customInputType, customMin, customMax, }: PresetWithCustomInputProps<T>) =>
|
|
32
|
+
export declare const PresetWithCustomInput: <T extends string>({ description, options, selected, onSelect, customName, customLabel, customPlaceholder, customValue, onCustomChange, customInputType, customMin, customMax, }: PresetWithCustomInputProps<T>) => React.JSX.Element;
|
package/lib/snippets/v2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ba as ActionType,dq as Actions,dp as RichTitle}from"../chunks/ui-components-
|
|
1
|
+
export{ba as ActionType,dq as Actions,dp as RichTitle}from"../chunks/ui-components-B2A1-SuV.js";export{C as CancelModal,j as DURATION_OPTIONS,g as DeleteModal,e as DurationErrorsSection,D as DynamicField,I as InstrumentationPreviewSection,N as NOISY_PERCENTAGE_OPTIONS,h as OdigosLogoTextByTier,O as OperationSection,b as PERCENTAGE_OPTIONS,f as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,d as RuleTypeSection,c as SamplingPreviewSection,S as SignalsCheckboxList,a as SourceScopeSection,U as UpgradeModal,i as WIDE_DRAWER_WIDTH,W as WideDrawer,Y as YamlSectionCard}from"../chunks/index-Cgdz0gvj.js";export{C as ColoredSpan,D as ColoredSpanVariant}from"../chunks/helpers-TT5Y1hFq.js";import"react/jsx-runtime";import"styled-components";import"../icons.js";import"zustand";import"react";import"javascript-time-ago";import"../chunks/vendor-IfqYyoNb.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/snippets.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{memo as r,useRef as i,useEffect as n}from"react";import"./chunks/vendor-
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{memo as r,useRef as i,useEffect as n}from"react";import"./chunks/vendor-IfqYyoNb.js";import d,{useTheme as s}from"styled-components";import{ac as a,R as l,eJ as c,h as p,S as m,df as u,da as h,k as g,N as b}from"./chunks/ui-components-B2A1-SuV.js";import{Handle as x,Position as f,ReactFlowProvider as v,ReactFlow as y,Controls as w,ControlButton as N,useReactFlow as k}from"@xyflow/react";import{RefreshIcon as $}from"./icons.js";import"javascript-time-ago";import"zustand";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";const C=d(l)`
|
|
2
2
|
max-width: 300px;
|
|
3
3
|
padding: 12px;
|
|
4
4
|
border-radius: 12px;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { EntityTypes, type WorkloadId } from '@/types';
|
|
1
|
+
import { EntityTypes, type SamplingRuleCategory, type WorkloadId } from '@/types';
|
|
2
2
|
export interface DrawerStoreState {
|
|
3
3
|
drawerType: EntityTypes | null;
|
|
4
4
|
drawerEntityId: string | WorkloadId | null;
|
|
5
|
+
pendingViewSamplingRule: {
|
|
6
|
+
ruleId: string;
|
|
7
|
+
category: SamplingRuleCategory;
|
|
8
|
+
} | null;
|
|
5
9
|
}
|
|
6
10
|
interface DrawerStoreStateSetters {
|
|
7
11
|
setDrawerType: (value: DrawerStoreState['drawerType']) => void;
|
|
8
12
|
setDrawerEntityId: (value: DrawerStoreState['drawerEntityId']) => void;
|
|
13
|
+
setPendingViewSamplingRule: (value: DrawerStoreState['pendingViewSamplingRule']) => void;
|
|
9
14
|
}
|
|
10
15
|
export declare const useDrawerStore: import("zustand").UseBoundStore<import("zustand").StoreApi<DrawerStoreState & DrawerStoreStateSetters>>;
|
|
11
16
|
export {};
|
package/lib/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{aM as ProgressKeys,k as useActiveNodeStore,fS as useDarkMode,w as useDataStreamStore,bd as useDrawerStore,j as useEntityStore,d5 as useFilterStore,bR as useModalStore,l as useNotificationStore,aL as useProgressStore,de as useSelectedStore,dm as useSetupStore}from"./chunks/ui-components-
|
|
1
|
+
export{aM as ProgressKeys,k as useActiveNodeStore,fS as useDarkMode,w as useDataStreamStore,bd as useDrawerStore,j as useEntityStore,d5 as useFilterStore,bR as useModalStore,l as useNotificationStore,aL as useProgressStore,de as useSelectedStore,dm as useSetupStore}from"./chunks/ui-components-B2A1-SuV.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-IfqYyoNb.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{f$ as Provider,g0 as animations,g1 as opacity,g2 as palettes}from"./chunks/ui-components-
|
|
1
|
+
export{f$ as Provider,g0 as animations,g1 as opacity,g2 as palettes}from"./chunks/ui-components-B2A1-SuV.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-IfqYyoNb.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ProgrammingLanguages } from '../common';
|
|
2
|
+
import type { HeadSamplingOperationMatcher, TailSamplingOperationMatcher } from '../sampling';
|
|
2
3
|
import { K8sResourceKind, OtelDistroName, DesiredStateProgress } from '../enum';
|
|
3
4
|
export interface WorkloadId {
|
|
4
5
|
namespace: string;
|
|
@@ -67,24 +68,21 @@ export interface K8sWorkloadContainerOverrides {
|
|
|
67
68
|
otelDistroName?: OtelDistroName | null;
|
|
68
69
|
runtimeInfo?: K8sWorkloadRuntimeInfoContainer | null;
|
|
69
70
|
}
|
|
70
|
-
export declare enum
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
EndWith = "endWith",
|
|
74
|
-
StartWith = "startWith"
|
|
71
|
+
export declare enum K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode {
|
|
72
|
+
SampledSpansOnly = "sampled_spans_only",
|
|
73
|
+
AllSpans = "all_spans"
|
|
75
74
|
}
|
|
76
|
-
export interface
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
conditions?: K8sWorkloadContainerAgentConfigTracesHeadSamplingCheckCondition[] | null;
|
|
83
|
-
percentage: number;
|
|
75
|
+
export interface K8sWorkloadContainerAgentConfigTracesHeadSamplingNoisyOperation {
|
|
76
|
+
ruleId: string;
|
|
77
|
+
name?: string | null;
|
|
78
|
+
disabled: boolean;
|
|
79
|
+
operation?: HeadSamplingOperationMatcher | null;
|
|
80
|
+
percentageAtMost?: number | null;
|
|
84
81
|
}
|
|
85
82
|
export interface K8sWorkloadContainerAgentConfigTracesHeadSampling {
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
dryRun?: boolean | null;
|
|
84
|
+
spanMetricsMode?: K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode | null;
|
|
85
|
+
noisyOperations?: K8sWorkloadContainerAgentConfigTracesHeadSamplingNoisyOperation[] | null;
|
|
88
86
|
}
|
|
89
87
|
export interface K8sWorkloadContainerAgentConfigTraces {
|
|
90
88
|
headSampling?: K8sWorkloadContainerAgentConfigTracesHeadSampling | null;
|
|
@@ -92,6 +90,37 @@ export interface K8sWorkloadContainerAgentConfigTraces {
|
|
|
92
90
|
export interface K8sWorkloadContainerAgentConfig {
|
|
93
91
|
traces?: K8sWorkloadContainerAgentConfigTraces | null;
|
|
94
92
|
}
|
|
93
|
+
export interface K8sWorkloadContainerCollectorConfigTailSamplingNoisyOperation {
|
|
94
|
+
ruleId: string;
|
|
95
|
+
name?: string | null;
|
|
96
|
+
disabled: boolean;
|
|
97
|
+
operation?: HeadSamplingOperationMatcher | null;
|
|
98
|
+
percentageAtMost?: number | null;
|
|
99
|
+
}
|
|
100
|
+
export interface K8sWorkloadContainerCollectorConfigTailSamplingHighlyRelevantOperation {
|
|
101
|
+
ruleId: string;
|
|
102
|
+
name?: string | null;
|
|
103
|
+
disabled: boolean;
|
|
104
|
+
error: boolean;
|
|
105
|
+
durationAtLeastMs?: number | null;
|
|
106
|
+
operation?: TailSamplingOperationMatcher | null;
|
|
107
|
+
percentageAtLeast?: number | null;
|
|
108
|
+
}
|
|
109
|
+
export interface K8sWorkloadContainerCollectorConfigTailSamplingCostReductionRule {
|
|
110
|
+
ruleId: string;
|
|
111
|
+
name?: string | null;
|
|
112
|
+
disabled: boolean;
|
|
113
|
+
operation?: TailSamplingOperationMatcher | null;
|
|
114
|
+
percentageAtMost: number;
|
|
115
|
+
}
|
|
116
|
+
export interface K8sWorkloadContainerCollectorConfigTailSampling {
|
|
117
|
+
noisyOperations?: K8sWorkloadContainerCollectorConfigTailSamplingNoisyOperation[] | null;
|
|
118
|
+
highlyRelevantOperations?: K8sWorkloadContainerCollectorConfigTailSamplingHighlyRelevantOperation[] | null;
|
|
119
|
+
costReductionRules?: K8sWorkloadContainerCollectorConfigTailSamplingCostReductionRule[] | null;
|
|
120
|
+
}
|
|
121
|
+
export interface K8sWorkloadContainerCollectorConfig {
|
|
122
|
+
tailSampling?: K8sWorkloadContainerCollectorConfigTailSampling | null;
|
|
123
|
+
}
|
|
95
124
|
export interface K8sWorkloadPodContainerProcessAttribute {
|
|
96
125
|
name: string;
|
|
97
126
|
value: string;
|
|
@@ -107,6 +136,8 @@ export interface K8sWorkloadContainer {
|
|
|
107
136
|
runtimeInfo?: K8sWorkloadRuntimeInfoContainer | null;
|
|
108
137
|
agentEnabled?: K8sWorkloadAgentEnabledContainer | null;
|
|
109
138
|
overrides?: K8sWorkloadContainerOverrides | null;
|
|
139
|
+
agentConfig?: K8sWorkloadContainerAgentConfig | null;
|
|
140
|
+
collectorConfig?: K8sWorkloadContainerCollectorConfig | null;
|
|
110
141
|
}
|
|
111
142
|
export interface K8sWorkloadPodContainerProcess {
|
|
112
143
|
healthy?: boolean | null;
|
package/lib/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{q as ActionKeyTypes,r as ActionType,eK as AddNodeTypes,eL as AgentInjectedReason,eM as BooleanOperation,aj as CodeAttributesKeyTypes,eN as ConditionType,eO as Crud,K as CustomInstrumentationsKeyTypes,b2 as DesiredStateProgress,eP as DestinationTypes,eQ as EdgeTypes,E as EntityTypes,a7 as ExtractionDataFormat,H as FieldTypes,L as GolangCustomProbe,J as HeadersCollectionKeyTypes,dP as InputTypes,eR as InstallationMethod,O as InstrumentationRuleType,eS as IntrumentationStatus,M as JavaCustomProbe,eT as JsonOperation,Y as K8sAttributesFrom,Q as K8sResourceKind,eU as
|
|
1
|
+
export{q as ActionKeyTypes,r as ActionType,eK as AddNodeTypes,eL as AgentInjectedReason,eM as BooleanOperation,aj as CodeAttributesKeyTypes,eN as ConditionType,eO as Crud,K as CustomInstrumentationsKeyTypes,b2 as DesiredStateProgress,eP as DestinationTypes,eQ as EdgeTypes,E as EntityTypes,a7 as ExtractionDataFormat,H as FieldTypes,L as GolangCustomProbe,J as HeadersCollectionKeyTypes,dP as InputTypes,eR as InstallationMethod,O as InstrumentationRuleType,eS as IntrumentationStatus,M as JavaCustomProbe,eT as JsonOperation,Y as K8sAttributesFrom,Q as K8sResourceKind,eU as K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode,eV as ListDirection,N as NodeTypes,eW as NumberOperation,eX as OtelDistroName,eY as OtherEntityTypes,b7 as OtherStatus,aI as OtherStatusType,al as PayloadCollectionKeyTypes,P as PlatformType,eZ as PodContainerLifecycleStatus,e_ as PodContainerStatus,e$ as PodPhase,f0 as Profile,bq as ProgrammingLanguages,f1 as SIGNAL_KEY_TO_TYPE,f2 as SIGNAL_TYPE_TO_KEY,f3 as SignalKey,B as SignalType,f4 as SortDirection,S as StatusType,f5 as StringOperation,T as Tier,f6 as WorkloadRolloutReason,ds as WorkloadRolloutStatus}from"./chunks/ui-components-B2A1-SuV.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-IfqYyoNb.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/visuals.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{f7 as VISUAL_ODIGOS_LOGO_HEIGHT,f8 as VISUAL_ODIGOS_LOGO_WIDTH,eH as VisualGreenRings,f9 as VisualOdigosLogo,c0 as VisualPurpleRings}from"./chunks/ui-components-
|
|
1
|
+
export{f7 as VISUAL_ODIGOS_LOGO_HEIGHT,f8 as VISUAL_ODIGOS_LOGO_WIDTH,eH as VisualGreenRings,f9 as VisualOdigosLogo,c0 as VisualPurpleRings}from"./chunks/ui-components-B2A1-SuV.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-IfqYyoNb.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odigos/ui-kit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.250",
|
|
4
4
|
"author": "Odigos",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -103,52 +103,52 @@
|
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
|
-
"react": "19.2.
|
|
107
|
-
"react-dom": "19.2.
|
|
106
|
+
"react": "19.2.7",
|
|
107
|
+
"react-dom": "19.2.7",
|
|
108
108
|
"styled-components": "6.3.12"
|
|
109
109
|
},
|
|
110
110
|
"dependencies": {
|
|
111
|
-
"@xyflow/react": "^12.
|
|
111
|
+
"@xyflow/react": "^12.11.0",
|
|
112
112
|
"elkjs": "^0.11.1",
|
|
113
113
|
"javascript-time-ago": "^2.6.4",
|
|
114
114
|
"lottie-react": "^2.4.1",
|
|
115
115
|
"prism-react-renderer": "^2.4.1",
|
|
116
|
-
"react": "19.2.
|
|
117
|
-
"react-dom": "19.2.
|
|
118
|
-
"react-error-boundary": "^6.1.
|
|
116
|
+
"react": "19.2.7",
|
|
117
|
+
"react-dom": "19.2.7",
|
|
118
|
+
"react-error-boundary": "^6.1.2",
|
|
119
119
|
"styled-components": "6.3.12",
|
|
120
120
|
"virtua": "^0.49.1",
|
|
121
|
-
"zustand": "^5.0.
|
|
121
|
+
"zustand": "^5.0.14"
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
|
-
"@babel/core": "^7.29.
|
|
125
|
-
"@babel/preset-env": "^7.29.
|
|
126
|
-
"@babel/preset-react": "^7.
|
|
127
|
-
"@babel/preset-typescript": "^7.
|
|
124
|
+
"@babel/core": "^7.29.7",
|
|
125
|
+
"@babel/preset-env": "^7.29.7",
|
|
126
|
+
"@babel/preset-react": "^7.29.7",
|
|
127
|
+
"@babel/preset-typescript": "^7.29.7",
|
|
128
128
|
"@eslint/eslintrc": "^3.3.5",
|
|
129
|
-
"@rollup/plugin-commonjs": "^29.0.
|
|
129
|
+
"@rollup/plugin-commonjs": "^29.0.3",
|
|
130
130
|
"@rollup/plugin-json": "^6.1.0",
|
|
131
131
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
132
132
|
"@rollup/plugin-terser": "^1.0.0",
|
|
133
133
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
134
134
|
"@storybook/addon-webpack5-compiler-babel": "^4.0.1",
|
|
135
|
-
"@storybook/react-webpack5": "10.
|
|
136
|
-
"@types/node": "^25.
|
|
137
|
-
"@types/react": "^19.2.
|
|
135
|
+
"@storybook/react-webpack5": "10.4.5",
|
|
136
|
+
"@types/node": "^25.9.3",
|
|
137
|
+
"@types/react": "^19.2.17",
|
|
138
138
|
"@types/react-dom": "^19.2.3",
|
|
139
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
140
|
-
"@typescript-eslint/parser": "^8.
|
|
139
|
+
"@typescript-eslint/eslint-plugin": "^8.61.0",
|
|
140
|
+
"@typescript-eslint/parser": "^8.61.0",
|
|
141
141
|
"babel-loader": "^10.1.1",
|
|
142
142
|
"babel-plugin-styled-components": "^2.1.4",
|
|
143
143
|
"eslint": "^9.39.4",
|
|
144
144
|
"eslint-plugin-react": "^7.37.5",
|
|
145
|
-
"eslint-plugin-storybook": "10.
|
|
146
|
-
"postcss": "^8.5.
|
|
147
|
-
"rollup": "^4.
|
|
145
|
+
"eslint-plugin-storybook": "10.4.5",
|
|
146
|
+
"postcss": "^8.5.15",
|
|
147
|
+
"rollup": "^4.62.0",
|
|
148
148
|
"rollup-plugin-filesize": "^10.0.0",
|
|
149
149
|
"rollup-plugin-postcss": "^4.0.2",
|
|
150
150
|
"rollup-plugin-visualizer": "^7.0.1",
|
|
151
|
-
"storybook": "10.
|
|
151
|
+
"storybook": "10.4.5",
|
|
152
152
|
"typescript": "^5.9.3"
|
|
153
153
|
}
|
|
154
154
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import{useMemo as n,useContext as o,createContext as a,Fragment as s}from"react";import{t as i,T as u,P as l,u as c,a as p,b as d,c as f}from"./ui-components-DODwSdKu.js";import h from"styled-components";const m=a({platformType:l.K8s,tier:u.Community,version:"v0.0.0"}),v=({children:t,platformType:r,tier:o,version:a})=>{const s=n(()=>({platformType:r,tier:o,version:a}),[r,o,a]);return e(m.Provider,{value:s,children:t})},g=(e,t)=>!t||i(e)>=i(t),y=e=>{const t=o(m),r=g(t.version,e),n=t.platformType===l.Vm;return{...t,isVersionSupported:r,isVm:n,isEnterprise:t.tier===u.Onprem}};function x(){return{sources:[],namespaces:[],languages:[]}}function k(e){return!e||!e.sources?.length&&!e.namespaces?.length&&!e.languages?.length}function S(e){return e?{sources:e.sources?[...e.sources]:[],namespaces:e.namespaces?[...e.namespaces]:[],languages:e.languages?[...e.languages]:[]}:{sources:[],namespaces:[],languages:[]}}function A(e){return null==e||0===e}function T(e){return{name:"",notes:"",disabled:!1,ruleType:"Relevance",sourceScopes:{sources:[],namespaces:[],languages:[]},operationType:"all",routeType:"route",route:"",serverAddress:"",method:"",kafkaTopic:"",durationPreset:"500",customDurationMs:"",keepErrors:!1,percentageMode:"costReduction"===e?"sample":"all",percentagePreset:"0",customPercentage:""}}function P(e){return k(e.sourceScopes)?null:e.sourceScopes}function R(e){return P(e)}function b(e){if("all"===e.percentageMode)return null;if("custom"===e.percentagePreset){const t=parseFloat(e.customPercentage);return isNaN(t)?null:t}return parseFloat(e.percentagePreset)}function M(e){if("custom"===e.durationPreset){const t=parseFloat(e.customDurationMs);return isNaN(t)?null:t}return parseInt(e.durationPreset,10)}function D(e){return{httpServer:{[e.routeType]:e.route||null,method:e.method||null}}}function I(e){return"all"===e.operationType?null:"httpServer"===e.operationType?D(e):"httpClient"===e.operationType?{httpClient:{serverAddress:e.serverAddress||null,["route"===e.routeType?"templatedPath":"templatedPathPrefix"]:e.route||null,method:e.method||null}}:null}function $(e){return"all"===e.operationType?null:"httpServer"===e.operationType?D(e):"kafkaConsumer"===e.operationType?{kafkaConsumer:{kafkaTopic:e.kafkaTopic||null}}:"kafkaProducer"===e.operationType?{kafkaProducer:{kafkaTopic:e.kafkaTopic||null}}:null}function C(e){return{ruleId:"",name:e.name||null,disabled:!1,notes:e.notes||null,sourceScopes:P(e),percentageAtMost:b(e),operation:I(e)}}function E(e){return{ruleId:"",name:e.name||null,disabled:!1,notes:e.notes||null,sourceScopes:P(e),error:e.keepErrors,durationAtLeastMs:"Duration"===e.ruleType?M(e):null,percentageAtLeast:b(e),operation:$(e)}}function w(e){return{ruleId:"",name:e.name||null,disabled:!1,notes:e.notes||null,sourceScopes:P(e),percentageAtMost:b(e)??0,operation:$(e)}}function L(e){return{name:e.name||null,disabled:e.disabled,sourceScopes:R(e),operation:I(e),percentageAtMost:b(e),notes:e.notes||null}}function O(e){return{name:e.name||null,disabled:e.disabled,sourceScopes:R(e),error:"Error"===e.ruleType,durationAtLeastMs:"Duration"===e.ruleType?M(e):null,operation:$(e),percentageAtLeast:b(e),notes:e.notes||null}}function N(e){return{name:e.name||null,disabled:e.disabled,sourceScopes:R(e),operation:$(e),percentageAtMost:b(e)??0,notes:e.notes||null}}const H=["5000","1000","500","100","50"],K=["50","25","10","1","0.5","0.1","0"];function j(e){if(null==e)return{percentageMode:"all",percentagePreset:"0",customPercentage:""};const t=K.find(t=>Number(t)===e);return t?{percentageMode:"sample",percentagePreset:t,customPercentage:""}:{percentageMode:"sample",percentagePreset:"custom",customPercentage:String(e)}}function z(e){if(!e)return{operationType:"all",routeType:"route",route:"",serverAddress:"",method:"",kafkaTopic:""};const t=e;if(t.httpServer){return{operationType:"httpServer",routeType:t.httpServer.routePrefix?"routePrefix":"route",route:t.httpServer.route||t.httpServer.routePrefix||"",serverAddress:"",method:t.httpServer.method||"",kafkaTopic:""}}return t.kafkaConsumer?{operationType:"kafkaConsumer",routeType:"route",route:"",serverAddress:"",method:"",kafkaTopic:t.kafkaConsumer.kafkaTopic||""}:t.kafkaProducer?{operationType:"kafkaProducer",routeType:"route",route:"",serverAddress:"",method:"",kafkaTopic:t.kafkaProducer.kafkaTopic||""}:{operationType:"all",routeType:"route",route:"",serverAddress:"",method:"",kafkaTopic:""}}function F(e){const t=T(),r=S(e.rule.sourceScopes);const n=function(e){return"highlyRelevant"!==e.category?"Relevance":e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance"}(e);let o,a,s={durationPreset:"500",customDurationMs:""},i=!1;switch(e.category){case"noisy":o=function(e){const t=e.rule.operation;if(!t)return{operationType:"all",routeType:"route",route:"",serverAddress:"",method:"",kafkaTopic:""};if(t.httpServer)return{operationType:"httpServer",routeType:t.httpServer.routePrefix?"routePrefix":"route",route:t.httpServer.route||t.httpServer.routePrefix||"",serverAddress:"",method:t.httpServer.method||"",kafkaTopic:""};if(t.httpClient)return{operationType:"httpClient",routeType:t.httpClient.templatedPathPrefix?"routePrefix":"route",route:t.httpClient.templatedPath||t.httpClient.templatedPathPrefix||"",serverAddress:t.httpClient.serverAddress||"",method:t.httpClient.method||"",kafkaTopic:""};return{operationType:"all",routeType:"route",route:"",serverAddress:"",method:"",kafkaTopic:""}}(e),a=A(u=e.rule.percentageAtMost)?{percentageMode:"all",percentagePreset:"0",customPercentage:""}:j(u);break;case"highlyRelevant":o=z(e.rule.operation),a=j(e.rule.percentageAtLeast),s=function(e){if(null==e)return{durationPreset:"500",customDurationMs:""};const t=H.find(t=>Number(t)===e);return t?{durationPreset:t,customDurationMs:""}:{durationPreset:"custom",customDurationMs:String(e)}}(e.rule.durationAtLeastMs),i=e.rule.error;break;case"costReduction":o=z(e.rule.operation),a=j(e.rule.percentageAtMost)}var u;return{...t,name:e.rule.name||"",notes:e.rule.notes||"",disabled:e.rule.disabled,ruleType:n,sourceScopes:r,...o,...s,keepErrors:i,...a}}var X;!function(e){e.Default="default",e.Action="action",e.Endpoint="endpoint",e.Scope="scope",e.Duration="duration"}(X||(X={}));const J=[X.Action,X.Endpoint,X.Scope,X.Duration],V=h.span`
|
|
2
|
-
font-family: ${({theme:e,$isMono:t})=>t?e.font_family.secondary:e.font_family.primary};
|
|
3
|
-
font-size: ${({theme:e})=>e.v2.text.size.xxs}px;
|
|
4
|
-
line-height: 20px;
|
|
5
|
-
color: ${({theme:e,$variant:t})=>{const r=e.v2.colors;switch(t){case"action":return r.green[400];case"endpoint":return r.purple[300];case"scope":return r.yellow[400];case"duration":return r.orange[600];default:return r.white[500]}}};
|
|
6
|
-
`,B=h.span`
|
|
7
|
-
display: inline;
|
|
8
|
-
cursor: help;
|
|
9
|
-
text-decoration: underline dotted;
|
|
10
|
-
text-underline-offset: 3px;
|
|
11
|
-
`,W=h.div`
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-direction: column;
|
|
14
|
-
gap: 4px;
|
|
15
|
-
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
16
|
-
border-radius: 4px;
|
|
17
|
-
padding: 8px;
|
|
18
|
-
max-width: 300px;
|
|
19
|
-
`,_=({items:t,children:n})=>{const{popupRef:o,popupOpen:a,setPopupOpen:s,popupPosition:i,handlePosition:u}=c({positionMode:"viewport",defaultClientHeight:48,defaultClientwidth:240}),l=e=>{u(e.clientX,e.clientY),s("mouseleave"!==e.type)};return r(B,{onMouseEnter:l,onMouseMove:l,onMouseLeave:l,children:[n,e(p,{ref:o,isOpen:a,top:i.top,left:i.left,asPortal:!0,style:{backgroundColor:"transparent",border:"none"},borderRadius:"0",padding:"0",maxWidth:"300px",children:e(W,{children:t.map((t,r)=>e(d,{size:f.XXXS,children:t},r))})})]})},q=({parts:n})=>{const o=n.map(e=>({...e,text:e.text.trim()})).filter(e=>e.text.length>0);return e(t,{children:o.map((n,o)=>{const a=e(V,{$variant:n.variant,$isMono:J.includes(n.variant),children:n.text});return r(s,{children:[0!==o&&e(t,{children:" "}),n.tooltipItems?.length?e(_,{items:n.tooltipItems,children:a}):a]},`${n.variant}-${o}`)})})};var G;!function(e){e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"}(G||(G={}));const Y=[{value:G.Noisy,label:"1. Noisy Operations",tooltip:"Rules that reduce noise from high-volume, low-value operations"},{value:G.HighlyRelevant,label:"2. Highly Relevant Operations",tooltip:"Rules that prioritize important traces for retention"},{value:G.CostReduction,label:"3. Cost Reduction",tooltip:"Rules that optimize costs by sampling less critical data"}],Q={[G.Noisy]:"This is the most efficient way to sample (with Head Sampling). Prefer to use it where possible.",[G.HighlyRelevant]:'Any trace from the "Noisy Operations" category is sampled prior to checking highly relevance.',[G.CostReduction]:"Cost reduction rules use Tail Sampling to drop traces that are unlikely to be useful for debugging or monitoring."},U={[G.Noisy]:"Noisy Operations rules list",[G.HighlyRelevant]:"Highly Relevant Operations rules list",[G.CostReduction]:"Cost Reduction rules list"},Z={[G.Noisy]:"noisy",[G.HighlyRelevant]:"highlyRelevant",[G.CostReduction]:"costReduction"};function ee(e){const t=e.kind?String(e.kind).toLowerCase():"deployment";return e.namespace&&e.name?`${t} '${e.name}' in namespace '${e.namespace}'`:e.name?`${t} '${e.name}'`:e.namespace?`any service in namespace '${e.namespace}'`:""}function te(e){return`any service in namespace '${e}'`}function re(e){return`${e} services`}function ne(e){const t=function(e){if(!e)return[];const t=[];for(const r of e.sources??[]){const e=ee(r);e&&t.push(e)}for(const r of e.namespaces??[])r&&t.push(te(r));for(const r of e.languages??[])r&&t.push(re(r));return t}(e);if(!t.length)return[{text:" in ",variant:X.Default},{text:"any service in the cluster",variant:X.Scope}];const r=[{text:" in ",variant:X.Default}],n=t.slice(0,2),o=t.slice(2);return n.forEach((e,t)=>{t>0&&r.push({text:", ",variant:X.Default}),r.push({text:e,variant:X.Scope})}),o.length>0&&r.push({text:` + ${o.length} more`,variant:X.Default,tooltipItems:o}),r}function oe(e,t){const r=(n=e).startsWith("/")?n.slice(1):n;var n;return t?`${t} /${r}`:`/${r}`}function ae(e){const t=e.method;return e.route?[{text:" for server endpoint ",variant:X.Default},{text:oe(e.route,t),variant:X.Endpoint}]:e.routePrefix?[{text:" for endpoints under ",variant:X.Default},{text:oe(e.routePrefix,t),variant:X.Endpoint}]:[]}function se(e){const t=[];if(A(e.percentageAtMost)?t.push({text:"Drop all traces",variant:X.Action}):(t.push({text:`Keep at most ${e.percentageAtMost}%`,variant:X.Action}),t.push({text:" of traces",variant:X.Default})),e.operation){const r=e.operation.httpServer,n=r?function(e){const t=e.method;return e.route?[{text:" where the root span is ",variant:X.Default},{text:oe(e.route,t),variant:X.Endpoint}]:e.routePrefix?[{text:" where the root span is under ",variant:X.Default},{text:oe(e.routePrefix,t),variant:X.Endpoint}]:[]}(r):[];n.length>0&&t.push(...n);const o=e.operation.httpClient,a=o?.templatedPath||o?.templatedPathPrefix,s=o?.serverAddress;if((a||s)&&0===n.length){const e=o?.method,r=a&&s?`${s}/${a}`:a||s;t.push({text:" to ",variant:X.Default}),e?t.push({text:`${e} /${r}`,variant:X.Endpoint}):t.push({text:`/${r}`,variant:X.Endpoint})}}else t.push({text:" on ",variant:X.Default}),t.push({text:"any operation",variant:X.Endpoint});return t.push(...ne(e.sourceScopes)),t}function ie(e){const t=[];if(null!=e.percentageAtLeast?(t.push({text:`Keep ${e.percentageAtLeast}%`,variant:X.Action}),t.push({text:" of traces",variant:X.Default})):t.push({text:"Keep all traces",variant:X.Action}),e.operation){const r=e.operation.httpServer;r&&t.push(...ae(r))}else t.push({text:" on ",variant:X.Default}),t.push({text:"any operation",variant:X.Endpoint});return t.push(...ne(e.sourceScopes)),!e.error&&null!=e.durationAtLeastMs&&e.durationAtLeastMs>0&&(t.push({text:" with duration > ",variant:X.Default}),t.push({text:`${e.durationAtLeastMs}ms`,variant:X.Duration})),t}function ue(e){const t=[];if(t.push({text:`Keep at most ${e.percentageAtMost}%`,variant:X.Action}),t.push({text:" of traces",variant:X.Default}),e.operation){const r=e.operation.httpServer,n=r?ae(r):[];n.length>0&&t.push(...n);const o=e.operation.kafkaConsumer?.kafkaTopic;o&&0===n.length&&(t.push({text:" from ",variant:X.Default}),t.push({text:`topic '${o}'`,variant:X.Endpoint}))}else t.push({text:" on ",variant:X.Default}),t.push({text:"any operation",variant:X.Endpoint});return t.push(...ne(e.sourceScopes)),t}function le(e){return e.error?"Error":null!=e.durationAtLeastMs?"Duration":"Relevance"}function ce(e,t,r){const n=Z[t],o=[];for(const a of e)switch(t){case G.Noisy:for(const e of a.noisyOperations)r?.has(e.ruleId)||o.push({ruleId:e.ruleId,samplingId:a.id,name:e.name??null,disabled:e.disabled,notes:e.notes??null,summary:se(e),category:n});break;case G.HighlyRelevant:for(const e of a.highlyRelevantOperations)r?.has(e.ruleId)||o.push({ruleId:e.ruleId,samplingId:a.id,name:e.name??null,disabled:e.disabled,notes:e.notes??null,summary:ie(e),category:n,typeBadge:le(e)});break;case G.CostReduction:for(const e of a.costReductionRules)r?.has(e.ruleId)||o.push({ruleId:e.ruleId,samplingId:a.id,name:e.name??null,disabled:e.disabled,notes:e.notes??null,summary:ue(e),category:n})}return o}function pe(e,t){switch(e){case"noisy":return se(t);case"highlyRelevant":return ie(t);case"costReduction":return ue(t)}}function de(e,t,r,n){for(const o of e)if(o.id===t)switch(n){case"noisy":{const e=o.noisyOperations.find(e=>e.ruleId===r);if(e)return{category:"noisy",samplingId:o.id,rule:e};break}case"highlyRelevant":{const e=o.highlyRelevantOperations.find(e=>e.ruleId===r);if(e)return{category:"highlyRelevant",samplingId:o.id,rule:e};break}case"costReduction":{const e=o.costReductionRules.find(e=>e.ruleId===r);if(e)return{category:"costReduction",samplingId:o.id,rule:e};break}}return null}function fe(e,t){const r=de(e,t.samplingId,t.rule.ruleId,t.category);return r?{...r,summary:pe(r.category,r.rule)}:null}function he(e,t){const r=de(e,t.samplingId,t.ruleId,t.category);return r?{...r,summary:pe(r.category,r.rule)}:null}function me(e){if(!e)return null;const t=(e.sources??[]).map(e=>`${e.namespace}/${e.kind}/${e.name}`).sort(),r=(e.namespaces??[]).slice().sort(),n=(e.languages??[]).slice().sort();return t.length||r.length||n.length?[t.join("|"),r.join("|"),n.join("|")].join("::"):null}function ve(e){return null==e?null:e}function ge(e,t){return JSON.stringify({sourceScopes:me(e),operation:ve(t)})}function ye(e,t,r,n){return JSON.stringify({sourceScopes:me(e),error:t??!1,durationAtLeastMs:(o=r,null==o?null:o),operation:ve(n)});var o}function xe(e,t){return JSON.stringify({sourceScopes:me(e),operation:ve(t)})}function ke(e,t,r,n){switch(t){case"noisy":{const t=ge(r.sourceScopes,r.operation);for(const r of e)for(const e of r.noisyOperations)if((!n||e.ruleId!==n)&&ge(e.sourceScopes,e.operation)===t)return e.ruleId;return null}case"highlyRelevant":{const t=ye(r.sourceScopes,r.error,r.durationAtLeastMs,r.operation);for(const r of e)for(const e of r.highlyRelevantOperations)if((!n||e.ruleId!==n)&&ye(e.sourceScopes,e.error,e.durationAtLeastMs,e.operation)===t)return e.ruleId;return null}case"costReduction":{const t=xe(r.sourceScopes,r.operation);for(const r of e)for(const e of r.costReductionRules)if((!n||e.ruleId!==n)&&xe(e.sourceScopes,e.operation)===t)return e.ruleId;return null}}}function Se(e){if(!e||!e.enabled)return[{text:"Auto rule is ",variant:X.Default},{text:"disabled",variant:X.Action}];return[{text:`Keep ${e.keepPercentage??0}%`,variant:X.Action},{text:" of ",variant:X.Default},{text:"traces for kubelet health probes in the entire cluster",variant:X.Scope}]}function Ae(e){return!0===e.error&&k(e.sourceScopes)&&!e.operation&&(null==e.percentageAtLeast||100===e.percentageAtLeast)}function Te(e){for(const t of e){const e=t.highlyRelevantOperations.find(Ae);if(e)return{rule:e,samplingId:t.id}}return null}function Pe(e){return!e||e.disabled?[{text:"Auto rule is ",variant:X.Default},{text:"disabled",variant:X.Action}]:[{text:"Keep all traces",variant:X.Action},{text:" of ",variant:X.Default},{text:"error traces across the entire cluster",variant:X.Scope}]}function Re(e){return k(e.sourceScopes)&&!e.operation}function be(e){for(const t of e){const e=t.costReductionRules.find(Re);if(e)return{rule:e,samplingId:t.id}}return null}function Me(e){return!e||e.disabled?[{text:" is ",variant:X.Default},{text:"disabled",variant:X.Action}]:[{text:`Keep at most ${e.percentageAtMost}%`,variant:X.Action},{text:" of ",variant:X.Default},{text:"traces across the entire cluster",variant:X.Scope}]}export{A,ue as B,q as C,ie as D,se as E,w as F,E as G,C as H,v as O,G as S,Me as a,Pe as b,g as c,Se as d,be as e,Te as f,T as g,ce as h,k as i,N as j,O as k,L as l,x as m,S as n,he as o,pe as p,Z as q,fe as r,ke as s,Y as t,y as u,F as v,Q as w,U as x,X as y,ne as z};
|