@odigos/ui-kit 0.0.235 → 0.0.237
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 +20 -0
- package/lib/chunks/{index-D6lL097V.js → index-92vqd713.js} +14 -14
- package/lib/chunks/{index-BmuiyBxZ.js → index-DB_UqHYt.js} +1 -1
- package/lib/chunks/index-zOzusnDO.js +77 -0
- package/lib/chunks/ui-components-CjDRcQJq.js +2235 -0
- package/lib/components/_v2/badge/index.d.ts +2 -2
- package/lib/components/_v2/cards/data-card/index.d.ts +7 -1
- package/lib/components/_v2/cli-command/index.d.ts +3 -0
- package/lib/components/_v2/condition/index.d.ts +13 -2
- package/lib/components/_v2/segment/index.d.ts +2 -1
- package/lib/components/data-card/data-card-fields/index.d.ts +0 -1
- package/lib/components/index.d.ts +0 -20
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/overview/search/builder.d.ts +1 -1
- package/lib/containers/_v2/overview/search/index.d.ts +0 -1
- package/lib/containers/index.d.ts +0 -32
- package/lib/containers/source-drawer/index.d.ts +1 -1
- package/lib/containers/v2.js +55 -57
- package/lib/containers.js +19 -556
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks/useActionFormData.d.ts +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/index.d.ts +0 -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.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-pkD-mO1h.js +0 -77
- package/lib/chunks/ui-components-B4It5sfa.js +0 -2696
- package/lib/components/auto-complete-input/index.d.ts +0 -22
- package/lib/components/data-finger/index.d.ts +0 -12
- package/lib/components/docs-button/index.d.ts +0 -8
- package/lib/components/header/index.d.ts +0 -8
- package/lib/components/icon-title-badge/index.d.ts +0 -11
- package/lib/components/icons-nav/index.d.ts +0 -17
- package/lib/components/input-list/index.d.ts +0 -13
- package/lib/components/input-table/index.d.ts +0 -13
- package/lib/components/input-table/map-columns-to-fields/index.d.ts +0 -15
- package/lib/components/input-table/types.d.ts +0 -15
- package/lib/components/interactive-table/index.d.ts +0 -27
- package/lib/components/interactive-table/table-row.d.ts +0 -13
- package/lib/components/key-value-input-list/index.d.ts +0 -20
- package/lib/components/monitors-checkboxes/index.d.ts +0 -13
- package/lib/components/navigation-buttons/index.d.ts +0 -16
- package/lib/components/section-title/index.d.ts +0 -12
- package/lib/components/segment/index.d.ts +0 -17
- package/lib/components/selection-button/index.d.ts +0 -17
- package/lib/components/stepper/index.d.ts +0 -11
- package/lib/components/tag/index.d.ts +0 -9
- package/lib/components/textarea/index.d.ts +0 -8
- package/lib/components/toggle/index.d.ts +0 -12
- package/lib/components/trace-loader/index.d.ts +0 -6
- package/lib/containers/action-drawer/build-card.d.ts +0 -3
- package/lib/containers/action-drawer/index.d.ts +0 -8
- package/lib/containers/action-form/custom-fields/add-cluster-info.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/delete-attributes.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/error-sampler.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/index.d.ts +0 -7
- package/lib/containers/action-form/custom-fields/k8s-attributes.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/latency-sampler.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/pii-masking.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/probabilistic-sampler.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/rename-attributes.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/service-name-sampler.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/span-attribute-sampler.d.ts +0 -5
- package/lib/containers/action-form/custom-fields/url-templatization.d.ts +0 -5
- package/lib/containers/action-form/index.d.ts +0 -11
- package/lib/containers/action-modal/index.d.ts +0 -7
- package/lib/containers/action-table/build-spec-cell.d.ts +0 -3
- package/lib/containers/action-table/index.d.ts +0 -7
- package/lib/containers/await-pipeline/index.d.ts +0 -4
- package/lib/containers/data-flow/column/add.d.ts +0 -8
- package/lib/containers/data-flow/column/base.d.ts +0 -21
- package/lib/containers/data-flow/column/frame.d.ts +0 -10
- package/lib/containers/data-flow/column/head.d.ts +0 -15
- package/lib/containers/data-flow/column/index.d.ts +0 -13
- package/lib/containers/data-flow/column/namespace-divider.d.ts +0 -7
- package/lib/containers/data-flow/column/source-visual-state.d.ts +0 -9
- package/lib/containers/data-flow/index.d.ts +0 -12
- package/lib/containers/data-flow-actions-menu/add-entity/index.d.ts +0 -4
- package/lib/containers/data-flow-actions-menu/data-stream-select/index.d.ts +0 -9
- package/lib/containers/data-flow-actions-menu/filters/index.d.ts +0 -4
- package/lib/containers/data-flow-actions-menu/index.d.ts +0 -9
- package/lib/containers/data-flow-actions-menu/search/index.d.ts +0 -6
- package/lib/containers/data-flow-actions-menu/search/search-results/builder.d.ts +0 -25
- package/lib/containers/data-flow-actions-menu/search/search-results/index.d.ts +0 -6
- package/lib/containers/data-flow-actions-menu/styled.d.ts +0 -10
- package/lib/containers/data-stream-drawer/index.d.ts +0 -10
- package/lib/containers/data-stream-form/index.d.ts +0 -11
- package/lib/containers/data-stream-modal/index.d.ts +0 -7
- package/lib/containers/data-stream-selection-form/index.d.ts +0 -13
- package/lib/containers/destination-drawer/build-card.d.ts +0 -3
- package/lib/containers/destination-drawer/index.d.ts +0 -10
- package/lib/containers/destination-form/dynamic-fields/index.d.ts +0 -10
- package/lib/containers/destination-form/index.d.ts +0 -15
- package/lib/containers/destination-form/test-connection/index.d.ts +0 -12
- package/lib/containers/destination-modal/choose-destination/destinations-list/index.d.ts +0 -10
- package/lib/containers/destination-modal/choose-destination/index.d.ts +0 -11
- package/lib/containers/destination-modal/index.d.ts +0 -13
- package/lib/containers/destination-selection-form/destination-list/index.d.ts +0 -8
- package/lib/containers/destination-selection-form/index.d.ts +0 -12
- package/lib/containers/destination-table/index.d.ts +0 -9
- package/lib/containers/dropdowns/condition-dropdown/index.d.ts +0 -15
- package/lib/containers/dropdowns/error-dropdown/index.d.ts +0 -16
- package/lib/containers/dropdowns/index.d.ts +0 -7
- package/lib/containers/dropdowns/kind-dropdown/index.d.ts +0 -15
- package/lib/containers/dropdowns/language-dropdown/index.d.ts +0 -15
- package/lib/containers/dropdowns/monitor-dropdown/index.d.ts +0 -13
- package/lib/containers/dropdowns/namespace-dropdown/index.d.ts +0 -15
- package/lib/containers/dropdowns/pods-agent-injection-status-dropdown/index.d.ts +0 -16
- package/lib/containers/instrumentation-rule-drawer/build-card.d.ts +0 -3
- package/lib/containers/instrumentation-rule-drawer/index.d.ts +0 -8
- package/lib/containers/instrumentation-rule-form/custom-fields/code-attributes.d.ts +0 -5
- package/lib/containers/instrumentation-rule-form/custom-fields/custom-instrumentation.d.ts +0 -5
- package/lib/containers/instrumentation-rule-form/custom-fields/headers-collection.d.ts +0 -5
- package/lib/containers/instrumentation-rule-form/custom-fields/index.d.ts +0 -7
- package/lib/containers/instrumentation-rule-form/custom-fields/payload-collection.d.ts +0 -5
- package/lib/containers/instrumentation-rule-form/index.d.ts +0 -11
- package/lib/containers/instrumentation-rule-modal/index.d.ts +0 -7
- package/lib/containers/instrumentation-rule-table/build-spec-cell.d.ts +0 -3
- package/lib/containers/instrumentation-rule-table/index.d.ts +0 -7
- package/lib/containers/multi-source-control/index.d.ts +0 -10
- package/lib/containers/setup-summary/index.d.ts +0 -10
- package/lib/containers/side-nav/index.d.ts +0 -16
- package/lib/containers/slack-invite/index.d.ts +0 -4
- package/lib/containers/source-modal/index.d.ts +0 -8
- package/lib/containers/source-selection-form/index.d.ts +0 -16
- package/lib/containers/source-selection-form/source-list/index.d.ts +0 -8
- package/lib/containers/source-table/index.d.ts +0 -9
- package/lib/containers/system-overview/describe/index.d.ts +0 -11
- package/lib/containers/system-overview/index.d.ts +0 -7
- package/lib/containers/system-overview/tokens/expires-at.d.ts +0 -6
- package/lib/containers/system-overview/tokens/index.d.ts +0 -8
- package/lib/containers/system-overview/tokens/token-actions.d.ts +0 -7
- package/lib/containers/table-cell-conditions/index.d.ts +0 -8
- package/lib/containers/toggle-dark-mode/index.d.ts +0 -2
- package/lib/containers/trace-view/build-spans.d.ts +0 -2
- package/lib/containers/trace-view/index.d.ts +0 -9
- package/lib/containers/trace-view/span/index.d.ts +0 -38
- package/lib/containers/trace-view/span-drawer/build-details-card.d.ts +0 -3
- package/lib/containers/trace-view/span-drawer/build-logs-card.d.ts +0 -3
- package/lib/containers/trace-view/span-drawer/build-process-card.d.ts +0 -3
- package/lib/containers/trace-view/span-drawer/build-tags-card.d.ts +0 -3
- package/lib/containers/trace-view/span-drawer/index.d.ts +0 -9
- package/lib/snippets/edit-button/index.d.ts +0 -7
- package/lib/snippets/note-back-to-summary/index.d.ts +0 -6
package/lib/contexts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{dp as ActionFormContextProvider,dQ as DataStreamFormContextProvider,dn as DestinationFormContextProvider,gH as OdigosProvider,dq as RuleFormContextProvider,b1 as SamplingRuleFormType,bN as SamplingRulesFormProvider,dm as SourceInstrumentFormContextProvider,gI as StorybookProvider,dk as checkVersionSupport,aG as useActionFormContext,a_ as useDataStreamFormContext,aK as useDestinationFormContext,ak as useOdigos,aX as useRuleFormContext,b0 as useSamplingRulesFormContext,bu as useSourceInstrumentFormContext,gJ as useStorybook}from"./chunks/ui-components-CjDRcQJq.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"virtua";
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{fS as capitalizeFirstLetter,fT as cleanObjectEmptyStringsValues,aJ as compareCondition,a0 as deepClone,dJ as entityIdKey,dO as filterActions,dN as filterDestinations,bE as filterDestinationsByStream,dM as filterSources,am as filterSourcesByStream,fU as flattenObjectKeys,dK as formatBytes,fV as formatDuration,g as generateId,bB as getActionIcon,q as getConditionsBooleans,at as getContainersIcons,fW as getContainersInstrumentedCount,fX as getDeepValue,bj as getDestinationIcon,fY as getDetectedLanguageIcons,dA as getEntityIcon,by as getEntityId,dG as getEntityIdKey,dz as getEntityLabel,fZ as getIdFromSseTarget,bI as getInstrumentationRuleIcon,f_ as getMainContainerLanguage,f$ as getMetricForEntity,g0 as getMonitorIcon,g1 as getPlatformIcon,g2 as getPlatformLabel,aZ as getProgrammingLanguageIcon,g3 as getRecursiveValues,p as getSourceLanguageIcons,g4 as getSseTargetFromId,g5 as getStatusColor,dU as getStatusFromPodStatus,l as getStatusIcon,U as getStatusTypeFromOdigosHealth,g6 as getValueForRange,o as getVirtualServiceIcon,ao as getWorkloadId,bF as getYamlFieldsForDestination,W as hasUnhealthyInstances,aA as isEmpty,g7 as isLegalK8sLabel,b$ as isOverTime,a1 as isStringABoolean,g8 as isTimeElapsed,g9 as isValidVersion,ga as mapConditions,bD as mapDestinationFieldsForDisplay,aN as mapExportedSignals,aO as mapSupportedSignals,gb as numbersOnly,a2 as parseBooleanFromString,gc as parseJsonStringToPrettyString,aP as prepareDestinationFormData,gd as removeEmptyValuesFromObject,bk as safeJsonParse,ge as safeJsonStringify,gf as setDeepValue,gg as sleep,O as splitCamelString,gh as stringifyNonStringValues,gi as trimVersion}from"./chunks/ui-components-CjDRcQJq.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"virtua";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Action, type ActionFormData } from '@/types';
|
|
2
2
|
export declare const useActionFormData: () => {
|
|
3
3
|
formData: ActionFormData;
|
|
4
|
-
formErrors: Partial<Record<"
|
|
4
|
+
formErrors: Partial<Record<"disabled" | "type" | "name" | "notes" | "signals" | "fields", string>>;
|
|
5
5
|
handleFormChange: (key?: string | undefined, val?: any, obj?: ActionFormData | undefined) => void;
|
|
6
6
|
resetFormData: (overrideForm?: ActionFormData | undefined) => void;
|
|
7
7
|
validateForm: (params?: {
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{gA as IGNORE_OUTSIDE_CLICK_ATTR,gB as useActionFormData,gC as useBodyScroll,dy as useClickNode,h as useClickNotification,dL as useContainerSize,u as useCopy,gD as useDataStreamFormData,gE as useDestinationFormData,bC as useGenericForm,gF as useInstrumentationRuleFormData,z as useKeyDown,dv as useOnClickOutside,d as usePopup,ev as useScrollTo,dx as useSessionStorage,an as useSourceFormData,gG as useSourceSelectionFormData,f as useTimeAgo}from"./chunks/ui-components-CjDRcQJq.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"virtua";
|
package/lib/snippets/index.d.ts
CHANGED
package/lib/snippets/v2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as ActionType,
|
|
1
|
+
export{A as ActionType,dT as Actions,c4 as ColoredSpan,fa as ColoredSpanVariant,dS as RichTitle}from"../chunks/ui-components-CjDRcQJq.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-92vqd713.js";export{Y as YamlSectionCard}from"../chunks/index-DB_UqHYt.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"virtua";
|
package/lib/snippets.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{gK as AddButton,X as CopyText,w as Flow,gL as MapItemNode,gM as NoDataNode,Z as PodContainer,ar as SourceContainer}from"./chunks/ui-components-CjDRcQJq.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"virtua";
|
package/lib/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{bv as ProgressKeys,v as useActiveNodeStore,gv as useDarkMode,al as useDataStreamStore,y as useDrawerStore,t as useEntityStore,dt as useFilterStore,dB as useModalStore,c as useNotificationStore,bt as useProgressStore,dD as useSelectedStore,dP as useSetupStore}from"./chunks/ui-components-CjDRcQJq.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"virtua";
|
package/lib/theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{gw as Provider,gx as animations,gy as opacity,gz as palettes}from"./chunks/ui-components-CjDRcQJq.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"virtua";
|
package/lib/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{ft as ActionCategory,au as ActionKeyTypes,aF as ActionType,fu as AddNodeTypes,fv as BooleanOperation,aQ as CodeAttributesKeyTypes,i as Crud,aV as CustomInstrumentationsKeyTypes,dF as DesiredStateProgress,fw as DestinationTypes,fx as EdgeTypes,E as EntityTypes,aE as FieldTypes,aT as GolangCustomProbe,aR as HeadersCollectionKeyTypes,az as InputTypes,fy as InstallationMethod,aW as InstrumentationRuleType,fz as IntrumentationStatus,aU as JavaCustomProbe,fA as JsonOperation,aC as K8sAttributesFrom,ap as K8sResourceKind,fB as ListDirection,m as NodeTypes,fC as NumberOperation,fD as OtelDistroName,fE as OtherEntityTypes,R as OtherStatus,bo as OtherStatusType,aS as PayloadCollectionKeyTypes,fF as PlatformType,fG as PodContainerLifecycleStatus,fH as PodContainerStatus,fI as PodPhase,fJ as Profile,ae as ProgrammingLanguages,fK as SIGNAL_KEY_TO_TYPE,fL as SIGNAL_TYPE_TO_KEY,fM as SignalKey,aM as SignalType,fN as SortDirection,S as StatusType,fO as StringOperation,bp as Tier,dW as WorkloadRolloutStatus}from"./chunks/ui-components-CjDRcQJq.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"virtua";
|
package/lib/visuals.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{fP as VISUAL_ODIGOS_LOGO_HEIGHT,fQ as VISUAL_ODIGOS_LOGO_WIDTH,fs as VisualGreenRings,fR as VisualOdigosLogo,ce as VisualPurpleRings}from"./chunks/ui-components-CjDRcQJq.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"virtua";
|
package/package.json
CHANGED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as t,jsx as n}from"react/jsx-runtime";import{forwardRef as i,useState as o,useRef as l,useImperativeHandle as r,useEffect as a,useLayoutEffect as s,useMemo as c,useCallback as d,Fragment as u,Children as h}from"react";import f,{useTheme as m}from"styled-components";import{c as p,d as g,T as v,e as y,f as b,h as x,i as w,E as S,I as k,F as $,j as C,k as T,l as z,m as I,B as N,a as F,n as P,o as E,p as O,q as R,S as L,r as D,s as M,P as A,t as B,v as W,b as X,L as V,w as Y,N as j,x as H,y as _,z as U,G as J,H as K,J as Z,O as G,K as q,M as Q,Q as ee,R as te,U as ne,V as ie,W as oe,X as le,Y as re,Z as ae,_ as se,g as ce,$ as de,a0 as ue,a1 as he,a2 as fe,a3 as me,a4 as pe,a5 as ge,a6 as ve,a7 as ye,a8 as be,a9 as xe,aa as we,ab as Se,ac as ke,ad as $e}from"./ui-components-B4It5sfa.js";import{EditIcon as Ce,TrashIcon as Te,SearchIcon as ze,MinusIcon as Ie,PlusIcon as Ne,XIcon as Fe,ExpandIcon as Pe,CopyIcon as Ee,DotIcon as Oe,DownloadIcon as Re,RefreshIcon as Le,RefreshLeftArrowIcon as De}from"../icons.js";import{Y as Me}from"./index-BmuiyBxZ.js";const Ae=i(({children:i,width:a=640,title:s,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:h,isEdit:f=!1,isFormDirty:k=!1,isLastItem:$=!1,onClose:C,onEdit:T,onSave:z,onDelete:I,onCancel:N,tabs:F,headerActionButtons:P},E)=>{const O=m(),{drawerType:R,setDrawerType:L,setDrawerEntityId:D}=p();g({key:"Enter",active:f},()=>J());const[M,A]=o(!1),[B,W]=o(!1),X=l(null),V=R===S.Source,Y=()=>{A(!1),W(!1)},j=()=>{Y(),T&&T(!1),L(null),D(null),C?.()};r(E,()=>({closeDrawer:j}));const H=()=>{X.current?.clearTitle(),N&&N(),Y()},_=()=>{const e=X.current?.isTitleDirty();k||e?W(!0):H()},U=()=>{A(!0)},J=()=>{z&&z(X.current?.getTitle()||"")},K=P||[];return T&&!f&&K.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>T(!0),children:e(t,{children:[n(Ce,{}),n(v,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),I&&!f&&K.push({"data-id":"drawer-delete",variant:"tertiary",onClick:U,children:e(t,{children:[n(Te,{}),n(v,{color:O.text.error,size:14,family:"secondary",decoration:"underline",children:V?y.UNINSTRUMENT:y.DELETE})]})}),e(t,{children:[n(b,{isOpen:!0,onClose:f?_:j,closeOnEscape:!M&&!B,width:"number"==typeof a?`${a+64}px`:a,header:{icons:u,iconSrcs:h,title:s,titleTooltip:c,replaceTitleWith:!d&&f?n(Be,{ref:X,title:s}):void 0,actionButtons:K,tabs:F},footer:{isOpen:f,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:J,children:y.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:_,children:y.CANCEL}],rightButtons:I?[{"data-id":"drawer-delete",variant:"tertiary",onClick:U,children:e(t,{children:[n(Te,{}),n(v,{size:14,color:O.text.error,family:"secondary",decoration:"underline",children:y.DELETE})]})}]:[]},children:i}),n(x,{isOpen:M,noOverlay:!0,name:`${R}${s?` (${s})`:""}`,type:R,isLastItem:$,onApprove:()=>{I&&I(),Y()},onDeny:Y}),n(w,{isOpen:B,noOverlay:!0,name:"edit mode",onApprove:H,onDeny:Y})]})}),Be=i(({title:e},t)=>{const[i,l]=o(e);return a(()=>{l(e)},[e]),r(t,()=>({getTitle:()=>i||e,isTitleDirty:()=>i!==e,clearTitle:()=>l(e)})),n(k,{"data-id":"title",value:i,onChange:e=>l(e.target.value)})});function We(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function Xe(e){const t=Math.abs(e);return t>=1e9?`${Ve(e/1e9)}s`:t>=1e6?`${Ve(e/1e6)}ms`:t>=1e3?`${Ve(e/1e3)}μs`:String(Math.round(e))}function Ve(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Ye(e){const t=[];for(let n=0;n<e.levels.length;n++){const i=e.levels[n];let o=0;for(let e=0;e+3<i.length;e+=4){const l=i[e],r=i[e+1],a=i[e+2],s=i[e+3],c=o+l;t.push({level:n,offset:c,size:r,self:a,nameIndex:s}),o=c+r}}return t}function je(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function He(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function _e(e,t,n,i,o,l={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:r=null,shouldKeepName:a,collapseRecursive:s=!1}=l,c=Ye(e);let d=r?function(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),i=new Map;for(const t of e){const e=i.get(t.level);e?e.push(t):i.set(t.level,[t])}const o=[t];for(let e=t.level+1;e<=n;e++){const t=o.filter(t=>t.level===e-1);if(0===t.length)break;const n=i.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){o.push(e);break}}return o}(c,r):c;if(0===d.length)return null;if(a&&(d=d.filter(t=>a(We(e,t.nameIndex))),0===d.length))return null;if(s&&(d=function(e,t){if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),i=new Map;for(const e of n){const t=i.get(e.level);t?t.push(e):i.set(e.level,[e])}const o=new Set;for(const t of n){const n=i.get(t.level+1);if(!n)continue;const l=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==l.length)continue;const r=l[0];r.size===t.size&&We(e,r.nameIndex)===We(e,t.nameIndex)&&o.add(je(r))}if(0===o.size)return n;const l=[];for(const e of n){if(o.has(je(e)))continue;let t=0;for(let n=0;n<e.level;n++){const l=i.get(n);if(!l)continue;const r=l.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);r&&o.has(je(r))&&t++}l.push({...e,level:e.level-t})}return l}(e,d),0===d.length))return null;const u=r?.level??0,h=r?.offset??0,f=r?.size??e.numTicks;if(f<=0)return null;const m=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,p=i??Number.POSITIVE_INFINITY,g=Math.max(1,Math.min(n/m,p)),v=o.trim(),y=g>8?1:0;return d.map(n=>{const i=n.level-u,o=(n.offset-h)/f*t,l=Math.max(n.size/f*t,1),r=i*g,a=Math.max(g-y,1),s=We(e,n.nameIndex);return{...n,x:o,y:r,w:l,h:a,name:s,matchesSearch:He(s,v)}})}function Ue(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const i=t.v2.colors.black[500],o=[{fill:t.v2.colors.purple[300],text:i},{fill:t.v2.colors.green[300],text:i},{fill:t.v2.colors.red[300],text:i},{fill:t.v2.colors.blue[300],text:i},{fill:t.v2.colors.yellow[300],text:i}];return o[n%o.length]}Be.displayName=Be.name,Ae.displayName=Ae.name;var Je,Ke;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Je||(Je={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Ke||(Ke={}));function Ze(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Ge(e,t,n){for(const i of n)if(e>=i.x&&e<i.x+i.w&&t>=i.y&&t<i.y+i.h)return i;return null}function qe(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Qe=({flamebearer:t,maxRowPx:i,searchQuery:r="",shouldKeepName:u,minHostHeight:h=200,onFullscreenChange:f,profilingSlots:p})=>{const g=m(),v=l(null),y=l(null),b=l({x:0,y:0}),x=l(t.numTicks),[w,S]=o({w:0,h:0}),[k,A]=o(""),[B,W]=o(null),[X,V]=o([]),[Y,j]=o(!1),[H,_]=o(Je.Fit),[U,J]=o(Ke.Fit),[K,Z]=o(!1),G=Math.max(1,Math.min(Math.floor(w.w*H),8192)),q=Math.max(1,Math.min(Math.floor(w.h*U),8192)),Q=X.length>0?X[X.length-1]:null,ee=Q?.size??t.numTicks;a(()=>{x.current!==t.numTicks&&(x.current=t.numTicks,V([]))},[t.numTicks]),s(()=>{const e=v.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();S({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),a(()=>{if(!Y)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[Y]),a(()=>(f?.(Y),()=>{Y&&f?.(!1)}),[Y,f]);const te=c(()=>_e(t,G,q,i,r,{zoomRoot:Q,shouldKeepName:u,collapseRecursive:K}),[t,i,r,q,G,Q,u,K]),ne=c(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(te?.length?r.trim()?te.filter(e=>e.matchesSearch):te:[]),[te,r]),ie=d(e=>{if(G<2||q<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=Ge((e.clientX-n.left)/n.width*G,(e.clientY-n.top)/n.height*q,ne);if(i){const e=je(i);W(e);const n=ee>0?(100*i.size/ee).toFixed(1):"0",o=t.numTicks>0?(100*i.size/t.numTicks).toFixed(1):"0";A(`${i.name}\ntotal ${Xe(i.size)} (${n}% of view, ${o}% of profile) · self ${Xe(i.self)}`)}else W(null),A("")},[ne,t.numTicks,q,G,ee]),oe=d(e=>{ie(e)},[ie]),le=d(()=>{W(null),A("")},[]),re=d(e=>{b.current={x:e.clientX,y:e.clientY}},[]),ae=d(e=>{const{x:t,y:n}=b.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(G<2||q<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=Ge((e.clientX-i.left)/i.width*G,(e.clientY-i.top)/i.height*q,ne);if(!o)return;const l=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(o);V(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(l,t)?e.slice(0,-1):[...e,l]})},[ne,q,G]);s(()=>{const e=y.current;if(!e||G<2||q<2)return;const n="undefined"!=typeof window&&window.devicePixelRatio||1,i=Math.max(G,q),o=Math.min(n,16384/i);e.width=Math.floor(G*o),e.height=Math.floor(q*o),e.style.width=`${G}px`,e.style.height=`${q}px`;const l=e.getContext("2d");l&&(l.setTransform(o,0,0,o,0,0),l.clearRect(0,0,G,q),te?.length?function(e,t,n,i,o,l,r,a){const s=l.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=o.trim().length>0;e.textRendering="optimizeLegibility";for(const t of i){const{x:n,y:i,w:o,h:r,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:h,text:f}=Ue(s,l);e.fillStyle=h,e.fillRect(n,i,o,r),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,i+.5),e.lineTo(n+o-.5,i+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,i+.5,Math.max(o-1,0),Math.max(r-1,0));const m=Ze(d,a),p=`${s} (${Xe(d)}, ${m}%)`,g=l.v2.text.size.xs,v=8,y=5,b=26,x=Math.min(g,Math.floor(r-2));if(o>=b&&x>=v){e.font=`${x}px ${l.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=p;for(;t.length>2&&e.measureText(t).width>o-2*y;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*y&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+y,i+r/2),e.fillStyle=f,e.fillText(t,n+y,i+r/2))}}if(r)for(const t of i){if(je(t)!==r)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:i,w:o,h:l}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,i+1,Math.max(o-2,0),Math.max(l-2,0));break}}(l,G,q,te,r,g,B,t.numTicks):(l.fillStyle=g.v2.colors.silver[900],l.fillRect(0,0,G,q)))},[te,t.numTicks,B,r,q,G,g]);const se=d(()=>j(e=>!e),[]),ce=t.numTicks>0?Math.max(0,Math.min(100,Math.round(ee/t.numTicks*100))):100,de=c(()=>function(e,t){const n=Ye(e),i=t?.offset??0,o=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let a=null;for(const e of n)e.level<l||e.offset<i||e.offset+e.size>o||e.size>=r||(!a||e.size>a.size||e.size===a.size&&e.level<a.level)&&(a=e);return a}(t,Q),[t,Q]),ue=null!==de,he=X.length>0,fe=Q?We(t,Q.nameIndex):"",me=d(()=>V([]),[]),pe=d(()=>V(e=>e.slice(0,-1)),[]),ge=d(()=>{de&&V(e=>[...e,de])},[de]);return e("div",{style:Y?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:g.v2.colors.silver[900]}:{flex:1,minHeight:h,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e($,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[n(C,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:z.Left,size:T.S,value:K,onChange:Z}),e($,{$gap:8,children:[e($,{children:[n(I,{variant:F.Secondary,size:N.S,label:"Reset zoom",leftIcon:ze,onClick:me,disabled:!X.length}),n(I,{variant:F.Secondary,size:N.S,iconSize:20,leftIcon:Ie,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!he,onClick:pe}),n("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:n(P,{size:O.XXS,color:E.Secondary,nowrap:!0,align:"center",children:`${ce}%`})}),n(I,{variant:F.Secondary,size:N.S,iconSize:20,leftIcon:Ne,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ue,onClick:ge})]}),e($,{children:[n(R,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:n(L,{size:M.S,variant:D.Filled,options:[{value:Je.Fit,label:"W: Fit"},{value:Je.X10,label:"10x"}],selected:H,setSelected:_})}),n(R,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:n(L,{size:M.S,variant:D.Filled,options:[{value:Ke.Fit,label:"H: Fit"},{value:Ke.X10,label:"10x"}],selected:U,setSelected:J})})]}),n(I,{variant:F.Secondary,size:N.S,iconSize:24,leftIcon:Y?Fe:Pe,tooltip:Y?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:se})]})]}),n(R,{fullWidth:!0,keepAlive:!0,text:k,children:n("div",{ref:v,style:{flex:1,minWidth:0,width:"100%",height:Y?"calc(100vh - 80px)":"calc(100vh - 370px)",position:"relative",overflowX:H>1?"auto":"hidden",overflowY:U>1?"auto":"hidden"},children:n("div",{style:{width:G||"100%",height:q||"100%",position:"relative"},children:n("canvas",{ref:y,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:B?"pointer":"default"},onPointerDown:re,onPointerMove:oe,onPointerLeave:le,onClick:ae})})})}),e($,{$justifyContent:"space-between",children:[n(P,Q?{size:O.XXXS,color:g.v2.colors.silver[300],children:`Zoomed: ${fe} • ${Xe(ee)} samples in view`}:{size:O.XXXS,color:g.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),p&&n(P,{size:O.XXXS,color:g.v2.colors.silver[300],children:`${p.activeKeys.length} / ${p.maxSlots} profiling slots · ${qe(p.totalBytesUsed)} / ${qe(p.maxTotalBytesBudget)} budget · TTL ${p.slotTtlSeconds}s`})]})]})};var et,tt;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(et||(et={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(tt||(tt={}));const nt=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function it(e,t){const n=function(e){return e.split(" ")[0]??""}(e);if(t.includes(tt.FilterOutVoid)&&"void"===n)return!1;if(t.includes(tt.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==n&&nt.test(n)))return!1}return!0}const ot={options:[{id:tt.FilterOutVoid,label:"Filter out void symbols"},{id:tt.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>it(e.cells.find(e=>e.key===et.Symbol)?.rawValue?.toString()??"",t)},lt=({rows:e,languages:t,filters:i,onFiltersChange:o})=>{const l=c(()=>[{key:et.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:t?.includes(A.Java)?ot:void 0,noFilter:!t?.includes(A.Java)},{key:et.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:et.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[t]),r=c(()=>e.map(e=>({cells:[{key:et.Symbol,rawValue:e.name},{key:et.Self,rawValue:Xe(e.self)},{key:et.Total,rawValue:Xe(e.total)}]})),[e]);return n(B,{variant:W.Data,maxHeight:"calc(100vh - 306px)",columns:l,rows:r,filters:i,onFiltersChange:o,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Ee,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var rt;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(rt||(rt={}));const at=f(_)`
|
|
2
|
-
width: 100%;
|
|
3
|
-
min-height: 0;
|
|
4
|
-
flex: 1;
|
|
5
|
-
border-radius: 16px;
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
8
|
-
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
9
|
-
`,st=f.div`
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
gap: 10px;
|
|
13
|
-
flex-wrap: wrap;
|
|
14
|
-
padding: 12px 12px 8px;
|
|
15
|
-
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
16
|
-
border-radius: 16px 16px 0 0;
|
|
17
|
-
`,ct=f($)`
|
|
18
|
-
flex-shrink: 0;
|
|
19
|
-
align-items: center;
|
|
20
|
-
gap: 4px;
|
|
21
|
-
`,dt=f.div`
|
|
22
|
-
display: flex;
|
|
23
|
-
flex: 1;
|
|
24
|
-
align-items: stretch;
|
|
25
|
-
gap: ${({$gap:e})=>e}px;
|
|
26
|
-
padding: 16px;
|
|
27
|
-
min-height: 0;
|
|
28
|
-
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
29
|
-
border-radius: 0 0 16px 16px;
|
|
30
|
-
`,ut=f(_)`
|
|
31
|
-
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
32
|
-
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
33
|
-
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
34
|
-
min-width: 0;
|
|
35
|
-
min-height: 0;
|
|
36
|
-
gap: 10px;
|
|
37
|
-
`,ht=f(_)`
|
|
38
|
-
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
39
|
-
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
40
|
-
min-width: 0;
|
|
41
|
-
min-height: 0;
|
|
42
|
-
gap: 10px;
|
|
43
|
-
`,ft=f($)`
|
|
44
|
-
width: 100%;
|
|
45
|
-
min-height: 32px;
|
|
46
|
-
flex-shrink: 0;
|
|
47
|
-
`,mt=({source:t,fetchProfilingSlots:i,enableProfiling:r,fetchSourceProfiling:s,onFlameFullscreenChange:h})=>{const f=m(),p=c(()=>({namespace:t.namespace,kind:t.kind,name:t.name}),[t.namespace,t.kind,t.name]),[g,v]=o(!0),[y,b]=o(null),[x,w]=o(null),[S,k]=o(0),[B,W]=o(rt.Both),[_,U]=o(""),[J,K]=o({}),Z=l(null),G=d(async()=>{try{const e=[i()];g&&e.push(s(p));const[t,n]=await Promise.all(e);t&&b(t),n?.profileJson&&w(n.profileJson)}finally{k(e=>e+1)}},[i,s,p]);a(()=>{let e=!1;return(async()=>{await r(p),e||(await G(),e||(Z.current=setInterval(G,3e3)))})(),()=>{e=!0,Z.current&&clearInterval(Z.current)}},[r,G,p]);const q=c(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),n=t.flamebearer;return!n?.names?.length||!Array.isArray(n.levels)||"number"!=typeof n.numTicks||n.numTicks<=0?null:{flamebearer:n,units:t.metadata?.units}}catch{return null}}(x),[x]),Q=c(()=>q?function(e){const t=new Map;for(let n=0;n<e.levels.length;n++){const i=e.levels[n];for(let n=0;n+3<i.length;n+=4){const o=i[n+1],l=i[n+2],r=We(e,i[n+3]);if(!r)continue;const a=t.get(r);(!a||o>a.total)&&t.set(r,{self:l,total:o})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(q.flamebearer):[],[q]),ee=c(()=>{const e=_.trim().toLowerCase();return e?Q.filter(t=>t.name.toLowerCase().includes(e)):Q},[Q,_]),te=B===rt.Table||B===rt.Both,ne=B===rt.Flame||B===rt.Both,ie=te&&ne,oe=t.detectedLanguages||t.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),le=c(()=>function(e,t){if(!t?.includes(A.Java))return;const n=e?.[et.Symbol]?.filter(Boolean)??[];return 0!==n.length?e=>it(e,n):void 0}(J,oe),[J,oe]);return S<2?n(X,{$height:"70vh",children:n(V,{withSpinner:!0})}):e(at,{$gap:0,$width:"100%",children:[e(st,{children:[n(R,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:n(ct,{children:n(P,{size:O.S,weight:500,color:E.Primary,nowrap:!0,children:"CPU Profiling"})})}),e($,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[n("div",{style:{flex:"1 1 220px",minWidth:180},children:n(Y,{value:_,onChange:U,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:f.v2.colors.silver[900],emphasizeBackgroundColor:f.v2.colors.silver[800]})}),n(L,{size:M.S,variant:D.Filled,options:[{value:rt.Table,label:"Top table"},{value:rt.Flame,label:"Flame graph"},{value:rt.Both,label:"Both"}],selected:B,setSelected:W}),n(I,g?{variant:F.Secondary,size:N.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>n(Oe,{...e,size:8,fill:f.v2.colors.green[500]})}:{variant:F.Secondary,size:N.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>n(Oe,{...e,size:8,fill:f.v2.colors.red[500]})})]})]}),n(dt,{$gap:te&&ne?16:0,children:q?e(u,{children:[te&&e(ut,{$splitWithFlame:ie,children:[n(ft,{$justifyContent:"flex-end",children:n(I,{variant:F.Secondary,size:N.S,label:"Download snapshot",rightIcon:Re,onClick:()=>{if(!x)return;const e=new Blob([x],{type:"application/json"}),n=URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download=`cpu-profile-${t.namespace}-${t.kind}-${t.name}.json`,i.click(),URL.revokeObjectURL(n)},disabled:!x})}),n(lt,{rows:ee,languages:oe,filters:J,onFiltersChange:K})]}),ne&&e(ht,{$splitWithTable:ie,children:[e(ft,{$justifyContent:"space-between",children:[n(H,{label:q?`Total in view ${Xe(q.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:f.v2.colors.silver[750],textColor:f.v2.colors.silver[200],textSize:O.XXS}),e($,{$gap:12,children:[!g&&n(I,{variant:F.Secondary,size:N.S,label:"Refresh",leftIcon:Le,onClick:G}),n(C,{label:"Auto refresh",labelAlign:z.Left,size:T.S,value:g,onChange:v})]})]}),n(Qe,{flamebearer:q.flamebearer,maxRowPx:24,searchQuery:_,shouldKeepName:le,minHostHeight:280,onFullscreenChange:h,profilingSlots:y},B)]})]}):n(X,{children:n(j,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},pt=(e,t)=>{const{name:n,kind:i,namespace:o}=e,l=[{title:U.KIND,value:i},{title:U.NAME,value:n,tooltip:"Resource name"}];return t||(l.unshift({title:U.NAMESPACE,value:o}),l.push({type:J.Divider}),l.push({type:J.CopyText,value:`kubectl get ${i} ${n} -n ${o}`.toLowerCase()})),l},gt=f.div`
|
|
48
|
-
display: flex;
|
|
49
|
-
flex-direction: column;
|
|
50
|
-
gap: 24px;
|
|
51
|
-
padding: 4px;
|
|
52
|
-
`,vt=({formData:e,handleFormChange:t})=>n(gt,{children:n(k,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:e.otelServiceName,onChange:({target:{value:e}})=>t("otelServiceName",e)})}),yt=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const t=q(e?.status),i=K(e?.reasonEnum),o=e?.message;return n($,{$alignItems:"center",$justifyContent:"center",children:n(Z,{status:t,title:i,subtitle:o,withBackground:t!==G.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},bt=({source:t,fetchSourceDescribe:i,onClickRestartPod:l})=>{const[r,s]=o(!1),[c,d]=o(null);return a(()=>{t&&i({namespace:t.namespace,name:t.name,kind:t.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):s(!0)})},[t.namespace,t.name,t.kind]),c||r?n(_,{$gap:12,children:r?n(X,{$height:"70vh",children:n(ee,{subTitle:"Could not fetch describe for this source"})}):c?.pods?.length?c.pods.map(({podName:i,nodeName:o,phase:r,agentInjected:a,runningLatestWorkloadRevision:s,containers:d,manifestYAML:u})=>{const f=r.status!==te.Success||ne(d)?te.Error:te.Success,m=[];return m.push(n(ie,{value:`kubectl get pod ${i.value} -n ${c?.namespace?.value||t.namespace}`.toLowerCase()},"copy-text")),m.push(n(oe,{length:"100%",margin:"0"},"divider-1")),m.push(n(le,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-1")),m.push(n(oe,{length:"100%",margin:"0"},"divider-2")),m.push(n(le,{title:r.name,tooltip:r.explain||"",value:{status:r.status||void 0,text:r.value}},"describe-row-2")),m.push(n(oe,{length:"100%",margin:"0"},"divider-3")),m.push(n(le,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-3")),m.push(n(oe,{length:"100%",margin:"0"},"divider-4")),s?.name&&(m.push(n(le,{title:s.name,tooltip:s.explain||void 0,value:{status:s.status||void 0,text:s.value}},"describe-row-4")),m.push(n(oe,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{m.push(n(re,{...e},`pod-container-${e.containerName.value}`))}),u&&(m.push(n(oe,{length:"100%",margin:"0"},"divider-6")),m.push(n(Me,{yaml:u},"yaml-section-card"))),n(ae,{title:`Pod: ${i.value}`,withExtend:!0,action:({hovered:o})=>e("div",{style:{position:"relative"},children:[n(Z,{status:f,title:f,withIcon:!0,withBorder:!0},"status"),o&&n(se,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:l?[{id:ce(),label:"Restart",rightIcon:Le,onClick:()=>l(c?.namespace?.value||t.namespace,i.value)}]:[]},"hover-actions")]}),children:h.toArray(m)},`pod-${i.value}`)}):n(X,{$height:"70vh",children:n(ee,{subTitle:"Check if you have any running pods and try again"})})}):n(X,{$height:"70vh",children:n(Q,{})})},xt=f($)`
|
|
53
|
-
width: 100%;
|
|
54
|
-
align-items: center;
|
|
55
|
-
justify-content: space-between;
|
|
56
|
-
`,wt=({source:t,fetchSourceLibraries:i})=>{const l=m(),[r,s]=o(!1),[c,d]=o(null);return a(()=>{t&&i({namespace:t.namespace,name:t.name,kind:t.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(de(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[t.namespace,t.name,t.kind]),c||r?n(_,{$gap:12,children:r?n(X,{$height:"70vh",children:n(ee,{subTitle:"Could not fetch libraries for this source"})}):c?.length?n(ae,{title:"Instrumented Libraries",children:c.map(({name:t,healthy:i,message:o,nonIdentifyingAttributes:r},a)=>e(u,{children:[e(_,{$gap:4,$width:"100%",children:[e(xt,{$width:"100%",children:[n(v,{size:12,color:l.text.grey,children:t}),e($,{$gap:4,children:[r.map(({key:e,value:i})=>he(i)&&fe(i)&&"is_standard_lib"===e?n(Z,{status:te.Default,title:"STANDARD",withBorder:!0},`${t}-${e}`):null),"boolean"==typeof i&&n(Z,{status:i?te.Success:te.Error,title:i?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),o&&n(v,{size:10,color:l.text.error,align:"right",children:o})]}),a!==c.length-1&&n(oe,{length:"100%",margin:"0"})]},`library-${t}`))}):e(X,{$height:"70vh",$gap:12,children:[n(ee,{title:"No libraries found",subTitle:""}),n(ue,{type:te.Warning,message:"This feature is in early development, and has very limited support"})]})}):n(X,{$height:"70vh",children:n(Q,{})})},St="70vh",kt=(e,t)=>e.serviceName.localeCompare(t.serviceName),$t=f(v)`
|
|
57
|
-
cursor: ${({$clickable:e})=>e?"pointer":"default"};
|
|
58
|
-
text-decoration: ${({$clickable:e})=>e?"underline":"none"};
|
|
59
|
-
&:hover {
|
|
60
|
-
opacity: ${({$clickable:e})=>e?.7:1};
|
|
61
|
-
}
|
|
62
|
-
`,Ct=f($)`
|
|
63
|
-
justify-content: flex-end;
|
|
64
|
-
align-items: center;
|
|
65
|
-
gap: 6px;
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
`,Tt=({items:i,emptyMessage:o,keyPrefix:l,findSource:r,onNavigate:a})=>{const s=m();return i.length?n(t,{children:i.map(({serviceName:t},o)=>{const c=!!r(t);return e(u,{children:[n($t,{size:13,color:c?s.text.secondary:s.text.grey,$clickable:c,onClick:()=>a(t),children:t}),o!==i.length-1&&n(oe,{length:"100%",margin:"0"})]},`${l}-${t}`)})}):n(v,{size:13,color:s.text.grey,children:o})},zt=({source:t,fetchPeerSources:i})=>{const l=m(),{setDrawerType:r,setDrawerEntityId:s}=p(),c=me(e=>e.sources),[u,h]=o(!1),[f,g]=o(!1),[y,b]=o(null),x=t.otelServiceName||t.name,w=d(()=>{x&&(g(!0),h(!1),i(x).then(({data:e})=>{e?.peerSources?b(e.peerSources):h(!0)}).finally(()=>g(!1)))},[x]);a(()=>{w()},[w]);const k=d(e=>c.find(t=>t.otelServiceName===e||t.name===e),[c]),$=d(e=>{const t=k(e);t&&(r(S.Source),s({namespace:t.namespace,name:t.name,kind:t.kind}))},[k,r,s]);if(!y&&!u&&f)return n(X,{$height:St,children:n(Q,{})});if(u)return n(X,{$height:St,children:n(ee,{subTitle:"Could not fetch peer sources"})});const C=y?.inbound?[...y.inbound].sort(kt):[],T=y?.outbound?[...y.outbound].sort(kt):[];return e(_,{$gap:12,children:[n(ae,{title:"Inbound",titleBadge:C.length,description:`Services that send requests to ${x}`,children:n(Tt,{items:C,emptyMessage:"No inbound connections",keyPrefix:"inbound",findSource:k,onNavigate:$})}),n(ae,{title:"Outbound",titleBadge:T.length,description:`Services that ${x} sends requests to`,children:n(Tt,{items:T,emptyMessage:"No outbound connections",keyPrefix:"outbound",findSource:k,onNavigate:$})}),e(Ct,{onClick:w,children:[n(Le,{size:14}),n(v,{size:12,color:l.text.grey,decoration:"underline",children:"Refresh"})]})]})};var It;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries",e.PeerSources="Peer Sources",e.Profiling="Profiling"}(It||(It={}));const Nt=[xe.Deployment,xe.StatefulSet,xe.DaemonSet,xe.DeploymentConfig,xe.Rollout,xe.StaticPod],Ft=[xe.Deployment,xe.StatefulSet,xe.DaemonSet,xe.DeploymentConfig,xe.Rollout,xe.Pod],Pt=[A.Python,A.Go,A.Java],Et=f.div`
|
|
68
|
-
width: 100%;
|
|
69
|
-
height: 100%;
|
|
70
|
-
max-height: calc(100vh - 220px);
|
|
71
|
-
overflow: overlay;
|
|
72
|
-
overflow-y: auto;
|
|
73
|
-
`,Ot=f.div`
|
|
74
|
-
display: flex;
|
|
75
|
-
flex-direction: column;
|
|
76
|
-
gap: 12px;
|
|
77
|
-
`;var Rt;!function(e){e.Workload="Workload",e.Pod="Pod"}(Rt||(Rt={}));const Lt=({persistSources:i,updateSource:r,restartWorkloads:s,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:h,fetchPeerSources:f,restartPod:m,recoverFromRollback:g,profilingEnabled:y,fetchProfilingSlots:b,enableProfiling:x,fetchSourceProfiling:w})=>{const{isVm:k}=pe(),$=me(e=>e.sources),{selectedStreamName:C}=ge(),{drawerType:T,drawerEntityId:z}=p(),I=c(()=>ve($,C),[$,C]),N=l(null),F=T===S.Source,[P,E]=o(!1),[O,R]=o(!1),[L,D]=o(It.Overview),[M,A]=o(null),[B,W]=o(!1);a(()=>{F&&z&&d(z).then(e=>A(e||null))},[F,z]);const{formData:X,handleFormChange:V,resetFormData:Y,loadFormWithDrawerItem:j}=ye(),H=c(()=>{if(z)return M&&JSON.stringify(be(M))===JSON.stringify(be(z))?M:I?.find(e=>JSON.stringify(be(e))===JSON.stringify(be(z)))},[z,I,M]);a(()=>{F&&H?j(H):Y()},[F,H]);const _=c(()=>{const e=H?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===G.Loading,containers:H?.containers||[]}},[H]),J=c(()=>!!H?.rollbackOccurred,[H?.rollbackOccurred]),K=c(()=>{const e=[{label:It.Overview,onClick:()=>D(It.Overview),selected:L===It.Overview}];return k||(Nt.includes(H?.kind)&&e.push({label:It.Pods,onClick:()=>D(It.Pods),selected:L===It.Pods}),H?.containers?.some(e=>Pt.includes(e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language))&&e.push({label:It.Libraries,onClick:()=>D(It.Libraries),selected:L===It.Libraries}),e.push({label:It.PeerSources,onClick:()=>D(It.PeerSources),selected:L===It.PeerSources}),y&&b&&x&&w&&e.push({label:It.Profiling,onClick:()=>D(It.Profiling),selected:L===It.Profiling})),e},[L,H,k,y,b,x,w]),Z=Ft.includes(H?.kind),[q,Q]=o({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});if(!H)return null;return e(Ae,{ref:N,width:B?"95vw":L===It.Profiling?"80vw":void 0,onClose:()=>{D(It.Overview),A(null),W(!1)},title:H.otelServiceName||H.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:$e(H.containers),isEdit:P,isFormDirty:O,onEdit:L===It.Overview?e=>{E("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=X.otelServiceName!==H.name?X.otelServiceName:"";V("otelServiceName",e),await r(z,{...X,otelServiceName:e}),A(null),R(!1),E(!1)},onDelete:L===It.Overview?async()=>{const{namespace:e,name:t,kind:n}=H;i({[e]:[{namespace:e,name:t,kind:n||void 0,selected:!1,currentStreamName:C}]}),A(null),R(!1),E(!1),N.current?.closeDrawer()}:void 0,onCancel:()=>{R(!1),E(!1),V("otelServiceName",H.otelServiceName||H.name||"")},isLastItem:1===I.length,tabs:K,headerActionButtons:k?[]:Z?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>Q({openFor:Rt.Workload,workloadId:z}),children:e(t,{children:[n(De,{}),n(v,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[L===It.Overview?P?n(Et,{children:n(vt,{formData:X,handleFormChange:(...e)=>{R(!0),V(...e),V("currentStreamName",C)}})}):e(Ot,{children:[n(yt,{workloadOdigosHealthStatus:H.workloadOdigosHealthStatus}),J&&n(ue,{type:te.Warning,message:U.ROLLBACK_OCCURRED_MESSAGE,action:{label:U.ROLLBACK_RECOVER,onClick:async()=>{await g(z);const e=await d(z);e&&A(e)}}}),n(we,{conditions:H.conditions||[]}),n(ae,{title:U.SOURCE_DETAILS,data:H?pt(H,k):[]}),n(ae,{title:k?U.DETECTED_PROCESSES:U.DETECTED_CONTAINERS,titleBadge:_.isLoading?G.Loading:_.containers.length,description:_.description||(k?U.DETECTED_PROCESSES_DESCRIPTION:U.DETECTED_CONTAINERS_DESCRIPTION),children:_.containers.map(e=>n(Se,{...e,callbackRuntimeOverride:e=>r(z,e)},`source-container-${e.containerName}`))}),H.manifestYAML&&n(Me,{title:`${H.kind} YAML`,yaml:H.manifestYAML,defaultOpen:!H.instrumentationConfigYAML}),H.instrumentationConfigYAML&&n(Me,{title:"Instrumentation Config YAML",yaml:H.instrumentationConfigYAML,defaultOpen:!H.manifestYAML})]}):L===It.Pods?n(bt,{source:H,fetchSourceDescribe:u,onClickRestartPod:Z?(e,t)=>Q({openFor:Rt.Pod,podNamespace:e,podName:t}):void 0}):L===It.Libraries?n(wt,{source:H,fetchSourceLibraries:h}):L===It.PeerSources?n(zt,{source:H,fetchPeerSources:f}):L===It.Profiling&&y&&b&&x&&w?n(mt,{source:H,fetchProfilingSlots:b,enableProfiling:x,fetchSourceProfiling:w,onFlameFullscreenChange:W}):null,n(ke,{isOpen:!!q.openFor,title:`Rollout Restart ${q.openFor}`,description:`Are you sure you want to rollout restart this ${q.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:te.Warning,onClick:()=>{q.openFor===Rt.Workload&&q.workloadId?s([q.workloadId]):q.openFor===Rt.Pod&&q.podNamespace&&q.podName&&m(q.podNamespace,q.podName),Q({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{Q({openFor:null})}}})]})};export{Ae as O,Lt as S,vt as a};
|