@oneuptime/common 12.0.2 → 12.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (384) hide show
  1. package/Models/DatabaseModels/CephCluster.ts +14 -0
  2. package/Models/DatabaseModels/CodeRepository.ts +14 -6
  3. package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.ts +14 -0
  4. package/Models/DatabaseModels/DockerHost.ts +14 -0
  5. package/Models/DatabaseModels/GlobalOidcProject.ts +18 -0
  6. package/Models/DatabaseModels/GlobalSsoProject.ts +18 -0
  7. package/Models/DatabaseModels/Index.ts +2 -0
  8. package/Models/DatabaseModels/IoTFleet.ts +14 -0
  9. package/Models/DatabaseModels/KubernetesCluster.ts +14 -0
  10. package/Models/DatabaseModels/LogDropFilter.ts +9 -20
  11. package/Models/DatabaseModels/NetworkDevice.ts +14 -0
  12. package/Models/DatabaseModels/NetworkInterface.ts +18 -0
  13. package/Models/DatabaseModels/Project.ts +16 -2
  14. package/Models/DatabaseModels/ProxmoxCluster.ts +14 -0
  15. package/Models/DatabaseModels/Service.ts +30 -0
  16. package/Models/DatabaseModels/StatusPageMonitorRule.ts +911 -0
  17. package/Models/DatabaseModels/StatusPagePrivateUser.ts +30 -0
  18. package/Models/DatabaseModels/StatusPageResource.ts +73 -0
  19. package/Models/DatabaseModels/TraceDropFilter.ts +9 -20
  20. package/Models/DatabaseModels/User.ts +30 -0
  21. package/Server/API/AIAgentDataAPI.ts +31 -0
  22. package/Server/API/BaseAPI.ts +13 -2
  23. package/Server/API/DashboardAPI.ts +458 -12
  24. package/Server/API/GitHubAPI.ts +119 -283
  25. package/Server/API/UserAPI.ts +263 -1
  26. package/Server/EnvironmentConfig.ts +38 -4
  27. package/Server/Infrastructure/GlobalCache.ts +152 -0
  28. package/Server/Infrastructure/Postgres/DataSourceOptions.ts +16 -0
  29. package/Server/Infrastructure/Postgres/SchemaMigrations/1786005052769-AddStatusPageMonitorRule.ts +123 -0
  30. package/Server/Infrastructure/Postgres/SchemaMigrations/1786018109307-AddPerUserPasswordSalt.ts +21 -0
  31. package/Server/Infrastructure/Postgres/SchemaMigrations/1786023262402-WidenHashedStringColumnsForScrypt.ts +68 -0
  32. package/Server/Infrastructure/Postgres/SchemaMigrations/1786100000000-RestoreServiceLowerNameIndex.ts +100 -0
  33. package/Server/Infrastructure/Postgres/SchemaMigrations/1786200000000-RestoreDroppedUniqueIndexes.ts +214 -0
  34. package/Server/Infrastructure/Postgres/SchemaMigrations/1786300000000-QuarantineUnboundGitHubInstallations.ts +69 -0
  35. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +12 -0
  36. package/Server/Services/AlertStateTimelineService.ts +20 -0
  37. package/Server/Services/AnalyticsDatabaseService.ts +72 -1
  38. package/Server/Services/CephClusterService.ts +26 -86
  39. package/Server/Services/CloudResourceService.ts +23 -83
  40. package/Server/Services/CodeRepositoryService.ts +105 -2
  41. package/Server/Services/DatabaseService.ts +296 -2
  42. package/Server/Services/DockerHostService.ts +19 -79
  43. package/Server/Services/DockerSwarmClusterService.ts +27 -88
  44. package/Server/Services/HostService.ts +46 -99
  45. package/Server/Services/IncidentStateTimelineService.ts +20 -0
  46. package/Server/Services/Index.ts +2 -0
  47. package/Server/Services/IoTFleetService.ts +19 -79
  48. package/Server/Services/KubernetesClusterService.ts +17 -78
  49. package/Server/Services/LabelService.ts +57 -10
  50. package/Server/Services/MetricTypeService.ts +84 -0
  51. package/Server/Services/MonitorService.ts +89 -14
  52. package/Server/Services/MonitorStatusTimelineService.ts +29 -0
  53. package/Server/Services/MonitorTemplateService.ts +65 -0
  54. package/Server/Services/OpenTelemetryIngestService.ts +230 -26
  55. package/Server/Services/PodmanHostService.ts +19 -79
  56. package/Server/Services/ProxmoxClusterService.ts +23 -83
  57. package/Server/Services/RumApplicationService.ts +19 -80
  58. package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +21 -0
  59. package/Server/Services/ServerlessFunctionService.ts +24 -85
  60. package/Server/Services/ServiceService.ts +299 -73
  61. package/Server/Services/StatusPageMonitorRuleEngineService.ts +752 -0
  62. package/Server/Services/StatusPageMonitorRuleService.ts +471 -0
  63. package/Server/Services/TelemetryEntityRelationshipService.ts +1 -0
  64. package/Server/Services/TelemetryEntityService.ts +1 -0
  65. package/Server/Services/UserService.ts +184 -0
  66. package/Server/Utils/AI/Toolbox/CodeTools.ts +45 -4
  67. package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +13 -0
  68. package/Server/Utils/CodeRepository/GitHub/GitHub.ts +157 -4
  69. package/Server/Utils/CodeRepository/GitHub/GitHubInstallationBinding.ts +130 -0
  70. package/Server/Utils/Database/ProjectScopedReferenceValidator.ts +170 -39
  71. package/Server/Utils/Monitor/MonitorResource.ts +63 -36
  72. package/Server/Utils/Monitor/MonitorStatusTimeline.ts +36 -0
  73. package/Server/Utils/Monitor/MonitorStepsProjectValidator.ts +148 -127
  74. package/Server/Utils/Monitor/MonitorStepsReferenceExtractor.ts +434 -0
  75. package/Server/Utils/PasswordHash.ts +306 -0
  76. package/Server/Utils/SingleFlight.ts +83 -0
  77. package/Server/Utils/StatusPage/MonitorRulePatternValidator.ts +46 -0
  78. package/Server/Utils/Telemetry/EntityRegistry.ts +107 -26
  79. package/Server/Utils/Telemetry/ResourceHeartbeat.ts +314 -0
  80. package/Server/Utils/Telemetry/Telemetry.ts +351 -122
  81. package/Tests/App/Dashboard/OverviewCustomFields.test.tsx +333 -0
  82. package/Tests/App/Dashboard/UserCustomFields.test.tsx +392 -0
  83. package/Tests/App/Dashboard/WidgetCatalog.test.ts +2 -0
  84. package/Tests/Models/DatabaseModels/ColumnTransformerInvariants.test.ts +306 -0
  85. package/Tests/Models/DatabaseModels/NumberColumnDeserialization.test.ts +333 -0
  86. package/Tests/Models/DatabaseModels/StatusPageMonitorRuleModel.test.ts +190 -0
  87. package/Tests/Server/API/AIAgentDataRepositoryToken.test.ts +381 -0
  88. package/Tests/Server/API/DashboardPublicAttributeValuesAPI.test.ts +943 -0
  89. package/Tests/Server/API/DashboardPublicMetricsAggregateAPI.test.ts +1296 -0
  90. package/Tests/Server/API/DashboardPublicResourceListAPI.test.ts +26 -0
  91. package/Tests/Server/API/DashboardPublicTemplatePayloads.test.ts +598 -0
  92. package/Tests/Server/API/GitHubAppInstallationBindingAPI.test.ts +539 -0
  93. package/Tests/Server/API/Helpers.ts +6 -1
  94. package/Tests/Server/API/UserProjectsAPI.test.ts +852 -0
  95. package/Tests/Server/Infrastructure/GlobalCache.test.ts +354 -0
  96. package/Tests/Server/Infrastructure/PostgresLockTimeoutOptions.test.ts +181 -0
  97. package/Tests/Server/Infrastructure/SemaphoreMutex.test.ts +215 -0
  98. package/Tests/Server/Services/AddPerUserPasswordSaltMigration.test.ts +178 -0
  99. package/Tests/Server/Services/AnalyticsDatabasePaginationStability.test.ts +582 -0
  100. package/Tests/Server/Services/AnalyticsDatabaseService.test.ts +5 -0
  101. package/Tests/Server/Services/CodeRepositoryInstallationBinding.test.ts +305 -0
  102. package/Tests/Server/Services/CodeRepositoryResolutionBinding.test.ts +147 -0
  103. package/Tests/Server/Services/DatabaseServicePerUserPasswordSalt.test.ts +870 -0
  104. package/Tests/Server/Services/DatabaseServiceUpdateColumnsIfUnlocked.test.ts +342 -0
  105. package/Tests/Server/Services/DropFilterSaveValidation.test.ts +245 -0
  106. package/Tests/Server/Services/HostServiceUpdateLastSeen.test.ts +163 -15
  107. package/Tests/Server/Services/MetricTypeAttachServices.test.ts +222 -0
  108. package/Tests/Server/Services/MissingReferenceWriteGuard.test.ts +614 -0
  109. package/Tests/Server/Services/MonitorStatusTimelineFastPath.test.ts +23 -0
  110. package/Tests/Server/Services/OpenTelemetryServiceResolutionCache.test.ts +568 -0
  111. package/Tests/Server/Services/ResourceUpdateLastSeenLivenessFallback.test.ts +305 -56
  112. package/Tests/Server/Services/RestoreDroppedUniqueIndexesMigration.test.ts +386 -0
  113. package/Tests/Server/Services/RestoreServiceLowerNameIndexMigration.test.ts +240 -0
  114. package/Tests/Server/Services/ServiceUpdateLastSeenSplitGates.test.ts +705 -0
  115. package/Tests/Server/Services/StatusPageMonitorRuleEngineService.test.ts +1719 -0
  116. package/Tests/Server/Services/StatusPageMonitorRuleHooks.test.ts +1212 -0
  117. package/Tests/Server/Services/StatusPageMonitorRuleMonitorCreateHook.test.ts +228 -0
  118. package/Tests/Server/Services/UserServiceFirstMasterAdminElection.test.ts +885 -0
  119. package/Tests/Server/Services/WidenHashedStringColumnsForScryptMigration.test.ts +220 -0
  120. package/Tests/Server/Utils/AI/CodeTools.test.ts +47 -1
  121. package/Tests/Server/Utils/AI/CodeWriteTools.test.ts +10 -0
  122. package/Tests/Server/Utils/APIKey/AccessPermission.test.ts +267 -0
  123. package/Tests/Server/Utils/AnalyticsDatabase/StatementGenerator.test.ts +120 -0
  124. package/Tests/Server/Utils/CodeRepository/GitHubInstallationBinding.test.ts +292 -0
  125. package/Tests/Server/Utils/Database/ProjectScopedReferenceValidator.test.ts +260 -13
  126. package/Tests/Server/Utils/EntityRegistryRowFence.test.ts +302 -0
  127. package/Tests/Server/Utils/GitHubInstallationOwnershipVerification.test.ts +340 -0
  128. package/Tests/Server/Utils/GitHubWebhookAndTreeCacheIsolation.test.ts +250 -0
  129. package/Tests/Server/Utils/MetricTypeIndexConvergence.test.ts +598 -0
  130. package/Tests/Server/Utils/Monitor/MonitorStatusTimelineUnusableStatus.test.ts +154 -0
  131. package/Tests/Server/Utils/Monitor/MonitorStepsProjectValidator.test.ts +638 -92
  132. package/Tests/Server/Utils/Monitor/MonitorStepsReferenceExtractor.test.ts +724 -0
  133. package/Tests/Server/Utils/PasswordHash.test.ts +555 -0
  134. package/Tests/Server/Utils/SingleFlight.test.ts +221 -0
  135. package/Tests/Types/Dashboard/NetworkDashboardTemplate.test.ts +793 -0
  136. package/Tests/Types/Database/BigIntColumnTransformer.test.ts +147 -0
  137. package/Tests/Types/Database/ColumnLength.test.ts +7 -1
  138. package/Tests/Types/Database/DatabasePropertyTransformer.test.ts +140 -0
  139. package/Tests/Types/Database/NumericColumnValue.test.ts +127 -0
  140. package/Tests/Types/Decimal.test.ts +37 -0
  141. package/Tests/Types/HashedStringPerUserSalt.test.ts +476 -0
  142. package/Tests/Types/Monitor/DockerAlertTemplates.test.ts +293 -0
  143. package/Tests/Types/Monitor/HostAlertTemplates.test.ts +249 -0
  144. package/Tests/Types/Monitor/IotAlertTemplates.test.ts +320 -0
  145. package/Tests/Types/Monitor/PodmanAlertTemplates.test.ts +271 -0
  146. package/Tests/Types/Monitor/SnmpVersionParsing.test.ts +152 -0
  147. package/Tests/Types/Port.test.ts +38 -0
  148. package/Tests/UI/Components/CustomFields/CustomFieldsDetail.test.tsx +696 -0
  149. package/Tests/UI/Components/LogsHistogram.test.tsx +276 -0
  150. package/Tests/UI/Components/UseLiveLogsRefresh.test.tsx +489 -0
  151. package/Tests/UI/Components/UseLogsHistogram.test.tsx +500 -0
  152. package/Tests/UI/Utils/UserProjectsModelAPI.test.ts +714 -0
  153. package/Tests/Utils/Dashboard/Components/DashboardComponentsUtil.test.ts +120 -0
  154. package/Tests/Utils/Dashboard/DashboardNetworkMapComponent.test.ts +327 -0
  155. package/Tests/Utils/TeamMembersByProject.test.ts +655 -0
  156. package/Types/Dashboard/DashboardComponentType.ts +1 -0
  157. package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +1 -0
  158. package/Types/Dashboard/DashboardComponents/DashboardNetworkMapComponent.ts +40 -0
  159. package/Types/Dashboard/DashboardTemplates.ts +397 -0
  160. package/Types/Database/BigIntColumnTransformer.ts +74 -0
  161. package/Types/Database/ColumnLength.ts +9 -1
  162. package/Types/Database/DatabaseProperty.ts +26 -0
  163. package/Types/Database/NumericColumnValue.ts +128 -0
  164. package/Types/Database/TableColumn.ts +11 -0
  165. package/Types/Database/UnsynchronizedIndex.ts +48 -0
  166. package/Types/Decimal.ts +16 -4
  167. package/Types/HashedString.ts +139 -4
  168. package/Types/Permission.ts +48 -0
  169. package/Types/Port.ts +16 -4
  170. package/UI/Components/CustomFields/CustomFieldsDetail.tsx +85 -11
  171. package/UI/Components/LogsViewer/useLiveLogsRefresh.ts +86 -0
  172. package/UI/Components/LogsViewer/useLogsHistogram.ts +113 -0
  173. package/UI/Components/Navbar/NavBar.tsx +12 -2
  174. package/UI/Components/Navbar/NavBarMenuModal.tsx +19 -7
  175. package/UI/Utils/ModelAPI/UserProjectsModelAPI.ts +257 -0
  176. package/Utils/Dashboard/Components/DashboardNetworkMapComponent.ts +136 -0
  177. package/Utils/Dashboard/Components/Index.ts +7 -0
  178. package/Utils/TeamMembersByProject.ts +237 -0
  179. package/build/dist/Models/DatabaseModels/CephCluster.js +16 -1
  180. package/build/dist/Models/DatabaseModels/CephCluster.js.map +1 -1
  181. package/build/dist/Models/DatabaseModels/CodeRepository.js +14 -6
  182. package/build/dist/Models/DatabaseModels/CodeRepository.js.map +1 -1
  183. package/build/dist/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js +12 -0
  184. package/build/dist/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js.map +1 -1
  185. package/build/dist/Models/DatabaseModels/DockerHost.js +16 -1
  186. package/build/dist/Models/DatabaseModels/DockerHost.js.map +1 -1
  187. package/build/dist/Models/DatabaseModels/GlobalOidcProject.js +16 -1
  188. package/build/dist/Models/DatabaseModels/GlobalOidcProject.js.map +1 -1
  189. package/build/dist/Models/DatabaseModels/GlobalSsoProject.js +16 -1
  190. package/build/dist/Models/DatabaseModels/GlobalSsoProject.js.map +1 -1
  191. package/build/dist/Models/DatabaseModels/Index.js +2 -0
  192. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  193. package/build/dist/Models/DatabaseModels/IoTFleet.js +16 -1
  194. package/build/dist/Models/DatabaseModels/IoTFleet.js.map +1 -1
  195. package/build/dist/Models/DatabaseModels/KubernetesCluster.js +16 -1
  196. package/build/dist/Models/DatabaseModels/KubernetesCluster.js.map +1 -1
  197. package/build/dist/Models/DatabaseModels/LogDropFilter.js +9 -20
  198. package/build/dist/Models/DatabaseModels/LogDropFilter.js.map +1 -1
  199. package/build/dist/Models/DatabaseModels/NetworkDevice.js +16 -1
  200. package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
  201. package/build/dist/Models/DatabaseModels/NetworkInterface.js +16 -1
  202. package/build/dist/Models/DatabaseModels/NetworkInterface.js.map +1 -1
  203. package/build/dist/Models/DatabaseModels/Project.js +16 -2
  204. package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
  205. package/build/dist/Models/DatabaseModels/ProxmoxCluster.js +16 -1
  206. package/build/dist/Models/DatabaseModels/ProxmoxCluster.js.map +1 -1
  207. package/build/dist/Models/DatabaseModels/Service.js +28 -1
  208. package/build/dist/Models/DatabaseModels/Service.js.map +1 -1
  209. package/build/dist/Models/DatabaseModels/StatusPageMonitorRule.js +925 -0
  210. package/build/dist/Models/DatabaseModels/StatusPageMonitorRule.js.map +1 -0
  211. package/build/dist/Models/DatabaseModels/StatusPagePrivateUser.js +32 -0
  212. package/build/dist/Models/DatabaseModels/StatusPagePrivateUser.js.map +1 -1
  213. package/build/dist/Models/DatabaseModels/StatusPageResource.js +72 -0
  214. package/build/dist/Models/DatabaseModels/StatusPageResource.js.map +1 -1
  215. package/build/dist/Models/DatabaseModels/TraceDropFilter.js +9 -20
  216. package/build/dist/Models/DatabaseModels/TraceDropFilter.js.map +1 -1
  217. package/build/dist/Models/DatabaseModels/User.js +32 -0
  218. package/build/dist/Models/DatabaseModels/User.js.map +1 -1
  219. package/build/dist/Server/API/AIAgentDataAPI.js +21 -2
  220. package/build/dist/Server/API/AIAgentDataAPI.js.map +1 -1
  221. package/build/dist/Server/API/BaseAPI.js +11 -1
  222. package/build/dist/Server/API/BaseAPI.js.map +1 -1
  223. package/build/dist/Server/API/DashboardAPI.js +343 -10
  224. package/build/dist/Server/API/DashboardAPI.js.map +1 -1
  225. package/build/dist/Server/API/GitHubAPI.js +94 -167
  226. package/build/dist/Server/API/GitHubAPI.js.map +1 -1
  227. package/build/dist/Server/API/UserAPI.js +187 -2
  228. package/build/dist/Server/API/UserAPI.js.map +1 -1
  229. package/build/dist/Server/EnvironmentConfig.js +34 -4
  230. package/build/dist/Server/EnvironmentConfig.js.map +1 -1
  231. package/build/dist/Server/Infrastructure/GlobalCache.js +120 -0
  232. package/build/dist/Server/Infrastructure/GlobalCache.js.map +1 -1
  233. package/build/dist/Server/Infrastructure/Postgres/DataSourceOptions.js +5 -3
  234. package/build/dist/Server/Infrastructure/Postgres/DataSourceOptions.js.map +1 -1
  235. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786005052769-AddStatusPageMonitorRule.js +48 -0
  236. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786005052769-AddStatusPageMonitorRule.js.map +1 -0
  237. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786018109307-AddPerUserPasswordSalt.js +14 -0
  238. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786018109307-AddPerUserPasswordSalt.js.map +1 -0
  239. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786023262402-WidenHashedStringColumnsForScrypt.js +59 -0
  240. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786023262402-WidenHashedStringColumnsForScrypt.js.map +1 -0
  241. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786100000000-RestoreServiceLowerNameIndex.js +93 -0
  242. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786100000000-RestoreServiceLowerNameIndex.js.map +1 -0
  243. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786200000000-RestoreDroppedUniqueIndexes.js +101 -0
  244. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786200000000-RestoreDroppedUniqueIndexes.js.map +1 -0
  245. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786300000000-QuarantineUnboundGitHubInstallations.js +66 -0
  246. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786300000000-QuarantineUnboundGitHubInstallations.js.map +1 -0
  247. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +12 -0
  248. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  249. package/build/dist/Server/Services/AlertStateTimelineService.js +19 -0
  250. package/build/dist/Server/Services/AlertStateTimelineService.js.map +1 -1
  251. package/build/dist/Server/Services/AnalyticsDatabaseService.js +57 -1
  252. package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
  253. package/build/dist/Server/Services/CephClusterService.js +26 -76
  254. package/build/dist/Server/Services/CephClusterService.js.map +1 -1
  255. package/build/dist/Server/Services/CloudResourceService.js +23 -73
  256. package/build/dist/Server/Services/CloudResourceService.js.map +1 -1
  257. package/build/dist/Server/Services/CodeRepositoryService.js +90 -2
  258. package/build/dist/Server/Services/CodeRepositoryService.js.map +1 -1
  259. package/build/dist/Server/Services/DatabaseService.js +246 -2
  260. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  261. package/build/dist/Server/Services/DockerHostService.js +19 -69
  262. package/build/dist/Server/Services/DockerHostService.js.map +1 -1
  263. package/build/dist/Server/Services/DockerSwarmClusterService.js +27 -78
  264. package/build/dist/Server/Services/DockerSwarmClusterService.js.map +1 -1
  265. package/build/dist/Server/Services/HostService.js +58 -102
  266. package/build/dist/Server/Services/HostService.js.map +1 -1
  267. package/build/dist/Server/Services/IncidentStateTimelineService.js +19 -0
  268. package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
  269. package/build/dist/Server/Services/Index.js +2 -0
  270. package/build/dist/Server/Services/Index.js.map +1 -1
  271. package/build/dist/Server/Services/IoTFleetService.js +19 -69
  272. package/build/dist/Server/Services/IoTFleetService.js.map +1 -1
  273. package/build/dist/Server/Services/KubernetesClusterService.js +17 -68
  274. package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
  275. package/build/dist/Server/Services/LabelService.js +42 -7
  276. package/build/dist/Server/Services/LabelService.js.map +1 -1
  277. package/build/dist/Server/Services/MetricTypeService.js +74 -0
  278. package/build/dist/Server/Services/MetricTypeService.js.map +1 -1
  279. package/build/dist/Server/Services/MonitorService.js +81 -9
  280. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  281. package/build/dist/Server/Services/MonitorStatusTimelineService.js +28 -0
  282. package/build/dist/Server/Services/MonitorStatusTimelineService.js.map +1 -1
  283. package/build/dist/Server/Services/MonitorTemplateService.js +60 -0
  284. package/build/dist/Server/Services/MonitorTemplateService.js.map +1 -1
  285. package/build/dist/Server/Services/OpenTelemetryIngestService.js +155 -25
  286. package/build/dist/Server/Services/OpenTelemetryIngestService.js.map +1 -1
  287. package/build/dist/Server/Services/PodmanHostService.js +19 -69
  288. package/build/dist/Server/Services/PodmanHostService.js.map +1 -1
  289. package/build/dist/Server/Services/ProxmoxClusterService.js +23 -73
  290. package/build/dist/Server/Services/ProxmoxClusterService.js.map +1 -1
  291. package/build/dist/Server/Services/RumApplicationService.js +19 -70
  292. package/build/dist/Server/Services/RumApplicationService.js.map +1 -1
  293. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +20 -0
  294. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
  295. package/build/dist/Server/Services/ServerlessFunctionService.js +24 -75
  296. package/build/dist/Server/Services/ServerlessFunctionService.js.map +1 -1
  297. package/build/dist/Server/Services/ServiceService.js +236 -61
  298. package/build/dist/Server/Services/ServiceService.js.map +1 -1
  299. package/build/dist/Server/Services/StatusPageMonitorRuleEngineService.js +603 -0
  300. package/build/dist/Server/Services/StatusPageMonitorRuleEngineService.js.map +1 -0
  301. package/build/dist/Server/Services/StatusPageMonitorRuleService.js +401 -0
  302. package/build/dist/Server/Services/StatusPageMonitorRuleService.js.map +1 -0
  303. package/build/dist/Server/Services/TelemetryEntityRelationshipService.js +1 -0
  304. package/build/dist/Server/Services/TelemetryEntityRelationshipService.js.map +1 -1
  305. package/build/dist/Server/Services/TelemetryEntityService.js +1 -0
  306. package/build/dist/Server/Services/TelemetryEntityService.js.map +1 -1
  307. package/build/dist/Server/Services/UserService.js +165 -0
  308. package/build/dist/Server/Services/UserService.js.map +1 -1
  309. package/build/dist/Server/Utils/AI/Toolbox/CodeTools.js +31 -1
  310. package/build/dist/Server/Utils/AI/Toolbox/CodeTools.js.map +1 -1
  311. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +13 -0
  312. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
  313. package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js +126 -4
  314. package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js.map +1 -1
  315. package/build/dist/Server/Utils/CodeRepository/GitHub/GitHubInstallationBinding.js +136 -0
  316. package/build/dist/Server/Utils/CodeRepository/GitHub/GitHubInstallationBinding.js.map +1 -0
  317. package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js +105 -29
  318. package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js.map +1 -1
  319. package/build/dist/Server/Utils/Monitor/MonitorResource.js +56 -32
  320. package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
  321. package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js +30 -3
  322. package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js.map +1 -1
  323. package/build/dist/Server/Utils/Monitor/MonitorStepsProjectValidator.js +110 -98
  324. package/build/dist/Server/Utils/Monitor/MonitorStepsProjectValidator.js.map +1 -1
  325. package/build/dist/Server/Utils/Monitor/MonitorStepsReferenceExtractor.js +312 -0
  326. package/build/dist/Server/Utils/Monitor/MonitorStepsReferenceExtractor.js.map +1 -0
  327. package/build/dist/Server/Utils/PasswordHash.js +237 -0
  328. package/build/dist/Server/Utils/PasswordHash.js.map +1 -0
  329. package/build/dist/Server/Utils/SingleFlight.js +76 -0
  330. package/build/dist/Server/Utils/SingleFlight.js.map +1 -0
  331. package/build/dist/Server/Utils/StatusPage/MonitorRulePatternValidator.js +29 -0
  332. package/build/dist/Server/Utils/StatusPage/MonitorRulePatternValidator.js.map +1 -0
  333. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +78 -19
  334. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
  335. package/build/dist/Server/Utils/Telemetry/ResourceHeartbeat.js +160 -0
  336. package/build/dist/Server/Utils/Telemetry/ResourceHeartbeat.js.map +1 -0
  337. package/build/dist/Server/Utils/Telemetry/Telemetry.js +279 -104
  338. package/build/dist/Server/Utils/Telemetry/Telemetry.js.map +1 -1
  339. package/build/dist/Types/Dashboard/DashboardComponentType.js +1 -0
  340. package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
  341. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +1 -0
  342. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
  343. package/build/dist/Types/Dashboard/DashboardComponents/DashboardNetworkMapComponent.js +2 -0
  344. package/build/dist/Types/Dashboard/DashboardComponents/DashboardNetworkMapComponent.js.map +1 -0
  345. package/build/dist/Types/Dashboard/DashboardTemplates.js +368 -0
  346. package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
  347. package/build/dist/Types/Database/BigIntColumnTransformer.js +66 -0
  348. package/build/dist/Types/Database/BigIntColumnTransformer.js.map +1 -0
  349. package/build/dist/Types/Database/ColumnLength.js +9 -1
  350. package/build/dist/Types/Database/ColumnLength.js.map +1 -1
  351. package/build/dist/Types/Database/DatabaseProperty.js +25 -0
  352. package/build/dist/Types/Database/DatabaseProperty.js.map +1 -1
  353. package/build/dist/Types/Database/NumericColumnValue.js +97 -0
  354. package/build/dist/Types/Database/NumericColumnValue.js.map +1 -0
  355. package/build/dist/Types/Database/TableColumn.js.map +1 -1
  356. package/build/dist/Types/Database/UnsynchronizedIndex.js +46 -0
  357. package/build/dist/Types/Database/UnsynchronizedIndex.js.map +1 -0
  358. package/build/dist/Types/Decimal.js +14 -3
  359. package/build/dist/Types/Decimal.js.map +1 -1
  360. package/build/dist/Types/HashedString.js +95 -5
  361. package/build/dist/Types/HashedString.js.map +1 -1
  362. package/build/dist/Types/Permission.js +42 -0
  363. package/build/dist/Types/Permission.js.map +1 -1
  364. package/build/dist/Types/Port.js +15 -5
  365. package/build/dist/Types/Port.js.map +1 -1
  366. package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js +51 -10
  367. package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js.map +1 -1
  368. package/build/dist/UI/Components/LogsViewer/useLiveLogsRefresh.js +44 -0
  369. package/build/dist/UI/Components/LogsViewer/useLiveLogsRefresh.js.map +1 -0
  370. package/build/dist/UI/Components/LogsViewer/useLogsHistogram.js +75 -0
  371. package/build/dist/UI/Components/LogsViewer/useLogsHistogram.js.map +1 -0
  372. package/build/dist/UI/Components/Navbar/NavBar.js +3 -1
  373. package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
  374. package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +19 -7
  375. package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
  376. package/build/dist/UI/Utils/ModelAPI/UserProjectsModelAPI.js +156 -0
  377. package/build/dist/UI/Utils/ModelAPI/UserProjectsModelAPI.js.map +1 -0
  378. package/build/dist/Utils/Dashboard/Components/DashboardNetworkMapComponent.js +114 -0
  379. package/build/dist/Utils/Dashboard/Components/DashboardNetworkMapComponent.js.map +1 -0
  380. package/build/dist/Utils/Dashboard/Components/Index.js +4 -0
  381. package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
  382. package/build/dist/Utils/TeamMembersByProject.js +145 -0
  383. package/build/dist/Utils/TeamMembersByProject.js.map +1 -0
  384. package/package.json +1 -1
@@ -0,0 +1,40 @@
1
+ import ObjectID from "../../ObjectID";
2
+ import DashboardComponentType from "../DashboardComponentType";
3
+ import BaseComponent from "./DashboardBaseComponent";
4
+
5
+ /*
6
+ * The dashboard-embeddable half of the Network Map: a world map of this
7
+ * project's NetworkSites, each pinned at its own coordinates and colored by
8
+ * the monitor status rolled up onto it.
9
+ *
10
+ * It is deliberately NOT the drill-down map from Pages/NetworkSite/NetworkMap
11
+ * — that one navigates, and a dashboard tile is a picture rather than a
12
+ * place you walk around in. This widget answers one question at a glance:
13
+ * where is the network, and what is red right now.
14
+ */
15
+ export default interface DashboardNetworkMapComponent extends BaseComponent {
16
+ componentType: DashboardComponentType.NetworkMap;
17
+ componentId: ObjectID;
18
+ arguments: {
19
+ title?: string | undefined;
20
+ /*
21
+ * How many sites the widget will draw. Sites past the cap are dropped
22
+ * rather than silently merged, and the footer says so — a count that
23
+ * quietly disagrees with the Sites page is how somebody concludes a
24
+ * site has disappeared.
25
+ */
26
+ maxSites?: number | undefined;
27
+ // Restrict the map to sites of these NetworkSiteType rows.
28
+ networkSiteTypeIds?: Array<string> | undefined;
29
+ /*
30
+ * "" / undefined — every site with coordinates.
31
+ * "down" — only sites whose rolled-up status is not operational.
32
+ * "operational" — only sites whose rolled-up status is operational.
33
+ */
34
+ statusFilter?: string | undefined;
35
+ // "map" (default) draws the world map; "list" falls back to a table.
36
+ viewMode?: "map" | "list" | undefined;
37
+ // Print each marker's site name under it when the map is not too busy.
38
+ showLabels?: boolean | undefined;
39
+ };
40
+ }
@@ -11,6 +11,7 @@ import MetricsAggregationType from "../Metrics/MetricsAggregationType";
11
11
  import IncidentMetricType from "../Incident/IncidentMetricType";
12
12
  import AlertMetricType from "../Alerts/AlertMetricType";
13
13
  import MonitorMetricType from "../Monitor/MonitorMetricType";
14
+ import MonitorType from "../Monitor/MonitorType";
14
15
  import MetricDashboardMetricType from "../Metrics/MetricDashboardMetricType";
15
16
  import { DashboardValueTrendDirection } from "./DashboardComponents/DashboardValueComponent";
16
17
 
@@ -39,6 +40,7 @@ export enum DashboardTemplateType {
39
40
  DockerSwarm = "DockerSwarm",
40
41
  Metrics = "Metrics",
41
42
  Rum = "Rum",
43
+ Network = "Network",
42
44
  }
43
45
 
44
46
  /*
@@ -165,6 +167,14 @@ export const DashboardTemplates: Array<DashboardTemplate> = [
165
167
  icon: IconProp.Cube,
166
168
  category: DashboardTemplateCategory.Infrastructure,
167
169
  },
170
+ {
171
+ type: DashboardTemplateType.Network,
172
+ name: "Network Dashboard",
173
+ description:
174
+ "Your sites on the world map, SNMP interface throughput, utilization and errors, device reachability and round-trip latency, and the monitors watching them.",
175
+ icon: IconProp.Map,
176
+ category: DashboardTemplateCategory.Infrastructure,
177
+ },
168
178
  ];
169
179
 
170
180
  /*
@@ -796,6 +806,71 @@ function createCephPoolListComponent(data: {
796
806
  };
797
807
  }
798
808
 
809
+ function createNetworkMapComponent(data: {
810
+ title: string;
811
+ top: number;
812
+ left: number;
813
+ width: number;
814
+ height: number;
815
+ maxSites?: number;
816
+ statusFilter?: string;
817
+ showLabels?: boolean;
818
+ }): DashboardBaseComponent {
819
+ return {
820
+ _type: ObjectType.DashboardComponent,
821
+ componentType: DashboardComponentType.NetworkMap,
822
+ componentId: ObjectID.generate(),
823
+ topInDashboardUnits: data.top,
824
+ leftInDashboardUnits: data.left,
825
+ widthInDashboardUnits: data.width,
826
+ heightInDashboardUnits: data.height,
827
+ /*
828
+ * A map needs room in BOTH axes — the world is roughly 2:1, so a short
829
+ * tile letterboxes it into a strip. Same floor the widget's own default
830
+ * declares (Common/Utils/Dashboard/Components/DashboardNetworkMapComponent).
831
+ */
832
+ minHeightInDashboardUnits: 4,
833
+ minWidthInDashboardUnits: 4,
834
+ arguments: {
835
+ title: data.title,
836
+ maxSites: data.maxSites ?? 250,
837
+ viewMode: "map",
838
+ showLabels: data.showLabels ?? true,
839
+ statusFilter: data.statusFilter,
840
+ },
841
+ };
842
+ }
843
+
844
+ function createMonitorListComponent(data: {
845
+ title: string;
846
+ top: number;
847
+ left: number;
848
+ width: number;
849
+ height: number;
850
+ maxRows?: number;
851
+ monitorTypes?: Array<string>;
852
+ statusFilter?: string;
853
+ }): DashboardBaseComponent {
854
+ return {
855
+ _type: ObjectType.DashboardComponent,
856
+ componentType: DashboardComponentType.MonitorList,
857
+ componentId: ObjectID.generate(),
858
+ topInDashboardUnits: data.top,
859
+ leftInDashboardUnits: data.left,
860
+ widthInDashboardUnits: data.width,
861
+ heightInDashboardUnits: data.height,
862
+ minHeightInDashboardUnits: 3,
863
+ minWidthInDashboardUnits: 6,
864
+ arguments: {
865
+ title: data.title,
866
+ maxRows: data.maxRows ?? 25,
867
+ viewMode: "list",
868
+ monitorTypes: data.monitorTypes,
869
+ statusFilter: data.statusFilter,
870
+ },
871
+ };
872
+ }
873
+
799
874
  // -- Dashboard configs --
800
875
 
801
876
  function createMonitorDashboardConfig(): DashboardViewConfig {
@@ -3411,6 +3486,326 @@ function createCephDashboardConfig(): DashboardViewConfig {
3411
3486
  };
3412
3487
  }
3413
3488
 
3489
+ function createNetworkDashboardConfig(): DashboardViewConfig {
3490
+ /*
3491
+ * Layout and metric notes:
3492
+ *
3493
+ * - The map reads the Postgres NetworkSite inventory rather than a metric
3494
+ * series, so its markers are true right now — the same reasoning the
3495
+ * Kubernetes / Ceph templates use for their inventory widgets.
3496
+ *
3497
+ * - EVERY metric widget here queries an `oneuptime.monitor.snmp.*` series,
3498
+ * and those are emitted by exactly one code path:
3499
+ * NetworkDeviceMetricUtil.saveWalkMetrics, off a network device walk.
3500
+ * That is deliberate and it is the constraint the rest of this template
3501
+ * is built around.
3502
+ *
3503
+ * The obvious tiles to reach for — uptime, round-trip time, packet loss,
3504
+ * jitter — do NOT belong here, however much a network dashboard wants
3505
+ * them. `oneuptime.monitor.online` and `oneuptime.monitor.response.time`
3506
+ * are emitted by MonitorMetricUtil for EVERY probeable monitor in the
3507
+ * project, and packet loss and jitter come from Ping/IP monitors. A tile
3508
+ * titled "Round-trip Time" on a network dashboard that silently averages
3509
+ * every website check in the project is worse than no tile: it is a
3510
+ * number a reader will act on. Device reachability is on this dashboard
3511
+ * as the Network Device monitor list, which IS correctly scoped.
3512
+ *
3513
+ * - Because every series here comes from the device walk, every series
3514
+ * carries `deviceName`, and the per-interface ones also carry
3515
+ * `interfaceName` — so both template variables bind to something real on
3516
+ * every widget. Those keys are BARE, not `resource.`-prefixed; see
3517
+ * NetworkDeviceMetricUtil.buildDeviceMetricRow.
3518
+ *
3519
+ * - No widget aggregates with Sum. The interface series are already
3520
+ * per-second RATES, and the Value tile reduces across time buckets — so
3521
+ * a summed rate grows with the dashboard's time range rather than
3522
+ * describing the network. Max answers "how bad did it get", Avg answers
3523
+ * "what is normal"; both are range-independent.
3524
+ *
3525
+ * - For the same reason the in/out bit-rate charts are NOT
3526
+ * transformAsRate'd the way the Ceph template's cumulative
3527
+ * ceph_pool_*_bytes counters are. They are already rates; rate-of-a-rate
3528
+ * plots noise around zero.
3529
+ */
3530
+ const components: Array<DashboardBaseComponent> = [
3531
+ // Row 0: Title
3532
+ createTextComponent({
3533
+ text: "Network Dashboard",
3534
+ top: 0,
3535
+ left: 0,
3536
+ width: 12,
3537
+ height: 1,
3538
+ isBold: true,
3539
+ }),
3540
+
3541
+ /*
3542
+ * Rows 1-5: where the network IS, next to how it is doing. The map is
3543
+ * the subject and takes two thirds of the width; the column beside it
3544
+ * is the numbers a reader checks without leaving the picture.
3545
+ */
3546
+ createNetworkMapComponent({
3547
+ title: "Sites",
3548
+ top: 1,
3549
+ left: 0,
3550
+ width: 8,
3551
+ height: 5,
3552
+ maxSites: 250,
3553
+ }),
3554
+ /*
3555
+ * SnmpInterfaceOperStatus is emitted as 0/1 per interface, so Avg is the
3556
+ * FRACTION of interfaces currently up — in [0, 1], not a percent.
3557
+ * Labelled "(avg)" for the same reason the Monitor template labels its
3558
+ * uptime tile that way rather than printing a misleading "%".
3559
+ */
3560
+ createValueComponent({
3561
+ title: "Interfaces Up (avg)",
3562
+ top: 1,
3563
+ left: 8,
3564
+ width: 4,
3565
+ metricConfig: {
3566
+ metricName: MonitorMetricType.SnmpInterfaceOperStatus,
3567
+ aggregationType: MetricsAggregationType.Avg,
3568
+ },
3569
+ trendDirection: DashboardValueTrendDirection.HigherIsBetter,
3570
+ }),
3571
+ createValueComponent({
3572
+ title: "Avg Interface Utilization",
3573
+ top: 2,
3574
+ left: 8,
3575
+ width: 4,
3576
+ metricConfig: {
3577
+ metricName: MonitorMetricType.SnmpInterfaceUtilizationPercent,
3578
+ aggregationType: MetricsAggregationType.Avg,
3579
+ },
3580
+ trendDirection: DashboardValueTrendDirection.HigherIsWorse,
3581
+ }),
3582
+ /*
3583
+ * Max, not Sum: this is "how bad did the worst port get", which is what
3584
+ * an operator acts on. Summing a per-second error rate across every
3585
+ * interface and every time bucket produces a number that doubles when
3586
+ * you widen the time picker.
3587
+ */
3588
+ createValueComponent({
3589
+ title: "Worst Interface Errors/sec",
3590
+ top: 3,
3591
+ left: 8,
3592
+ width: 4,
3593
+ metricConfig: {
3594
+ metricName: MonitorMetricType.SnmpInterfaceErrorsPerSecond,
3595
+ aggregationType: MetricsAggregationType.Max,
3596
+ },
3597
+ trendDirection: DashboardValueTrendDirection.HigherIsWorse,
3598
+ }),
3599
+ createValueComponent({
3600
+ title: "Peak Inbound",
3601
+ top: 4,
3602
+ left: 8,
3603
+ width: 4,
3604
+ metricConfig: {
3605
+ metricName: MonitorMetricType.SnmpInterfaceInBitsPerSecond,
3606
+ aggregationType: MetricsAggregationType.Max,
3607
+ },
3608
+ }),
3609
+ createValueComponent({
3610
+ title: "Peak Outbound",
3611
+ top: 5,
3612
+ left: 8,
3613
+ width: 4,
3614
+ metricConfig: {
3615
+ metricName: MonitorMetricType.SnmpInterfaceOutBitsPerSecond,
3616
+ aggregationType: MetricsAggregationType.Max,
3617
+ },
3618
+ }),
3619
+
3620
+ // Row 6: Section header
3621
+ createTextComponent({
3622
+ text: "Interface Throughput",
3623
+ top: 6,
3624
+ left: 0,
3625
+ width: 12,
3626
+ height: 1,
3627
+ isBold: true,
3628
+ }),
3629
+
3630
+ /*
3631
+ * Rows 7-9: throughput, split per interface. Grouping by
3632
+ * `interfaceName` is what turns one flat line into one line per uplink,
3633
+ * which is the only form in which "is a link saturated" is answerable —
3634
+ * an ungrouped chart averages a saturated uplink with nine idle access
3635
+ * ports and reports that everything is fine.
3636
+ */
3637
+ createChartComponent({
3638
+ title: "Inbound by Interface",
3639
+ chartType: DashboardChartType.Area,
3640
+ top: 7,
3641
+ left: 0,
3642
+ width: 6,
3643
+ height: 3,
3644
+ metricConfig: {
3645
+ metricName: MonitorMetricType.SnmpInterfaceInBitsPerSecond,
3646
+ aggregationType: MetricsAggregationType.Avg,
3647
+ legend: "Inbound",
3648
+ legendUnit: "bps",
3649
+ groupByAttributeKeys: ["interfaceName"],
3650
+ },
3651
+ }),
3652
+ createChartComponent({
3653
+ title: "Outbound by Interface",
3654
+ chartType: DashboardChartType.Area,
3655
+ top: 7,
3656
+ left: 6,
3657
+ width: 6,
3658
+ height: 3,
3659
+ metricConfig: {
3660
+ metricName: MonitorMetricType.SnmpInterfaceOutBitsPerSecond,
3661
+ aggregationType: MetricsAggregationType.Avg,
3662
+ legend: "Outbound",
3663
+ legendUnit: "bps",
3664
+ groupByAttributeKeys: ["interfaceName"],
3665
+ },
3666
+ }),
3667
+
3668
+ // Row 10: Section header
3669
+ createTextComponent({
3670
+ text: "Utilization & Errors",
3671
+ top: 10,
3672
+ left: 0,
3673
+ width: 12,
3674
+ height: 1,
3675
+ isBold: true,
3676
+ }),
3677
+
3678
+ /*
3679
+ * Rows 11-13: the gauge an operator watches during an incident, the
3680
+ * error-rate gauge that leads it, and the per-interface error breakdown
3681
+ * that says WHICH port to look at.
3682
+ */
3683
+ createGaugeComponent({
3684
+ title: "Peak Interface Utilization",
3685
+ top: 11,
3686
+ left: 0,
3687
+ width: 3,
3688
+ height: 3,
3689
+ minValue: 0,
3690
+ maxValue: 100,
3691
+ warningThreshold: 70,
3692
+ criticalThreshold: 90,
3693
+ metricConfig: {
3694
+ metricName: MonitorMetricType.SnmpInterfaceUtilizationPercent,
3695
+ aggregationType: MetricsAggregationType.Max,
3696
+ },
3697
+ }),
3698
+ createGaugeComponent({
3699
+ title: "Interface Error Rate",
3700
+ top: 11,
3701
+ left: 3,
3702
+ width: 3,
3703
+ height: 3,
3704
+ /*
3705
+ * A healthy Ethernet port errors essentially never, so the scale is
3706
+ * deliberately tight: a sustained one error per second is already a
3707
+ * cable, duplex or optic problem worth a ticket, and five is a link
3708
+ * on its way out. A 0-100 scale like the utilization gauge next to it
3709
+ * would render every real fault as a flat line on the floor.
3710
+ */
3711
+ minValue: 0,
3712
+ maxValue: 10,
3713
+ warningThreshold: 1,
3714
+ criticalThreshold: 5,
3715
+ metricConfig: {
3716
+ metricName: MonitorMetricType.SnmpInterfaceErrorsPerSecond,
3717
+ aggregationType: MetricsAggregationType.Avg,
3718
+ },
3719
+ }),
3720
+ createChartComponent({
3721
+ title: "Interface Errors by Interface",
3722
+ chartType: DashboardChartType.Bar,
3723
+ top: 11,
3724
+ left: 6,
3725
+ width: 6,
3726
+ height: 3,
3727
+ metricConfig: {
3728
+ metricName: MonitorMetricType.SnmpInterfaceErrorsPerSecond,
3729
+ aggregationType: MetricsAggregationType.Avg,
3730
+ legend: "Errors/sec",
3731
+ groupByAttributeKeys: ["interfaceName"],
3732
+ },
3733
+ }),
3734
+
3735
+ // Row 14: Section header
3736
+ createTextComponent({
3737
+ text: "Devices & Monitors",
3738
+ top: 14,
3739
+ left: 0,
3740
+ width: 12,
3741
+ height: 1,
3742
+ isBold: true,
3743
+ }),
3744
+
3745
+ /*
3746
+ * Rows 15-18: utilization per interface, beside the monitors that page
3747
+ * somebody when a device stops answering. The list is pinned to Network
3748
+ * Device monitors — an unfiltered monitor list on a network dashboard is
3749
+ * just the Monitors page with fewer columns — and it is also this
3750
+ * dashboard's reachability view, correctly scoped in a way a shared
3751
+ * uptime metric could never be.
3752
+ */
3753
+ createChartComponent({
3754
+ title: "Utilization by Interface",
3755
+ chartType: DashboardChartType.Line,
3756
+ top: 15,
3757
+ left: 0,
3758
+ width: 6,
3759
+ height: 4,
3760
+ metricConfig: {
3761
+ metricName: MonitorMetricType.SnmpInterfaceUtilizationPercent,
3762
+ aggregationType: MetricsAggregationType.Avg,
3763
+ legend: "Utilization",
3764
+ legendUnit: "%",
3765
+ groupByAttributeKeys: ["interfaceName"],
3766
+ },
3767
+ }),
3768
+ createMonitorListComponent({
3769
+ title: "Network Device Monitors",
3770
+ top: 15,
3771
+ left: 6,
3772
+ width: 6,
3773
+ height: 4,
3774
+ maxRows: 25,
3775
+ monitorTypes: [MonitorType.NetworkDevice],
3776
+ }),
3777
+ ];
3778
+
3779
+ /*
3780
+ * Network device metrics are stored with BARE attribute keys
3781
+ * (`deviceName`, `interfaceName`) rather than the OTel `resource.` prefix
3782
+ * — see NetworkDeviceMetricUtil.buildDeviceMetricRow — so the variables
3783
+ * bind to the bare keys. Both are multi-select: comparing two uplinks, or
3784
+ * two branch routers, is the normal use rather than the exception.
3785
+ */
3786
+ const variables: Array<DashboardVariable> = [
3787
+ createTelemetryAttributeVariable({
3788
+ name: "device",
3789
+ label: "Device",
3790
+ attributeKey: "deviceName",
3791
+ isMultiSelect: true,
3792
+ }),
3793
+ createTelemetryAttributeVariable({
3794
+ name: "interface",
3795
+ label: "Interface",
3796
+ attributeKey: "interfaceName",
3797
+ isMultiSelect: true,
3798
+ }),
3799
+ ];
3800
+
3801
+ return {
3802
+ _type: ObjectType.DashboardViewConfig,
3803
+ components,
3804
+ variables,
3805
+ heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 19),
3806
+ };
3807
+ }
3808
+
3414
3809
  export function getTemplateConfig(
3415
3810
  type: DashboardTemplateType,
3416
3811
  ): DashboardViewConfig | null {
@@ -3437,6 +3832,8 @@ export function getTemplateConfig(
3437
3832
  return createMetricsDashboardConfig();
3438
3833
  case DashboardTemplateType.Rum:
3439
3834
  return createRumDashboardConfig();
3835
+ case DashboardTemplateType.Network:
3836
+ return createNetworkDashboardConfig();
3440
3837
  case DashboardTemplateType.Blank:
3441
3838
  return null;
3442
3839
  }
@@ -0,0 +1,74 @@
1
+ import { ValueTransformer } from "typeorm/decorator/options/ValueTransformer";
2
+
3
+ /*
4
+ * Round-trip for columns declared `ColumnType.BigPositiveNumber` (Postgres
5
+ * bigint) that the rest of the codebase wants to read as a plain number.
6
+ *
7
+ * `to` MUST pass `undefined` through untouched. TypeORM runs the column
8
+ * transformer *before* it decides whether the column was supplied at all:
9
+ *
10
+ * InsertQueryBuilder.createColumnValueExpression
11
+ * -> driver.preparePersistentValue (applies transformer.to)
12
+ * -> if (value === undefined) expression += "DEFAULT"
13
+ *
14
+ * so a transformer that folds `undefined` into `null` rewrites "the caller
15
+ * did not set this column" into "the caller explicitly set it to NULL". The
16
+ * column's DEFAULT is then never reached. On a `NOT NULL DEFAULT 0` counter
17
+ * that is a 500 on *every* insert:
18
+ *
19
+ * null value in column "droppedCount" of relation "LogDropFilter"
20
+ * violates not-null constraint
21
+ *
22
+ * which is exactly what shipped for the drop-filter drop counters. Nothing
23
+ * in the product sets those counters on create — they are ingest-owned — so
24
+ * every drop filter created through the dashboard failed.
25
+ *
26
+ * `from` exists because node-postgres hands bigint back as a string (it does
27
+ * not fit a JS number in the general case). Every value we store here is a
28
+ * record counter well inside Number.MAX_SAFE_INTEGER, and the UI renders it
29
+ * as a number, so normalize once here rather than making each reader
30
+ * remember.
31
+ */
32
+ export function getBigIntDatabaseTransformer(): ValueTransformer {
33
+ return {
34
+ to: (value: number | null | undefined): string | null | undefined => {
35
+ /*
36
+ * Not a mistake and not the same as `null`: see the note above. This
37
+ * is the branch that lets the column DEFAULT apply.
38
+ */
39
+ if (value === undefined) {
40
+ return undefined;
41
+ }
42
+
43
+ if (value === null) {
44
+ return null;
45
+ }
46
+
47
+ if (typeof value !== "number" || !Number.isFinite(value)) {
48
+ /*
49
+ * `Math.trunc(NaN).toString()` is the string "NaN", which Postgres
50
+ * rejects with a syntax error that names neither the column nor the
51
+ * caller. Null at least fails as a constraint violation on the
52
+ * column it belongs to.
53
+ */
54
+ return null;
55
+ }
56
+
57
+ return Math.trunc(value).toString();
58
+ },
59
+
60
+ from: (value: string | number | null | undefined): number | null => {
61
+ if (value === null || value === undefined) {
62
+ return null;
63
+ }
64
+
65
+ if (typeof value === "number") {
66
+ return Number.isFinite(value) ? value : null;
67
+ }
68
+
69
+ const parsed: number = parseInt(value, 10);
70
+
71
+ return isNaN(parsed) ? null : parsed;
72
+ },
73
+ };
74
+ }
@@ -12,7 +12,15 @@ enum ColumnLength {
12
12
  Password = 500,
13
13
  ShortURL = 100,
14
14
  ShortText = 100,
15
- HashedString = 64,
15
+ /*
16
+ * Wide enough for a self-describing password hash, not just a bare digest.
17
+ * User passwords are stored as `scrypt$N=...,r=...,p=...$<64 hex>` (~90
18
+ * characters) so the cost parameters travel with the hash and can be
19
+ * raised later without a migration. The columns that still store a plain
20
+ * SHA-256 digest — session refresh tokens, master passwords — simply do
21
+ * not use the extra room.
22
+ */
23
+ HashedString = 255,
16
24
  Phone = 30,
17
25
  OTP = 8,
18
26
  }
@@ -45,6 +45,32 @@ export default class DatabaseProperty extends SerializableObject {
45
45
  public static getDatabaseTransformer(): ValueTransformer {
46
46
  return {
47
47
  to: (value: any) => {
48
+ /*
49
+ * `undefined` means "the caller did not set this column", and it has
50
+ * to stay distinguishable from `null` all the way into TypeORM.
51
+ *
52
+ * TypeORM runs the transformer BEFORE deciding whether the column
53
+ * was supplied:
54
+ *
55
+ * InsertQueryBuilder.createColumnValueExpression
56
+ * -> driver.preparePersistentValue (runs this function)
57
+ * -> if (value === undefined) expression += "DEFAULT"
58
+ *
59
+ * so answering `null` here (which every `toDatabase` does for a
60
+ * falsy value) rewrites an omitted column into an explicit NULL and
61
+ * makes the column's DEFAULT unreachable. On a NOT NULL column with
62
+ * a default — an on-call layer's `rotation`, a drop filter's
63
+ * `droppedCount` — that is a not-null constraint violation, i.e. an
64
+ * HTTP 500, on every create that leaves the column alone.
65
+ *
66
+ * UPDATE is unaffected either way: UpdateQueryBuilder strips
67
+ * undefined properties before the transformer ever sees them
68
+ * ("it doesn't make sense to update undefined properties").
69
+ */
70
+ if (value === undefined) {
71
+ return undefined;
72
+ }
73
+
48
74
  return this._toDatabase(value);
49
75
  },
50
76
  from: (value: any) => {