@oneuptime/common 14.0.3 → 14.0.6

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 (663) hide show
  1. package/Models/DatabaseModels/Alert.ts +55 -0
  2. package/Models/DatabaseModels/DatabaseServer.ts +1650 -0
  3. package/Models/DatabaseModels/DatabaseServerEndpoint.ts +540 -0
  4. package/Models/DatabaseModels/DatabaseServerFeed.ts +625 -0
  5. package/Models/DatabaseModels/DatabaseServerLabelRule.ts +514 -0
  6. package/Models/DatabaseModels/DatabaseServerOwnerRule.ts +596 -0
  7. package/Models/DatabaseModels/DatabaseServerOwnerTeam.ts +491 -0
  8. package/Models/DatabaseModels/DatabaseServerOwnerUser.ts +490 -0
  9. package/Models/DatabaseModels/Incident.ts +55 -0
  10. package/Models/DatabaseModels/Index.ts +16 -0
  11. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +26 -0
  12. package/Models/DatabaseModels/ScheduledMaintenance.ts +55 -0
  13. package/Models/DatabaseModels/TelemetryException.ts +2 -0
  14. package/Models/DatabaseModels/UserProjectSsoConsent.ts +146 -0
  15. package/Server/Infrastructure/Postgres/SchemaMigrations/1795000000000-AddDatabaseServerTables.ts +673 -0
  16. package/Server/Infrastructure/Postgres/SchemaMigrations/1795100000000-AddUserProjectSsoConsent.ts +51 -0
  17. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
  18. package/Server/Middleware/MultipartFormData.ts +1 -1
  19. package/Server/Middleware/TelemetryIngest.ts +15 -8
  20. package/Server/Services/AlertReminderRuleService.ts +100 -24
  21. package/Server/Services/DatabaseServerEndpointService.ts +895 -0
  22. package/Server/Services/DatabaseServerFeedService.ts +128 -0
  23. package/Server/Services/DatabaseServerLabelRuleEngineService.ts +340 -0
  24. package/Server/Services/DatabaseServerLabelRuleService.ts +14 -0
  25. package/Server/Services/DatabaseServerOwnerRuleEngineService.ts +425 -0
  26. package/Server/Services/DatabaseServerOwnerRuleService.ts +14 -0
  27. package/Server/Services/DatabaseServerOwnerTeamService.ts +180 -0
  28. package/Server/Services/DatabaseServerOwnerUserService.ts +173 -0
  29. package/Server/Services/DatabaseServerService.ts +4546 -0
  30. package/Server/Services/DatabaseService.ts +14 -8
  31. package/Server/Services/DockerResourceService.ts +43 -2
  32. package/Server/Services/IncidentReminderRuleService.ts +103 -23
  33. package/Server/Services/Index.ts +16 -0
  34. package/Server/Services/InventoryItemService.ts +113 -5
  35. package/Server/Services/IoTDeviceService.ts +145 -37
  36. package/Server/Services/MetricService.ts +1 -1
  37. package/Server/Services/OpenTelemetryIngestService.ts +19 -0
  38. package/Server/Services/PodmanResourceService.ts +43 -2
  39. package/Server/Services/ScheduledMaintenanceReminderRuleService.ts +107 -23
  40. package/Server/Services/ServiceService.ts +1 -1
  41. package/Server/Services/TelemetryUsageBillingService.ts +29 -2
  42. package/Server/Services/UserProjectSsoConsentService.ts +74 -0
  43. package/Server/Services/UserService.ts +14 -1
  44. package/Server/Types/Database/Permissions/OwnerTableRegistry.ts +18 -0
  45. package/Server/Types/Database/QueryHelper.ts +84 -2
  46. package/Server/Utils/AI/Toolbox/MetricTools.ts +13 -2
  47. package/Server/Utils/AI/Toolbox/ResourceTools.ts +81 -2
  48. package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +1 -1
  49. package/Server/Utils/Database/AffectedResourceRelations.ts +6 -0
  50. package/Server/Utils/Monitor/Criteria/CompareCriteria.ts +33 -0
  51. package/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.ts +192 -9
  52. package/Server/Utils/Monitor/MonitorAlert.ts +28 -1
  53. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +2264 -755
  54. package/Server/Utils/Monitor/MonitorIncident.ts +28 -1
  55. package/Server/Utils/Monitor/MonitorMaintenanceSuppression.ts +268 -6
  56. package/Server/Utils/Monitor/MonitorResource.ts +47 -11
  57. package/Server/Utils/Monitor/MonitorResourceContext.ts +1 -0
  58. package/Server/Utils/Monitor/MonitorStepResourceIdentity.ts +239 -21
  59. package/Server/Utils/Monitor/PerSeriesResolutionRootCause.ts +43 -0
  60. package/Server/Utils/Monitor/SeriesResourceLabels.ts +291 -0
  61. package/Server/Utils/Monitor/SeriesResourceLinker.ts +111 -12
  62. package/Server/Utils/Rules/RuleRun/RuleRunRegistry.ts +25 -0
  63. package/Server/Utils/StartServer.ts +26 -6
  64. package/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.ts +2 -0
  65. package/Server/Utils/Telemetry/DatabaseEndpointDiscovery.ts +688 -0
  66. package/Server/Utils/Telemetry/EntityRegistry.ts +5 -1
  67. package/Server/Utils/Telemetry/LogExceptionExtractor.ts +18 -1
  68. package/Server/Utils/Telemetry/ResourceEntityFilter.ts +175 -12
  69. package/Server/Utils/Telemetry/ResourceFacetResolver.ts +12 -0
  70. package/Server/Utils/Telemetry/ServiceDependencyDiscovery.ts +606 -36
  71. package/Server/Utils/Telemetry/Telemetry.ts +16 -0
  72. package/Server/Utils/Telemetry/TelemetryEntity.ts +22 -22
  73. package/Server/Utils/Telemetry/TelemetryIngestionKeyGuard.ts +16 -10
  74. package/Tests/App/Accounts/SignedInRedirect.test.tsx +241 -0
  75. package/Tests/App/AdminDashboard/AdminHeaderSmallScreens.test.tsx +221 -4
  76. package/Tests/App/Dashboard/AIInsightsResourcePageContext.test.ts +42 -0
  77. package/Tests/App/Dashboard/AffectedResourcesDisplay.test.tsx +100 -0
  78. package/Tests/App/Dashboard/AffectedResourcesPicker.test.tsx +86 -0
  79. package/Tests/App/Dashboard/AffectedResourcesPickerHiddenTypes.test.tsx +2 -0
  80. package/Tests/App/Dashboard/AffectedResourcesSummaryStep.test.tsx +19 -0
  81. package/Tests/App/Dashboard/BreadcrumbCoverage.test.tsx +14 -0
  82. package/Tests/App/Dashboard/CorrelateFilterBuilder.test.tsx +26 -1
  83. package/Tests/App/Dashboard/DashboardAppSsoError.test.tsx +501 -0
  84. package/Tests/App/Dashboard/DashboardHeaderRequests.test.tsx +64 -1
  85. package/Tests/App/Dashboard/DashboardHeaderSmallScreens.test.tsx +178 -18
  86. package/Tests/App/Dashboard/DashboardMasterPageSsoRedirect.test.tsx +444 -0
  87. package/Tests/App/Dashboard/DashboardNavBarForeignHiddenRule.test.tsx +573 -0
  88. package/Tests/App/Dashboard/DatabaseChartAxes.test.tsx +431 -0
  89. package/Tests/App/Dashboard/DatabaseContainerDetailBadge.test.tsx +249 -0
  90. package/Tests/App/Dashboard/DatabaseDashboardE2EFixes.test.ts +681 -0
  91. package/Tests/App/Dashboard/DatabaseDocumentationMarkdown.test.ts +1801 -0
  92. package/Tests/App/Dashboard/DatabaseFleetSummaryRefresh.test.tsx +280 -0
  93. package/Tests/App/Dashboard/DatabaseFormHelpers.test.tsx +321 -0
  94. package/Tests/App/Dashboard/DatabaseMetricMonitorLink.test.tsx +795 -0
  95. package/Tests/App/Dashboard/DatabaseOverviewHeader.test.tsx +580 -0
  96. package/Tests/App/Dashboard/DatabaseRecommendationsEngineMetrics.test.ts +270 -0
  97. package/Tests/App/Dashboard/DatabaseServerComponents.test.tsx +1486 -0
  98. package/Tests/App/Dashboard/DatabaseServerEngineMetricsFilter.test.ts +223 -0
  99. package/Tests/App/Dashboard/DatabaseServerPresentation.test.ts +435 -0
  100. package/Tests/App/Dashboard/DatabaseServerSummary.test.ts +186 -0
  101. package/Tests/App/Dashboard/DatabaseServerTelemetryQueries.test.ts +1553 -0
  102. package/Tests/App/Dashboard/DatabaseTableTruncation.test.tsx +326 -0
  103. package/Tests/App/Dashboard/DatabaseTelemetryScope.test.ts +512 -0
  104. package/Tests/App/Dashboard/DatabaseTelemetryTabs.test.tsx +774 -0
  105. package/Tests/App/Dashboard/DatabaseViewLayout.test.tsx +233 -0
  106. package/Tests/App/Dashboard/DatabaseWorkloadBadge.test.tsx +972 -0
  107. package/Tests/App/Dashboard/DiscoveryReviewInventoryRefresh.test.tsx +5 -0
  108. package/Tests/App/Dashboard/DiscoveryReviewUnnamedHostHint.test.tsx +1061 -0
  109. package/Tests/App/Dashboard/EventOverlayScope.test.ts +147 -0
  110. package/Tests/App/Dashboard/EventOverlayScopeHook.test.tsx +1 -0
  111. package/Tests/App/Dashboard/LogsResourceFacetChips.test.tsx +1 -0
  112. package/Tests/App/Dashboard/MetricsViewerDrillDown.test.tsx +310 -0
  113. package/Tests/App/Dashboard/MetricsViewerEntityScopedRows.test.tsx +495 -0
  114. package/Tests/App/Dashboard/MonitorCreateFromMonitorBackedDevice.test.tsx +132 -1
  115. package/Tests/App/Dashboard/NavigationSearchKeywords.test.tsx +5 -0
  116. package/Tests/App/Dashboard/NetworkTopologyExplorerSearch.test.tsx +1267 -0
  117. package/Tests/App/Dashboard/ProductOrientation.test.tsx +4 -3
  118. package/Tests/App/Dashboard/RecommendationsLoadedContext.test.tsx +349 -0
  119. package/Tests/App/Dashboard/ResourceArchiveSettings.test.tsx +62 -0
  120. package/Tests/App/Dashboard/ResourceFeedPageWiring.test.ts +8 -1
  121. package/Tests/App/Dashboard/ResourceFeedPagesFilterSort.test.tsx +14 -0
  122. package/Tests/App/Dashboard/ResourceOverviewTileTooltips.test.tsx +4 -1
  123. package/Tests/App/Dashboard/RumOverviewPage.test.tsx +127 -0
  124. package/Tests/App/Dashboard/ScheduledMaintenanceOverviewPage.test.tsx +2 -0
  125. package/Tests/App/Dashboard/ServiceMapDatabaseLink.test.tsx +1085 -0
  126. package/Tests/App/Dashboard/SiteSearchBox.test.tsx +2110 -0
  127. package/Tests/App/Dashboard/TelemetryMetricsSignals.test.ts +168 -8
  128. package/Tests/App/Dashboard/TelemetryResourceRetentionSettings.test.tsx +10 -0
  129. package/Tests/App/Dashboard/TracesResourceFacets.test.tsx +2 -1
  130. package/Tests/App/StatusPage/StatusPageHeaderForeignHiddenRule.test.tsx +284 -0
  131. package/Tests/ClassStrings.ts +178 -0
  132. package/Tests/Fixtures/MobilePasskeyUser.json +1 -2
  133. package/Tests/ForeignHiddenRuleGuard.ts +2152 -0
  134. package/Tests/Models/DatabaseModels/DatabaseServerModels.test.ts +2250 -0
  135. package/Tests/Models/DatabaseModels/ResourceFeedModels.test.ts +24 -5
  136. package/Tests/Models/DatabaseModels/StaticRuleCriteriaInheritance.test.ts +4 -2
  137. package/Tests/RenderedMarkup.ts +518 -0
  138. package/Tests/ResponsiveVisibility.test.ts +490 -4
  139. package/Tests/ResponsiveVisibility.ts +505 -52
  140. package/Tests/Server/Infrastructure/Postgres/AddConfigurableRuleCriteriaMigration.test.ts +3 -0
  141. package/Tests/Server/Infrastructure/Postgres/AddDatabaseServerTablesMigration.test.ts +541 -0
  142. package/Tests/Server/Infrastructure/Postgres/AddUserProjectSsoConsentMigration.test.ts +234 -0
  143. package/Tests/Server/Services/ContainerSnapshotUpsertPostgres.test.ts +319 -0
  144. package/Tests/Server/Services/CrossProjectRelationWriteGuard.test.ts +13 -0
  145. package/Tests/Server/Services/DatabaseServerEndpointService.test.ts +2033 -0
  146. package/Tests/Server/Services/DatabaseServerFeedAndOwnerServices.test.ts +529 -0
  147. package/Tests/Server/Services/DatabaseServerLifecycle.test.ts +3302 -0
  148. package/Tests/Server/Services/DatabaseServerRegistries.test.ts +603 -0
  149. package/Tests/Server/Services/DatabaseServerRuleEngines.test.ts +754 -0
  150. package/Tests/Server/Services/DatabaseServerService.test.ts +3558 -0
  151. package/Tests/Server/Services/DatabaseServerSqlPostgres.test.ts +2045 -0
  152. package/Tests/Server/Services/DatabaseServiceUpdateColumnsIfUnlockedPostgres.test.ts +362 -0
  153. package/Tests/Server/Services/DatabaseServiceUpdateColumnsIfUnlockedReply.test.ts +210 -0
  154. package/Tests/Server/Services/HookFreeWriteLengthClamp.test.ts +18 -0
  155. package/Tests/Server/Services/IncidentAlertSloLinkSurvivesEdit.test.ts +2 -0
  156. package/Tests/Server/Services/IncomingCallPolicyEscalationRuleTarget.test.ts +225 -0
  157. package/Tests/Server/Services/InventoryItemDisplayName.test.ts +280 -2
  158. package/Tests/Server/Services/InventoryUpsertSchemaParity.test.ts +8 -2
  159. package/Tests/Server/Services/IoTDeviceLatestMetricsPostgres.test.ts +689 -0
  160. package/Tests/Server/Services/IoTDeviceService.test.ts +379 -0
  161. package/Tests/Server/Services/LatestMetricsValuesShape.test.ts +360 -0
  162. package/Tests/Server/Services/LlmModelPriceService.test.ts +402 -0
  163. package/Tests/Server/Services/MetricServiceAggregate.test.ts +12 -0
  164. package/Tests/Server/Services/OpenTelemetryResourceRetentionMemo.test.ts +7 -1
  165. package/Tests/Server/Services/OwnerRowUniqueness.test.ts +61 -9
  166. package/Tests/Server/Services/ReminderRuleLookupPostgres.test.ts +2250 -0
  167. package/Tests/Server/Services/ReminderRuleRefreshOpenSubjectsPaging.test.ts +653 -0
  168. package/Tests/Server/Services/ResourceUpdateLastSeenLivenessFallback.test.ts +68 -20
  169. package/Tests/Server/Services/SavedViewDefaults.test.ts +325 -0
  170. package/Tests/Server/Services/StaticRuleCriteriaRuntimeCoverage.test.ts +3 -3
  171. package/Tests/Server/Services/StatusPageCertificateService.test.ts +169 -0
  172. package/Tests/Server/Services/TeamComplianceSettingService.test.ts +191 -0
  173. package/Tests/Server/Services/TelemetryResourceFacetCounting.test.ts +9 -0
  174. package/Tests/Server/Services/UserProjectSsoConsentPostgres.test.ts +153 -0
  175. package/Tests/Server/Services/UserProjectSsoConsentService.test.ts +192 -0
  176. package/Tests/Server/Services/UserServiceFirstMasterAdminElection.test.ts +71 -0
  177. package/Tests/Server/Services/UserSignupIdTakeoverPostgres.test.ts +238 -0
  178. package/Tests/Server/Services/WorkspaceNotificationSummaryHelpers.test.ts +592 -0
  179. package/Tests/Server/Types/Billing/PayAsYouGoMeteredAuthorization.test.ts +3 -0
  180. package/Tests/Server/Types/Database/EventOverlayScopePostgres.test.ts +1 -0
  181. package/Tests/Server/Types/Database/FeedEventTypeFilterQuery.test.ts +11 -0
  182. package/Tests/Server/Types/Database/Permissions/InfrastructureOwnershipScope.test.ts +8 -0
  183. package/Tests/Server/Types/Database/QueryHelperBooleanForCriteriaBackedRule.test.ts +1094 -0
  184. package/Tests/Server/Types/Database/QueryHelperSearchAllWords.test.ts +651 -0
  185. package/Tests/Server/Utils/AI/AlertWriteTools.test.ts +256 -0
  186. package/Tests/Server/Utils/AI/IncidentWriteTools.test.ts +482 -0
  187. package/Tests/Server/Utils/AI/ResourceTools.test.ts +134 -0
  188. package/Tests/Server/Utils/Monitor/Criteria/CompareCriteria.test.ts +54 -0
  189. package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.test.ts +41 -0
  190. package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteriaAnomalyUnits.test.ts +279 -9
  191. package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteriaDisplayContext.test.ts +933 -0
  192. package/Tests/Server/Utils/Monitor/DatabaseMaintenanceSuppression.test.ts +582 -0
  193. package/Tests/Server/Utils/Monitor/DatabaseServerMonitorLinking.test.ts +753 -0
  194. package/Tests/Server/Utils/Monitor/MetricDecimalThreshold.test.ts +417 -0
  195. package/Tests/Server/Utils/Monitor/MonitorActionTimestamps.test.ts +1 -0
  196. package/Tests/Server/Utils/Monitor/MonitorAlertCriteriaReferences.test.ts +1 -0
  197. package/Tests/Server/Utils/Monitor/MonitorAlertResourceLinking.test.ts +119 -0
  198. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluator.test.ts +60 -25
  199. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorAffectedResourceEdgeCases.test.ts +1815 -0
  200. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorKubernetesAffectedResources.test.ts +1447 -0
  201. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorKubernetesRatioEmail.test.ts +352 -0
  202. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPlatformMetricUnits.test.ts +717 -0
  203. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPlatformRawScan.test.ts +2125 -0
  204. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPlatformSeriesAffectedResources.test.ts +1288 -0
  205. package/Tests/Server/Utils/Monitor/MonitorDependencySuppressionCreatorSkip.test.ts +1 -0
  206. package/Tests/Server/Utils/Monitor/MonitorIncidentCriteriaReferences.test.ts +1 -0
  207. package/Tests/Server/Utils/Monitor/MonitorIncidentMemberRoleMembership.test.ts +1 -0
  208. package/Tests/Server/Utils/Monitor/MonitorIncidentResourceLinking.test.ts +88 -0
  209. package/Tests/Server/Utils/Monitor/MonitorMaintenanceSuppression.test.ts +205 -0
  210. package/Tests/Server/Utils/Monitor/MonitorResourceContext.test.ts +62 -0
  211. package/Tests/Server/Utils/Monitor/MonitorResourceDatabaseMaintenance.test.ts +803 -0
  212. package/Tests/Server/Utils/Monitor/MonitorStepResourceIdentity.test.ts +133 -3
  213. package/Tests/Server/Utils/Monitor/MonitorSummaryPersistence.test.ts +1 -0
  214. package/Tests/Server/Utils/Monitor/PerSeriesRecoveryResolution.test.ts +472 -1
  215. package/Tests/Server/Utils/Monitor/PerSeriesSecondEntityAlerting.test.ts +1 -0
  216. package/Tests/Server/Utils/Monitor/SeriesResourceLinker.test.ts +236 -2
  217. package/Tests/Server/Utils/SeriesResourceLabels.test.ts +70 -0
  218. package/Tests/Server/Utils/StartServerProtobufContentType.test.ts +54 -0
  219. package/Tests/Server/Utils/Telemetry/DatabaseEndpointDiscovery.test.ts +1895 -0
  220. package/Tests/Server/Utils/Telemetry/EntityRegistry.test.ts +7 -0
  221. package/Tests/Server/Utils/Telemetry/LogExceptionExtractorSeverityGate.test.ts +90 -0
  222. package/Tests/Server/Utils/Telemetry/ResourceEntityFilter.test.ts +570 -0
  223. package/Tests/Server/Utils/Telemetry/ResourceFacetResolver.test.ts +97 -2
  224. package/Tests/Server/Utils/Telemetry/ServiceDependencyDiscovery.test.ts +1337 -0
  225. package/Tests/Server/Utils/Telemetry/TelemetryEntity.test.ts +295 -0
  226. package/Tests/Types/AI/AIResourceContext.test.ts +30 -0
  227. package/Tests/Types/BaseDatabase/AggregationType.test.ts +5 -1
  228. package/Tests/Types/Dashboard/KubernetesDashboardTemplate.test.ts +184 -0
  229. package/Tests/Types/Dashboard/KubernetesDashboardTemplates.test.ts +107 -0
  230. package/Tests/Types/DatabaseServer/DatabaseContainerClassifier.test.ts +3644 -0
  231. package/Tests/Types/DatabaseServer/DatabaseContainerCommand.test.ts +340 -0
  232. package/Tests/Types/DatabaseServer/DatabaseContainerCommandCorpus.ts +826 -0
  233. package/Tests/Types/DatabaseServer/DatabaseContainerCommandPostgres.test.ts +150 -0
  234. package/Tests/Types/DatabaseServer/DatabaseEndpoint.test.ts +2657 -0
  235. package/Tests/Types/DatabaseServer/DatabaseServerDiscoverySource.test.ts +64 -0
  236. package/Tests/Types/DatabaseServer/DatabaseServerEntityKeys.test.ts +952 -0
  237. package/Tests/Types/DatabaseServer/DatabaseServerMetricCatalog.test.ts +1161 -0
  238. package/Tests/Types/DatabaseServer/DatabaseSystem.test.ts +1514 -0
  239. package/Tests/Types/DatabaseServer/DatabaseTelemetryResolver.test.ts +1558 -0
  240. package/Tests/Types/Monitor/CephAlertTemplates.test.ts +255 -6
  241. package/Tests/Types/Monitor/DatabaseAlertTemplates.test.ts +2254 -0
  242. package/Tests/Types/Monitor/KubernetesAlertTemplates.test.ts +292 -0
  243. package/Tests/Types/Monitor/KubernetesMetricCatalog.test.ts +272 -0
  244. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCatalog.test.ts +253 -9
  245. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCoverage.test.ts +13 -5
  246. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationNotificationMode.test.ts +4 -2
  247. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationUtil.test.ts +111 -2
  248. package/Tests/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.test.ts +61 -0
  249. package/Tests/Types/Monitor/SeriesContext/SeriesLabelDisplay.test.ts +114 -0
  250. package/Tests/Types/Monitor/Utils/KubernetesAgentEmittedMetrics.ts +202 -0
  251. package/Tests/Types/NetworkDevice/DiscoveredHostNamingStatus.test.ts +401 -0
  252. package/Tests/Types/Telemetry/ResourceEntityFacet.test.ts +4 -1
  253. package/Tests/Types/Telemetry/ResourceFacetCatalog.test.ts +24 -2
  254. package/Tests/UI/Components/Card.test.tsx +93 -2
  255. package/Tests/UI/Components/FeedOptions.test.ts +6 -0
  256. package/Tests/UI/Components/FeedOptionsButton.test.tsx +8 -1
  257. package/Tests/UI/Components/ForeignHiddenRuleResilience.test.tsx +1147 -0
  258. package/Tests/UI/Components/HeaderRightRail.test.tsx +41 -1
  259. package/Tests/UI/Components/LogsEntityNames.test.ts +16 -1
  260. package/Tests/UI/Components/LogsFacetSidebarHiddenFacets.test.tsx +7 -3
  261. package/Tests/UI/Components/ResourceFacetConfigs.test.ts +2 -1
  262. package/Tests/UI/Components/RuleCriteria/RuleCriteriaModelTable.test.tsx +3 -3
  263. package/Tests/UI/Components/SrOnlyForeignRule.test.tsx +994 -0
  264. package/Tests/UI/Components/StatusPage/ResourceListSelection.test.tsx +34 -1
  265. package/Tests/UI/Components/TelemetryFacetSidebarHiddenFacets.test.tsx +4 -1
  266. package/Tests/UI/ForeignHiddenRuleGuard.test.ts +1951 -0
  267. package/Tests/UI/Rum/ChunkLoader.test.ts +76 -0
  268. package/Tests/UI/Rum/ReplayPlayerChrome.test.tsx +19 -1
  269. package/Tests/UI/Rum/ReplayRailDetail.test.tsx +53 -0
  270. package/Tests/UI/Rum/ReplaySignals.test.ts +54 -0
  271. package/Tests/UI/Rum/ReplayTabSwitcher.test.tsx +19 -1
  272. package/Tests/UI/TailwindPlayCdnForeignHiddenRule.test.ts +1005 -0
  273. package/Tests/UI/ThemeGroupHoverReveal.test.ts +847 -0
  274. package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +70 -0
  275. package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +21 -0
  276. package/Tests/UI/Utils/ModelAPISsoRedirect.test.ts +127 -0
  277. package/Tests/UI/Utils/Navigation.test.ts +102 -0
  278. package/Tests/UI/Utils/Telemetry/TelemetryEntityNames.test.ts +23 -0
  279. package/Tests/Utils/Dashboard/KubernetesClusterCpuTileRepair.test.ts +370 -0
  280. package/Tests/Utils/LabelRuleImportExport.test.ts +5 -0
  281. package/Tests/Utils/MetricUnitUtil.test.ts +227 -2
  282. package/Tests/Utils/Monitor/MetricValueFormatter.test.ts +288 -2
  283. package/Tests/Utils/Monitor/PlatformResourceIdentityAndUnits.test.ts +1559 -0
  284. package/Tests/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.test.ts +2546 -0
  285. package/Tests/Utils/NetworkDiscovery/DiscoveredHostUtil.test.ts +315 -0
  286. package/Tests/Utils/NetworkDiscovery/DiscoveryReverseDnsChain.test.ts +336 -1
  287. package/Tests/Utils/NetworkDiscovery/NetbiosNameUtil.test.ts +244 -0
  288. package/Tests/Utils/Rules/MonitorTypeRuleCriteria.test.ts +181 -0
  289. package/Tests/Utils/ValueFormatter.test.ts +50 -0
  290. package/Tests/tsconfig.json +16 -0
  291. package/Types/AI/AIResourceContext.ts +7 -0
  292. package/Types/BaseDatabase/AggregationType.ts +7 -0
  293. package/Types/Dashboard/DashboardTemplates.ts +22 -8
  294. package/Types/DatabaseServer/DatabaseConnectionSpan.ts +77 -0
  295. package/Types/DatabaseServer/DatabaseContainerClassifier.ts +2068 -0
  296. package/Types/DatabaseServer/DatabaseContainerCommand.ts +801 -0
  297. package/Types/DatabaseServer/DatabaseEndpoint.ts +1943 -0
  298. package/Types/DatabaseServer/DatabaseServerDiscoverySource.ts +68 -0
  299. package/Types/DatabaseServer/DatabaseServerMetricCatalog.ts +966 -0
  300. package/Types/DatabaseServer/DatabaseSystem.ts +2124 -0
  301. package/Types/DatabaseServer/DatabaseTelemetryResolver.ts +555 -0
  302. package/Types/Email/EmailTemplateType.ts +1 -0
  303. package/Types/Monitor/CephAlertTemplates.ts +18 -0
  304. package/Types/Monitor/DatabaseAlertTemplates.ts +2020 -0
  305. package/Types/Monitor/KubernetesAlertTemplates.ts +64 -24
  306. package/Types/Monitor/KubernetesMetricCatalog.ts +118 -19
  307. package/Types/Monitor/MetricMonitor/MetricCriteriaContext.ts +14 -0
  308. package/Types/Monitor/MetricMonitor/MetricMonitorResponse.ts +93 -10
  309. package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.ts +109 -8
  310. package/Types/Monitor/Recommendation/MonitorRecommendationTypes.ts +36 -7
  311. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.ts +43 -2
  312. package/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.ts +41 -6
  313. package/Types/Monitor/SeriesContext/SeriesLabelDisplay.ts +26 -0
  314. package/Types/NetworkDevice/DiscoveredHostNamingStatus.ts +147 -0
  315. package/Types/Permission.ts +267 -0
  316. package/Types/Probe/ProbeApiIngestResponse.ts +8 -0
  317. package/Types/Rules/RuleCriteriaFieldRegistry.ts +10 -0
  318. package/Types/Rules/RuleRun.ts +12 -0
  319. package/Types/Rum/SessionReplayCustomEvents.ts +29 -3
  320. package/Types/Rum/WebVitals.ts +13 -0
  321. package/Types/Telemetry/EntityType.ts +23 -0
  322. package/Types/Telemetry/ResourceFacetCatalog.ts +14 -0
  323. package/Types/Telemetry/ServiceType.ts +8 -0
  324. package/UI/Components/Banner/Banner.tsx +1 -1
  325. package/UI/Components/Card/Card.tsx +1 -1
  326. package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +2 -2
  327. package/UI/Components/Charts/Line/LineChart.tsx +7 -0
  328. package/UI/Components/CommandPalette/CommandPalette.tsx +1 -1
  329. package/UI/Components/Date/StartAndEndDate.tsx +5 -5
  330. package/UI/Components/Diagram/HorizontalStepChain.tsx +1 -1
  331. package/UI/Components/Feed/FeedOptionsButton.tsx +1 -1
  332. package/UI/Components/Forms/BasicForm.tsx +1 -1
  333. package/UI/Components/Header/Header.tsx +1 -1
  334. package/UI/Components/Header/HeaderIconDropdownButton.tsx +1 -1
  335. package/UI/Components/HeaderAlert/HeaderAlert.tsx +1 -1
  336. package/UI/Components/Input/Input.tsx +11 -0
  337. package/UI/Components/LogsViewer/components/FacetValueRow.tsx +1 -1
  338. package/UI/Components/LogsViewer/components/LogsFacetSidebar.tsx +1 -1
  339. package/UI/Components/Modal/ModalFooter.tsx +1 -1
  340. package/UI/Components/ModelDetail/CardModelDetail.tsx +2 -2
  341. package/UI/Components/ModelTable/BaseModelTable.tsx +4 -4
  342. package/UI/Components/Navbar/NavBar.tsx +9 -2
  343. package/UI/Components/Navbar/NavBarMenuModal.tsx +2 -2
  344. package/UI/Components/Page/Page.tsx +1 -1
  345. package/UI/Components/Pagination/Pagination.tsx +3 -3
  346. package/UI/Components/ProgressButtons/ProgressButtonItem.tsx +1 -1
  347. package/UI/Components/SideMenu/SideMenu.tsx +4 -1
  348. package/UI/Components/StatusPage/ResourceGroupNavigator.tsx +4 -2
  349. package/UI/Components/StatusPage/ResourceList.tsx +6 -6
  350. package/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.tsx +1 -1
  351. package/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.tsx +1 -1
  352. package/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.tsx +1 -1
  353. package/UI/Components/Workflow/ComponentsModal.tsx +2 -2
  354. package/UI/Components/Workflow/StepTraceViewer.tsx +1 -1
  355. package/UI/Styles/Theme.css +8 -1
  356. package/UI/Utils/Navigation.ts +89 -42
  357. package/UI/Utils/Telemetry/TelemetryEntityNames.ts +7 -0
  358. package/UI/Utils/TelemetryService.ts +4 -3
  359. package/Utils/Dashboard/KubernetesClusterCpuTileRepair.ts +147 -0
  360. package/Utils/LabelRuleImportExport.ts +2 -0
  361. package/Utils/MetricUnitUtil.ts +103 -11
  362. package/Utils/Monitor/MetricValueFormatter.ts +66 -13
  363. package/Utils/Monitor/PlatformMetricUnitUtil.ts +215 -0
  364. package/Utils/Monitor/PlatformResourceIdentity.ts +514 -0
  365. package/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.ts +425 -0
  366. package/Utils/NetworkDiscovery/DiscoveredHostUtil.ts +32 -0
  367. package/Utils/NetworkDiscovery/NetbiosNameUtil.ts +73 -0
  368. package/Utils/Telemetry/DatabaseServerEntityKeys.ts +275 -0
  369. package/Utils/Telemetry/EntityKey.ts +176 -0
  370. package/Utils/ValueFormatter.ts +16 -0
  371. package/build/dist/Models/DatabaseModels/Alert.js +54 -0
  372. package/build/dist/Models/DatabaseModels/Alert.js.map +1 -1
  373. package/build/dist/Models/DatabaseModels/DatabaseServer.js +1683 -0
  374. package/build/dist/Models/DatabaseModels/DatabaseServer.js.map +1 -0
  375. package/build/dist/Models/DatabaseModels/DatabaseServerEndpoint.js +559 -0
  376. package/build/dist/Models/DatabaseModels/DatabaseServerEndpoint.js.map +1 -0
  377. package/build/dist/Models/DatabaseModels/DatabaseServerFeed.js +648 -0
  378. package/build/dist/Models/DatabaseModels/DatabaseServerFeed.js.map +1 -0
  379. package/build/dist/Models/DatabaseModels/DatabaseServerLabelRule.js +522 -0
  380. package/build/dist/Models/DatabaseModels/DatabaseServerLabelRule.js.map +1 -0
  381. package/build/dist/Models/DatabaseModels/DatabaseServerOwnerRule.js +603 -0
  382. package/build/dist/Models/DatabaseModels/DatabaseServerOwnerRule.js.map +1 -0
  383. package/build/dist/Models/DatabaseModels/DatabaseServerOwnerTeam.js +506 -0
  384. package/build/dist/Models/DatabaseModels/DatabaseServerOwnerTeam.js.map +1 -0
  385. package/build/dist/Models/DatabaseModels/DatabaseServerOwnerUser.js +505 -0
  386. package/build/dist/Models/DatabaseModels/DatabaseServerOwnerUser.js.map +1 -0
  387. package/build/dist/Models/DatabaseModels/Incident.js +54 -0
  388. package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
  389. package/build/dist/Models/DatabaseModels/Index.js +16 -0
  390. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  391. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
  392. package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js +54 -0
  393. package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js.map +1 -1
  394. package/build/dist/Models/DatabaseModels/TelemetryException.js +2 -0
  395. package/build/dist/Models/DatabaseModels/TelemetryException.js.map +1 -1
  396. package/build/dist/Models/DatabaseModels/UserProjectSsoConsent.js +162 -0
  397. package/build/dist/Models/DatabaseModels/UserProjectSsoConsent.js.map +1 -0
  398. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795000000000-AddDatabaseServerTables.js +240 -0
  399. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795000000000-AddDatabaseServerTables.js.map +1 -0
  400. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795100000000-AddUserProjectSsoConsent.js +26 -0
  401. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795100000000-AddUserProjectSsoConsent.js.map +1 -0
  402. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
  403. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  404. package/build/dist/Server/Middleware/MultipartFormData.js +1 -1
  405. package/build/dist/Server/Middleware/TelemetryIngest.js +15 -8
  406. package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
  407. package/build/dist/Server/Services/AlertReminderRuleService.js +72 -23
  408. package/build/dist/Server/Services/AlertReminderRuleService.js.map +1 -1
  409. package/build/dist/Server/Services/DatabaseServerEndpointService.js +694 -0
  410. package/build/dist/Server/Services/DatabaseServerEndpointService.js.map +1 -0
  411. package/build/dist/Server/Services/DatabaseServerFeedService.js +110 -0
  412. package/build/dist/Server/Services/DatabaseServerFeedService.js.map +1 -0
  413. package/build/dist/Server/Services/DatabaseServerLabelRuleEngineService.js +272 -0
  414. package/build/dist/Server/Services/DatabaseServerLabelRuleEngineService.js.map +1 -0
  415. package/build/dist/Server/Services/DatabaseServerLabelRuleService.js +13 -0
  416. package/build/dist/Server/Services/DatabaseServerLabelRuleService.js.map +1 -0
  417. package/build/dist/Server/Services/DatabaseServerOwnerRuleEngineService.js +340 -0
  418. package/build/dist/Server/Services/DatabaseServerOwnerRuleEngineService.js.map +1 -0
  419. package/build/dist/Server/Services/DatabaseServerOwnerRuleService.js +13 -0
  420. package/build/dist/Server/Services/DatabaseServerOwnerRuleService.js.map +1 -0
  421. package/build/dist/Server/Services/DatabaseServerOwnerTeamService.js +160 -0
  422. package/build/dist/Server/Services/DatabaseServerOwnerTeamService.js.map +1 -0
  423. package/build/dist/Server/Services/DatabaseServerOwnerUserService.js +153 -0
  424. package/build/dist/Server/Services/DatabaseServerOwnerUserService.js.map +1 -0
  425. package/build/dist/Server/Services/DatabaseServerService.js +3272 -0
  426. package/build/dist/Server/Services/DatabaseServerService.js.map +1 -0
  427. package/build/dist/Server/Services/DatabaseService.js +8 -4
  428. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  429. package/build/dist/Server/Services/DockerResourceService.js +30 -3
  430. package/build/dist/Server/Services/DockerResourceService.js.map +1 -1
  431. package/build/dist/Server/Services/IncidentReminderRuleService.js +73 -23
  432. package/build/dist/Server/Services/IncidentReminderRuleService.js.map +1 -1
  433. package/build/dist/Server/Services/Index.js +16 -0
  434. package/build/dist/Server/Services/Index.js.map +1 -1
  435. package/build/dist/Server/Services/InventoryItemService.js +88 -5
  436. package/build/dist/Server/Services/InventoryItemService.js.map +1 -1
  437. package/build/dist/Server/Services/IoTDeviceService.js +111 -24
  438. package/build/dist/Server/Services/IoTDeviceService.js.map +1 -1
  439. package/build/dist/Server/Services/MetricService.js +1 -1
  440. package/build/dist/Server/Services/OpenTelemetryIngestService.js +24 -9
  441. package/build/dist/Server/Services/OpenTelemetryIngestService.js.map +1 -1
  442. package/build/dist/Server/Services/PodmanResourceService.js +30 -3
  443. package/build/dist/Server/Services/PodmanResourceService.js.map +1 -1
  444. package/build/dist/Server/Services/ScheduledMaintenanceReminderRuleService.js +75 -23
  445. package/build/dist/Server/Services/ScheduledMaintenanceReminderRuleService.js.map +1 -1
  446. package/build/dist/Server/Services/ServiceService.js +1 -1
  447. package/build/dist/Server/Services/ServiceService.js.map +1 -1
  448. package/build/dist/Server/Services/TelemetryUsageBillingService.js +23 -2
  449. package/build/dist/Server/Services/TelemetryUsageBillingService.js.map +1 -1
  450. package/build/dist/Server/Services/UserProjectSsoConsentService.js +79 -0
  451. package/build/dist/Server/Services/UserProjectSsoConsentService.js.map +1 -0
  452. package/build/dist/Server/Services/UserService.js +13 -1
  453. package/build/dist/Server/Services/UserService.js.map +1 -1
  454. package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js +18 -0
  455. package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js.map +1 -1
  456. package/build/dist/Server/Types/Database/QueryHelper.js +73 -2
  457. package/build/dist/Server/Types/Database/QueryHelper.js.map +1 -1
  458. package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js +13 -2
  459. package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js.map +1 -1
  460. package/build/dist/Server/Utils/AI/Toolbox/ResourceTools.js +58 -1
  461. package/build/dist/Server/Utils/AI/Toolbox/ResourceTools.js.map +1 -1
  462. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +1 -1
  463. package/build/dist/Server/Utils/Database/AffectedResourceRelations.js +6 -0
  464. package/build/dist/Server/Utils/Database/AffectedResourceRelations.js.map +1 -1
  465. package/build/dist/Server/Utils/Monitor/Criteria/CompareCriteria.js +31 -0
  466. package/build/dist/Server/Utils/Monitor/Criteria/CompareCriteria.js.map +1 -1
  467. package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js +135 -14
  468. package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js.map +1 -1
  469. package/build/dist/Server/Utils/Monitor/MonitorAlert.js +22 -6
  470. package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
  471. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +1489 -524
  472. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  473. package/build/dist/Server/Utils/Monitor/MonitorIncident.js +22 -6
  474. package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
  475. package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js +196 -6
  476. package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js.map +1 -1
  477. package/build/dist/Server/Utils/Monitor/MonitorResource.js +36 -9
  478. package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
  479. package/build/dist/Server/Utils/Monitor/MonitorResourceContext.js +1 -0
  480. package/build/dist/Server/Utils/Monitor/MonitorResourceContext.js.map +1 -1
  481. package/build/dist/Server/Utils/Monitor/MonitorStepResourceIdentity.js +175 -17
  482. package/build/dist/Server/Utils/Monitor/MonitorStepResourceIdentity.js.map +1 -1
  483. package/build/dist/Server/Utils/Monitor/PerSeriesResolutionRootCause.js +29 -0
  484. package/build/dist/Server/Utils/Monitor/PerSeriesResolutionRootCause.js.map +1 -0
  485. package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js +211 -0
  486. package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js.map +1 -1
  487. package/build/dist/Server/Utils/Monitor/SeriesResourceLinker.js +82 -10
  488. package/build/dist/Server/Utils/Monitor/SeriesResourceLinker.js.map +1 -1
  489. package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js +25 -0
  490. package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js.map +1 -1
  491. package/build/dist/Server/Utils/StartServer.js +20 -4
  492. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  493. package/build/dist/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.js +2 -0
  494. package/build/dist/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.js.map +1 -1
  495. package/build/dist/Server/Utils/Telemetry/DatabaseEndpointDiscovery.js +442 -0
  496. package/build/dist/Server/Utils/Telemetry/DatabaseEndpointDiscovery.js.map +1 -0
  497. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +5 -1
  498. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
  499. package/build/dist/Server/Utils/Telemetry/LogExceptionExtractor.js +15 -1
  500. package/build/dist/Server/Utils/Telemetry/LogExceptionExtractor.js.map +1 -1
  501. package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js +121 -5
  502. package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js.map +1 -1
  503. package/build/dist/Server/Utils/Telemetry/ResourceFacetResolver.js +12 -0
  504. package/build/dist/Server/Utils/Telemetry/ResourceFacetResolver.js.map +1 -1
  505. package/build/dist/Server/Utils/Telemetry/ServiceDependencyDiscovery.js +438 -36
  506. package/build/dist/Server/Utils/Telemetry/ServiceDependencyDiscovery.js.map +1 -1
  507. package/build/dist/Server/Utils/Telemetry/Telemetry.js +12 -0
  508. package/build/dist/Server/Utils/Telemetry/Telemetry.js.map +1 -1
  509. package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +17 -18
  510. package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
  511. package/build/dist/Server/Utils/Telemetry/TelemetryIngestionKeyGuard.js +16 -10
  512. package/build/dist/Server/Utils/Telemetry/TelemetryIngestionKeyGuard.js.map +1 -1
  513. package/build/dist/Types/AI/AIResourceContext.js +7 -0
  514. package/build/dist/Types/AI/AIResourceContext.js.map +1 -1
  515. package/build/dist/Types/BaseDatabase/AggregationType.js +7 -0
  516. package/build/dist/Types/BaseDatabase/AggregationType.js.map +1 -1
  517. package/build/dist/Types/Dashboard/DashboardTemplates.js +22 -8
  518. package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
  519. package/build/dist/Types/DatabaseServer/DatabaseConnectionSpan.js +71 -0
  520. package/build/dist/Types/DatabaseServer/DatabaseConnectionSpan.js.map +1 -0
  521. package/build/dist/Types/DatabaseServer/DatabaseContainerClassifier.js +1462 -0
  522. package/build/dist/Types/DatabaseServer/DatabaseContainerClassifier.js.map +1 -0
  523. package/build/dist/Types/DatabaseServer/DatabaseContainerCommand.js +691 -0
  524. package/build/dist/Types/DatabaseServer/DatabaseContainerCommand.js.map +1 -0
  525. package/build/dist/Types/DatabaseServer/DatabaseEndpoint.js +1407 -0
  526. package/build/dist/Types/DatabaseServer/DatabaseEndpoint.js.map +1 -0
  527. package/build/dist/Types/DatabaseServer/DatabaseServerDiscoverySource.js +60 -0
  528. package/build/dist/Types/DatabaseServer/DatabaseServerDiscoverySource.js.map +1 -0
  529. package/build/dist/Types/DatabaseServer/DatabaseServerMetricCatalog.js +804 -0
  530. package/build/dist/Types/DatabaseServer/DatabaseServerMetricCatalog.js.map +1 -0
  531. package/build/dist/Types/DatabaseServer/DatabaseSystem.js +1860 -0
  532. package/build/dist/Types/DatabaseServer/DatabaseSystem.js.map +1 -0
  533. package/build/dist/Types/DatabaseServer/DatabaseTelemetryResolver.js +406 -0
  534. package/build/dist/Types/DatabaseServer/DatabaseTelemetryResolver.js.map +1 -0
  535. package/build/dist/Types/Email/EmailTemplateType.js +1 -0
  536. package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
  537. package/build/dist/Types/Monitor/CephAlertTemplates.js +18 -0
  538. package/build/dist/Types/Monitor/CephAlertTemplates.js.map +1 -1
  539. package/build/dist/Types/Monitor/DatabaseAlertTemplates.js +1518 -0
  540. package/build/dist/Types/Monitor/DatabaseAlertTemplates.js.map +1 -0
  541. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +57 -24
  542. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
  543. package/build/dist/Types/Monitor/KubernetesMetricCatalog.js +104 -18
  544. package/build/dist/Types/Monitor/KubernetesMetricCatalog.js.map +1 -1
  545. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +80 -3
  546. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js.map +1 -1
  547. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js +10 -3
  548. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js.map +1 -1
  549. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +29 -0
  550. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js.map +1 -1
  551. package/build/dist/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.js +21 -6
  552. package/build/dist/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.js.map +1 -1
  553. package/build/dist/Types/Monitor/SeriesContext/SeriesLabelDisplay.js +25 -0
  554. package/build/dist/Types/Monitor/SeriesContext/SeriesLabelDisplay.js.map +1 -1
  555. package/build/dist/Types/NetworkDevice/DiscoveredHostNamingStatus.js +136 -0
  556. package/build/dist/Types/NetworkDevice/DiscoveredHostNamingStatus.js.map +1 -0
  557. package/build/dist/Types/Permission.js +234 -0
  558. package/build/dist/Types/Permission.js.map +1 -1
  559. package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js +10 -0
  560. package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js.map +1 -1
  561. package/build/dist/Types/Rules/RuleRun.js +4 -0
  562. package/build/dist/Types/Rules/RuleRun.js.map +1 -1
  563. package/build/dist/Types/Rum/SessionReplayCustomEvents.js.map +1 -1
  564. package/build/dist/Types/Rum/WebVitals.js +12 -0
  565. package/build/dist/Types/Rum/WebVitals.js.map +1 -1
  566. package/build/dist/Types/Telemetry/EntityType.js +23 -0
  567. package/build/dist/Types/Telemetry/EntityType.js.map +1 -1
  568. package/build/dist/Types/Telemetry/ResourceFacetCatalog.js +14 -0
  569. package/build/dist/Types/Telemetry/ResourceFacetCatalog.js.map +1 -1
  570. package/build/dist/Types/Telemetry/ServiceType.js +8 -0
  571. package/build/dist/Types/Telemetry/ServiceType.js.map +1 -1
  572. package/build/dist/UI/Components/Banner/Banner.js +1 -1
  573. package/build/dist/UI/Components/Banner/Banner.js.map +1 -1
  574. package/build/dist/UI/Components/Card/Card.js +1 -1
  575. package/build/dist/UI/Components/Card/Card.js.map +1 -1
  576. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +2 -2
  577. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
  578. package/build/dist/UI/Components/Charts/Line/LineChart.js +1 -1
  579. package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
  580. package/build/dist/UI/Components/CommandPalette/CommandPalette.js +1 -1
  581. package/build/dist/UI/Components/CommandPalette/CommandPalette.js.map +1 -1
  582. package/build/dist/UI/Components/Date/StartAndEndDate.js +5 -5
  583. package/build/dist/UI/Components/Date/StartAndEndDate.js.map +1 -1
  584. package/build/dist/UI/Components/Diagram/HorizontalStepChain.js +1 -1
  585. package/build/dist/UI/Components/Diagram/HorizontalStepChain.js.map +1 -1
  586. package/build/dist/UI/Components/Feed/FeedOptionsButton.js +1 -1
  587. package/build/dist/UI/Components/Feed/FeedOptionsButton.js.map +1 -1
  588. package/build/dist/UI/Components/Forms/BasicForm.js +1 -1
  589. package/build/dist/UI/Components/Forms/BasicForm.js.map +1 -1
  590. package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js +1 -1
  591. package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
  592. package/build/dist/UI/Components/HeaderAlert/HeaderAlert.js +1 -1
  593. package/build/dist/UI/Components/HeaderAlert/HeaderAlert.js.map +1 -1
  594. package/build/dist/UI/Components/Input/Input.js +1 -1
  595. package/build/dist/UI/Components/Input/Input.js.map +1 -1
  596. package/build/dist/UI/Components/LogsViewer/components/FacetValueRow.js +1 -1
  597. package/build/dist/UI/Components/LogsViewer/components/FacetValueRow.js.map +1 -1
  598. package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js +1 -1
  599. package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js.map +1 -1
  600. package/build/dist/UI/Components/Modal/ModalFooter.js +1 -1
  601. package/build/dist/UI/Components/Modal/ModalFooter.js.map +1 -1
  602. package/build/dist/UI/Components/ModelDetail/CardModelDetail.js +2 -2
  603. package/build/dist/UI/Components/ModelDetail/CardModelDetail.js.map +1 -1
  604. package/build/dist/UI/Components/ModelTable/BaseModelTable.js +4 -4
  605. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  606. package/build/dist/UI/Components/Navbar/NavBar.js +9 -2
  607. package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
  608. package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +2 -2
  609. package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
  610. package/build/dist/UI/Components/Page/Page.js +1 -1
  611. package/build/dist/UI/Components/Page/Page.js.map +1 -1
  612. package/build/dist/UI/Components/Pagination/Pagination.js +3 -3
  613. package/build/dist/UI/Components/Pagination/Pagination.js.map +1 -1
  614. package/build/dist/UI/Components/ProgressButtons/ProgressButtonItem.js +1 -1
  615. package/build/dist/UI/Components/ProgressButtons/ProgressButtonItem.js.map +1 -1
  616. package/build/dist/UI/Components/SideMenu/SideMenu.js +4 -1
  617. package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
  618. package/build/dist/UI/Components/StatusPage/ResourceGroupNavigator.js +3 -1
  619. package/build/dist/UI/Components/StatusPage/ResourceGroupNavigator.js.map +1 -1
  620. package/build/dist/UI/Components/StatusPage/ResourceList.js +6 -6
  621. package/build/dist/UI/Components/StatusPage/ResourceList.js.map +1 -1
  622. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js +1 -1
  623. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js.map +1 -1
  624. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.js +1 -1
  625. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.js.map +1 -1
  626. package/build/dist/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.js +1 -1
  627. package/build/dist/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.js.map +1 -1
  628. package/build/dist/UI/Components/Workflow/ComponentsModal.js +2 -2
  629. package/build/dist/UI/Components/Workflow/ComponentsModal.js.map +1 -1
  630. package/build/dist/UI/Components/Workflow/StepTraceViewer.js +1 -1
  631. package/build/dist/UI/Components/Workflow/StepTraceViewer.js.map +1 -1
  632. package/build/dist/UI/Utils/Navigation.js +66 -33
  633. package/build/dist/UI/Utils/Navigation.js.map +1 -1
  634. package/build/dist/UI/Utils/Telemetry/TelemetryEntityNames.js +7 -0
  635. package/build/dist/UI/Utils/Telemetry/TelemetryEntityNames.js.map +1 -1
  636. package/build/dist/UI/Utils/TelemetryService.js +3 -2
  637. package/build/dist/UI/Utils/TelemetryService.js.map +1 -1
  638. package/build/dist/Utils/Dashboard/KubernetesClusterCpuTileRepair.js +110 -0
  639. package/build/dist/Utils/Dashboard/KubernetesClusterCpuTileRepair.js.map +1 -0
  640. package/build/dist/Utils/LabelRuleImportExport.js +2 -0
  641. package/build/dist/Utils/LabelRuleImportExport.js.map +1 -1
  642. package/build/dist/Utils/MetricUnitUtil.js +77 -13
  643. package/build/dist/Utils/MetricUnitUtil.js.map +1 -1
  644. package/build/dist/Utils/Monitor/MetricValueFormatter.js +58 -13
  645. package/build/dist/Utils/Monitor/MetricValueFormatter.js.map +1 -1
  646. package/build/dist/Utils/Monitor/PlatformMetricUnitUtil.js +161 -0
  647. package/build/dist/Utils/Monitor/PlatformMetricUnitUtil.js.map +1 -0
  648. package/build/dist/Utils/Monitor/PlatformResourceIdentity.js +323 -0
  649. package/build/dist/Utils/Monitor/PlatformResourceIdentity.js.map +1 -0
  650. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.js +270 -0
  651. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.js.map +1 -0
  652. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js +23 -0
  653. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js.map +1 -1
  654. package/build/dist/Utils/NetworkDiscovery/NetbiosNameUtil.js +61 -0
  655. package/build/dist/Utils/NetworkDiscovery/NetbiosNameUtil.js.map +1 -1
  656. package/build/dist/Utils/Telemetry/DatabaseServerEntityKeys.js +178 -0
  657. package/build/dist/Utils/Telemetry/DatabaseServerEntityKeys.js.map +1 -0
  658. package/build/dist/Utils/Telemetry/EntityKey.js +133 -0
  659. package/build/dist/Utils/Telemetry/EntityKey.js.map +1 -1
  660. package/build/dist/Utils/ValueFormatter.js +15 -0
  661. package/build/dist/Utils/ValueFormatter.js.map +1 -1
  662. package/package.json +1 -1
  663. package/tsconfig.tests.json +7 -5
@@ -0,0 +1,323 @@
1
+ /*
2
+ * Which platform object a set of metric attributes describes.
3
+ *
4
+ * Two readers need this answer and must never disagree about it:
5
+ *
6
+ * - the telemetry worker, which scans raw datapoints and names the
7
+ * resource behind each one for the "Affected Resources" list;
8
+ * - the criteria evaluator, which names the resource behind each series
9
+ * a grouped monitor evaluated — from the series' group-by labels, which
10
+ * are the same attribute keys the worker reads (a template grouping by
11
+ * node groups by `resource.k8s.node.name`).
12
+ *
13
+ * Both used to carry their own copy of the attribute keys. Keeping one copy
14
+ * here is what lets a per-series list and a raw-scan list title the same
15
+ * node the same way.
16
+ */
17
+ export default class PlatformResourceIdentity {
18
+ /**
19
+ * Read one attribute as a non-empty string. Numbers are stringified —
20
+ * Ceph's `pool_id` arrives as either.
21
+ */
22
+ static readAttribute(attributes, key) {
23
+ const value = attributes[key];
24
+ if (typeof value === "string") {
25
+ return value.length > 0 ? value : undefined;
26
+ }
27
+ if (typeof value === "number" && Number.isFinite(value)) {
28
+ return String(value);
29
+ }
30
+ return undefined;
31
+ }
32
+ /**
33
+ * Series labels are whatever keys the user grouped by. The shipped
34
+ * templates group by the stored, `resource.`-prefixed key; a hand-built
35
+ * monitor may group by the bare OTel key ("k8s.node.name"). Mirror each
36
+ * label under its other spelling so either reads as the same identity.
37
+ * An existing key is never overwritten.
38
+ */
39
+ static withBothAttributeSpellings(labels) {
40
+ const result = Object.assign({}, labels);
41
+ const resourcePrefix = "resource.";
42
+ for (const key of Object.keys(labels)) {
43
+ const otherSpelling = key.startsWith(resourcePrefix)
44
+ ? key.substring(resourcePrefix.length)
45
+ : `${resourcePrefix}${key}`;
46
+ if (otherSpelling && result[otherSpelling] === undefined) {
47
+ result[otherSpelling] = labels[key];
48
+ }
49
+ }
50
+ return result;
51
+ }
52
+ static kubernetes(attributes) {
53
+ const read = (key) => {
54
+ return PlatformResourceIdentity.readAttribute(attributes, key);
55
+ };
56
+ let workloadType = undefined;
57
+ let workloadName = undefined;
58
+ /*
59
+ * Most specific controller first. A pod created by a Deployment is
60
+ * also stamped with its ReplicaSet, and the Deployment is the name a
61
+ * human looks for.
62
+ */
63
+ const workloadKeys = [
64
+ ["resource.k8s.deployment.name", "Deployment"],
65
+ ["resource.k8s.statefulset.name", "StatefulSet"],
66
+ ["resource.k8s.daemonset.name", "DaemonSet"],
67
+ ["resource.k8s.job.name", "Job"],
68
+ ["resource.k8s.cronjob.name", "CronJob"],
69
+ ["resource.k8s.replicaset.name", "ReplicaSet"],
70
+ /*
71
+ * Not a workload, but the object the HPA templates group by, and a
72
+ * series titled by it reads far better than one titled by its
73
+ * namespace.
74
+ */
75
+ ["resource.k8s.hpa.name", "HorizontalPodAutoscaler"],
76
+ ];
77
+ for (const [key, type] of workloadKeys) {
78
+ const name = read(key);
79
+ if (name) {
80
+ workloadType = type;
81
+ workloadName = name;
82
+ break;
83
+ }
84
+ }
85
+ return {
86
+ podName: read("resource.k8s.pod.name"),
87
+ namespace: read("resource.k8s.namespace.name"),
88
+ nodeName: read("resource.k8s.node.name"),
89
+ containerName: read("resource.k8s.container.name"),
90
+ workloadType: workloadType,
91
+ workloadName: workloadName,
92
+ };
93
+ }
94
+ /**
95
+ * The key the worker dedupes Kubernetes datapoints on: two rows with the
96
+ * same key are the same resource.
97
+ */
98
+ static kubernetesKey(identity) {
99
+ return [
100
+ identity.podName || "",
101
+ identity.namespace || "",
102
+ identity.nodeName || "",
103
+ identity.containerName || "",
104
+ identity.workloadName || "",
105
+ ].join("|");
106
+ }
107
+ /**
108
+ * Fill in the context a Kubernetes series' own labels do not carry —
109
+ * its namespace, workload and node — from one of the series' own
110
+ * datapoints.
111
+ *
112
+ * Only what is guaranteed to be the same for EVERY datapoint of the
113
+ * series is borrowed. A pod runs on one node and belongs to one
114
+ * workload and one namespace, so a series that names a pod may borrow
115
+ * all three; a workload lives in one namespace. A series grouped by
116
+ * node may borrow nothing: a node-level series summed from container
117
+ * rows (container CPU requests per node) has a different pod and
118
+ * namespace on every row, and borrowing one would title the node with
119
+ * an arbitrary tenant. The datapoint must also agree with every field
120
+ * the series already has, or it is not the series' datapoint at all.
121
+ */
122
+ static withKubernetesContext(series, context) {
123
+ const agrees = PlatformResourceIdentity.agreesOn(series, context, [
124
+ "podName",
125
+ "namespace",
126
+ "nodeName",
127
+ "containerName",
128
+ "workloadType",
129
+ "workloadName",
130
+ ]);
131
+ if (!agrees) {
132
+ return series;
133
+ }
134
+ if (series.podName) {
135
+ return Object.assign(Object.assign({}, series), { namespace: series.namespace || context.namespace, nodeName: series.nodeName || context.nodeName, workloadType: series.workloadName
136
+ ? series.workloadType
137
+ : context.workloadType, workloadName: series.workloadName || context.workloadName });
138
+ }
139
+ if (series.workloadName && !series.containerName) {
140
+ return Object.assign(Object.assign({}, series), { namespace: series.namespace || context.namespace });
141
+ }
142
+ return series;
143
+ }
144
+ static proxmox(attributes) {
145
+ return {
146
+ resourceId: PlatformResourceIdentity.readAttribute(attributes, "id"),
147
+ resourceName: PlatformResourceIdentity.readAttribute(attributes, "name"),
148
+ resourceType: PlatformResourceIdentity.readAttribute(attributes, "pve.type"),
149
+ scope: PlatformResourceIdentity.readAttribute(attributes, "pve.scope"),
150
+ nodeName: PlatformResourceIdentity.readAttribute(attributes, "node"),
151
+ };
152
+ }
153
+ static proxmoxKey(identity) {
154
+ return [
155
+ identity.resourceId || "",
156
+ identity.resourceName || "",
157
+ identity.nodeName || "",
158
+ ].join("|");
159
+ }
160
+ /**
161
+ * A Proxmox series grouped by `id` names one guest, node or storage;
162
+ * every datapoint of it carries the same agent-stamped type and scope,
163
+ * and (on the metadata series) the same name and node.
164
+ */
165
+ static withProxmoxContext(series, context) {
166
+ if (!series.resourceId ||
167
+ !PlatformResourceIdentity.agreesOn(series, context, ["resourceId", "resourceName", "resourceType", "scope", "nodeName"])) {
168
+ return series;
169
+ }
170
+ return Object.assign(Object.assign({}, series), { resourceName: series.resourceName || context.resourceName, resourceType: series.resourceType || context.resourceType, scope: series.scope || context.scope, nodeName: series.nodeName || context.nodeName });
171
+ }
172
+ static vmware(attributes) {
173
+ const read = (key) => {
174
+ return PlatformResourceIdentity.readAttribute(attributes, key);
175
+ };
176
+ /*
177
+ * Identity lives in the RESOURCE attributes the vcenter receiver
178
+ * stamps, stored `resource.`-prefixed. A VM template is a VM with
179
+ * `isTemplate` in the inventory, so its `vcenter.vm_template.*`
180
+ * identity folds into the VM fields.
181
+ */
182
+ return {
183
+ datacenterName: read("resource.vcenter.datacenter.name"),
184
+ clusterName: read("resource.vcenter.cluster.name"),
185
+ hostName: read("resource.vcenter.host.name"),
186
+ vmName: read("resource.vcenter.vm.name") ||
187
+ read("resource.vcenter.vm_template.name"),
188
+ vmId: read("resource.vcenter.vm.id") ||
189
+ read("resource.vcenter.vm_template.id"),
190
+ datastoreName: read("resource.vcenter.datastore.name"),
191
+ resourcePoolName: read("resource.vcenter.resource_pool.name"),
192
+ resourcePoolPath: read("resource.vcenter.resource_pool.inventory_path"),
193
+ };
194
+ }
195
+ /**
196
+ * Dedupe on the full identity tuple: `vcenter.vm.id` alone identifies a
197
+ * VM, but hosts / datastores / clusters are only unique within their
198
+ * datacenter and pools within their path.
199
+ */
200
+ static vmwareKey(identity) {
201
+ return [
202
+ identity.datacenterName || "",
203
+ identity.clusterName || "",
204
+ identity.hostName || "",
205
+ identity.vmId || "",
206
+ identity.vmName || "",
207
+ identity.datastoreName || "",
208
+ identity.resourcePoolPath || identity.resourcePoolName || "",
209
+ ].join("|");
210
+ }
211
+ /**
212
+ * vSphere is a strict tree — a VM sits on one host in one cluster in one
213
+ * datacenter — so a series that names an object may borrow the objects
214
+ * ABOVE it from its own datapoint, never anything beside or below it. A
215
+ * resource pool may not borrow a host: the VMs in a pool can run on
216
+ * different hosts.
217
+ */
218
+ static withVMwareContext(series, context) {
219
+ if (!PlatformResourceIdentity.agreesOn(series, context, [
220
+ "datacenterName",
221
+ "clusterName",
222
+ "hostName",
223
+ "vmName",
224
+ "vmId",
225
+ "datastoreName",
226
+ "resourcePoolName",
227
+ "resourcePoolPath",
228
+ ])) {
229
+ return series;
230
+ }
231
+ const above = {
232
+ datacenterName: series.datacenterName || context.datacenterName,
233
+ clusterName: series.clusterName || context.clusterName,
234
+ };
235
+ if (series.vmName || series.vmId) {
236
+ return Object.assign(Object.assign(Object.assign({}, series), above), { hostName: series.hostName || context.hostName, vmName: series.vmName || context.vmName, vmId: series.vmId || context.vmId, resourcePoolName: series.resourcePoolName || context.resourcePoolName, resourcePoolPath: series.resourcePoolPath || context.resourcePoolPath });
237
+ }
238
+ if (series.resourcePoolName || series.resourcePoolPath) {
239
+ /*
240
+ * A pool's own name and inventory path are one object: a series
241
+ * grouped by the path may borrow the name (and vice versa), so it is
242
+ * titled the way the raw-scan list titles it.
243
+ */
244
+ return Object.assign(Object.assign(Object.assign({}, series), above), { resourcePoolName: series.resourcePoolName || context.resourcePoolName, resourcePoolPath: series.resourcePoolPath || context.resourcePoolPath });
245
+ }
246
+ if (series.hostName) {
247
+ return Object.assign(Object.assign({}, series), above);
248
+ }
249
+ if (series.datastoreName || series.clusterName) {
250
+ return Object.assign(Object.assign({}, series), { datacenterName: above.datacenterName });
251
+ }
252
+ return series;
253
+ }
254
+ static ceph(attributes) {
255
+ return {
256
+ daemon: PlatformResourceIdentity.readAttribute(attributes, "ceph_daemon"),
257
+ poolId: PlatformResourceIdentity.readAttribute(attributes, "pool_id"),
258
+ poolName: PlatformResourceIdentity.readAttribute(attributes, "name"),
259
+ hostname: PlatformResourceIdentity.readAttribute(attributes, "hostname"),
260
+ };
261
+ }
262
+ static cephKey(identity) {
263
+ return [
264
+ identity.daemon || "",
265
+ identity.poolId || "",
266
+ identity.poolName || "",
267
+ identity.hostname || "",
268
+ ].join("|");
269
+ }
270
+ /**
271
+ * A daemon runs on one host and a pool id has one name, so a series that
272
+ * names either may borrow those from its own datapoint.
273
+ */
274
+ static withCephContext(series, context) {
275
+ if ((!series.daemon && !series.poolId) ||
276
+ !PlatformResourceIdentity.agreesOn(series, context, ["daemon", "poolId", "poolName", "hostname"])) {
277
+ return series;
278
+ }
279
+ return Object.assign(Object.assign({}, series), { poolName: series.poolName || context.poolName, hostname: series.hostname || context.hostname });
280
+ }
281
+ static dockerSwarm(attributes) {
282
+ /*
283
+ * Prefixed: the docker_stats receiver puts container identity on the
284
+ * RESOURCE, so ClickHouse stores `resource.container.name`.
285
+ */
286
+ return {
287
+ containerName: PlatformResourceIdentity.readAttribute(attributes, "resource.container.name"),
288
+ containerImage: PlatformResourceIdentity.readAttribute(attributes, "resource.container.image.name"),
289
+ nodeName: PlatformResourceIdentity.readAttribute(attributes, "docker.swarm.node.name"),
290
+ serviceName: PlatformResourceIdentity.readAttribute(attributes, "docker.swarm.service.name"),
291
+ };
292
+ }
293
+ static dockerSwarmKey(identity) {
294
+ return [
295
+ identity.containerName || "",
296
+ identity.containerImage || "",
297
+ identity.nodeName || "",
298
+ identity.serviceName || "",
299
+ ].join("|");
300
+ }
301
+ /**
302
+ * A Swarm task's container runs one image on one node for one service,
303
+ * so a series that names the container may borrow all three.
304
+ */
305
+ static withDockerSwarmContext(series, context) {
306
+ if (!series.containerName ||
307
+ !PlatformResourceIdentity.agreesOn(series, context, ["containerName", "containerImage", "nodeName", "serviceName"])) {
308
+ return series;
309
+ }
310
+ return Object.assign(Object.assign({}, series), { containerImage: series.containerImage || context.containerImage, nodeName: series.nodeName || context.nodeName, serviceName: series.serviceName || context.serviceName });
311
+ }
312
+ /*
313
+ * True when every listed field present on both sides has the same value.
314
+ */
315
+ static agreesOn(series, context, fields) {
316
+ return fields.every((field) => {
317
+ const a = series[field];
318
+ const b = context[field];
319
+ return a === undefined || b === undefined || a === b;
320
+ });
321
+ }
322
+ }
323
+ //# sourceMappingURL=PlatformResourceIdentity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlatformResourceIdentity.js","sourceRoot":"","sources":["../../../../Utils/Monitor/PlatformResourceIdentity.ts"],"names":[],"mappings":"AAiCA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,OAAO,wBAAwB;IAC3C;;;OAGG;IACI,MAAM,CAAC,aAAa,CACzB,UAAsB,EACtB,GAAW;QAEX,MAAM,KAAK,GAAY,UAAU,CAAC,GAAG,CAAC,CAAC;QAEvC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9C,CAAC;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACxD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,0BAA0B,CAAC,MAAkB;QACzD,MAAM,MAAM,qBAAoB,MAAM,CAAE,CAAC;QACzC,MAAM,cAAc,GAAW,WAAW,CAAC;QAE3C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACtC,MAAM,aAAa,GAAW,GAAG,CAAC,UAAU,CAAC,cAAc,CAAC;gBAC1D,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC;gBACtC,CAAC,CAAC,GAAG,cAAc,GAAG,GAAG,EAAE,CAAC;YAE9B,IAAI,aAAa,IAAI,MAAM,CAAC,a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AC,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,270 @@
1
+ import { DiscoveredHostNetbiosStatus, DiscoveredHostReverseDnsStatus, readDiscoveredHostNetbiosStatus, readDiscoveredHostReverseDnsStatus, } from "../../Types/NetworkDevice/DiscoveredHostNamingStatus";
2
+ import { DiscoveryScanStatus } from "./DiscoveryScanStatus";
3
+ import { isNetbiosQueryableIPv4Address, normalizeNetbiosName, } from "./NetbiosNameUtil";
4
+ import { normalizeReverseDnsName } from "./ReverseDnsNameUtil";
5
+ import { ScanModeUtil } from "./ScanModeUtil";
6
+ export const UNNAMED_HOST_LABEL = "No name found";
7
+ export const NOT_YET_NAMED_HOST_LABEL = "Not named yet";
8
+ /*
9
+ * Said for a scan still sweeping. Names are looked up only after the sweep
10
+ * finishes (Probe/Jobs/Discovery/FetchScans.ts, scanWithDeadline), so every
11
+ * host a running scan has reported so far is unnamed by construction — the
12
+ * interesting question has not been asked yet.
13
+ */
14
+ export const IN_PROGRESS_EXPLANATION = "Names are looked up after the sweep finishes, so hosts found so far are listed by address. Open Review Results again when the scan completes.";
15
+ /*
16
+ * Said for a scan that failed. A sweep that misses its deadline or throws is
17
+ * reported without ever reaching the naming passes, so its hosts are the ones
18
+ * it had uploaded along the way — which carry no names by design.
19
+ */
20
+ export const FAILED_SCAN_EXPLANATION = "This scan stopped before it looked up names, so its hosts are listed by address. Run it again to name them.";
21
+ /*
22
+ * One sentence per code. None of them says how many times the probe asked:
23
+ * a retry has to fit in the naming pass's time budget, so "even on a retry"
24
+ * could be false for exactly the hosts a slow DNS server pushed past the
25
+ * deadline. The tip that follows these codes says to rescan, which is the
26
+ * part the operator can act on.
27
+ */
28
+ const REVERSE_DNS_SENTENCES = {
29
+ [DiscoveredHostReverseDnsStatus.NoRecord]: "Reverse DNS: the probe's DNS server has no PTR record for this address.",
30
+ [DiscoveredHostReverseDnsStatus.UnusableName]: "Reverse DNS: a PTR record came back, but it is not a valid hostname, so it was not used.",
31
+ [DiscoveredHostReverseDnsStatus.Timeout]: "Reverse DNS: the probe's DNS server did not answer in time.",
32
+ [DiscoveredHostReverseDnsStatus.ServerFailure]: "Reverse DNS: the probe's DNS server answered with a server failure (SERVFAIL).",
33
+ [DiscoveredHostReverseDnsStatus.Refused]: "Reverse DNS: the probe's DNS server refused the query.",
34
+ [DiscoveredHostReverseDnsStatus.Unreachable]: "Reverse DNS: the probe could not reach its DNS server.",
35
+ [DiscoveredHostReverseDnsStatus.Failed]: "Reverse DNS: the lookup failed on the probe.",
36
+ [DiscoveredHostReverseDnsStatus.SkippedTimeBudget]: "Reverse DNS: not looked up. The scan ran out of time for name lookups before reaching this address.",
37
+ [DiscoveredHostReverseDnsStatus.SkippedNoResolver]: "Reverse DNS: not looked up. The probe's DNS server was not answering, so it stopped asking.",
38
+ };
39
+ /*
40
+ * A row with no reverse-DNS code: stored by a probe older than the codes, or
41
+ * by one whose pass failed outright. Nothing on the row says which, or why,
42
+ * so this claims neither.
43
+ */
44
+ export const REVERSE_DNS_NOT_RECORDED_SENTENCE = "Reverse DNS: no name was recorded for this address.";
45
+ const NETBIOS_SENTENCES = {
46
+ [DiscoveredHostNetbiosStatus.NoReply]: "NetBIOS: no reply on UDP 137, which is usual for devices that are not Windows, or when a firewall blocks it.",
47
+ [DiscoveredHostNetbiosStatus.NoUsableName]: "NetBIOS: the device replied, but reported no usable name.",
48
+ [DiscoveredHostNetbiosStatus.SendFailed]: "NetBIOS: the query could not be sent from the probe.",
49
+ [DiscoveredHostNetbiosStatus.Skipped]: "NetBIOS: not asked. The lookup stopped before reaching this address.",
50
+ [DiscoveredHostNetbiosStatus.SkippedHostCap]: "NetBIOS: not asked. The scan reached the probe's NetBIOS host limit.",
51
+ [DiscoveredHostNetbiosStatus.SkippedIneligibleAddress]: "NetBIOS: not asked. Only private addresses are asked.",
52
+ [DiscoveredHostNetbiosStatus.SkippedGlobalProbe]: "NetBIOS: not asked. This scan ran on a global probe, and global probes never send NetBIOS queries.",
53
+ };
54
+ export const NETBIOS_OFF_SENTENCE = "NetBIOS: off for this scan.";
55
+ // NetBIOS was on, and yet the row carries no code: an older probe's row.
56
+ export const NETBIOS_NOT_RECORDED_SENTENCE = "NetBIOS: no name was recorded.";
57
+ export const SNMP_NOT_CHECKED_SENTENCE = "SNMP: not checked by this scan.";
58
+ export const SNMP_NO_ANSWER_SENTENCE = "SNMP: no answer with this scan's credentials.";
59
+ export const SNMP_NO_SYSNAME_SENTENCE = "SNMP: the device answered, but reported no name (sysName).";
60
+ /*
61
+ * The one piece of advice that fits the reverse-DNS code best, when any
62
+ * does. "No record" gets the one that matters most for the issue this came
63
+ * from: the probe resolves through ITS OWN DNS server, which need not be the
64
+ * one the operator checked with, so the comparison worth making is from where
65
+ * the probe resolves. That is inside its container or pod, not the machine
66
+ * under it (#3916): a pod's resolver is the cluster DNS, not the node's
67
+ * /etc/resolv.conf, and a Docker container's can differ from its host's too,
68
+ * so "from the probe's host" sent the operator to a lookup that could name
69
+ * the device while the probe's could not. The probe image ships nslookup
70
+ * (dnsutils, Probe/Dockerfile.tpl), so the advice can be followed as written.
71
+ */
72
+ export const NO_RECORD_TIP = "The probe uses its own DNS server, which may not be the one you checked with. Run nslookup on this address inside the probe's container or pod to compare.";
73
+ export const TRANSIENT_FAILURE_TIP = "Rescan to try again. If it keeps happening, check the DNS servers the probe uses, inside its container or pod.";
74
+ /*
75
+ * Offered when the scan left one or both of the ways of asking the DEVICE for
76
+ * its name switched off. Those are exactly the names the issue asked to see
77
+ * first — the one configured on the device — so saying where they come from
78
+ * is the useful answer to "but it has a hostname". Only the sources that were
79
+ * actually off, and would run if turned on, are named — for NetBIOS that
80
+ * means the probe is not a global one AND the address is one its lookup
81
+ * would query at all (isNetbiosQueryableIPv4Address).
82
+ */
83
+ export const ASK_THE_DEVICE_TIP = "Checking SNMP, or NetBIOS lookup for Windows hosts, asks the device for its own name.";
84
+ export const ASK_THE_DEVICE_SNMP_TIP = "Checking SNMP asks the device for its own name.";
85
+ export const ASK_THE_DEVICE_NETBIOS_TIP = "NetBIOS lookup asks Windows hosts for their own name.";
86
+ /*
87
+ * The codes that get TRANSIENT_FAILURE_TIP: the lookup failed rather than
88
+ * answered, so a rescan may name the host, and the DNS servers the probe's
89
+ * host uses are where to look when it does not.
90
+ *
91
+ * SkippedNoResolver is one of them although its address was never looked up
92
+ * (#3916). The probe stopped asking only because every lookup before it had
93
+ * failed in these same ways, so the advice is the same. Without it, the hosts
94
+ * a pass gave up on were the only failed lookups with nothing to check.
95
+ */
96
+ const TRANSIENT_REVERSE_DNS_STATUSES = new Set([
97
+ DiscoveredHostReverseDnsStatus.Timeout,
98
+ DiscoveredHostReverseDnsStatus.ServerFailure,
99
+ DiscoveredHostReverseDnsStatus.Refused,
100
+ DiscoveredHostReverseDnsStatus.Unreachable,
101
+ DiscoveredHostReverseDnsStatus.Failed,
102
+ DiscoveredHostReverseDnsStatus.SkippedNoResolver,
103
+ ]);
104
+ // A string with something in it besides whitespace.
105
+ function hasText(value) {
106
+ return typeof value === "string" && value.trim().length > 0;
107
+ }
108
+ /**
109
+ * True when the row would be named by something other than its address: a
110
+ * sysName, a usable PTR name or a usable NetBIOS name. Mirrors
111
+ * getDiscoveredHostFullName's order and its re-normalisation, so the hint is
112
+ * shown on exactly the rows whose name line is the address.
113
+ */
114
+ export function isDiscoveredHostNamed(host) {
115
+ return (hasText(host.sysName) ||
116
+ Boolean(normalizeReverseDnsName(host.dnsHostname)) ||
117
+ Boolean(normalizeNetbiosName(host.netbiosName)));
118
+ }
119
+ function describeSnmp(data) {
120
+ if (data.scan && !ScanModeUtil.isSnmpEnabled(data.scan)) {
121
+ return SNMP_NOT_CHECKED_SENTENCE;
122
+ }
123
+ if (data.host.snmpReachable === false) {
124
+ return SNMP_NO_ANSWER_SENTENCE;
125
+ }
126
+ /*
127
+ * Answered SNMP — or a row from before `snmpReachable` existed, when every
128
+ * host listed had answered it. Either way the host is unnamed, so whatever
129
+ * it said had no sysName in it.
130
+ */
131
+ if (data.scan || data.host.snmpReachable === true) {
132
+ return SNMP_NO_SYSNAME_SENTENCE;
133
+ }
134
+ return undefined;
135
+ }
136
+ function describeNetbios(data) {
137
+ if (data.status) {
138
+ return NETBIOS_SENTENCES[data.status];
139
+ }
140
+ // Without the scan there is no telling whether NetBIOS was ever on.
141
+ if (!data.scan) {
142
+ return undefined;
143
+ }
144
+ if (data.scan.isNetbiosLookupEnabled !== true) {
145
+ return NETBIOS_OFF_SENTENCE;
146
+ }
147
+ /*
148
+ * On, but no code: a row from a probe older than the codes. If the scan's
149
+ * probe is a global one, the lookup was skipped whatever that probe's
150
+ * version — the global-probe refusal predates the codes.
151
+ */
152
+ if (data.isGlobalProbe) {
153
+ return NETBIOS_SENTENCES[DiscoveredHostNetbiosStatus.SkippedGlobalProbe];
154
+ }
155
+ /*
156
+ * Likewise for an address outside the private and CGNAT ranges (#3916):
157
+ * the probe's refusal of those shipped in the same change as the
158
+ * isNetbiosLookupEnabled column, so no probe that honoured the setting
159
+ * ever asked one.
160
+ */
161
+ if (!data.isQueryableAddress) {
162
+ return NETBIOS_SENTENCES[DiscoveredHostNetbiosStatus.SkippedIneligibleAddress];
163
+ }
164
+ return NETBIOS_NOT_RECORDED_SENTENCE;
165
+ }
166
+ /**
167
+ * Why this discovered host has no name, or undefined when it has one (or has
168
+ * no address, which its row already explains).
169
+ *
170
+ * `isGlobalProbe` is whether the scan's probe is a global one, when the
171
+ * caller knows. It matters only for rows that carry no NetBIOS code, and for
172
+ * whether a scan with NetBIOS off is advised to turn it on.
173
+ */
174
+ export function explainUnnamedDiscoveredHost(data) {
175
+ var _a, _b;
176
+ const host = data.host;
177
+ if (!host || typeof host !== "object") {
178
+ return undefined;
179
+ }
180
+ /*
181
+ * A row with no address cannot be imported, and says so on its checkbox.
182
+ * Nullish is checked before stringifying: String(null) is "null", which
183
+ * would read as an address.
184
+ */
185
+ if (host.ipAddress === undefined ||
186
+ host.ipAddress === null ||
187
+ !hasText(String(host.ipAddress))) {
188
+ return undefined;
189
+ }
190
+ if (isDiscoveredHostNamed(host)) {
191
+ return undefined;
192
+ }
193
+ const dnsHostnameStatus = readDiscoveredHostReverseDnsStatus(host.dnsHostnameStatus);
194
+ const netbiosNameStatus = readDiscoveredHostNetbiosStatus(host.netbiosNameStatus);
195
+ /*
196
+ * A per-host code means the naming passes ran for this row, whatever the
197
+ * scan is doing now — a recurring scan keeps its previous run's results
198
+ * while the next run starts. Only a row with no code at all is explained by
199
+ * the scan's state.
200
+ */
201
+ if (!dnsHostnameStatus && !netbiosNameStatus) {
202
+ if (((_a = data.scan) === null || _a === void 0 ? void 0 : _a.status) === DiscoveryScanStatus.InProgress) {
203
+ return {
204
+ label: NOT_YET_NAMED_HOST_LABEL,
205
+ text: IN_PROGRESS_EXPLANATION,
206
+ };
207
+ }
208
+ if (((_b = data.scan) === null || _b === void 0 ? void 0 : _b.status) === DiscoveryScanStatus.Failed) {
209
+ return { label: UNNAMED_HOST_LABEL, text: FAILED_SCAN_EXPLANATION };
210
+ }
211
+ }
212
+ /*
213
+ * Whether the probe's NetBIOS lookup would send this address a query at
214
+ * all. It refuses everything but private and CGNAT IPv4, whoever asks.
215
+ */
216
+ const isNetbiosQueryableAddress = isNetbiosQueryableIPv4Address(host.ipAddress);
217
+ const netbiosSentence = describeNetbios({
218
+ status: netbiosNameStatus,
219
+ scan: data.scan,
220
+ isGlobalProbe: data.isGlobalProbe === true,
221
+ isQueryableAddress: isNetbiosQueryableAddress,
222
+ });
223
+ const sentences = [];
224
+ // The naming order, so the sentences read in the order the sources win.
225
+ const snmpSentence = describeSnmp({
226
+ host: host,
227
+ scan: data.scan,
228
+ });
229
+ if (snmpSentence) {
230
+ sentences.push(snmpSentence);
231
+ }
232
+ sentences.push(dnsHostnameStatus
233
+ ? REVERSE_DNS_SENTENCES[dnsHostnameStatus]
234
+ : REVERSE_DNS_NOT_RECORDED_SENTENCE);
235
+ if (netbiosSentence) {
236
+ sentences.push(netbiosSentence);
237
+ }
238
+ if (dnsHostnameStatus === DiscoveredHostReverseDnsStatus.NoRecord) {
239
+ sentences.push(NO_RECORD_TIP);
240
+ }
241
+ else if (dnsHostnameStatus &&
242
+ TRANSIENT_REVERSE_DNS_STATUSES.has(dnsHostnameStatus)) {
243
+ sentences.push(TRANSIENT_FAILURE_TIP);
244
+ }
245
+ const isSnmpOff = snmpSentence === SNMP_NOT_CHECKED_SENTENCE;
246
+ /*
247
+ * NetBIOS is suggested only where turning it on could work. A global probe
248
+ * never sends NetBIOS queries whatever the scan asks for, so on one this
249
+ * advice would send the operator to a setting whose only effect is the
250
+ * "not asked" line on the next scan (#3916). The bundled self-hosted probes
251
+ * are global, so that is not a rare case. The same goes for an address the
252
+ * lookup refuses — public space, IPv6, anything not a strict dotted quad —
253
+ * where the next scan would only say "Only private addresses are asked".
254
+ */
255
+ const shouldSuggestNetbios = netbiosSentence === NETBIOS_OFF_SENTENCE &&
256
+ data.isGlobalProbe !== true &&
257
+ isNetbiosQueryableAddress;
258
+ if (isSnmpOff && shouldSuggestNetbios) {
259
+ sentences.push(ASK_THE_DEVICE_TIP);
260
+ }
261
+ else if (isSnmpOff) {
262
+ sentences.push(ASK_THE_DEVICE_SNMP_TIP);
263
+ }
264
+ else if (shouldSuggestNetbios) {
265
+ sentences.push(ASK_THE_DEVICE_NETBIOS_TIP);
266
+ }
267
+ return { label: UNNAMED_HOST_LABEL, text: sentences.join(" ") };
268
+ }
269
+ export default explainUnnamedDiscoveredHost;
270
+ //# sourceMappingURL=DiscoveredHostNamingDiagnosis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiscoveredHostNamingDiagnosis.js","sourceRoot":"","sources":["../../../../Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.ts"],"names":[],"mappings":"AACA,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,EAC9B,+BAA+B,EAC/B,kCAAkC,GACnC,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,mBAAm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AAE,CAAC;QACtC,SAAS,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACrC,CAAC;SAAM,IAAI,SAAS,EAAE,CAAC;QACrB,SAAS,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IAC1C,CAAC;SAAM,IAAI,oBAAoB,EAAE,CAAC;QAChC,SAAS,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAClE,CAAC;AAED,eAAe,4BAA4B,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { readDiscoveredHostNetbiosStatus, readDiscoveredHostReverseDnsStatus, } from "../../Types/NetworkDevice/DiscoveredHostNamingStatus";
1
2
  import { normalizeNetbiosName } from "./NetbiosNameUtil";
2
3
  import { normalizeReverseDnsName } from "./ReverseDnsNameUtil";
3
4
  /*
@@ -121,6 +122,28 @@ export function normalizeDiscoveredHosts(hosts) {
121
122
  else {
122
123
  delete normalized.netbiosName;
123
124
  }
125
+ /*
126
+ * The two "why is this host unnamed" codes (OneUptime issue #3916). Not
127
+ * chosen by the scanned network, but still read out of the same verbatim
128
+ * jsonb, and the dialog turns them into tooltip copy — so only the exact
129
+ * codes survive, and anything else is DELETED for the reason the names
130
+ * above are. A code this build does not know (a newer probe's) goes the
131
+ * same way and the row falls back to the explanation older rows get.
132
+ */
133
+ const dnsHostnameStatus = readDiscoveredHostReverseDnsStatus(host.dnsHostnameStatus);
134
+ if (dnsHostnameStatus) {
135
+ normalized.dnsHostnameStatus = dnsHostnameStatus;
136
+ }
137
+ else {
138
+ delete normalized.dnsHostnameStatus;
139
+ }
140
+ const netbiosNameStatus = readDiscoveredHostNetbiosStatus(host.netbiosNameStatus);
141
+ if (netbiosNameStatus) {
142
+ normalized.netbiosNameStatus = netbiosNameStatus;
143
+ }
144
+ else {
145
+ delete normalized.netbiosNameStatus;
146
+ }
124
147
  cleaned.push(normalized);
125
148
  }
126
149
  // An address the scan reports as registered is registered on every row.