@galaxy-io/filament-ui 0.11.0 → 0.13.0
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/dist/api/queries/constants.d.ts +1 -0
- package/dist/api/queries/constants.js +2 -1
- package/dist/api/queries/pipelines.d.ts +15 -0
- package/dist/api/queries/pipelines.js +13 -12
- package/dist/api/queries/runs.d.ts +1 -1
- package/dist/api/queries/runs.js +8 -11
- package/dist/api/queries/webhooks.d.ts +61 -0
- package/dist/api/queries/webhooks.js +41 -0
- package/dist/api/utils.d.ts +1 -0
- package/dist/api/utils.js +3 -1
- package/dist/components/connections/ConnectorPreviewChip.js +4 -3
- package/dist/components/webhooks/WebhookDeliveryUrlCopyButton.d.ts +8 -0
- package/dist/components/webhooks/WebhookDeliveryUrlCopyButton.js +33 -0
- package/dist/components/webhooks/WebhookEndpointErrorLayout.d.ts +7 -0
- package/dist/components/webhooks/WebhookEndpointErrorLayout.js +26 -0
- package/dist/components/webhooks/WebhookEndpointStatusBeacon.d.ts +7 -0
- package/dist/components/webhooks/WebhookEndpointStatusBeacon.js +20 -0
- package/dist/components/webhooks/WebhookEndpointStatusCallout.d.ts +8 -0
- package/dist/components/webhooks/WebhookEndpointStatusCallout.js +11 -0
- package/dist/components/webhooks/constants.d.ts +10 -0
- package/dist/components/webhooks/constants.js +36 -0
- package/dist/components/webhooks/hooks/useWebhookEndpointSync.d.ts +8 -0
- package/dist/components/webhooks/hooks/useWebhookEndpointSync.js +112 -0
- package/dist/components/webhooks/types.d.ts +9 -0
- package/dist/components/webhooks/types.js +13 -0
- package/dist/components/webhooks/utils.d.ts +21 -0
- package/dist/components/webhooks/utils.js +47 -0
- package/dist/constants.js +1 -1
- package/dist/gen/ingestion/v1/capabilities_pb.js +1 -1
- package/dist/gen/ingestion/v1/connectors_pb.d.ts +6 -0
- package/dist/gen/ingestion/v1/connectors_pb.js +1 -1
- package/dist/gen/ingestion/v1/runs_pb.d.ts +2 -1
- package/dist/gen/ingestion/v1/service_pb.d.ts +19 -0
- package/dist/gen/ingestion/v1/service_pb.js +5 -3
- package/dist/gen/ingestion/v1/webhooks_pb.d.ts +177 -0
- package/dist/gen/ingestion/v1/webhooks_pb.js +23 -0
- package/dist/hooks/useConfirm.d.ts +1 -1
- package/dist/module/hooks.d.ts +5 -6
- package/dist/module/hooks.js +6 -1
- package/dist/module/routes.d.ts +1 -2
- package/dist/module/schemas.d.ts +1 -2
- package/dist/module/schemas.js +1 -2
- package/dist/pages/connections/ConnectionsPage.js +0 -4
- package/dist/pages/connections/components/card/ConnectionCard.d.ts +0 -1
- package/dist/pages/connections/components/card/ConnectionCard.js +4 -9
- package/dist/pages/connections/components/create/configure/CreateConnectionConfigure.js +48 -11
- package/dist/pages/connections/components/drawer/ConnectionDrawer.js +6 -1
- package/dist/pages/connections/components/drawer/ConnectionDrawerSection.js +1 -1
- package/dist/pages/connections/components/drawer/ConnectionDrawerWebhook.d.ts +7 -0
- package/dist/pages/connections/components/drawer/ConnectionDrawerWebhook.js +105 -0
- package/dist/pages/connections/components/drawer/ConnectionDrawerWebhookSecrets.d.ts +7 -0
- package/dist/pages/connections/components/drawer/ConnectionDrawerWebhookSecrets.js +40 -0
- package/dist/pages/connections/components/drawer/ConnectionDrawerWebhookSigningKey.d.ts +9 -0
- package/dist/pages/connections/components/drawer/ConnectionDrawerWebhookSigningKey.js +120 -0
- package/dist/pages/connections/components/form/ConnectionFormSigningKeyModal.d.ts +9 -0
- package/dist/pages/connections/components/form/ConnectionFormSigningKeyModal.js +66 -0
- package/dist/pages/connections/components/form/ConnectionFormWrapper.d.ts +1 -0
- package/dist/pages/connections/components/form/ConnectionFormWrapper.js +2 -1
- package/dist/pages/connections/components/form/types.d.ts +5 -0
- package/dist/pages/connections/hooks/useConnectionWebhookKeyMint.d.ts +12 -0
- package/dist/pages/connections/hooks/useConnectionWebhookKeyMint.js +27 -0
- package/dist/pages/observability/ObservabilityPage.js +61 -66
- package/dist/pages/observability/components/ObservabilityPageActions.js +1 -3
- package/dist/pages/observability/components/ObservabilityWidgetEmpty.d.ts +8 -0
- package/dist/pages/observability/components/ObservabilityWidgetEmpty.js +30 -0
- package/dist/pages/observability/components/band/ObservabilityBand.d.ts +3 -0
- package/dist/pages/observability/components/band/ObservabilityBand.js +28 -0
- package/dist/pages/observability/components/band/ObservabilityBandList.d.ts +12 -0
- package/dist/pages/observability/components/band/ObservabilityBandList.js +81 -0
- package/dist/pages/observability/components/band/ObservabilityBandMetricTile.d.ts +10 -0
- package/dist/pages/observability/components/band/ObservabilityBandMetricTile.js +86 -0
- package/dist/pages/observability/components/band/ObservabilityBandPivotSelect.d.ts +7 -0
- package/dist/pages/observability/components/band/ObservabilityBandPivotSelect.js +37 -0
- package/dist/pages/observability/components/band/ObservabilityBandRunsChart.d.ts +10 -0
- package/dist/pages/observability/components/band/ObservabilityBandRunsChart.js +26 -0
- package/dist/pages/observability/components/band/ObservabilityBandRunsPastTile.d.ts +3 -0
- package/dist/pages/observability/components/band/ObservabilityBandRunsPastTile.js +128 -0
- package/dist/pages/observability/components/band/ObservabilityBandRunsTile.d.ts +3 -0
- package/dist/pages/observability/components/band/ObservabilityBandRunsTile.js +13 -0
- package/dist/pages/observability/components/band/ObservabilityBandRunsUpcomingTile.d.ts +3 -0
- package/dist/pages/observability/components/band/ObservabilityBandRunsUpcomingTile.js +63 -0
- package/dist/pages/observability/components/band/ObservabilityBandTile.d.ts +12 -0
- package/dist/pages/observability/components/band/ObservabilityBandTile.js +71 -0
- package/dist/pages/observability/components/band/ObservabilityBandTimeseriesChart.d.ts +14 -0
- package/dist/pages/observability/components/band/ObservabilityBandTimeseriesChart.js +48 -0
- package/dist/pages/observability/components/band/ObservabilityBandTopList.d.ts +12 -0
- package/dist/pages/observability/components/band/ObservabilityBandTopList.js +19 -0
- package/dist/pages/observability/components/band/constants.d.ts +25 -0
- package/dist/pages/observability/components/band/constants.js +81 -0
- package/dist/pages/observability/components/band/types.d.ts +27 -0
- package/dist/pages/observability/components/band/utils.d.ts +25 -0
- package/dist/pages/observability/components/band/utils.js +93 -0
- package/dist/pages/observability/components/connections/ObservabilityConnectionRow.d.ts +9 -0
- package/dist/pages/observability/components/connections/ObservabilityConnectionRow.js +57 -0
- package/dist/pages/observability/components/connections/ObservabilityConnectionsWidget.d.ts +7 -0
- package/dist/pages/observability/components/connections/ObservabilityConnectionsWidget.js +56 -0
- package/dist/pages/observability/components/connections/constants.d.ts +5 -0
- package/dist/pages/observability/components/connections/constants.js +24 -0
- package/dist/pages/observability/components/connections/types.d.ts +4 -0
- package/dist/pages/observability/components/connections/utils.d.ts +4 -0
- package/dist/pages/observability/components/connections/utils.js +23 -0
- package/dist/pages/observability/components/failures/ObservabilityFailuresBanner.d.ts +3 -0
- package/dist/pages/observability/components/failures/ObservabilityFailuresBanner.js +33 -0
- package/dist/pages/observability/components/failures/ObservabilityFailuresDetails.d.ts +7 -0
- package/dist/pages/observability/components/failures/ObservabilityFailuresDetails.js +99 -0
- package/dist/pages/observability/components/failures/constants.d.ts +2 -0
- package/dist/pages/observability/components/pipelines/ObservabilityPipelinesBar.d.ts +7 -0
- package/dist/pages/observability/components/pipelines/ObservabilityPipelinesBar.js +34 -0
- package/dist/pages/observability/components/pipelines/ObservabilityPipelinesColumnCell.d.ts +7 -0
- package/dist/pages/observability/components/pipelines/ObservabilityPipelinesColumnCell.js +15 -0
- package/dist/pages/observability/components/pipelines/ObservabilityPipelinesHeader.d.ts +3 -0
- package/dist/pages/observability/components/pipelines/ObservabilityPipelinesHeader.js +34 -0
- package/dist/pages/observability/components/pipelines/ObservabilityPipelinesRow.d.ts +11 -0
- package/dist/pages/observability/components/pipelines/ObservabilityPipelinesRow.js +120 -0
- package/dist/pages/observability/components/pipelines/ObservabilityPipelinesWidget.d.ts +3 -0
- package/dist/pages/observability/components/pipelines/ObservabilityPipelinesWidget.js +142 -0
- package/dist/pages/observability/components/pipelines/constants.d.ts +23 -0
- package/dist/pages/observability/components/pipelines/constants.js +33 -0
- package/dist/pages/observability/components/pipelines/types.d.ts +22 -0
- package/dist/pages/observability/components/pipelines/types.js +11 -0
- package/dist/pages/observability/components/pipelines/utils.d.ts +9 -0
- package/dist/pages/observability/components/pipelines/utils.js +73 -0
- package/dist/pages/observability/components/runs/ObservabilityRunsPastTable.js +6 -13
- package/dist/pages/observability/components/runs/ObservabilityRunsTableActions.d.ts +3 -0
- package/dist/pages/observability/components/runs/ObservabilityRunsTableActions.js +43 -0
- package/dist/pages/observability/components/runs/ObservabilityRunsTableWidget.js +2 -0
- package/dist/pages/observability/components/runs/ObservabilityRunsViewToggle.d.ts +3 -0
- package/dist/pages/observability/components/runs/ObservabilityRunsViewToggle.js +26 -0
- package/dist/pages/observability/components/runs/constants.d.ts +4 -10
- package/dist/pages/observability/components/runs/constants.js +8 -12
- package/dist/pages/observability/components/scheduled/ObservabilityScheduledWidget.d.ts +3 -0
- package/dist/pages/observability/components/scheduled/ObservabilityScheduledWidget.js +94 -0
- package/dist/pages/observability/components/setup/ObservabilitySetupChecklist.js +3 -1
- package/dist/pages/observability/components/setup/constants.js +1 -1
- package/dist/pages/observability/constants.d.ts +18 -3
- package/dist/pages/observability/constants.js +24 -4
- package/dist/pages/observability/hooks/useObservabilityAggregateQuery.d.ts +2 -0
- package/dist/pages/observability/hooks/useObservabilityAggregateQuery.js +13 -0
- package/dist/pages/observability/hooks/useObservabilityBandRanking.d.ts +8 -0
- package/dist/pages/observability/hooks/useObservabilityBandRanking.js +21 -0
- package/dist/pages/observability/hooks/useObservabilityBandUpcoming.d.ts +8 -0
- package/dist/pages/observability/hooks/useObservabilityBandUpcoming.js +45 -0
- package/dist/pages/observability/hooks/useObservabilityMetricInputs.d.ts +9 -0
- package/dist/pages/observability/hooks/useObservabilityMetricInputs.js +33 -0
- package/dist/pages/observability/hooks/useObservabilityPipelines.d.ts +12 -0
- package/dist/pages/observability/hooks/useObservabilityPipelines.js +22 -0
- package/dist/pages/observability/hooks/useObservabilityTimeseriesQuery.d.ts +2 -0
- package/dist/pages/observability/hooks/useObservabilityTimeseriesQuery.js +13 -0
- package/dist/pages/observability/types.d.ts +16 -0
- package/dist/pages/observability/types.js +7 -1
- package/dist/pages/observability/utils.d.ts +6 -1
- package/dist/pages/observability/utils.js +19 -2
- package/dist/pages/pipelines/canvas/hooks/usePipelineCanvasPanelResourceOptions.js +1 -1
- package/dist/pages/pipelines/canvas/panel/overview/PipelineCanvasPanelOverview.js +1 -1
- package/dist/pages/pipelines/canvas/panel/overview/node/PipelineCanvasPanelNodeDetail.js +1 -1
- package/dist/pages/pipelines/canvas/panel/overview/resource/PipelineCanvasPanelResourceDetail.js +11 -0
- package/dist/pages/pipelines/canvas/panel/overview/resource/PipelineCanvasPanelResourceEndpoint.js +1 -1
- package/dist/pages/pipelines/canvas/panel/overview/resource/PipelineCanvasPanelResourceSection.js +4 -1
- package/dist/pages/pipelines/canvas/routes/hooks/usePipelineCanvasRoutes.js +1 -1
- package/dist/pages/pipelines/components/create/components/CreatePipelineModalFooter.js +7 -1
- package/dist/pages/pipelines/components/create/hooks/useCreatePipelineResources.js +2 -2
- package/dist/pages/pipelines/components/create/steps/CreatePipelineModalResources.js +5 -2
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesTable.js +15 -2
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesUrlCell.d.ts +7 -0
- package/dist/pages/pipelines/components/create/steps/components/CreatePipelineModalResourcesUrlCell.js +27 -0
- package/dist/pages/pipelines/components/header/PipelinePageEditActions.js +10 -0
- package/dist/pages/pipelines/components/header/PipelinePageHeading.js +1 -1
- package/dist/pages/pipelines/components/resource/PipelineResourceCreateForm.d.ts +1 -0
- package/dist/pages/pipelines/components/resource/PipelineResourceCreateForm.js +10 -3
- package/dist/pages/pipelines/components/run/PipelineRunModal.js +7 -4
- package/dist/pages/pipelines/components/run/PipelineRunModalResourcesPane.d.ts +1 -0
- package/dist/pages/pipelines/components/run/PipelineRunModalResourcesPane.js +5 -4
- package/dist/pages/pipelines/components/run/utils.d.ts +1 -0
- package/dist/pages/pipelines/components/run/utils.js +2 -1
- package/dist/pages/pipelines/components/table/PipelinesTable.js +1 -1
- package/dist/pages/pipelines/settings/PipelineSettingsPageAdvanced.js +1 -1
- package/dist/pages/pipelines/settings/PipelineSettingsPageDanger.js +1 -1
- package/dist/pages/pipelines/settings/PipelineSettingsPageGeneral.js +2 -2
- package/dist/pages/pipelines/settings/PipelineSettingsPageSchedule.js +1 -1
- package/dist/styles.css +15 -0
- package/dist/utils/errors.d.ts +2 -0
- package/dist/utils/errors.js +6 -1
- package/package.json +1 -1
- package/dist/pages/observability/components/metrics/ObservabilityMetricsWidget.d.ts +0 -3
- package/dist/pages/observability/components/metrics/ObservabilityMetricsWidget.js +0 -139
- package/dist/pages/observability/components/metrics/constants.d.ts +0 -3
- package/dist/pages/observability/components/metrics/constants.js +0 -11
- package/dist/pages/observability/components/runs/ObservabilityRunsChart.d.ts +0 -3
- package/dist/pages/observability/components/runs/ObservabilityRunsChart.js +0 -66
- package/dist/pages/observability/components/runs/ObservabilityRunsChartWidget.d.ts +0 -3
- package/dist/pages/observability/components/runs/ObservabilityRunsChartWidget.js +0 -75
- package/dist/pages/observability/components/runs/ObservabilityRunsScheduledChart.d.ts +0 -3
- package/dist/pages/observability/components/runs/ObservabilityRunsScheduledChart.js +0 -39
- package/dist/pages/observability/components/runs/types.d.ts +0 -1
- package/dist/pages/observability/components/runs/utils.d.ts +0 -14
- package/dist/pages/observability/components/runs/utils.js +0 -71
- package/dist/pages/observability/components/timeseries/ObservabilityPivotSelect.d.ts +0 -8
- package/dist/pages/observability/components/timeseries/ObservabilityPivotSelect.js +0 -28
- package/dist/pages/observability/components/timeseries/ObservabilityTimeseriesChart.d.ts +0 -14
- package/dist/pages/observability/components/timeseries/ObservabilityTimeseriesChart.js +0 -105
- package/dist/pages/observability/components/timeseries/ObservabilityTimeseriesWidget.d.ts +0 -19
- package/dist/pages/observability/components/timeseries/ObservabilityTimeseriesWidget.js +0 -61
- package/dist/pages/observability/components/timeseries/constants.d.ts +0 -19
- package/dist/pages/observability/components/timeseries/constants.js +0 -57
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { OBSERVABILITY_RUNS_NO_STATUSES_PLACEHOLDER, OBSERVABILITY_RUNS_SERIES } from "./constants.js";
|
|
2
|
-
import { OBSERVABILITY_REFRESH_INTERVAL_TO_MS_MAP, OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP } from "../../constants.js";
|
|
3
|
-
import { useFilamentSearchUpdate, useObservabilitySearch } from "../../../../module/hooks.js";
|
|
4
|
-
import { getBucketLabelFormatter } from "../../utils.js";
|
|
5
|
-
import { useObservabilityBucketStart } from "../../hooks/useObservabilityBucketStart.js";
|
|
6
|
-
import { useQueryTimeseriesQuery } from "../../../../api/queries/metrics.js";
|
|
7
|
-
import { createRunCountTimeseriesInput, mapChartSelectionToRunsFilter, mapTimeseriesToChartGroups } from "./utils.js";
|
|
8
|
-
import { useMemo } from "react";
|
|
9
|
-
import { jsx } from "react/jsx-runtime";
|
|
10
|
-
import Flex, { AlignItems, FlexDirection } from "@galaxy-io/dls/layout/Flex";
|
|
11
|
-
import BarChart from "@galaxy-io/dls/charts/BarChart";
|
|
12
|
-
//#region src/pages/observability/components/runs/ObservabilityRunsChart.tsx
|
|
13
|
-
var ObservabilityRunsChart = () => {
|
|
14
|
-
const updateSearch = useFilamentSearchUpdate();
|
|
15
|
-
const { timeframe, refreshInterval, statuses, runsBucket, runsStatus } = useObservabilitySearch();
|
|
16
|
-
const bucketStartMs = useObservabilityBucketStart(timeframe);
|
|
17
|
-
const bucketLabelFormatter = getBucketLabelFormatter(OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP[timeframe].granularity);
|
|
18
|
-
const input = useMemo(() => createRunCountTimeseriesInput(timeframe, bucketStartMs, statuses), [
|
|
19
|
-
timeframe,
|
|
20
|
-
bucketStartMs,
|
|
21
|
-
statuses
|
|
22
|
-
]);
|
|
23
|
-
const { data, isFetching } = useQueryTimeseriesQuery({
|
|
24
|
-
input,
|
|
25
|
-
options: {
|
|
26
|
-
enabled: statuses.length > 0,
|
|
27
|
-
refetchInterval: OBSERVABILITY_REFRESH_INTERVAL_TO_MS_MAP[refreshInterval]
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
const groups = useMemo(() => {
|
|
31
|
-
if (!statuses.length) return [];
|
|
32
|
-
return mapTimeseriesToChartGroups(data?.series ?? []);
|
|
33
|
-
}, [data, statuses.length]);
|
|
34
|
-
const selection = useMemo(() => runsBucket === void 0 && runsStatus === void 0 ? null : {
|
|
35
|
-
categoryKey: runsBucket === void 0 ? void 0 : String(runsBucket),
|
|
36
|
-
seriesKey: runsStatus === void 0 ? void 0 : String(runsStatus)
|
|
37
|
-
}, [runsBucket, runsStatus]);
|
|
38
|
-
const handleSelectionChange = (next) => {
|
|
39
|
-
const filter = mapChartSelectionToRunsFilter(next[next.length - 1]);
|
|
40
|
-
updateSearch((prev) => ({
|
|
41
|
-
...prev,
|
|
42
|
-
...filter
|
|
43
|
-
}));
|
|
44
|
-
};
|
|
45
|
-
return /* @__PURE__ */ jsx(Flex, {
|
|
46
|
-
alignItems: AlignItems.START,
|
|
47
|
-
direction: FlexDirection.COLUMN,
|
|
48
|
-
padding: [12, 16],
|
|
49
|
-
height: 240,
|
|
50
|
-
fillWidth: true,
|
|
51
|
-
children: /* @__PURE__ */ jsx(BarChart, {
|
|
52
|
-
series: OBSERVABILITY_RUNS_SERIES,
|
|
53
|
-
groups,
|
|
54
|
-
labelFormatter: bucketLabelFormatter,
|
|
55
|
-
selection,
|
|
56
|
-
onSelectionChange: handleSelectionChange,
|
|
57
|
-
isFilterable: true,
|
|
58
|
-
isLoading: isFetching,
|
|
59
|
-
placeholder: statuses.length ? void 0 : OBSERVABILITY_RUNS_NO_STATUSES_PLACEHOLDER,
|
|
60
|
-
ariaLabel: "Runs by status",
|
|
61
|
-
minSegmentLength: 4
|
|
62
|
-
})
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
//#endregion
|
|
66
|
-
export { ObservabilityRunsChart as default };
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { RunStatus } from "../../../../gen/ingestion/v1/runs_pb.js";
|
|
2
|
-
import { mapOptionIdToEnum } from "../../../../utils/select.js";
|
|
3
|
-
import { ObservabilityRunsView } from "../../types.js";
|
|
4
|
-
import { OBSERVABILITY_RUNS_ALL_STATUSES_LABEL, OBSERVABILITY_RUNS_CHART_SCHEDULED_STATUS_OPTIONS, OBSERVABILITY_RUNS_CHART_STATUS_OPTIONS, OBSERVABILITY_RUNS_SCHEDULED_STATUS_OPTION, OBSERVABILITY_RUNS_VIEW_TO_LABEL_MAP } from "./constants.js";
|
|
5
|
-
import { useFilamentSearchUpdate, useObservabilitySearch } from "../../../../module/hooks.js";
|
|
6
|
-
import ObservabilityRunsChart from "./ObservabilityRunsChart.js";
|
|
7
|
-
import ObservabilityRunsScheduledChart from "./ObservabilityRunsScheduledChart.js";
|
|
8
|
-
import { FlowArrowIcon } from "@phosphor-icons/react";
|
|
9
|
-
import { useMemo } from "react";
|
|
10
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
import Box from "@galaxy-io/dls/layout/Box";
|
|
12
|
-
import Text from "@galaxy-io/dls/text/Text";
|
|
13
|
-
import Widget from "@galaxy-io/dls/widget/Widget";
|
|
14
|
-
import MultiSelectInput, { MultiSelectInputSize, MultiSelectInputVariant } from "@galaxy-io/dls/inputs/MultiSelectInput";
|
|
15
|
-
import pluralize from "pluralize";
|
|
16
|
-
import ToggleInput, { ToggleInputSize, ToggleInputVariant } from "@galaxy-io/dls/inputs/ToggleInput";
|
|
17
|
-
//#region src/pages/observability/components/runs/ObservabilityRunsChartWidget.tsx
|
|
18
|
-
var ObservabilityRunsChartWidget = () => {
|
|
19
|
-
const updateSearch = useFilamentSearchUpdate();
|
|
20
|
-
const { runs: view, statuses } = useObservabilitySearch();
|
|
21
|
-
const selectedStatusIds = useMemo(() => OBSERVABILITY_RUNS_CHART_STATUS_OPTIONS.map((option) => option.id).filter((id) => statuses.includes(mapOptionIdToEnum(RunStatus, id))), [statuses]);
|
|
22
|
-
const handleViewChange = (nextView) => {
|
|
23
|
-
updateSearch((prev) => ({
|
|
24
|
-
...prev,
|
|
25
|
-
runs: nextView,
|
|
26
|
-
runsBucket: void 0,
|
|
27
|
-
runsStatus: void 0
|
|
28
|
-
}));
|
|
29
|
-
};
|
|
30
|
-
const handleStatusChange = (ids) => {
|
|
31
|
-
updateSearch((prev) => ({
|
|
32
|
-
...prev,
|
|
33
|
-
statuses: ids.map((id) => mapOptionIdToEnum(RunStatus, id)),
|
|
34
|
-
runsBucket: void 0,
|
|
35
|
-
runsStatus: void 0
|
|
36
|
-
}));
|
|
37
|
-
};
|
|
38
|
-
const switcherItems = Object.values(ObservabilityRunsView).map((runsView) => ({
|
|
39
|
-
id: runsView,
|
|
40
|
-
label: OBSERVABILITY_RUNS_VIEW_TO_LABEL_MAP[runsView]
|
|
41
|
-
}));
|
|
42
|
-
const isUpcoming = view === ObservabilityRunsView.UPCOMING;
|
|
43
|
-
return /* @__PURE__ */ jsx(Widget, {
|
|
44
|
-
isFlush: true,
|
|
45
|
-
gap: 0,
|
|
46
|
-
header: "Runs",
|
|
47
|
-
icon: FlowArrowIcon,
|
|
48
|
-
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ToggleInput, {
|
|
49
|
-
size: ToggleInputSize.SMALL,
|
|
50
|
-
variant: ToggleInputVariant.PRIMARY,
|
|
51
|
-
options: switcherItems,
|
|
52
|
-
value: view,
|
|
53
|
-
onChange: handleViewChange,
|
|
54
|
-
ariaLabel: "Runs view"
|
|
55
|
-
}), /* @__PURE__ */ jsx(Box, {
|
|
56
|
-
width: 160,
|
|
57
|
-
children: /* @__PURE__ */ jsx(MultiSelectInput, {
|
|
58
|
-
fillWidth: true,
|
|
59
|
-
options: isUpcoming ? OBSERVABILITY_RUNS_CHART_SCHEDULED_STATUS_OPTIONS : OBSERVABILITY_RUNS_CHART_STATUS_OPTIONS,
|
|
60
|
-
selectAllLabel: isUpcoming ? void 0 : OBSERVABILITY_RUNS_ALL_STATUSES_LABEL,
|
|
61
|
-
value: isUpcoming ? [OBSERVABILITY_RUNS_SCHEDULED_STATUS_OPTION.id] : selectedStatusIds,
|
|
62
|
-
size: MultiSelectInputSize.SMALL,
|
|
63
|
-
variant: MultiSelectInputVariant.PRIMARY,
|
|
64
|
-
onChange: handleStatusChange,
|
|
65
|
-
placeholder: "Select statuses...",
|
|
66
|
-
ariaLabel: "Run statuses",
|
|
67
|
-
isDisabled: isUpcoming,
|
|
68
|
-
renderValue: (options) => /* @__PURE__ */ jsx(Text, { children: pluralize("status", options.length, true) })
|
|
69
|
-
})
|
|
70
|
-
})] }),
|
|
71
|
-
children: view === ObservabilityRunsView.PAST ? /* @__PURE__ */ jsx(ObservabilityRunsChart, {}) : /* @__PURE__ */ jsx(ObservabilityRunsScheduledChart, {})
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
//#endregion
|
|
75
|
-
export { ObservabilityRunsChartWidget as default };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { OBSERVABILITY_RUNS_SCHEDULED_INPUT, OBSERVABILITY_RUNS_SCHEDULED_SERIES } from "./constants.js";
|
|
2
|
-
import { OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP } from "../../constants.js";
|
|
3
|
-
import { useObservabilitySearch } from "../../../../module/hooks.js";
|
|
4
|
-
import { useListRunsQuery } from "../../../../api/queries/runs.js";
|
|
5
|
-
import { getBucketLabelFormatter } from "../../utils.js";
|
|
6
|
-
import { useObservabilityBucketStart } from "../../hooks/useObservabilityBucketStart.js";
|
|
7
|
-
import { createScheduledRunsChartGroups } from "./utils.js";
|
|
8
|
-
import { useMemo } from "react";
|
|
9
|
-
import { jsx } from "react/jsx-runtime";
|
|
10
|
-
import Flex, { AlignItems, FlexDirection } from "@galaxy-io/dls/layout/Flex";
|
|
11
|
-
import BarChart from "@galaxy-io/dls/charts/BarChart";
|
|
12
|
-
//#region src/pages/observability/components/runs/ObservabilityRunsScheduledChart.tsx
|
|
13
|
-
var ObservabilityRunsScheduledChart = () => {
|
|
14
|
-
const { timeframe } = useObservabilitySearch();
|
|
15
|
-
const bucketStartMs = useObservabilityBucketStart(timeframe);
|
|
16
|
-
const bucketLabelFormatter = getBucketLabelFormatter(OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP[timeframe].granularity);
|
|
17
|
-
const { data, isFetching } = useListRunsQuery({ input: OBSERVABILITY_RUNS_SCHEDULED_INPUT });
|
|
18
|
-
const groups = useMemo(() => createScheduledRunsChartGroups(data?.runs ?? [], timeframe, bucketStartMs), [
|
|
19
|
-
data,
|
|
20
|
-
timeframe,
|
|
21
|
-
bucketStartMs
|
|
22
|
-
]);
|
|
23
|
-
return /* @__PURE__ */ jsx(Flex, {
|
|
24
|
-
alignItems: AlignItems.START,
|
|
25
|
-
direction: FlexDirection.COLUMN,
|
|
26
|
-
padding: [12, 16],
|
|
27
|
-
height: 240,
|
|
28
|
-
fillWidth: true,
|
|
29
|
-
children: /* @__PURE__ */ jsx(BarChart, {
|
|
30
|
-
series: OBSERVABILITY_RUNS_SCHEDULED_SERIES,
|
|
31
|
-
groups,
|
|
32
|
-
labelFormatter: bucketLabelFormatter,
|
|
33
|
-
isLoading: isFetching,
|
|
34
|
-
ariaLabel: "Scheduled runs"
|
|
35
|
-
})
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
//#endregion
|
|
39
|
-
export { ObservabilityRunsScheduledChart as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type ObservabilityRunMetric = "runs";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BarChartGroupDatum } from '@galaxy-io/dls/charts/BarChart';
|
|
2
|
-
import { ChartSelection } from '@galaxy-io/dls/charts/types';
|
|
3
|
-
import { ListRunsRequest, RunInfo, RunStatus } from '../../../../gen/ingestion/v1/runs_pb';
|
|
4
|
-
import { QueryTimeseriesRequest, Timeseries } from '../../../../gen/metrics/v1/metrics_pb';
|
|
5
|
-
import { ObservabilityRunMetric } from './types';
|
|
6
|
-
import { ObservabilityTimeframe } from '../../types';
|
|
7
|
-
export declare const createRunCountTimeseriesInput: (timeframe: ObservabilityTimeframe, bucketStartMs: number, statuses: RunStatus[]) => QueryTimeseriesRequest;
|
|
8
|
-
export declare const createScheduledRunsChartGroups: (runs: RunInfo[], timeframe: ObservabilityTimeframe, bucketStartMs: number) => BarChartGroupDatum<ObservabilityRunMetric>[];
|
|
9
|
-
export declare const mapTimeseriesToChartGroups: (series: Timeseries[]) => BarChartGroupDatum<ObservabilityRunMetric>[];
|
|
10
|
-
export declare const mapChartSelectionToRunsFilter: (selection: ChartSelection | undefined) => {
|
|
11
|
-
runsBucket: bigint | undefined;
|
|
12
|
-
runsStatus: RunStatus.REQUESTED | RunStatus.RUNNING | RunStatus.COMPLETED | RunStatus.FAILED | RunStatus.CANCELED | RunStatus.PAUSED | RunStatus.PARTIAL | RunStatus.SCHEDULED | undefined;
|
|
13
|
-
};
|
|
14
|
-
export declare const createRunsWindowInput: (timeframe: ObservabilityTimeframe, bucketStartMs: number, runsBucket: bigint | undefined) => Pick<ListRunsRequest, "sinceMs" | "untilMs">;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { RunStatus } from "../../../../gen/ingestion/v1/runs_pb.js";
|
|
2
|
-
import { mapOptionIdToEnum } from "../../../../utils/select.js";
|
|
3
|
-
import { PIPELINE_RUN_STATUS_TO_HUE_MAP, PIPELINE_RUN_STATUS_TO_LABEL_MAP } from "../../../../components/runs/constants.js";
|
|
4
|
-
import { Metric, MetricDimension, MetricFilterSchema } from "../../../../gen/metrics/v1/metrics_pb.js";
|
|
5
|
-
import { OBSERVABILITY_GRANULARITY_TO_DURATION_MS_MAP, OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP } from "../../constants.js";
|
|
6
|
-
import { createObservabilityTimeseriesInput, createTimeframeSince, formatBucketKey, getBucketOffset } from "../../utils.js";
|
|
7
|
-
import { create } from "@bufbuild/protobuf";
|
|
8
|
-
//#region src/pages/observability/components/runs/utils.ts
|
|
9
|
-
var createRunCountTimeseriesInput = (timeframe, bucketStartMs, statuses) => createObservabilityTimeseriesInput(timeframe, bucketStartMs, {
|
|
10
|
-
metrics: [Metric.RUN_COUNT],
|
|
11
|
-
groupBy: MetricDimension.STATUS,
|
|
12
|
-
filters: [create(MetricFilterSchema, {
|
|
13
|
-
dimension: MetricDimension.STATUS,
|
|
14
|
-
values: statuses.map(String)
|
|
15
|
-
})]
|
|
16
|
-
});
|
|
17
|
-
var createScheduledRunsChartGroups = (runs, timeframe, bucketStartMs) => {
|
|
18
|
-
const { durationMs, granularity } = OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP[timeframe];
|
|
19
|
-
const start = new Date(bucketStartMs);
|
|
20
|
-
const bucketCount = Math.round(durationMs / OBSERVABILITY_GRANULARITY_TO_DURATION_MS_MAP[granularity]);
|
|
21
|
-
const bucketBounds = Array.from({ length: bucketCount + 1 }, (_, index) => getBucketOffset(granularity, start, index));
|
|
22
|
-
return bucketBounds.slice(0, -1).map((bucketStartMs, bucketIndex) => ({
|
|
23
|
-
label: formatBucketKey(BigInt(bucketStartMs)),
|
|
24
|
-
bars: [{
|
|
25
|
-
metric: "runs",
|
|
26
|
-
components: [{
|
|
27
|
-
key: String(RunStatus.SCHEDULED),
|
|
28
|
-
label: PIPELINE_RUN_STATUS_TO_LABEL_MAP[RunStatus.SCHEDULED],
|
|
29
|
-
value: runs.filter((run) => Number(run.scheduledAt) >= bucketStartMs && Number(run.scheduledAt) < bucketBounds[bucketIndex + 1]).length,
|
|
30
|
-
color: PIPELINE_RUN_STATUS_TO_HUE_MAP[RunStatus.SCHEDULED]
|
|
31
|
-
}]
|
|
32
|
-
}]
|
|
33
|
-
}));
|
|
34
|
-
};
|
|
35
|
-
var mapTimeseriesToChartGroups = (series) => (series[0]?.points ?? []).map((point, bucketIndex) => ({
|
|
36
|
-
label: formatBucketKey(point.bucketStartMs),
|
|
37
|
-
bars: [{
|
|
38
|
-
metric: "runs",
|
|
39
|
-
components: series.flatMap((statusSeries) => {
|
|
40
|
-
const status = mapOptionIdToEnum(RunStatus, statusSeries.key);
|
|
41
|
-
const color = PIPELINE_RUN_STATUS_TO_HUE_MAP[status];
|
|
42
|
-
return color ? [{
|
|
43
|
-
key: statusSeries.key,
|
|
44
|
-
label: PIPELINE_RUN_STATUS_TO_LABEL_MAP[status],
|
|
45
|
-
value: statusSeries.points[bucketIndex].values[0],
|
|
46
|
-
color
|
|
47
|
-
}] : [];
|
|
48
|
-
}).sort((a, b) => b.value - a.value)
|
|
49
|
-
}]
|
|
50
|
-
}));
|
|
51
|
-
var mapChartSelectionToRunsFilter = (selection) => {
|
|
52
|
-
const status = mapOptionIdToEnum(RunStatus, selection?.seriesKey ?? "");
|
|
53
|
-
return {
|
|
54
|
-
runsBucket: selection?.categoryKey === void 0 ? void 0 : BigInt(selection.categoryKey),
|
|
55
|
-
runsStatus: status === RunStatus.UNSPECIFIED ? void 0 : status
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
var createRunsWindowInput = (timeframe, bucketStartMs, runsBucket) => {
|
|
59
|
-
const sinceMs = createTimeframeSince(timeframe, bucketStartMs);
|
|
60
|
-
if (runsBucket === void 0) return {
|
|
61
|
-
sinceMs,
|
|
62
|
-
untilMs: 0n
|
|
63
|
-
};
|
|
64
|
-
const { granularity } = OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP[timeframe];
|
|
65
|
-
return {
|
|
66
|
-
sinceMs: runsBucket > sinceMs ? runsBucket : sinceMs,
|
|
67
|
-
untilMs: runsBucket + BigInt(OBSERVABILITY_GRANULARITY_TO_DURATION_MS_MAP[granularity])
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
//#endregion
|
|
71
|
-
export { createRunCountTimeseriesInput, createRunsWindowInput, createScheduledRunsChartGroups, mapChartSelectionToRunsFilter, mapTimeseriesToChartGroups };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { MetricDimension } from '../../../../gen/metrics/v1/metrics_pb';
|
|
3
|
-
interface ObservabilityPivotSelectProps {
|
|
4
|
-
value: MetricDimension | undefined;
|
|
5
|
-
onChange: (pivot: MetricDimension | undefined) => void;
|
|
6
|
-
}
|
|
7
|
-
declare const ObservabilityPivotSelect: FC<ObservabilityPivotSelectProps>;
|
|
8
|
-
export default ObservabilityPivotSelect;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { mapOptionIdToEnum } from "../../../../utils/select.js";
|
|
2
|
-
import { MetricDimension } from "../../../../gen/metrics/v1/metrics_pb.js";
|
|
3
|
-
import { OBSERVABILITY_TIMESERIES_PIVOT_OPTIONS } from "./constants.js";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import SelectInput, { SelectInputSize, SelectInputVariant } from "@galaxy-io/dls/inputs/SelectInput";
|
|
6
|
-
import Box from "@galaxy-io/dls/layout/Box";
|
|
7
|
-
//#region src/pages/observability/components/timeseries/ObservabilityPivotSelect.tsx
|
|
8
|
-
var ObservabilityPivotSelect = ({ value, onChange }) => {
|
|
9
|
-
const handleChange = (id) => {
|
|
10
|
-
onChange(id === null ? void 0 : mapOptionIdToEnum(MetricDimension, id));
|
|
11
|
-
};
|
|
12
|
-
return /* @__PURE__ */ jsx(Box, {
|
|
13
|
-
width: 150,
|
|
14
|
-
children: /* @__PURE__ */ jsx(SelectInput, {
|
|
15
|
-
fillWidth: true,
|
|
16
|
-
options: OBSERVABILITY_TIMESERIES_PIVOT_OPTIONS,
|
|
17
|
-
value: value === void 0 ? null : String(value),
|
|
18
|
-
size: SelectInputSize.SMALL,
|
|
19
|
-
variant: SelectInputVariant.PRIMARY,
|
|
20
|
-
onChange: handleChange,
|
|
21
|
-
isClearable: true,
|
|
22
|
-
placeholder: "Group by...",
|
|
23
|
-
ariaLabel: "Group by"
|
|
24
|
-
})
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
//#endregion
|
|
28
|
-
export { ObservabilityPivotSelect as default };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ChartCurve, ChartPalette, ChartValueFormatter } from '@galaxy-io/dls/charts/types';
|
|
3
|
-
import { Metric, MetricDimension } from '../../../../gen/metrics/v1/metrics_pb';
|
|
4
|
-
interface ObservabilityTimeseriesChartProps {
|
|
5
|
-
seriesLabel: string;
|
|
6
|
-
metric: Metric;
|
|
7
|
-
color: ChartPalette;
|
|
8
|
-
pivot: MetricDimension | undefined;
|
|
9
|
-
curve: ChartCurve;
|
|
10
|
-
isStacked: boolean;
|
|
11
|
-
valueFormatter?: ChartValueFormatter;
|
|
12
|
-
}
|
|
13
|
-
declare const ObservabilityTimeseriesChart: FC<ObservabilityTimeseriesChartProps>;
|
|
14
|
-
export default ObservabilityTimeseriesChart;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { RunStatus } from "../../../../gen/ingestion/v1/runs_pb.js";
|
|
2
|
-
import { mapOptionIdToEnum } from "../../../../utils/select.js";
|
|
3
|
-
import { PIPELINE_RUN_STATUS_TO_HUE_MAP, PIPELINE_RUN_STATUS_TO_LABEL_MAP } from "../../../../components/runs/constants.js";
|
|
4
|
-
import { MetricDimension } from "../../../../gen/metrics/v1/metrics_pb.js";
|
|
5
|
-
import { OBSERVABILITY_REFRESH_INTERVAL_TO_MS_MAP, OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP } from "../../constants.js";
|
|
6
|
-
import { useObservabilitySearch } from "../../../../module/hooks.js";
|
|
7
|
-
import { formatPipelineName } from "../../../../components/pipelines/utils.js";
|
|
8
|
-
import { useGetPipelineQueries } from "../../../../api/queries/pipelines.js";
|
|
9
|
-
import { createObservabilityTimeseriesInput, formatBucketKey, getBucketLabelFormatter } from "../../utils.js";
|
|
10
|
-
import { useObservabilityBucketStart } from "../../hooks/useObservabilityBucketStart.js";
|
|
11
|
-
import { useQueryTimeseriesQuery } from "../../../../api/queries/metrics.js";
|
|
12
|
-
import { OBSERVABILITY_TIMESERIES_PIVOT_PALETTE } from "./constants.js";
|
|
13
|
-
import { useMemo } from "react";
|
|
14
|
-
import { jsx } from "react/jsx-runtime";
|
|
15
|
-
import Flex, { AlignItems, FlexDirection } from "@galaxy-io/dls/layout/Flex";
|
|
16
|
-
import { ChartSwatch } from "@galaxy-io/dls/charts/types";
|
|
17
|
-
import AreaChart from "@galaxy-io/dls/charts/AreaChart";
|
|
18
|
-
import LineChart from "@galaxy-io/dls/charts/LineChart";
|
|
19
|
-
//#region src/pages/observability/components/timeseries/ObservabilityTimeseriesChart.tsx
|
|
20
|
-
var ObservabilityTimeseriesChart = ({ seriesLabel, metric, color, pivot, curve, isStacked, valueFormatter }) => {
|
|
21
|
-
const { timeframe, refreshInterval } = useObservabilitySearch();
|
|
22
|
-
const pivotDimension = pivot ?? MetricDimension.UNSPECIFIED;
|
|
23
|
-
const bucketStartMs = useObservabilityBucketStart(timeframe);
|
|
24
|
-
const bucketLabelFormatter = getBucketLabelFormatter(OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP[timeframe].granularity);
|
|
25
|
-
const input = useMemo(() => createObservabilityTimeseriesInput(timeframe, bucketStartMs, {
|
|
26
|
-
metrics: [metric],
|
|
27
|
-
groupBy: pivotDimension
|
|
28
|
-
}), [
|
|
29
|
-
timeframe,
|
|
30
|
-
bucketStartMs,
|
|
31
|
-
metric,
|
|
32
|
-
pivotDimension
|
|
33
|
-
]);
|
|
34
|
-
const { data, isFetching } = useQueryTimeseriesQuery({
|
|
35
|
-
input,
|
|
36
|
-
options: { refetchInterval: OBSERVABILITY_REFRESH_INTERVAL_TO_MS_MAP[refreshInterval] }
|
|
37
|
-
});
|
|
38
|
-
const pivotPipelineIds = useMemo(() => pivotDimension === MetricDimension.PIPELINE_ID ? (data?.series ?? []).map((keySeries) => keySeries.key) : [], [data, pivotDimension]);
|
|
39
|
-
const pivotPipelines = useGetPipelineQueries(pivotPipelineIds);
|
|
40
|
-
const { series, lines } = useMemo(() => {
|
|
41
|
-
const timeseries = (data?.series ?? []).filter((keySeries) => pivotDimension !== MetricDimension.STATUS || PIPELINE_RUN_STATUS_TO_HUE_MAP[mapOptionIdToEnum(RunStatus, keySeries.key)] !== void 0);
|
|
42
|
-
const pipelineNamesByPipelineId = new Map(pivotPipelines.map((pipeline) => [pipeline.id, formatPipelineName(pipeline, true)]));
|
|
43
|
-
const keyToLabel = (key) => {
|
|
44
|
-
if (pivotDimension === MetricDimension.STATUS) return PIPELINE_RUN_STATUS_TO_LABEL_MAP[mapOptionIdToEnum(RunStatus, key)];
|
|
45
|
-
if (pivotDimension === MetricDimension.PIPELINE_ID) return pipelineNamesByPipelineId.get(key) ?? key;
|
|
46
|
-
return seriesLabel;
|
|
47
|
-
};
|
|
48
|
-
const keyToColor = (key, index) => {
|
|
49
|
-
if (pivotDimension === MetricDimension.STATUS) return PIPELINE_RUN_STATUS_TO_HUE_MAP[mapOptionIdToEnum(RunStatus, key)];
|
|
50
|
-
if (pivotDimension === MetricDimension.PIPELINE_ID) return OBSERVABILITY_TIMESERIES_PIVOT_PALETTE[index % OBSERVABILITY_TIMESERIES_PIVOT_PALETTE.length];
|
|
51
|
-
return color;
|
|
52
|
-
};
|
|
53
|
-
return {
|
|
54
|
-
series: Object.fromEntries(timeseries.map((keySeries, index) => [keySeries.key || seriesLabel, {
|
|
55
|
-
label: keyToLabel(keySeries.key),
|
|
56
|
-
color: keyToColor(keySeries.key, index)
|
|
57
|
-
}])),
|
|
58
|
-
lines: timeseries.map((keySeries) => ({
|
|
59
|
-
metric: keySeries.key || seriesLabel,
|
|
60
|
-
showArea: pivotDimension === MetricDimension.UNSPECIFIED,
|
|
61
|
-
points: keySeries.points.map((point) => ({
|
|
62
|
-
x: formatBucketKey(point.bucketStartMs),
|
|
63
|
-
y: point.values[0]
|
|
64
|
-
}))
|
|
65
|
-
}))
|
|
66
|
-
};
|
|
67
|
-
}, [
|
|
68
|
-
data,
|
|
69
|
-
pivotPipelines,
|
|
70
|
-
pivotDimension,
|
|
71
|
-
seriesLabel,
|
|
72
|
-
color
|
|
73
|
-
]);
|
|
74
|
-
return /* @__PURE__ */ jsx(Flex, {
|
|
75
|
-
alignItems: AlignItems.START,
|
|
76
|
-
direction: FlexDirection.COLUMN,
|
|
77
|
-
padding: [12, 16],
|
|
78
|
-
height: 240,
|
|
79
|
-
fillWidth: true,
|
|
80
|
-
children: isStacked ? /* @__PURE__ */ jsx(AreaChart, {
|
|
81
|
-
series,
|
|
82
|
-
areas: lines,
|
|
83
|
-
curve,
|
|
84
|
-
valueFormatter,
|
|
85
|
-
labelFormatter: bucketLabelFormatter,
|
|
86
|
-
isLoading: isFetching,
|
|
87
|
-
swatch: ChartSwatch.SQUARE,
|
|
88
|
-
hasLegend: true,
|
|
89
|
-
isFilterable: true,
|
|
90
|
-
isStacked: true
|
|
91
|
-
}) : /* @__PURE__ */ jsx(LineChart, {
|
|
92
|
-
series,
|
|
93
|
-
lines,
|
|
94
|
-
curve,
|
|
95
|
-
valueFormatter,
|
|
96
|
-
labelFormatter: bucketLabelFormatter,
|
|
97
|
-
isLoading: isFetching,
|
|
98
|
-
swatch: ChartSwatch.SQUARE,
|
|
99
|
-
hasLegend: true,
|
|
100
|
-
isFilterable: true
|
|
101
|
-
})
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
//#endregion
|
|
105
|
-
export { ObservabilityTimeseriesChart as default };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Icon } from '@phosphor-icons/react';
|
|
2
|
-
import { MetricDimension } from '../../../../gen/metrics/v1/metrics_pb';
|
|
3
|
-
import { ObservabilityChartView } from './constants';
|
|
4
|
-
import { ObservabilitySearch } from '../../../../module/schemas';
|
|
5
|
-
type ObservabilityTimeseriesViewKey = "throughput" | "usage";
|
|
6
|
-
type ObservabilityTimeseriesView<TKey extends ObservabilityTimeseriesViewKey> = NonNullable<ObservabilitySearch[TKey]>;
|
|
7
|
-
interface ObservabilityTimeseriesWidgetProps<TKey extends ObservabilityTimeseriesViewKey> {
|
|
8
|
-
header: string;
|
|
9
|
-
icon: Icon;
|
|
10
|
-
isStacked?: boolean;
|
|
11
|
-
views: ObservabilityTimeseriesView<TKey>[];
|
|
12
|
-
viewToConfigMap: Record<ObservabilityTimeseriesView<TKey>, ObservabilityChartView>;
|
|
13
|
-
defaultView: ObservabilityTimeseriesView<TKey>;
|
|
14
|
-
defaultPivot?: MetricDimension;
|
|
15
|
-
viewSearchKey: TKey;
|
|
16
|
-
pivotSearchKey: "throughputPivot" | "usagePivot";
|
|
17
|
-
}
|
|
18
|
-
declare const ObservabilityTimeseriesWidget: <TKey extends ObservabilityTimeseriesViewKey>({ views, viewToConfigMap, defaultView, defaultPivot, viewSearchKey, pivotSearchKey, header, icon, isStacked, }: ObservabilityTimeseriesWidgetProps<TKey>) => import('react').JSX.Element;
|
|
19
|
-
export default ObservabilityTimeseriesWidget;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { MetricDimension } from "../../../../gen/metrics/v1/metrics_pb.js";
|
|
2
|
-
import { useFilamentSearchUpdate, useObservabilitySearch } from "../../../../module/hooks.js";
|
|
3
|
-
import ObservabilityPivotSelect from "./ObservabilityPivotSelect.js";
|
|
4
|
-
import ObservabilityTimeseriesChart from "./ObservabilityTimeseriesChart.js";
|
|
5
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import Widget from "@galaxy-io/dls/widget/Widget";
|
|
7
|
-
import ToggleInput, { ToggleInputSize, ToggleInputVariant } from "@galaxy-io/dls/inputs/ToggleInput";
|
|
8
|
-
import { ChartCurve } from "@galaxy-io/dls/charts/types";
|
|
9
|
-
//#region src/pages/observability/components/timeseries/ObservabilityTimeseriesWidget.tsx
|
|
10
|
-
var ObservabilityTimeseriesWidget = ({ views, viewToConfigMap, defaultView, defaultPivot, viewSearchKey, pivotSearchKey, header, icon, isStacked = false }) => {
|
|
11
|
-
const updateSearch = useFilamentSearchUpdate();
|
|
12
|
-
const search = useObservabilitySearch();
|
|
13
|
-
const view = search[viewSearchKey] ?? defaultView;
|
|
14
|
-
const searchPivot = search[pivotSearchKey];
|
|
15
|
-
const pivot = searchPivot === MetricDimension.UNSPECIFIED ? void 0 : searchPivot ?? defaultPivot;
|
|
16
|
-
const { seriesLabel, metric, color, valueFormatter } = viewToConfigMap[view];
|
|
17
|
-
const handleViewChange = (nextView) => {
|
|
18
|
-
updateSearch((prev) => ({
|
|
19
|
-
...prev,
|
|
20
|
-
[viewSearchKey]: nextView
|
|
21
|
-
}));
|
|
22
|
-
};
|
|
23
|
-
const handlePivotChange = (nextPivot) => {
|
|
24
|
-
updateSearch((prev) => ({
|
|
25
|
-
...prev,
|
|
26
|
-
[pivotSearchKey]: nextPivot ?? MetricDimension.UNSPECIFIED
|
|
27
|
-
}));
|
|
28
|
-
};
|
|
29
|
-
const switcherItems = views.map((id) => ({
|
|
30
|
-
id,
|
|
31
|
-
label: viewToConfigMap[id].label
|
|
32
|
-
}));
|
|
33
|
-
return /* @__PURE__ */ jsx(Widget, {
|
|
34
|
-
isFlush: true,
|
|
35
|
-
gap: 0,
|
|
36
|
-
header,
|
|
37
|
-
icon,
|
|
38
|
-
actions: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ToggleInput, {
|
|
39
|
-
size: ToggleInputSize.SMALL,
|
|
40
|
-
variant: ToggleInputVariant.PRIMARY,
|
|
41
|
-
options: switcherItems,
|
|
42
|
-
value: view,
|
|
43
|
-
onChange: handleViewChange,
|
|
44
|
-
ariaLabel: `${header} view`
|
|
45
|
-
}), /* @__PURE__ */ jsx(ObservabilityPivotSelect, {
|
|
46
|
-
value: pivot,
|
|
47
|
-
onChange: handlePivotChange
|
|
48
|
-
})] }),
|
|
49
|
-
children: /* @__PURE__ */ jsx(ObservabilityTimeseriesChart, {
|
|
50
|
-
seriesLabel,
|
|
51
|
-
metric,
|
|
52
|
-
color,
|
|
53
|
-
pivot,
|
|
54
|
-
curve: ChartCurve.LINEAR,
|
|
55
|
-
isStacked,
|
|
56
|
-
valueFormatter
|
|
57
|
-
})
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
//#endregion
|
|
61
|
-
export { ObservabilityTimeseriesWidget as default };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ChartPalette, ChartValueFormatter } from '@galaxy-io/dls/charts/types';
|
|
2
|
-
import { SelectOption } from '@galaxy-io/dls/inputs/SelectInput';
|
|
3
|
-
import { Metric } from '../../../../gen/metrics/v1/metrics_pb';
|
|
4
|
-
import { ObservabilityThroughputView, ObservabilityUsageView } from '../../types';
|
|
5
|
-
export declare const OBSERVABILITY_TIMESERIES_CHART_HEIGHT = 240;
|
|
6
|
-
export declare const OBSERVABILITY_TIMESERIES_PIVOT_SELECT_WIDTH = 150;
|
|
7
|
-
export declare const OBSERVABILITY_TIMESERIES_PIVOT_OPTIONS: SelectOption[];
|
|
8
|
-
export declare const OBSERVABILITY_TIMESERIES_PIVOT_PALETTE: ChartPalette[];
|
|
9
|
-
export interface ObservabilityChartView {
|
|
10
|
-
label: string;
|
|
11
|
-
seriesLabel: string;
|
|
12
|
-
metric: Metric;
|
|
13
|
-
color: ChartPalette;
|
|
14
|
-
valueFormatter: ChartValueFormatter;
|
|
15
|
-
}
|
|
16
|
-
export declare const OBSERVABILITY_THROUGHPUT_VIEWS: ObservabilityThroughputView[];
|
|
17
|
-
export declare const OBSERVABILITY_USAGE_VIEWS: ObservabilityUsageView[];
|
|
18
|
-
export declare const OBSERVABILITY_THROUGHPUT_VIEW_TO_CONFIG_MAP: Record<ObservabilityThroughputView, ObservabilityChartView>;
|
|
19
|
-
export declare const OBSERVABILITY_USAGE_VIEW_TO_CONFIG_MAP: Record<ObservabilityUsageView, ObservabilityChartView>;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { ObservabilityThroughputView, ObservabilityUsageView } from "../../types.js";
|
|
2
|
-
import { Metric, MetricDimension } from "../../../../gen/metrics/v1/metrics_pb.js";
|
|
3
|
-
import { formatBytes, formatDuration, formatNumber } from "@galaxy-io/dls/utils/format";
|
|
4
|
-
import { ChartPalette } from "@galaxy-io/dls/charts/types";
|
|
5
|
-
//#region src/pages/observability/components/timeseries/constants.ts
|
|
6
|
-
var OBSERVABILITY_TIMESERIES_PIVOT_OPTIONS = [{
|
|
7
|
-
id: String(MetricDimension.PIPELINE_ID),
|
|
8
|
-
label: "Pipeline"
|
|
9
|
-
}, {
|
|
10
|
-
id: String(MetricDimension.STATUS),
|
|
11
|
-
label: "Status"
|
|
12
|
-
}];
|
|
13
|
-
var OBSERVABILITY_TIMESERIES_PIVOT_PALETTE = [
|
|
14
|
-
ChartPalette.PURPLE,
|
|
15
|
-
ChartPalette.TEAL,
|
|
16
|
-
ChartPalette.PINK,
|
|
17
|
-
ChartPalette.ORANGE,
|
|
18
|
-
ChartPalette.BLUE,
|
|
19
|
-
ChartPalette.GREEN,
|
|
20
|
-
ChartPalette.YELLOW
|
|
21
|
-
];
|
|
22
|
-
var OBSERVABILITY_THROUGHPUT_VIEWS = [ObservabilityThroughputView.RECORDS, ObservabilityThroughputView.VOLUME];
|
|
23
|
-
var OBSERVABILITY_USAGE_VIEWS = [ObservabilityUsageView.CPU, ObservabilityUsageView.MEMORY];
|
|
24
|
-
var OBSERVABILITY_THROUGHPUT_VIEW_TO_CONFIG_MAP = {
|
|
25
|
-
[ObservabilityThroughputView.RECORDS]: {
|
|
26
|
-
label: "Records",
|
|
27
|
-
seriesLabel: "Records",
|
|
28
|
-
metric: Metric.RUN_RECORDS,
|
|
29
|
-
color: ChartPalette.PURPLE,
|
|
30
|
-
valueFormatter: (value) => formatNumber(value, { precision: 0 })
|
|
31
|
-
},
|
|
32
|
-
[ObservabilityThroughputView.VOLUME]: {
|
|
33
|
-
label: "Volume",
|
|
34
|
-
seriesLabel: "Bytes",
|
|
35
|
-
metric: Metric.RUN_BYTES,
|
|
36
|
-
color: ChartPalette.TEAL,
|
|
37
|
-
valueFormatter: (value) => formatBytes(value)
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
var OBSERVABILITY_USAGE_VIEW_TO_CONFIG_MAP = {
|
|
41
|
-
[ObservabilityUsageView.CPU]: {
|
|
42
|
-
label: "CPU",
|
|
43
|
-
seriesLabel: "CPU",
|
|
44
|
-
metric: Metric.RUN_CPU_USAGE,
|
|
45
|
-
color: ChartPalette.ORANGE,
|
|
46
|
-
valueFormatter: (value) => formatDuration(value * 1e3)
|
|
47
|
-
},
|
|
48
|
-
[ObservabilityUsageView.MEMORY]: {
|
|
49
|
-
label: "Memory",
|
|
50
|
-
seriesLabel: "Memory",
|
|
51
|
-
metric: Metric.RUN_MEMORY_USAGE,
|
|
52
|
-
color: ChartPalette.PINK,
|
|
53
|
-
valueFormatter: (value) => formatBytes(value)
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
//#endregion
|
|
57
|
-
export { OBSERVABILITY_THROUGHPUT_VIEWS, OBSERVABILITY_THROUGHPUT_VIEW_TO_CONFIG_MAP, OBSERVABILITY_TIMESERIES_PIVOT_OPTIONS, OBSERVABILITY_TIMESERIES_PIVOT_PALETTE, OBSERVABILITY_USAGE_VIEWS, OBSERVABILITY_USAGE_VIEW_TO_CONFIG_MAP };
|