@oneuptime/common 11.4.0 → 11.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/DatabaseModels/AIRun.ts +50 -0
- package/Models/DatabaseModels/AlertSeverity.ts +6 -0
- package/Models/DatabaseModels/IncidentSeverity.ts +6 -0
- package/Models/DatabaseModels/Index.ts +16 -0
- package/Models/DatabaseModels/IoTDeviceCredential.ts +471 -0
- package/Models/DatabaseModels/LlmLog.ts +56 -0
- package/Models/DatabaseModels/LlmProvider.ts +33 -0
- package/Models/DatabaseModels/NetworkDevice.ts +1385 -0
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +717 -0
- package/Models/DatabaseModels/NetworkDeviceLabelRule.ts +514 -0
- package/Models/DatabaseModels/NetworkDeviceOwnerRule.ts +596 -0
- package/Models/DatabaseModels/NetworkDeviceOwnerTeam.ts +487 -0
- package/Models/DatabaseModels/NetworkDeviceOwnerUser.ts +486 -0
- package/Models/DatabaseModels/NetworkInterface.ts +563 -0
- package/Models/DatabaseModels/Project.ts +145 -0
- package/Models/DatabaseModels/TelemetryEntityRelationship.ts +54 -0
- package/Server/API/AIAgentTaskAPI.ts +10 -24
- package/Server/API/AIInvestigationAPI.ts +131 -63
- package/Server/API/AlertAPI.ts +5 -0
- package/Server/API/IncidentAPI.ts +10 -0
- package/Server/API/IncidentEpisodeAPI.ts +5 -0
- package/Server/API/LlmProviderAPI.ts +4 -0
- package/Server/API/ScheduledMaintenanceAPI.ts +5 -0
- package/Server/API/TelemetryAPI.ts +4 -3
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783650000000-AddAdditionalParamsToLlmProvider.ts +19 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783695782697-AddCacheTokenColumnsToLlmLog.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783701585317-AddAlertInvestigationGating.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783702431535-AddAiDailyAutonomousTokenLimitToProject.ts +19 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783720000000-AddNetworkDeviceTables.ts +105 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783721121260-AddAttemptCountToAIRun.ts +15 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783730000000-AddNetworkDeviceOwnersAndRules.ts +192 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783740000000-AddNetworkDeviceDiscoveryScan.ts +37 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783750000000-AddLldpNeighborsToNetworkDevice.ts +19 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783760576655-AddInvestigationTuningToProject.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783762505482-AddTelemetryEntityRelationshipMetrics.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783780000000-AddIoTDeviceCredentialTable.ts +79 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783790000000-AddSnmpV3AuthColumnsToNetworkDevice.ts +49 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +24 -0
- package/Server/Services/AIAgentTaskService.ts +62 -0
- package/Server/Services/AIRunService.ts +58 -0
- package/Server/Services/AIService.ts +101 -0
- package/Server/Services/AnalyticsDatabaseService.ts +27 -0
- package/Server/Services/IncidentService.ts +14 -41
- package/Server/Services/Index.ts +14 -0
- package/Server/Services/IoTDeviceCredentialService.ts +351 -0
- package/Server/Services/IoTDeviceService.ts +64 -21
- package/Server/Services/LlmLogService.ts +26 -0
- package/Server/Services/LlmProviderService.ts +3 -0
- package/Server/Services/LogAggregationService.ts +29 -11
- package/Server/Services/MetricService.ts +603 -13
- package/Server/Services/MonitorService.ts +4 -1
- package/Server/Services/NetworkDeviceDiscoveryScanService.ts +10 -0
- package/Server/Services/NetworkDeviceLabelRuleEngineService.ts +204 -0
- package/Server/Services/NetworkDeviceLabelRuleService.ts +14 -0
- package/Server/Services/NetworkDeviceOwnerRuleEngineService.ts +222 -0
- package/Server/Services/NetworkDeviceOwnerRuleService.ts +14 -0
- package/Server/Services/NetworkDeviceOwnerTeamService.ts +10 -0
- package/Server/Services/NetworkDeviceOwnerUserService.ts +10 -0
- package/Server/Services/NetworkDeviceService.ts +50 -0
- package/Server/Services/NetworkInterfaceService.ts +10 -0
- package/Server/Services/TelemetryEntityRelationshipService.ts +23 -0
- package/Server/Services/TelemetryEntityService.ts +72 -2
- package/Server/Utils/AI/Sentinel/AlertInvestigationRunner.ts +244 -12
- package/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.ts +92 -19
- package/Server/Utils/AI/Sentinel/InvestigationQueue.ts +493 -0
- package/Server/Utils/AI/Sentinel/README.md +10 -0
- package/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.ts +88 -68
- package/Server/Utils/AI/Toolbox/Index.ts +2 -1
- package/Server/Utils/AI/Toolbox/MetricTools.ts +391 -0
- package/Server/Utils/LLM/LLMService.ts +21 -0
- package/Server/Utils/Monitor/Criteria/APIRequestCriteria.ts +44 -0
- package/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.ts +170 -2
- package/Server/Utils/Monitor/IoTDeviceAbsenceSeries.ts +101 -0
- package/Server/Utils/Monitor/MonitorAlert.ts +15 -3
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +1 -1
- package/Server/Utils/Monitor/MonitorIncident.ts +19 -3
- package/Server/Utils/Monitor/MonitorMetricUtil.ts +195 -2
- package/Server/Utils/Monitor/MonitorResource.ts +77 -21
- package/Server/Utils/Monitor/MonitorTemplateUtil.ts +1 -1
- package/Server/Utils/Monitor/NetworkDeviceHydrationUtil.ts +201 -0
- package/Server/Utils/Monitor/NetworkInventoryUtil.ts +215 -0
- package/Server/Utils/Monitor/SnmpInterfaceRateUtil.ts +169 -0
- package/Tests/Server/Services/AIAgentTaskServiceClaim.test.ts +146 -0
- package/Tests/Server/Services/AIServiceDailyBudget.test.ts +173 -0
- package/Tests/Server/Services/IncidentInternalNoteAnnouncement.test.ts +97 -0
- package/Tests/Server/Services/IoTDeviceService.test.ts +54 -0
- package/Tests/Server/Services/LogAggregationService.test.ts +22 -0
- package/Tests/Server/Services/MetricServiceAggregate.test.ts +194 -0
- package/Tests/Server/Utils/AI/BaselineAnomalyTool.test.ts +253 -0
- package/Tests/Server/Utils/AI/LLMServiceToolCalling.test.ts +44 -0
- package/Tests/Server/Utils/AI/SentinelAlertGating.test.ts +360 -0
- package/Tests/Server/Utils/AI/SentinelInvestigationQueue.test.ts +295 -0
- package/Tests/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.test.ts +59 -0
- package/Tests/Server/Utils/Monitor/IoTDeviceAbsenceSeries.test.ts +113 -0
- package/Tests/Server/Utils/Monitor/PerSeriesRecoveryResolution.test.ts +198 -0
- package/Tests/Types/AI/AIAgentTaskStatus.test.ts +86 -0
- package/Tests/Types/BaseDatabase/AggregationIntervalUtil.test.ts +127 -0
- package/Tests/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.test.ts +152 -0
- package/Tests/Types/Monitor/MonitorType.test.ts +1 -1
- package/Tests/Types/Trace/TraceRecordingRuleDefinition.test.ts +308 -0
- package/Tests/UI/Components/Dropdown.test.tsx +17 -0
- package/Tests/UI/Components/EntityDropdown.test.tsx +130 -0
- package/Tests/UI/Components/Modal.test.tsx +144 -2
- package/Tests/UI/Components/TelemetrySearchBar.test.tsx +90 -0
- package/Tests/UI/Utils/Theme.test.ts +161 -0
- package/Tests/Utils/Monitor/LatencyMatrixUtil.test.ts +111 -0
- package/Types/AI/AIRunStatus.ts +9 -0
- package/Types/BaseDatabase/AggregateBy.ts +12 -0
- package/Types/Dashboard/DashboardComponentType.ts +1 -0
- package/Types/Dashboard/DashboardComponents/DashboardLogChartComponent.ts +24 -0
- package/Types/Dashboard/DashboardTemplates.ts +9 -1
- package/Types/LlmLogStatus.ts +1 -0
- package/Types/Monitor/CriteriaFilter.ts +9 -0
- package/Types/Monitor/HttpPhaseTimings.ts +16 -0
- package/Types/Monitor/IotAlertTemplates.ts +22 -3
- package/Types/Monitor/LatencyMatrix.ts +27 -0
- package/Types/Monitor/MonitorCriteriaInstance.ts +2 -2
- package/Types/Monitor/MonitorMetricType.ts +27 -0
- package/Types/Monitor/MonitorStep.ts +36 -11
- package/Types/Monitor/MonitorStepNetworkDeviceMonitor.ts +55 -0
- package/Types/Monitor/MonitorStepSnmpMonitor.ts +8 -0
- package/Types/Monitor/MonitorType.ts +14 -9
- package/Types/Monitor/PingMonitor/PingMonitorResponse.ts +20 -0
- package/Types/Monitor/SnmpMonitor/LldpNeighbor.ts +12 -0
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.ts +116 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +29 -0
- package/Types/Monitor/SnmpMonitor/SnmpInterface.ts +31 -0
- package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.ts +24 -0
- package/Types/Monitor/SnmpMonitor/SnmpTrap.ts +20 -0
- package/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.ts +173 -0
- package/Types/Permission.ts +314 -0
- package/Types/Probe/ProbeMonitorResponse.ts +22 -0
- package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +8 -5
- package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +4 -1
- package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +6 -3
- package/UI/Components/CodeBlock/CodeBlock.tsx +2 -1
- package/UI/Components/CodeEditor/CodeEditor.tsx +3 -0
- package/UI/Components/Divider/Divider.tsx +1 -1
- package/UI/Components/Dropdown/Dropdown.tsx +13 -4
- package/UI/Components/EntityDropdown/EntityDropdown.tsx +110 -2
- package/UI/Components/ErrorBoundary.tsx +2 -1
- package/UI/Components/EventItem/EventItem.tsx +2 -2
- package/UI/Components/GanttChart/Bar/Index.tsx +1 -1
- package/UI/Components/Graphs/UptimeBarTooltip.tsx +30 -23
- package/UI/Components/Header/Header.tsx +7 -0
- package/UI/Components/Header/HeaderIconDropdownButton.tsx +2 -0
- package/UI/Components/Icon/Icon.tsx +8 -6
- package/UI/Components/Label/Label.tsx +2 -2
- package/UI/Components/LogsViewer/components/LogsAnalyticsView.tsx +22 -10
- package/UI/Components/LogsViewer/components/LogsHistogram.tsx +9 -3
- package/UI/Components/Markdown.tsx/MarkdownEditor.tsx +8 -8
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +44 -20
- package/UI/Components/Modal/ConfirmModal.tsx +1 -1
- package/UI/Components/Modal/Modal.tsx +213 -121
- package/UI/Components/Modal/ModalFooter.tsx +33 -22
- package/UI/Components/ModelTable/TableView.tsx +1 -1
- package/UI/Components/MonitorGraphs/UptimeBarDayModal.tsx +20 -12
- package/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.ts +2 -2
- package/UI/Components/Pill/Pill.tsx +21 -13
- package/UI/Components/StatusBubble/StatusBubble.tsx +3 -3
- package/UI/Components/Tabs/Tabs.tsx +10 -1
- package/UI/Components/TelemetryViewer/TelemetryViewer.tsx +7 -1
- package/UI/Components/TelemetryViewer/components/TelemetryHistogram.tsx +9 -3
- package/UI/Components/TelemetryViewer/components/TelemetrySearchBar.tsx +62 -4
- package/UI/Components/Workflow/Component.tsx +53 -33
- package/UI/Components/Workflow/ComponentPortViewer.tsx +6 -6
- package/UI/Components/Workflow/ComponentReturnValueViewer.tsx +8 -8
- package/UI/Components/Workflow/ComponentsModal.tsx +16 -9
- package/UI/Components/Workflow/Workflow.tsx +13 -11
- package/UI/Utils/Navigation.ts +10 -1
- package/UI/Utils/Theme.ts +140 -0
- package/Utils/Dashboard/Components/DashboardLogChartComponent.ts +99 -0
- package/Utils/Dashboard/Components/Index.ts +7 -0
- package/Utils/Monitor/LatencyMatrixUtil.ts +162 -0
- package/Utils/Monitor/MonitorMetricType.ts +141 -3
- package/Utils/Monitor/NetworkTopologyUtil.ts +159 -0
- package/Utils/Telemetry/EntityRelationship.ts +11 -0
- package/build/dist/Models/DatabaseModels/AIRun.js +52 -0
- package/build/dist/Models/DatabaseModels/AIRun.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertSeverity.js +6 -0
- package/build/dist/Models/DatabaseModels/AlertSeverity.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentSeverity.js +6 -0
- package/build/dist/Models/DatabaseModels/IncidentSeverity.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +16 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IoTDeviceCredential.js +493 -0
- package/build/dist/Models/DatabaseModels/IoTDeviceCredential.js.map +1 -0
- package/build/dist/Models/DatabaseModels/LlmLog.js +58 -0
- package/build/dist/Models/DatabaseModels/LlmLog.js.map +1 -1
- package/build/dist/Models/DatabaseModels/LlmProvider.js +33 -0
- package/build/dist/Models/DatabaseModels/LlmProvider.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +1426 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +738 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLabelRule.js +522 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLabelRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerRule.js +603 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerTeam.js +503 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerTeam.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerUser.js +502 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerUser.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkInterface.js +589 -0
- package/build/dist/Models/DatabaseModels/NetworkInterface.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Project.js +147 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryEntityRelationship.js +57 -0
- package/build/dist/Models/DatabaseModels/TelemetryEntityRelationship.js.map +1 -1
- package/build/dist/Server/API/AIAgentTaskAPI.js +8 -23
- package/build/dist/Server/API/AIAgentTaskAPI.js.map +1 -1
- package/build/dist/Server/API/AIInvestigationAPI.js +95 -55
- package/build/dist/Server/API/AIInvestigationAPI.js.map +1 -1
- package/build/dist/Server/API/AlertAPI.js +5 -0
- package/build/dist/Server/API/AlertAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentAPI.js +10 -0
- package/build/dist/Server/API/IncidentAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentEpisodeAPI.js +5 -0
- package/build/dist/Server/API/IncidentEpisodeAPI.js.map +1 -1
- package/build/dist/Server/API/LlmProviderAPI.js +5 -7
- package/build/dist/Server/API/LlmProviderAPI.js.map +1 -1
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js +5 -0
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js.map +1 -1
- package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783650000000-AddAdditionalParamsToLlmProvider.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783650000000-AddAdditionalParamsToLlmProvider.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783695782697-AddCacheTokenColumnsToLlmLog.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783695782697-AddCacheTokenColumnsToLlmLog.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783701585317-AddAlertInvestigationGating.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783701585317-AddAlertInvestigationGating.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783702431535-AddAiDailyAutonomousTokenLimitToProject.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783702431535-AddAiDailyAutonomousTokenLimitToProject.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783720000000-AddNetworkDeviceTables.js +51 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783720000000-AddNetworkDeviceTables.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783721121260-AddAttemptCountToAIRun.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783721121260-AddAttemptCountToAIRun.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783730000000-AddNetworkDeviceOwnersAndRules.js +101 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783730000000-AddNetworkDeviceOwnersAndRules.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783740000000-AddNetworkDeviceDiscoveryScan.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783740000000-AddNetworkDeviceDiscoveryScan.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783750000000-AddLldpNeighborsToNetworkDevice.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783750000000-AddLldpNeighborsToNetworkDevice.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783760576655-AddInvestigationTuningToProject.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783760576655-AddInvestigationTuningToProject.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783762505482-AddTelemetryEntityRelationshipMetrics.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783762505482-AddTelemetryEntityRelationshipMetrics.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783780000000-AddIoTDeviceCredentialTable.js +38 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783780000000-AddIoTDeviceCredentialTable.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783790000000-AddSnmpV3AuthColumnsToNetworkDevice.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783790000000-AddSnmpV3AuthColumnsToNetworkDevice.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AIAgentTaskService.js +59 -0
- package/build/dist/Server/Services/AIAgentTaskService.js.map +1 -1
- package/build/dist/Server/Services/AIRunService.js +33 -0
- package/build/dist/Server/Services/AIRunService.js.map +1 -1
- package/build/dist/Server/Services/AIService.js +82 -9
- package/build/dist/Server/Services/AIService.js.map +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js +19 -0
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +14 -25
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +14 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/IoTDeviceCredentialService.js +321 -0
- package/build/dist/Server/Services/IoTDeviceCredentialService.js.map +1 -0
- package/build/dist/Server/Services/IoTDeviceService.js +49 -15
- package/build/dist/Server/Services/IoTDeviceService.js.map +1 -1
- package/build/dist/Server/Services/LlmLogService.js +29 -0
- package/build/dist/Server/Services/LlmLogService.js.map +1 -1
- package/build/dist/Server/Services/LlmProviderService.js +3 -0
- package/build/dist/Server/Services/LlmProviderService.js.map +1 -1
- package/build/dist/Server/Services/LogAggregationService.js +21 -7
- package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
- package/build/dist/Server/Services/MetricService.js +449 -7
- package/build/dist/Server/Services/MetricService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +2 -1
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js +9 -0
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js +166 -0
- package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceLabelRuleService.js +13 -0
- package/build/dist/Server/Services/NetworkDeviceLabelRuleService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerRuleEngineService.js +186 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerRuleService.js +13 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerRuleService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js +9 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js +9 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceService.js +52 -0
- package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -0
- package/build/dist/Server/Services/NetworkInterfaceService.js +9 -0
- package/build/dist/Server/Services/NetworkInterfaceService.js.map +1 -0
- package/build/dist/Server/Services/TelemetryEntityRelationshipService.js +22 -0
- package/build/dist/Server/Services/TelemetryEntityRelationshipService.js.map +1 -1
- package/build/dist/Server/Services/TelemetryEntityService.js +64 -2
- package/build/dist/Server/Services/TelemetryEntityService.js.map +1 -1
- package/build/dist/Server/Utils/AI/Sentinel/AlertInvestigationRunner.js +189 -9
- package/build/dist/Server/Utils/AI/Sentinel/AlertInvestigationRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.js +84 -17
- package/build/dist/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Sentinel/InvestigationQueue.js +428 -0
- package/build/dist/Server/Utils/AI/Sentinel/InvestigationQueue.js.map +1 -0
- package/build/dist/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.js +63 -47
- package/build/dist/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/Index.js +2 -1
- package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js +300 -0
- package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js.map +1 -1
- package/build/dist/Server/Utils/LLM/LLMService.js +16 -0
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/APIRequestCriteria.js +29 -0
- package/build/dist/Server/Utils/Monitor/Criteria/APIRequestCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js +130 -2
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/IoTDeviceAbsenceSeries.js +81 -0
- package/build/dist/Server/Utils/Monitor/IoTDeviceAbsenceSeries.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +18 -7
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +25 -10
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js +155 -5
- package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorResource.js +76 -30
- package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js +147 -0
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +167 -0
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/SnmpInterfaceRateUtil.js +93 -0
- package/build/dist/Server/Utils/Monitor/SnmpInterfaceRateUtil.js.map +1 -0
- package/build/dist/Types/AI/AIRunStatus.js +9 -0
- package/build/dist/Types/AI/AIRunStatus.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponentType.js +1 -0
- package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardLogChartComponent.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardLogChartComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardTemplates.js +9 -1
- package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
- package/build/dist/Types/LlmLogStatus.js +1 -0
- package/build/dist/Types/LlmLogStatus.js.map +1 -1
- package/build/dist/Types/Monitor/CriteriaFilter.js +9 -0
- package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
- package/build/dist/Types/Monitor/HttpPhaseTimings.js +2 -0
- package/build/dist/Types/Monitor/HttpPhaseTimings.js.map +1 -0
- package/build/dist/Types/Monitor/IotAlertTemplates.js +7 -7
- package/build/dist/Types/Monitor/IotAlertTemplates.js.map +1 -1
- package/build/dist/Types/Monitor/LatencyMatrix.js +2 -0
- package/build/dist/Types/Monitor/LatencyMatrix.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js +2 -2
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorMetricType.js +24 -0
- package/build/dist/Types/Monitor/MonitorMetricType.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +22 -9
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepNetworkDeviceMonitor.js +36 -0
- package/build/dist/Types/Monitor/MonitorStepNetworkDeviceMonitor.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorStepSnmpMonitor.js +3 -0
- package/build/dist/Types/Monitor/MonitorStepSnmpMonitor.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorType.js +14 -9
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/Monitor/PingMonitor/PingMonitorResponse.js +2 -0
- package/build/dist/Types/Monitor/PingMonitor/PingMonitorResponse.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/LldpNeighbor.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/LldpNeighbor.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +89 -0
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkTopology.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkTopology.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpInterface.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpInterface.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpTrap.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpTrap.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js +137 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js.map +1 -0
- package/build/dist/Types/Permission.js +280 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +7 -4
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +4 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +6 -3
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
- package/build/dist/UI/Components/CodeBlock/CodeBlock.js +1 -1
- package/build/dist/UI/Components/CodeBlock/CodeBlock.js.map +1 -1
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js +3 -1
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js.map +1 -1
- package/build/dist/UI/Components/Divider/Divider.js +1 -1
- package/build/dist/UI/Components/Divider/Divider.js.map +1 -1
- package/build/dist/UI/Components/Dropdown/Dropdown.js +10 -4
- package/build/dist/UI/Components/Dropdown/Dropdown.js.map +1 -1
- package/build/dist/UI/Components/EntityDropdown/EntityDropdown.js +76 -3
- package/build/dist/UI/Components/EntityDropdown/EntityDropdown.js.map +1 -1
- package/build/dist/UI/Components/ErrorBoundary.js +2 -1
- package/build/dist/UI/Components/ErrorBoundary.js.map +1 -1
- package/build/dist/UI/Components/EventItem/EventItem.js +2 -2
- package/build/dist/UI/Components/EventItem/EventItem.js.map +1 -1
- package/build/dist/UI/Components/GanttChart/Bar/Index.js +1 -1
- package/build/dist/UI/Components/GanttChart/Bar/Index.js.map +1 -1
- package/build/dist/UI/Components/Graphs/UptimeBarTooltip.js +29 -23
- package/build/dist/UI/Components/Graphs/UptimeBarTooltip.js.map +1 -1
- package/build/dist/UI/Components/Header/Header.js +1 -0
- package/build/dist/UI/Components/Header/Header.js.map +1 -1
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js +1 -1
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +8 -6
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/Label/Label.js +2 -2
- package/build/dist/UI/Components/Label/Label.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js +20 -8
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsHistogram.js +8 -2
- package/build/dist/UI/Components/LogsViewer/components/LogsHistogram.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownEditor.js +8 -8
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +40 -20
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
- package/build/dist/UI/Components/Modal/ConfirmModal.js +1 -1
- package/build/dist/UI/Components/Modal/ConfirmModal.js.map +1 -1
- package/build/dist/UI/Components/Modal/Modal.js +109 -51
- package/build/dist/UI/Components/Modal/Modal.js.map +1 -1
- package/build/dist/UI/Components/Modal/ModalFooter.js +13 -10
- package/build/dist/UI/Components/Modal/ModalFooter.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/TableView.js +1 -1
- package/build/dist/UI/Components/ModelTable/TableView.js.map +1 -1
- package/build/dist/UI/Components/MonitorGraphs/UptimeBarDayModal.js +17 -12
- package/build/dist/UI/Components/MonitorGraphs/UptimeBarDayModal.js.map +1 -1
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js +2 -2
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js.map +1 -1
- package/build/dist/UI/Components/Pill/Pill.js +12 -13
- package/build/dist/UI/Components/Pill/Pill.js.map +1 -1
- package/build/dist/UI/Components/StatusBubble/StatusBubble.js +3 -3
- package/build/dist/UI/Components/StatusBubble/StatusBubble.js.map +1 -1
- package/build/dist/UI/Components/Tabs/Tabs.js +3 -1
- package/build/dist/UI/Components/Tabs/Tabs.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js +1 -1
- package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogram.js +8 -2
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogram.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetrySearchBar.js +36 -6
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetrySearchBar.js.map +1 -1
- package/build/dist/UI/Components/Workflow/Component.js +43 -33
- package/build/dist/UI/Components/Workflow/Component.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentPortViewer.js +6 -6
- package/build/dist/UI/Components/Workflow/ComponentPortViewer.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js +8 -8
- package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentsModal.js +15 -9
- package/build/dist/UI/Components/Workflow/ComponentsModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/Workflow.js +13 -11
- package/build/dist/UI/Components/Workflow/Workflow.js.map +1 -1
- package/build/dist/UI/Utils/Navigation.js +11 -1
- package/build/dist/UI/Utils/Navigation.js.map +1 -1
- package/build/dist/UI/Utils/Theme.js +106 -0
- package/build/dist/UI/Utils/Theme.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardLogChartComponent.js +89 -0
- package/build/dist/Utils/Dashboard/Components/DashboardLogChartComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/Index.js +4 -0
- package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
- package/build/dist/Utils/Monitor/LatencyMatrixUtil.js +89 -0
- package/build/dist/Utils/Monitor/LatencyMatrixUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/MonitorMetricType.js +138 -4
- package/build/dist/Utils/Monitor/MonitorMetricType.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +112 -0
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -0
- package/build/dist/Utils/Telemetry/EntityRelationship.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,11 +8,19 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import OneUptimeDate from "../../../../Types/Date";
|
|
11
|
+
import SortOrder from "../../../../Types/BaseDatabase/SortOrder";
|
|
12
|
+
import AIRunType from "../../../../Types/AI/AIRunType";
|
|
11
13
|
import { Blue500 } from "../../../../Types/BrandColors";
|
|
12
14
|
import { AlertFeedEventType } from "../../../../Models/DatabaseModels/AlertFeed";
|
|
15
|
+
import AlertService from "../../../Services/AlertService";
|
|
16
|
+
import AlertSeverityService from "../../../Services/AlertSeverityService";
|
|
17
|
+
import ProjectService from "../../../Services/ProjectService";
|
|
18
|
+
import AIRunService from "../../../Services/AIRunService";
|
|
13
19
|
import AlertFeedService from "../../../Services/AlertFeedService";
|
|
20
|
+
import QueryHelper from "../../../Types/Database/QueryHelper";
|
|
14
21
|
import AlertAIContextBuilder from "../AlertAIContextBuilder";
|
|
15
22
|
import SentinelInvestigationEngine from "./SentinelInvestigationEngine";
|
|
23
|
+
import SentinelInvestigationQueue from "./InvestigationQueue";
|
|
16
24
|
import logger from "../../Logger";
|
|
17
25
|
import CaptureSpan from "../../Telemetry/CaptureSpan";
|
|
18
26
|
/*
|
|
@@ -23,13 +31,23 @@ import CaptureSpan from "../../Telemetry/CaptureSpan";
|
|
|
23
31
|
* the alert timeline + Slack/Teams. Symmetric to incident investigation and
|
|
24
32
|
* built on the same shared SentinelInvestigationEngine.
|
|
25
33
|
*
|
|
26
|
-
* Gated by the same per-project opt-in as incidents
|
|
27
|
-
*
|
|
34
|
+
* Gated by the same per-project opt-in as incidents, PLUS alert-specific cost
|
|
35
|
+
* gates (alert volume can be far higher than incidents):
|
|
36
|
+
* - severity floor: only alerts at or above the project's configured minimum
|
|
37
|
+
* severity are investigated; when unset, the top two severity tiers
|
|
38
|
+
* (lowest two `order` values) are the default.
|
|
39
|
+
* - per-monitor dedupe window: a monitor that already triggered an
|
|
40
|
+
* investigation recently is not re-investigated — the first RCA stands.
|
|
28
41
|
*/
|
|
42
|
+
// Per-project override lives in Project.alertInvestigationDedupeWindowMinutes.
|
|
43
|
+
export const DEFAULT_DEDUPE_WINDOW_MINUTES = 30;
|
|
44
|
+
// Clamp: an RCA older than a day is a new episode by any reading.
|
|
45
|
+
const MAX_DEDUPE_WINDOW_MINUTES = 24 * 60;
|
|
29
46
|
export default class SentinelAlertInvestigationRunner {
|
|
30
47
|
/*
|
|
31
48
|
* Entry point called (fire-and-forget) from AlertService.onCreateSuccess.
|
|
32
|
-
*
|
|
49
|
+
* Cheap: gates + a Queued AIRun row; execution happens via the queue.
|
|
50
|
+
* Never throws — all failures are logged.
|
|
33
51
|
*/
|
|
34
52
|
static async investigateNewAlert(data) {
|
|
35
53
|
const { alertId, projectId } = data;
|
|
@@ -37,14 +55,59 @@ export default class SentinelAlertInvestigationRunner {
|
|
|
37
55
|
if (!(await SentinelInvestigationEngine.isEnabledForProject(projectId, "Alert"))) {
|
|
38
56
|
return;
|
|
39
57
|
}
|
|
40
|
-
const
|
|
58
|
+
const gate = await this.shouldInvestigateAlert({
|
|
41
59
|
alertId,
|
|
60
|
+
projectId,
|
|
42
61
|
});
|
|
43
|
-
|
|
62
|
+
if (!gate.investigate) {
|
|
63
|
+
logger.debug(`Sentinel: skipping investigation for alert ${alertId.toString()} — ${gate.reason}.`);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
await SentinelInvestigationQueue.enqueue({
|
|
44
67
|
projectId,
|
|
45
|
-
feature: "Sentinel Alert Investigation",
|
|
46
68
|
subjectAlertId: alertId,
|
|
47
|
-
|
|
69
|
+
subjectMonitorId: gate.monitorId,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
logger.error(`Sentinel: unexpected error enqueueing investigation for alert ${alertId.toString()}: ${error}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/*
|
|
77
|
+
* Execute a claimed run: assemble alert context and hand it to the engine.
|
|
78
|
+
* Called by SentinelInvestigationQueue after a successful claim. Never
|
|
79
|
+
* throws — failures are handed to the queue's retry policy so a claimed
|
|
80
|
+
* run is always finalized or requeued.
|
|
81
|
+
*/
|
|
82
|
+
static async executeInvestigation(data) {
|
|
83
|
+
const { aiRunId, projectId, alertId, attemptCount } = data;
|
|
84
|
+
let contextSummary;
|
|
85
|
+
try {
|
|
86
|
+
const contextData = await AlertAIContextBuilder.buildAlertContext({
|
|
87
|
+
alertId,
|
|
88
|
+
});
|
|
89
|
+
contextSummary = this.buildAlertSummary(contextData);
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
/*
|
|
93
|
+
* Context assembly failed — the run is claimed, so hand it to the
|
|
94
|
+
* retry policy rather than leaving it Running until the sweeper.
|
|
95
|
+
*/
|
|
96
|
+
await SentinelInvestigationQueue.failOrRequeue({
|
|
97
|
+
aiRunId,
|
|
98
|
+
attemptCount,
|
|
99
|
+
errorMessage: `Failed to build alert context: ${error instanceof Error ? error.message : String(error)}`,
|
|
100
|
+
isPermanent: false,
|
|
101
|
+
});
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
await SentinelInvestigationEngine.executeRun({
|
|
105
|
+
aiRunId,
|
|
106
|
+
projectId,
|
|
107
|
+
attemptCount,
|
|
108
|
+
request: {
|
|
109
|
+
feature: "Sentinel Alert Investigation",
|
|
110
|
+
contextSummary,
|
|
48
111
|
postAnalysis: async (postData) => {
|
|
49
112
|
await AlertFeedService.createAlertFeedItem({
|
|
50
113
|
alertId,
|
|
@@ -61,11 +124,116 @@ export default class SentinelAlertInvestigationRunner {
|
|
|
61
124
|
},
|
|
62
125
|
});
|
|
63
126
|
},
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/*
|
|
131
|
+
* The alert-specific cost gates, evaluated BEFORE the expensive context
|
|
132
|
+
* build. Severity first (cheapest to reason about), then the per-monitor
|
|
133
|
+
* dedupe window. The severity gate only filters KNOWN-low-severity noise:
|
|
134
|
+
* an alert whose severity order cannot be determined passes it.
|
|
135
|
+
*/
|
|
136
|
+
static async shouldInvestigateAlert(data) {
|
|
137
|
+
var _a, _b;
|
|
138
|
+
const { alertId, projectId } = data;
|
|
139
|
+
const alert = await AlertService.findOneById({
|
|
140
|
+
id: alertId,
|
|
141
|
+
select: {
|
|
142
|
+
monitorId: true,
|
|
143
|
+
alertSeverity: {
|
|
144
|
+
order: true,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
props: { isRoot: true },
|
|
148
|
+
});
|
|
149
|
+
if (!alert) {
|
|
150
|
+
return { investigate: false, reason: "alert not found" };
|
|
151
|
+
}
|
|
152
|
+
// One project read serves both the severity floor and the dedupe window.
|
|
153
|
+
const project = await ProjectService.findOneById({
|
|
154
|
+
id: projectId,
|
|
155
|
+
select: {
|
|
156
|
+
alertInvestigationMinimumSeverityId: true,
|
|
157
|
+
alertInvestigationDedupeWindowMinutes: true,
|
|
158
|
+
},
|
|
159
|
+
props: { isRoot: true },
|
|
160
|
+
});
|
|
161
|
+
// Severity floor.
|
|
162
|
+
const floorOrder = await this.getSeverityFloorOrder(projectId, project === null || project === void 0 ? void 0 : project.alertInvestigationMinimumSeverityId);
|
|
163
|
+
const alertOrder = (_a = alert.alertSeverity) === null || _a === void 0 ? void 0 : _a.order;
|
|
164
|
+
if (floorOrder !== null &&
|
|
165
|
+
alertOrder !== undefined &&
|
|
166
|
+
alertOrder > floorOrder) {
|
|
167
|
+
return {
|
|
168
|
+
investigate: false,
|
|
169
|
+
reason: `severity order ${alertOrder} is below the investigation floor (order ${floorOrder})`,
|
|
170
|
+
monitorId: alert.monitorId,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/*
|
|
174
|
+
* Per-monitor dedupe window: per-project override, defaulting to 30
|
|
175
|
+
* minutes, clamped to at most a day; 0 disables the cooldown. Alerts
|
|
176
|
+
* without a monitor have no dedupe key.
|
|
177
|
+
*/
|
|
178
|
+
const dedupeWindowMinutes = Math.min(MAX_DEDUPE_WINDOW_MINUTES, Math.max(0, (_b = project === null || project === void 0 ? void 0 : project.alertInvestigationDedupeWindowMinutes) !== null && _b !== void 0 ? _b : DEFAULT_DEDUPE_WINDOW_MINUTES));
|
|
179
|
+
if (alert.monitorId && dedupeWindowMinutes > 0) {
|
|
180
|
+
const windowStart = OneUptimeDate.getSomeMinutesAgo(dedupeWindowMinutes);
|
|
181
|
+
const recentRunCount = (await AIRunService.countBy({
|
|
182
|
+
query: {
|
|
183
|
+
projectId,
|
|
184
|
+
monitorId: alert.monitorId,
|
|
185
|
+
runType: AIRunType.Investigation,
|
|
186
|
+
createdAt: QueryHelper.greaterThan(windowStart),
|
|
187
|
+
},
|
|
188
|
+
props: { isRoot: true },
|
|
189
|
+
})).toNumber();
|
|
190
|
+
if (recentRunCount > 0) {
|
|
191
|
+
return {
|
|
192
|
+
investigate: false,
|
|
193
|
+
reason: `monitor ${alert.monitorId.toString()} was already investigated within the last ${dedupeWindowMinutes} minutes`,
|
|
194
|
+
monitorId: alert.monitorId,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
investigate: true,
|
|
200
|
+
reason: "passed severity and dedupe gates",
|
|
201
|
+
monitorId: alert.monitorId,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
/*
|
|
205
|
+
* The severity `order` value that still qualifies for investigation (lower
|
|
206
|
+
* order = higher severity; an alert qualifies when its order <= floor).
|
|
207
|
+
* An explicitly configured minimum severity wins; when unset — or when the
|
|
208
|
+
* configured severity has been deleted — the default is the project's top
|
|
209
|
+
* two tiers. Returns null when no floor applies (no severities configured).
|
|
210
|
+
*/
|
|
211
|
+
static async getSeverityFloorOrder(projectId, minimumSeverityId) {
|
|
212
|
+
var _a;
|
|
213
|
+
if (minimumSeverityId) {
|
|
214
|
+
const floorSeverity = await AlertSeverityService.findOneById({
|
|
215
|
+
id: minimumSeverityId,
|
|
216
|
+
select: { order: true },
|
|
217
|
+
props: { isRoot: true },
|
|
64
218
|
});
|
|
219
|
+
if (floorSeverity && floorSeverity.order !== undefined) {
|
|
220
|
+
return floorSeverity.order;
|
|
221
|
+
}
|
|
65
222
|
}
|
|
66
|
-
|
|
67
|
-
|
|
223
|
+
// Default: the top two severity tiers (the two lowest order values).
|
|
224
|
+
const topTiers = await AlertSeverityService.findBy({
|
|
225
|
+
query: { projectId },
|
|
226
|
+
select: { order: true },
|
|
227
|
+
sort: { order: SortOrder.Ascending },
|
|
228
|
+
limit: 2,
|
|
229
|
+
skip: 0,
|
|
230
|
+
props: { isRoot: true },
|
|
231
|
+
});
|
|
232
|
+
if (topTiers.length === 0) {
|
|
233
|
+
return null;
|
|
68
234
|
}
|
|
235
|
+
const lastTier = topTiers[topTiers.length - 1];
|
|
236
|
+
return (_a = lastTier.order) !== null && _a !== void 0 ? _a : null;
|
|
69
237
|
}
|
|
70
238
|
// Build a compact alert record to seed the investigation.
|
|
71
239
|
static buildAlertSummary(contextData) {
|
|
@@ -116,4 +284,16 @@ __decorate([
|
|
|
116
284
|
__metadata("design:paramtypes", [Object]),
|
|
117
285
|
__metadata("design:returntype", Promise)
|
|
118
286
|
], SentinelAlertInvestigationRunner, "investigateNewAlert", null);
|
|
287
|
+
__decorate([
|
|
288
|
+
CaptureSpan(),
|
|
289
|
+
__metadata("design:type", Function),
|
|
290
|
+
__metadata("design:paramtypes", [Object]),
|
|
291
|
+
__metadata("design:returntype", Promise)
|
|
292
|
+
], SentinelAlertInvestigationRunner, "executeInvestigation", null);
|
|
293
|
+
__decorate([
|
|
294
|
+
CaptureSpan(),
|
|
295
|
+
__metadata("design:type", Function),
|
|
296
|
+
__metadata("design:paramtypes", [Object]),
|
|
297
|
+
__metadata("design:returntype", Promise)
|
|
298
|
+
], SentinelAlertInvestigationRunner, "shouldInvestigateAlert", null);
|
|
119
299
|
//# sourceMappingURL=AlertInvestigationRunner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertInvestigationRunner.js","sourceRoot":"","sources":["../../../../../../Server/Utils/AI/Sentinel/AlertInvestigationRunner.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"AlertInvestigationRunner.js","sourceRoot":"","sources":["../../../../../../Server/Utils/AI/Sentinel/AlertInvestigationRunner.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,SAAS,MAAM,0CAA0C,CAAC;AACjE,OAAO,SAAS,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAIxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,YAAY,MAAM,gCAAgC,CAAC;AAC1D,OAAO,oBAAoB,MAAM,wCAAwC,CAAC;AAC1E,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,YAAY,MAAM,gCAAgC,CAAC;AAC1D,OAAO,gBAAgB,MAAM,oCAAoC,CAAC;AAClE,OAAO,WAAW,MAAM,qCAAqC,CAAC;AAC9D,OAAO,qBAEN,MAAM,0BAA0B,CAAC;AAClC,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AACxE,OAAO,0BAA0B,MAAM,sBAAsB,CAAC;AAE9D,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,WAAW,MAAM,6BAA6B,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AAEH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,6BAA6B,GA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EAuCb;AASmB;IADnB,WAAW,EAAE;;;;kEA8Db;AASmB;IADnB,WAAW,EAAE;;;;oEA+Fb"}
|
|
@@ -10,9 +10,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
import OneUptimeDate from "../../../../Types/Date";
|
|
11
11
|
import { Blue500 } from "../../../../Types/BrandColors";
|
|
12
12
|
import { IncidentFeedEventType } from "../../../../Models/DatabaseModels/IncidentFeed";
|
|
13
|
+
import IncidentInternalNote from "../../../../Models/DatabaseModels/IncidentInternalNote";
|
|
13
14
|
import IncidentFeedService from "../../../Services/IncidentFeedService";
|
|
15
|
+
import IncidentInternalNoteService from "../../../Services/IncidentInternalNoteService";
|
|
14
16
|
import IncidentAIContextBuilder from "../IncidentAIContextBuilder";
|
|
15
17
|
import SentinelInvestigationEngine from "./SentinelInvestigationEngine";
|
|
18
|
+
import SentinelInvestigationQueue from "./InvestigationQueue";
|
|
16
19
|
import SentinelMemory from "./SentinelMemory";
|
|
17
20
|
import logger from "../../Logger";
|
|
18
21
|
import CaptureSpan from "../../Telemetry/CaptureSpan";
|
|
@@ -21,18 +24,17 @@ import CaptureSpan from "../../Telemetry/CaptureSpan";
|
|
|
21
24
|
*
|
|
22
25
|
* When a new incident is declared, wakes Sentinel to investigate it (read-only)
|
|
23
26
|
* and post a cited root-cause analysis into the incident timeline + Slack/Teams
|
|
24
|
-
* — before the on-call engineer has finished reading the page. The
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* Built on the fire-and-forget async pattern already used throughout
|
|
30
|
-
* IncidentService.onCreateSuccess. See Internal/Roadmap/AISentinelReliabilityBrain.md.
|
|
27
|
+
* — before the on-call engineer has finished reading the page. The trigger only
|
|
28
|
+
* records durable intent (a Queued AIRun via SentinelInvestigationQueue), so a
|
|
29
|
+
* pod restart can no longer orphan an investigation; the heavy lifting (run
|
|
30
|
+
* lifecycle, the agent loop, confidence gating) lives in the shared
|
|
31
|
+
* SentinelInvestigationEngine. See Internal/Roadmap/AISentinelExecution.md.
|
|
31
32
|
*/
|
|
32
33
|
export default class SentinelIncidentInvestigationRunner {
|
|
33
34
|
/*
|
|
34
35
|
* Entry point called (fire-and-forget) from IncidentService.onCreateSuccess.
|
|
35
|
-
*
|
|
36
|
+
* Cheap: gates + a Queued AIRun row; execution happens via the queue.
|
|
37
|
+
* Never throws — all failures are logged.
|
|
36
38
|
*/
|
|
37
39
|
static async investigateNewIncident(data) {
|
|
38
40
|
const { incidentId, projectId } = data;
|
|
@@ -40,6 +42,25 @@ export default class SentinelIncidentInvestigationRunner {
|
|
|
40
42
|
if (!(await SentinelInvestigationEngine.isEnabledForProject(projectId, "Incident"))) {
|
|
41
43
|
return;
|
|
42
44
|
}
|
|
45
|
+
await SentinelInvestigationQueue.enqueue({
|
|
46
|
+
projectId,
|
|
47
|
+
subjectIncidentId: incidentId,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
logger.error(`Sentinel: unexpected error enqueueing investigation for incident ${incidentId.toString()}: ${error}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/*
|
|
55
|
+
* Execute a claimed run: assemble incident context and hand it to the
|
|
56
|
+
* engine. Called by SentinelInvestigationQueue after a successful claim.
|
|
57
|
+
* Never throws — failures are handed to the queue's retry policy so a
|
|
58
|
+
* claimed run is always finalized or requeued.
|
|
59
|
+
*/
|
|
60
|
+
static async executeInvestigation(data) {
|
|
61
|
+
const { aiRunId, projectId, incidentId, attemptCount } = data;
|
|
62
|
+
let contextSummary;
|
|
63
|
+
try {
|
|
43
64
|
const contextData = await IncidentAIContextBuilder.buildIncidentContext({
|
|
44
65
|
incidentId,
|
|
45
66
|
includeWorkspaceMessages: false,
|
|
@@ -63,11 +84,29 @@ export default class SentinelIncidentInvestigationRunner {
|
|
|
63
84
|
})
|
|
64
85
|
.filter(Boolean),
|
|
65
86
|
});
|
|
66
|
-
|
|
67
|
-
|
|
87
|
+
contextSummary =
|
|
88
|
+
this.buildIncidentSummary(contextData) + priorCasesContext;
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
/*
|
|
92
|
+
* Context assembly failed — the run is claimed, so hand it to the
|
|
93
|
+
* retry policy rather than leaving it Running until the sweeper.
|
|
94
|
+
*/
|
|
95
|
+
await SentinelInvestigationQueue.failOrRequeue({
|
|
96
|
+
aiRunId,
|
|
97
|
+
attemptCount,
|
|
98
|
+
errorMessage: `Failed to build incident context: ${error instanceof Error ? error.message : String(error)}`,
|
|
99
|
+
isPermanent: false,
|
|
100
|
+
});
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
await SentinelInvestigationEngine.executeRun({
|
|
104
|
+
aiRunId,
|
|
105
|
+
projectId,
|
|
106
|
+
attemptCount,
|
|
107
|
+
request: {
|
|
68
108
|
feature: "Sentinel Incident Investigation",
|
|
69
|
-
|
|
70
|
-
contextSummary: this.buildIncidentSummary(contextData) + priorCasesContext,
|
|
109
|
+
contextSummary,
|
|
71
110
|
postAnalysis: async (postData) => {
|
|
72
111
|
await IncidentFeedService.createIncidentFeedItem({
|
|
73
112
|
incidentId,
|
|
@@ -83,12 +122,34 @@ export default class SentinelIncidentInvestigationRunner {
|
|
|
83
122
|
sendWorkspaceNotification: postData.isConfident,
|
|
84
123
|
},
|
|
85
124
|
});
|
|
125
|
+
/*
|
|
126
|
+
* Also file the RCA as an incident internal note, where responders
|
|
127
|
+
* collaborate. The RootCause feed item above, with its quiet-mode
|
|
128
|
+
* gating, must stay the single notification source, so:
|
|
129
|
+
* ignoreHooks skips the note service's "posted private note" feed
|
|
130
|
+
* item + unconditional workspace ping (workflow triggers and
|
|
131
|
+
* realtime updates still fire), and isOwnerNotified stops the
|
|
132
|
+
* note-posted owner-notification cron from paging owners about it.
|
|
133
|
+
* Best-effort: a note failure must not fail the run after the feed
|
|
134
|
+
* item already posted.
|
|
135
|
+
*/
|
|
136
|
+
try {
|
|
137
|
+
const note = new IncidentInternalNote();
|
|
138
|
+
note.incidentId = incidentId;
|
|
139
|
+
note.projectId = projectId;
|
|
140
|
+
note.note = postData.analysisMarkdown;
|
|
141
|
+
note.isOwnerNotified = true;
|
|
142
|
+
await IncidentInternalNoteService.create({
|
|
143
|
+
data: note,
|
|
144
|
+
props: { isRoot: true, ignoreHooks: true },
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
logger.error(`Sentinel: failed to post RCA internal note for incident ${incidentId.toString()}: ${error}`);
|
|
149
|
+
}
|
|
86
150
|
},
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
catch (error) {
|
|
90
|
-
logger.error(`Sentinel: unexpected error investigating incident ${incidentId.toString()}: ${error}`);
|
|
91
|
-
}
|
|
151
|
+
},
|
|
152
|
+
});
|
|
92
153
|
}
|
|
93
154
|
// Build a compact incident record to seed the investigation.
|
|
94
155
|
static buildIncidentSummary(contextData) {
|
|
@@ -144,4 +205,10 @@ __decorate([
|
|
|
144
205
|
__metadata("design:paramtypes", [Object]),
|
|
145
206
|
__metadata("design:returntype", Promise)
|
|
146
207
|
], SentinelIncidentInvestigationRunner, "investigateNewIncident", null);
|
|
208
|
+
__decorate([
|
|
209
|
+
CaptureSpan(),
|
|
210
|
+
__metadata("design:type", Function),
|
|
211
|
+
__metadata("design:paramtypes", [Object]),
|
|
212
|
+
__metadata("design:returntype", Promise)
|
|
213
|
+
], SentinelIncidentInvestigationRunner, "executeInvestigation", null);
|
|
147
214
|
//# sourceMappingURL=IncidentInvestigationRunner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncidentInvestigationRunner.js","sourceRoot":"","sources":["../../../../../../Server/Utils/AI/Sentinel/IncidentInvestigationRunner.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,mBAAmB,MAAM,uCAAuC,CAAC;AACxE,OAAO,wBAEN,MAAM,6BAA6B,CAAC;AACrC,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AACxE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,WAAW,MAAM,6BAA6B,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"IncidentInvestigationRunner.js","sourceRoot":"","sources":["../../../../../../Server/Utils/AI/Sentinel/IncidentInvestigationRunner.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,oBAAoB,MAAM,wDAAwD,CAAC;AAC1F,OAAO,mBAAmB,MAAM,uCAAuC,CAAC;AACxE,OAAO,2BAA2B,MAAM,+CAA+C,CAAC;AACxF,OAAO,wBAEN,MAAM,6BAA6B,CAAC;AACrC,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AACxE,OAAO,0BAA0B,MAAM,sBAAsB,CAAC;AAC9D,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,WAAW,MAAM,6BAA6B,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,OAAO,mCAAmC;IACtD;;;;OAIG;IAEiB,AAAb,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,IAG1C;QACC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QAEvC,IAAI,CAAC;YACH,IACE,CAAC,CAAC,MAAM,2BAA2B,CAAC,mBAAmB,CACrD,SAAS,EACT,UAAU,CACX,CAAC,EACF,CAAC;gBACD,OAAO;YACT,CAAC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