@odigos/ui-kit 0.0.217 → 0.0.219

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.
Files changed (109) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/lib/chunks/{index-eGTPcqRB.js → index-YIqbBRyO.js} +1 -1
  3. package/lib/chunks/ui-components-Dj10kYlT.js +2469 -0
  4. package/lib/components/_v2/autocomplete/index.d.ts +1 -0
  5. package/lib/components/_v2/button/index.d.ts +2 -0
  6. package/lib/components/_v2/cards/section-card/index.d.ts +1 -1
  7. package/lib/components/_v2/drawer/footer/index.d.ts +9 -0
  8. package/lib/components/_v2/drawer/index.d.ts +2 -0
  9. package/lib/components/_v2/hover-actions/index.d.ts +2 -0
  10. package/lib/components/_v2/note/index.d.ts +1 -0
  11. package/lib/components/_v2/radio/index.d.ts +1 -0
  12. package/lib/components/_v2/search/index.d.ts +6 -1
  13. package/lib/components/_v2/segment/index.d.ts +2 -1
  14. package/lib/components/_v2/table/index.d.ts +3 -1
  15. package/lib/components/_v2/table/styled.d.ts +2 -0
  16. package/lib/components/_v2/table/table-rows/index.d.ts +2 -1
  17. package/lib/components/_v2/table/types.d.ts +2 -0
  18. package/lib/components/styled.d.ts +3 -0
  19. package/lib/components/tooltip/index.d.ts +7 -0
  20. package/lib/components/v2.js +1 -1
  21. package/lib/components.js +1 -1
  22. package/lib/constants/index.d.ts +1 -0
  23. package/lib/constants/sampling/index.d.ts +87 -0
  24. package/lib/constants.js +1 -1
  25. package/lib/containers/_v2/_drawers/create-sampling-rule-drawer/index.d.ts +18 -4
  26. package/lib/containers/_v2/_drawers/edit-auto-rule-drawer/index.d.ts +7 -2
  27. package/lib/containers/_v2/_drawers/edit-cost-reduction-auto-rule-drawer/index.d.ts +7 -2
  28. package/lib/containers/_v2/_drawers/edit-highly-relevant-auto-rule-drawer/index.d.ts +6 -2
  29. package/lib/containers/_v2/_drawers/view-sampling-rule-drawer/index.d.ts +2 -4
  30. package/lib/containers/_v2/_forms/create-sampling-rule-form/context.d.ts +34 -0
  31. package/lib/containers/_v2/_forms/create-sampling-rule-form/index.d.ts +3 -0
  32. package/lib/containers/_v2/{_drawers/create-sampling-rule-drawer → _forms/create-sampling-rule-form}/sections/duration-errors.d.ts +1 -1
  33. package/lib/containers/_v2/{_drawers/create-sampling-rule-drawer → _forms/create-sampling-rule-form}/sections/operation.d.ts +1 -1
  34. package/lib/containers/_v2/{_drawers/create-sampling-rule-drawer → _forms/create-sampling-rule-form}/sections/percentage.d.ts +1 -1
  35. package/lib/containers/_v2/{_drawers/create-sampling-rule-drawer → _forms/create-sampling-rule-form}/sections/rule-info.d.ts +1 -1
  36. package/lib/containers/_v2/{_drawers/create-sampling-rule-drawer → _forms/create-sampling-rule-form}/sections/sampling-preview.d.ts +1 -1
  37. package/lib/containers/_v2/_forms/create-sampling-rule-form/styled.d.ts +5 -0
  38. package/lib/containers/_v2/{_drawers/create-sampling-rule-drawer → _forms/create-sampling-rule-form}/types.d.ts +1 -1
  39. package/lib/containers/_v2/_forms/edit-auto-rule-form/context.d.ts +21 -0
  40. package/lib/containers/_v2/_forms/edit-auto-rule-form/index.d.ts +3 -0
  41. package/lib/containers/_v2/_forms/edit-cost-reduction-auto-rule-form/context.d.ts +21 -0
  42. package/lib/containers/_v2/_forms/edit-cost-reduction-auto-rule-form/index.d.ts +3 -0
  43. package/lib/containers/_v2/_forms/edit-highly-relevant-auto-rule-form/context.d.ts +14 -0
  44. package/lib/containers/_v2/_forms/edit-highly-relevant-auto-rule-form/index.d.ts +3 -0
  45. package/lib/containers/_v2/_forms/index.d.ts +5 -0
  46. package/lib/containers/_v2/_forms/view-sampling-rule-form/context.d.ts +37 -0
  47. package/lib/containers/_v2/{_drawers/view-sampling-rule-drawer → _forms/view-sampling-rule-form}/footer.d.ts +3 -3
  48. package/lib/containers/_v2/_forms/view-sampling-rule-form/index.d.ts +3 -0
  49. package/lib/containers/_v2/{_drawers/view-sampling-rule-drawer → _forms/view-sampling-rule-form}/reverse-converters.d.ts +2 -2
  50. package/lib/containers/_v2/{_drawers/view-sampling-rule-drawer → _forms/view-sampling-rule-form}/sections/operation-details.d.ts +1 -1
  51. package/lib/containers/_v2/{_drawers/view-sampling-rule-drawer → _forms/view-sampling-rule-form}/sections/percentage.d.ts +1 -1
  52. package/lib/containers/_v2/{_drawers/view-sampling-rule-drawer → _forms/view-sampling-rule-form}/sections/rule-info.d.ts +1 -1
  53. package/lib/containers/_v2/{_drawers/view-sampling-rule-drawer → _forms/view-sampling-rule-form}/sections/sampling-preview.d.ts +2 -2
  54. package/lib/containers/_v2/index.d.ts +1 -2
  55. package/lib/containers/_v2/sampling-rules/auto-rule-card/index.d.ts +8 -0
  56. package/lib/containers/_v2/{sampling-rules-list → sampling-rules}/helpers.d.ts +23 -5
  57. package/lib/containers/_v2/sampling-rules/index.d.ts +3 -0
  58. package/lib/containers/_v2/sampling-rules/rules-table/index.d.ts +13 -0
  59. package/lib/containers/_v2/{sampling-rules-list/toolbar.d.ts → sampling-rules/toolbar/index.d.ts} +1 -1
  60. package/lib/containers/_v2/sampling-rules/types.d.ts +72 -0
  61. package/lib/containers/source-drawer/index.d.ts +5 -0
  62. package/lib/containers/source-drawer/profiling/flame-graph-canvas.d.ts +10 -0
  63. package/lib/containers/source-drawer/profiling/flamebearer.d.ts +70 -0
  64. package/lib/containers/source-drawer/profiling/index.d.ts +34 -0
  65. package/lib/containers/source-drawer/profiling/symbol-table.d.ts +6 -0
  66. package/lib/containers/v2.js +148 -341
  67. package/lib/containers.js +168 -120
  68. package/lib/contexts.js +1 -1
  69. package/lib/functions.js +1 -1
  70. package/lib/hooks/usePopup.d.ts +17 -1
  71. package/lib/hooks.js +1 -1
  72. package/lib/mock-data/index.d.ts +1 -0
  73. package/lib/mock-data/profiling/index.d.ts +10 -0
  74. package/lib/mock-data/service-map/index.d.ts +3 -1
  75. package/lib/snippets/_v2/colored-span/index.d.ts +16 -0
  76. package/lib/snippets/_v2/index.d.ts +1 -0
  77. package/lib/snippets/_v2/rich-title/index.d.ts +2 -2
  78. package/lib/snippets/v2.js +15 -17
  79. package/lib/snippets.js +1 -1
  80. package/lib/store.js +1 -1
  81. package/lib/theme.js +1 -1
  82. package/lib/types.js +1 -1
  83. package/lib/visuals.js +1 -1
  84. package/package.json +13 -13
  85. package/lib/chunks/ui-components-DaRAAytB.js +0 -2422
  86. package/lib/containers/_v2/_drawers/create-sampling-rule-drawer/constants.d.ts +0 -26
  87. package/lib/containers/_v2/_drawers/edit-auto-rule-drawer/constants.d.ts +0 -10
  88. package/lib/containers/_v2/_drawers/edit-auto-rule-drawer/types.d.ts +0 -8
  89. package/lib/containers/_v2/_drawers/edit-cost-reduction-auto-rule-drawer/constants.d.ts +0 -10
  90. package/lib/containers/_v2/_drawers/edit-cost-reduction-auto-rule-drawer/types.d.ts +0 -8
  91. package/lib/containers/_v2/_drawers/edit-highly-relevant-auto-rule-drawer/constants.d.ts +0 -6
  92. package/lib/containers/_v2/_drawers/edit-highly-relevant-auto-rule-drawer/types.d.ts +0 -6
  93. package/lib/containers/_v2/_drawers/view-sampling-rule-drawer/constants.d.ts +0 -19
  94. package/lib/containers/_v2/_drawers/view-sampling-rule-drawer/sections/styled.d.ts +0 -4
  95. package/lib/containers/_v2/_drawers/view-sampling-rule-drawer/types.d.ts +0 -1
  96. package/lib/containers/_v2/auto-rule-card/constants.d.ts +0 -1
  97. package/lib/containers/_v2/auto-rule-card/helpers.d.ts +0 -19
  98. package/lib/containers/_v2/auto-rule-card/index.d.ts +0 -5
  99. package/lib/containers/_v2/auto-rule-card/types.d.ts +0 -6
  100. package/lib/containers/_v2/sampling-rules-list/constants.d.ts +0 -23
  101. package/lib/containers/_v2/sampling-rules-list/index.d.ts +0 -6
  102. package/lib/containers/_v2/sampling-rules-list/rule-row.d.ts +0 -12
  103. package/lib/containers/_v2/sampling-rules-list/summary-span.d.ts +0 -10
  104. package/lib/containers/_v2/sampling-rules-list/types.d.ts +0 -47
  105. package/lib/containers/_v2/{_drawers/create-sampling-rule-drawer → _forms/create-sampling-rule-form}/converters.d.ts +0 -0
  106. package/lib/containers/_v2/{_drawers/create-sampling-rule-drawer → _forms/create-sampling-rule-form}/form-helpers.d.ts +0 -0
  107. package/lib/containers/_v2/{_drawers/create-sampling-rule-drawer → _forms/create-sampling-rule-form}/sections/source-scope.d.ts +1 -1
  108. /package/lib/containers/_v2/{_drawers/view-sampling-rule-drawer → _forms/view-sampling-rule-form}/sections/duration-errors.d.ts +0 -0
  109. /package/lib/containers/_v2/{_drawers/view-sampling-rule-drawer → _forms/view-sampling-rule-form}/sections/source-scopes.d.ts +0 -0
@@ -0,0 +1,37 @@
1
+ import React, { type FC } from 'react';
2
+ import type { ViewRuleData } from '../../sampling-rules/types';
3
+ import type { SamplingRuleFormState, DuplicateValidationResult } from '../create-sampling-rule-form/types';
4
+ interface ViewSamplingRuleFormContextType {
5
+ data: ViewRuleData | null;
6
+ isEditing: boolean;
7
+ formData: SamplingRuleFormState;
8
+ handleChange: (updates: Partial<SamplingRuleFormState>) => void;
9
+ handleEdit: () => void;
10
+ handleCancelEdit: () => void;
11
+ duplicateWarning: DuplicateValidationResult | null;
12
+ setDuplicateWarning: (warning: DuplicateValidationResult | null) => void;
13
+ sourceOptions: {
14
+ id: string;
15
+ label: string;
16
+ }[];
17
+ namespaceOptions: {
18
+ id: string;
19
+ label: string;
20
+ }[];
21
+ }
22
+ export interface ViewSamplingRuleFormContextProviderProps {
23
+ data: ViewRuleData | null;
24
+ defaultEditMode?: boolean;
25
+ sourceOptions?: {
26
+ id: string;
27
+ label: string;
28
+ }[];
29
+ namespaceOptions?: {
30
+ id: string;
31
+ label: string;
32
+ }[];
33
+ children: React.ReactNode;
34
+ }
35
+ export declare const ViewSamplingRuleFormContextProvider: FC<ViewSamplingRuleFormContextProviderProps>;
36
+ export declare const useViewSamplingRuleFormContext: () => ViewSamplingRuleFormContextType;
37
+ export {};
@@ -1,4 +1,4 @@
1
- import { type FC } from 'react';
1
+ import type { FooterProps } from '@/components/_v2/drawer/footer';
2
2
  interface ViewFooterProps {
3
3
  isEditing: false;
4
4
  onDelete: () => void;
@@ -16,6 +16,6 @@ interface EditFooterProps {
16
16
  onDelete: () => void;
17
17
  duplicateWarning?: DuplicateWarningInfo | null;
18
18
  }
19
- export type DrawerFooterProps = ViewFooterProps | EditFooterProps;
20
- export declare const DrawerFooter: FC<DrawerFooterProps>;
19
+ export type ViewDrawerFooterProps = ViewFooterProps | EditFooterProps;
20
+ export declare function buildViewDrawerFooter(props: ViewDrawerFooterProps): FooterProps;
21
21
  export {};
@@ -0,0 +1,3 @@
1
+ import { type FC } from 'react';
2
+ export * from './context';
3
+ export declare const ViewSamplingRuleForm: FC;
@@ -1,3 +1,3 @@
1
- import type { ViewRuleData } from './types';
2
- import type { SamplingRuleFormState } from '../create-sampling-rule-drawer/types';
1
+ import type { ViewRuleData } from '../../sampling-rules/types';
2
+ import type { SamplingRuleFormState } from '../create-sampling-rule-form/types';
3
3
  export declare function viewRuleDataToFormState(data: ViewRuleData): SamplingRuleFormState;
@@ -1,5 +1,5 @@
1
1
  import { type FC } from 'react';
2
- import type { ViewRuleData } from '../types';
2
+ import type { ViewRuleData } from '../../../sampling-rules/types';
3
3
  export interface OperationDetailsProps {
4
4
  data: ViewRuleData;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { type FC } from 'react';
2
- import type { ViewRuleData } from '../types';
2
+ import type { ViewRuleData } from '../../../sampling-rules/types';
3
3
  export interface PercentageProps {
4
4
  data: ViewRuleData;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { type FC } from 'react';
2
- import type { ViewRuleData } from '../types';
2
+ import type { ViewRuleData } from '../../../sampling-rules/types';
3
3
  export interface RuleInfoProps {
4
4
  data: ViewRuleData;
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import { type FC } from 'react';
2
- import type { SummaryPart } from '../../../sampling-rules-list/types';
2
+ import { type ColoredSpanPart } from '@/snippets/_v2/colored-span';
3
3
  export interface SamplingPreviewProps {
4
- summary: SummaryPart[];
4
+ summary: ColoredSpanPart[];
5
5
  }
6
6
  export declare const SamplingPreview: FC<SamplingPreviewProps>;
@@ -1,8 +1,7 @@
1
1
  export * from './_drawers';
2
2
  export * from './_forms';
3
- export * from './auto-rule-card';
4
3
  export * from './central-connections';
5
4
  export * from './onboarding';
6
5
  export * from './pipeline-collectors';
7
- export * from './sampling-rules-list';
6
+ export * from './sampling-rules';
8
7
  export * from './settings';
@@ -0,0 +1,8 @@
1
+ import { type FC } from 'react';
2
+ import { ColoredSpanPart } from '@/snippets/_v2/colored-span';
3
+ export interface AutoRuleCardProps {
4
+ title: string;
5
+ summary: ColoredSpanPart[];
6
+ onEdit: () => void;
7
+ }
8
+ export declare const AutoRuleCard: FC<AutoRuleCardProps>;
@@ -1,5 +1,6 @@
1
1
  import type { NoisyOperationRule, HighlyRelevantOperationRule, CostReductionRule, SourcesScopeInput, HeadSamplingOperationMatcher, TailSamplingOperationMatcher, SamplingRules } from '@/types';
2
- import type { SamplingRuleItem, SamplingRuleCategory, SummaryPart, HighlyRelevantBadgeType, ViewRuleData } from './types';
2
+ import { type ColoredSpanPart } from '@/snippets/_v2/colored-span';
3
+ import type { SamplingRuleItem, SamplingRuleCategory, HighlyRelevantBadgeType, ViewRuleData } from './types';
3
4
  export declare enum SamplingCategory {
4
5
  Noisy = "noisy",
5
6
  HighlyRelevant = "highly-relevant",
@@ -13,12 +14,12 @@ export declare const SAMPLING_SEGMENT_OPTIONS: {
13
14
  export declare const SAMPLING_CATEGORY_NOTES: Record<SamplingCategory, string>;
14
15
  export declare const SAMPLING_CATEGORY_LIST_TITLES: Record<SamplingCategory, string>;
15
16
  export declare const CATEGORY_TO_RULE_CATEGORY: Record<SamplingCategory, SamplingRuleCategory>;
16
- export declare function buildNoisySummary(rule: NoisyOperationRule): SummaryPart[];
17
- export declare function buildHighlyRelevantSummary(rule: HighlyRelevantOperationRule): SummaryPart[];
18
- export declare function buildCostReductionSummary(rule: CostReductionRule): SummaryPart[];
17
+ export declare function buildNoisySummary(rule: NoisyOperationRule): ColoredSpanPart[];
18
+ export declare function buildHighlyRelevantSummary(rule: HighlyRelevantOperationRule): ColoredSpanPart[];
19
+ export declare function buildCostReductionSummary(rule: CostReductionRule): ColoredSpanPart[];
19
20
  export declare function getHighlyRelevantTypeBadge(rule: HighlyRelevantOperationRule): HighlyRelevantBadgeType;
20
21
  export declare function buildSamplingRuleItems(groups: SamplingRules[], category: SamplingCategory, excludeRuleIds?: Set<string>): SamplingRuleItem[];
21
- export declare function buildSummaryForRule(category: SamplingRuleCategory, rule: NoisyOperationRule | HighlyRelevantOperationRule | CostReductionRule): SummaryPart[];
22
+ export declare function buildSummaryForRule(category: SamplingRuleCategory, rule: NoisyOperationRule | HighlyRelevantOperationRule | CostReductionRule): ColoredSpanPart[];
22
23
  export declare function refreshViewRuleData(groups: SamplingRules[], current: ViewRuleData): ViewRuleData | null;
23
24
  export declare function lookupViewRuleData(groups: SamplingRules[], item: SamplingRuleItem): ViewRuleData | null;
24
25
  export interface DuplicateCheckInput {
@@ -28,3 +29,20 @@ export interface DuplicateCheckInput {
28
29
  durationAtLeastMs?: number | null;
29
30
  }
30
31
  export declare function findDuplicateRuleId(groups: SamplingRules[], category: SamplingRuleCategory, input: DuplicateCheckInput, excludeRuleId?: string): string | null;
32
+ export interface K8sHealthProbesConfig {
33
+ enabled: boolean | null;
34
+ keepPercentage: number | null;
35
+ }
36
+ export declare function buildAutoRuleSummary(config: K8sHealthProbesConfig | null): ColoredSpanPart[];
37
+ export interface HighlyRelevantAutoRuleMatch {
38
+ rule: HighlyRelevantOperationRule;
39
+ samplingId: string;
40
+ }
41
+ export declare function findHighlyRelevantAutoRule(groups: SamplingRules[]): HighlyRelevantAutoRuleMatch | null;
42
+ export declare function buildHighlyRelevantAutoRuleSummary(rule: HighlyRelevantOperationRule | null): ColoredSpanPart[];
43
+ export interface CostReductionAutoRuleMatch {
44
+ rule: CostReductionRule;
45
+ samplingId: string;
46
+ }
47
+ export declare function findCostReductionAutoRule(groups: SamplingRules[]): CostReductionAutoRuleMatch | null;
48
+ export declare function buildCostReductionAutoRuleSummary(rule: CostReductionRule | null): ColoredSpanPart[];
@@ -0,0 +1,3 @@
1
+ import { type FC } from 'react';
2
+ import type { SamplingRulesProps } from './types';
3
+ export declare const SamplingRules: FC<SamplingRulesProps>;
@@ -0,0 +1,13 @@
1
+ import { type FC, type CSSProperties } from 'react';
2
+ import type { SamplingRuleItem } from '../types';
3
+ export interface RulesTableProps {
4
+ title: string;
5
+ items: SamplingRuleItem[];
6
+ isLoading: boolean;
7
+ showTypeFilter: boolean;
8
+ tableRowsMaxHeight: CSSProperties['maxHeight'];
9
+ onRuleClick: (item: SamplingRuleItem) => void;
10
+ onEditRule: (ruleId: string, samplingId: string) => void;
11
+ onDeleteRule: (ruleId: string, samplingId: string) => void;
12
+ }
13
+ export declare const RulesTable: FC<RulesTableProps>;
@@ -1,5 +1,5 @@
1
1
  import { type FC } from 'react';
2
- import type { TypeFilter } from './types';
2
+ import type { TypeFilter } from '../types';
3
3
  export interface ListToolbarProps {
4
4
  title: string;
5
5
  titleTooltip?: string;
@@ -0,0 +1,72 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { ColoredSpanPart } from '@/snippets/_v2';
3
+ import type { CostReductionRuleInput, HighlyRelevantOperationRuleInput, NoisyOperationRule, HighlyRelevantOperationRule, CostReductionRule, NoisyOperationRuleInput, SamplingRules, WorkloadId } from '@/types';
4
+ export type SamplingRuleCategory = 'noisy' | 'highlyRelevant' | 'costReduction';
5
+ export type HighlyRelevantBadgeType = 'Relevance' | 'Duration' | 'Error';
6
+ export interface SamplingRuleItem {
7
+ ruleId: string;
8
+ samplingId: string;
9
+ name: string | null;
10
+ disabled: boolean;
11
+ notes: string | null;
12
+ summary: ColoredSpanPart[];
13
+ category: SamplingRuleCategory;
14
+ typeBadge?: HighlyRelevantBadgeType;
15
+ }
16
+ export type TypeFilter = 'all' | HighlyRelevantBadgeType;
17
+ export interface SamplingRulesListProps {
18
+ title: string;
19
+ titleTooltip?: string;
20
+ items: SamplingRuleItem[];
21
+ isLoading?: boolean;
22
+ showTypeFilter?: boolean;
23
+ onRuleClick: (item: SamplingRuleItem) => void;
24
+ onEditRule: (ruleId: string, samplingId: string) => void;
25
+ onDeleteRule: (ruleId: string, samplingId: string) => void;
26
+ }
27
+ interface BaseViewRule {
28
+ samplingId: string;
29
+ summary: ColoredSpanPart[];
30
+ }
31
+ interface ViewNoisyRule extends BaseViewRule {
32
+ category: Extract<SamplingRuleCategory, 'noisy'>;
33
+ rule: NoisyOperationRule;
34
+ }
35
+ interface ViewHighlyRelevantRule extends BaseViewRule {
36
+ category: Extract<SamplingRuleCategory, 'highlyRelevant'>;
37
+ rule: HighlyRelevantOperationRule;
38
+ }
39
+ interface ViewCostReductionRule extends BaseViewRule {
40
+ category: Extract<SamplingRuleCategory, 'costReduction'>;
41
+ rule: CostReductionRule;
42
+ }
43
+ export type ViewRuleData = ViewNoisyRule | ViewHighlyRelevantRule | ViewCostReductionRule;
44
+ export interface SamplingRulesSelectOption {
45
+ id: string;
46
+ label: string;
47
+ }
48
+ /** Matches effective k8s health-probes sampling config from the API. */
49
+ export interface SamplingRulesK8sHealthConfig {
50
+ enabled: boolean | null;
51
+ keepPercentage: number | null;
52
+ }
53
+ export interface SamplingRulesProps {
54
+ workloads: {
55
+ id: WorkloadId;
56
+ }[];
57
+ samplingRules: SamplingRules[];
58
+ k8sHealthProbesConfig: SamplingRulesK8sHealthConfig | null;
59
+ loading: boolean;
60
+ tableRowsMaxHeight: CSSProperties['maxHeight'];
61
+ fetchSamplingRules: () => void;
62
+ createNoisyOperationRule: (samplingId: string, rule: NoisyOperationRuleInput) => void;
63
+ updateNoisyOperationRule: (samplingId: string, ruleId: string, rule: NoisyOperationRuleInput) => void;
64
+ createHighlyRelevantOperationRule: (samplingId: string, rule: HighlyRelevantOperationRuleInput) => void;
65
+ updateHighlyRelevantOperationRule: (samplingId: string, ruleId: string, rule: HighlyRelevantOperationRuleInput) => void;
66
+ createCostReductionRule: (samplingId: string, rule: CostReductionRuleInput) => void;
67
+ updateCostReductionRule: (samplingId: string, ruleId: string, rule: CostReductionRuleInput) => void;
68
+ deleteSamplingRule: (samplingId: string, ruleId: string, category: SamplingRuleCategory) => void;
69
+ updateK8sHealthProbesConfig: (enabled: boolean, keepPercentage: number) => void;
70
+ docsUrl?: string;
71
+ }
72
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { type FC } from 'react';
2
+ import { type ProfilingProps } from './profiling';
2
3
  import { type DescribeProps } from './describe';
3
4
  import { type LibrariesProps } from './libraries';
4
5
  import { type PeerSourcesProps } from './peers';
@@ -13,6 +14,10 @@ interface SourceDrawerProps {
13
14
  fetchSourceDescribe: DescribeProps['fetchSourceDescribe'];
14
15
  fetchSourceLibraries: LibrariesProps['fetchSourceLibraries'];
15
16
  fetchPeerSources: PeerSourcesProps['fetchPeerSources'];
17
+ fetchProfilingSlots?: ProfilingProps['fetchProfilingSlots'];
18
+ enableProfiling?: ProfilingProps['enableProfiling'];
19
+ releaseProfiling?: ProfilingProps['releaseProfiling'];
20
+ fetchSourceProfiling?: ProfilingProps['fetchSourceProfiling'];
16
21
  }
17
22
  declare const SourceDrawer: FC<SourceDrawerProps>;
18
23
  export { SourceDrawer, type SourceDrawerProps };
@@ -0,0 +1,10 @@
1
+ import { type FC } from 'react';
2
+ import type { Flamebearer } from './flamebearer';
3
+ export interface FlameGraphCanvasProps {
4
+ flamebearer: Flamebearer;
5
+ maxRowPx?: number;
6
+ /** Non-empty: only stack frames whose name contains the query are drawn (case-insensitive). */
7
+ searchQuery?: string;
8
+ minHostHeight?: number;
9
+ }
10
+ export declare const FlameGraphCanvas: FC<FlameGraphCanvasProps>;
@@ -0,0 +1,70 @@
1
+ /** Pyroscope single-format profile (`flamebearer` + `metadata`) as returned by profiling APIs. */
2
+ import type { DefaultTheme } from 'styled-components';
3
+ export interface Flamebearer {
4
+ /** Usually `string[]`; some APIs use objects per symbol — see `flameNameAt`. */
5
+ names: string[];
6
+ levels: number[][];
7
+ numTicks: number;
8
+ maxSelf?: number;
9
+ }
10
+ /** Resolve a flamebearer symbol index to display text (handles string or common object shapes from APIs). */
11
+ export declare function flameNameAt(fb: Pick<Flamebearer, 'names'>, nameIndex: number): string;
12
+ export interface ParsedFlameProfile {
13
+ flamebearer: Flamebearer;
14
+ units?: string;
15
+ }
16
+ export interface SymbolTableRow {
17
+ name: string;
18
+ self: number;
19
+ total: number;
20
+ }
21
+ export declare function parseFlameProfileJson(raw: string | null): ParsedFlameProfile | null;
22
+ /** One table row per symbol: keep the occurrence with the widest bar (largest cumulative total). */
23
+ export declare function buildSymbolTableRows(fb: Flamebearer): SymbolTableRow[];
24
+ export declare function formatSampleCount(n: number): string;
25
+ export interface FlameRect {
26
+ level: number;
27
+ offset: number;
28
+ size: number;
29
+ self: number;
30
+ nameIndex: number;
31
+ }
32
+ export declare function flattenFlameRects(fb: Flamebearer): FlameRect[];
33
+ /** Stable identity for a frame in the raw flamebearer (for zoom stack + hit-test). */
34
+ export declare function flameRectKey(r: Pick<FlameRect, 'level' | 'offset' | 'size' | 'nameIndex'>): string;
35
+ export declare function flameRectsEqual(a: FlameRect, b: FlameRect): boolean;
36
+ /**
37
+ * All frames in the subtree under `root` (pprof-style “zoom into this frame”).
38
+ * Parent/child follows horizontal containment on adjacent levels, matching merged flame graphs.
39
+ */
40
+ export declare function collectSubtreeFlameRects(all: FlameRect[], root: FlameRect): FlameRect[];
41
+ export declare function flameBarMatchesSearch(name: string, query: string): boolean;
42
+ /** Pixel layout for one flame bar (canvas + hit testing). */
43
+ export type FlameLayoutBar = {
44
+ level: number;
45
+ offset: number;
46
+ size: number;
47
+ self: number;
48
+ nameIndex: number;
49
+ x: number;
50
+ y: number;
51
+ w: number;
52
+ h: number;
53
+ name: string;
54
+ matchesSearch: boolean;
55
+ };
56
+ /**
57
+ * @param zoomRoot When set, layout only that frame’s subtree and scale the X axis to its cumulative size (click-to-zoom, same idea as pprof’s pivot).
58
+ */
59
+ export declare function computeFlameLayout(fb: Flamebearer, cw: number, ch: number, maxRowPx: number | undefined, searchQuery: string, zoomRoot?: FlameRect | null): FlameLayoutBar[] | null;
60
+ /** Deepest stack frames first so hit tests prefer narrow children over parents. */
61
+ export declare function sortFlameBarsDeepestFirst<T extends {
62
+ level: number;
63
+ }>(bars: T[]): T[];
64
+ export interface FlameBarColors {
65
+ fill: string;
66
+ /** Label color on the bar (dark fills → light text, light fills → dark text). */
67
+ text: string;
68
+ }
69
+ /** Stable brand palette (purple / teal / pink from theme) per symbol name. */
70
+ export declare function flameColorsForName(name: string, theme: DefaultTheme): FlameBarColors;
@@ -0,0 +1,34 @@
1
+ import { type FC } from 'react';
2
+ import type { Source } from '@/types';
3
+ interface SourceIdentifier {
4
+ namespace: string;
5
+ kind: string;
6
+ name: string;
7
+ }
8
+ interface ProfilingSlots {
9
+ activeKeys: string[];
10
+ keysWithData: string[];
11
+ totalBytesUsed: number;
12
+ slotMaxBytes: number;
13
+ maxSlots: number;
14
+ maxTotalBytesBudget: number;
15
+ slotTtlSeconds: number;
16
+ }
17
+ interface SourceProfilingResult {
18
+ profileJson: string;
19
+ }
20
+ interface EnableOrReleaseProfilingResult {
21
+ status: string;
22
+ sourceKey: string;
23
+ maxSlots?: number;
24
+ activeSlots?: number;
25
+ }
26
+ export interface ProfilingProps {
27
+ source: Source;
28
+ fetchProfilingSlots: () => Promise<ProfilingSlots | undefined>;
29
+ enableProfiling: (source: SourceIdentifier) => Promise<EnableOrReleaseProfilingResult | undefined>;
30
+ releaseProfiling: (source: SourceIdentifier) => Promise<EnableOrReleaseProfilingResult | undefined>;
31
+ fetchSourceProfiling: (source: SourceIdentifier) => Promise<SourceProfilingResult | undefined>;
32
+ }
33
+ export declare const Profiling: FC<ProfilingProps>;
34
+ export {};
@@ -0,0 +1,6 @@
1
+ import { type FC } from 'react';
2
+ import { type SymbolTableRow } from './flamebearer';
3
+ export interface SymbolTableProps {
4
+ rows: SymbolTableRow[];
5
+ }
6
+ export declare const SymbolTable: FC<SymbolTableProps>;