@oneuptime/common 14.0.3 → 14.0.5

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 (617) 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/OpenTelemetryIngestService.ts +19 -0
  37. package/Server/Services/PodmanResourceService.ts +43 -2
  38. package/Server/Services/ScheduledMaintenanceReminderRuleService.ts +107 -23
  39. package/Server/Services/ServiceService.ts +1 -1
  40. package/Server/Services/TelemetryUsageBillingService.ts +29 -2
  41. package/Server/Services/UserProjectSsoConsentService.ts +74 -0
  42. package/Server/Services/UserService.ts +14 -1
  43. package/Server/Types/Database/Permissions/OwnerTableRegistry.ts +18 -0
  44. package/Server/Types/Database/QueryHelper.ts +30 -1
  45. package/Server/Utils/AI/Toolbox/ResourceTools.ts +69 -1
  46. package/Server/Utils/Database/AffectedResourceRelations.ts +6 -0
  47. package/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.ts +188 -6
  48. package/Server/Utils/Monitor/MonitorAlert.ts +28 -1
  49. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +2262 -755
  50. package/Server/Utils/Monitor/MonitorIncident.ts +28 -1
  51. package/Server/Utils/Monitor/MonitorMaintenanceSuppression.ts +268 -6
  52. package/Server/Utils/Monitor/MonitorResource.ts +47 -11
  53. package/Server/Utils/Monitor/MonitorResourceContext.ts +1 -0
  54. package/Server/Utils/Monitor/MonitorStepResourceIdentity.ts +239 -21
  55. package/Server/Utils/Monitor/PerSeriesResolutionRootCause.ts +43 -0
  56. package/Server/Utils/Monitor/SeriesResourceLabels.ts +291 -0
  57. package/Server/Utils/Monitor/SeriesResourceLinker.ts +111 -12
  58. package/Server/Utils/Rules/RuleRun/RuleRunRegistry.ts +25 -0
  59. package/Server/Utils/StartServer.ts +26 -6
  60. package/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.ts +2 -0
  61. package/Server/Utils/Telemetry/DatabaseEndpointDiscovery.ts +688 -0
  62. package/Server/Utils/Telemetry/EntityRegistry.ts +5 -1
  63. package/Server/Utils/Telemetry/LogExceptionExtractor.ts +18 -1
  64. package/Server/Utils/Telemetry/ResourceEntityFilter.ts +175 -12
  65. package/Server/Utils/Telemetry/ResourceFacetResolver.ts +12 -0
  66. package/Server/Utils/Telemetry/ServiceDependencyDiscovery.ts +606 -36
  67. package/Server/Utils/Telemetry/Telemetry.ts +16 -0
  68. package/Server/Utils/Telemetry/TelemetryEntity.ts +22 -22
  69. package/Server/Utils/Telemetry/TelemetryIngestionKeyGuard.ts +16 -10
  70. package/Tests/App/Accounts/SignedInRedirect.test.tsx +241 -0
  71. package/Tests/App/AdminDashboard/AdminHeaderSmallScreens.test.tsx +221 -4
  72. package/Tests/App/Dashboard/AIInsightsResourcePageContext.test.ts +42 -0
  73. package/Tests/App/Dashboard/AffectedResourcesDisplay.test.tsx +100 -0
  74. package/Tests/App/Dashboard/AffectedResourcesPicker.test.tsx +86 -0
  75. package/Tests/App/Dashboard/AffectedResourcesPickerHiddenTypes.test.tsx +2 -0
  76. package/Tests/App/Dashboard/AffectedResourcesSummaryStep.test.tsx +19 -0
  77. package/Tests/App/Dashboard/BreadcrumbCoverage.test.tsx +14 -0
  78. package/Tests/App/Dashboard/CorrelateFilterBuilder.test.tsx +26 -1
  79. package/Tests/App/Dashboard/DashboardAppSsoError.test.tsx +501 -0
  80. package/Tests/App/Dashboard/DashboardHeaderRequests.test.tsx +64 -1
  81. package/Tests/App/Dashboard/DashboardHeaderSmallScreens.test.tsx +178 -18
  82. package/Tests/App/Dashboard/DashboardMasterPageSsoRedirect.test.tsx +444 -0
  83. package/Tests/App/Dashboard/DashboardNavBarForeignHiddenRule.test.tsx +573 -0
  84. package/Tests/App/Dashboard/DatabaseChartAxes.test.tsx +431 -0
  85. package/Tests/App/Dashboard/DatabaseContainerDetailBadge.test.tsx +249 -0
  86. package/Tests/App/Dashboard/DatabaseDashboardE2EFixes.test.ts +681 -0
  87. package/Tests/App/Dashboard/DatabaseDocumentationMarkdown.test.ts +1801 -0
  88. package/Tests/App/Dashboard/DatabaseFleetSummaryRefresh.test.tsx +280 -0
  89. package/Tests/App/Dashboard/DatabaseFormHelpers.test.tsx +321 -0
  90. package/Tests/App/Dashboard/DatabaseMetricMonitorLink.test.tsx +795 -0
  91. package/Tests/App/Dashboard/DatabaseOverviewHeader.test.tsx +580 -0
  92. package/Tests/App/Dashboard/DatabaseRecommendationsEngineMetrics.test.ts +270 -0
  93. package/Tests/App/Dashboard/DatabaseServerComponents.test.tsx +1486 -0
  94. package/Tests/App/Dashboard/DatabaseServerEngineMetricsFilter.test.ts +223 -0
  95. package/Tests/App/Dashboard/DatabaseServerPresentation.test.ts +435 -0
  96. package/Tests/App/Dashboard/DatabaseServerSummary.test.ts +186 -0
  97. package/Tests/App/Dashboard/DatabaseServerTelemetryQueries.test.ts +1553 -0
  98. package/Tests/App/Dashboard/DatabaseTableTruncation.test.tsx +326 -0
  99. package/Tests/App/Dashboard/DatabaseTelemetryScope.test.ts +512 -0
  100. package/Tests/App/Dashboard/DatabaseTelemetryTabs.test.tsx +774 -0
  101. package/Tests/App/Dashboard/DatabaseViewLayout.test.tsx +233 -0
  102. package/Tests/App/Dashboard/DatabaseWorkloadBadge.test.tsx +972 -0
  103. package/Tests/App/Dashboard/DiscoveryReviewInventoryRefresh.test.tsx +5 -0
  104. package/Tests/App/Dashboard/DiscoveryReviewUnnamedHostHint.test.tsx +1061 -0
  105. package/Tests/App/Dashboard/EventOverlayScope.test.ts +147 -0
  106. package/Tests/App/Dashboard/EventOverlayScopeHook.test.tsx +1 -0
  107. package/Tests/App/Dashboard/LogsResourceFacetChips.test.tsx +1 -0
  108. package/Tests/App/Dashboard/MetricsViewerDrillDown.test.tsx +310 -0
  109. package/Tests/App/Dashboard/MetricsViewerEntityScopedRows.test.tsx +495 -0
  110. package/Tests/App/Dashboard/MonitorCreateFromMonitorBackedDevice.test.tsx +132 -1
  111. package/Tests/App/Dashboard/NavigationSearchKeywords.test.tsx +5 -0
  112. package/Tests/App/Dashboard/ProductOrientation.test.tsx +4 -3
  113. package/Tests/App/Dashboard/RecommendationsLoadedContext.test.tsx +349 -0
  114. package/Tests/App/Dashboard/ResourceArchiveSettings.test.tsx +62 -0
  115. package/Tests/App/Dashboard/ResourceFeedPageWiring.test.ts +8 -1
  116. package/Tests/App/Dashboard/ResourceFeedPagesFilterSort.test.tsx +14 -0
  117. package/Tests/App/Dashboard/ScheduledMaintenanceOverviewPage.test.tsx +2 -0
  118. package/Tests/App/Dashboard/ServiceMapDatabaseLink.test.tsx +1085 -0
  119. package/Tests/App/Dashboard/TelemetryResourceRetentionSettings.test.tsx +10 -0
  120. package/Tests/App/Dashboard/TracesResourceFacets.test.tsx +2 -1
  121. package/Tests/App/StatusPage/StatusPageHeaderForeignHiddenRule.test.tsx +284 -0
  122. package/Tests/ClassStrings.ts +178 -0
  123. package/Tests/Fixtures/MobilePasskeyUser.json +1 -2
  124. package/Tests/ForeignHiddenRuleGuard.ts +2152 -0
  125. package/Tests/Models/DatabaseModels/DatabaseServerModels.test.ts +2250 -0
  126. package/Tests/Models/DatabaseModels/ResourceFeedModels.test.ts +24 -5
  127. package/Tests/Models/DatabaseModels/StaticRuleCriteriaInheritance.test.ts +4 -2
  128. package/Tests/RenderedMarkup.ts +518 -0
  129. package/Tests/ResponsiveVisibility.test.ts +490 -4
  130. package/Tests/ResponsiveVisibility.ts +505 -52
  131. package/Tests/Server/Infrastructure/Postgres/AddConfigurableRuleCriteriaMigration.test.ts +3 -0
  132. package/Tests/Server/Infrastructure/Postgres/AddDatabaseServerTablesMigration.test.ts +541 -0
  133. package/Tests/Server/Infrastructure/Postgres/AddUserProjectSsoConsentMigration.test.ts +234 -0
  134. package/Tests/Server/Services/ContainerSnapshotUpsertPostgres.test.ts +319 -0
  135. package/Tests/Server/Services/CrossProjectRelationWriteGuard.test.ts +13 -0
  136. package/Tests/Server/Services/DatabaseServerEndpointService.test.ts +2033 -0
  137. package/Tests/Server/Services/DatabaseServerFeedAndOwnerServices.test.ts +529 -0
  138. package/Tests/Server/Services/DatabaseServerLifecycle.test.ts +3302 -0
  139. package/Tests/Server/Services/DatabaseServerRegistries.test.ts +603 -0
  140. package/Tests/Server/Services/DatabaseServerRuleEngines.test.ts +754 -0
  141. package/Tests/Server/Services/DatabaseServerService.test.ts +3558 -0
  142. package/Tests/Server/Services/DatabaseServerSqlPostgres.test.ts +2045 -0
  143. package/Tests/Server/Services/DatabaseServiceUpdateColumnsIfUnlockedPostgres.test.ts +362 -0
  144. package/Tests/Server/Services/DatabaseServiceUpdateColumnsIfUnlockedReply.test.ts +210 -0
  145. package/Tests/Server/Services/HookFreeWriteLengthClamp.test.ts +18 -0
  146. package/Tests/Server/Services/IncidentAlertSloLinkSurvivesEdit.test.ts +2 -0
  147. package/Tests/Server/Services/IncomingCallPolicyEscalationRuleTarget.test.ts +225 -0
  148. package/Tests/Server/Services/InventoryItemDisplayName.test.ts +280 -2
  149. package/Tests/Server/Services/InventoryUpsertSchemaParity.test.ts +8 -2
  150. package/Tests/Server/Services/IoTDeviceLatestMetricsPostgres.test.ts +689 -0
  151. package/Tests/Server/Services/IoTDeviceService.test.ts +379 -0
  152. package/Tests/Server/Services/LatestMetricsValuesShape.test.ts +360 -0
  153. package/Tests/Server/Services/LlmModelPriceService.test.ts +402 -0
  154. package/Tests/Server/Services/OpenTelemetryResourceRetentionMemo.test.ts +7 -1
  155. package/Tests/Server/Services/OwnerRowUniqueness.test.ts +61 -9
  156. package/Tests/Server/Services/ReminderRuleLookupPostgres.test.ts +2250 -0
  157. package/Tests/Server/Services/ReminderRuleRefreshOpenSubjectsPaging.test.ts +653 -0
  158. package/Tests/Server/Services/ResourceUpdateLastSeenLivenessFallback.test.ts +68 -20
  159. package/Tests/Server/Services/StaticRuleCriteriaRuntimeCoverage.test.ts +3 -3
  160. package/Tests/Server/Services/TelemetryResourceFacetCounting.test.ts +9 -0
  161. package/Tests/Server/Services/UserProjectSsoConsentPostgres.test.ts +153 -0
  162. package/Tests/Server/Services/UserProjectSsoConsentService.test.ts +192 -0
  163. package/Tests/Server/Services/UserServiceFirstMasterAdminElection.test.ts +71 -0
  164. package/Tests/Server/Services/UserSignupIdTakeoverPostgres.test.ts +238 -0
  165. package/Tests/Server/Services/WorkspaceNotificationSummaryHelpers.test.ts +592 -0
  166. package/Tests/Server/Types/Billing/PayAsYouGoMeteredAuthorization.test.ts +3 -0
  167. package/Tests/Server/Types/Database/EventOverlayScopePostgres.test.ts +1 -0
  168. package/Tests/Server/Types/Database/FeedEventTypeFilterQuery.test.ts +11 -0
  169. package/Tests/Server/Types/Database/Permissions/InfrastructureOwnershipScope.test.ts +8 -0
  170. package/Tests/Server/Types/Database/QueryHelperBooleanForCriteriaBackedRule.test.ts +1094 -0
  171. package/Tests/Server/Utils/AI/ResourceTools.test.ts +134 -0
  172. package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.test.ts +41 -0
  173. package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteriaAnomalyUnits.test.ts +279 -9
  174. package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteriaDisplayContext.test.ts +933 -0
  175. package/Tests/Server/Utils/Monitor/DatabaseMaintenanceSuppression.test.ts +582 -0
  176. package/Tests/Server/Utils/Monitor/DatabaseServerMonitorLinking.test.ts +753 -0
  177. package/Tests/Server/Utils/Monitor/MonitorActionTimestamps.test.ts +1 -0
  178. package/Tests/Server/Utils/Monitor/MonitorAlertCriteriaReferences.test.ts +1 -0
  179. package/Tests/Server/Utils/Monitor/MonitorAlertResourceLinking.test.ts +119 -0
  180. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluator.test.ts +60 -25
  181. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorAffectedResourceEdgeCases.test.ts +1719 -0
  182. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorKubernetesAffectedResources.test.ts +1447 -0
  183. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorKubernetesRatioEmail.test.ts +352 -0
  184. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPlatformMetricUnits.test.ts +717 -0
  185. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPlatformRawScan.test.ts +2125 -0
  186. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPlatformSeriesAffectedResources.test.ts +1288 -0
  187. package/Tests/Server/Utils/Monitor/MonitorDependencySuppressionCreatorSkip.test.ts +1 -0
  188. package/Tests/Server/Utils/Monitor/MonitorIncidentCriteriaReferences.test.ts +1 -0
  189. package/Tests/Server/Utils/Monitor/MonitorIncidentMemberRoleMembership.test.ts +1 -0
  190. package/Tests/Server/Utils/Monitor/MonitorIncidentResourceLinking.test.ts +88 -0
  191. package/Tests/Server/Utils/Monitor/MonitorMaintenanceSuppression.test.ts +205 -0
  192. package/Tests/Server/Utils/Monitor/MonitorResourceContext.test.ts +62 -0
  193. package/Tests/Server/Utils/Monitor/MonitorResourceDatabaseMaintenance.test.ts +803 -0
  194. package/Tests/Server/Utils/Monitor/MonitorStepResourceIdentity.test.ts +133 -3
  195. package/Tests/Server/Utils/Monitor/MonitorSummaryPersistence.test.ts +1 -0
  196. package/Tests/Server/Utils/Monitor/PerSeriesRecoveryResolution.test.ts +472 -1
  197. package/Tests/Server/Utils/Monitor/PerSeriesSecondEntityAlerting.test.ts +1 -0
  198. package/Tests/Server/Utils/Monitor/SeriesResourceLinker.test.ts +236 -2
  199. package/Tests/Server/Utils/SeriesResourceLabels.test.ts +70 -0
  200. package/Tests/Server/Utils/StartServerProtobufContentType.test.ts +54 -0
  201. package/Tests/Server/Utils/Telemetry/DatabaseEndpointDiscovery.test.ts +1895 -0
  202. package/Tests/Server/Utils/Telemetry/EntityRegistry.test.ts +7 -0
  203. package/Tests/Server/Utils/Telemetry/LogExceptionExtractorSeverityGate.test.ts +90 -0
  204. package/Tests/Server/Utils/Telemetry/ResourceEntityFilter.test.ts +570 -0
  205. package/Tests/Server/Utils/Telemetry/ResourceFacetResolver.test.ts +97 -2
  206. package/Tests/Server/Utils/Telemetry/ServiceDependencyDiscovery.test.ts +1337 -0
  207. package/Tests/Server/Utils/Telemetry/TelemetryEntity.test.ts +295 -0
  208. package/Tests/Types/AI/AIResourceContext.test.ts +30 -0
  209. package/Tests/Types/DatabaseServer/DatabaseContainerClassifier.test.ts +3644 -0
  210. package/Tests/Types/DatabaseServer/DatabaseContainerCommand.test.ts +340 -0
  211. package/Tests/Types/DatabaseServer/DatabaseContainerCommandCorpus.ts +826 -0
  212. package/Tests/Types/DatabaseServer/DatabaseContainerCommandPostgres.test.ts +150 -0
  213. package/Tests/Types/DatabaseServer/DatabaseEndpoint.test.ts +2657 -0
  214. package/Tests/Types/DatabaseServer/DatabaseServerDiscoverySource.test.ts +64 -0
  215. package/Tests/Types/DatabaseServer/DatabaseServerEntityKeys.test.ts +952 -0
  216. package/Tests/Types/DatabaseServer/DatabaseServerMetricCatalog.test.ts +1161 -0
  217. package/Tests/Types/DatabaseServer/DatabaseSystem.test.ts +1514 -0
  218. package/Tests/Types/DatabaseServer/DatabaseTelemetryResolver.test.ts +1558 -0
  219. package/Tests/Types/Monitor/CephAlertTemplates.test.ts +255 -6
  220. package/Tests/Types/Monitor/DatabaseAlertTemplates.test.ts +2254 -0
  221. package/Tests/Types/Monitor/KubernetesAlertTemplates.test.ts +298 -0
  222. package/Tests/Types/Monitor/KubernetesMetricCatalog.test.ts +271 -0
  223. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCatalog.test.ts +253 -9
  224. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCoverage.test.ts +13 -5
  225. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationNotificationMode.test.ts +4 -2
  226. package/Tests/Types/Monitor/Recommendation/MonitorRecommendationUtil.test.ts +111 -2
  227. package/Tests/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.test.ts +61 -0
  228. package/Tests/Types/Monitor/SeriesContext/SeriesLabelDisplay.test.ts +114 -0
  229. package/Tests/Types/Monitor/Utils/KubernetesAgentEmittedMetrics.ts +181 -0
  230. package/Tests/Types/NetworkDevice/DiscoveredHostNamingStatus.test.ts +401 -0
  231. package/Tests/Types/Telemetry/ResourceEntityFacet.test.ts +4 -1
  232. package/Tests/Types/Telemetry/ResourceFacetCatalog.test.ts +24 -2
  233. package/Tests/UI/Components/Card.test.tsx +93 -2
  234. package/Tests/UI/Components/FeedOptions.test.ts +6 -0
  235. package/Tests/UI/Components/FeedOptionsButton.test.tsx +8 -1
  236. package/Tests/UI/Components/ForeignHiddenRuleResilience.test.tsx +1147 -0
  237. package/Tests/UI/Components/HeaderRightRail.test.tsx +41 -1
  238. package/Tests/UI/Components/LogsEntityNames.test.ts +16 -1
  239. package/Tests/UI/Components/LogsFacetSidebarHiddenFacets.test.tsx +7 -3
  240. package/Tests/UI/Components/ResourceFacetConfigs.test.ts +2 -1
  241. package/Tests/UI/Components/RuleCriteria/RuleCriteriaModelTable.test.tsx +3 -3
  242. package/Tests/UI/Components/SrOnlyForeignRule.test.tsx +994 -0
  243. package/Tests/UI/Components/StatusPage/ResourceListSelection.test.tsx +34 -1
  244. package/Tests/UI/Components/TelemetryFacetSidebarHiddenFacets.test.tsx +4 -1
  245. package/Tests/UI/ForeignHiddenRuleGuard.test.ts +1951 -0
  246. package/Tests/UI/Rum/ReplayPlayerChrome.test.tsx +19 -1
  247. package/Tests/UI/Rum/ReplayTabSwitcher.test.tsx +19 -1
  248. package/Tests/UI/TailwindPlayCdnForeignHiddenRule.test.ts +1005 -0
  249. package/Tests/UI/ThemeGroupHoverReveal.test.ts +847 -0
  250. package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +70 -0
  251. package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +21 -0
  252. package/Tests/UI/Utils/ModelAPISsoRedirect.test.ts +127 -0
  253. package/Tests/UI/Utils/Navigation.test.ts +102 -0
  254. package/Tests/UI/Utils/Telemetry/TelemetryEntityNames.test.ts +23 -0
  255. package/Tests/Utils/LabelRuleImportExport.test.ts +5 -0
  256. package/Tests/Utils/MetricUnitUtil.test.ts +227 -2
  257. package/Tests/Utils/Monitor/MetricValueFormatter.test.ts +288 -2
  258. package/Tests/Utils/Monitor/PlatformResourceIdentityAndUnits.test.ts +1559 -0
  259. package/Tests/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.test.ts +2546 -0
  260. package/Tests/Utils/NetworkDiscovery/DiscoveredHostUtil.test.ts +315 -0
  261. package/Tests/Utils/NetworkDiscovery/DiscoveryReverseDnsChain.test.ts +336 -1
  262. package/Tests/Utils/NetworkDiscovery/NetbiosNameUtil.test.ts +244 -0
  263. package/Tests/Utils/ValueFormatter.test.ts +50 -0
  264. package/Tests/tsconfig.json +16 -0
  265. package/Types/AI/AIResourceContext.ts +7 -0
  266. package/Types/Dashboard/DashboardTemplates.ts +2 -1
  267. package/Types/DatabaseServer/DatabaseConnectionSpan.ts +77 -0
  268. package/Types/DatabaseServer/DatabaseContainerClassifier.ts +2068 -0
  269. package/Types/DatabaseServer/DatabaseContainerCommand.ts +801 -0
  270. package/Types/DatabaseServer/DatabaseEndpoint.ts +1943 -0
  271. package/Types/DatabaseServer/DatabaseServerDiscoverySource.ts +68 -0
  272. package/Types/DatabaseServer/DatabaseServerMetricCatalog.ts +966 -0
  273. package/Types/DatabaseServer/DatabaseSystem.ts +2124 -0
  274. package/Types/DatabaseServer/DatabaseTelemetryResolver.ts +555 -0
  275. package/Types/Email/EmailTemplateType.ts +1 -0
  276. package/Types/Monitor/CephAlertTemplates.ts +18 -0
  277. package/Types/Monitor/DatabaseAlertTemplates.ts +2020 -0
  278. package/Types/Monitor/KubernetesAlertTemplates.ts +64 -24
  279. package/Types/Monitor/KubernetesMetricCatalog.ts +118 -19
  280. package/Types/Monitor/MetricMonitor/MetricCriteriaContext.ts +14 -0
  281. package/Types/Monitor/MetricMonitor/MetricMonitorResponse.ts +93 -10
  282. package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.ts +109 -8
  283. package/Types/Monitor/Recommendation/MonitorRecommendationTypes.ts +36 -7
  284. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.ts +43 -2
  285. package/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.ts +41 -6
  286. package/Types/Monitor/SeriesContext/SeriesLabelDisplay.ts +26 -0
  287. package/Types/NetworkDevice/DiscoveredHostNamingStatus.ts +147 -0
  288. package/Types/Permission.ts +267 -0
  289. package/Types/Probe/ProbeApiIngestResponse.ts +8 -0
  290. package/Types/Rules/RuleCriteriaFieldRegistry.ts +10 -0
  291. package/Types/Rules/RuleRun.ts +12 -0
  292. package/Types/Telemetry/EntityType.ts +23 -0
  293. package/Types/Telemetry/ResourceFacetCatalog.ts +14 -0
  294. package/Types/Telemetry/ServiceType.ts +8 -0
  295. package/UI/Components/Banner/Banner.tsx +1 -1
  296. package/UI/Components/Card/Card.tsx +1 -1
  297. package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +2 -2
  298. package/UI/Components/Charts/Line/LineChart.tsx +7 -0
  299. package/UI/Components/CommandPalette/CommandPalette.tsx +1 -1
  300. package/UI/Components/Date/StartAndEndDate.tsx +5 -5
  301. package/UI/Components/Diagram/HorizontalStepChain.tsx +1 -1
  302. package/UI/Components/Feed/FeedOptionsButton.tsx +1 -1
  303. package/UI/Components/Forms/BasicForm.tsx +1 -1
  304. package/UI/Components/Header/Header.tsx +1 -1
  305. package/UI/Components/Header/HeaderIconDropdownButton.tsx +1 -1
  306. package/UI/Components/HeaderAlert/HeaderAlert.tsx +1 -1
  307. package/UI/Components/LogsViewer/components/FacetValueRow.tsx +1 -1
  308. package/UI/Components/LogsViewer/components/LogsFacetSidebar.tsx +1 -1
  309. package/UI/Components/Modal/ModalFooter.tsx +1 -1
  310. package/UI/Components/ModelDetail/CardModelDetail.tsx +2 -2
  311. package/UI/Components/ModelTable/BaseModelTable.tsx +4 -4
  312. package/UI/Components/Navbar/NavBar.tsx +9 -2
  313. package/UI/Components/Navbar/NavBarMenuModal.tsx +2 -2
  314. package/UI/Components/Page/Page.tsx +1 -1
  315. package/UI/Components/Pagination/Pagination.tsx +3 -3
  316. package/UI/Components/ProgressButtons/ProgressButtonItem.tsx +1 -1
  317. package/UI/Components/SideMenu/SideMenu.tsx +4 -1
  318. package/UI/Components/StatusPage/ResourceGroupNavigator.tsx +4 -2
  319. package/UI/Components/StatusPage/ResourceList.tsx +6 -6
  320. package/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.tsx +1 -1
  321. package/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.tsx +1 -1
  322. package/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.tsx +1 -1
  323. package/UI/Components/Workflow/ComponentsModal.tsx +2 -2
  324. package/UI/Components/Workflow/StepTraceViewer.tsx +1 -1
  325. package/UI/Styles/Theme.css +8 -1
  326. package/UI/Utils/Navigation.ts +89 -42
  327. package/UI/Utils/Telemetry/TelemetryEntityNames.ts +7 -0
  328. package/UI/Utils/TelemetryService.ts +4 -3
  329. package/Utils/LabelRuleImportExport.ts +2 -0
  330. package/Utils/MetricUnitUtil.ts +103 -11
  331. package/Utils/Monitor/MetricValueFormatter.ts +66 -13
  332. package/Utils/Monitor/PlatformMetricUnitUtil.ts +215 -0
  333. package/Utils/Monitor/PlatformResourceIdentity.ts +514 -0
  334. package/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.ts +425 -0
  335. package/Utils/NetworkDiscovery/DiscoveredHostUtil.ts +32 -0
  336. package/Utils/NetworkDiscovery/NetbiosNameUtil.ts +73 -0
  337. package/Utils/Telemetry/DatabaseServerEntityKeys.ts +275 -0
  338. package/Utils/Telemetry/EntityKey.ts +176 -0
  339. package/Utils/ValueFormatter.ts +16 -0
  340. package/build/dist/Models/DatabaseModels/Alert.js +54 -0
  341. package/build/dist/Models/DatabaseModels/Alert.js.map +1 -1
  342. package/build/dist/Models/DatabaseModels/DatabaseServer.js +1683 -0
  343. package/build/dist/Models/DatabaseModels/DatabaseServer.js.map +1 -0
  344. package/build/dist/Models/DatabaseModels/DatabaseServerEndpoint.js +559 -0
  345. package/build/dist/Models/DatabaseModels/DatabaseServerEndpoint.js.map +1 -0
  346. package/build/dist/Models/DatabaseModels/DatabaseServerFeed.js +648 -0
  347. package/build/dist/Models/DatabaseModels/DatabaseServerFeed.js.map +1 -0
  348. package/build/dist/Models/DatabaseModels/DatabaseServerLabelRule.js +522 -0
  349. package/build/dist/Models/DatabaseModels/DatabaseServerLabelRule.js.map +1 -0
  350. package/build/dist/Models/DatabaseModels/DatabaseServerOwnerRule.js +603 -0
  351. package/build/dist/Models/DatabaseModels/DatabaseServerOwnerRule.js.map +1 -0
  352. package/build/dist/Models/DatabaseModels/DatabaseServerOwnerTeam.js +506 -0
  353. package/build/dist/Models/DatabaseModels/DatabaseServerOwnerTeam.js.map +1 -0
  354. package/build/dist/Models/DatabaseModels/DatabaseServerOwnerUser.js +505 -0
  355. package/build/dist/Models/DatabaseModels/DatabaseServerOwnerUser.js.map +1 -0
  356. package/build/dist/Models/DatabaseModels/Incident.js +54 -0
  357. package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
  358. package/build/dist/Models/DatabaseModels/Index.js +16 -0
  359. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  360. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
  361. package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js +54 -0
  362. package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js.map +1 -1
  363. package/build/dist/Models/DatabaseModels/TelemetryException.js +2 -0
  364. package/build/dist/Models/DatabaseModels/TelemetryException.js.map +1 -1
  365. package/build/dist/Models/DatabaseModels/UserProjectSsoConsent.js +162 -0
  366. package/build/dist/Models/DatabaseModels/UserProjectSsoConsent.js.map +1 -0
  367. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795000000000-AddDatabaseServerTables.js +240 -0
  368. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795000000000-AddDatabaseServerTables.js.map +1 -0
  369. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795100000000-AddUserProjectSsoConsent.js +26 -0
  370. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795100000000-AddUserProjectSsoConsent.js.map +1 -0
  371. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
  372. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  373. package/build/dist/Server/Middleware/MultipartFormData.js +1 -1
  374. package/build/dist/Server/Middleware/TelemetryIngest.js +15 -8
  375. package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
  376. package/build/dist/Server/Services/AlertReminderRuleService.js +72 -23
  377. package/build/dist/Server/Services/AlertReminderRuleService.js.map +1 -1
  378. package/build/dist/Server/Services/DatabaseServerEndpointService.js +694 -0
  379. package/build/dist/Server/Services/DatabaseServerEndpointService.js.map +1 -0
  380. package/build/dist/Server/Services/DatabaseServerFeedService.js +110 -0
  381. package/build/dist/Server/Services/DatabaseServerFeedService.js.map +1 -0
  382. package/build/dist/Server/Services/DatabaseServerLabelRuleEngineService.js +272 -0
  383. package/build/dist/Server/Services/DatabaseServerLabelRuleEngineService.js.map +1 -0
  384. package/build/dist/Server/Services/DatabaseServerLabelRuleService.js +13 -0
  385. package/build/dist/Server/Services/DatabaseServerLabelRuleService.js.map +1 -0
  386. package/build/dist/Server/Services/DatabaseServerOwnerRuleEngineService.js +340 -0
  387. package/build/dist/Server/Services/DatabaseServerOwnerRuleEngineService.js.map +1 -0
  388. package/build/dist/Server/Services/DatabaseServerOwnerRuleService.js +13 -0
  389. package/build/dist/Server/Services/DatabaseServerOwnerRuleService.js.map +1 -0
  390. package/build/dist/Server/Services/DatabaseServerOwnerTeamService.js +160 -0
  391. package/build/dist/Server/Services/DatabaseServerOwnerTeamService.js.map +1 -0
  392. package/build/dist/Server/Services/DatabaseServerOwnerUserService.js +153 -0
  393. package/build/dist/Server/Services/DatabaseServerOwnerUserService.js.map +1 -0
  394. package/build/dist/Server/Services/DatabaseServerService.js +3272 -0
  395. package/build/dist/Server/Services/DatabaseServerService.js.map +1 -0
  396. package/build/dist/Server/Services/DatabaseService.js +8 -4
  397. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  398. package/build/dist/Server/Services/DockerResourceService.js +30 -3
  399. package/build/dist/Server/Services/DockerResourceService.js.map +1 -1
  400. package/build/dist/Server/Services/IncidentReminderRuleService.js +73 -23
  401. package/build/dist/Server/Services/IncidentReminderRuleService.js.map +1 -1
  402. package/build/dist/Server/Services/Index.js +16 -0
  403. package/build/dist/Server/Services/Index.js.map +1 -1
  404. package/build/dist/Server/Services/InventoryItemService.js +88 -5
  405. package/build/dist/Server/Services/InventoryItemService.js.map +1 -1
  406. package/build/dist/Server/Services/IoTDeviceService.js +111 -24
  407. package/build/dist/Server/Services/IoTDeviceService.js.map +1 -1
  408. package/build/dist/Server/Services/OpenTelemetryIngestService.js +24 -9
  409. package/build/dist/Server/Services/OpenTelemetryIngestService.js.map +1 -1
  410. package/build/dist/Server/Services/PodmanResourceService.js +30 -3
  411. package/build/dist/Server/Services/PodmanResourceService.js.map +1 -1
  412. package/build/dist/Server/Services/ScheduledMaintenanceReminderRuleService.js +75 -23
  413. package/build/dist/Server/Services/ScheduledMaintenanceReminderRuleService.js.map +1 -1
  414. package/build/dist/Server/Services/ServiceService.js +1 -1
  415. package/build/dist/Server/Services/ServiceService.js.map +1 -1
  416. package/build/dist/Server/Services/TelemetryUsageBillingService.js +23 -2
  417. package/build/dist/Server/Services/TelemetryUsageBillingService.js.map +1 -1
  418. package/build/dist/Server/Services/UserProjectSsoConsentService.js +79 -0
  419. package/build/dist/Server/Services/UserProjectSsoConsentService.js.map +1 -0
  420. package/build/dist/Server/Services/UserService.js +13 -1
  421. package/build/dist/Server/Services/UserService.js.map +1 -1
  422. package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js +18 -0
  423. package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js.map +1 -1
  424. package/build/dist/Server/Types/Database/QueryHelper.js +26 -1
  425. package/build/dist/Server/Types/Database/QueryHelper.js.map +1 -1
  426. package/build/dist/Server/Utils/AI/Toolbox/ResourceTools.js +46 -0
  427. package/build/dist/Server/Utils/AI/Toolbox/ResourceTools.js.map +1 -1
  428. package/build/dist/Server/Utils/Database/AffectedResourceRelations.js +6 -0
  429. package/build/dist/Server/Utils/Database/AffectedResourceRelations.js.map +1 -1
  430. package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js +134 -13
  431. package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js.map +1 -1
  432. package/build/dist/Server/Utils/Monitor/MonitorAlert.js +22 -6
  433. package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
  434. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +1489 -524
  435. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  436. package/build/dist/Server/Utils/Monitor/MonitorIncident.js +22 -6
  437. package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
  438. package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js +196 -6
  439. package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js.map +1 -1
  440. package/build/dist/Server/Utils/Monitor/MonitorResource.js +36 -9
  441. package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
  442. package/build/dist/Server/Utils/Monitor/MonitorResourceContext.js +1 -0
  443. package/build/dist/Server/Utils/Monitor/MonitorResourceContext.js.map +1 -1
  444. package/build/dist/Server/Utils/Monitor/MonitorStepResourceIdentity.js +175 -17
  445. package/build/dist/Server/Utils/Monitor/MonitorStepResourceIdentity.js.map +1 -1
  446. package/build/dist/Server/Utils/Monitor/PerSeriesResolutionRootCause.js +29 -0
  447. package/build/dist/Server/Utils/Monitor/PerSeriesResolutionRootCause.js.map +1 -0
  448. package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js +211 -0
  449. package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js.map +1 -1
  450. package/build/dist/Server/Utils/Monitor/SeriesResourceLinker.js +82 -10
  451. package/build/dist/Server/Utils/Monitor/SeriesResourceLinker.js.map +1 -1
  452. package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js +25 -0
  453. package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js.map +1 -1
  454. package/build/dist/Server/Utils/StartServer.js +20 -4
  455. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  456. package/build/dist/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.js +2 -0
  457. package/build/dist/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.js.map +1 -1
  458. package/build/dist/Server/Utils/Telemetry/DatabaseEndpointDiscovery.js +442 -0
  459. package/build/dist/Server/Utils/Telemetry/DatabaseEndpointDiscovery.js.map +1 -0
  460. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +5 -1
  461. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
  462. package/build/dist/Server/Utils/Telemetry/LogExceptionExtractor.js +15 -1
  463. package/build/dist/Server/Utils/Telemetry/LogExceptionExtractor.js.map +1 -1
  464. package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js +121 -5
  465. package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js.map +1 -1
  466. package/build/dist/Server/Utils/Telemetry/ResourceFacetResolver.js +12 -0
  467. package/build/dist/Server/Utils/Telemetry/ResourceFacetResolver.js.map +1 -1
  468. package/build/dist/Server/Utils/Telemetry/ServiceDependencyDiscovery.js +438 -36
  469. package/build/dist/Server/Utils/Telemetry/ServiceDependencyDiscovery.js.map +1 -1
  470. package/build/dist/Server/Utils/Telemetry/Telemetry.js +12 -0
  471. package/build/dist/Server/Utils/Telemetry/Telemetry.js.map +1 -1
  472. package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +17 -18
  473. package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
  474. package/build/dist/Server/Utils/Telemetry/TelemetryIngestionKeyGuard.js +16 -10
  475. package/build/dist/Server/Utils/Telemetry/TelemetryIngestionKeyGuard.js.map +1 -1
  476. package/build/dist/Types/AI/AIResourceContext.js +7 -0
  477. package/build/dist/Types/AI/AIResourceContext.js.map +1 -1
  478. package/build/dist/Types/Dashboard/DashboardTemplates.js +2 -1
  479. package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
  480. package/build/dist/Types/DatabaseServer/DatabaseConnectionSpan.js +71 -0
  481. package/build/dist/Types/DatabaseServer/DatabaseConnectionSpan.js.map +1 -0
  482. package/build/dist/Types/DatabaseServer/DatabaseContainerClassifier.js +1462 -0
  483. package/build/dist/Types/DatabaseServer/DatabaseContainerClassifier.js.map +1 -0
  484. package/build/dist/Types/DatabaseServer/DatabaseContainerCommand.js +691 -0
  485. package/build/dist/Types/DatabaseServer/DatabaseContainerCommand.js.map +1 -0
  486. package/build/dist/Types/DatabaseServer/DatabaseEndpoint.js +1407 -0
  487. package/build/dist/Types/DatabaseServer/DatabaseEndpoint.js.map +1 -0
  488. package/build/dist/Types/DatabaseServer/DatabaseServerDiscoverySource.js +60 -0
  489. package/build/dist/Types/DatabaseServer/DatabaseServerDiscoverySource.js.map +1 -0
  490. package/build/dist/Types/DatabaseServer/DatabaseServerMetricCatalog.js +804 -0
  491. package/build/dist/Types/DatabaseServer/DatabaseServerMetricCatalog.js.map +1 -0
  492. package/build/dist/Types/DatabaseServer/DatabaseSystem.js +1860 -0
  493. package/build/dist/Types/DatabaseServer/DatabaseSystem.js.map +1 -0
  494. package/build/dist/Types/DatabaseServer/DatabaseTelemetryResolver.js +406 -0
  495. package/build/dist/Types/DatabaseServer/DatabaseTelemetryResolver.js.map +1 -0
  496. package/build/dist/Types/Email/EmailTemplateType.js +1 -0
  497. package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
  498. package/build/dist/Types/Monitor/CephAlertTemplates.js +18 -0
  499. package/build/dist/Types/Monitor/CephAlertTemplates.js.map +1 -1
  500. package/build/dist/Types/Monitor/DatabaseAlertTemplates.js +1518 -0
  501. package/build/dist/Types/Monitor/DatabaseAlertTemplates.js.map +1 -0
  502. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +57 -24
  503. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
  504. package/build/dist/Types/Monitor/KubernetesMetricCatalog.js +104 -18
  505. package/build/dist/Types/Monitor/KubernetesMetricCatalog.js.map +1 -1
  506. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +80 -3
  507. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js.map +1 -1
  508. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js +10 -3
  509. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js.map +1 -1
  510. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +29 -0
  511. package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js.map +1 -1
  512. package/build/dist/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.js +21 -6
  513. package/build/dist/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.js.map +1 -1
  514. package/build/dist/Types/Monitor/SeriesContext/SeriesLabelDisplay.js +25 -0
  515. package/build/dist/Types/Monitor/SeriesContext/SeriesLabelDisplay.js.map +1 -1
  516. package/build/dist/Types/NetworkDevice/DiscoveredHostNamingStatus.js +136 -0
  517. package/build/dist/Types/NetworkDevice/DiscoveredHostNamingStatus.js.map +1 -0
  518. package/build/dist/Types/Permission.js +234 -0
  519. package/build/dist/Types/Permission.js.map +1 -1
  520. package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js +10 -0
  521. package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js.map +1 -1
  522. package/build/dist/Types/Rules/RuleRun.js +4 -0
  523. package/build/dist/Types/Rules/RuleRun.js.map +1 -1
  524. package/build/dist/Types/Telemetry/EntityType.js +23 -0
  525. package/build/dist/Types/Telemetry/EntityType.js.map +1 -1
  526. package/build/dist/Types/Telemetry/ResourceFacetCatalog.js +14 -0
  527. package/build/dist/Types/Telemetry/ResourceFacetCatalog.js.map +1 -1
  528. package/build/dist/Types/Telemetry/ServiceType.js +8 -0
  529. package/build/dist/Types/Telemetry/ServiceType.js.map +1 -1
  530. package/build/dist/UI/Components/Banner/Banner.js +1 -1
  531. package/build/dist/UI/Components/Banner/Banner.js.map +1 -1
  532. package/build/dist/UI/Components/Card/Card.js +1 -1
  533. package/build/dist/UI/Components/Card/Card.js.map +1 -1
  534. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +2 -2
  535. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
  536. package/build/dist/UI/Components/Charts/Line/LineChart.js +1 -1
  537. package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
  538. package/build/dist/UI/Components/CommandPalette/CommandPalette.js +1 -1
  539. package/build/dist/UI/Components/CommandPalette/CommandPalette.js.map +1 -1
  540. package/build/dist/UI/Components/Date/StartAndEndDate.js +5 -5
  541. package/build/dist/UI/Components/Date/StartAndEndDate.js.map +1 -1
  542. package/build/dist/UI/Components/Diagram/HorizontalStepChain.js +1 -1
  543. package/build/dist/UI/Components/Diagram/HorizontalStepChain.js.map +1 -1
  544. package/build/dist/UI/Components/Feed/FeedOptionsButton.js +1 -1
  545. package/build/dist/UI/Components/Feed/FeedOptionsButton.js.map +1 -1
  546. package/build/dist/UI/Components/Forms/BasicForm.js +1 -1
  547. package/build/dist/UI/Components/Forms/BasicForm.js.map +1 -1
  548. package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js +1 -1
  549. package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
  550. package/build/dist/UI/Components/HeaderAlert/HeaderAlert.js +1 -1
  551. package/build/dist/UI/Components/HeaderAlert/HeaderAlert.js.map +1 -1
  552. package/build/dist/UI/Components/LogsViewer/components/FacetValueRow.js +1 -1
  553. package/build/dist/UI/Components/LogsViewer/components/FacetValueRow.js.map +1 -1
  554. package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js +1 -1
  555. package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js.map +1 -1
  556. package/build/dist/UI/Components/Modal/ModalFooter.js +1 -1
  557. package/build/dist/UI/Components/Modal/ModalFooter.js.map +1 -1
  558. package/build/dist/UI/Components/ModelDetail/CardModelDetail.js +2 -2
  559. package/build/dist/UI/Components/ModelDetail/CardModelDetail.js.map +1 -1
  560. package/build/dist/UI/Components/ModelTable/BaseModelTable.js +4 -4
  561. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  562. package/build/dist/UI/Components/Navbar/NavBar.js +9 -2
  563. package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
  564. package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +2 -2
  565. package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
  566. package/build/dist/UI/Components/Page/Page.js +1 -1
  567. package/build/dist/UI/Components/Page/Page.js.map +1 -1
  568. package/build/dist/UI/Components/Pagination/Pagination.js +3 -3
  569. package/build/dist/UI/Components/Pagination/Pagination.js.map +1 -1
  570. package/build/dist/UI/Components/ProgressButtons/ProgressButtonItem.js +1 -1
  571. package/build/dist/UI/Components/ProgressButtons/ProgressButtonItem.js.map +1 -1
  572. package/build/dist/UI/Components/SideMenu/SideMenu.js +4 -1
  573. package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
  574. package/build/dist/UI/Components/StatusPage/ResourceGroupNavigator.js +3 -1
  575. package/build/dist/UI/Components/StatusPage/ResourceGroupNavigator.js.map +1 -1
  576. package/build/dist/UI/Components/StatusPage/ResourceList.js +6 -6
  577. package/build/dist/UI/Components/StatusPage/ResourceList.js.map +1 -1
  578. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js +1 -1
  579. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js.map +1 -1
  580. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.js +1 -1
  581. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.js.map +1 -1
  582. package/build/dist/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.js +1 -1
  583. package/build/dist/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.js.map +1 -1
  584. package/build/dist/UI/Components/Workflow/ComponentsModal.js +2 -2
  585. package/build/dist/UI/Components/Workflow/ComponentsModal.js.map +1 -1
  586. package/build/dist/UI/Components/Workflow/StepTraceViewer.js +1 -1
  587. package/build/dist/UI/Components/Workflow/StepTraceViewer.js.map +1 -1
  588. package/build/dist/UI/Utils/Navigation.js +66 -33
  589. package/build/dist/UI/Utils/Navigation.js.map +1 -1
  590. package/build/dist/UI/Utils/Telemetry/TelemetryEntityNames.js +7 -0
  591. package/build/dist/UI/Utils/Telemetry/TelemetryEntityNames.js.map +1 -1
  592. package/build/dist/UI/Utils/TelemetryService.js +3 -2
  593. package/build/dist/UI/Utils/TelemetryService.js.map +1 -1
  594. package/build/dist/Utils/LabelRuleImportExport.js +2 -0
  595. package/build/dist/Utils/LabelRuleImportExport.js.map +1 -1
  596. package/build/dist/Utils/MetricUnitUtil.js +77 -13
  597. package/build/dist/Utils/MetricUnitUtil.js.map +1 -1
  598. package/build/dist/Utils/Monitor/MetricValueFormatter.js +58 -13
  599. package/build/dist/Utils/Monitor/MetricValueFormatter.js.map +1 -1
  600. package/build/dist/Utils/Monitor/PlatformMetricUnitUtil.js +161 -0
  601. package/build/dist/Utils/Monitor/PlatformMetricUnitUtil.js.map +1 -0
  602. package/build/dist/Utils/Monitor/PlatformResourceIdentity.js +323 -0
  603. package/build/dist/Utils/Monitor/PlatformResourceIdentity.js.map +1 -0
  604. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.js +270 -0
  605. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.js.map +1 -0
  606. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js +23 -0
  607. package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js.map +1 -1
  608. package/build/dist/Utils/NetworkDiscovery/NetbiosNameUtil.js +61 -0
  609. package/build/dist/Utils/NetworkDiscovery/NetbiosNameUtil.js.map +1 -1
  610. package/build/dist/Utils/Telemetry/DatabaseServerEntityKeys.js +178 -0
  611. package/build/dist/Utils/Telemetry/DatabaseServerEntityKeys.js.map +1 -0
  612. package/build/dist/Utils/Telemetry/EntityKey.js +133 -0
  613. package/build/dist/Utils/Telemetry/EntityKey.js.map +1 -1
  614. package/build/dist/Utils/ValueFormatter.js +15 -0
  615. package/build/dist/Utils/ValueFormatter.js.map +1 -1
  616. package/package.json +1 -1
  617. package/tsconfig.tests.json +7 -5
@@ -15,6 +15,11 @@ interface UnitDefinition {
15
15
  label: string;
16
16
  aliases: Array<string>;
17
17
  toCanonical: number;
18
+ /*
19
+ * A unit the family can CONVERT but that the threshold / legend unit
20
+ * pickers never offer. See the binary byte units below for why.
21
+ */
22
+ isConversionOnly?: boolean | undefined;
18
23
  }
19
24
 
20
25
  /*
@@ -59,6 +64,61 @@ const byteUnits: Array<UnitDefinition> = [
59
64
  aliases: ["pb", "petabyte", "petabytes", "pby"],
60
65
  toCanonical: 1e15,
61
66
  },
67
+
68
+ /*
69
+ * Binary (IEC) byte units — powers of 1024, not 1000. OpenTelemetry
70
+ * spells them in UCUM ("KiBy", "MiBy"), and the vcenter receiver reports
71
+ * memory in them, so without these members a "MiBy" sample was in no
72
+ * family at all: it could not be converted into a "GB" threshold (the
73
+ * value passed through unchanged, about a thousand times off) and the
74
+ * notification formatter could not scale it ("1048576 MiB" instead of
75
+ * "1.1 TB").
76
+ *
77
+ * CONVERSION-ONLY, deliberately. The threshold and legend unit pickers
78
+ * (CriteriaFilter, MetricAlias) build their options from
79
+ * getCompatibleUnits, whose byte list is the six decimal units — a
80
+ * contract MetricUnitUtil.test pins. Listing five near-duplicates
81
+ * ("MB" next to "MiB") in every bytes dropdown would clutter it for
82
+ * every metric, while the conversions below are what actually fixes
83
+ * the numbers. So the pickers keep treating a native "MiBy" exactly as
84
+ * they did before (a single raw-unit option, free-text legend), and
85
+ * only convertToMetricUnit / getFamilyBaseUnit see these members.
86
+ */
87
+ {
88
+ value: "KiB",
89
+ label: "Kibibytes (KiB)",
90
+ aliases: ["kib", "kiby", "kibibyte", "kibibytes"],
91
+ toCanonical: 1024,
92
+ isConversionOnly: true,
93
+ },
94
+ {
95
+ value: "MiB",
96
+ label: "Mebibytes (MiB)",
97
+ aliases: ["mib", "miby", "mebibyte", "mebibytes"],
98
+ toCanonical: 1024 ** 2,
99
+ isConversionOnly: true,
100
+ },
101
+ {
102
+ value: "GiB",
103
+ label: "Gibibytes (GiB)",
104
+ aliases: ["gib", "giby", "gibibyte", "gibibytes"],
105
+ toCanonical: 1024 ** 3,
106
+ isConversionOnly: true,
107
+ },
108
+ {
109
+ value: "TiB",
110
+ label: "Tebibytes (TiB)",
111
+ aliases: ["tib", "tiby", "tebibyte", "tebibytes"],
112
+ toCanonical: 1024 ** 4,
113
+ isConversionOnly: true,
114
+ },
115
+ {
116
+ value: "PiB",
117
+ label: "Pebibytes (PiB)",
118
+ aliases: ["pib", "piby", "pebibyte", "pebibytes"],
119
+ toCanonical: 1024 ** 5,
120
+ isConversionOnly: true,
121
+ },
62
122
  ];
63
123
 
64
124
  const timeUnits: Array<UnitDefinition> = [
@@ -167,24 +227,40 @@ function normalize(unit: string): string {
167
227
  return unit.trim().toLowerCase();
168
228
  }
169
229
 
230
+ /*
231
+ * Which members a lookup may match. "offered" is what the unit pickers
232
+ * work with — every member except the conversion-only ones — and is what
233
+ * the picker-facing methods use, so a conversion-only native unit still
234
+ * reads to them as "no known family". "all" is for arithmetic.
235
+ */
236
+ type MemberScope = "offered" | "all";
237
+
238
+ function isInScope(definition: UnitDefinition, scope: MemberScope): boolean {
239
+ return scope === "all" || !definition.isConversionOnly;
240
+ }
241
+
170
242
  function findDefinitionInFamily(
171
243
  unit: string,
172
244
  family: Array<UnitDefinition>,
245
+ scope: MemberScope,
173
246
  ): UnitDefinition | null {
174
247
  const normalized: string = normalize(unit);
175
248
  return (
176
249
  family.find((u: UnitDefinition) => {
177
- return u.aliases.includes(normalized);
250
+ return isInScope(u, scope) && u.aliases.includes(normalized);
178
251
  }) || null
179
252
  );
180
253
  }
181
254
 
182
- function findFamily(unit: string): Array<UnitDefinition> | null {
255
+ function findFamily(
256
+ unit: string,
257
+ scope: MemberScope,
258
+ ): Array<UnitDefinition> | null {
183
259
  if (!unit || !unit.trim()) {
184
260
  return null;
185
261
  }
186
262
  for (const family of allFamilies) {
187
- if (findDefinitionInFamily(unit, family)) {
263
+ if (findDefinitionInFamily(unit, family, scope)) {
188
264
  return family;
189
265
  }
190
266
  }
@@ -205,14 +281,21 @@ export default class MetricUnitUtil {
205
281
  return [];
206
282
  }
207
283
 
208
- const family: Array<UnitDefinition> | null = findFamily(metricUnit);
284
+ const family: Array<UnitDefinition> | null = findFamily(
285
+ metricUnit,
286
+ "offered",
287
+ );
209
288
  if (!family) {
210
289
  return [{ value: metricUnit, label: metricUnit }];
211
290
  }
212
291
 
213
- return family.map((u: UnitDefinition) => {
214
- return { value: u.value, label: u.label };
215
- });
292
+ return family
293
+ .filter((u: UnitDefinition) => {
294
+ return isInScope(u, "offered");
295
+ })
296
+ .map((u: UnitDefinition) => {
297
+ return { value: u.value, label: u.label };
298
+ });
216
299
  }
217
300
 
218
301
  /*
@@ -233,7 +316,10 @@ export default class MetricUnitUtil {
233
316
  return undefined;
234
317
  }
235
318
 
236
- const family: Array<UnitDefinition> | null = findFamily(metricUnit);
319
+ const family: Array<UnitDefinition> | null = findFamily(
320
+ metricUnit,
321
+ "offered",
322
+ );
237
323
  if (!family) {
238
324
  return metricUnit;
239
325
  }
@@ -241,6 +327,7 @@ export default class MetricUnitUtil {
241
327
  const def: UnitDefinition | null = findDefinitionInFamily(
242
328
  metricUnit,
243
329
  family,
330
+ "offered",
244
331
  );
245
332
 
246
333
  if (family === percentUnits && def?.value === "1") {
@@ -272,7 +359,7 @@ export default class MetricUnitUtil {
272
359
  return value;
273
360
  }
274
361
 
275
- const family: Array<UnitDefinition> | null = findFamily(metricUnit);
362
+ const family: Array<UnitDefinition> | null = findFamily(metricUnit, "all");
276
363
  if (!family) {
277
364
  return value;
278
365
  }
@@ -280,10 +367,12 @@ export default class MetricUnitUtil {
280
367
  const fromDef: UnitDefinition | null = findDefinitionInFamily(
281
368
  fromUnit,
282
369
  family,
370
+ "all",
283
371
  );
284
372
  const metricDef: UnitDefinition | null = findDefinitionInFamily(
285
373
  metricUnit,
286
374
  family,
375
+ "all",
287
376
  );
288
377
 
289
378
  if (!fromDef || !metricDef) {
@@ -317,7 +406,7 @@ export default class MetricUnitUtil {
317
406
  return null;
318
407
  }
319
408
 
320
- const family: Array<UnitDefinition> | null = findFamily(metricUnit);
409
+ const family: Array<UnitDefinition> | null = findFamily(metricUnit, "all");
321
410
  if (!family) {
322
411
  return null;
323
412
  }
@@ -335,6 +424,9 @@ export default class MetricUnitUtil {
335
424
  * Convenience: does the metric unit belong to a family we can offer
336
425
  * conversions for? When false, the UI should still render a dropdown,
337
426
  * but with just the raw unit.
427
+ *
428
+ * "Offer" is literal: a conversion-only unit ("MiBy") answers false, in
429
+ * step with getCompatibleUnits, which gives it no family list either.
338
430
  */
339
431
  public static hasCompatibleUnitFamily(
340
432
  metricUnit: string | undefined,
@@ -342,6 +434,6 @@ export default class MetricUnitUtil {
342
434
  if (!metricUnit || !metricUnit.trim()) {
343
435
  return false;
344
436
  }
345
- return findFamily(metricUnit) !== null;
437
+ return findFamily(metricUnit, "offered") !== null;
346
438
  }
347
439
  }
@@ -35,22 +35,39 @@ import ValueFormatter from "../ValueFormatter";
35
35
  * sample arrive carrying the unit "GB", and ValueFormatter has a
36
36
  * ladder for "bytes" but not for "GB" — so 2500 of them rendered
37
37
  * "2.5K GB" instead of "2.5 TB". Anything in a MetricUnitUtil family
38
- * is converted to that family's base before the ladder runs.
38
+ * is converted to that family's base before the ladder runs. That
39
+ * includes the binary (IEC) byte units the vcenter receiver reports
40
+ * memory in: 2048 "MiBy" is restated as 2147483648 bytes and reads
41
+ * "2.15 GB", where it used to read "2048 MiB" and, for a large host,
42
+ * "1048576 MiB".
39
43
  *
40
44
  * 3. UNITS WORTH HIDING. OTel's dimensionless "1" and UCUM's
41
45
  * annotation-only units ("{restarts}", "{packets}") are not
42
46
  * dimensions, and printing them produces the "0.06 1" that
43
47
  * CompareCriteria and MonitorCriteriaObservationBuilder each grew
44
- * their own guard against. That rule lives here now.
48
+ * their own guard against. That rule lives here now — with one
49
+ * exception: braces around a REAL, scalable unit ("{KiBy/s}", which
50
+ * the vcenter receiver uses for throughput) are unwrapped rather than
51
+ * hidden, because the value in them is a quantity, not a count.
45
52
  */
46
53
  export default class MetricValueFormatter {
47
54
  /*
48
55
  * UCUM annotation-only units — "{thread}", "{packets}", "{errors}".
49
56
  * The braces describe what is being counted; the value is a plain
50
57
  * count and the text inside them is not a unit a reader should see.
58
+ *
59
+ * Only reached for braces whose inner text is NOT itself a scalable
60
+ * unit: canonicalizeUnit has already unwrapped "{KiBy/s}" to "KiBy/s"
61
+ * (see unwrapScalableAnnotation), so what still matches here is a
62
+ * genuine annotation.
51
63
  */
52
64
  private static readonly annotationOnlyUnitPattern: RegExp = /^\{[^{}]*\}$/;
53
65
 
66
+ /*
67
+ * The same shape, capturing the inner text.
68
+ */
69
+ private static readonly bracedUnitPattern: RegExp = /^\{([^{}]*)\}$/;
70
+
54
71
  /*
55
72
  * The per-platform metric catalogs (Kubernetes, Ceph, Proxmox, Docker
56
73
  * Swarm) were written for humans reading a metric picker, so they spell
@@ -93,7 +110,8 @@ export default class MetricValueFormatter {
93
110
  * Whether `unit` names a real dimension for `metricName` — i.e. whether
94
111
  * it is worth attaching to a number at all. False for the empty unit,
95
112
  * for the dimensionless "1" on a non-fraction metric, and for
96
- * annotation-only units.
113
+ * annotation-only units. True for a braced unit whose inner text is a
114
+ * scalable unit ("{KiBy/s}"), which format() renders as that unit.
97
115
  */
98
116
  public static hasDisplayableUnit(
99
117
  unit: string | null | undefined,
@@ -128,6 +146,8 @@ export default class MetricValueFormatter {
128
146
  * format({ value: 1500, unit: "ms" }) → "1.5 sec"
129
147
  * format({ value: 3661, unit: "seconds" }) → "1.02 hours"
130
148
  * format({ value: 1500000, unit: "By/s" }) → "1.5 MB/s"
149
+ * format({ value: 2048, unit: "MiBy" }) → "2.15 GB"
150
+ * format({ value: 2500000, unit: "{KiBy/s}" }) → "2.56 GB/s"
131
151
  * format({ value: 0.2534, unit: "1",
132
152
  * metricName: "system.cpu.utilization" }) → "25.34%"
133
153
  * format({ value: 87.5, unit: "%" }) → "87.50%"
@@ -139,6 +159,7 @@ export default class MetricValueFormatter {
139
159
  * A value with no dimension to report is left bare:
140
160
  * format({ value: 1500 }) → "1500"
141
161
  * format({ value: 1500, unit: "{restarts}" }) → "1500"
162
+ * format({ value: 1500, unit: "{errors/s}" }) → "1500"
142
163
  * format({ value: 3.14159 }) → "3.14"
143
164
  */
144
165
  public static format(input: {
@@ -198,7 +219,7 @@ export default class MetricValueFormatter {
198
219
  * becomes "m per s2" and "10*3/uL" becomes "10*3 per uL", both longer
199
220
  * and less recognisable than what the exporter wrote. getCompactUnit
200
221
  * keeps the slash and still expands what is worth expanding
201
- * ("Cel" → "°C", "KiBy" → "KiB").
222
+ * ("Cel" → "°C").
202
223
  */
203
224
  const unitSymbol: string =
204
225
  ValueFormatter.getCompactUnit(unit, formatOptions) || unit;
@@ -229,11 +250,12 @@ export default class MetricValueFormatter {
229
250
  }
230
251
 
231
252
  /*
232
- * Trim the unit and rewrite the catalogs' English spellings of "no
233
- * dimension" into the UCUM ones the rest of the pipeline understands.
234
- * Anything else is returned untouched — including its casing, which
235
- * matters because an unrecognised unit is echoed verbatim next to the
236
- * value ("5 widgets", not "5 Widgets").
253
+ * Trim the unit, unwrap a braced scalable unit ("{KiBy/s}" → "KiBy/s"),
254
+ * and rewrite the catalogs' English spellings of "no dimension" into the
255
+ * UCUM ones the rest of the pipeline understands. Anything else is
256
+ * returned untouched — including its casing, which matters because an
257
+ * unrecognised unit is echoed verbatim next to the value ("5 widgets",
258
+ * not "5 Widgets").
237
259
  */
238
260
  private static canonicalizeUnit(unit: string | null | undefined): string {
239
261
  const trimmed: string = (unit || "").trim();
@@ -242,10 +264,40 @@ export default class MetricValueFormatter {
242
264
  return "";
243
265
  }
244
266
 
267
+ const unwrapped: string =
268
+ MetricValueFormatter.unwrapScalableAnnotation(trimmed);
269
+
245
270
  const alias: string | undefined =
246
- MetricValueFormatter.informalUnitAliases[trimmed.toLowerCase()];
271
+ MetricValueFormatter.informalUnitAliases[unwrapped.toLowerCase()];
272
+
273
+ return alias === undefined ? unwrapped : alias;
274
+ }
275
+
276
+ /*
277
+ * The vcenter receiver declares its throughput metrics as "{KiBy/s}":
278
+ * UCUM annotation braces around what is, in fact, a real unit. The
279
+ * annotation rule used to hide it, so 2500000 of them — about 2.56 GB/s
280
+ * of disk traffic — reached the inbox as a bare "2500000".
281
+ *
282
+ * So a braced unit is unwrapped when, and only when, its inner text is
283
+ * something this formatter can SCALE: a unit with a ladder, a member of
284
+ * a MetricUnitUtil family whose base has one ("KiBy", "GB", "min"), or
285
+ * a rate whose numerator is one of those ("KiBy/s", "By/s"). Every
286
+ * genuine annotation stays hidden exactly as before — "{restarts}",
287
+ * "{cpu}", "{packets/s}" and "{errors/s}" name no unit a ladder knows,
288
+ * so they keep rendering as the bare count.
289
+ */
290
+ private static unwrapScalableAnnotation(unit: string): string {
291
+ const match: RegExpMatchArray | null = unit.match(
292
+ MetricValueFormatter.bracedUnitPattern,
293
+ );
294
+ const inner: string = (match?.[1] || "").trim();
295
+
296
+ if (!inner) {
297
+ return unit;
298
+ }
247
299
 
248
- return alias === undefined ? trimmed : alias;
300
+ return MetricValueFormatter.toScalableUnit(1, inner) ? inner : unit;
249
301
  }
250
302
 
251
303
  /**
@@ -273,8 +325,9 @@ export default class MetricValueFormatter {
273
325
  * - it already has one ("bytes", "ms", "s", "ns");
274
326
  * - it is a rate whose NUMERATOR does ("By/s" → scale the bytes, keep
275
327
  * the "/s"), which is how 1500000 By/s reads "1.5 MB/s";
276
- * - it is a prefixed member of a MetricUnitUtil family ("GB", "hours"),
277
- * in which case the value is converted into that family's base first.
328
+ * - it is a prefixed member of a MetricUnitUtil family ("GB", "hours",
329
+ * and the binary "MiBy" / "KiBy"), in which case the value is
330
+ * converted into that family's base first.
278
331
  */
279
332
  private static toScalableUnit(
280
333
  value: number,
@@ -0,0 +1,215 @@
1
+ import Dictionary from "../../Types/Dictionary";
2
+ import MonitorType from "../../Types/Monitor/MonitorType";
3
+ import { getCephMetricByMetricName } from "../../Types/Monitor/CephMetricCatalog";
4
+ import { getDockerMetricByMetricName } from "../../Types/Monitor/DockerMetricCatalog";
5
+ import { getDockerSwarmMetricByMetricName } from "../../Types/Monitor/DockerSwarmMetricCatalog";
6
+ import { getHostMetricByMetricName } from "../../Types/Monitor/HostMetricCatalog";
7
+ import { getIoTMetricByMetricName } from "../../Types/Monitor/IotMetricCatalog";
8
+ import { getKubernetesMetricByMetricName } from "../../Types/Monitor/KubernetesMetricCatalog";
9
+ import { getPodmanMetricByMetricName } from "../../Types/Monitor/PodmanMetricCatalog";
10
+ import { getProxmoxMetricByMetricName } from "../../Types/Monitor/ProxmoxMetricCatalog";
11
+ import { getVMwareMetricByMetricName } from "../../Types/Monitor/VMwareMetricCatalog";
12
+
13
+ /*
14
+ * The platforms that ship their own metric catalog. Each catalog names the
15
+ * unit its metrics' stored values are in.
16
+ */
17
+ export type MetricCatalogPlatform =
18
+ | "kubernetes"
19
+ | "proxmox"
20
+ | "vmware"
21
+ | "dockerSwarm"
22
+ | "ceph"
23
+ | "docker"
24
+ | "podman"
25
+ | "host"
26
+ | "iot";
27
+
28
+ /*
29
+ * What unit a platform monitor's metric values are in.
30
+ *
31
+ * Two sources can answer that, and they disagree often enough to matter:
32
+ *
33
+ * - the unit the OpenTelemetry exporter DECLARED, stored on MetricType
34
+ * (k8s.node.allocatable_memory → "By");
35
+ * - the unit the platform's metric catalog SAYS the values are in
36
+ * (KubernetesMetricCatalog, DockerMetricCatalog, ...).
37
+ *
38
+ * The catalog wins. It was written against what each agent actually sends,
39
+ * and the exporters are not always right about their own numbers:
40
+ * docker_stats declares container.cpu.utilization and
41
+ * container.memory.percent with the unit "1" but sends 0–100. Taking the
42
+ * declared "1" would render 85.3 as "8530.00%", and — worse — a threshold
43
+ * typed in "%" would convert every sample ×100 and fire forever. kubeletstats
44
+ * declares k8s.node.cpu.utilization as "1" but it is a cores gauge.
45
+ *
46
+ * The declared unit is the fallback for everything the catalog does not
47
+ * know, which is how k8s.node.allocatable_memory reads "258 GB" instead of
48
+ * "257760964608" even before it has a catalog entry.
49
+ */
50
+ export default class PlatformMetricUnitUtil {
51
+ /**
52
+ * The catalog platform a monitor type reads its metrics from, or null for
53
+ * monitor types without one (generic Metrics monitors keep the exporter's
54
+ * declared unit).
55
+ */
56
+ public static getPlatformForMonitorType(
57
+ monitorType: MonitorType | undefined,
58
+ ): MetricCatalogPlatform | null {
59
+ switch (monitorType) {
60
+ case MonitorType.Kubernetes:
61
+ return "kubernetes";
62
+ case MonitorType.Proxmox:
63
+ return "proxmox";
64
+ case MonitorType.VMware:
65
+ return "vmware";
66
+ case MonitorType.DockerSwarm:
67
+ return "dockerSwarm";
68
+ case MonitorType.Ceph:
69
+ return "ceph";
70
+ case MonitorType.Docker:
71
+ return "docker";
72
+ case MonitorType.Podman:
73
+ return "podman";
74
+ case MonitorType.Host:
75
+ return "host";
76
+ case MonitorType.IoTDevice:
77
+ return "iot";
78
+ default:
79
+ return null;
80
+ }
81
+ }
82
+
83
+ /**
84
+ * The unit the platform's catalog declares for a metric, exactly as the
85
+ * catalog spells it ("bytes", "cores", "ratio", "count", "%"), or
86
+ * undefined when the catalog does not know the metric or gives it no
87
+ * unit.
88
+ */
89
+ public static getCatalogUnit(input: {
90
+ platform: MetricCatalogPlatform;
91
+ metricName: string;
92
+ }): string | undefined {
93
+ const unit: string | undefined = PlatformMetricUnitUtil.lookupCatalogUnit(
94
+ input.platform,
95
+ input.metricName,
96
+ );
97
+
98
+ return unit && unit.trim() ? unit.trim() : undefined;
99
+ }
100
+
101
+ /**
102
+ * The unit a platform metric's values are in, spelled so the rest of the
103
+ * pipeline can convert it: the catalog unit when the catalog has a real
104
+ * one, else the exporter-declared unit, else undefined.
105
+ *
106
+ * The catalogs spell two dimensionless concepts in English. "ratio" (and
107
+ * "fraction") becomes UCUM's "1", which MetricUnitUtil can convert to a
108
+ * "%" threshold and MetricValueFormatter renders as a percentage.
109
+ * "count" names no dimension at all, so it defers to the declared unit
110
+ * ("{restart}", which renders bare the same way) instead of hiding it.
111
+ */
112
+ public static getMetricUnit(input: {
113
+ platform: MetricCatalogPlatform | null;
114
+ metricName: string;
115
+ declaredUnit?: string | null | undefined;
116
+ }): string | undefined {
117
+ const catalogUnit: string | undefined = input.platform
118
+ ? PlatformMetricUnitUtil.toConvertibleUnit(
119
+ PlatformMetricUnitUtil.getCatalogUnit({
120
+ platform: input.platform,
121
+ metricName: input.metricName,
122
+ }),
123
+ )
124
+ : undefined;
125
+
126
+ if (catalogUnit) {
127
+ return catalogUnit;
128
+ }
129
+
130
+ const declaredUnit: string = (input.declaredUnit || "").trim();
131
+
132
+ return declaredUnit || undefined;
133
+ }
134
+
135
+ /**
136
+ * The unit map a platform monitor hands the criteria evaluator: one entry
137
+ * per metric name, keyed lowercased like MetricMonitorResponse's
138
+ * `nativeUnitsByMetricName`, holding getMetricUnit's answer. Metrics with
139
+ * no known unit are left out rather than mapped to "".
140
+ */
141
+ public static buildUnitsByMetricName(input: {
142
+ platform: MetricCatalogPlatform | null;
143
+ metricNames: Array<string>;
144
+ declaredUnitsByMetricName: Map<string, string>;
145
+ }): Dictionary<string> {
146
+ const unitsByMetricName: Dictionary<string> = {};
147
+
148
+ for (const metricName of input.metricNames) {
149
+ if (!metricName) {
150
+ continue;
151
+ }
152
+
153
+ const unit: string | undefined = PlatformMetricUnitUtil.getMetricUnit({
154
+ platform: input.platform,
155
+ metricName: metricName,
156
+ declaredUnit: input.declaredUnitsByMetricName.get(
157
+ metricName.toLowerCase(),
158
+ ),
159
+ });
160
+
161
+ if (unit) {
162
+ unitsByMetricName[metricName.toLowerCase()] = unit;
163
+ }
164
+ }
165
+
166
+ return unitsByMetricName;
167
+ }
168
+
169
+ private static toConvertibleUnit(
170
+ unit: string | undefined,
171
+ ): string | undefined {
172
+ if (!unit) {
173
+ return undefined;
174
+ }
175
+
176
+ switch (unit.toLowerCase()) {
177
+ case "ratio":
178
+ case "fraction":
179
+ return "1";
180
+ case "count":
181
+ case "counts":
182
+ return undefined;
183
+ default:
184
+ return unit;
185
+ }
186
+ }
187
+
188
+ private static lookupCatalogUnit(
189
+ platform: MetricCatalogPlatform,
190
+ metricName: string,
191
+ ): string | undefined {
192
+ switch (platform) {
193
+ case "kubernetes":
194
+ return getKubernetesMetricByMetricName(metricName)?.unit;
195
+ case "proxmox":
196
+ return getProxmoxMetricByMetricName(metricName)?.unit;
197
+ case "vmware":
198
+ return getVMwareMetricByMetricName(metricName)?.unit;
199
+ case "dockerSwarm":
200
+ return getDockerSwarmMetricByMetricName(metricName)?.unit;
201
+ case "ceph":
202
+ return getCephMetricByMetricName(metricName)?.unit;
203
+ case "docker":
204
+ return getDockerMetricByMetricName(metricName)?.unit;
205
+ case "podman":
206
+ return getPodmanMetricByMetricName(metricName)?.unit;
207
+ case "host":
208
+ return getHostMetricByMetricName(metricName)?.unit;
209
+ case "iot":
210
+ return getIoTMetricByMetricName(metricName)?.unit;
211
+ default:
212
+ return undefined;
213
+ }
214
+ }
215
+ }