@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
|
@@ -48,6 +48,19 @@ export default class ApiPut extends ComponentCode {
|
|
|
48
48
|
headers: args["request-headers"] as Dictionary<string>,
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
+
/*
|
|
52
|
+
* On the server API resolves with an HTTPErrorResponse instead of
|
|
53
|
+
* throwing (only the UI subclass throws), so the catch below never sees
|
|
54
|
+
* an HTTP error - a 4xx/5xx used to take the success port and log
|
|
55
|
+
* "Success" at the customer.
|
|
56
|
+
*/
|
|
57
|
+
if (apiResult instanceof HTTPErrorResponse) {
|
|
58
|
+
return Promise.resolve({
|
|
59
|
+
returnValues: ApiComponentUtils.getReturnValues(apiResult),
|
|
60
|
+
executePort: result.errorPort,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
51
64
|
return Promise.resolve({
|
|
52
65
|
returnValues: ApiComponentUtils.getReturnValues(apiResult),
|
|
53
66
|
executePort: result.successPort,
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import DatabaseService from "../../Services/DatabaseService";
|
|
2
|
+
import Query from "../../Types/Database/Query";
|
|
3
|
+
import QueryHelper from "../../Types/Database/QueryHelper";
|
|
4
|
+
import Select from "../../Types/Database/Select";
|
|
5
|
+
import { LIMIT_PER_PROJECT } from "../../../Types/Database/LimitMax";
|
|
6
|
+
import BadDataException from "../../../Types/Exception/BadDataException";
|
|
7
|
+
import ObjectID from "../../../Types/ObjectID";
|
|
8
|
+
import DatabaseBaseModel from "../../../Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel";
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* Incidents, alerts and scheduled maintenance events point at project-scoped
|
|
12
|
+
* records — the current state, the severity, the monitor status to switch to.
|
|
13
|
+
* Nothing checked that those ids belonged to the row's own project, so an id
|
|
14
|
+
* taken from a second project (an API call, a template, a monitor criteria)
|
|
15
|
+
* could be persisted.
|
|
16
|
+
*
|
|
17
|
+
* That is what makes the *referenced* project undeletable: deleting a Project
|
|
18
|
+
* cascades into its IncidentState / IncidentSeverity / MonitorStatus rows, but
|
|
19
|
+
* the Incident row owned by a different project still points at them and those
|
|
20
|
+
* FKs are ON DELETE NO ACTION, so Postgres raises 23503 and the API answers
|
|
21
|
+
* "This item cannot be deleted because Incident records still reference it."
|
|
22
|
+
*
|
|
23
|
+
* The check below is deliberately narrow, for the same reason
|
|
24
|
+
* MonitorStepsProjectValidator is: it only rejects an id that really is
|
|
25
|
+
* another project's record. An id that matches no row at all is left alone —
|
|
26
|
+
* refusing it would block users from saving their way out of a record that
|
|
27
|
+
* already references something deleted, and the not-null/foreign-key checks
|
|
28
|
+
* report that case on their own.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
export interface ProjectScopedReference {
|
|
32
|
+
// Human readable name of the referenced model, e.g. "Incident Severity".
|
|
33
|
+
modelName: string;
|
|
34
|
+
id: ObjectID | string | undefined | null;
|
|
35
|
+
// The service that owns the referenced model, e.g. IncidentSeverityService.
|
|
36
|
+
service: DatabaseService<DatabaseBaseModel>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface ForeignReference {
|
|
40
|
+
modelName: string;
|
|
41
|
+
name: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/*
|
|
45
|
+
* The same reference reaches a service hook in several shapes: the id column
|
|
46
|
+
* (`incidentSeverityId`), a relation object (`incidentSeverity: { _id }`), an
|
|
47
|
+
* ObjectID in either slot, or — on the update path — a bare uuid string in the
|
|
48
|
+
* relation slot, which DatabaseService.sanitizeCreateOrUpdate only turns into
|
|
49
|
+
* a relation entity *after* onBeforeUpdate has run. Reading `?._id` alone
|
|
50
|
+
* misses the string shape and the guard would silently pass.
|
|
51
|
+
*/
|
|
52
|
+
export function resolveReferenceId(
|
|
53
|
+
value: unknown,
|
|
54
|
+
): ObjectID | string | undefined {
|
|
55
|
+
if (!value) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (typeof value === "string") {
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (value instanceof ObjectID) {
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const relation: { _id?: string | undefined; id?: ObjectID | undefined } =
|
|
68
|
+
value as { _id?: string | undefined; id?: ObjectID | undefined };
|
|
69
|
+
|
|
70
|
+
return relation._id || relation.id || undefined;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export default class ProjectScopedReferenceValidator {
|
|
74
|
+
public static async validateReferencesBelongToProject(data: {
|
|
75
|
+
projectId: ObjectID | undefined;
|
|
76
|
+
references: Array<ProjectScopedReference>;
|
|
77
|
+
// Used in the error message, e.g. "incident" -> "This incident references…".
|
|
78
|
+
subject?: string | undefined;
|
|
79
|
+
}): Promise<void> {
|
|
80
|
+
if (!data.projectId) {
|
|
81
|
+
/*
|
|
82
|
+
* Root/internal writes do not always carry a project. Callers resolve the
|
|
83
|
+
* project themselves where they can; when they cannot there is nothing to
|
|
84
|
+
* compare against and the check is a no-op.
|
|
85
|
+
*/
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/*
|
|
90
|
+
* One lookup per referenced model rather than one per id — an incident
|
|
91
|
+
* carries three of these and they are on the create path.
|
|
92
|
+
*/
|
|
93
|
+
const idsByService: Map<
|
|
94
|
+
DatabaseService<DatabaseBaseModel>,
|
|
95
|
+
Map<string, string>
|
|
96
|
+
> = new Map();
|
|
97
|
+
|
|
98
|
+
for (const reference of data.references) {
|
|
99
|
+
const id: string = reference.id?.toString() || "";
|
|
100
|
+
|
|
101
|
+
if (!id) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (!idsByService.has(reference.service)) {
|
|
106
|
+
idsByService.set(reference.service, new Map());
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
idsByService.get(reference.service)!.set(id, reference.modelName);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (idsByService.size === 0) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const foreignReferences: Array<ForeignReference> = [];
|
|
117
|
+
|
|
118
|
+
for (const [service, idToModelName] of idsByService) {
|
|
119
|
+
const records: Array<DatabaseBaseModel> = await service.findBy({
|
|
120
|
+
query: {
|
|
121
|
+
_id: QueryHelper.any(Array.from(idToModelName.keys())),
|
|
122
|
+
},
|
|
123
|
+
/*
|
|
124
|
+
* `name` and `projectId` are not on DatabaseBaseModel, but every model
|
|
125
|
+
* passed here is project scoped and named, so the cast is safe.
|
|
126
|
+
*/
|
|
127
|
+
select: {
|
|
128
|
+
_id: true,
|
|
129
|
+
name: true,
|
|
130
|
+
projectId: true,
|
|
131
|
+
} as Select<DatabaseBaseModel>,
|
|
132
|
+
limit: LIMIT_PER_PROJECT,
|
|
133
|
+
skip: 0,
|
|
134
|
+
props: {
|
|
135
|
+
isRoot: true,
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
for (const record of records) {
|
|
140
|
+
const recordProjectId: ObjectID | undefined =
|
|
141
|
+
record.getValue<ObjectID>("projectId") || undefined;
|
|
142
|
+
|
|
143
|
+
if (recordProjectId?.toString() === data.projectId.toString()) {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const id: string = record._id?.toString() || "";
|
|
148
|
+
|
|
149
|
+
foreignReferences.push({
|
|
150
|
+
modelName: idToModelName.get(id) || "Record",
|
|
151
|
+
name: record.getValue<string>("name")?.toString() || id,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (foreignReferences.length === 0) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const described: string = foreignReferences
|
|
161
|
+
.map((reference: ForeignReference) => {
|
|
162
|
+
return `${reference.modelName} "${reference.name}"`;
|
|
163
|
+
})
|
|
164
|
+
.join(", ");
|
|
165
|
+
|
|
166
|
+
throw new BadDataException(
|
|
167
|
+
`This ${
|
|
168
|
+
data.subject || "request"
|
|
169
|
+
} references records that belong to a different project: ${described}. Please pick values from this project and try again.`,
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/*
|
|
174
|
+
* "Can this project actually use this record?" — for callers that must not
|
|
175
|
+
* throw. The probe and telemetry ingest workers build incidents and alerts
|
|
176
|
+
* from monitor criteria, whose stored ids may still point at another
|
|
177
|
+
* project (monitorSteps repair could not always resolve them). Throwing
|
|
178
|
+
* there fails the whole ingest job for that monitor, so those callers ask
|
|
179
|
+
* this instead and fall back to their project's own default.
|
|
180
|
+
*
|
|
181
|
+
* Note the deliberate difference from validateReferencesBelongToProject: an
|
|
182
|
+
* id that matches NO record is unusable here (false), while the write guard
|
|
183
|
+
* lets it pass so a record already pointing at something deleted stays
|
|
184
|
+
* saveable.
|
|
185
|
+
*/
|
|
186
|
+
public static async isUsableInProject(data: {
|
|
187
|
+
projectId: ObjectID | undefined;
|
|
188
|
+
id: ObjectID | string | undefined | null;
|
|
189
|
+
service: DatabaseService<DatabaseBaseModel>;
|
|
190
|
+
}): Promise<boolean> {
|
|
191
|
+
const id: string = data.id?.toString() || "";
|
|
192
|
+
|
|
193
|
+
if (!id || !data.projectId) {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const record: DatabaseBaseModel | null = await data.service.findOneBy({
|
|
198
|
+
query: {
|
|
199
|
+
_id: id,
|
|
200
|
+
projectId: data.projectId,
|
|
201
|
+
} as Query<DatabaseBaseModel>,
|
|
202
|
+
select: {
|
|
203
|
+
_id: true,
|
|
204
|
+
},
|
|
205
|
+
props: {
|
|
206
|
+
isRoot: true,
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
return Boolean(record);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import BadDataException from "../../Types/Exception/BadDataException";
|
|
2
|
+
import {
|
|
3
|
+
MAX_SAMPLE_PERCENTAGE,
|
|
4
|
+
MIN_SAMPLE_PERCENTAGE,
|
|
5
|
+
} from "../../Types/Telemetry/DropFilterSampling";
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* Shared save-time validation for log and trace drop filters.
|
|
9
|
+
*
|
|
10
|
+
* Both drop-filter models have historically accepted configurations the
|
|
11
|
+
* ingest engine could not honour, and both failed silently and
|
|
12
|
+
* destructively:
|
|
13
|
+
*
|
|
14
|
+
* - A blank `filterQuery` compiles to "match every record", so a drop
|
|
15
|
+
* filter saved with an empty query discards 100% of a project's
|
|
16
|
+
* telemetry. Nothing warned, and nothing recorded the drops.
|
|
17
|
+
*
|
|
18
|
+
* - `samplePercentage` is nullable with no default and the form field is
|
|
19
|
+
* optional, so `action = "sample"` could be saved with no percentage at
|
|
20
|
+
* all. The engine then fell back to a hardcoded 50, i.e. "silently
|
|
21
|
+
* throw away half of it", while the UI rendered the unset value as
|
|
22
|
+
* "0% kept".
|
|
23
|
+
*
|
|
24
|
+
* Rejecting both at the API boundary is the only place a human is present
|
|
25
|
+
* to read the error. The ingest path additionally fails *safe* on rows that
|
|
26
|
+
* predate this validation (see DropFilterSampling.resolveSamplePercentage
|
|
27
|
+
* and LogDropFilterService.loadDropFilters).
|
|
28
|
+
*
|
|
29
|
+
* Deliberately not validated here: whether `filterQuery` actually parses.
|
|
30
|
+
* The parser lives in the App feature set, which Common must not import,
|
|
31
|
+
* and an unparsable query compiles to "match nothing" — a harmless no-op
|
|
32
|
+
* rather than a data-destroying one.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/*
|
|
36
|
+
* Both LogDropFilterAction and TraceDropFilterAction spell this "sample";
|
|
37
|
+
* comparing the raw string keeps this validator usable from both services
|
|
38
|
+
* without either enum leaking in.
|
|
39
|
+
*/
|
|
40
|
+
export const SAMPLE_ACTION: string = "sample";
|
|
41
|
+
|
|
42
|
+
export interface DropFilterCandidate {
|
|
43
|
+
action: string | undefined | null;
|
|
44
|
+
samplePercentage: number | undefined | null;
|
|
45
|
+
filterQuery: string | undefined | null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface DropFilterValidationOptions {
|
|
49
|
+
/*
|
|
50
|
+
* "logs" or "spans" — only used to make the error message read like the
|
|
51
|
+
* product surface the user is actually on.
|
|
52
|
+
*/
|
|
53
|
+
recordNoun: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function validateDropFilterFilterQuery(
|
|
57
|
+
filterQuery: string | undefined | null,
|
|
58
|
+
options: DropFilterValidationOptions,
|
|
59
|
+
): void {
|
|
60
|
+
if (
|
|
61
|
+
filterQuery === undefined ||
|
|
62
|
+
filterQuery === null ||
|
|
63
|
+
filterQuery.trim().length === 0
|
|
64
|
+
) {
|
|
65
|
+
throw new BadDataException(
|
|
66
|
+
`Filter query is required. A drop filter with an empty query matches every record, which would discard all of this project's ${options.recordNoun}. Add a condition, or delete the filter.`,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function validateDropFilterSamplePercentage(
|
|
72
|
+
candidate: DropFilterCandidate,
|
|
73
|
+
options: DropFilterValidationOptions,
|
|
74
|
+
): void {
|
|
75
|
+
if (candidate.action !== SAMPLE_ACTION) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const samplePercentage: number | undefined | null =
|
|
80
|
+
candidate.samplePercentage;
|
|
81
|
+
|
|
82
|
+
if (
|
|
83
|
+
typeof samplePercentage !== "number" ||
|
|
84
|
+
!Number.isFinite(samplePercentage)
|
|
85
|
+
) {
|
|
86
|
+
throw new BadDataException(
|
|
87
|
+
`Sample percentage is required when the action is "Sample". Enter the percentage of matching ${options.recordNoun} to keep, between ${MIN_SAMPLE_PERCENTAGE} and ${MAX_SAMPLE_PERCENTAGE}.`,
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (
|
|
92
|
+
samplePercentage < MIN_SAMPLE_PERCENTAGE ||
|
|
93
|
+
samplePercentage > MAX_SAMPLE_PERCENTAGE
|
|
94
|
+
) {
|
|
95
|
+
throw new BadDataException(
|
|
96
|
+
`Sample percentage must be between ${MIN_SAMPLE_PERCENTAGE} and ${MAX_SAMPLE_PERCENTAGE}. Use the "Drop" action to discard every matching record, or disable the filter to keep every one.`,
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/*
|
|
102
|
+
* Validate a fully-resolved candidate row. Callers building this from an
|
|
103
|
+
* update must merge the incoming partial over the stored row first, so a
|
|
104
|
+
* request that flips `action` to "sample" without supplying a percentage is
|
|
105
|
+
* still caught.
|
|
106
|
+
*/
|
|
107
|
+
export function validateDropFilter(
|
|
108
|
+
candidate: DropFilterCandidate,
|
|
109
|
+
options: DropFilterValidationOptions,
|
|
110
|
+
): void {
|
|
111
|
+
validateDropFilterFilterQuery(candidate.filterQuery, options);
|
|
112
|
+
validateDropFilterSamplePercentage(candidate, options);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/*
|
|
116
|
+
* `PartialEntity` values may be `() => string` raw SQL expressions rather
|
|
117
|
+
* than literals. We cannot evaluate one here, so an update that sets a
|
|
118
|
+
* validated field to an expression cannot be checked — validating a
|
|
119
|
+
* stringified function would be worse than not validating at all.
|
|
120
|
+
*
|
|
121
|
+
* Nothing in the product writes drop-filter fields this way; the branch
|
|
122
|
+
* exists so the types stay honest and a future caller that does it gets
|
|
123
|
+
* skipped rather than spuriously rejected.
|
|
124
|
+
*/
|
|
125
|
+
export function isSqlExpressionValue(value: unknown): boolean {
|
|
126
|
+
return typeof value === "function";
|
|
127
|
+
}
|
package/Server/Utils/Errors.ts
CHANGED
|
@@ -14,6 +14,11 @@ export default {
|
|
|
14
14
|
SUBSCRIPTION_NOT_FOUND: "Subscription not found.",
|
|
15
15
|
INVOICE_NOT_FOUND: "Invoice not found.",
|
|
16
16
|
PAYMENT_INTENT_NOT_FOUND: "Payment intent not found.",
|
|
17
|
+
TRIAL_END_DATE_IN_PAST: "Trial end date must be in the future.",
|
|
18
|
+
TRIAL_END_DATE_TOO_FAR_IN_FUTURE:
|
|
19
|
+
"Trial end date cannot be more than 730 days (two years) in the future. This is a limit imposed by the payment provider.",
|
|
20
|
+
CANNOT_EXTEND_TRIAL_ON_CANCELLED_SUBSCRIPTION:
|
|
21
|
+
"This subscription has been cancelled. Its trial cannot be extended.",
|
|
17
22
|
},
|
|
18
23
|
TeamMemberService: {
|
|
19
24
|
ALREADY_INVITED: "This user has already been invited to this team",
|
|
@@ -22,6 +22,7 @@ import { TelemetryQuery } from "../../../Types/Telemetry/TelemetryQuery";
|
|
|
22
22
|
import { DisableAutomaticAlertCreation } from "../../EnvironmentConfig";
|
|
23
23
|
import AlertService from "../../Services/AlertService";
|
|
24
24
|
import AlertSeverityService from "../../Services/AlertSeverityService";
|
|
25
|
+
import ProjectScopedReferenceValidator from "../Database/ProjectScopedReferenceValidator";
|
|
25
26
|
import AlertStateTimelineService from "../../Services/AlertStateTimelineService";
|
|
26
27
|
import HostService from "../../Services/HostService";
|
|
27
28
|
import NetworkDeviceOwnerUserService, {
|
|
@@ -420,7 +421,33 @@ export default class MonitorAlert {
|
|
|
420
421
|
storageMap,
|
|
421
422
|
});
|
|
422
423
|
|
|
423
|
-
|
|
424
|
+
/*
|
|
425
|
+
* A criteria severity belonging to *another* project is rejected by
|
|
426
|
+
* AlertService on create. Throwing here would fail the whole
|
|
427
|
+
* probe/telemetry ingest job for this monitor, so treat it as
|
|
428
|
+
* "missing" and fall back to this project's own default — which is
|
|
429
|
+
* also what stops the bad id spreading onto new alerts. See the same
|
|
430
|
+
* fallback in MonitorIncident.
|
|
431
|
+
*/
|
|
432
|
+
const isCriteriaSeverityUsable: boolean =
|
|
433
|
+
await ProjectScopedReferenceValidator.isUsableInProject({
|
|
434
|
+
projectId: input.monitor.projectId!,
|
|
435
|
+
id: criteriaAlert.alertSeverityId,
|
|
436
|
+
service: AlertSeverityService,
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
if (
|
|
440
|
+
criteriaAlert.alertSeverityId?.toString() &&
|
|
441
|
+
!isCriteriaSeverityUsable
|
|
442
|
+
) {
|
|
443
|
+
logger.error(
|
|
444
|
+
`${input.monitor.id?.toString()} - Criteria "${
|
|
445
|
+
input.criteriaInstance.data?.name
|
|
446
|
+
}" references alert severity ${criteriaAlert.alertSeverityId.toString()}, which does not belong to project ${input.monitor.projectId?.toString()}. Falling back to this project's default severity.`,
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
if (!isCriteriaSeverityUsable) {
|
|
424
451
|
// pick the critical criteria.
|
|
425
452
|
|
|
426
453
|
const severity: AlertSeverity | null =
|
|
@@ -34,6 +34,7 @@ import PodmanHostService from "../../Services/PodmanHostService";
|
|
|
34
34
|
import ProxmoxClusterService from "../../Services/ProxmoxClusterService";
|
|
35
35
|
import ServiceService from "../../Services/ServiceService";
|
|
36
36
|
import IncidentSeverityService from "../../Services/IncidentSeverityService";
|
|
37
|
+
import ProjectScopedReferenceValidator from "../Database/ProjectScopedReferenceValidator";
|
|
37
38
|
import IncidentStateTimelineService from "../../Services/IncidentStateTimelineService";
|
|
38
39
|
import IncidentMemberService from "../../Services/IncidentMemberService";
|
|
39
40
|
import NetworkDeviceOwnerUserService, {
|
|
@@ -505,7 +506,35 @@ export default class MonitorIncident {
|
|
|
505
506
|
* Use `?.toString()` truthiness so an empty/blank ObjectID is treated
|
|
506
507
|
* the same as "missing" and falls through to the project-default lookup.
|
|
507
508
|
*/
|
|
508
|
-
|
|
509
|
+
/*
|
|
510
|
+
* A criteria severity that belongs to *another* project is rejected by
|
|
511
|
+
* IncidentService on create. Throwing here would fail the whole
|
|
512
|
+
* probe/telemetry ingest job for this monitor — no incident, and no
|
|
513
|
+
* payload or monitor log persisted either, because those run after the
|
|
514
|
+
* create. Treat it as "missing" and fall back to this project's own
|
|
515
|
+
* default, which is also what stops the bad id spreading onto new
|
|
516
|
+
* incidents. monitorSteps can still hold one: the 1785240000000
|
|
517
|
+
* repair skipped ids it could not resolve.
|
|
518
|
+
*/
|
|
519
|
+
const isCriteriaSeverityUsable: boolean =
|
|
520
|
+
await ProjectScopedReferenceValidator.isUsableInProject({
|
|
521
|
+
projectId: input.monitor.projectId!,
|
|
522
|
+
id: criteriaIncident.incidentSeverityId,
|
|
523
|
+
service: IncidentSeverityService,
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
if (
|
|
527
|
+
criteriaIncident.incidentSeverityId?.toString() &&
|
|
528
|
+
!isCriteriaSeverityUsable
|
|
529
|
+
) {
|
|
530
|
+
logger.error(
|
|
531
|
+
`${input.monitor.id?.toString()} - Criteria "${
|
|
532
|
+
input.criteriaInstance.data?.name
|
|
533
|
+
}" references incident severity ${criteriaIncident.incidentSeverityId.toString()}, which does not belong to project ${input.monitor.projectId?.toString()}. Falling back to this project's default severity.`,
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
if (!isCriteriaSeverityUsable) {
|
|
509
538
|
// pick the critical (first/lowest-order root) severity.
|
|
510
539
|
|
|
511
540
|
const severity: IncidentSeverity | null =
|
|
@@ -550,7 +579,7 @@ export default class MonitorIncident {
|
|
|
550
579
|
|
|
551
580
|
incident.incidentSeverityId = severity.id!;
|
|
552
581
|
} else {
|
|
553
|
-
incident.incidentSeverityId = criteriaIncident.incidentSeverityId
|
|
582
|
+
incident.incidentSeverityId = criteriaIncident.incidentSeverityId!;
|
|
554
583
|
}
|
|
555
584
|
|
|
556
585
|
incident.monitors = [input.monitor];
|
|
@@ -208,4 +208,35 @@ export default class AppMetrics {
|
|
|
208
208
|
|
|
209
209
|
return this.ingestPayloadBytes;
|
|
210
210
|
}
|
|
211
|
+
|
|
212
|
+
// -- Telemetry discarded by project drop filters -----------------------
|
|
213
|
+
|
|
214
|
+
private static ingestDroppedCounter: TelemetryCounter | null = null;
|
|
215
|
+
|
|
216
|
+
/*
|
|
217
|
+
* Records telemetry a project's own drop filters discarded at ingest.
|
|
218
|
+
*
|
|
219
|
+
* Before this existed, a drop filter deleted records with no trace
|
|
220
|
+
* anywhere — no log line, no metric, no counter — so "my logs are
|
|
221
|
+
* missing" tickets could not be distinguished from a broken pipeline
|
|
222
|
+
* without reading the customer's filter rows by hand.
|
|
223
|
+
*
|
|
224
|
+
* Attributes carry `oneuptime.project.id` and `oneuptime.drop_filter.id`
|
|
225
|
+
* on purpose: without them the counter says only "something dropped
|
|
226
|
+
* telemetry", which is exactly the unanswerable state this replaces.
|
|
227
|
+
* Cardinality stays bounded — projects times a handful of filters each,
|
|
228
|
+
* and only projects that configured a filter ever emit a point.
|
|
229
|
+
*/
|
|
230
|
+
public static getIngestDroppedCounter(): TelemetryCounter {
|
|
231
|
+
if (!this.ingestDroppedCounter) {
|
|
232
|
+
this.ingestDroppedCounter = Telemetry.getCounter({
|
|
233
|
+
name: "oneuptime.telemetry.ingest.dropped.count",
|
|
234
|
+
description:
|
|
235
|
+
"Number of telemetry records discarded by a project's drop filters, partitioned by signal, action, project and filter.",
|
|
236
|
+
unit: "1",
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return this.ingestDroppedCounter;
|
|
241
|
+
}
|
|
211
242
|
}
|
|
@@ -37,12 +37,15 @@ describe("Analytics KubernetesCostAllocation model", () => {
|
|
|
37
37
|
"cpuCoreHours",
|
|
38
38
|
"cpuCoreRequestAverage",
|
|
39
39
|
"cpuCoreUsageAverage",
|
|
40
|
+
"cpuCoreLimitAverage",
|
|
40
41
|
"cpuCost",
|
|
41
42
|
"gpuHours",
|
|
42
43
|
"gpuCost",
|
|
43
44
|
"ramByteHours",
|
|
44
45
|
"ramBytesRequestAverage",
|
|
45
46
|
"ramBytesUsageAverage",
|
|
47
|
+
"ramBytesLimitAverage",
|
|
48
|
+
"ramBytesUsageMax",
|
|
46
49
|
"ramCost",
|
|
47
50
|
"pvByteHours",
|
|
48
51
|
"pvCost",
|
|
@@ -95,6 +98,19 @@ describe("Analytics KubernetesCostAllocation model", () => {
|
|
|
95
98
|
);
|
|
96
99
|
});
|
|
97
100
|
|
|
101
|
+
test("carries the shipment identity the ingest dedup relies on", () => {
|
|
102
|
+
const shipmentId: AnalyticsTableColumn | null =
|
|
103
|
+
model.getTableColumn("shipmentId");
|
|
104
|
+
expect(shipmentId?.type).toBe(TableColumnType.Text);
|
|
105
|
+
// Rows written before the shipment contract read back as "no identity".
|
|
106
|
+
expect(shipmentId?.defaultValue).toBe("");
|
|
107
|
+
|
|
108
|
+
const shipmentChunk: AnalyticsTableColumn | null =
|
|
109
|
+
model.getTableColumn("shipmentChunk");
|
|
110
|
+
expect(shipmentChunk?.type).toBe(TableColumnType.Number);
|
|
111
|
+
expect(shipmentChunk?.defaultValue).toBe(0);
|
|
112
|
+
});
|
|
113
|
+
|
|
98
114
|
test("stores labels as a map with an extracted key column", () => {
|
|
99
115
|
const labels: AnalyticsTableColumn | null = model.getTableColumn("labels");
|
|
100
116
|
expect(labels?.type).toBe(TableColumnType.MapStringString);
|