@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
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import DatabaseService from "./DatabaseService";
|
|
2
2
|
import Model from "../../Models/DatabaseModels/TelemetryEntity";
|
|
3
|
+
import Service from "../../Models/DatabaseModels/Service";
|
|
4
|
+
import ServiceService from "./ServiceService";
|
|
5
|
+
import QueryHelper from "../Types/Database/QueryHelper";
|
|
6
|
+
import SortOrder from "../../Types/BaseDatabase/SortOrder";
|
|
3
7
|
import ObjectID from "../../Types/ObjectID";
|
|
4
8
|
import OneUptimeDate from "../../Types/Date";
|
|
5
9
|
import ColumnLength from "../../Types/Database/ColumnLength";
|
|
@@ -68,6 +72,51 @@ export class TelemetryEntityService extends DatabaseService<Model> {
|
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
|
|
75
|
+
/**
|
|
76
|
+
* The polymorphic (resourceType, resourceId) pointer for Service
|
|
77
|
+
* entities: resolve the backing Service row by name (case-insensitive —
|
|
78
|
+
* entity display names are canonicalized to lowercase while Service
|
|
79
|
+
* rows keep their original casing, the same matching ingest itself
|
|
80
|
+
* uses). This is the single place the name join happens; everything
|
|
81
|
+
* downstream (traces links, overlays) reads the pointer instead of
|
|
82
|
+
* re-matching names. Best-effort: no Service row means no pointer.
|
|
83
|
+
*/
|
|
84
|
+
private async resolveServiceResourceId(data: {
|
|
85
|
+
projectId: ObjectID;
|
|
86
|
+
entity: ExtractedEntity;
|
|
87
|
+
}): Promise<ObjectID | null> {
|
|
88
|
+
if (data.entity.entityType !== EntityType.Service) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
const name: string = TelemetryEntityService.deriveDisplayName(data.entity);
|
|
92
|
+
if (!name) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
/*
|
|
97
|
+
* createdAt ASC mirrors ingest's findOrCreateTelemetryService: if
|
|
98
|
+
* case-variant duplicate Service rows exist, telemetry keys to the
|
|
99
|
+
* OLDEST row, so the pointer must resolve to the same one.
|
|
100
|
+
*/
|
|
101
|
+
const service: Service | null = await ServiceService.findOneBy({
|
|
102
|
+
query: {
|
|
103
|
+
projectId: data.projectId,
|
|
104
|
+
name: QueryHelper.findWithSameText(name),
|
|
105
|
+
},
|
|
106
|
+
select: { _id: true },
|
|
107
|
+
sort: { createdAt: SortOrder.Ascending },
|
|
108
|
+
props: { isRoot: true },
|
|
109
|
+
});
|
|
110
|
+
return service?._id ? new ObjectID(service._id.toString()) : null;
|
|
111
|
+
} catch (err) {
|
|
112
|
+
logger.error(
|
|
113
|
+
`TelemetryEntityService: failed to resolve Service row for entity name "${name}":`,
|
|
114
|
+
);
|
|
115
|
+
logger.error(err as Error);
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
71
120
|
private async upsertEntity(data: {
|
|
72
121
|
projectId: ObjectID;
|
|
73
122
|
entity: ExtractedEntity;
|
|
@@ -76,6 +125,9 @@ export class TelemetryEntityService extends DatabaseService<Model> {
|
|
|
76
125
|
const { projectId, entity, countByType } = data;
|
|
77
126
|
const now: Date = OneUptimeDate.getCurrentDate();
|
|
78
127
|
|
|
128
|
+
const serviceResourceId: ObjectID | null =
|
|
129
|
+
await this.resolveServiceResourceId({ projectId, entity });
|
|
130
|
+
|
|
79
131
|
await reconcileByNaturalKey({
|
|
80
132
|
service: this,
|
|
81
133
|
query: {
|
|
@@ -85,9 +137,23 @@ export class TelemetryEntityService extends DatabaseService<Model> {
|
|
|
85
137
|
},
|
|
86
138
|
lastSeenAt: now,
|
|
87
139
|
describe: `entity ${entity.entityType}/${entity.entityKey}`,
|
|
88
|
-
select: { descriptiveAttributes: true, labels: true },
|
|
140
|
+
select: { descriptiveAttributes: true, labels: true, resourceId: true },
|
|
89
141
|
buildUpdate: (existing: Model): QueryDeepPartialEntity<Model> => {
|
|
90
|
-
|
|
142
|
+
const update: QueryDeepPartialEntity<Model> =
|
|
143
|
+
TelemetryEntityService.buildDescriptiveUpdate(entity, existing);
|
|
144
|
+
/*
|
|
145
|
+
* Stamp / refresh the pointer on the throttled bump too, so
|
|
146
|
+
* pre-existing rows converge and a deleted+recreated Service
|
|
147
|
+
* (new id, same name) heals instead of pointing at a dead row.
|
|
148
|
+
*/
|
|
149
|
+
if (
|
|
150
|
+
serviceResourceId &&
|
|
151
|
+
existing.resourceId?.toString() !== serviceResourceId.toString()
|
|
152
|
+
) {
|
|
153
|
+
(update as { resourceType?: string }).resourceType = "Service";
|
|
154
|
+
(update as { resourceId?: ObjectID }).resourceId = serviceResourceId;
|
|
155
|
+
}
|
|
156
|
+
return update;
|
|
91
157
|
},
|
|
92
158
|
/*
|
|
93
159
|
* Entity budget (doc §Edge Cases): existing rows always get their
|
|
@@ -145,6 +211,10 @@ export class TelemetryEntityService extends DatabaseService<Model> {
|
|
|
145
211
|
model.displayName = TelemetryEntityService.deriveDisplayName(
|
|
146
212
|
entity,
|
|
147
213
|
).substring(0, ColumnLength.ShortText);
|
|
214
|
+
if (serviceResourceId) {
|
|
215
|
+
model.resourceType = "Service";
|
|
216
|
+
model.resourceId = serviceResourceId;
|
|
217
|
+
}
|
|
148
218
|
model.firstSeenAt = now;
|
|
149
219
|
model.lastSeenAt = now;
|
|
150
220
|
return model;
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import ObjectID from "../../../../Types/ObjectID";
|
|
2
2
|
import OneUptimeDate from "../../../../Types/Date";
|
|
3
|
+
import SortOrder from "../../../../Types/BaseDatabase/SortOrder";
|
|
4
|
+
import AIRunType from "../../../../Types/AI/AIRunType";
|
|
3
5
|
import { Blue500 } from "../../../../Types/BrandColors";
|
|
6
|
+
import Alert from "../../../../Models/DatabaseModels/Alert";
|
|
7
|
+
import AlertSeverity from "../../../../Models/DatabaseModels/AlertSeverity";
|
|
8
|
+
import Project from "../../../../Models/DatabaseModels/Project";
|
|
4
9
|
import { AlertFeedEventType } from "../../../../Models/DatabaseModels/AlertFeed";
|
|
10
|
+
import AlertService from "../../../Services/AlertService";
|
|
11
|
+
import AlertSeverityService from "../../../Services/AlertSeverityService";
|
|
12
|
+
import ProjectService from "../../../Services/ProjectService";
|
|
13
|
+
import AIRunService from "../../../Services/AIRunService";
|
|
5
14
|
import AlertFeedService from "../../../Services/AlertFeedService";
|
|
15
|
+
import QueryHelper from "../../../Types/Database/QueryHelper";
|
|
6
16
|
import AlertAIContextBuilder, {
|
|
7
17
|
AlertContextData,
|
|
8
18
|
} from "../AlertAIContextBuilder";
|
|
9
19
|
import SentinelInvestigationEngine from "./SentinelInvestigationEngine";
|
|
20
|
+
import SentinelInvestigationQueue from "./InvestigationQueue";
|
|
10
21
|
import { ObservabilityAssistantResult } from "../Chat/ObservabilityAssistant";
|
|
11
22
|
import logger from "../../Logger";
|
|
12
23
|
import CaptureSpan from "../../Telemetry/CaptureSpan";
|
|
@@ -19,13 +30,33 @@ import CaptureSpan from "../../Telemetry/CaptureSpan";
|
|
|
19
30
|
* the alert timeline + Slack/Teams. Symmetric to incident investigation and
|
|
20
31
|
* built on the same shared SentinelInvestigationEngine.
|
|
21
32
|
*
|
|
22
|
-
* Gated by the same per-project opt-in as incidents
|
|
23
|
-
*
|
|
33
|
+
* Gated by the same per-project opt-in as incidents, PLUS alert-specific cost
|
|
34
|
+
* gates (alert volume can be far higher than incidents):
|
|
35
|
+
* - severity floor: only alerts at or above the project's configured minimum
|
|
36
|
+
* severity are investigated; when unset, the top two severity tiers
|
|
37
|
+
* (lowest two `order` values) are the default.
|
|
38
|
+
* - per-monitor dedupe window: a monitor that already triggered an
|
|
39
|
+
* investigation recently is not re-investigated — the first RCA stands.
|
|
24
40
|
*/
|
|
41
|
+
|
|
42
|
+
// Per-project override lives in Project.alertInvestigationDedupeWindowMinutes.
|
|
43
|
+
export const DEFAULT_DEDUPE_WINDOW_MINUTES: number = 30;
|
|
44
|
+
// Clamp: an RCA older than a day is a new episode by any reading.
|
|
45
|
+
const MAX_DEDUPE_WINDOW_MINUTES: number = 24 * 60;
|
|
46
|
+
|
|
47
|
+
export interface AlertGateDecision {
|
|
48
|
+
investigate: boolean;
|
|
49
|
+
// Human-readable reason recorded in the debug log when skipping.
|
|
50
|
+
reason: string;
|
|
51
|
+
// Passed through to the AIRun as the dedupe key for future windows.
|
|
52
|
+
monitorId?: ObjectID | undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
25
55
|
export default class SentinelAlertInvestigationRunner {
|
|
26
56
|
/*
|
|
27
57
|
* Entry point called (fire-and-forget) from AlertService.onCreateSuccess.
|
|
28
|
-
*
|
|
58
|
+
* Cheap: gates + a Queued AIRun row; execution happens via the queue.
|
|
59
|
+
* Never throws — all failures are logged.
|
|
29
60
|
*/
|
|
30
61
|
@CaptureSpan()
|
|
31
62
|
public static async investigateNewAlert(data: {
|
|
@@ -44,16 +75,76 @@ export default class SentinelAlertInvestigationRunner {
|
|
|
44
75
|
return;
|
|
45
76
|
}
|
|
46
77
|
|
|
78
|
+
const gate: AlertGateDecision = await this.shouldInvestigateAlert({
|
|
79
|
+
alertId,
|
|
80
|
+
projectId,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
if (!gate.investigate) {
|
|
84
|
+
logger.debug(
|
|
85
|
+
`Sentinel: skipping investigation for alert ${alertId.toString()} — ${gate.reason}.`,
|
|
86
|
+
);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
await SentinelInvestigationQueue.enqueue({
|
|
91
|
+
projectId,
|
|
92
|
+
subjectAlertId: alertId,
|
|
93
|
+
subjectMonitorId: gate.monitorId,
|
|
94
|
+
});
|
|
95
|
+
} catch (error) {
|
|
96
|
+
logger.error(
|
|
97
|
+
`Sentinel: unexpected error enqueueing investigation for alert ${alertId.toString()}: ${error}`,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/*
|
|
103
|
+
* Execute a claimed run: assemble alert context and hand it to the engine.
|
|
104
|
+
* Called by SentinelInvestigationQueue after a successful claim. Never
|
|
105
|
+
* throws — failures are handed to the queue's retry policy so a claimed
|
|
106
|
+
* run is always finalized or requeued.
|
|
107
|
+
*/
|
|
108
|
+
@CaptureSpan()
|
|
109
|
+
public static async executeInvestigation(data: {
|
|
110
|
+
aiRunId: ObjectID;
|
|
111
|
+
projectId: ObjectID;
|
|
112
|
+
alertId: ObjectID;
|
|
113
|
+
attemptCount: number;
|
|
114
|
+
}): Promise<void> {
|
|
115
|
+
const { aiRunId, projectId, alertId, attemptCount } = data;
|
|
116
|
+
|
|
117
|
+
let contextSummary: string;
|
|
118
|
+
try {
|
|
47
119
|
const contextData: AlertContextData =
|
|
48
120
|
await AlertAIContextBuilder.buildAlertContext({
|
|
49
121
|
alertId,
|
|
50
122
|
});
|
|
51
123
|
|
|
52
|
-
|
|
53
|
-
|
|
124
|
+
contextSummary = this.buildAlertSummary(contextData);
|
|
125
|
+
} catch (error) {
|
|
126
|
+
/*
|
|
127
|
+
* Context assembly failed — the run is claimed, so hand it to the
|
|
128
|
+
* retry policy rather than leaving it Running until the sweeper.
|
|
129
|
+
*/
|
|
130
|
+
await SentinelInvestigationQueue.failOrRequeue({
|
|
131
|
+
aiRunId,
|
|
132
|
+
attemptCount,
|
|
133
|
+
errorMessage: `Failed to build alert context: ${
|
|
134
|
+
error instanceof Error ? error.message : String(error)
|
|
135
|
+
}`,
|
|
136
|
+
isPermanent: false,
|
|
137
|
+
});
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
await SentinelInvestigationEngine.executeRun({
|
|
142
|
+
aiRunId,
|
|
143
|
+
projectId,
|
|
144
|
+
attemptCount,
|
|
145
|
+
request: {
|
|
54
146
|
feature: "Sentinel Alert Investigation",
|
|
55
|
-
|
|
56
|
-
contextSummary: this.buildAlertSummary(contextData),
|
|
147
|
+
contextSummary,
|
|
57
148
|
postAnalysis: async (postData: {
|
|
58
149
|
analysisMarkdown: string;
|
|
59
150
|
isConfident: boolean;
|
|
@@ -74,12 +165,153 @@ export default class SentinelAlertInvestigationRunner {
|
|
|
74
165
|
},
|
|
75
166
|
});
|
|
76
167
|
},
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/*
|
|
173
|
+
* The alert-specific cost gates, evaluated BEFORE the expensive context
|
|
174
|
+
* build. Severity first (cheapest to reason about), then the per-monitor
|
|
175
|
+
* dedupe window. The severity gate only filters KNOWN-low-severity noise:
|
|
176
|
+
* an alert whose severity order cannot be determined passes it.
|
|
177
|
+
*/
|
|
178
|
+
@CaptureSpan()
|
|
179
|
+
public static async shouldInvestigateAlert(data: {
|
|
180
|
+
alertId: ObjectID;
|
|
181
|
+
projectId: ObjectID;
|
|
182
|
+
}): Promise<AlertGateDecision> {
|
|
183
|
+
const { alertId, projectId } = data;
|
|
184
|
+
|
|
185
|
+
const alert: Alert | null = await AlertService.findOneById({
|
|
186
|
+
id: alertId,
|
|
187
|
+
select: {
|
|
188
|
+
monitorId: true,
|
|
189
|
+
alertSeverity: {
|
|
190
|
+
order: true,
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
props: { isRoot: true },
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
if (!alert) {
|
|
197
|
+
return { investigate: false, reason: "alert not found" };
|
|
82
198
|
}
|
|
199
|
+
|
|
200
|
+
// One project read serves both the severity floor and the dedupe window.
|
|
201
|
+
const project: Project | null = await ProjectService.findOneById({
|
|
202
|
+
id: projectId,
|
|
203
|
+
select: {
|
|
204
|
+
alertInvestigationMinimumSeverityId: true,
|
|
205
|
+
alertInvestigationDedupeWindowMinutes: true,
|
|
206
|
+
},
|
|
207
|
+
props: { isRoot: true },
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
// Severity floor.
|
|
211
|
+
const floorOrder: number | null = await this.getSeverityFloorOrder(
|
|
212
|
+
projectId,
|
|
213
|
+
project?.alertInvestigationMinimumSeverityId,
|
|
214
|
+
);
|
|
215
|
+
const alertOrder: number | undefined = alert.alertSeverity?.order;
|
|
216
|
+
|
|
217
|
+
if (
|
|
218
|
+
floorOrder !== null &&
|
|
219
|
+
alertOrder !== undefined &&
|
|
220
|
+
alertOrder > floorOrder
|
|
221
|
+
) {
|
|
222
|
+
return {
|
|
223
|
+
investigate: false,
|
|
224
|
+
reason: `severity order ${alertOrder} is below the investigation floor (order ${floorOrder})`,
|
|
225
|
+
monitorId: alert.monitorId,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/*
|
|
230
|
+
* Per-monitor dedupe window: per-project override, defaulting to 30
|
|
231
|
+
* minutes, clamped to at most a day; 0 disables the cooldown. Alerts
|
|
232
|
+
* without a monitor have no dedupe key.
|
|
233
|
+
*/
|
|
234
|
+
const dedupeWindowMinutes: number = Math.min(
|
|
235
|
+
MAX_DEDUPE_WINDOW_MINUTES,
|
|
236
|
+
Math.max(
|
|
237
|
+
0,
|
|
238
|
+
project?.alertInvestigationDedupeWindowMinutes ??
|
|
239
|
+
DEFAULT_DEDUPE_WINDOW_MINUTES,
|
|
240
|
+
),
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
if (alert.monitorId && dedupeWindowMinutes > 0) {
|
|
244
|
+
const windowStart: Date =
|
|
245
|
+
OneUptimeDate.getSomeMinutesAgo(dedupeWindowMinutes);
|
|
246
|
+
|
|
247
|
+
const recentRunCount: number = (
|
|
248
|
+
await AIRunService.countBy({
|
|
249
|
+
query: {
|
|
250
|
+
projectId,
|
|
251
|
+
monitorId: alert.monitorId,
|
|
252
|
+
runType: AIRunType.Investigation,
|
|
253
|
+
createdAt: QueryHelper.greaterThan(windowStart),
|
|
254
|
+
},
|
|
255
|
+
props: { isRoot: true },
|
|
256
|
+
})
|
|
257
|
+
).toNumber();
|
|
258
|
+
|
|
259
|
+
if (recentRunCount > 0) {
|
|
260
|
+
return {
|
|
261
|
+
investigate: false,
|
|
262
|
+
reason: `monitor ${alert.monitorId.toString()} was already investigated within the last ${dedupeWindowMinutes} minutes`,
|
|
263
|
+
monitorId: alert.monitorId,
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return {
|
|
269
|
+
investigate: true,
|
|
270
|
+
reason: "passed severity and dedupe gates",
|
|
271
|
+
monitorId: alert.monitorId,
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/*
|
|
276
|
+
* The severity `order` value that still qualifies for investigation (lower
|
|
277
|
+
* order = higher severity; an alert qualifies when its order <= floor).
|
|
278
|
+
* An explicitly configured minimum severity wins; when unset — or when the
|
|
279
|
+
* configured severity has been deleted — the default is the project's top
|
|
280
|
+
* two tiers. Returns null when no floor applies (no severities configured).
|
|
281
|
+
*/
|
|
282
|
+
private static async getSeverityFloorOrder(
|
|
283
|
+
projectId: ObjectID,
|
|
284
|
+
minimumSeverityId: ObjectID | undefined,
|
|
285
|
+
): Promise<number | null> {
|
|
286
|
+
if (minimumSeverityId) {
|
|
287
|
+
const floorSeverity: AlertSeverity | null =
|
|
288
|
+
await AlertSeverityService.findOneById({
|
|
289
|
+
id: minimumSeverityId,
|
|
290
|
+
select: { order: true },
|
|
291
|
+
props: { isRoot: true },
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
if (floorSeverity && floorSeverity.order !== undefined) {
|
|
295
|
+
return floorSeverity.order;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// Default: the top two severity tiers (the two lowest order values).
|
|
300
|
+
const topTiers: Array<AlertSeverity> = await AlertSeverityService.findBy({
|
|
301
|
+
query: { projectId },
|
|
302
|
+
select: { order: true },
|
|
303
|
+
sort: { order: SortOrder.Ascending },
|
|
304
|
+
limit: 2,
|
|
305
|
+
skip: 0,
|
|
306
|
+
props: { isRoot: true },
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
if (topTiers.length === 0) {
|
|
310
|
+
return null;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
const lastTier: AlertSeverity = topTiers[topTiers.length - 1]!;
|
|
314
|
+
return lastTier.order ?? null;
|
|
83
315
|
}
|
|
84
316
|
|
|
85
317
|
// Build a compact alert record to seed the investigation.
|
|
@@ -2,11 +2,14 @@ import ObjectID from "../../../../Types/ObjectID";
|
|
|
2
2
|
import OneUptimeDate from "../../../../Types/Date";
|
|
3
3
|
import { Blue500 } from "../../../../Types/BrandColors";
|
|
4
4
|
import { IncidentFeedEventType } from "../../../../Models/DatabaseModels/IncidentFeed";
|
|
5
|
+
import IncidentInternalNote from "../../../../Models/DatabaseModels/IncidentInternalNote";
|
|
5
6
|
import IncidentFeedService from "../../../Services/IncidentFeedService";
|
|
7
|
+
import IncidentInternalNoteService from "../../../Services/IncidentInternalNoteService";
|
|
6
8
|
import IncidentAIContextBuilder, {
|
|
7
9
|
IncidentContextData,
|
|
8
10
|
} from "../IncidentAIContextBuilder";
|
|
9
11
|
import SentinelInvestigationEngine from "./SentinelInvestigationEngine";
|
|
12
|
+
import SentinelInvestigationQueue from "./InvestigationQueue";
|
|
10
13
|
import SentinelMemory from "./SentinelMemory";
|
|
11
14
|
import { ObservabilityAssistantResult } from "../Chat/ObservabilityAssistant";
|
|
12
15
|
import logger from "../../Logger";
|
|
@@ -17,18 +20,17 @@ import CaptureSpan from "../../Telemetry/CaptureSpan";
|
|
|
17
20
|
*
|
|
18
21
|
* When a new incident is declared, wakes Sentinel to investigate it (read-only)
|
|
19
22
|
* and post a cited root-cause analysis into the incident timeline + Slack/Teams
|
|
20
|
-
* — before the on-call engineer has finished reading the page. The
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* Built on the fire-and-forget async pattern already used throughout
|
|
26
|
-
* IncidentService.onCreateSuccess. See Internal/Roadmap/AISentinelReliabilityBrain.md.
|
|
23
|
+
* — before the on-call engineer has finished reading the page. The trigger only
|
|
24
|
+
* records durable intent (a Queued AIRun via SentinelInvestigationQueue), so a
|
|
25
|
+
* pod restart can no longer orphan an investigation; the heavy lifting (run
|
|
26
|
+
* lifecycle, the agent loop, confidence gating) lives in the shared
|
|
27
|
+
* SentinelInvestigationEngine. See Internal/Roadmap/AISentinelExecution.md.
|
|
27
28
|
*/
|
|
28
29
|
export default class SentinelIncidentInvestigationRunner {
|
|
29
30
|
/*
|
|
30
31
|
* Entry point called (fire-and-forget) from IncidentService.onCreateSuccess.
|
|
31
|
-
*
|
|
32
|
+
* Cheap: gates + a Queued AIRun row; execution happens via the queue.
|
|
33
|
+
* Never throws — all failures are logged.
|
|
32
34
|
*/
|
|
33
35
|
@CaptureSpan()
|
|
34
36
|
public static async investigateNewIncident(data: {
|
|
@@ -47,6 +49,34 @@ export default class SentinelIncidentInvestigationRunner {
|
|
|
47
49
|
return;
|
|
48
50
|
}
|
|
49
51
|
|
|
52
|
+
await SentinelInvestigationQueue.enqueue({
|
|
53
|
+
projectId,
|
|
54
|
+
subjectIncidentId: incidentId,
|
|
55
|
+
});
|
|
56
|
+
} catch (error) {
|
|
57
|
+
logger.error(
|
|
58
|
+
`Sentinel: unexpected error enqueueing investigation for incident ${incidentId.toString()}: ${error}`,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/*
|
|
64
|
+
* Execute a claimed run: assemble incident context and hand it to the
|
|
65
|
+
* engine. Called by SentinelInvestigationQueue after a successful claim.
|
|
66
|
+
* Never throws — failures are handed to the queue's retry policy so a
|
|
67
|
+
* claimed run is always finalized or requeued.
|
|
68
|
+
*/
|
|
69
|
+
@CaptureSpan()
|
|
70
|
+
public static async executeInvestigation(data: {
|
|
71
|
+
aiRunId: ObjectID;
|
|
72
|
+
projectId: ObjectID;
|
|
73
|
+
incidentId: ObjectID;
|
|
74
|
+
attemptCount: number;
|
|
75
|
+
}): Promise<void> {
|
|
76
|
+
const { aiRunId, projectId, incidentId, attemptCount } = data;
|
|
77
|
+
|
|
78
|
+
let contextSummary: string;
|
|
79
|
+
try {
|
|
50
80
|
const contextData: IncidentContextData =
|
|
51
81
|
await IncidentAIContextBuilder.buildIncidentContext({
|
|
52
82
|
incidentId,
|
|
@@ -74,12 +104,31 @@ export default class SentinelIncidentInvestigationRunner {
|
|
|
74
104
|
.filter(Boolean),
|
|
75
105
|
});
|
|
76
106
|
|
|
77
|
-
|
|
78
|
-
|
|
107
|
+
contextSummary =
|
|
108
|
+
this.buildIncidentSummary(contextData) + priorCasesContext;
|
|
109
|
+
} catch (error) {
|
|
110
|
+
/*
|
|
111
|
+
* Context assembly failed — the run is claimed, so hand it to the
|
|
112
|
+
* retry policy rather than leaving it Running until the sweeper.
|
|
113
|
+
*/
|
|
114
|
+
await SentinelInvestigationQueue.failOrRequeue({
|
|
115
|
+
aiRunId,
|
|
116
|
+
attemptCount,
|
|
117
|
+
errorMessage: `Failed to build incident context: ${
|
|
118
|
+
error instanceof Error ? error.message : String(error)
|
|
119
|
+
}`,
|
|
120
|
+
isPermanent: false,
|
|
121
|
+
});
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
await SentinelInvestigationEngine.executeRun({
|
|
126
|
+
aiRunId,
|
|
127
|
+
projectId,
|
|
128
|
+
attemptCount,
|
|
129
|
+
request: {
|
|
79
130
|
feature: "Sentinel Incident Investigation",
|
|
80
|
-
|
|
81
|
-
contextSummary:
|
|
82
|
-
this.buildIncidentSummary(contextData) + priorCasesContext,
|
|
131
|
+
contextSummary,
|
|
83
132
|
postAnalysis: async (postData: {
|
|
84
133
|
analysisMarkdown: string;
|
|
85
134
|
isConfident: boolean;
|
|
@@ -99,13 +148,37 @@ export default class SentinelIncidentInvestigationRunner {
|
|
|
99
148
|
sendWorkspaceNotification: postData.isConfident,
|
|
100
149
|
},
|
|
101
150
|
});
|
|
151
|
+
|
|
152
|
+
/*
|
|
153
|
+
* Also file the RCA as an incident internal note, where responders
|
|
154
|
+
* collaborate. The RootCause feed item above, with its quiet-mode
|
|
155
|
+
* gating, must stay the single notification source, so:
|
|
156
|
+
* ignoreHooks skips the note service's "posted private note" feed
|
|
157
|
+
* item + unconditional workspace ping (workflow triggers and
|
|
158
|
+
* realtime updates still fire), and isOwnerNotified stops the
|
|
159
|
+
* note-posted owner-notification cron from paging owners about it.
|
|
160
|
+
* Best-effort: a note failure must not fail the run after the feed
|
|
161
|
+
* item already posted.
|
|
162
|
+
*/
|
|
163
|
+
try {
|
|
164
|
+
const note: IncidentInternalNote = new IncidentInternalNote();
|
|
165
|
+
note.incidentId = incidentId;
|
|
166
|
+
note.projectId = projectId;
|
|
167
|
+
note.note = postData.analysisMarkdown;
|
|
168
|
+
note.isOwnerNotified = true;
|
|
169
|
+
|
|
170
|
+
await IncidentInternalNoteService.create({
|
|
171
|
+
data: note,
|
|
172
|
+
props: { isRoot: true, ignoreHooks: true },
|
|
173
|
+
});
|
|
174
|
+
} catch (error) {
|
|
175
|
+
logger.error(
|
|
176
|
+
`Sentinel: failed to post RCA internal note for incident ${incidentId.toString()}: ${error}`,
|
|
177
|
+
);
|
|
178
|
+
}
|
|
102
179
|
},
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
logger.error(
|
|
106
|
-
`Sentinel: unexpected error investigating incident ${incidentId.toString()}: ${error}`,
|
|
107
|
-
);
|
|
108
|
-
}
|
|
180
|
+
},
|
|
181
|
+
});
|
|
109
182
|
}
|
|
110
183
|
|
|
111
184
|
// Build a compact incident record to seed the investigation.
|