@oneuptime/common 11.4.1 → 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.
Files changed (321) hide show
  1. package/Models/DatabaseModels/AIRun.ts +50 -0
  2. package/Models/DatabaseModels/AlertSeverity.ts +6 -0
  3. package/Models/DatabaseModels/IncidentSeverity.ts +6 -0
  4. package/Models/DatabaseModels/Index.ts +16 -0
  5. package/Models/DatabaseModels/IoTDeviceCredential.ts +471 -0
  6. package/Models/DatabaseModels/LlmLog.ts +56 -0
  7. package/Models/DatabaseModels/LlmProvider.ts +33 -0
  8. package/Models/DatabaseModels/NetworkDevice.ts +1385 -0
  9. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +717 -0
  10. package/Models/DatabaseModels/NetworkDeviceLabelRule.ts +514 -0
  11. package/Models/DatabaseModels/NetworkDeviceOwnerRule.ts +596 -0
  12. package/Models/DatabaseModels/NetworkDeviceOwnerTeam.ts +487 -0
  13. package/Models/DatabaseModels/NetworkDeviceOwnerUser.ts +486 -0
  14. package/Models/DatabaseModels/NetworkInterface.ts +563 -0
  15. package/Models/DatabaseModels/Project.ts +145 -0
  16. package/Models/DatabaseModels/TelemetryEntityRelationship.ts +54 -0
  17. package/Server/API/AIInvestigationAPI.ts +131 -63
  18. package/Server/API/AlertAPI.ts +5 -0
  19. package/Server/API/IncidentAPI.ts +10 -0
  20. package/Server/API/IncidentEpisodeAPI.ts +5 -0
  21. package/Server/API/LlmProviderAPI.ts +4 -0
  22. package/Server/API/ScheduledMaintenanceAPI.ts +5 -0
  23. package/Server/Infrastructure/Postgres/SchemaMigrations/1783650000000-AddAdditionalParamsToLlmProvider.ts +19 -0
  24. package/Server/Infrastructure/Postgres/SchemaMigrations/1783695782697-AddCacheTokenColumnsToLlmLog.ts +25 -0
  25. package/Server/Infrastructure/Postgres/SchemaMigrations/1783701585317-AddAlertInvestigationGating.ts +31 -0
  26. package/Server/Infrastructure/Postgres/SchemaMigrations/1783702431535-AddAiDailyAutonomousTokenLimitToProject.ts +19 -0
  27. package/Server/Infrastructure/Postgres/SchemaMigrations/1783720000000-AddNetworkDeviceTables.ts +105 -0
  28. package/Server/Infrastructure/Postgres/SchemaMigrations/1783721121260-AddAttemptCountToAIRun.ts +15 -0
  29. package/Server/Infrastructure/Postgres/SchemaMigrations/1783730000000-AddNetworkDeviceOwnersAndRules.ts +192 -0
  30. package/Server/Infrastructure/Postgres/SchemaMigrations/1783740000000-AddNetworkDeviceDiscoveryScan.ts +37 -0
  31. package/Server/Infrastructure/Postgres/SchemaMigrations/1783750000000-AddLldpNeighborsToNetworkDevice.ts +19 -0
  32. package/Server/Infrastructure/Postgres/SchemaMigrations/1783760576655-AddInvestigationTuningToProject.ts +25 -0
  33. package/Server/Infrastructure/Postgres/SchemaMigrations/1783762505482-AddTelemetryEntityRelationshipMetrics.ts +31 -0
  34. package/Server/Infrastructure/Postgres/SchemaMigrations/1783780000000-AddIoTDeviceCredentialTable.ts +79 -0
  35. package/Server/Infrastructure/Postgres/SchemaMigrations/1783790000000-AddSnmpV3AuthColumnsToNetworkDevice.ts +49 -0
  36. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +24 -0
  37. package/Server/Services/AIRunService.ts +58 -0
  38. package/Server/Services/AIService.ts +101 -0
  39. package/Server/Services/IncidentService.ts +14 -41
  40. package/Server/Services/Index.ts +14 -0
  41. package/Server/Services/IoTDeviceCredentialService.ts +351 -0
  42. package/Server/Services/IoTDeviceService.ts +64 -21
  43. package/Server/Services/LlmLogService.ts +26 -0
  44. package/Server/Services/LlmProviderService.ts +3 -0
  45. package/Server/Services/MonitorService.ts +4 -1
  46. package/Server/Services/NetworkDeviceDiscoveryScanService.ts +10 -0
  47. package/Server/Services/NetworkDeviceLabelRuleEngineService.ts +204 -0
  48. package/Server/Services/NetworkDeviceLabelRuleService.ts +14 -0
  49. package/Server/Services/NetworkDeviceOwnerRuleEngineService.ts +222 -0
  50. package/Server/Services/NetworkDeviceOwnerRuleService.ts +14 -0
  51. package/Server/Services/NetworkDeviceOwnerTeamService.ts +10 -0
  52. package/Server/Services/NetworkDeviceOwnerUserService.ts +10 -0
  53. package/Server/Services/NetworkDeviceService.ts +50 -0
  54. package/Server/Services/NetworkInterfaceService.ts +10 -0
  55. package/Server/Services/TelemetryEntityRelationshipService.ts +23 -0
  56. package/Server/Services/TelemetryEntityService.ts +72 -2
  57. package/Server/Utils/AI/Sentinel/AlertInvestigationRunner.ts +244 -12
  58. package/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.ts +92 -19
  59. package/Server/Utils/AI/Sentinel/InvestigationQueue.ts +493 -0
  60. package/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.ts +88 -68
  61. package/Server/Utils/AI/Toolbox/Index.ts +2 -1
  62. package/Server/Utils/AI/Toolbox/MetricTools.ts +391 -0
  63. package/Server/Utils/LLM/LLMService.ts +21 -0
  64. package/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.ts +170 -2
  65. package/Server/Utils/Monitor/IoTDeviceAbsenceSeries.ts +101 -0
  66. package/Server/Utils/Monitor/MonitorAlert.ts +15 -3
  67. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +1 -1
  68. package/Server/Utils/Monitor/MonitorIncident.ts +19 -3
  69. package/Server/Utils/Monitor/MonitorMetricUtil.ts +87 -0
  70. package/Server/Utils/Monitor/MonitorResource.ts +77 -21
  71. package/Server/Utils/Monitor/MonitorTemplateUtil.ts +1 -1
  72. package/Server/Utils/Monitor/NetworkDeviceHydrationUtil.ts +201 -0
  73. package/Server/Utils/Monitor/NetworkInventoryUtil.ts +215 -0
  74. package/Server/Utils/Monitor/SnmpInterfaceRateUtil.ts +169 -0
  75. package/Tests/Server/Services/AIServiceDailyBudget.test.ts +173 -0
  76. package/Tests/Server/Services/IncidentInternalNoteAnnouncement.test.ts +97 -0
  77. package/Tests/Server/Services/IoTDeviceService.test.ts +54 -0
  78. package/Tests/Server/Utils/AI/BaselineAnomalyTool.test.ts +253 -0
  79. package/Tests/Server/Utils/AI/LLMServiceToolCalling.test.ts +44 -0
  80. package/Tests/Server/Utils/AI/SentinelAlertGating.test.ts +360 -0
  81. package/Tests/Server/Utils/AI/SentinelInvestigationQueue.test.ts +295 -0
  82. package/Tests/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.test.ts +59 -0
  83. package/Tests/Server/Utils/Monitor/IoTDeviceAbsenceSeries.test.ts +113 -0
  84. package/Tests/Server/Utils/Monitor/PerSeriesRecoveryResolution.test.ts +198 -0
  85. package/Tests/Types/Monitor/MonitorType.test.ts +1 -1
  86. package/Tests/Utils/Monitor/LatencyMatrixUtil.test.ts +111 -0
  87. package/Types/AI/AIRunStatus.ts +9 -0
  88. package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +0 -1
  89. package/Types/Dashboard/DashboardComponents/DashboardLogChartComponent.ts +8 -3
  90. package/Types/LlmLogStatus.ts +1 -0
  91. package/Types/Monitor/CriteriaFilter.ts +5 -0
  92. package/Types/Monitor/IotAlertTemplates.ts +22 -3
  93. package/Types/Monitor/LatencyMatrix.ts +27 -0
  94. package/Types/Monitor/MonitorCriteriaInstance.ts +2 -2
  95. package/Types/Monitor/MonitorMetricType.ts +10 -0
  96. package/Types/Monitor/MonitorStep.ts +36 -11
  97. package/Types/Monitor/MonitorStepNetworkDeviceMonitor.ts +55 -0
  98. package/Types/Monitor/MonitorStepSnmpMonitor.ts +8 -0
  99. package/Types/Monitor/MonitorType.ts +14 -9
  100. package/Types/Monitor/SnmpMonitor/LldpNeighbor.ts +12 -0
  101. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.ts +116 -0
  102. package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +29 -0
  103. package/Types/Monitor/SnmpMonitor/SnmpInterface.ts +31 -0
  104. package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.ts +24 -0
  105. package/Types/Monitor/SnmpMonitor/SnmpTrap.ts +20 -0
  106. package/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.ts +173 -0
  107. package/Types/Permission.ts +314 -0
  108. package/Types/Probe/ProbeMonitorResponse.ts +8 -0
  109. package/UI/Components/Icon/Icon.tsx +8 -6
  110. package/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.ts +2 -2
  111. package/UI/Components/Tabs/Tabs.tsx +10 -1
  112. package/UI/Utils/Navigation.ts +10 -1
  113. package/Utils/Dashboard/Components/DashboardLogChartComponent.ts +16 -21
  114. package/Utils/Monitor/LatencyMatrixUtil.ts +162 -0
  115. package/Utils/Monitor/MonitorMetricType.ts +71 -1
  116. package/Utils/Monitor/NetworkTopologyUtil.ts +159 -0
  117. package/Utils/Telemetry/EntityRelationship.ts +11 -0
  118. package/build/dist/Models/DatabaseModels/AIRun.js +52 -0
  119. package/build/dist/Models/DatabaseModels/AIRun.js.map +1 -1
  120. package/build/dist/Models/DatabaseModels/AlertSeverity.js +6 -0
  121. package/build/dist/Models/DatabaseModels/AlertSeverity.js.map +1 -1
  122. package/build/dist/Models/DatabaseModels/IncidentSeverity.js +6 -0
  123. package/build/dist/Models/DatabaseModels/IncidentSeverity.js.map +1 -1
  124. package/build/dist/Models/DatabaseModels/Index.js +16 -0
  125. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  126. package/build/dist/Models/DatabaseModels/IoTDeviceCredential.js +493 -0
  127. package/build/dist/Models/DatabaseModels/IoTDeviceCredential.js.map +1 -0
  128. package/build/dist/Models/DatabaseModels/LlmLog.js +58 -0
  129. package/build/dist/Models/DatabaseModels/LlmLog.js.map +1 -1
  130. package/build/dist/Models/DatabaseModels/LlmProvider.js +33 -0
  131. package/build/dist/Models/DatabaseModels/LlmProvider.js.map +1 -1
  132. package/build/dist/Models/DatabaseModels/NetworkDevice.js +1426 -0
  133. package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -0
  134. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +738 -0
  135. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -0
  136. package/build/dist/Models/DatabaseModels/NetworkDeviceLabelRule.js +522 -0
  137. package/build/dist/Models/DatabaseModels/NetworkDeviceLabelRule.js.map +1 -0
  138. package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerRule.js +603 -0
  139. package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerRule.js.map +1 -0
  140. package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerTeam.js +503 -0
  141. package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerTeam.js.map +1 -0
  142. package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerUser.js +502 -0
  143. package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerUser.js.map +1 -0
  144. package/build/dist/Models/DatabaseModels/NetworkInterface.js +589 -0
  145. package/build/dist/Models/DatabaseModels/NetworkInterface.js.map +1 -0
  146. package/build/dist/Models/DatabaseModels/Project.js +147 -0
  147. package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
  148. package/build/dist/Models/DatabaseModels/TelemetryEntityRelationship.js +57 -0
  149. package/build/dist/Models/DatabaseModels/TelemetryEntityRelationship.js.map +1 -1
  150. package/build/dist/Server/API/AIInvestigationAPI.js +95 -55
  151. package/build/dist/Server/API/AIInvestigationAPI.js.map +1 -1
  152. package/build/dist/Server/API/AlertAPI.js +5 -0
  153. package/build/dist/Server/API/AlertAPI.js.map +1 -1
  154. package/build/dist/Server/API/IncidentAPI.js +10 -0
  155. package/build/dist/Server/API/IncidentAPI.js.map +1 -1
  156. package/build/dist/Server/API/IncidentEpisodeAPI.js +5 -0
  157. package/build/dist/Server/API/IncidentEpisodeAPI.js.map +1 -1
  158. package/build/dist/Server/API/LlmProviderAPI.js +5 -7
  159. package/build/dist/Server/API/LlmProviderAPI.js.map +1 -1
  160. package/build/dist/Server/API/ScheduledMaintenanceAPI.js +5 -0
  161. package/build/dist/Server/API/ScheduledMaintenanceAPI.js.map +1 -1
  162. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783650000000-AddAdditionalParamsToLlmProvider.js +12 -0
  163. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783650000000-AddAdditionalParamsToLlmProvider.js.map +1 -0
  164. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783695782697-AddCacheTokenColumnsToLlmLog.js +14 -0
  165. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783695782697-AddCacheTokenColumnsToLlmLog.js.map +1 -0
  166. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783701585317-AddAlertInvestigationGating.js +18 -0
  167. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783701585317-AddAlertInvestigationGating.js.map +1 -0
  168. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783702431535-AddAiDailyAutonomousTokenLimitToProject.js +12 -0
  169. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783702431535-AddAiDailyAutonomousTokenLimitToProject.js.map +1 -0
  170. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783720000000-AddNetworkDeviceTables.js +51 -0
  171. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783720000000-AddNetworkDeviceTables.js.map +1 -0
  172. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783721121260-AddAttemptCountToAIRun.js +12 -0
  173. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783721121260-AddAttemptCountToAIRun.js.map +1 -0
  174. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783730000000-AddNetworkDeviceOwnersAndRules.js +101 -0
  175. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783730000000-AddNetworkDeviceOwnersAndRules.js.map +1 -0
  176. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783740000000-AddNetworkDeviceDiscoveryScan.js +18 -0
  177. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783740000000-AddNetworkDeviceDiscoveryScan.js.map +1 -0
  178. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783750000000-AddLldpNeighborsToNetworkDevice.js +12 -0
  179. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783750000000-AddLldpNeighborsToNetworkDevice.js.map +1 -0
  180. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783760576655-AddInvestigationTuningToProject.js +14 -0
  181. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783760576655-AddInvestigationTuningToProject.js.map +1 -0
  182. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783762505482-AddTelemetryEntityRelationshipMetrics.js +16 -0
  183. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783762505482-AddTelemetryEntityRelationshipMetrics.js.map +1 -0
  184. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783780000000-AddIoTDeviceCredentialTable.js +38 -0
  185. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783780000000-AddIoTDeviceCredentialTable.js.map +1 -0
  186. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783790000000-AddSnmpV3AuthColumnsToNetworkDevice.js +22 -0
  187. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783790000000-AddSnmpV3AuthColumnsToNetworkDevice.js.map +1 -0
  188. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +24 -0
  189. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  190. package/build/dist/Server/Services/AIRunService.js +33 -0
  191. package/build/dist/Server/Services/AIRunService.js.map +1 -1
  192. package/build/dist/Server/Services/AIService.js +82 -9
  193. package/build/dist/Server/Services/AIService.js.map +1 -1
  194. package/build/dist/Server/Services/IncidentService.js +14 -25
  195. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  196. package/build/dist/Server/Services/Index.js +14 -0
  197. package/build/dist/Server/Services/Index.js.map +1 -1
  198. package/build/dist/Server/Services/IoTDeviceCredentialService.js +321 -0
  199. package/build/dist/Server/Services/IoTDeviceCredentialService.js.map +1 -0
  200. package/build/dist/Server/Services/IoTDeviceService.js +49 -15
  201. package/build/dist/Server/Services/IoTDeviceService.js.map +1 -1
  202. package/build/dist/Server/Services/LlmLogService.js +29 -0
  203. package/build/dist/Server/Services/LlmLogService.js.map +1 -1
  204. package/build/dist/Server/Services/LlmProviderService.js +3 -0
  205. package/build/dist/Server/Services/LlmProviderService.js.map +1 -1
  206. package/build/dist/Server/Services/MonitorService.js +2 -1
  207. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  208. package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js +9 -0
  209. package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js.map +1 -0
  210. package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js +166 -0
  211. package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js.map +1 -0
  212. package/build/dist/Server/Services/NetworkDeviceLabelRuleService.js +13 -0
  213. package/build/dist/Server/Services/NetworkDeviceLabelRuleService.js.map +1 -0
  214. package/build/dist/Server/Services/NetworkDeviceOwnerRuleEngineService.js +186 -0
  215. package/build/dist/Server/Services/NetworkDeviceOwnerRuleEngineService.js.map +1 -0
  216. package/build/dist/Server/Services/NetworkDeviceOwnerRuleService.js +13 -0
  217. package/build/dist/Server/Services/NetworkDeviceOwnerRuleService.js.map +1 -0
  218. package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js +9 -0
  219. package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js.map +1 -0
  220. package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js +9 -0
  221. package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js.map +1 -0
  222. package/build/dist/Server/Services/NetworkDeviceService.js +52 -0
  223. package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -0
  224. package/build/dist/Server/Services/NetworkInterfaceService.js +9 -0
  225. package/build/dist/Server/Services/NetworkInterfaceService.js.map +1 -0
  226. package/build/dist/Server/Services/TelemetryEntityRelationshipService.js +22 -0
  227. package/build/dist/Server/Services/TelemetryEntityRelationshipService.js.map +1 -1
  228. package/build/dist/Server/Services/TelemetryEntityService.js +64 -2
  229. package/build/dist/Server/Services/TelemetryEntityService.js.map +1 -1
  230. package/build/dist/Server/Utils/AI/Sentinel/AlertInvestigationRunner.js +189 -9
  231. package/build/dist/Server/Utils/AI/Sentinel/AlertInvestigationRunner.js.map +1 -1
  232. package/build/dist/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.js +84 -17
  233. package/build/dist/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.js.map +1 -1
  234. package/build/dist/Server/Utils/AI/Sentinel/InvestigationQueue.js +428 -0
  235. package/build/dist/Server/Utils/AI/Sentinel/InvestigationQueue.js.map +1 -0
  236. package/build/dist/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.js +63 -47
  237. package/build/dist/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.js.map +1 -1
  238. package/build/dist/Server/Utils/AI/Toolbox/Index.js +2 -1
  239. package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
  240. package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js +300 -0
  241. package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js.map +1 -1
  242. package/build/dist/Server/Utils/LLM/LLMService.js +16 -0
  243. package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
  244. package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js +130 -2
  245. package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js.map +1 -1
  246. package/build/dist/Server/Utils/Monitor/IoTDeviceAbsenceSeries.js +81 -0
  247. package/build/dist/Server/Utils/Monitor/IoTDeviceAbsenceSeries.js.map +1 -0
  248. package/build/dist/Server/Utils/Monitor/MonitorAlert.js +18 -7
  249. package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
  250. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +1 -1
  251. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  252. package/build/dist/Server/Utils/Monitor/MonitorIncident.js +25 -10
  253. package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
  254. package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js +69 -3
  255. package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js.map +1 -1
  256. package/build/dist/Server/Utils/Monitor/MonitorResource.js +76 -30
  257. package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
  258. package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js +1 -1
  259. package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js.map +1 -1
  260. package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js +147 -0
  261. package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js.map +1 -0
  262. package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +167 -0
  263. package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -0
  264. package/build/dist/Server/Utils/Monitor/SnmpInterfaceRateUtil.js +93 -0
  265. package/build/dist/Server/Utils/Monitor/SnmpInterfaceRateUtil.js.map +1 -0
  266. package/build/dist/Types/AI/AIRunStatus.js +9 -0
  267. package/build/dist/Types/AI/AIRunStatus.js.map +1 -1
  268. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +0 -1
  269. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
  270. package/build/dist/Types/LlmLogStatus.js +1 -0
  271. package/build/dist/Types/LlmLogStatus.js.map +1 -1
  272. package/build/dist/Types/Monitor/CriteriaFilter.js +5 -0
  273. package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
  274. package/build/dist/Types/Monitor/IotAlertTemplates.js +7 -7
  275. package/build/dist/Types/Monitor/IotAlertTemplates.js.map +1 -1
  276. package/build/dist/Types/Monitor/LatencyMatrix.js +2 -0
  277. package/build/dist/Types/Monitor/LatencyMatrix.js.map +1 -0
  278. package/build/dist/Types/Monitor/MonitorCriteriaInstance.js +2 -2
  279. package/build/dist/Types/Monitor/MonitorCriteriaInstance.js.map +1 -1
  280. package/build/dist/Types/Monitor/MonitorMetricType.js +9 -0
  281. package/build/dist/Types/Monitor/MonitorMetricType.js.map +1 -1
  282. package/build/dist/Types/Monitor/MonitorStep.js +22 -9
  283. package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
  284. package/build/dist/Types/Monitor/MonitorStepNetworkDeviceMonitor.js +36 -0
  285. package/build/dist/Types/Monitor/MonitorStepNetworkDeviceMonitor.js.map +1 -0
  286. package/build/dist/Types/Monitor/MonitorStepSnmpMonitor.js +3 -0
  287. package/build/dist/Types/Monitor/MonitorStepSnmpMonitor.js.map +1 -1
  288. package/build/dist/Types/Monitor/MonitorType.js +14 -9
  289. package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
  290. package/build/dist/Types/Monitor/SnmpMonitor/LldpNeighbor.js +2 -0
  291. package/build/dist/Types/Monitor/SnmpMonitor/LldpNeighbor.js.map +1 -0
  292. package/build/dist/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +89 -0
  293. package/build/dist/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js.map +1 -0
  294. package/build/dist/Types/Monitor/SnmpMonitor/NetworkTopology.js +2 -0
  295. package/build/dist/Types/Monitor/SnmpMonitor/NetworkTopology.js.map +1 -0
  296. package/build/dist/Types/Monitor/SnmpMonitor/SnmpInterface.js +2 -0
  297. package/build/dist/Types/Monitor/SnmpMonitor/SnmpInterface.js.map +1 -0
  298. package/build/dist/Types/Monitor/SnmpMonitor/SnmpTrap.js +2 -0
  299. package/build/dist/Types/Monitor/SnmpMonitor/SnmpTrap.js.map +1 -0
  300. package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js +137 -0
  301. package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js.map +1 -0
  302. package/build/dist/Types/Permission.js +280 -0
  303. package/build/dist/Types/Permission.js.map +1 -1
  304. package/build/dist/UI/Components/Icon/Icon.js +8 -6
  305. package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
  306. package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js +2 -2
  307. package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js.map +1 -1
  308. package/build/dist/UI/Components/Tabs/Tabs.js +3 -1
  309. package/build/dist/UI/Components/Tabs/Tabs.js.map +1 -1
  310. package/build/dist/UI/Utils/Navigation.js +11 -1
  311. package/build/dist/UI/Utils/Navigation.js.map +1 -1
  312. package/build/dist/Utils/Dashboard/Components/DashboardLogChartComponent.js +17 -20
  313. package/build/dist/Utils/Dashboard/Components/DashboardLogChartComponent.js.map +1 -1
  314. package/build/dist/Utils/Monitor/LatencyMatrixUtil.js +89 -0
  315. package/build/dist/Utils/Monitor/LatencyMatrixUtil.js.map +1 -0
  316. package/build/dist/Utils/Monitor/MonitorMetricType.js +68 -1
  317. package/build/dist/Utils/Monitor/MonitorMetricType.js.map +1 -1
  318. package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +112 -0
  319. package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -0
  320. package/build/dist/Utils/Telemetry/EntityRelationship.js.map +1 -1
  321. package/package.json +1 -1
@@ -2938,18 +2938,20 @@ const Icon: FunctionComponent<ComponentProps> = ({
2938
2938
  );
2939
2939
  } else if (icon === IconProp.Podman) {
2940
2940
  /*
2941
- * Podman mark — a simplified, bold silhouette of Podman's seal mascot.
2942
- * The official emblem (a finely detailed seal inside a hexagonal frame)
2943
- * collapses into an illegible blob at small sizes, so this is a cleaner
2944
- * single-path seal that stays recognizable down to ~16px and sits well
2945
- * beside the other resource brand logos (Docker / Proxmox / Ceph).
2941
+ * Podman mark — a clean side-profile silhouette of Podman's seal mascot:
2942
+ * head raised with a visible eye, an arched back, and trailing tail
2943
+ * flippers. The official emblem (a finely detailed seal inside a hexagonal
2944
+ * frame) collapses into an illegible blob at small sizes, so this reads as
2945
+ * a recognizable little sea creature down to ~16px and sits well beside the
2946
+ * other resource brand logos (Docker / Proxmox / Ceph). The eye is punched
2947
+ * out via the even-odd fill rule.
2946
2948
  */
2947
2949
  return getSvgWrapper(
2948
2950
  <path
2949
2951
  fill="currentColor"
2950
2952
  stroke="none"
2951
2953
  fillRule="evenodd"
2952
- d="M6.4 7.2C6.2 5.2 7.8 3.7 9.7 3.9C11.2 4.1 12.2 5.3 12.3 6.8C13 6.4 14 6.6 14.4 7.4C14.8 8.1 14.5 8.9 13.9 9.3C15.4 11 16.2 13.4 16.2 15.7C17.1 15.6 18.2 15.9 18.6 16.7C18.2 17.6 17 18.2 15.7 18.1C14 18 12.7 16.7 12.4 15C11.7 16.9 10.1 18.2 8.3 18.1C7.2 18 6.9 17.1 7.6 16.5C8.7 15.6 9.1 14 8.8 12.4C8.6 11 8 9.6 7.3 8.5C6.8 8.3 6.5 7.8 6.4 7.2ZM8.45 6.4a0.85 0.85 0 1 0 1.7 0a0.85 0.85 0 1 0 -1.7 0z"
2954
+ d="M6.6 8.4C6.2 6.6 7.4 5 9.2 4.9c1.6-.1 2.9 1 3.5 2.2.7-.5 1.7-.7 2.5-.2.6.36.8 1.06.5 1.6 1.9 1.3 3.2 3.4 3.6 5.9.9-.15 1.9.15 2.3.95.35.75-.2 1.45-1.1 1.7-1.5.42-3.2-.15-4.1-1.5-.3.95-.9 1.75-1.7 2.25 1.2.5 2 1.2 1.6 2-.3.6-1.2.7-2.2.4-1.7-.5-3-1.9-3.4-3.6-.9.9-2.2 1.4-3.5 1.3-1-.1-1.5-.8-1.2-1.5.25-.6.9-.9 1.6-1-1-1.5-1.5-3.4-1.4-5.3-.6-.3-1.05-.85-1.1-1.55ZM8.4 8a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"
2953
2955
  />,
2954
2956
  );
2955
2957
  } else if (icon === IconProp.Proxmox) {
@@ -344,9 +344,9 @@ export default class TemplateVariablesCatalog {
344
344
  ],
345
345
  };
346
346
 
347
- case MonitorType.SNMP:
347
+ case MonitorType.NetworkDevice:
348
348
  return {
349
- title: "SNMP",
349
+ title: "Network Device (SNMP)",
350
350
  variables: [
351
351
  {
352
352
  key: "isOnline",
@@ -10,6 +10,11 @@ import React, {
10
10
  export interface ComponentProps {
11
11
  tabs: Array<Tab>;
12
12
  onTabChange: (tab: Tab) => void;
13
+ /**
14
+ * Tab selected on first render (e.g. restored from a URL param).
15
+ * Falls back to the first tab when absent or unknown.
16
+ */
17
+ initialTabName?: string | undefined;
13
18
  }
14
19
 
15
20
  const Tabs: FunctionComponent<ComponentProps> = (
@@ -88,7 +93,11 @@ const Tabs: FunctionComponent<ComponentProps> = (
88
93
 
89
94
  if (!hasInitialized.current && props.tabs.length > 0) {
90
95
  hasInitialized.current = true;
91
- setCurrentTabName(props.tabs[0]!.name);
96
+ setCurrentTabName(
97
+ props.initialTabName && tabNames.includes(props.initialTabName)
98
+ ? props.initialTabName
99
+ : props.tabs[0]!.name,
100
+ );
92
101
  return;
93
102
  }
94
103
 
@@ -102,7 +102,16 @@ abstract class Navigation {
102
102
  (queryString ? `?${queryString}` : "") +
103
103
  window.location.hash;
104
104
 
105
- window.history.replaceState(window.history.state, "", newRelativeUrl);
105
+ try {
106
+ window.history.replaceState(window.history.state, "", newRelativeUrl);
107
+ } catch {
108
+ /*
109
+ * Safari throws SecurityError when replaceState is called >100
110
+ * times / 30s (e.g. fast typing into a URL-synced search box).
111
+ * React state stays authoritative; the URL re-syncs on the next
112
+ * successful write.
113
+ */
114
+ }
106
115
  }
107
116
 
108
117
  public static getParamByName(
@@ -7,13 +7,13 @@ import {
7
7
  ComponentArgument,
8
8
  ComponentArgumentSection,
9
9
  ComponentInputType,
10
- EntityFilterModelType,
11
10
  } from "../../../Types/Dashboard/DashboardComponents/ComponentArgument";
12
11
  import DashboardComponentType from "../../../Types/Dashboard/DashboardComponentType";
12
+ import DashboardChartType from "../../../Types/Dashboard/Chart/ChartType";
13
13
 
14
14
  const DisplaySection: ComponentArgumentSection = {
15
15
  name: "Display Options",
16
- description: "Configure the chart heading",
16
+ description: "Configure the chart heading and visualization",
17
17
  order: 1,
18
18
  };
19
19
 
@@ -35,7 +35,9 @@ export default class DashboardLogChartComponentUtil extends DashboardBaseCompone
35
35
  componentId: ObjectID.generate(),
36
36
  minHeightInDashboardUnits: 3,
37
37
  minWidthInDashboardUnits: 6,
38
- arguments: {},
38
+ arguments: {
39
+ chartType: DashboardChartType.Bar,
40
+ },
39
41
  };
40
42
  }
41
43
 
@@ -53,14 +55,17 @@ export default class DashboardLogChartComponentUtil extends DashboardBaseCompone
53
55
  section: DisplaySection,
54
56
  },
55
57
  {
56
- name: "Services",
57
- description: "Only count logs emitted by the selected services",
58
- required: false,
59
- type: ComponentInputType.EntityMultiSelectDropdown,
60
- id: "serviceIds",
61
- placeholder: "All services",
62
- section: FiltersSection,
63
- entityFilterModelType: EntityFilterModelType.Service,
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
+ ],
64
69
  },
65
70
  {
66
71
  name: "Severities",
@@ -89,16 +94,6 @@ export default class DashboardLogChartComponentUtil extends DashboardBaseCompone
89
94
  placeholder: "Search text...",
90
95
  section: FiltersSection,
91
96
  },
92
- {
93
- name: "Attribute Filters",
94
- description:
95
- "Exact attribute matches, e.g. @service.name:checkout @deployment.environment:production",
96
- required: false,
97
- type: ComponentInputType.LongText,
98
- id: "attributeFilterQuery",
99
- placeholder: "@key:value @another.key:value",
100
- section: FiltersSection,
101
- },
102
97
  ];
103
98
  }
104
99
  }
@@ -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
+ }
@@ -43,6 +43,14 @@ class MonitorMetricTypeUtil {
43
43
  case MonitorMetricType.TimeToFirstByte:
44
44
  case MonitorMetricType.DownloadTime:
45
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;
46
54
 
47
55
  /*
48
56
  * Extended server/VM metrics. Cumulative counters (bytes/packets/ops since
@@ -197,9 +205,20 @@ class MonitorMetricTypeUtil {
197
205
  ];
198
206
  }
199
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
+
200
220
  if (
201
221
  monitorType === MonitorType.Port ||
202
- monitorType === MonitorType.SNMP ||
203
222
  monitorType === MonitorType.DNS ||
204
223
  monitorType === MonitorType.DNSSEC ||
205
224
  monitorType === MonitorType.Domain ||
@@ -285,6 +304,28 @@ class MonitorMetricTypeUtil {
285
304
  ];
286
305
  }
287
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
+
288
329
  // Other monitor types keep the single-card layout.
289
330
  const metrics: Array<MonitorMetricType> =
290
331
  this.getMonitorMetricTypesByMonitorType(monitorType);
@@ -332,6 +373,16 @@ class MonitorMetricTypeUtil {
332
373
  return "Time to First Byte";
333
374
  case MonitorMetricType.DownloadTime:
334
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";
335
386
  case MonitorMetricType.LoadAverage1Min:
336
387
  return "Load Average (1 minute)";
337
388
  case MonitorMetricType.LoadAverage5Min:
@@ -424,6 +475,15 @@ class MonitorMetricTypeUtil {
424
475
  case MonitorMetricType.TimeToFirstByte:
425
476
  case MonitorMetricType.DownloadTime:
426
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";
427
487
  case MonitorMetricType.LoadAverage1Min:
428
488
  case MonitorMetricType.LoadAverage5Min:
429
489
  case MonitorMetricType.LoadAverage15Min:
@@ -494,6 +554,16 @@ class MonitorMetricTypeUtil {
494
554
  return "Time from the end of connection setup until the first byte of the response arrived — the server-side processing time.";
495
555
  case MonitorMetricType.DownloadTime:
496
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.";
497
567
  case MonitorMetricType.LoadAverage1Min:
498
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.";
499
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
  /*
@@ -49,6 +49,8 @@ let AIRun = class AIRun extends BaseModel {
49
49
  this.conversationId = undefined;
50
50
  this.triggeredByIncidentId = undefined;
51
51
  this.triggeredByAlertId = undefined;
52
+ this.monitorId = undefined;
53
+ this.attemptCount = undefined;
52
54
  this.startedAt = undefined;
53
55
  this.completedAt = undefined;
54
56
  this.lastHeartbeatAt = undefined;
@@ -338,6 +340,56 @@ __decorate([
338
340
  }),
339
341
  __metadata("design:type", ObjectID)
340
342
  ], AIRun.prototype, "triggeredByAlertId", void 0);
343
+ __decorate([
344
+ ColumnAccessControl({
345
+ create: [],
346
+ read: [
347
+ Permission.ProjectOwner,
348
+ Permission.ProjectAdmin,
349
+ Permission.ProjectMember,
350
+ ],
351
+ update: [],
352
+ }),
353
+ Index(),
354
+ TableColumn({
355
+ type: TableColumnType.ObjectID,
356
+ required: false,
357
+ canReadOnRelationQuery: true,
358
+ title: "Monitor ID",
359
+ description: "The monitor behind the alert that triggered this run — the dedupe key for per-monitor investigation windows.",
360
+ }),
361
+ Column({
362
+ type: ColumnType.ObjectID,
363
+ nullable: true,
364
+ transformer: ObjectID.getDatabaseTransformer(),
365
+ }),
366
+ __metadata("design:type", ObjectID)
367
+ ], AIRun.prototype, "monitorId", void 0);
368
+ __decorate([
369
+ ColumnAccessControl({
370
+ create: [],
371
+ read: [
372
+ Permission.ProjectOwner,
373
+ Permission.ProjectAdmin,
374
+ Permission.ProjectMember,
375
+ ],
376
+ update: [],
377
+ }),
378
+ TableColumn({
379
+ required: true,
380
+ type: TableColumnType.Number,
381
+ title: "Attempt Count",
382
+ description: "How many times a worker has claimed this run for execution. Incremented on each claim; the queue stops retrying after the maximum.",
383
+ isDefaultValueColumn: true,
384
+ defaultValue: 0,
385
+ }),
386
+ Column({
387
+ nullable: false,
388
+ default: 0,
389
+ type: ColumnType.Number,
390
+ }),
391
+ __metadata("design:type", Number)
392
+ ], AIRun.prototype, "attemptCount", void 0);
341
393
  __decorate([
342
394
  ColumnAccessControl({
343
395
  create: [],