@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
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import DashboardLogChartComponent from "../../../Types/Dashboard/DashboardComponents/DashboardLogChartComponent";
|
|
2
|
+
import { ObjectType } from "../../../Types/JSON";
|
|
3
|
+
import ObjectID from "../../../Types/ObjectID";
|
|
4
|
+
import LogSeverity from "../../../Types/Log/LogSeverity";
|
|
5
|
+
import DashboardBaseComponentUtil from "./DashboardBaseComponent";
|
|
6
|
+
import {
|
|
7
|
+
ComponentArgument,
|
|
8
|
+
ComponentArgumentSection,
|
|
9
|
+
ComponentInputType,
|
|
10
|
+
} from "../../../Types/Dashboard/DashboardComponents/ComponentArgument";
|
|
11
|
+
import DashboardComponentType from "../../../Types/Dashboard/DashboardComponentType";
|
|
12
|
+
import DashboardChartType from "../../../Types/Dashboard/Chart/ChartType";
|
|
13
|
+
|
|
14
|
+
const DisplaySection: ComponentArgumentSection = {
|
|
15
|
+
name: "Display Options",
|
|
16
|
+
description: "Configure the chart heading and visualization",
|
|
17
|
+
order: 1,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const FiltersSection: ComponentArgumentSection = {
|
|
21
|
+
name: "Log Query",
|
|
22
|
+
description: "Choose which logs contribute to the chart",
|
|
23
|
+
order: 2,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default class DashboardLogChartComponentUtil extends DashboardBaseComponentUtil {
|
|
27
|
+
public static override getDefaultComponent(): DashboardLogChartComponent {
|
|
28
|
+
return {
|
|
29
|
+
_type: ObjectType.DashboardComponent,
|
|
30
|
+
componentType: DashboardComponentType.LogChart,
|
|
31
|
+
widthInDashboardUnits: 8,
|
|
32
|
+
heightInDashboardUnits: 5,
|
|
33
|
+
topInDashboardUnits: 0,
|
|
34
|
+
leftInDashboardUnits: 0,
|
|
35
|
+
componentId: ObjectID.generate(),
|
|
36
|
+
minHeightInDashboardUnits: 3,
|
|
37
|
+
minWidthInDashboardUnits: 6,
|
|
38
|
+
arguments: {
|
|
39
|
+
chartType: DashboardChartType.Bar,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public static override getComponentConfigArguments(): Array<
|
|
45
|
+
ComponentArgument<DashboardLogChartComponent>
|
|
46
|
+
> {
|
|
47
|
+
return [
|
|
48
|
+
{
|
|
49
|
+
name: "Title",
|
|
50
|
+
description: "Header shown above the log-volume chart",
|
|
51
|
+
required: false,
|
|
52
|
+
type: ComponentInputType.Text,
|
|
53
|
+
id: "title",
|
|
54
|
+
placeholder: "Log Volume",
|
|
55
|
+
section: DisplaySection,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "Chart Type",
|
|
59
|
+
description: "How log volume is visualized over time",
|
|
60
|
+
required: true,
|
|
61
|
+
type: ComponentInputType.Dropdown,
|
|
62
|
+
id: "chartType",
|
|
63
|
+
section: DisplaySection,
|
|
64
|
+
dropdownOptions: [
|
|
65
|
+
{ label: "Bar Chart", value: DashboardChartType.Bar },
|
|
66
|
+
{ label: "Line Chart", value: DashboardChartType.Line },
|
|
67
|
+
{ label: "Area Chart", value: DashboardChartType.Area },
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "Severities",
|
|
72
|
+
description: "Only count logs at the selected severity levels",
|
|
73
|
+
required: false,
|
|
74
|
+
type: ComponentInputType.MultiSelectDropdown,
|
|
75
|
+
id: "severityFilters",
|
|
76
|
+
placeholder: "All severities",
|
|
77
|
+
section: FiltersSection,
|
|
78
|
+
dropdownOptions: [
|
|
79
|
+
{ label: "Fatal", value: LogSeverity.Fatal },
|
|
80
|
+
{ label: "Error", value: LogSeverity.Error },
|
|
81
|
+
{ label: "Warning", value: LogSeverity.Warning },
|
|
82
|
+
{ label: "Information", value: LogSeverity.Information },
|
|
83
|
+
{ label: "Debug", value: LogSeverity.Debug },
|
|
84
|
+
{ label: "Trace", value: LogSeverity.Trace },
|
|
85
|
+
{ label: "Unspecified", value: LogSeverity.Unspecified },
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "Body Contains",
|
|
90
|
+
description: "Only count logs whose body contains this text",
|
|
91
|
+
required: false,
|
|
92
|
+
type: ComponentInputType.Text,
|
|
93
|
+
id: "bodyContains",
|
|
94
|
+
placeholder: "Search text...",
|
|
95
|
+
section: FiltersSection,
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -23,6 +23,7 @@ import DashboardKubernetesNodeListComponentUtil from "./DashboardKubernetesNodeL
|
|
|
23
23
|
import DashboardKubernetesPodListComponentUtil from "./DashboardKubernetesPodListComponent";
|
|
24
24
|
import DashboardKubernetesStatefulSetListComponentUtil from "./DashboardKubernetesStatefulSetListComponent";
|
|
25
25
|
import DashboardLogStreamComponentUtil from "./DashboardLogStreamComponent";
|
|
26
|
+
import DashboardLogChartComponentUtil from "./DashboardLogChartComponent";
|
|
26
27
|
import DashboardMonitorListComponentUtil from "./DashboardMonitorListComponent";
|
|
27
28
|
import DashboardPodmanContainerListComponentUtil from "./DashboardPodmanContainerListComponent";
|
|
28
29
|
import DashboardPodmanHostListComponentUtil from "./DashboardPodmanHostListComponent";
|
|
@@ -80,6 +81,12 @@ export default class DashboardComponentsUtil {
|
|
|
80
81
|
>;
|
|
81
82
|
}
|
|
82
83
|
|
|
84
|
+
if (dashboardComponentType === DashboardComponentType.LogChart) {
|
|
85
|
+
return DashboardLogChartComponentUtil.getComponentConfigArguments() as Array<
|
|
86
|
+
ComponentArgument<DashboardBaseComponent>
|
|
87
|
+
>;
|
|
88
|
+
}
|
|
89
|
+
|
|
83
90
|
if (dashboardComponentType === DashboardComponentType.TraceList) {
|
|
84
91
|
return DashboardTraceListComponentUtil.getComponentConfigArguments() as Array<
|
|
85
92
|
ComponentArgument<DashboardBaseComponent>
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import LatencyMatrix, {
|
|
2
|
+
LatencyMatrixAxisItem,
|
|
3
|
+
LatencyMatrixCell,
|
|
4
|
+
} from "../../Types/Monitor/LatencyMatrix";
|
|
5
|
+
import { JSONObject } from "../../Types/JSON";
|
|
6
|
+
|
|
7
|
+
export interface LatencyMatrixMonitorInput {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface LatencyMatrixProbeInput {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface LatencyMatrixProbeResult {
|
|
18
|
+
monitorId: string;
|
|
19
|
+
probeId: string;
|
|
20
|
+
/*
|
|
21
|
+
* MonitorProbe.lastMonitoringLog: a map of monitorStepId -> the last
|
|
22
|
+
* ProbeMonitorResponse for that step. The matrix uses the most recently
|
|
23
|
+
* monitored step's response time and online state.
|
|
24
|
+
*/
|
|
25
|
+
lastMonitoringLog?: JSONObject | undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default class LatencyMatrixUtil {
|
|
29
|
+
/*
|
|
30
|
+
* Shapes probe/monitor axes plus each monitor-probe pair's last-check
|
|
31
|
+
* snapshot into a dense grid. Pure over its inputs so it's unit-testable
|
|
32
|
+
* without a database.
|
|
33
|
+
*/
|
|
34
|
+
public static buildMatrix(data: {
|
|
35
|
+
monitors: Array<LatencyMatrixMonitorInput>;
|
|
36
|
+
probes: Array<LatencyMatrixProbeInput>;
|
|
37
|
+
results: Array<LatencyMatrixProbeResult>;
|
|
38
|
+
now: Date;
|
|
39
|
+
}): LatencyMatrix {
|
|
40
|
+
const monitors: Array<LatencyMatrixAxisItem> = data.monitors.map(
|
|
41
|
+
(monitor: LatencyMatrixMonitorInput) => {
|
|
42
|
+
return { id: monitor.id, name: monitor.name };
|
|
43
|
+
},
|
|
44
|
+
);
|
|
45
|
+
const probes: Array<LatencyMatrixAxisItem> = data.probes.map(
|
|
46
|
+
(probe: LatencyMatrixProbeInput) => {
|
|
47
|
+
return { id: probe.id, name: probe.name };
|
|
48
|
+
},
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const cells: Record<string, Record<string, LatencyMatrixCell>> = {};
|
|
52
|
+
|
|
53
|
+
// Seed every cell as "no data" so the grid is dense.
|
|
54
|
+
for (const monitor of monitors) {
|
|
55
|
+
cells[monitor.id] = {};
|
|
56
|
+
for (const probe of probes) {
|
|
57
|
+
cells[monitor.id]![probe.id] = {
|
|
58
|
+
monitorId: monitor.id,
|
|
59
|
+
probeId: probe.id,
|
|
60
|
+
hasData: false,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
for (const result of data.results) {
|
|
66
|
+
const row: Record<string, LatencyMatrixCell> | undefined =
|
|
67
|
+
cells[result.monitorId];
|
|
68
|
+
if (!row || !row[result.probeId]) {
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const latest: {
|
|
73
|
+
latencyInMs?: number | undefined;
|
|
74
|
+
isOnline?: boolean | undefined;
|
|
75
|
+
monitoredAt?: Date | undefined;
|
|
76
|
+
} | null = LatencyMatrixUtil.extractLatest(result.lastMonitoringLog);
|
|
77
|
+
|
|
78
|
+
if (!latest) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const cell: LatencyMatrixCell = {
|
|
83
|
+
monitorId: result.monitorId,
|
|
84
|
+
probeId: result.probeId,
|
|
85
|
+
hasData: true,
|
|
86
|
+
latencyInMs: latest.latencyInMs,
|
|
87
|
+
isOnline: latest.isOnline,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
if (latest.monitoredAt) {
|
|
91
|
+
cell.ageInSeconds = Math.max(
|
|
92
|
+
0,
|
|
93
|
+
Math.round(
|
|
94
|
+
(data.now.getTime() - new Date(latest.monitoredAt).getTime()) /
|
|
95
|
+
1000,
|
|
96
|
+
),
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
row[result.probeId] = cell;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return { monitors, probes, cells };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/*
|
|
107
|
+
* Picks the most-recently-monitored step from a lastMonitoringLog and
|
|
108
|
+
* returns its latency / online / timestamp. Returns null when the log is
|
|
109
|
+
* empty or malformed.
|
|
110
|
+
*/
|
|
111
|
+
private static extractLatest(log: JSONObject | undefined): {
|
|
112
|
+
latencyInMs?: number | undefined;
|
|
113
|
+
isOnline?: boolean | undefined;
|
|
114
|
+
monitoredAt?: Date | undefined;
|
|
115
|
+
} | null {
|
|
116
|
+
if (!log || typeof log !== "object") {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
let best: {
|
|
121
|
+
latencyInMs?: number | undefined;
|
|
122
|
+
isOnline?: boolean | undefined;
|
|
123
|
+
monitoredAt?: Date | undefined;
|
|
124
|
+
} | null = null;
|
|
125
|
+
let bestTime: number = -Infinity;
|
|
126
|
+
|
|
127
|
+
for (const stepId of Object.keys(log)) {
|
|
128
|
+
const response: JSONObject | undefined = log[stepId] as
|
|
129
|
+
| JSONObject
|
|
130
|
+
| undefined;
|
|
131
|
+
if (!response || typeof response !== "object") {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const monitoredAtValue: unknown = response["monitoredAt"];
|
|
136
|
+
const monitoredAt: Date | undefined = monitoredAtValue
|
|
137
|
+
? new Date(monitoredAtValue as string)
|
|
138
|
+
: undefined;
|
|
139
|
+
const time: number =
|
|
140
|
+
monitoredAt && !isNaN(monitoredAt.getTime())
|
|
141
|
+
? monitoredAt.getTime()
|
|
142
|
+
: 0;
|
|
143
|
+
|
|
144
|
+
if (time >= bestTime) {
|
|
145
|
+
bestTime = time;
|
|
146
|
+
const latencyValue: unknown = response["responseTimeInMs"];
|
|
147
|
+
const onlineValue: unknown = response["isOnline"];
|
|
148
|
+
best = {
|
|
149
|
+
latencyInMs:
|
|
150
|
+
typeof latencyValue === "number" ? latencyValue : undefined,
|
|
151
|
+
isOnline: typeof onlineValue === "boolean" ? onlineValue : undefined,
|
|
152
|
+
monitoredAt:
|
|
153
|
+
monitoredAt && !isNaN(monitoredAt.getTime())
|
|
154
|
+
? monitoredAt
|
|
155
|
+
: undefined,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return best;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -33,6 +33,24 @@ class MonitorMetricTypeUtil {
|
|
|
33
33
|
return AggregationType.Avg;
|
|
34
34
|
case MonitorMetricType.ExecutionTime:
|
|
35
35
|
return AggregationType.Avg;
|
|
36
|
+
case MonitorMetricType.PacketLossPercent:
|
|
37
|
+
return AggregationType.Avg;
|
|
38
|
+
case MonitorMetricType.Jitter:
|
|
39
|
+
return AggregationType.Avg;
|
|
40
|
+
case MonitorMetricType.DnsLookupTime:
|
|
41
|
+
case MonitorMetricType.TcpConnectTime:
|
|
42
|
+
case MonitorMetricType.TlsHandshakeTime:
|
|
43
|
+
case MonitorMetricType.TimeToFirstByte:
|
|
44
|
+
case MonitorMetricType.DownloadTime:
|
|
45
|
+
return AggregationType.Avg;
|
|
46
|
+
case MonitorMetricType.SnmpInterfaceOperStatus:
|
|
47
|
+
return AggregationType.Min;
|
|
48
|
+
case MonitorMetricType.SnmpInterfaceInBitsPerSecond:
|
|
49
|
+
case MonitorMetricType.SnmpInterfaceOutBitsPerSecond:
|
|
50
|
+
case MonitorMetricType.SnmpInterfaceErrorsPerSecond:
|
|
51
|
+
return AggregationType.Avg;
|
|
52
|
+
case MonitorMetricType.SnmpInterfaceUtilizationPercent:
|
|
53
|
+
return AggregationType.Max;
|
|
36
54
|
|
|
37
55
|
/*
|
|
38
56
|
* Extended server/VM metrics. Cumulative counters (bytes/packets/ops since
|
|
@@ -79,6 +97,10 @@ class MonitorMetricTypeUtil {
|
|
|
79
97
|
switch (checkOn) {
|
|
80
98
|
case CheckOn.ResponseTime:
|
|
81
99
|
return MonitorMetricType.ResponseTime;
|
|
100
|
+
case CheckOn.PacketLossPercent:
|
|
101
|
+
return MonitorMetricType.PacketLossPercent;
|
|
102
|
+
case CheckOn.Jitter:
|
|
103
|
+
return MonitorMetricType.Jitter;
|
|
82
104
|
case CheckOn.ResponseStatusCode:
|
|
83
105
|
return MonitorMetricType.ResponseStatusCode;
|
|
84
106
|
case CheckOn.IsOnline:
|
|
@@ -117,6 +139,11 @@ class MonitorMetricTypeUtil {
|
|
|
117
139
|
MonitorMetricType.IsOnline,
|
|
118
140
|
MonitorMetricType.ResponseTime,
|
|
119
141
|
MonitorMetricType.ResponseStatusCode,
|
|
142
|
+
MonitorMetricType.DnsLookupTime,
|
|
143
|
+
MonitorMetricType.TcpConnectTime,
|
|
144
|
+
MonitorMetricType.TlsHandshakeTime,
|
|
145
|
+
MonitorMetricType.TimeToFirstByte,
|
|
146
|
+
MonitorMetricType.DownloadTime,
|
|
120
147
|
];
|
|
121
148
|
}
|
|
122
149
|
|
|
@@ -165,11 +192,33 @@ class MonitorMetricTypeUtil {
|
|
|
165
192
|
return [MonitorMetricType.ExecutionTime];
|
|
166
193
|
}
|
|
167
194
|
|
|
195
|
+
if (monitorType === MonitorType.Ping || monitorType === MonitorType.IP) {
|
|
196
|
+
/*
|
|
197
|
+
* Ping/IP checks send multiple echo requests, so they get packet-level
|
|
198
|
+
* network metrics on top of availability and response time.
|
|
199
|
+
*/
|
|
200
|
+
return [
|
|
201
|
+
MonitorMetricType.IsOnline,
|
|
202
|
+
MonitorMetricType.ResponseTime,
|
|
203
|
+
MonitorMetricType.PacketLossPercent,
|
|
204
|
+
MonitorMetricType.Jitter,
|
|
205
|
+
];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (monitorType === MonitorType.NetworkDevice) {
|
|
209
|
+
return [
|
|
210
|
+
MonitorMetricType.IsOnline,
|
|
211
|
+
MonitorMetricType.ResponseTime,
|
|
212
|
+
MonitorMetricType.SnmpInterfaceOperStatus,
|
|
213
|
+
MonitorMetricType.SnmpInterfaceInBitsPerSecond,
|
|
214
|
+
MonitorMetricType.SnmpInterfaceOutBitsPerSecond,
|
|
215
|
+
MonitorMetricType.SnmpInterfaceUtilizationPercent,
|
|
216
|
+
MonitorMetricType.SnmpInterfaceErrorsPerSecond,
|
|
217
|
+
];
|
|
218
|
+
}
|
|
219
|
+
|
|
168
220
|
if (
|
|
169
|
-
monitorType === MonitorType.Ping ||
|
|
170
|
-
monitorType === MonitorType.IP ||
|
|
171
221
|
monitorType === MonitorType.Port ||
|
|
172
|
-
monitorType === MonitorType.SNMP ||
|
|
173
222
|
monitorType === MonitorType.DNS ||
|
|
174
223
|
monitorType === MonitorType.DNSSEC ||
|
|
175
224
|
monitorType === MonitorType.Domain ||
|
|
@@ -255,6 +304,28 @@ class MonitorMetricTypeUtil {
|
|
|
255
304
|
];
|
|
256
305
|
}
|
|
257
306
|
|
|
307
|
+
if (monitorType === MonitorType.NetworkDevice) {
|
|
308
|
+
return [
|
|
309
|
+
{
|
|
310
|
+
title: "Availability",
|
|
311
|
+
description: "Device reachability and SNMP response time.",
|
|
312
|
+
metrics: [MonitorMetricType.IsOnline, MonitorMetricType.ResponseTime],
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
title: "Interfaces",
|
|
316
|
+
description:
|
|
317
|
+
"Per-interface status, bandwidth, utilization, and errors. One series per interface.",
|
|
318
|
+
metrics: [
|
|
319
|
+
MonitorMetricType.SnmpInterfaceOperStatus,
|
|
320
|
+
MonitorMetricType.SnmpInterfaceInBitsPerSecond,
|
|
321
|
+
MonitorMetricType.SnmpInterfaceOutBitsPerSecond,
|
|
322
|
+
MonitorMetricType.SnmpInterfaceUtilizationPercent,
|
|
323
|
+
MonitorMetricType.SnmpInterfaceErrorsPerSecond,
|
|
324
|
+
],
|
|
325
|
+
},
|
|
326
|
+
];
|
|
327
|
+
}
|
|
328
|
+
|
|
258
329
|
// Other monitor types keep the single-card layout.
|
|
259
330
|
const metrics: Array<MonitorMetricType> =
|
|
260
331
|
this.getMonitorMetricTypesByMonitorType(monitorType);
|
|
@@ -288,6 +359,30 @@ class MonitorMetricTypeUtil {
|
|
|
288
359
|
return "Memory Usage Percent";
|
|
289
360
|
case MonitorMetricType.ExecutionTime:
|
|
290
361
|
return "Execution Time";
|
|
362
|
+
case MonitorMetricType.PacketLossPercent:
|
|
363
|
+
return "Packet Loss";
|
|
364
|
+
case MonitorMetricType.Jitter:
|
|
365
|
+
return "Jitter";
|
|
366
|
+
case MonitorMetricType.DnsLookupTime:
|
|
367
|
+
return "DNS Lookup Time";
|
|
368
|
+
case MonitorMetricType.TcpConnectTime:
|
|
369
|
+
return "TCP Connect Time";
|
|
370
|
+
case MonitorMetricType.TlsHandshakeTime:
|
|
371
|
+
return "TLS Handshake Time";
|
|
372
|
+
case MonitorMetricType.TimeToFirstByte:
|
|
373
|
+
return "Time to First Byte";
|
|
374
|
+
case MonitorMetricType.DownloadTime:
|
|
375
|
+
return "Download Time";
|
|
376
|
+
case MonitorMetricType.SnmpInterfaceOperStatus:
|
|
377
|
+
return "Interface Status";
|
|
378
|
+
case MonitorMetricType.SnmpInterfaceInBitsPerSecond:
|
|
379
|
+
return "Interface Inbound Bandwidth";
|
|
380
|
+
case MonitorMetricType.SnmpInterfaceOutBitsPerSecond:
|
|
381
|
+
return "Interface Outbound Bandwidth";
|
|
382
|
+
case MonitorMetricType.SnmpInterfaceUtilizationPercent:
|
|
383
|
+
return "Interface Utilization";
|
|
384
|
+
case MonitorMetricType.SnmpInterfaceErrorsPerSecond:
|
|
385
|
+
return "Interface Errors";
|
|
291
386
|
case MonitorMetricType.LoadAverage1Min:
|
|
292
387
|
return "Load Average (1 minute)";
|
|
293
388
|
case MonitorMetricType.LoadAverage5Min:
|
|
@@ -370,6 +465,25 @@ class MonitorMetricTypeUtil {
|
|
|
370
465
|
return "%";
|
|
371
466
|
case MonitorMetricType.ExecutionTime:
|
|
372
467
|
return "ms";
|
|
468
|
+
case MonitorMetricType.PacketLossPercent:
|
|
469
|
+
return "%";
|
|
470
|
+
case MonitorMetricType.Jitter:
|
|
471
|
+
return "ms";
|
|
472
|
+
case MonitorMetricType.DnsLookupTime:
|
|
473
|
+
case MonitorMetricType.TcpConnectTime:
|
|
474
|
+
case MonitorMetricType.TlsHandshakeTime:
|
|
475
|
+
case MonitorMetricType.TimeToFirstByte:
|
|
476
|
+
case MonitorMetricType.DownloadTime:
|
|
477
|
+
return "ms";
|
|
478
|
+
case MonitorMetricType.SnmpInterfaceOperStatus:
|
|
479
|
+
return "";
|
|
480
|
+
case MonitorMetricType.SnmpInterfaceInBitsPerSecond:
|
|
481
|
+
case MonitorMetricType.SnmpInterfaceOutBitsPerSecond:
|
|
482
|
+
return "bps";
|
|
483
|
+
case MonitorMetricType.SnmpInterfaceUtilizationPercent:
|
|
484
|
+
return "%";
|
|
485
|
+
case MonitorMetricType.SnmpInterfaceErrorsPerSecond:
|
|
486
|
+
return "errors/s";
|
|
373
487
|
case MonitorMetricType.LoadAverage1Min:
|
|
374
488
|
case MonitorMetricType.LoadAverage5Min:
|
|
375
489
|
case MonitorMetricType.LoadAverage15Min:
|
|
@@ -426,6 +540,30 @@ class MonitorMetricTypeUtil {
|
|
|
426
540
|
return "Memory usage percent is the percentage of memory that is currently being used on a server. It is a measure of how much of the server's memory is being used.";
|
|
427
541
|
case MonitorMetricType.ExecutionTime:
|
|
428
542
|
return "Execution time is the time taken for a custom JavaScript code or a synthetic monitor to execute.";
|
|
543
|
+
case MonitorMetricType.PacketLossPercent:
|
|
544
|
+
return "Percentage of ICMP echo requests that received no reply during this check. Sustained loss above 1-2% typically indicates congestion, faulty hardware, or routing problems on the path.";
|
|
545
|
+
case MonitorMetricType.Jitter:
|
|
546
|
+
return "Variation in round-trip time across the packets sent in each check (standard deviation). High jitter degrades real-time traffic like VoIP and video even when average latency looks healthy.";
|
|
547
|
+
case MonitorMetricType.DnsLookupTime:
|
|
548
|
+
return "Time spent resolving the hostname to an IP address. Spikes here point at the DNS provider, not the monitored service.";
|
|
549
|
+
case MonitorMetricType.TcpConnectTime:
|
|
550
|
+
return "Time spent establishing the TCP connection after DNS resolution — a proxy for raw network latency to the target.";
|
|
551
|
+
case MonitorMetricType.TlsHandshakeTime:
|
|
552
|
+
return "Time spent negotiating TLS after the TCP connection was established. Regressions here often follow certificate or cipher configuration changes.";
|
|
553
|
+
case MonitorMetricType.TimeToFirstByte:
|
|
554
|
+
return "Time from the end of connection setup until the first byte of the response arrived — the server-side processing time.";
|
|
555
|
+
case MonitorMetricType.DownloadTime:
|
|
556
|
+
return "Time spent receiving the response body after the first byte arrived.";
|
|
557
|
+
case MonitorMetricType.SnmpInterfaceOperStatus:
|
|
558
|
+
return "Operational status of each interface: 1 when up, 0 when down. Interfaces that are administratively disabled also report 0.";
|
|
559
|
+
case MonitorMetricType.SnmpInterfaceInBitsPerSecond:
|
|
560
|
+
return "Inbound traffic per interface, computed from the delta of IF-MIB octet counters between checks.";
|
|
561
|
+
case MonitorMetricType.SnmpInterfaceOutBitsPerSecond:
|
|
562
|
+
return "Outbound traffic per interface, computed from the delta of IF-MIB octet counters between checks.";
|
|
563
|
+
case MonitorMetricType.SnmpInterfaceUtilizationPercent:
|
|
564
|
+
return "Traffic in the busiest direction as a percentage of the interface's reported speed. Sustained values above 80% typically mean the link needs an upgrade.";
|
|
565
|
+
case MonitorMetricType.SnmpInterfaceErrorsPerSecond:
|
|
566
|
+
return "Combined inbound and outbound errors per second per interface. A non-zero rate usually points to cabling, SFP, or duplex problems.";
|
|
429
567
|
case MonitorMetricType.LoadAverage1Min:
|
|
430
568
|
return "Average number of runnable or uninterruptible processes over the last 1 minute. Values persistently above the number of CPU cores indicate CPU saturation.";
|
|
431
569
|
case MonitorMetricType.LoadAverage5Min:
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import NetworkTopology, {
|
|
2
|
+
NetworkTopologyEdge,
|
|
3
|
+
NetworkTopologyNode,
|
|
4
|
+
NetworkTopologyNodeStatus,
|
|
5
|
+
} from "../../Types/Monitor/SnmpMonitor/NetworkTopology";
|
|
6
|
+
import LldpNeighbor from "../../Types/Monitor/SnmpMonitor/LldpNeighbor";
|
|
7
|
+
|
|
8
|
+
export interface TopologyDeviceInput {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
hostname?: string | undefined;
|
|
12
|
+
sysName?: string | undefined;
|
|
13
|
+
lastSeenAt?: Date | undefined;
|
|
14
|
+
interfacesUp?: number | undefined;
|
|
15
|
+
interfacesDown?: number | undefined;
|
|
16
|
+
lldpNeighbors?: Array<LldpNeighbor> | undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// A device not seen within this window is treated as not currently up.
|
|
20
|
+
const FRESH_WINDOW_MS: number = 15 * 60 * 1000;
|
|
21
|
+
|
|
22
|
+
export default class NetworkTopologyUtil {
|
|
23
|
+
/*
|
|
24
|
+
* Builds the topology graph from every device in a project. Nodes are the
|
|
25
|
+
* devices; LLDP neighbors that match another device (by sysName or
|
|
26
|
+
* hostname) become edges, and neighbors that match nothing become
|
|
27
|
+
* lightweight "unmanaged" nodes so links don't dead-end. Edges are
|
|
28
|
+
* undirected and deduplicated, so a link reported from both ends appears
|
|
29
|
+
* once.
|
|
30
|
+
*/
|
|
31
|
+
public static buildTopology(
|
|
32
|
+
devices: Array<TopologyDeviceInput>,
|
|
33
|
+
now: Date,
|
|
34
|
+
): NetworkTopology {
|
|
35
|
+
const nodes: Array<NetworkTopologyNode> = [];
|
|
36
|
+
const edges: Array<NetworkTopologyEdge> = [];
|
|
37
|
+
|
|
38
|
+
// Index managed devices by the identifiers LLDP neighbors reference.
|
|
39
|
+
const deviceByMatchKey: Map<string, TopologyDeviceInput> = new Map();
|
|
40
|
+
for (const device of devices) {
|
|
41
|
+
for (const key of NetworkTopologyUtil.matchKeysForDevice(device)) {
|
|
42
|
+
deviceByMatchKey.set(key, device);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
for (const device of devices) {
|
|
47
|
+
nodes.push({
|
|
48
|
+
id: device.id,
|
|
49
|
+
name: device.name,
|
|
50
|
+
isManaged: true,
|
|
51
|
+
status: NetworkTopologyUtil.deviceStatus(device, now),
|
|
52
|
+
interfacesUp: device.interfacesUp,
|
|
53
|
+
interfacesDown: device.interfacesDown,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const unmanagedNodeIds: Set<string> = new Set();
|
|
58
|
+
const seenEdgeKeys: Set<string> = new Set();
|
|
59
|
+
|
|
60
|
+
for (const device of devices) {
|
|
61
|
+
for (const neighbor of device.lldpNeighbors || []) {
|
|
62
|
+
const matchKey: string | undefined =
|
|
63
|
+
NetworkTopologyUtil.normalizeKey(neighbor.remoteSysName) ||
|
|
64
|
+
NetworkTopologyUtil.normalizeKey(neighbor.remoteChassisId);
|
|
65
|
+
|
|
66
|
+
if (!matchKey) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const matched: TopologyDeviceInput | undefined =
|
|
71
|
+
deviceByMatchKey.get(matchKey);
|
|
72
|
+
|
|
73
|
+
let toNodeId: string;
|
|
74
|
+
|
|
75
|
+
if (matched) {
|
|
76
|
+
if (matched.id === device.id) {
|
|
77
|
+
// Self-referential neighbor entry; skip.
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
toNodeId = matched.id;
|
|
81
|
+
} else {
|
|
82
|
+
toNodeId = `unmanaged:${matchKey}`;
|
|
83
|
+
if (!unmanagedNodeIds.has(toNodeId)) {
|
|
84
|
+
unmanagedNodeIds.add(toNodeId);
|
|
85
|
+
nodes.push({
|
|
86
|
+
id: toNodeId,
|
|
87
|
+
name:
|
|
88
|
+
neighbor.remoteSysName ||
|
|
89
|
+
neighbor.remoteChassisId ||
|
|
90
|
+
"Unknown device",
|
|
91
|
+
isManaged: false,
|
|
92
|
+
status: "unknown",
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Undirected dedupe: canonicalize the endpoint pair.
|
|
98
|
+
const edgeKey: string = [device.id, toNodeId].sort().join("::");
|
|
99
|
+
if (seenEdgeKeys.has(edgeKey)) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
seenEdgeKeys.add(edgeKey);
|
|
103
|
+
|
|
104
|
+
edges.push({
|
|
105
|
+
fromNodeId: device.id,
|
|
106
|
+
toNodeId: toNodeId,
|
|
107
|
+
fromPort:
|
|
108
|
+
neighbor.localInterfaceIndex !== undefined
|
|
109
|
+
? `if${neighbor.localInterfaceIndex}`
|
|
110
|
+
: undefined,
|
|
111
|
+
toPort: neighbor.remotePortId,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return { nodes, edges };
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
private static matchKeysForDevice(
|
|
120
|
+
device: TopologyDeviceInput,
|
|
121
|
+
): Array<string> {
|
|
122
|
+
const keys: Array<string> = [];
|
|
123
|
+
const sysNameKey: string | undefined = NetworkTopologyUtil.normalizeKey(
|
|
124
|
+
device.sysName,
|
|
125
|
+
);
|
|
126
|
+
const hostnameKey: string | undefined = NetworkTopologyUtil.normalizeKey(
|
|
127
|
+
device.hostname,
|
|
128
|
+
);
|
|
129
|
+
if (sysNameKey) {
|
|
130
|
+
keys.push(sysNameKey);
|
|
131
|
+
}
|
|
132
|
+
if (hostnameKey) {
|
|
133
|
+
keys.push(hostnameKey);
|
|
134
|
+
}
|
|
135
|
+
return keys;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
private static normalizeKey(value: string | undefined): string | undefined {
|
|
139
|
+
if (!value) {
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
const trimmed: string = value.trim().toLowerCase();
|
|
143
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
private static deviceStatus(
|
|
147
|
+
device: TopologyDeviceInput,
|
|
148
|
+
now: Date,
|
|
149
|
+
): NetworkTopologyNodeStatus {
|
|
150
|
+
if (!device.lastSeenAt) {
|
|
151
|
+
return "unknown";
|
|
152
|
+
}
|
|
153
|
+
const ageMs: number = now.getTime() - new Date(device.lastSeenAt).getTime();
|
|
154
|
+
if (ageMs > FRESH_WINDOW_MS) {
|
|
155
|
+
return "down";
|
|
156
|
+
}
|
|
157
|
+
return "up";
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -11,11 +11,22 @@ import EntityType from "../../Types/Telemetry/EntityType";
|
|
|
11
11
|
* synchronous: operates on already-computed entity keys, no DB round trip.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Traffic observed over a `depends-on` edge in one computation window.
|
|
16
|
+
* Co-occurrence edges carry no call semantics and never have these.
|
|
17
|
+
*/
|
|
18
|
+
export interface EntityRelationshipMetrics {
|
|
19
|
+
callCount: number;
|
|
20
|
+
errorCount: number;
|
|
21
|
+
avgDurationMs: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
14
24
|
/** A single directed relationship edge between two entities. */
|
|
15
25
|
export interface EntityRelationshipEdge {
|
|
16
26
|
fromEntityKey: string;
|
|
17
27
|
toEntityKey: string;
|
|
18
28
|
relationshipType: EntityRelationshipType;
|
|
29
|
+
metrics?: EntityRelationshipMetrics | undefined;
|
|
19
30
|
}
|
|
20
31
|
|
|
21
32
|
/*
|