@oneuptime/common 11.7.2 → 11.7.4
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/Models/AnalyticsModels/KubernetesCostAllocation.ts +103 -0
- package/Models/DatabaseModels/AlertEpisodeStateTimeline.ts +1 -0
- package/Models/DatabaseModels/AlertStateTimeline.ts +1 -0
- package/Models/DatabaseModels/IncidentEpisodeStateTimeline.ts +1 -0
- package/Models/DatabaseModels/IncidentStateTimeline.ts +1 -0
- package/Models/DatabaseModels/Index.ts +5 -0
- package/Models/DatabaseModels/LogDropFilter.ts +89 -0
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +13 -3
- package/Models/DatabaseModels/RecommendationDismissal.ts +463 -0
- package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.ts +1 -0
- package/Models/DatabaseModels/StatusPageGroup.ts +95 -0
- package/Models/DatabaseModels/TableView.ts +40 -0
- package/Models/DatabaseModels/TraceDropFilter.ts +89 -0
- package/Models/DatabaseModels/WorkflowVariable.ts +5 -1
- package/Server/API/AlertAPI.ts +32 -17
- package/Server/API/BaseAPI.ts +31 -2
- package/Server/API/BaseAnalyticsAPI.ts +36 -2
- package/Server/API/CommonAPI.ts +57 -0
- package/Server/API/IncidentAPI.ts +60 -33
- package/Server/API/IncidentEpisodeAPI.ts +31 -16
- package/Server/API/MonitorAPI.ts +30 -0
- package/Server/API/MonitorTemplateAPI.ts +8 -0
- package/Server/API/ProbeAPI.ts +196 -15
- package/Server/API/ProjectAPI.ts +79 -1
- package/Server/API/ScheduledMaintenanceAPI.ts +33 -18
- package/Server/API/StatusPageAPI.ts +74 -37
- package/Server/API/WorkspaceNotificationRuleAPI.ts +34 -4
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785241000000-AddColumnsToTableView.ts +13 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785320000000-RepairCrossProjectIncidentReferences.ts +527 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785329453269-AddParentGroupToStatusPageGroup.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785397674289-AddRecommendationDismissalTable.ts +55 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785405581596-AddDroppedCountersToDropFilters.ts +53 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +10 -0
- package/Server/Services/AlertEpisodeService.ts +47 -0
- package/Server/Services/AlertService.ts +125 -0
- package/Server/Services/BillingService.ts +98 -0
- package/Server/Services/DatabaseService.ts +184 -20
- package/Server/Services/IncidentEpisodeService.ts +47 -0
- package/Server/Services/IncidentService.ts +123 -0
- package/Server/Services/IncidentTemplateService.ts +123 -1
- package/Server/Services/Index.ts +2 -0
- package/Server/Services/LogDropFilterService.ts +133 -0
- package/Server/Services/MonitorProbeService.ts +94 -4
- package/Server/Services/MonitorService.ts +48 -43
- package/Server/Services/NetworkDeviceDiscoveryScanService.ts +70 -0
- package/Server/Services/ProbeService.ts +66 -0
- package/Server/Services/ProjectService.ts +131 -7
- package/Server/Services/RecommendationDismissalService.ts +52 -0
- package/Server/Services/RunbookAgentJobService.ts +68 -7
- package/Server/Services/ScheduledMaintenanceService.ts +103 -0
- package/Server/Services/ScheduledMaintenanceTemplateService.ts +90 -0
- package/Server/Services/StatusPageGroupService.ts +186 -0
- package/Server/Services/TraceDropFilterService.ts +133 -0
- package/Server/Types/Workflow/Components/API/Delete.ts +12 -0
- package/Server/Types/Workflow/Components/API/Get.ts +12 -0
- package/Server/Types/Workflow/Components/API/Patch.ts +12 -0
- package/Server/Types/Workflow/Components/API/Post.ts +12 -0
- package/Server/Types/Workflow/Components/API/Put.ts +13 -0
- package/Server/Utils/Database/ProjectScopedReferenceValidator.ts +212 -0
- package/Server/Utils/DropFilterValidation.ts +127 -0
- package/Server/Utils/Errors.ts +5 -0
- package/Server/Utils/Monitor/MonitorAlert.ts +28 -1
- package/Server/Utils/Monitor/MonitorIncident.ts +31 -2
- package/Server/Utils/Telemetry/AppMetrics.ts +31 -0
- package/Tests/Models/AnalyticsModels/KubernetesCostAllocation.test.ts +16 -0
- package/Tests/Models/DatabaseModels/MonitorProbeColumnAccessControl.test.ts +196 -0
- package/Tests/Models/RecommendationDismissalModel.test.ts +269 -0
- package/Tests/Server/API/BaseAPIUpdatePayloadValidation.test.ts +320 -0
- package/Tests/Server/API/BaseAnalyticsAPIUpdatePayloadValidation.test.ts +293 -0
- package/Tests/Server/API/CommonAPIAuthGuard.test.ts +164 -0
- package/Tests/Server/API/ProbeAPI.test.ts +422 -53
- package/Tests/Server/API/ProjectAPI.test.ts +180 -0
- package/Tests/Server/API/ProjectAPIExtendTrialBillingDisabled.test.ts +138 -0
- package/Tests/Server/API/ProjectScopedCustomRouteAuth.test.ts +458 -0
- package/Tests/Server/Infrastructure/ContainerBootConfiguration.test.ts +359 -0
- package/Tests/Server/Infrastructure/ProcessSignalDelivery.test.ts +427 -0
- package/Tests/Server/Services/BillingServiceExtendTrial.test.ts +439 -0
- package/Tests/Server/Services/CrossProjectReferenceWriteGuard.test.ts +810 -0
- package/Tests/Server/Services/DatabaseServiceAtomicAddToColumns.test.ts +269 -0
- package/Tests/Server/Services/DatabaseServiceEmptyUpdate.test.ts +277 -0
- package/Tests/Server/Services/DatabaseServiceSortColumnSelect.test.ts +201 -0
- package/Tests/Server/Services/DiscoveryScanClaimHookFreeSafety.test.ts +81 -23
- package/Tests/Server/Services/DropFilterSaveValidation.test.ts +398 -0
- package/Tests/Server/Services/MonitorProbeDeleteHooks.test.ts +280 -0
- package/Tests/Server/Services/MonitorProbeServiceProbeTenancy.test.ts +304 -0
- package/Tests/Server/Services/NetworkDeviceDiscoveryScanService.test.ts +262 -0
- package/Tests/Server/Services/ProjectServiceExtendTrial.test.ts +614 -0
- package/Tests/Server/Services/RecommendationDismissalService.test.ts +306 -0
- package/Tests/Server/Services/RepairCrossProjectIncidentReferencesMigration.test.ts +528 -0
- package/Tests/Server/Services/StatusPageGroupNesting.test.ts +395 -0
- package/Tests/Server/TestingUtils/Services/BillingServiceHelper.ts +26 -21
- package/Tests/Server/Types/Database/Permissions/WorkflowVariableColumnPermission.test.ts +227 -0
- package/Tests/Server/Types/Workflow/Components/ApiComponentErrorPort.test.ts +285 -0
- package/Tests/Server/Utils/Database/ProjectScopedReferenceValidator.test.ts +463 -0
- package/Tests/Server/Utils/DropFilterValidation.test.ts +269 -0
- package/Tests/Server/Utils/Telemetry/SpanUtil.test.ts +94 -0
- package/Tests/Types/DateUserTimezone.test.ts +52 -0
- package/Tests/Types/JSONFunctions.test.ts +103 -1
- package/Tests/Types/Monitor/KubernetesAlertTemplates.test.ts +177 -9
- package/Tests/Types/Monitor/MonitorStepDnsMonitor.test.ts +105 -0
- package/Tests/Types/Monitor/MonitorStepDnssecMonitor.test.ts +131 -0
- package/Tests/Types/Monitor/MonitorStepDomainMonitor.test.ts +60 -0
- package/Tests/Types/Monitor/MonitorStepExternalStatusPageMonitor.test.ts +82 -0
- package/Tests/Types/Monitor/MonitorStepInfrastructureMonitors.test.ts +268 -0
- package/Tests/Types/Monitor/MonitorStepMetricMonitor.test.ts +386 -0
- package/Tests/Types/Monitor/MonitorStepProfileMonitor.test.ts +185 -0
- package/Tests/Types/Monitor/MonitorStepSnmpMonitor.test.ts +156 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCatalog.test.ts +371 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCoverage.test.ts +901 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationNotificationMode.test.ts +607 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.test.ts +754 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationUtil.test.ts +960 -0
- package/Tests/Types/RollingTime/RollingTimeUtil.test.ts +186 -0
- package/Tests/Types/Runbook/RunbookStepTimeout.test.ts +410 -0
- package/Tests/Types/Telemetry/DropFilterSampling.test.ts +241 -0
- package/Tests/Types/Workspace/NotificationRuleConditionUtil.test.ts +353 -0
- package/Tests/Types/Workspace/NotificationRuleUtil.test.ts +566 -0
- package/Tests/UI/Components/CodeEditor.test.tsx +174 -0
- package/Tests/UI/Components/ErrorBoundary.test.tsx +555 -24
- package/Tests/UI/Components/InfoCard.test.tsx +358 -0
- package/Tests/UI/Components/LogTimeRangePicker.test.tsx +138 -0
- package/Tests/UI/Components/Modal.test.tsx +43 -5
- package/Tests/UI/Components/ModelTable/BaseModelTableColumnCustomization.test.tsx +679 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableSearchLabels.test.tsx +397 -0
- package/Tests/UI/Components/ModelTable/ColumnCustomizationModal.test.tsx +999 -0
- package/Tests/UI/Components/ModelTable/ColumnPreference.test.ts +1678 -0
- package/Tests/UI/Components/ModelTable/CustomFieldColumns.test.tsx +1094 -0
- package/Tests/UI/Components/Runbook/StepTimeoutInput.test.tsx +386 -0
- package/Tests/UI/Components/StatusPage/ResourceGroupSection.test.tsx +671 -0
- package/Tests/UI/Components/TelemetryTimeRangePicker.test.tsx +404 -0
- package/Tests/UI/Utils/DropdownAlignment.test.ts +306 -0
- package/Tests/UI/Utils/TableFilterUrlState.test.ts +292 -0
- package/Tests/Utils/Monitor/MonitorSummaryProbeUtil.test.ts +263 -0
- package/Tests/Utils/NetworkDiscovery/ScanTargetUtil.test.ts +583 -0
- package/Tests/Utils/StatusPage/GroupNestingLayout.test.ts +1072 -0
- package/Tests/Utils/StatusPage/GroupTree.test.ts +583 -0
- package/Tests/Utils/StatusPage/ResourceUptime.test.ts +411 -0
- package/Tests/Utils/UserPreferences.test.ts +563 -0
- package/Types/Date.ts +15 -6
- package/Types/JSONFunctions.ts +7 -2
- package/Types/Kubernetes/KubernetesCostIngest.ts +37 -1
- package/Types/Monitor/KubernetesAlertTemplates.ts +205 -0
- package/Types/Monitor/MonitorStep.ts +10 -1
- package/Types/Monitor/MonitorStepMetricMonitor.ts +46 -1
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.ts +413 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.ts +168 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationTypes.ts +175 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.ts +743 -0
- package/Types/Permission.ts +45 -0
- package/Types/Recommendation/RecommendationType.ts +20 -0
- package/Types/Runbook/RunbookExecutionDeadline.ts +129 -0
- package/Types/Runbook/RunbookStepTimeout.ts +202 -0
- package/Types/Telemetry/DropFilterSampling.ts +92 -0
- package/UI/Components/AI/GenerateFromAIModal.tsx +0 -2
- package/UI/Components/Accordion/Accordion.tsx +10 -2
- package/UI/Components/BulkUpdate/BulkLabelActions.tsx +0 -1
- package/UI/Components/CodeEditor/CodeEditor.tsx +34 -20
- package/UI/Components/Date/RangeStartAndEndDateView.tsx +0 -1
- package/UI/Components/EditionLabel/EditionLabel.tsx +1 -27
- package/UI/Components/Error/PageError.tsx +0 -4
- package/UI/Components/ErrorBoundary.tsx +252 -15
- package/UI/Components/InfoCard/InfoCard.tsx +58 -1
- package/UI/Components/LogsViewer/components/LogTimeRangePicker.tsx +34 -1
- package/UI/Components/MasterPage/MasterPage.tsx +65 -0
- package/UI/Components/Modal/Modal.tsx +16 -60
- package/UI/Components/ModelFormModal/ModelFormModal.tsx +0 -8
- package/UI/Components/ModelTable/BaseModelTable.tsx +503 -71
- package/UI/Components/ModelTable/Column.ts +17 -0
- package/UI/Components/ModelTable/ColumnCustomizationModal.tsx +523 -0
- package/UI/Components/ModelTable/ColumnPreference.ts +482 -0
- package/UI/Components/ModelTable/CustomFieldColumns.tsx +326 -0
- package/UI/Components/ModelTable/TableView.tsx +24 -2
- package/UI/Components/ModelTable/useCustomFieldColumns.ts +150 -0
- package/UI/Components/Runbook/StepTimeoutInput.tsx +173 -0
- package/UI/Components/SideMenu/SideMenu.tsx +24 -4
- package/UI/Components/StatusPage/ResourceGroupSection.tsx +231 -0
- package/UI/Components/Table/Table.tsx +14 -1
- package/UI/Components/Table/TableRow.tsx +180 -175
- package/UI/Components/Table/Types/Column.ts +2 -0
- package/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.tsx +34 -1
- package/UI/Utils/DropdownAlignment.ts +162 -0
- package/UI/Utils/TableFilterUrlState.ts +59 -20
- package/Utils/API.ts +106 -2
- package/Utils/Monitor/MonitorSummaryProbeUtil.ts +130 -0
- package/Utils/NetworkDiscovery/ScanTargetUtil.ts +434 -0
- package/Utils/StatusPage/GroupNestingLayout.ts +343 -0
- package/Utils/StatusPage/GroupTree.ts +307 -0
- package/Utils/StatusPage/ResourceUptime.ts +90 -17
- package/Utils/UserPreferences.ts +53 -0
- package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js +86 -0
- package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertEpisodeStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/AlertStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentEpisodeStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/IncidentEpisodeStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/LogDropFilter.js +91 -0
- package/build/dist/Models/DatabaseModels/LogDropFilter.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +14 -4
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
- package/build/dist/Models/DatabaseModels/RecommendationDismissal.js +484 -0
- package/build/dist/Models/DatabaseModels/RecommendationDismissal.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageGroup.js +94 -0
- package/build/dist/Models/DatabaseModels/StatusPageGroup.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TableView.js +40 -0
- package/build/dist/Models/DatabaseModels/TableView.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TraceDropFilter.js +91 -0
- package/build/dist/Models/DatabaseModels/TraceDropFilter.js.map +1 -1
- package/build/dist/Models/DatabaseModels/WorkflowVariable.js +5 -1
- package/build/dist/Models/DatabaseModels/WorkflowVariable.js.map +1 -1
- package/build/dist/Server/API/AlertAPI.js +22 -13
- package/build/dist/Server/API/AlertAPI.js.map +1 -1
- package/build/dist/Server/API/BaseAPI.js +22 -1
- package/build/dist/Server/API/BaseAPI.js.map +1 -1
- package/build/dist/Server/API/BaseAnalyticsAPI.js +24 -1
- package/build/dist/Server/API/BaseAnalyticsAPI.js.map +1 -1
- package/build/dist/Server/API/CommonAPI.js +42 -0
- package/build/dist/Server/API/CommonAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentAPI.js +43 -26
- package/build/dist/Server/API/IncidentAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentEpisodeAPI.js +21 -12
- package/build/dist/Server/API/IncidentEpisodeAPI.js.map +1 -1
- package/build/dist/Server/API/MonitorAPI.js +23 -0
- package/build/dist/Server/API/MonitorAPI.js.map +1 -1
- package/build/dist/Server/API/MonitorTemplateAPI.js +4 -0
- package/build/dist/Server/API/MonitorTemplateAPI.js.map +1 -1
- package/build/dist/Server/API/ProbeAPI.js +131 -15
- package/build/dist/Server/API/ProbeAPI.js.map +1 -1
- package/build/dist/Server/API/ProjectAPI.js +62 -3
- package/build/dist/Server/API/ProjectAPI.js.map +1 -1
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js +23 -14
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +61 -33
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/API/WorkspaceNotificationRuleAPI.js +26 -2
- package/build/dist/Server/API/WorkspaceNotificationRuleAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785241000000-AddColumnsToTableView.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785241000000-AddColumnsToTableView.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785320000000-RepairCrossProjectIncidentReferences.js +397 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785320000000-RepairCrossProjectIncidentReferences.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785329453269-AddParentGroupToStatusPageGroup.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785329453269-AddParentGroupToStatusPageGroup.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785397674289-AddRecommendationDismissalTable.js +30 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785397674289-AddRecommendationDismissalTable.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785405581596-AddDroppedCountersToDropFilters.js +34 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785405581596-AddDroppedCountersToDropFilters.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +10 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AlertEpisodeService.js +39 -0
- package/build/dist/Server/Services/AlertEpisodeService.js.map +1 -1
- package/build/dist/Server/Services/AlertService.js +95 -0
- package/build/dist/Server/Services/AlertService.js.map +1 -1
- package/build/dist/Server/Services/BillingService.js +71 -0
- package/build/dist/Server/Services/BillingService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +140 -17
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeService.js +39 -0
- package/build/dist/Server/Services/IncidentEpisodeService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +100 -0
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentTemplateService.js +97 -0
- package/build/dist/Server/Services/IncidentTemplateService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +2 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/LogDropFilterService.js +93 -0
- package/build/dist/Server/Services/LogDropFilterService.js.map +1 -1
- package/build/dist/Server/Services/MonitorProbeService.js +73 -5
- package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +34 -39
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js +71 -0
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js.map +1 -1
- package/build/dist/Server/Services/ProbeService.js +64 -0
- package/build/dist/Server/Services/ProbeService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +103 -7
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/RecommendationDismissalService.js +50 -0
- package/build/dist/Server/Services/RecommendationDismissalService.js.map +1 -0
- package/build/dist/Server/Services/RunbookAgentJobService.js +63 -5
- package/build/dist/Server/Services/RunbookAgentJobService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceService.js +83 -0
- package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceTemplateService.js +65 -0
- package/build/dist/Server/Services/ScheduledMaintenanceTemplateService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageGroupService.js +136 -0
- package/build/dist/Server/Services/StatusPageGroupService.js.map +1 -1
- package/build/dist/Server/Services/TraceDropFilterService.js +93 -0
- package/build/dist/Server/Services/TraceDropFilterService.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Get.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Get.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Post.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Put.js +12 -0
- package/build/dist/Server/Types/Workflow/Components/API/Put.js.map +1 -1
- package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js +132 -0
- package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js.map +1 -0
- package/build/dist/Server/Utils/DropFilterValidation.js +80 -0
- package/build/dist/Server/Utils/DropFilterValidation.js.map +1 -0
- package/build/dist/Server/Utils/Errors.js +3 -0
- package/build/dist/Server/Utils/Errors.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +30 -12
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +38 -18
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/AppMetrics.js +26 -0
- package/build/dist/Server/Utils/Telemetry/AppMetrics.js.map +1 -1
- package/build/dist/Types/Date.js +14 -4
- package/build/dist/Types/Date.js.map +1 -1
- package/build/dist/Types/JSONFunctions.js +8 -3
- package/build/dist/Types/JSONFunctions.js.map +1 -1
- package/build/dist/Types/Kubernetes/KubernetesCostIngest.js.map +1 -1
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +192 -0
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +6 -1
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepMetricMonitor.js +32 -1
- package/build/dist/Types/Monitor/MonitorStepMetricMonitor.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +294 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js.map +1 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.js +110 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.js.map +1 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js +58 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js.map +1 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +451 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js.map +1 -0
- package/build/dist/Types/Permission.js +40 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Recommendation/RecommendationType.js +21 -0
- package/build/dist/Types/Recommendation/RecommendationType.js.map +1 -0
- package/build/dist/Types/Runbook/RunbookExecutionDeadline.js +93 -0
- package/build/dist/Types/Runbook/RunbookExecutionDeadline.js.map +1 -0
- package/build/dist/Types/Runbook/RunbookStepTimeout.js +142 -0
- package/build/dist/Types/Runbook/RunbookStepTimeout.js.map +1 -0
- package/build/dist/Types/Telemetry/DropFilterSampling.js +75 -0
- package/build/dist/Types/Telemetry/DropFilterSampling.js.map +1 -0
- package/build/dist/UI/Components/AI/GenerateFromAIModal.js +1 -2
- package/build/dist/UI/Components/AI/GenerateFromAIModal.js.map +1 -1
- package/build/dist/UI/Components/Accordion/Accordion.js +9 -2
- package/build/dist/UI/Components/Accordion/Accordion.js.map +1 -1
- package/build/dist/UI/Components/BulkUpdate/BulkLabelActions.js +1 -1
- package/build/dist/UI/Components/BulkUpdate/BulkLabelActions.js.map +1 -1
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js +27 -14
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js.map +1 -1
- package/build/dist/UI/Components/Date/RangeStartAndEndDateView.js +1 -1
- package/build/dist/UI/Components/Date/RangeStartAndEndDateView.js.map +1 -1
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js +2 -20
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js.map +1 -1
- package/build/dist/UI/Components/Error/PageError.js +1 -3
- package/build/dist/UI/Components/Error/PageError.js.map +1 -1
- package/build/dist/UI/Components/ErrorBoundary.js +145 -11
- package/build/dist/UI/Components/ErrorBoundary.js.map +1 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js +28 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogTimeRangePicker.js +13 -2
- package/build/dist/UI/Components/LogsViewer/components/LogTimeRangePicker.js.map +1 -1
- package/build/dist/UI/Components/MasterPage/MasterPage.js +50 -1
- package/build/dist/UI/Components/MasterPage/MasterPage.js.map +1 -1
- package/build/dist/UI/Components/Modal/Modal.js +4 -32
- package/build/dist/UI/Components/Modal/Modal.js.map +1 -1
- package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +308 -40
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js +230 -0
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/ColumnPreference.js +258 -0
- package/build/dist/UI/Components/ModelTable/ColumnPreference.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js +168 -0
- package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/TableView.js +13 -2
- package/build/dist/UI/Components/ModelTable/TableView.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/useCustomFieldColumns.js +84 -0
- package/build/dist/UI/Components/ModelTable/useCustomFieldColumns.js.map +1 -0
- package/build/dist/UI/Components/Runbook/StepTimeoutInput.js +101 -0
- package/build/dist/UI/Components/Runbook/StepTimeoutInput.js.map +1 -0
- package/build/dist/UI/Components/SideMenu/SideMenu.js +15 -5
- package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
- package/build/dist/UI/Components/StatusPage/ResourceGroupSection.js +73 -0
- package/build/dist/UI/Components/StatusPage/ResourceGroupSection.js.map +1 -0
- package/build/dist/UI/Components/Table/Table.js +15 -2
- package/build/dist/UI/Components/Table/Table.js.map +1 -1
- package/build/dist/UI/Components/Table/TableRow.js +11 -6
- package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.js +13 -2
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.js.map +1 -1
- package/build/dist/UI/Utils/DropdownAlignment.js +98 -0
- package/build/dist/UI/Utils/DropdownAlignment.js.map +1 -0
- package/build/dist/UI/Utils/TableFilterUrlState.js +48 -15
- package/build/dist/UI/Utils/TableFilterUrlState.js.map +1 -1
- package/build/dist/Utils/API.js +39 -2
- package/build/dist/Utils/API.js.map +1 -1
- package/build/dist/Utils/Monitor/MonitorSummaryProbeUtil.js +97 -0
- package/build/dist/Utils/Monitor/MonitorSummaryProbeUtil.js.map +1 -0
- package/build/dist/Utils/NetworkDiscovery/ScanTargetUtil.js +330 -0
- package/build/dist/Utils/NetworkDiscovery/ScanTargetUtil.js.map +1 -0
- package/build/dist/Utils/StatusPage/GroupNestingLayout.js +280 -0
- package/build/dist/Utils/StatusPage/GroupNestingLayout.js.map +1 -0
- package/build/dist/Utils/StatusPage/GroupTree.js +214 -0
- package/build/dist/Utils/StatusPage/GroupTree.js.map +1 -0
- package/build/dist/Utils/StatusPage/ResourceUptime.js +60 -16
- package/build/dist/Utils/StatusPage/ResourceUptime.js.map +1 -1
- package/build/dist/Utils/UserPreferences.js +33 -0
- package/build/dist/Utils/UserPreferences.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import MonitorStep from "../MonitorStep";
|
|
2
|
+
import MonitorType from "../MonitorType";
|
|
3
|
+
import IconProp from "../../Icon/IconProp";
|
|
4
|
+
import RecommendationType from "../../Recommendation/RecommendationType";
|
|
5
|
+
import {
|
|
6
|
+
MonitorRecommendation,
|
|
7
|
+
MonitorRecommendationArgs,
|
|
8
|
+
MonitorRecommendationResourceType,
|
|
9
|
+
MonitorRecommendationSeverity,
|
|
10
|
+
buildRecommendationId,
|
|
11
|
+
} from "./MonitorRecommendationTypes";
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
CephAlertTemplate,
|
|
15
|
+
getAllCephAlertTemplates,
|
|
16
|
+
} from "../CephAlertTemplates";
|
|
17
|
+
import {
|
|
18
|
+
DockerAlertTemplate,
|
|
19
|
+
getAllDockerAlertTemplates,
|
|
20
|
+
} from "../DockerAlertTemplates";
|
|
21
|
+
import {
|
|
22
|
+
DockerSwarmAlertTemplate,
|
|
23
|
+
getAllDockerSwarmAlertTemplates,
|
|
24
|
+
} from "../DockerSwarmAlertTemplates";
|
|
25
|
+
import {
|
|
26
|
+
HostAlertTemplate,
|
|
27
|
+
getAllHostAlertTemplates,
|
|
28
|
+
} from "../HostAlertTemplates";
|
|
29
|
+
import {
|
|
30
|
+
IoTAlertTemplate,
|
|
31
|
+
getAllIoTAlertTemplates,
|
|
32
|
+
} from "../IotAlertTemplates";
|
|
33
|
+
import {
|
|
34
|
+
KubernetesAlertTemplate,
|
|
35
|
+
getAllKubernetesAlertTemplates,
|
|
36
|
+
} from "../KubernetesAlertTemplates";
|
|
37
|
+
import {
|
|
38
|
+
PodmanAlertTemplate,
|
|
39
|
+
getAllPodmanAlertTemplates,
|
|
40
|
+
} from "../PodmanAlertTemplates";
|
|
41
|
+
import {
|
|
42
|
+
ProxmoxAlertTemplate,
|
|
43
|
+
getAllProxmoxAlertTemplates,
|
|
44
|
+
} from "../ProxmoxAlertTemplates";
|
|
45
|
+
|
|
46
|
+
/*
|
|
47
|
+
* A resource type's entry in the registry.
|
|
48
|
+
*
|
|
49
|
+
* `identifierFieldName` is documentation that the tests enforce: it names the
|
|
50
|
+
* field the underlying module's `<X>AlertTemplateArgs` actually uses, so that
|
|
51
|
+
* a future rename in a template module fails a test here instead of silently
|
|
52
|
+
* producing monitors scoped to `undefined`.
|
|
53
|
+
*/
|
|
54
|
+
export interface MonitorRecommendationResourceTypeDefinition {
|
|
55
|
+
resourceType: MonitorRecommendationResourceType;
|
|
56
|
+
monitorType: MonitorType;
|
|
57
|
+
// Human label, singular, e.g. "Kubernetes Cluster".
|
|
58
|
+
resourceLabel: string;
|
|
59
|
+
// The field name in the owning module's own args interface.
|
|
60
|
+
identifierFieldName:
|
|
61
|
+
| "clusterIdentifier"
|
|
62
|
+
| "hostIdentifier"
|
|
63
|
+
| "fleetIdentifier";
|
|
64
|
+
icon: IconProp;
|
|
65
|
+
getRecommendations: () => Array<MonitorRecommendation>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
* The structural shape every `<X>AlertTemplate` interface shares. The eight
|
|
70
|
+
* modules declare eight separate interfaces that differ only in the literal
|
|
71
|
+
* union used for `category` (and the args type of `getMonitorStep`), so the
|
|
72
|
+
* normalizer below widens `category` to `string` rather than trying to union
|
|
73
|
+
* eight unrelated literal unions.
|
|
74
|
+
*/
|
|
75
|
+
interface StructuralAlertTemplate {
|
|
76
|
+
id: string;
|
|
77
|
+
name: string;
|
|
78
|
+
description: string;
|
|
79
|
+
category: string;
|
|
80
|
+
severity: MonitorRecommendationSeverity;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
type MonitorStepBuilder = (args: MonitorRecommendationArgs) => MonitorStep;
|
|
84
|
+
|
|
85
|
+
function normalize(data: {
|
|
86
|
+
resourceType: MonitorRecommendationResourceType;
|
|
87
|
+
monitorType: MonitorType;
|
|
88
|
+
template: StructuralAlertTemplate;
|
|
89
|
+
getMonitorStep: MonitorStepBuilder;
|
|
90
|
+
}): MonitorRecommendation {
|
|
91
|
+
return {
|
|
92
|
+
recommendationId: buildRecommendationId(
|
|
93
|
+
data.resourceType,
|
|
94
|
+
data.template.id,
|
|
95
|
+
),
|
|
96
|
+
recommendationType: RecommendationType.Monitor,
|
|
97
|
+
resourceType: data.resourceType,
|
|
98
|
+
monitorType: data.monitorType,
|
|
99
|
+
templateId: data.template.id,
|
|
100
|
+
name: data.template.name,
|
|
101
|
+
description: data.template.description,
|
|
102
|
+
category: data.template.category,
|
|
103
|
+
severity: data.template.severity,
|
|
104
|
+
getMonitorStep: data.getMonitorStep,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/*
|
|
109
|
+
* One adapter per module. Each is deliberately written out rather than
|
|
110
|
+
* generated from a lookup table: the args field rename is the only thing that
|
|
111
|
+
* differs, and doing it explicitly keeps every call site fully type-checked
|
|
112
|
+
* against that module's real args interface. A generic version would need
|
|
113
|
+
* `any` and would not catch a renamed field.
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
function getKubernetesRecommendations(): Array<MonitorRecommendation> {
|
|
117
|
+
return getAllKubernetesAlertTemplates().map(
|
|
118
|
+
(template: KubernetesAlertTemplate) => {
|
|
119
|
+
return normalize({
|
|
120
|
+
resourceType: MonitorRecommendationResourceType.Kubernetes,
|
|
121
|
+
monitorType: MonitorType.Kubernetes,
|
|
122
|
+
template: template,
|
|
123
|
+
getMonitorStep: (args: MonitorRecommendationArgs) => {
|
|
124
|
+
return template.getMonitorStep({
|
|
125
|
+
clusterIdentifier: args.resourceIdentifier,
|
|
126
|
+
onlineMonitorStatusId: args.onlineMonitorStatusId,
|
|
127
|
+
offlineMonitorStatusId: args.offlineMonitorStatusId,
|
|
128
|
+
defaultIncidentSeverityId: args.defaultIncidentSeverityId,
|
|
129
|
+
defaultAlertSeverityId: args.defaultAlertSeverityId,
|
|
130
|
+
monitorName: args.monitorName,
|
|
131
|
+
});
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function getHostRecommendations(): Array<MonitorRecommendation> {
|
|
139
|
+
return getAllHostAlertTemplates().map((template: HostAlertTemplate) => {
|
|
140
|
+
return normalize({
|
|
141
|
+
resourceType: MonitorRecommendationResourceType.Host,
|
|
142
|
+
monitorType: MonitorType.Host,
|
|
143
|
+
template: template,
|
|
144
|
+
getMonitorStep: (args: MonitorRecommendationArgs) => {
|
|
145
|
+
return template.getMonitorStep({
|
|
146
|
+
hostIdentifier: args.resourceIdentifier,
|
|
147
|
+
onlineMonitorStatusId: args.onlineMonitorStatusId,
|
|
148
|
+
offlineMonitorStatusId: args.offlineMonitorStatusId,
|
|
149
|
+
defaultIncidentSeverityId: args.defaultIncidentSeverityId,
|
|
150
|
+
defaultAlertSeverityId: args.defaultAlertSeverityId,
|
|
151
|
+
monitorName: args.monitorName,
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function getDockerRecommendations(): Array<MonitorRecommendation> {
|
|
159
|
+
return getAllDockerAlertTemplates().map((template: DockerAlertTemplate) => {
|
|
160
|
+
return normalize({
|
|
161
|
+
resourceType: MonitorRecommendationResourceType.Docker,
|
|
162
|
+
monitorType: MonitorType.Docker,
|
|
163
|
+
template: template,
|
|
164
|
+
getMonitorStep: (args: MonitorRecommendationArgs) => {
|
|
165
|
+
return template.getMonitorStep({
|
|
166
|
+
hostIdentifier: args.resourceIdentifier,
|
|
167
|
+
onlineMonitorStatusId: args.onlineMonitorStatusId,
|
|
168
|
+
offlineMonitorStatusId: args.offlineMonitorStatusId,
|
|
169
|
+
defaultIncidentSeverityId: args.defaultIncidentSeverityId,
|
|
170
|
+
defaultAlertSeverityId: args.defaultAlertSeverityId,
|
|
171
|
+
monitorName: args.monitorName,
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function getDockerSwarmRecommendations(): Array<MonitorRecommendation> {
|
|
179
|
+
return getAllDockerSwarmAlertTemplates().map(
|
|
180
|
+
(template: DockerSwarmAlertTemplate) => {
|
|
181
|
+
return normalize({
|
|
182
|
+
resourceType: MonitorRecommendationResourceType.DockerSwarm,
|
|
183
|
+
monitorType: MonitorType.DockerSwarm,
|
|
184
|
+
template: template,
|
|
185
|
+
getMonitorStep: (args: MonitorRecommendationArgs) => {
|
|
186
|
+
return template.getMonitorStep({
|
|
187
|
+
clusterIdentifier: args.resourceIdentifier,
|
|
188
|
+
onlineMonitorStatusId: args.onlineMonitorStatusId,
|
|
189
|
+
offlineMonitorStatusId: args.offlineMonitorStatusId,
|
|
190
|
+
defaultIncidentSeverityId: args.defaultIncidentSeverityId,
|
|
191
|
+
defaultAlertSeverityId: args.defaultAlertSeverityId,
|
|
192
|
+
monitorName: args.monitorName,
|
|
193
|
+
});
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
},
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function getPodmanRecommendations(): Array<MonitorRecommendation> {
|
|
201
|
+
return getAllPodmanAlertTemplates().map((template: PodmanAlertTemplate) => {
|
|
202
|
+
return normalize({
|
|
203
|
+
resourceType: MonitorRecommendationResourceType.Podman,
|
|
204
|
+
monitorType: MonitorType.Podman,
|
|
205
|
+
template: template,
|
|
206
|
+
getMonitorStep: (args: MonitorRecommendationArgs) => {
|
|
207
|
+
return template.getMonitorStep({
|
|
208
|
+
hostIdentifier: args.resourceIdentifier,
|
|
209
|
+
onlineMonitorStatusId: args.onlineMonitorStatusId,
|
|
210
|
+
offlineMonitorStatusId: args.offlineMonitorStatusId,
|
|
211
|
+
defaultIncidentSeverityId: args.defaultIncidentSeverityId,
|
|
212
|
+
defaultAlertSeverityId: args.defaultAlertSeverityId,
|
|
213
|
+
monitorName: args.monitorName,
|
|
214
|
+
});
|
|
215
|
+
},
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function getProxmoxRecommendations(): Array<MonitorRecommendation> {
|
|
221
|
+
return getAllProxmoxAlertTemplates().map((template: ProxmoxAlertTemplate) => {
|
|
222
|
+
return normalize({
|
|
223
|
+
resourceType: MonitorRecommendationResourceType.Proxmox,
|
|
224
|
+
monitorType: MonitorType.Proxmox,
|
|
225
|
+
template: template,
|
|
226
|
+
getMonitorStep: (args: MonitorRecommendationArgs) => {
|
|
227
|
+
return template.getMonitorStep({
|
|
228
|
+
clusterIdentifier: args.resourceIdentifier,
|
|
229
|
+
onlineMonitorStatusId: args.onlineMonitorStatusId,
|
|
230
|
+
offlineMonitorStatusId: args.offlineMonitorStatusId,
|
|
231
|
+
defaultIncidentSeverityId: args.defaultIncidentSeverityId,
|
|
232
|
+
defaultAlertSeverityId: args.defaultAlertSeverityId,
|
|
233
|
+
monitorName: args.monitorName,
|
|
234
|
+
});
|
|
235
|
+
},
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function getCephRecommendations(): Array<MonitorRecommendation> {
|
|
241
|
+
return getAllCephAlertTemplates().map((template: CephAlertTemplate) => {
|
|
242
|
+
return normalize({
|
|
243
|
+
resourceType: MonitorRecommendationResourceType.Ceph,
|
|
244
|
+
monitorType: MonitorType.Ceph,
|
|
245
|
+
template: template,
|
|
246
|
+
getMonitorStep: (args: MonitorRecommendationArgs) => {
|
|
247
|
+
return template.getMonitorStep({
|
|
248
|
+
clusterIdentifier: args.resourceIdentifier,
|
|
249
|
+
onlineMonitorStatusId: args.onlineMonitorStatusId,
|
|
250
|
+
offlineMonitorStatusId: args.offlineMonitorStatusId,
|
|
251
|
+
defaultIncidentSeverityId: args.defaultIncidentSeverityId,
|
|
252
|
+
defaultAlertSeverityId: args.defaultAlertSeverityId,
|
|
253
|
+
monitorName: args.monitorName,
|
|
254
|
+
});
|
|
255
|
+
},
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function getIoTRecommendations(): Array<MonitorRecommendation> {
|
|
261
|
+
return getAllIoTAlertTemplates().map((template: IoTAlertTemplate) => {
|
|
262
|
+
return normalize({
|
|
263
|
+
resourceType: MonitorRecommendationResourceType.IoTDevice,
|
|
264
|
+
monitorType: MonitorType.IoTDevice,
|
|
265
|
+
template: template,
|
|
266
|
+
getMonitorStep: (args: MonitorRecommendationArgs) => {
|
|
267
|
+
return template.getMonitorStep({
|
|
268
|
+
fleetIdentifier: args.resourceIdentifier,
|
|
269
|
+
onlineMonitorStatusId: args.onlineMonitorStatusId,
|
|
270
|
+
offlineMonitorStatusId: args.offlineMonitorStatusId,
|
|
271
|
+
defaultIncidentSeverityId: args.defaultIncidentSeverityId,
|
|
272
|
+
defaultAlertSeverityId: args.defaultAlertSeverityId,
|
|
273
|
+
monitorName: args.monitorName,
|
|
274
|
+
});
|
|
275
|
+
},
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
const RESOURCE_TYPE_DEFINITIONS: Array<MonitorRecommendationResourceTypeDefinition> =
|
|
281
|
+
[
|
|
282
|
+
{
|
|
283
|
+
resourceType: MonitorRecommendationResourceType.Kubernetes,
|
|
284
|
+
monitorType: MonitorType.Kubernetes,
|
|
285
|
+
resourceLabel: "Kubernetes Cluster",
|
|
286
|
+
identifierFieldName: "clusterIdentifier",
|
|
287
|
+
icon: IconProp.Kubernetes,
|
|
288
|
+
getRecommendations: getKubernetesRecommendations,
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
resourceType: MonitorRecommendationResourceType.Host,
|
|
292
|
+
monitorType: MonitorType.Host,
|
|
293
|
+
resourceLabel: "Host",
|
|
294
|
+
identifierFieldName: "hostIdentifier",
|
|
295
|
+
icon: IconProp.Server,
|
|
296
|
+
getRecommendations: getHostRecommendations,
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
resourceType: MonitorRecommendationResourceType.Docker,
|
|
300
|
+
monitorType: MonitorType.Docker,
|
|
301
|
+
resourceLabel: "Docker Host",
|
|
302
|
+
identifierFieldName: "hostIdentifier",
|
|
303
|
+
icon: IconProp.Docker,
|
|
304
|
+
getRecommendations: getDockerRecommendations,
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
resourceType: MonitorRecommendationResourceType.DockerSwarm,
|
|
308
|
+
monitorType: MonitorType.DockerSwarm,
|
|
309
|
+
resourceLabel: "Docker Swarm Cluster",
|
|
310
|
+
identifierFieldName: "clusterIdentifier",
|
|
311
|
+
icon: IconProp.DockerSwarm,
|
|
312
|
+
getRecommendations: getDockerSwarmRecommendations,
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
resourceType: MonitorRecommendationResourceType.Podman,
|
|
316
|
+
monitorType: MonitorType.Podman,
|
|
317
|
+
resourceLabel: "Podman Host",
|
|
318
|
+
identifierFieldName: "hostIdentifier",
|
|
319
|
+
icon: IconProp.Podman,
|
|
320
|
+
getRecommendations: getPodmanRecommendations,
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
resourceType: MonitorRecommendationResourceType.Proxmox,
|
|
324
|
+
monitorType: MonitorType.Proxmox,
|
|
325
|
+
resourceLabel: "Proxmox Cluster",
|
|
326
|
+
identifierFieldName: "clusterIdentifier",
|
|
327
|
+
icon: IconProp.Server,
|
|
328
|
+
getRecommendations: getProxmoxRecommendations,
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
resourceType: MonitorRecommendationResourceType.Ceph,
|
|
332
|
+
monitorType: MonitorType.Ceph,
|
|
333
|
+
resourceLabel: "Ceph Cluster",
|
|
334
|
+
identifierFieldName: "clusterIdentifier",
|
|
335
|
+
icon: IconProp.Database,
|
|
336
|
+
getRecommendations: getCephRecommendations,
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
resourceType: MonitorRecommendationResourceType.IoTDevice,
|
|
340
|
+
monitorType: MonitorType.IoTDevice,
|
|
341
|
+
resourceLabel: "IoT Fleet",
|
|
342
|
+
identifierFieldName: "fleetIdentifier",
|
|
343
|
+
icon: IconProp.CPUChip,
|
|
344
|
+
getRecommendations: getIoTRecommendations,
|
|
345
|
+
},
|
|
346
|
+
];
|
|
347
|
+
|
|
348
|
+
export default class MonitorRecommendationCatalog {
|
|
349
|
+
public static getResourceTypeDefinitions(): Array<MonitorRecommendationResourceTypeDefinition> {
|
|
350
|
+
return [...RESOURCE_TYPE_DEFINITIONS];
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
public static getResourceTypeDefinition(
|
|
354
|
+
resourceType: MonitorRecommendationResourceType,
|
|
355
|
+
): MonitorRecommendationResourceTypeDefinition | undefined {
|
|
356
|
+
return RESOURCE_TYPE_DEFINITIONS.find(
|
|
357
|
+
(definition: MonitorRecommendationResourceTypeDefinition) => {
|
|
358
|
+
return definition.resourceType === resourceType;
|
|
359
|
+
},
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
public static getRecommendations(
|
|
364
|
+
resourceType: MonitorRecommendationResourceType,
|
|
365
|
+
): Array<MonitorRecommendation> {
|
|
366
|
+
const definition: MonitorRecommendationResourceTypeDefinition | undefined =
|
|
367
|
+
this.getResourceTypeDefinition(resourceType);
|
|
368
|
+
|
|
369
|
+
if (!definition) {
|
|
370
|
+
return [];
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
return definition.getRecommendations();
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
public static getAllRecommendations(): Array<MonitorRecommendation> {
|
|
377
|
+
return RESOURCE_TYPE_DEFINITIONS.flatMap(
|
|
378
|
+
(definition: MonitorRecommendationResourceTypeDefinition) => {
|
|
379
|
+
return definition.getRecommendations();
|
|
380
|
+
},
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
public static getRecommendationById(
|
|
385
|
+
recommendationId: string,
|
|
386
|
+
): MonitorRecommendation | undefined {
|
|
387
|
+
return this.getAllRecommendations().find(
|
|
388
|
+
(recommendation: MonitorRecommendation) => {
|
|
389
|
+
return recommendation.recommendationId === recommendationId;
|
|
390
|
+
},
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/*
|
|
395
|
+
* Distinct categories for a resource type, in the order the underlying
|
|
396
|
+
* module declares its templates. Order matters for the UI: the modules list
|
|
397
|
+
* their most important templates first, and the page renders category
|
|
398
|
+
* sections in this order.
|
|
399
|
+
*/
|
|
400
|
+
public static getCategories(
|
|
401
|
+
resourceType: MonitorRecommendationResourceType,
|
|
402
|
+
): Array<string> {
|
|
403
|
+
const categories: Array<string> = [];
|
|
404
|
+
|
|
405
|
+
for (const recommendation of this.getRecommendations(resourceType)) {
|
|
406
|
+
if (!categories.includes(recommendation.category)) {
|
|
407
|
+
categories.push(recommendation.category);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
return categories;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import ObjectID from "../../ObjectID";
|
|
2
|
+
import {
|
|
3
|
+
MonitorRecommendationSeverity,
|
|
4
|
+
MonitorRecommendationSeverityMap,
|
|
5
|
+
} from "./MonitorRecommendationTypes";
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* The slice of an IncidentSeverity / AlertSeverity row this mapping needs.
|
|
9
|
+
*
|
|
10
|
+
* Deliberately structural rather than the model classes: this module lives in
|
|
11
|
+
* `Common/Types` and is imported by both the dashboard and the tests, neither
|
|
12
|
+
* of which should have to construct a full database model to ask "which
|
|
13
|
+
* severity does Warning map to".
|
|
14
|
+
*/
|
|
15
|
+
export interface MonitorRecommendationSeverityOption {
|
|
16
|
+
id: ObjectID;
|
|
17
|
+
name: string;
|
|
18
|
+
// Project-defined rank. 1 is the most severe. May be absent on legacy rows.
|
|
19
|
+
order?: number | undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/*
|
|
23
|
+
* Maps a recommendation's declared severity (`Critical` / `Warning`) onto one
|
|
24
|
+
* of the project's own incident or alert severities.
|
|
25
|
+
*
|
|
26
|
+
* Why this exists: the templates take a single `defaultIncidentSeverityId`
|
|
27
|
+
* argument, and the page filled it with the project's first severity. So
|
|
28
|
+
* "Deployment Replica Mismatch" (Warning) and "Node Not Ready" (Critical)
|
|
29
|
+
* both opened a Critical Incident. Every recommendation paged at the same
|
|
30
|
+
* level, and the Critical/Warning badge on the card described nothing that
|
|
31
|
+
* happened afterwards.
|
|
32
|
+
*
|
|
33
|
+
* The rule is intentionally boring and order-based rather than name-based:
|
|
34
|
+
* severities are user-renameable ("Sev1", "P0", "Critical Incident", localized
|
|
35
|
+
* names), so matching on a name works for the default seed and for nothing
|
|
36
|
+
* else. `order` is the field the product itself treats as rank.
|
|
37
|
+
*/
|
|
38
|
+
export default class MonitorRecommendationSeverityMapper {
|
|
39
|
+
/*
|
|
40
|
+
* Severities ranked most-severe first.
|
|
41
|
+
*
|
|
42
|
+
* Sorted by `order` ascending, with rows missing an order pushed to the end
|
|
43
|
+
* rather than treated as order 0 — an unset order is "unranked", and
|
|
44
|
+
* silently promoting it to most-severe would map every Critical
|
|
45
|
+
* recommendation onto it.
|
|
46
|
+
*
|
|
47
|
+
* Ties (two severities sharing an order, which the product permits) fall
|
|
48
|
+
* back to the incoming array order, so the mapping is stable across calls
|
|
49
|
+
* given the same input. Callers pass the list already sorted by order from
|
|
50
|
+
* the API, so in practice this is the API's own ordering.
|
|
51
|
+
*/
|
|
52
|
+
public static rankSeverities(
|
|
53
|
+
options: Array<MonitorRecommendationSeverityOption>,
|
|
54
|
+
): Array<MonitorRecommendationSeverityOption> {
|
|
55
|
+
return [...options].sort(
|
|
56
|
+
(
|
|
57
|
+
a: MonitorRecommendationSeverityOption,
|
|
58
|
+
b: MonitorRecommendationSeverityOption,
|
|
59
|
+
) => {
|
|
60
|
+
const aOrder: number =
|
|
61
|
+
typeof a.order === "number" ? a.order : Number.MAX_SAFE_INTEGER;
|
|
62
|
+
const bOrder: number =
|
|
63
|
+
typeof b.order === "number" ? b.order : Number.MAX_SAFE_INTEGER;
|
|
64
|
+
|
|
65
|
+
return aOrder - bOrder;
|
|
66
|
+
},
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/*
|
|
71
|
+
* The default Critical -> ? / Warning -> ? mapping for a project.
|
|
72
|
+
*
|
|
73
|
+
* Critical takes the most severe row. Warning takes the next one down, and
|
|
74
|
+
* falls back to the same row as Critical when the project only defines one
|
|
75
|
+
* severity — a project with a single severity has no way to express the
|
|
76
|
+
* distinction, and refusing to map Warning at all would leave those monitors
|
|
77
|
+
* on the template's own choice, which is the bug this class exists to fix.
|
|
78
|
+
*
|
|
79
|
+
* Warning deliberately takes the SECOND severity rather than the LAST. On
|
|
80
|
+
* the default seed those are the same row (incidents: Critical/Major/Minor
|
|
81
|
+
* -> Major either way is second, Minor is last), but a project with five
|
|
82
|
+
* severities means "Warning" much closer to Major than to the bottom of the
|
|
83
|
+
* scale, and a recommendation the catalog calls Warning is a real
|
|
84
|
+
* production problem, not a nitpick.
|
|
85
|
+
*/
|
|
86
|
+
public static getDefaultSeverityMapping(
|
|
87
|
+
options: Array<MonitorRecommendationSeverityOption>,
|
|
88
|
+
): MonitorRecommendationSeverityMap {
|
|
89
|
+
const ranked: Array<MonitorRecommendationSeverityOption> =
|
|
90
|
+
this.rankSeverities(options);
|
|
91
|
+
|
|
92
|
+
if (ranked.length === 0) {
|
|
93
|
+
return {};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const mostSevere: MonitorRecommendationSeverityOption = ranked[0]!;
|
|
97
|
+
const nextSevere: MonitorRecommendationSeverityOption =
|
|
98
|
+
ranked[1] || mostSevere;
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
Critical: mostSevere.id,
|
|
102
|
+
Warning: nextSevere.id,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/*
|
|
107
|
+
* Resolve one recommendation's severity through a mapping.
|
|
108
|
+
*
|
|
109
|
+
* Returns undefined when the mapping has no entry, which callers must treat
|
|
110
|
+
* as "leave the template's own severity alone" rather than as "no severity"
|
|
111
|
+
* — a criteria instance with a populated incident and no severity id fails
|
|
112
|
+
* `MonitorCriteriaInstance.getValidationError` and the whole create fails.
|
|
113
|
+
*/
|
|
114
|
+
public static resolveSeverityId(data: {
|
|
115
|
+
severity: MonitorRecommendationSeverity;
|
|
116
|
+
severityMap?: MonitorRecommendationSeverityMap | undefined;
|
|
117
|
+
}): ObjectID | undefined {
|
|
118
|
+
if (!data.severityMap) {
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return data.severityMap[data.severity];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/*
|
|
126
|
+
* Human-readable "Critical -> Critical Incident" pairs, for the create form
|
|
127
|
+
* to show what it is about to do. Rendering the mapping is the only thing
|
|
128
|
+
* that makes an automatic choice reviewable instead of surprising.
|
|
129
|
+
*/
|
|
130
|
+
public static describeMapping(data: {
|
|
131
|
+
options: Array<MonitorRecommendationSeverityOption>;
|
|
132
|
+
severityMap?: MonitorRecommendationSeverityMap | undefined;
|
|
133
|
+
}): Array<{ severity: MonitorRecommendationSeverity; name: string }> {
|
|
134
|
+
const severities: Array<MonitorRecommendationSeverity> = [
|
|
135
|
+
"Critical",
|
|
136
|
+
"Warning",
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
const described: Array<{
|
|
140
|
+
severity: MonitorRecommendationSeverity;
|
|
141
|
+
name: string;
|
|
142
|
+
}> = [];
|
|
143
|
+
|
|
144
|
+
for (const severity of severities) {
|
|
145
|
+
const id: ObjectID | undefined = this.resolveSeverityId({
|
|
146
|
+
severity: severity,
|
|
147
|
+
severityMap: data.severityMap,
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
if (!id) {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const match: MonitorRecommendationSeverityOption | undefined =
|
|
155
|
+
data.options.find((option: MonitorRecommendationSeverityOption) => {
|
|
156
|
+
return option.id.toString() === id.toString();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
if (!match) {
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
described.push({ severity: severity, name: match.name });
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return described;
|
|
167
|
+
}
|
|
168
|
+
}
|