@oneuptime/common 14.0.2 → 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.
- package/Models/DatabaseModels/Alert.ts +55 -0
- package/Models/DatabaseModels/AlertFeed.ts +2 -0
- package/Models/DatabaseModels/DatabaseServer.ts +1650 -0
- package/Models/DatabaseModels/DatabaseServerEndpoint.ts +540 -0
- package/Models/DatabaseModels/DatabaseServerFeed.ts +625 -0
- package/Models/DatabaseModels/DatabaseServerLabelRule.ts +514 -0
- package/Models/DatabaseModels/DatabaseServerOwnerRule.ts +596 -0
- package/Models/DatabaseModels/DatabaseServerOwnerTeam.ts +491 -0
- package/Models/DatabaseModels/DatabaseServerOwnerUser.ts +490 -0
- package/Models/DatabaseModels/Incident.ts +55 -0
- package/Models/DatabaseModels/IncidentAlert.ts +540 -0
- package/Models/DatabaseModels/IncidentFeed.ts +2 -0
- package/Models/DatabaseModels/Index.ts +18 -0
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +26 -0
- package/Models/DatabaseModels/Project.ts +60 -0
- package/Models/DatabaseModels/RumApplication.ts +52 -1
- package/Models/DatabaseModels/ScheduledMaintenance.ts +55 -0
- package/Models/DatabaseModels/TelemetryException.ts +2 -0
- package/Models/DatabaseModels/UserProjectSsoConsent.ts +146 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1794800000000-AddSessionReplaySameOriginTracePropagation.ts +28 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1794900000000-AddIncidentAlert.ts +89 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1795000000000-AddDatabaseServerTables.ts +673 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1795100000000-AddUserProjectSsoConsent.ts +51 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
- package/Server/Middleware/MultipartFormData.ts +1 -1
- package/Server/Middleware/TelemetryIngest.ts +15 -8
- package/Server/Services/AlertReminderRuleService.ts +100 -24
- package/Server/Services/DatabaseServerEndpointService.ts +895 -0
- package/Server/Services/DatabaseServerFeedService.ts +128 -0
- package/Server/Services/DatabaseServerLabelRuleEngineService.ts +340 -0
- package/Server/Services/DatabaseServerLabelRuleService.ts +14 -0
- package/Server/Services/DatabaseServerOwnerRuleEngineService.ts +425 -0
- package/Server/Services/DatabaseServerOwnerRuleService.ts +14 -0
- package/Server/Services/DatabaseServerOwnerTeamService.ts +180 -0
- package/Server/Services/DatabaseServerOwnerUserService.ts +173 -0
- package/Server/Services/DatabaseServerService.ts +4546 -0
- package/Server/Services/DatabaseService.ts +14 -8
- package/Server/Services/DockerResourceService.ts +43 -2
- package/Server/Services/IncidentAlertService.ts +1811 -0
- package/Server/Services/IncidentReminderRuleService.ts +103 -23
- package/Server/Services/IncidentService.ts +210 -10
- package/Server/Services/IncidentStateTimelineService.ts +24 -0
- package/Server/Services/Index.ts +18 -0
- package/Server/Services/InventoryItemService.ts +113 -5
- package/Server/Services/IoTDeviceService.ts +145 -37
- package/Server/Services/OpenTelemetryIngestService.ts +19 -0
- package/Server/Services/PodmanResourceService.ts +43 -2
- package/Server/Services/ScheduledMaintenanceReminderRuleService.ts +107 -23
- package/Server/Services/ServiceService.ts +1 -1
- package/Server/Services/TelemetryUsageBillingService.ts +29 -2
- package/Server/Services/UserProjectSsoConsentService.ts +74 -0
- package/Server/Services/UserService.ts +14 -1
- package/Server/Types/Database/Permissions/OwnerTableRegistry.ts +18 -0
- package/Server/Types/Database/QueryHelper.ts +30 -1
- package/Server/Utils/AI/Toolbox/ResourceTools.ts +69 -1
- package/Server/Utils/Database/AffectedResourceRelations.ts +6 -0
- package/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.ts +188 -6
- package/Server/Utils/Monitor/MonitorAlert.ts +28 -1
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +2262 -755
- package/Server/Utils/Monitor/MonitorIncident.ts +28 -1
- package/Server/Utils/Monitor/MonitorMaintenanceSuppression.ts +268 -6
- package/Server/Utils/Monitor/MonitorResource.ts +47 -11
- package/Server/Utils/Monitor/MonitorResourceContext.ts +1 -0
- package/Server/Utils/Monitor/MonitorStepResourceIdentity.ts +239 -21
- package/Server/Utils/Monitor/PerSeriesResolutionRootCause.ts +43 -0
- package/Server/Utils/Monitor/SeriesResourceLabels.ts +291 -0
- package/Server/Utils/Monitor/SeriesResourceLinker.ts +111 -12
- package/Server/Utils/Rules/RuleRun/RuleRunRegistry.ts +25 -0
- package/Server/Utils/SessionReplay/SessionReplayGateCache.ts +24 -2
- package/Server/Utils/StartServer.ts +26 -6
- package/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.ts +2 -0
- package/Server/Utils/Telemetry/DatabaseEndpointDiscovery.ts +688 -0
- package/Server/Utils/Telemetry/EntityRegistry.ts +5 -1
- package/Server/Utils/Telemetry/LogExceptionExtractor.ts +18 -1
- package/Server/Utils/Telemetry/ResourceEntityFilter.ts +175 -12
- package/Server/Utils/Telemetry/ResourceFacetResolver.ts +12 -0
- package/Server/Utils/Telemetry/ServiceDependencyDiscovery.ts +606 -36
- package/Server/Utils/Telemetry/Telemetry.ts +16 -0
- package/Server/Utils/Telemetry/TelemetryEntity.ts +22 -22
- package/Server/Utils/Telemetry/TelemetryIngestionKeyGuard.ts +16 -10
- package/Tests/App/Accounts/SignedInRedirect.test.tsx +241 -0
- package/Tests/App/AdminDashboard/AdminHeaderSmallScreens.test.tsx +221 -4
- package/Tests/App/Dashboard/AIInsightsResourcePageContext.test.ts +42 -0
- package/Tests/App/Dashboard/AffectedResourcesDisplay.test.tsx +100 -0
- package/Tests/App/Dashboard/AffectedResourcesPicker.test.tsx +86 -0
- package/Tests/App/Dashboard/AffectedResourcesPickerHiddenTypes.test.tsx +2 -0
- package/Tests/App/Dashboard/AffectedResourcesSummaryStep.test.tsx +19 -0
- package/Tests/App/Dashboard/BreadcrumbCoverage.test.tsx +14 -0
- package/Tests/App/Dashboard/BulkIncidentLinkActions.test.tsx +869 -0
- package/Tests/App/Dashboard/CephMetricTooltips.test.tsx +1777 -0
- package/Tests/App/Dashboard/CloudFleetSummary.test.ts +8 -0
- package/Tests/App/Dashboard/CloudMetricTooltips.test.tsx +887 -0
- package/Tests/App/Dashboard/ContainerHostMetricTooltips.test.tsx +1309 -0
- package/Tests/App/Dashboard/CorrelateFilterBuilder.test.tsx +26 -1
- package/Tests/App/Dashboard/DashboardAppSsoError.test.tsx +501 -0
- package/Tests/App/Dashboard/DashboardHeaderRequests.test.tsx +64 -1
- package/Tests/App/Dashboard/DashboardHeaderSmallScreens.test.tsx +178 -18
- package/Tests/App/Dashboard/DashboardMasterPageSsoRedirect.test.tsx +444 -0
- package/Tests/App/Dashboard/DashboardNavBarForeignHiddenRule.test.tsx +573 -0
- package/Tests/App/Dashboard/DatabaseChartAxes.test.tsx +431 -0
- package/Tests/App/Dashboard/DatabaseContainerDetailBadge.test.tsx +249 -0
- package/Tests/App/Dashboard/DatabaseDashboardE2EFixes.test.ts +681 -0
- package/Tests/App/Dashboard/DatabaseDocumentationMarkdown.test.ts +1801 -0
- package/Tests/App/Dashboard/DatabaseFleetSummaryRefresh.test.tsx +280 -0
- package/Tests/App/Dashboard/DatabaseFormHelpers.test.tsx +321 -0
- package/Tests/App/Dashboard/DatabaseMetricMonitorLink.test.tsx +795 -0
- package/Tests/App/Dashboard/DatabaseOverviewHeader.test.tsx +580 -0
- package/Tests/App/Dashboard/DatabaseRecommendationsEngineMetrics.test.ts +270 -0
- package/Tests/App/Dashboard/DatabaseServerComponents.test.tsx +1486 -0
- package/Tests/App/Dashboard/DatabaseServerEngineMetricsFilter.test.ts +223 -0
- package/Tests/App/Dashboard/DatabaseServerPresentation.test.ts +435 -0
- package/Tests/App/Dashboard/DatabaseServerSummary.test.ts +186 -0
- package/Tests/App/Dashboard/DatabaseServerTelemetryQueries.test.ts +1553 -0
- package/Tests/App/Dashboard/DatabaseTableTruncation.test.tsx +326 -0
- package/Tests/App/Dashboard/DatabaseTelemetryScope.test.ts +512 -0
- package/Tests/App/Dashboard/DatabaseTelemetryTabs.test.tsx +774 -0
- package/Tests/App/Dashboard/DatabaseViewLayout.test.tsx +233 -0
- package/Tests/App/Dashboard/DatabaseWorkloadBadge.test.tsx +972 -0
- package/Tests/App/Dashboard/DiscoveryReviewInventoryRefresh.test.tsx +5 -0
- package/Tests/App/Dashboard/DiscoveryReviewUnnamedHostHint.test.tsx +1061 -0
- package/Tests/App/Dashboard/DiscoveryScanLivePage.test.tsx +39 -0
- package/Tests/App/Dashboard/DockerSwarmClustersListTooltips.test.tsx +414 -0
- package/Tests/App/Dashboard/DockerSwarmMetricTooltips.test.ts +796 -0
- package/Tests/App/Dashboard/DockerSwarmOverviewTooltips.test.tsx +747 -0
- package/Tests/App/Dashboard/EventOverlayScope.test.ts +147 -0
- package/Tests/App/Dashboard/EventOverlayScopeHook.test.tsx +1 -0
- package/Tests/App/Dashboard/ExceptionMonitorEnvironmentFilter.test.tsx +38 -18
- package/Tests/App/Dashboard/HostDetailViewTooltips.test.tsx +725 -0
- package/Tests/App/Dashboard/HostListColumnTooltips.test.tsx +472 -0
- package/Tests/App/Dashboard/HostMetricTooltips.test.ts +709 -0
- package/Tests/App/Dashboard/HostOverviewTooltips.test.tsx +698 -0
- package/Tests/App/Dashboard/HostTooltipHarness.ts +124 -0
- package/Tests/App/Dashboard/HostsListTooltips.test.tsx +395 -0
- package/Tests/App/Dashboard/IncidentAlertLinkDialog.test.tsx +691 -0
- package/Tests/App/Dashboard/IncidentAlertLinkHelpers.test.ts +458 -0
- package/Tests/App/Dashboard/IncidentAlertLinkPages.test.tsx +828 -0
- package/Tests/App/Dashboard/IncidentAlertLinkSideMenus.test.tsx +231 -0
- package/Tests/App/Dashboard/IncidentCreateFromAlerts.test.tsx +689 -0
- package/Tests/App/Dashboard/IoTMetricTooltips.test.tsx +1123 -0
- package/Tests/App/Dashboard/KubernetesClusterMetricTooltips.test.ts +837 -0
- package/Tests/App/Dashboard/KubernetesClusterOverviewTooltips.test.tsx +699 -0
- package/Tests/App/Dashboard/KubernetesContainersTabTooltips.test.tsx +320 -0
- package/Tests/App/Dashboard/KubernetesCostTooltips.test.tsx +502 -0
- package/Tests/App/Dashboard/KubernetesInsightsTooltips.test.tsx +222 -0
- package/Tests/App/Dashboard/KubernetesResourceMetricTooltips.test.ts +561 -0
- package/Tests/App/Dashboard/KubernetesResourcePagesTooltips.test.tsx +1168 -0
- package/Tests/App/Dashboard/LinkIncidentAlertModal.test.tsx +154 -0
- package/Tests/App/Dashboard/LogsResourceFacetChips.test.tsx +1 -0
- package/Tests/App/Dashboard/MetricDescriptionRules.ts +170 -0
- package/Tests/App/Dashboard/MetricDescriptionsCatalog.test.ts +206 -0
- package/Tests/App/Dashboard/MetricDescriptionsConsistency.test.ts +275 -0
- package/Tests/App/Dashboard/MetricsViewerDrillDown.test.tsx +310 -0
- package/Tests/App/Dashboard/MetricsViewerEntityScopedRows.test.tsx +495 -0
- package/Tests/App/Dashboard/MonitorCreateFromMonitorBackedDevice.test.tsx +132 -1
- package/Tests/App/Dashboard/NavigationSearchKeywords.test.tsx +5 -0
- package/Tests/App/Dashboard/NetworkDeviceTooltips.test.tsx +852 -0
- package/Tests/App/Dashboard/NetworkDiagnosticsTooltips.test.tsx +556 -0
- package/Tests/App/Dashboard/NetworkMetricTooltips.test.ts +1348 -0
- package/Tests/App/Dashboard/NetworkSiteTooltips.test.tsx +679 -0
- package/Tests/App/Dashboard/ProductOrientation.test.tsx +4 -3
- package/Tests/App/Dashboard/ProxmoxMetricTooltips.test.ts +592 -0
- package/Tests/App/Dashboard/ProxmoxOverviewTooltips.test.tsx +1002 -0
- package/Tests/App/Dashboard/ProxmoxResourcePageTooltips.test.tsx +923 -0
- package/Tests/App/Dashboard/RecommendationsLoadedContext.test.tsx +349 -0
- package/Tests/App/Dashboard/ResourceArchiveSettings.test.tsx +62 -0
- package/Tests/App/Dashboard/ResourceFeedPageWiring.test.ts +8 -1
- package/Tests/App/Dashboard/ResourceFeedPagesFilterSort.test.tsx +14 -0
- package/Tests/App/Dashboard/ResourceOverviewTileTooltips.test.tsx +1066 -0
- package/Tests/App/Dashboard/RumOverviewPage.test.tsx +1195 -0
- package/Tests/App/Dashboard/ScheduledMaintenanceOverviewPage.test.tsx +2 -0
- package/Tests/App/Dashboard/ServerlessMetricTooltips.test.tsx +474 -0
- package/Tests/App/Dashboard/ServiceMapDatabaseLink.test.tsx +1085 -0
- package/Tests/App/Dashboard/ServiceMetricTooltips.test.tsx +772 -0
- package/Tests/App/Dashboard/SessionReplayAuditTable.test.tsx +56 -1
- package/Tests/App/Dashboard/TelemetryMetricsSignals.test.ts +1207 -0
- package/Tests/App/Dashboard/TelemetryResourceRetentionSettings.test.tsx +10 -0
- package/Tests/App/Dashboard/TelemetryResourceTabTooltips.test.tsx +437 -0
- package/Tests/App/Dashboard/TracesResourceFacets.test.tsx +2 -1
- package/Tests/App/Dashboard/VMwareMetricTooltips.test.ts +801 -0
- package/Tests/App/Dashboard/VMwareOverviewTooltips.test.tsx +601 -0
- package/Tests/App/Dashboard/VMwareResourcePagesTooltips.test.tsx +646 -0
- package/Tests/App/Dashboard/VMwareTooltipHarness.ts +145 -0
- package/Tests/App/StatusPage/StatusPageHeaderForeignHiddenRule.test.tsx +284 -0
- package/Tests/ClassStrings.ts +178 -0
- package/Tests/Fixtures/MobilePasskeyUser.json +1 -2
- package/Tests/ForeignHiddenRuleGuard.ts +2152 -0
- package/Tests/Models/DatabaseModels/DatabaseServerModels.test.ts +2250 -0
- package/Tests/Models/DatabaseModels/IncidentAlertModel.test.ts +554 -0
- package/Tests/Models/DatabaseModels/ResourceFeedModels.test.ts +24 -5
- package/Tests/Models/DatabaseModels/SessionReplayModels.test.ts +117 -0
- package/Tests/Models/DatabaseModels/StaticRuleCriteriaInheritance.test.ts +4 -2
- package/Tests/RenderedMarkup.ts +518 -0
- package/Tests/ResponsiveVisibility.test.ts +490 -4
- package/Tests/ResponsiveVisibility.ts +505 -52
- package/Tests/Server/Infrastructure/Postgres/AddConfigurableRuleCriteriaMigration.test.ts +3 -0
- package/Tests/Server/Infrastructure/Postgres/AddDatabaseServerTablesMigration.test.ts +541 -0
- package/Tests/Server/Infrastructure/Postgres/AddIncidentAlertMigration.test.ts +341 -0
- package/Tests/Server/Infrastructure/Postgres/AddSessionReplaySameOriginTracePropagationMigration.test.ts +247 -0
- package/Tests/Server/Infrastructure/Postgres/AddUserProjectSsoConsentMigration.test.ts +234 -0
- package/Tests/Server/Services/ContainerSnapshotUpsertPostgres.test.ts +319 -0
- package/Tests/Server/Services/CrossProjectRelationWriteGuard.test.ts +13 -0
- package/Tests/Server/Services/DatabaseServerEndpointService.test.ts +2033 -0
- package/Tests/Server/Services/DatabaseServerFeedAndOwnerServices.test.ts +529 -0
- package/Tests/Server/Services/DatabaseServerLifecycle.test.ts +3302 -0
- package/Tests/Server/Services/DatabaseServerRegistries.test.ts +603 -0
- package/Tests/Server/Services/DatabaseServerRuleEngines.test.ts +754 -0
- package/Tests/Server/Services/DatabaseServerService.test.ts +3558 -0
- package/Tests/Server/Services/DatabaseServerSqlPostgres.test.ts +2045 -0
- package/Tests/Server/Services/DatabaseServiceUpdateColumnsIfUnlockedPostgres.test.ts +362 -0
- package/Tests/Server/Services/DatabaseServiceUpdateColumnsIfUnlockedReply.test.ts +210 -0
- package/Tests/Server/Services/HookFreeWriteLengthClamp.test.ts +18 -0
- package/Tests/Server/Services/IncidentAlertPostgres.test.ts +903 -0
- package/Tests/Server/Services/IncidentAlertRegistration.test.ts +96 -0
- package/Tests/Server/Services/IncidentAlertService.test.ts +2225 -0
- package/Tests/Server/Services/IncidentAlertSloLinkSurvivesEdit.test.ts +2 -0
- package/Tests/Server/Services/IncidentAlertStateCascade.test.ts +970 -0
- package/Tests/Server/Services/IncidentCreateFromAlerts.test.ts +1284 -0
- package/Tests/Server/Services/IncomingCallPolicyEscalationRuleTarget.test.ts +225 -0
- package/Tests/Server/Services/InventoryItemDisplayName.test.ts +280 -2
- package/Tests/Server/Services/InventoryUpsertSchemaParity.test.ts +8 -2
- package/Tests/Server/Services/IoTDeviceLatestMetricsPostgres.test.ts +689 -0
- package/Tests/Server/Services/IoTDeviceService.test.ts +379 -0
- package/Tests/Server/Services/LatestMetricsValuesShape.test.ts +360 -0
- package/Tests/Server/Services/LlmModelPriceService.test.ts +402 -0
- package/Tests/Server/Services/OpenTelemetryResourceRetentionMemo.test.ts +7 -1
- package/Tests/Server/Services/OwnerRowUniqueness.test.ts +61 -9
- package/Tests/Server/Services/ReminderRuleLookupPostgres.test.ts +2250 -0
- package/Tests/Server/Services/ReminderRuleRefreshOpenSubjectsPaging.test.ts +653 -0
- package/Tests/Server/Services/ResourceUpdateLastSeenLivenessFallback.test.ts +68 -20
- package/Tests/Server/Services/StaticRuleCriteriaRuntimeCoverage.test.ts +3 -3
- package/Tests/Server/Services/TelemetryResourceFacetCounting.test.ts +9 -0
- package/Tests/Server/Services/UserProjectSsoConsentPostgres.test.ts +153 -0
- package/Tests/Server/Services/UserProjectSsoConsentService.test.ts +192 -0
- package/Tests/Server/Services/UserServiceFirstMasterAdminElection.test.ts +71 -0
- package/Tests/Server/Services/UserSignupIdTakeoverPostgres.test.ts +238 -0
- package/Tests/Server/Services/WorkspaceNotificationSummaryHelpers.test.ts +592 -0
- package/Tests/Server/Types/Billing/PayAsYouGoMeteredAuthorization.test.ts +3 -0
- package/Tests/Server/Types/Database/EventOverlayScopePostgres.test.ts +1 -0
- package/Tests/Server/Types/Database/FeedEventTypeFilterQuery.test.ts +11 -0
- package/Tests/Server/Types/Database/Permissions/InfrastructureOwnershipScope.test.ts +8 -0
- package/Tests/Server/Types/Database/QueryHelperBooleanForCriteriaBackedRule.test.ts +1094 -0
- package/Tests/Server/Utils/AI/ResourceTools.test.ts +134 -0
- package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.test.ts +41 -0
- package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteriaAnomalyUnits.test.ts +279 -9
- package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteriaDisplayContext.test.ts +933 -0
- package/Tests/Server/Utils/Monitor/DatabaseMaintenanceSuppression.test.ts +582 -0
- package/Tests/Server/Utils/Monitor/DatabaseServerMonitorLinking.test.ts +753 -0
- package/Tests/Server/Utils/Monitor/MonitorActionTimestamps.test.ts +1 -0
- package/Tests/Server/Utils/Monitor/MonitorAlertCriteriaReferences.test.ts +1 -0
- package/Tests/Server/Utils/Monitor/MonitorAlertResourceLinking.test.ts +119 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluator.test.ts +60 -25
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorAffectedResourceEdgeCases.test.ts +1719 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorKubernetesAffectedResources.test.ts +1447 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorKubernetesRatioEmail.test.ts +352 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPlatformMetricUnits.test.ts +717 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPlatformRawScan.test.ts +2125 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPlatformSeriesAffectedResources.test.ts +1288 -0
- package/Tests/Server/Utils/Monitor/MonitorDependencySuppressionCreatorSkip.test.ts +1 -0
- package/Tests/Server/Utils/Monitor/MonitorIncidentCriteriaReferences.test.ts +1 -0
- package/Tests/Server/Utils/Monitor/MonitorIncidentMemberRoleMembership.test.ts +1 -0
- package/Tests/Server/Utils/Monitor/MonitorIncidentResourceLinking.test.ts +88 -0
- package/Tests/Server/Utils/Monitor/MonitorMaintenanceSuppression.test.ts +205 -0
- package/Tests/Server/Utils/Monitor/MonitorResourceContext.test.ts +62 -0
- package/Tests/Server/Utils/Monitor/MonitorResourceDatabaseMaintenance.test.ts +803 -0
- package/Tests/Server/Utils/Monitor/MonitorStepResourceIdentity.test.ts +133 -3
- package/Tests/Server/Utils/Monitor/MonitorSummaryPersistence.test.ts +1 -0
- package/Tests/Server/Utils/Monitor/PerSeriesRecoveryResolution.test.ts +472 -1
- package/Tests/Server/Utils/Monitor/PerSeriesSecondEntityAlerting.test.ts +1 -0
- package/Tests/Server/Utils/Monitor/SeriesResourceLinker.test.ts +236 -2
- package/Tests/Server/Utils/SeriesResourceLabels.test.ts +70 -0
- package/Tests/Server/Utils/SessionReplay/SessionReplayGateCachePolicy.test.ts +103 -0
- package/Tests/Server/Utils/StartServerProtobufContentType.test.ts +54 -0
- package/Tests/Server/Utils/Telemetry/DatabaseEndpointDiscovery.test.ts +1895 -0
- package/Tests/Server/Utils/Telemetry/EntityRegistry.test.ts +7 -0
- package/Tests/Server/Utils/Telemetry/LogExceptionExtractorSeverityGate.test.ts +90 -0
- package/Tests/Server/Utils/Telemetry/ResourceEntityFilter.test.ts +570 -0
- package/Tests/Server/Utils/Telemetry/ResourceFacetResolver.test.ts +97 -2
- package/Tests/Server/Utils/Telemetry/ServiceDependencyDiscovery.test.ts +1337 -0
- package/Tests/Server/Utils/Telemetry/TelemetryEntity.test.ts +295 -0
- package/Tests/Types/AI/AIResourceContext.test.ts +30 -0
- package/Tests/Types/DatabaseServer/DatabaseContainerClassifier.test.ts +3644 -0
- package/Tests/Types/DatabaseServer/DatabaseContainerCommand.test.ts +340 -0
- package/Tests/Types/DatabaseServer/DatabaseContainerCommandCorpus.ts +826 -0
- package/Tests/Types/DatabaseServer/DatabaseContainerCommandPostgres.test.ts +150 -0
- package/Tests/Types/DatabaseServer/DatabaseEndpoint.test.ts +2657 -0
- package/Tests/Types/DatabaseServer/DatabaseServerDiscoverySource.test.ts +64 -0
- package/Tests/Types/DatabaseServer/DatabaseServerEntityKeys.test.ts +952 -0
- package/Tests/Types/DatabaseServer/DatabaseServerMetricCatalog.test.ts +1161 -0
- package/Tests/Types/DatabaseServer/DatabaseSystem.test.ts +1514 -0
- package/Tests/Types/DatabaseServer/DatabaseTelemetryResolver.test.ts +1558 -0
- package/Tests/Types/Monitor/CephAlertTemplates.test.ts +255 -6
- package/Tests/Types/Monitor/DatabaseAlertTemplates.test.ts +2254 -0
- package/Tests/Types/Monitor/KubernetesAlertTemplates.test.ts +298 -0
- package/Tests/Types/Monitor/KubernetesMetricCatalog.test.ts +271 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCatalog.test.ts +253 -9
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCoverage.test.ts +13 -5
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationNotificationMode.test.ts +4 -2
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationUtil.test.ts +111 -2
- package/Tests/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.test.ts +61 -0
- package/Tests/Types/Monitor/SeriesContext/SeriesLabelDisplay.test.ts +114 -0
- package/Tests/Types/Monitor/Utils/KubernetesAgentEmittedMetrics.ts +181 -0
- package/Tests/Types/NetworkDevice/DiscoveredHostNamingStatus.test.ts +401 -0
- package/Tests/Types/Rum/WebVitals.test.ts +173 -0
- package/Tests/Types/Telemetry/ResourceEntityFacet.test.ts +4 -1
- package/Tests/Types/Telemetry/ResourceFacetCatalog.test.ts +24 -2
- package/Tests/UI/Components/Card.test.tsx +93 -2
- package/Tests/UI/Components/FeedOptions.test.ts +6 -0
- package/Tests/UI/Components/FeedOptionsButton.test.tsx +8 -1
- package/Tests/UI/Components/FieldLabelInfoCardTooltip.test.tsx +413 -0
- package/Tests/UI/Components/ForeignHiddenRuleResilience.test.tsx +1147 -0
- package/Tests/UI/Components/HeaderRightRail.test.tsx +41 -1
- package/Tests/UI/Components/InfoTooltip.test.tsx +242 -0
- package/Tests/UI/Components/LogsEntityNames.test.ts +16 -1
- package/Tests/UI/Components/LogsFacetSidebarHiddenFacets.test.tsx +7 -3
- package/Tests/UI/Components/ModelTable/BaseModelTableBulkDelete.test.tsx +207 -3
- package/Tests/UI/Components/ModelTable/BaseModelTableBulkDeleteVerb.test.tsx +367 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableCreateButtonTitle.test.tsx +275 -0
- package/Tests/UI/Components/ResourceFacetConfigs.test.ts +2 -1
- package/Tests/UI/Components/RuleCriteria/RuleCriteriaModelTable.test.tsx +3 -3
- package/Tests/UI/Components/SrOnlyForeignRule.test.tsx +994 -0
- package/Tests/UI/Components/StatusPage/ResourceListSelection.test.tsx +34 -1
- package/Tests/UI/Components/TableHeaderTooltip.test.tsx +662 -0
- package/Tests/UI/Components/TelemetryFacetSidebarHiddenFacets.test.tsx +4 -1
- package/Tests/UI/ForeignHiddenRuleGuard.test.ts +1951 -0
- package/Tests/UI/Rum/PrivacySummaryCard.test.tsx +166 -9
- package/Tests/UI/Rum/RecordingHealthTooltips.test.tsx +447 -0
- package/Tests/UI/Rum/ReplayCorrelationPanel.test.tsx +164 -0
- package/Tests/UI/Rum/ReplayFrameCapture.test.ts +6750 -0
- package/Tests/UI/Rum/ReplayPlayerChrome.test.tsx +19 -1
- package/Tests/UI/Rum/ReplayRail.test.tsx +723 -12
- package/Tests/UI/Rum/ReplayRailDetail.test.tsx +86 -0
- package/Tests/UI/Rum/ReplayScreenshot.test.ts +2124 -0
- package/Tests/UI/Rum/ReplayScreenshotActions.test.tsx +3288 -0
- package/Tests/UI/Rum/ReplayStage.test.tsx +62 -0
- package/Tests/UI/Rum/ReplayStageOverlays.test.tsx +983 -2
- package/Tests/UI/Rum/ReplayTabSwitcher.test.tsx +19 -1
- package/Tests/UI/Rum/SessionReplaySettingsPolicyLoading.test.tsx +149 -0
- package/Tests/UI/Rum/SessionReplaySetupGuide.test.tsx +107 -6
- package/Tests/UI/Rum/SessionReplayUsersTableTooltips.test.tsx +330 -0
- package/Tests/UI/Rum/UserFlowTooltips.test.tsx +886 -0
- package/Tests/UI/TailwindPlayCdnForeignHiddenRule.test.ts +1005 -0
- package/Tests/UI/ThemeGroupHoverReveal.test.ts +847 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +80 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +23 -0
- package/Tests/UI/Utils/ModelAPISsoRedirect.test.ts +127 -0
- package/Tests/UI/Utils/Navigation.test.ts +102 -0
- package/Tests/UI/Utils/PermissionGate.test.ts +76 -0
- package/Tests/UI/Utils/Telemetry/TelemetryEntityNames.test.ts +23 -0
- package/Tests/Utils/Incident/IncidentFromAlerts.test.ts +696 -0
- package/Tests/Utils/LabelRuleImportExport.test.ts +5 -0
- package/Tests/Utils/MetricUnitUtil.test.ts +227 -2
- package/Tests/Utils/Monitor/MetricValueFormatter.test.ts +288 -2
- package/Tests/Utils/Monitor/PlatformResourceIdentityAndUnits.test.ts +1559 -0
- package/Tests/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.test.ts +2546 -0
- package/Tests/Utils/NetworkDiscovery/DiscoveredHostUtil.test.ts +315 -0
- package/Tests/Utils/NetworkDiscovery/DiscoveryReverseDnsChain.test.ts +336 -1
- package/Tests/Utils/NetworkDiscovery/NetbiosNameUtil.test.ts +244 -0
- package/Tests/Utils/Rum/SessionTraceState.test.ts +239 -0
- package/Tests/Utils/ValueFormatter.test.ts +50 -0
- package/Tests/tsconfig.json +16 -0
- package/Types/AI/AIResourceContext.ts +7 -0
- package/Types/Dashboard/DashboardTemplates.ts +2 -1
- package/Types/DatabaseServer/DatabaseConnectionSpan.ts +77 -0
- package/Types/DatabaseServer/DatabaseContainerClassifier.ts +2068 -0
- package/Types/DatabaseServer/DatabaseContainerCommand.ts +801 -0
- package/Types/DatabaseServer/DatabaseEndpoint.ts +1943 -0
- package/Types/DatabaseServer/DatabaseServerDiscoverySource.ts +68 -0
- package/Types/DatabaseServer/DatabaseServerMetricCatalog.ts +966 -0
- package/Types/DatabaseServer/DatabaseSystem.ts +2124 -0
- package/Types/DatabaseServer/DatabaseTelemetryResolver.ts +555 -0
- package/Types/Email/EmailTemplateType.ts +1 -0
- package/Types/Incident/IncidentAlertLink.ts +38 -0
- package/Types/Monitor/CephAlertTemplates.ts +18 -0
- package/Types/Monitor/DatabaseAlertTemplates.ts +2020 -0
- package/Types/Monitor/KubernetesAlertTemplates.ts +64 -24
- package/Types/Monitor/KubernetesMetricCatalog.ts +118 -19
- package/Types/Monitor/MetricMonitor/MetricCriteriaContext.ts +14 -0
- package/Types/Monitor/MetricMonitor/MetricMonitorResponse.ts +93 -10
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.ts +109 -8
- package/Types/Monitor/Recommendation/MonitorRecommendationTypes.ts +36 -7
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.ts +43 -2
- package/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.ts +41 -6
- package/Types/Monitor/SeriesContext/SeriesLabelDisplay.ts +26 -0
- package/Types/NetworkDevice/DiscoveredHostNamingStatus.ts +147 -0
- package/Types/Permission.ts +315 -0
- package/Types/Probe/ProbeApiIngestResponse.ts +8 -0
- package/Types/Rules/RuleCriteriaFieldRegistry.ts +10 -0
- package/Types/Rules/RuleRun.ts +12 -0
- package/Types/Rum/SessionReplay.ts +25 -6
- package/Types/Rum/WebVitals.ts +52 -0
- package/Types/Telemetry/EntityType.ts +23 -0
- package/Types/Telemetry/ResourceFacetCatalog.ts +14 -0
- package/Types/Telemetry/ServiceType.ts +8 -0
- package/UI/Components/Banner/Banner.tsx +1 -1
- package/UI/Components/Card/Card.tsx +1 -1
- package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +2 -2
- package/UI/Components/Charts/Line/LineChart.tsx +7 -0
- package/UI/Components/CommandPalette/CommandPalette.tsx +1 -1
- package/UI/Components/Date/StartAndEndDate.tsx +5 -5
- package/UI/Components/Detail/FieldLabel.tsx +8 -0
- package/UI/Components/Diagram/HorizontalStepChain.tsx +1 -1
- package/UI/Components/Feed/FeedOptionsButton.tsx +1 -1
- package/UI/Components/Forms/BasicForm.tsx +1 -1
- package/UI/Components/Header/Header.tsx +1 -1
- package/UI/Components/Header/HeaderIconDropdownButton.tsx +1 -1
- package/UI/Components/HeaderAlert/HeaderAlert.tsx +1 -1
- package/UI/Components/InfoCard/InfoCard.tsx +47 -1
- package/UI/Components/LogsViewer/components/FacetValueRow.tsx +1 -1
- package/UI/Components/LogsViewer/components/LogsFacetSidebar.tsx +1 -1
- package/UI/Components/Modal/ModalFooter.tsx +1 -1
- package/UI/Components/ModelDetail/CardModelDetail.tsx +2 -2
- package/UI/Components/ModelTable/BaseModelTable.tsx +99 -21
- package/UI/Components/ModelTable/Column.ts +5 -0
- package/UI/Components/Navbar/NavBar.tsx +9 -2
- package/UI/Components/Navbar/NavBarMenuModal.tsx +2 -2
- package/UI/Components/Page/Page.tsx +1 -1
- package/UI/Components/Pagination/Pagination.tsx +3 -3
- package/UI/Components/ProgressButtons/ProgressButtonItem.tsx +1 -1
- package/UI/Components/SideMenu/SideMenu.tsx +4 -1
- package/UI/Components/StatusPage/ResourceGroupNavigator.tsx +4 -2
- package/UI/Components/StatusPage/ResourceList.tsx +6 -6
- package/UI/Components/Table/TableHeader.tsx +47 -2
- package/UI/Components/Table/Types/Column.ts +7 -0
- package/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.tsx +1 -1
- package/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.tsx +1 -1
- package/UI/Components/Tooltip/InfoTooltip.tsx +78 -0
- package/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.tsx +1 -1
- package/UI/Components/Workflow/ComponentsModal.tsx +2 -2
- package/UI/Components/Workflow/StepTraceViewer.tsx +1 -1
- package/UI/Styles/Theme.css +8 -1
- package/UI/Utils/Navigation.ts +89 -42
- package/UI/Utils/PermissionGate.ts +11 -2
- package/UI/Utils/Telemetry/TelemetryEntityNames.ts +7 -0
- package/UI/Utils/TelemetryService.ts +4 -3
- package/Utils/Incident/IncidentFromAlerts.ts +516 -0
- package/Utils/LabelRuleImportExport.ts +2 -0
- package/Utils/MetricUnitUtil.ts +103 -11
- package/Utils/Monitor/MetricValueFormatter.ts +66 -13
- package/Utils/Monitor/PlatformMetricUnitUtil.ts +215 -0
- package/Utils/Monitor/PlatformResourceIdentity.ts +514 -0
- package/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.ts +425 -0
- package/Utils/NetworkDiscovery/DiscoveredHostUtil.ts +32 -0
- package/Utils/NetworkDiscovery/NetbiosNameUtil.ts +73 -0
- package/Utils/Rum/SessionTraceState.ts +212 -0
- package/Utils/Telemetry/DatabaseServerEntityKeys.ts +275 -0
- package/Utils/Telemetry/EntityKey.ts +176 -0
- package/Utils/ValueFormatter.ts +16 -0
- package/build/dist/Models/DatabaseModels/Alert.js +54 -0
- package/build/dist/Models/DatabaseModels/Alert.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertFeed.js +2 -0
- package/build/dist/Models/DatabaseModels/AlertFeed.js.map +1 -1
- package/build/dist/Models/DatabaseModels/DatabaseServer.js +1683 -0
- package/build/dist/Models/DatabaseModels/DatabaseServer.js.map +1 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerEndpoint.js +559 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerEndpoint.js.map +1 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerFeed.js +648 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerLabelRule.js +522 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerLabelRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerOwnerRule.js +603 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerOwnerRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerOwnerTeam.js +506 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerOwnerTeam.js.map +1 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerOwnerUser.js +505 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerOwnerUser.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Incident.js +54 -0
- package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentAlert.js +553 -0
- package/build/dist/Models/DatabaseModels/IncidentAlert.js.map +1 -0
- package/build/dist/Models/DatabaseModels/IncidentFeed.js +2 -0
- package/build/dist/Models/DatabaseModels/IncidentFeed.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +18 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +62 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/RumApplication.js +53 -1
- package/build/dist/Models/DatabaseModels/RumApplication.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js +54 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryException.js +2 -0
- package/build/dist/Models/DatabaseModels/TelemetryException.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserProjectSsoConsent.js +162 -0
- package/build/dist/Models/DatabaseModels/UserProjectSsoConsent.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794800000000-AddSessionReplaySameOriginTracePropagation.js +20 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794800000000-AddSessionReplaySameOriginTracePropagation.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794900000000-AddIncidentAlert.js +42 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794900000000-AddIncidentAlert.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795000000000-AddDatabaseServerTables.js +240 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795000000000-AddDatabaseServerTables.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795100000000-AddUserProjectSsoConsent.js +26 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795100000000-AddUserProjectSsoConsent.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/MultipartFormData.js +1 -1
- package/build/dist/Server/Middleware/TelemetryIngest.js +15 -8
- package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
- package/build/dist/Server/Services/AlertReminderRuleService.js +72 -23
- package/build/dist/Server/Services/AlertReminderRuleService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseServerEndpointService.js +694 -0
- package/build/dist/Server/Services/DatabaseServerEndpointService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerFeedService.js +110 -0
- package/build/dist/Server/Services/DatabaseServerFeedService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerLabelRuleEngineService.js +272 -0
- package/build/dist/Server/Services/DatabaseServerLabelRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerLabelRuleService.js +13 -0
- package/build/dist/Server/Services/DatabaseServerLabelRuleService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerOwnerRuleEngineService.js +340 -0
- package/build/dist/Server/Services/DatabaseServerOwnerRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerOwnerRuleService.js +13 -0
- package/build/dist/Server/Services/DatabaseServerOwnerRuleService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerOwnerTeamService.js +160 -0
- package/build/dist/Server/Services/DatabaseServerOwnerTeamService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerOwnerUserService.js +153 -0
- package/build/dist/Server/Services/DatabaseServerOwnerUserService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerService.js +3272 -0
- package/build/dist/Server/Services/DatabaseServerService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseService.js +8 -4
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/DockerResourceService.js +30 -3
- package/build/dist/Server/Services/DockerResourceService.js.map +1 -1
- package/build/dist/Server/Services/IncidentAlertService.js +1370 -0
- package/build/dist/Server/Services/IncidentAlertService.js.map +1 -0
- package/build/dist/Server/Services/IncidentReminderRuleService.js +73 -23
- package/build/dist/Server/Services/IncidentReminderRuleService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +164 -12
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js +21 -0
- package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +18 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/InventoryItemService.js +88 -5
- package/build/dist/Server/Services/InventoryItemService.js.map +1 -1
- package/build/dist/Server/Services/IoTDeviceService.js +111 -24
- package/build/dist/Server/Services/IoTDeviceService.js.map +1 -1
- package/build/dist/Server/Services/OpenTelemetryIngestService.js +24 -9
- package/build/dist/Server/Services/OpenTelemetryIngestService.js.map +1 -1
- package/build/dist/Server/Services/PodmanResourceService.js +30 -3
- package/build/dist/Server/Services/PodmanResourceService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceReminderRuleService.js +75 -23
- package/build/dist/Server/Services/ScheduledMaintenanceReminderRuleService.js.map +1 -1
- package/build/dist/Server/Services/ServiceService.js +1 -1
- package/build/dist/Server/Services/ServiceService.js.map +1 -1
- package/build/dist/Server/Services/TelemetryUsageBillingService.js +23 -2
- package/build/dist/Server/Services/TelemetryUsageBillingService.js.map +1 -1
- package/build/dist/Server/Services/UserProjectSsoConsentService.js +79 -0
- package/build/dist/Server/Services/UserProjectSsoConsentService.js.map +1 -0
- package/build/dist/Server/Services/UserService.js +13 -1
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js +18 -0
- package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js.map +1 -1
- package/build/dist/Server/Types/Database/QueryHelper.js +26 -1
- package/build/dist/Server/Types/Database/QueryHelper.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/ResourceTools.js +46 -0
- package/build/dist/Server/Utils/AI/Toolbox/ResourceTools.js.map +1 -1
- package/build/dist/Server/Utils/Database/AffectedResourceRelations.js +6 -0
- package/build/dist/Server/Utils/Database/AffectedResourceRelations.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js +134 -13
- package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +22 -6
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +1489 -524
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +22 -6
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js +196 -6
- package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorResource.js +36 -9
- package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorResourceContext.js +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorResourceContext.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorStepResourceIdentity.js +175 -17
- package/build/dist/Server/Utils/Monitor/MonitorStepResourceIdentity.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/PerSeriesResolutionRootCause.js +29 -0
- package/build/dist/Server/Utils/Monitor/PerSeriesResolutionRootCause.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js +211 -0
- package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/SeriesResourceLinker.js +82 -10
- package/build/dist/Server/Utils/Monitor/SeriesResourceLinker.js.map +1 -1
- package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js +25 -0
- package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js.map +1 -1
- package/build/dist/Server/Utils/SessionReplay/SessionReplayGateCache.js +8 -0
- package/build/dist/Server/Utils/SessionReplay/SessionReplayGateCache.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js +20 -4
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.js +2 -0
- package/build/dist/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/DatabaseEndpointDiscovery.js +442 -0
- package/build/dist/Server/Utils/Telemetry/DatabaseEndpointDiscovery.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +5 -1
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/LogExceptionExtractor.js +15 -1
- package/build/dist/Server/Utils/Telemetry/LogExceptionExtractor.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js +121 -5
- package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/ResourceFacetResolver.js +12 -0
- package/build/dist/Server/Utils/Telemetry/ResourceFacetResolver.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/ServiceDependencyDiscovery.js +438 -36
- package/build/dist/Server/Utils/Telemetry/ServiceDependencyDiscovery.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/Telemetry.js +12 -0
- package/build/dist/Server/Utils/Telemetry/Telemetry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +17 -18
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/TelemetryIngestionKeyGuard.js +16 -10
- package/build/dist/Server/Utils/Telemetry/TelemetryIngestionKeyGuard.js.map +1 -1
- package/build/dist/Types/AI/AIResourceContext.js +7 -0
- package/build/dist/Types/AI/AIResourceContext.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardTemplates.js +2 -1
- package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
- package/build/dist/Types/DatabaseServer/DatabaseConnectionSpan.js +71 -0
- package/build/dist/Types/DatabaseServer/DatabaseConnectionSpan.js.map +1 -0
- package/build/dist/Types/DatabaseServer/DatabaseContainerClassifier.js +1462 -0
- package/build/dist/Types/DatabaseServer/DatabaseContainerClassifier.js.map +1 -0
- package/build/dist/Types/DatabaseServer/DatabaseContainerCommand.js +691 -0
- package/build/dist/Types/DatabaseServer/DatabaseContainerCommand.js.map +1 -0
- package/build/dist/Types/DatabaseServer/DatabaseEndpoint.js +1407 -0
- package/build/dist/Types/DatabaseServer/DatabaseEndpoint.js.map +1 -0
- package/build/dist/Types/DatabaseServer/DatabaseServerDiscoverySource.js +60 -0
- package/build/dist/Types/DatabaseServer/DatabaseServerDiscoverySource.js.map +1 -0
- package/build/dist/Types/DatabaseServer/DatabaseServerMetricCatalog.js +804 -0
- package/build/dist/Types/DatabaseServer/DatabaseServerMetricCatalog.js.map +1 -0
- package/build/dist/Types/DatabaseServer/DatabaseSystem.js +1860 -0
- package/build/dist/Types/DatabaseServer/DatabaseSystem.js.map +1 -0
- package/build/dist/Types/DatabaseServer/DatabaseTelemetryResolver.js +406 -0
- package/build/dist/Types/DatabaseServer/DatabaseTelemetryResolver.js.map +1 -0
- package/build/dist/Types/Email/EmailTemplateType.js +1 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/Incident/IncidentAlertLink.js +34 -0
- package/build/dist/Types/Incident/IncidentAlertLink.js.map +1 -0
- package/build/dist/Types/Monitor/CephAlertTemplates.js +18 -0
- package/build/dist/Types/Monitor/CephAlertTemplates.js.map +1 -1
- package/build/dist/Types/Monitor/DatabaseAlertTemplates.js +1518 -0
- package/build/dist/Types/Monitor/DatabaseAlertTemplates.js.map +1 -0
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +57 -24
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
- package/build/dist/Types/Monitor/KubernetesMetricCatalog.js +104 -18
- package/build/dist/Types/Monitor/KubernetesMetricCatalog.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +80 -3
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js +10 -3
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +29 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.js +21 -6
- package/build/dist/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.js.map +1 -1
- package/build/dist/Types/Monitor/SeriesContext/SeriesLabelDisplay.js +25 -0
- package/build/dist/Types/Monitor/SeriesContext/SeriesLabelDisplay.js.map +1 -1
- package/build/dist/Types/NetworkDevice/DiscoveredHostNamingStatus.js +136 -0
- package/build/dist/Types/NetworkDevice/DiscoveredHostNamingStatus.js.map +1 -0
- package/build/dist/Types/Permission.js +276 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js +10 -0
- package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js.map +1 -1
- package/build/dist/Types/Rules/RuleRun.js +4 -0
- package/build/dist/Types/Rules/RuleRun.js.map +1 -1
- package/build/dist/Types/Rum/WebVitals.js +25 -0
- package/build/dist/Types/Rum/WebVitals.js.map +1 -1
- package/build/dist/Types/Telemetry/EntityType.js +23 -0
- package/build/dist/Types/Telemetry/EntityType.js.map +1 -1
- package/build/dist/Types/Telemetry/ResourceFacetCatalog.js +14 -0
- package/build/dist/Types/Telemetry/ResourceFacetCatalog.js.map +1 -1
- package/build/dist/Types/Telemetry/ServiceType.js +8 -0
- package/build/dist/Types/Telemetry/ServiceType.js.map +1 -1
- package/build/dist/UI/Components/Banner/Banner.js +1 -1
- package/build/dist/UI/Components/Banner/Banner.js.map +1 -1
- package/build/dist/UI/Components/Card/Card.js +1 -1
- package/build/dist/UI/Components/Card/Card.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +2 -2
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js +1 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
- package/build/dist/UI/Components/CommandPalette/CommandPalette.js +1 -1
- package/build/dist/UI/Components/CommandPalette/CommandPalette.js.map +1 -1
- package/build/dist/UI/Components/Date/StartAndEndDate.js +5 -5
- package/build/dist/UI/Components/Date/StartAndEndDate.js.map +1 -1
- package/build/dist/UI/Components/Detail/FieldLabel.js +2 -0
- package/build/dist/UI/Components/Detail/FieldLabel.js.map +1 -1
- package/build/dist/UI/Components/Diagram/HorizontalStepChain.js +1 -1
- package/build/dist/UI/Components/Diagram/HorizontalStepChain.js.map +1 -1
- package/build/dist/UI/Components/Feed/FeedOptionsButton.js +1 -1
- package/build/dist/UI/Components/Feed/FeedOptionsButton.js.map +1 -1
- package/build/dist/UI/Components/Forms/BasicForm.js +1 -1
- package/build/dist/UI/Components/Forms/BasicForm.js.map +1 -1
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js +1 -1
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
- package/build/dist/UI/Components/HeaderAlert/HeaderAlert.js +1 -1
- package/build/dist/UI/Components/HeaderAlert/HeaderAlert.js.map +1 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js +22 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/FacetValueRow.js +1 -1
- package/build/dist/UI/Components/LogsViewer/components/FacetValueRow.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js.map +1 -1
- package/build/dist/UI/Components/Modal/ModalFooter.js +1 -1
- package/build/dist/UI/Components/Modal/ModalFooter.js.map +1 -1
- package/build/dist/UI/Components/ModelDetail/CardModelDetail.js +2 -2
- package/build/dist/UI/Components/ModelDetail/CardModelDetail.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +70 -18
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBar.js +9 -2
- package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +2 -2
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
- package/build/dist/UI/Components/Page/Page.js +1 -1
- package/build/dist/UI/Components/Page/Page.js.map +1 -1
- package/build/dist/UI/Components/Pagination/Pagination.js +3 -3
- package/build/dist/UI/Components/Pagination/Pagination.js.map +1 -1
- package/build/dist/UI/Components/ProgressButtons/ProgressButtonItem.js +1 -1
- package/build/dist/UI/Components/ProgressButtons/ProgressButtonItem.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenu.js +4 -1
- package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
- package/build/dist/UI/Components/StatusPage/ResourceGroupNavigator.js +3 -1
- package/build/dist/UI/Components/StatusPage/ResourceGroupNavigator.js.map +1 -1
- package/build/dist/UI/Components/StatusPage/ResourceList.js +6 -6
- package/build/dist/UI/Components/StatusPage/ResourceList.js.map +1 -1
- package/build/dist/UI/Components/Table/TableHeader.js +18 -2
- package/build/dist/UI/Components/Table/TableHeader.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.js +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.js.map +1 -1
- package/build/dist/UI/Components/Tooltip/InfoTooltip.js +28 -0
- package/build/dist/UI/Components/Tooltip/InfoTooltip.js.map +1 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.js +1 -1
- package/build/dist/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentsModal.js +2 -2
- package/build/dist/UI/Components/Workflow/ComponentsModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/StepTraceViewer.js +1 -1
- package/build/dist/UI/Components/Workflow/StepTraceViewer.js.map +1 -1
- package/build/dist/UI/Utils/Navigation.js +66 -33
- package/build/dist/UI/Utils/Navigation.js.map +1 -1
- package/build/dist/UI/Utils/PermissionGate.js +4 -2
- package/build/dist/UI/Utils/PermissionGate.js.map +1 -1
- package/build/dist/UI/Utils/Telemetry/TelemetryEntityNames.js +7 -0
- package/build/dist/UI/Utils/Telemetry/TelemetryEntityNames.js.map +1 -1
- package/build/dist/UI/Utils/TelemetryService.js +3 -2
- package/build/dist/UI/Utils/TelemetryService.js.map +1 -1
- package/build/dist/Utils/Incident/IncidentFromAlerts.js +306 -0
- package/build/dist/Utils/Incident/IncidentFromAlerts.js.map +1 -0
- package/build/dist/Utils/LabelRuleImportExport.js +2 -0
- package/build/dist/Utils/LabelRuleImportExport.js.map +1 -1
- package/build/dist/Utils/MetricUnitUtil.js +77 -13
- package/build/dist/Utils/MetricUnitUtil.js.map +1 -1
- package/build/dist/Utils/Monitor/MetricValueFormatter.js +58 -13
- package/build/dist/Utils/Monitor/MetricValueFormatter.js.map +1 -1
- package/build/dist/Utils/Monitor/PlatformMetricUnitUtil.js +161 -0
- package/build/dist/Utils/Monitor/PlatformMetricUnitUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/PlatformResourceIdentity.js +323 -0
- package/build/dist/Utils/Monitor/PlatformResourceIdentity.js.map +1 -0
- package/build/dist/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.js +270 -0
- package/build/dist/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.js.map +1 -0
- package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js +23 -0
- package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js.map +1 -1
- package/build/dist/Utils/NetworkDiscovery/NetbiosNameUtil.js +61 -0
- package/build/dist/Utils/NetworkDiscovery/NetbiosNameUtil.js.map +1 -1
- package/build/dist/Utils/Rum/SessionTraceState.js +154 -0
- package/build/dist/Utils/Rum/SessionTraceState.js.map +1 -0
- package/build/dist/Utils/Telemetry/DatabaseServerEntityKeys.js +178 -0
- package/build/dist/Utils/Telemetry/DatabaseServerEntityKeys.js.map +1 -0
- package/build/dist/Utils/Telemetry/EntityKey.js +133 -0
- package/build/dist/Utils/Telemetry/EntityKey.js.map +1 -1
- package/build/dist/Utils/ValueFormatter.js +15 -0
- package/build/dist/Utils/ValueFormatter.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.tests.json +7 -5
|
@@ -34,20 +34,28 @@ import ValueFormatter from "../ValueFormatter";
|
|
|
34
34
|
* sample arrive carrying the unit "GB", and ValueFormatter has a
|
|
35
35
|
* ladder for "bytes" but not for "GB" — so 2500 of them rendered
|
|
36
36
|
* "2.5K GB" instead of "2.5 TB". Anything in a MetricUnitUtil family
|
|
37
|
-
* is converted to that family's base before the ladder runs.
|
|
37
|
+
* is converted to that family's base before the ladder runs. That
|
|
38
|
+
* includes the binary (IEC) byte units the vcenter receiver reports
|
|
39
|
+
* memory in: 2048 "MiBy" is restated as 2147483648 bytes and reads
|
|
40
|
+
* "2.15 GB", where it used to read "2048 MiB" and, for a large host,
|
|
41
|
+
* "1048576 MiB".
|
|
38
42
|
*
|
|
39
43
|
* 3. UNITS WORTH HIDING. OTel's dimensionless "1" and UCUM's
|
|
40
44
|
* annotation-only units ("{restarts}", "{packets}") are not
|
|
41
45
|
* dimensions, and printing them produces the "0.06 1" that
|
|
42
46
|
* CompareCriteria and MonitorCriteriaObservationBuilder each grew
|
|
43
|
-
* their own guard against. That rule lives here now
|
|
47
|
+
* their own guard against. That rule lives here now — with one
|
|
48
|
+
* exception: braces around a REAL, scalable unit ("{KiBy/s}", which
|
|
49
|
+
* the vcenter receiver uses for throughput) are unwrapped rather than
|
|
50
|
+
* hidden, because the value in them is a quantity, not a count.
|
|
44
51
|
*/
|
|
45
52
|
class MetricValueFormatter {
|
|
46
53
|
/**
|
|
47
54
|
* Whether `unit` names a real dimension for `metricName` — i.e. whether
|
|
48
55
|
* it is worth attaching to a number at all. False for the empty unit,
|
|
49
56
|
* for the dimensionless "1" on a non-fraction metric, and for
|
|
50
|
-
* annotation-only units.
|
|
57
|
+
* annotation-only units. True for a braced unit whose inner text is a
|
|
58
|
+
* scalable unit ("{KiBy/s}"), which format() renders as that unit.
|
|
51
59
|
*/
|
|
52
60
|
static hasDisplayableUnit(unit, metricName) {
|
|
53
61
|
const trimmed = MetricValueFormatter.canonicalizeUnit(unit);
|
|
@@ -75,6 +83,8 @@ class MetricValueFormatter {
|
|
|
75
83
|
* format({ value: 1500, unit: "ms" }) → "1.5 sec"
|
|
76
84
|
* format({ value: 3661, unit: "seconds" }) → "1.02 hours"
|
|
77
85
|
* format({ value: 1500000, unit: "By/s" }) → "1.5 MB/s"
|
|
86
|
+
* format({ value: 2048, unit: "MiBy" }) → "2.15 GB"
|
|
87
|
+
* format({ value: 2500000, unit: "{KiBy/s}" }) → "2.56 GB/s"
|
|
78
88
|
* format({ value: 0.2534, unit: "1",
|
|
79
89
|
* metricName: "system.cpu.utilization" }) → "25.34%"
|
|
80
90
|
* format({ value: 87.5, unit: "%" }) → "87.50%"
|
|
@@ -86,6 +96,7 @@ class MetricValueFormatter {
|
|
|
86
96
|
* A value with no dimension to report is left bare:
|
|
87
97
|
* format({ value: 1500 }) → "1500"
|
|
88
98
|
* format({ value: 1500, unit: "{restarts}" }) → "1500"
|
|
99
|
+
* format({ value: 1500, unit: "{errors/s}" }) → "1500"
|
|
89
100
|
* format({ value: 3.14159 }) → "3.14"
|
|
90
101
|
*/
|
|
91
102
|
static format(input) {
|
|
@@ -127,7 +138,7 @@ class MetricValueFormatter {
|
|
|
127
138
|
* becomes "m per s2" and "10*3/uL" becomes "10*3 per uL", both longer
|
|
128
139
|
* and less recognisable than what the exporter wrote. getCompactUnit
|
|
129
140
|
* keeps the slash and still expands what is worth expanding
|
|
130
|
-
* ("Cel" → "°C"
|
|
141
|
+
* ("Cel" → "°C").
|
|
131
142
|
*/
|
|
132
143
|
const unitSymbol = ValueFormatter.getCompactUnit(unit, formatOptions) || unit;
|
|
133
144
|
return `${MetricValueFormatter.formatBareNumber(input.value)} ${unitSymbol}`;
|
|
@@ -146,19 +157,43 @@ class MetricValueFormatter {
|
|
|
146
157
|
return readable.trim() ? readable : null;
|
|
147
158
|
}
|
|
148
159
|
/*
|
|
149
|
-
* Trim the unit
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
* value ("5 widgets",
|
|
160
|
+
* Trim the unit, unwrap a braced scalable unit ("{KiBy/s}" → "KiBy/s"),
|
|
161
|
+
* and rewrite the catalogs' English spellings of "no dimension" into the
|
|
162
|
+
* UCUM ones the rest of the pipeline understands. Anything else is
|
|
163
|
+
* returned untouched — including its casing, which matters because an
|
|
164
|
+
* unrecognised unit is echoed verbatim next to the value ("5 widgets",
|
|
165
|
+
* not "5 Widgets").
|
|
154
166
|
*/
|
|
155
167
|
static canonicalizeUnit(unit) {
|
|
156
168
|
const trimmed = (unit || "").trim();
|
|
157
169
|
if (!trimmed) {
|
|
158
170
|
return "";
|
|
159
171
|
}
|
|
160
|
-
const
|
|
161
|
-
|
|
172
|
+
const unwrapped = MetricValueFormatter.unwrapScalableAnnotation(trimmed);
|
|
173
|
+
const alias = MetricValueFormatter.informalUnitAliases[unwrapped.toLowerCase()];
|
|
174
|
+
return alias === undefined ? unwrapped : alias;
|
|
175
|
+
}
|
|
176
|
+
/*
|
|
177
|
+
* The vcenter receiver declares its throughput metrics as "{KiBy/s}":
|
|
178
|
+
* UCUM annotation braces around what is, in fact, a real unit. The
|
|
179
|
+
* annotation rule used to hide it, so 2500000 of them — about 2.56 GB/s
|
|
180
|
+
* of disk traffic — reached the inbox as a bare "2500000".
|
|
181
|
+
*
|
|
182
|
+
* So a braced unit is unwrapped when, and only when, its inner text is
|
|
183
|
+
* something this formatter can SCALE: a unit with a ladder, a member of
|
|
184
|
+
* a MetricUnitUtil family whose base has one ("KiBy", "GB", "min"), or
|
|
185
|
+
* a rate whose numerator is one of those ("KiBy/s", "By/s"). Every
|
|
186
|
+
* genuine annotation stays hidden exactly as before — "{restarts}",
|
|
187
|
+
* "{cpu}", "{packets/s}" and "{errors/s}" name no unit a ladder knows,
|
|
188
|
+
* so they keep rendering as the bare count.
|
|
189
|
+
*/
|
|
190
|
+
static unwrapScalableAnnotation(unit) {
|
|
191
|
+
const match = unit.match(MetricValueFormatter.bracedUnitPattern);
|
|
192
|
+
const inner = ((match === null || match === void 0 ? void 0 : match[1]) || "").trim();
|
|
193
|
+
if (!inner) {
|
|
194
|
+
return unit;
|
|
195
|
+
}
|
|
196
|
+
return MetricValueFormatter.toScalableUnit(1, inner) ? inner : unit;
|
|
162
197
|
}
|
|
163
198
|
/**
|
|
164
199
|
* Whether this metric's value is a point in time rather than a quantity,
|
|
@@ -179,8 +214,9 @@ class MetricValueFormatter {
|
|
|
179
214
|
* - it already has one ("bytes", "ms", "s", "ns");
|
|
180
215
|
* - it is a rate whose NUMERATOR does ("By/s" → scale the bytes, keep
|
|
181
216
|
* the "/s"), which is how 1500000 By/s reads "1.5 MB/s";
|
|
182
|
-
* - it is a prefixed member of a MetricUnitUtil family ("GB", "hours"
|
|
183
|
-
* in which case the value is
|
|
217
|
+
* - it is a prefixed member of a MetricUnitUtil family ("GB", "hours",
|
|
218
|
+
* and the binary "MiBy" / "KiBy"), in which case the value is
|
|
219
|
+
* converted into that family's base first.
|
|
184
220
|
*/
|
|
185
221
|
static toScalableUnit(value, unit) {
|
|
186
222
|
if (!unit) {
|
|
@@ -235,8 +271,17 @@ class MetricValueFormatter {
|
|
|
235
271
|
* UCUM annotation-only units — "{thread}", "{packets}", "{errors}".
|
|
236
272
|
* The braces describe what is being counted; the value is a plain
|
|
237
273
|
* count and the text inside them is not a unit a reader should see.
|
|
274
|
+
*
|
|
275
|
+
* Only reached for braces whose inner text is NOT itself a scalable
|
|
276
|
+
* unit: canonicalizeUnit has already unwrapped "{KiBy/s}" to "KiBy/s"
|
|
277
|
+
* (see unwrapScalableAnnotation), so what still matches here is a
|
|
278
|
+
* genuine annotation.
|
|
238
279
|
*/
|
|
239
280
|
MetricValueFormatter.annotationOnlyUnitPattern = /^\{[^{}]*\}$/;
|
|
281
|
+
/*
|
|
282
|
+
* The same shape, capturing the inner text.
|
|
283
|
+
*/
|
|
284
|
+
MetricValueFormatter.bracedUnitPattern = /^\{([^{}]*)\}$/;
|
|
240
285
|
/*
|
|
241
286
|
* The per-platform metric catalogs (Kubernetes, Ceph, Proxmox, Docker
|
|
242
287
|
* Swarm) were written for humans reading a metric picker, so they spell
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetricValueFormatter.js","sourceRoot":"","sources":["../../../../Utils/Monitor/MetricValueFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"MetricValueFormatter.js","sourceRoot":"","sources":["../../../../Utils/Monitor/MetricValueFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,cAAc,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ACrB,CAAC;YACF,IAAI,EAAE,QAAQ;SACf,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACK,MAAM,CAAC,gBAAgB,CAAC,KAAa;QAC3C,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;QAC1B,CAAC;QAED,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC7C,CAAC;;AApVD;;;;;;;;;GASG;AACqB,8CAAyB,GAAW,cAAc,CAAC;AAE3E;;GAEG;AACqB,sCAAiB,GAAW,gBAAgB,CAAC;AAErE;;;;;;;;;;;;GAYG;AACqB,wCAAmB,GAA2B;IACpE,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,GAAG;IACV,QAAQ,EAAE,GAAG;CACd,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACqB,mDAA8B,GACpD,sCAAsC,CAAC;eAtDtB,oBAAoB"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import MonitorType from "../../Types/Monitor/MonitorType";
|
|
2
|
+
import { getCephMetricByMetricName } from "../../Types/Monitor/CephMetricCatalog";
|
|
3
|
+
import { getDockerMetricByMetricName } from "../../Types/Monitor/DockerMetricCatalog";
|
|
4
|
+
import { getDockerSwarmMetricByMetricName } from "../../Types/Monitor/DockerSwarmMetricCatalog";
|
|
5
|
+
import { getHostMetricByMetricName } from "../../Types/Monitor/HostMetricCatalog";
|
|
6
|
+
import { getIoTMetricByMetricName } from "../../Types/Monitor/IotMetricCatalog";
|
|
7
|
+
import { getKubernetesMetricByMetricName } from "../../Types/Monitor/KubernetesMetricCatalog";
|
|
8
|
+
import { getPodmanMetricByMetricName } from "../../Types/Monitor/PodmanMetricCatalog";
|
|
9
|
+
import { getProxmoxMetricByMetricName } from "../../Types/Monitor/ProxmoxMetricCatalog";
|
|
10
|
+
import { getVMwareMetricByMetricName } from "../../Types/Monitor/VMwareMetricCatalog";
|
|
11
|
+
/*
|
|
12
|
+
* What unit a platform monitor's metric values are in.
|
|
13
|
+
*
|
|
14
|
+
* Two sources can answer that, and they disagree often enough to matter:
|
|
15
|
+
*
|
|
16
|
+
* - the unit the OpenTelemetry exporter DECLARED, stored on MetricType
|
|
17
|
+
* (k8s.node.allocatable_memory → "By");
|
|
18
|
+
* - the unit the platform's metric catalog SAYS the values are in
|
|
19
|
+
* (KubernetesMetricCatalog, DockerMetricCatalog, ...).
|
|
20
|
+
*
|
|
21
|
+
* The catalog wins. It was written against what each agent actually sends,
|
|
22
|
+
* and the exporters are not always right about their own numbers:
|
|
23
|
+
* docker_stats declares container.cpu.utilization and
|
|
24
|
+
* container.memory.percent with the unit "1" but sends 0–100. Taking the
|
|
25
|
+
* declared "1" would render 85.3 as "8530.00%", and — worse — a threshold
|
|
26
|
+
* typed in "%" would convert every sample ×100 and fire forever. kubeletstats
|
|
27
|
+
* declares k8s.node.cpu.utilization as "1" but it is a cores gauge.
|
|
28
|
+
*
|
|
29
|
+
* The declared unit is the fallback for everything the catalog does not
|
|
30
|
+
* know, which is how k8s.node.allocatable_memory reads "258 GB" instead of
|
|
31
|
+
* "257760964608" even before it has a catalog entry.
|
|
32
|
+
*/
|
|
33
|
+
export default class PlatformMetricUnitUtil {
|
|
34
|
+
/**
|
|
35
|
+
* The catalog platform a monitor type reads its metrics from, or null for
|
|
36
|
+
* monitor types without one (generic Metrics monitors keep the exporter's
|
|
37
|
+
* declared unit).
|
|
38
|
+
*/
|
|
39
|
+
static getPlatformForMonitorType(monitorType) {
|
|
40
|
+
switch (monitorType) {
|
|
41
|
+
case MonitorType.Kubernetes:
|
|
42
|
+
return "kubernetes";
|
|
43
|
+
case MonitorType.Proxmox:
|
|
44
|
+
return "proxmox";
|
|
45
|
+
case MonitorType.VMware:
|
|
46
|
+
return "vmware";
|
|
47
|
+
case MonitorType.DockerSwarm:
|
|
48
|
+
return "dockerSwarm";
|
|
49
|
+
case MonitorType.Ceph:
|
|
50
|
+
return "ceph";
|
|
51
|
+
case MonitorType.Docker:
|
|
52
|
+
return "docker";
|
|
53
|
+
case MonitorType.Podman:
|
|
54
|
+
return "podman";
|
|
55
|
+
case MonitorType.Host:
|
|
56
|
+
return "host";
|
|
57
|
+
case MonitorType.IoTDevice:
|
|
58
|
+
return "iot";
|
|
59
|
+
default:
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The unit the platform's catalog declares for a metric, exactly as the
|
|
65
|
+
* catalog spells it ("bytes", "cores", "ratio", "count", "%"), or
|
|
66
|
+
* undefined when the catalog does not know the metric or gives it no
|
|
67
|
+
* unit.
|
|
68
|
+
*/
|
|
69
|
+
static getCatalogUnit(input) {
|
|
70
|
+
const unit = PlatformMetricUnitUtil.lookupCatalogUnit(input.platform, input.metricName);
|
|
71
|
+
return unit && unit.trim() ? unit.trim() : undefined;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The unit a platform metric's values are in, spelled so the rest of the
|
|
75
|
+
* pipeline can convert it: the catalog unit when the catalog has a real
|
|
76
|
+
* one, else the exporter-declared unit, else undefined.
|
|
77
|
+
*
|
|
78
|
+
* The catalogs spell two dimensionless concepts in English. "ratio" (and
|
|
79
|
+
* "fraction") becomes UCUM's "1", which MetricUnitUtil can convert to a
|
|
80
|
+
* "%" threshold and MetricValueFormatter renders as a percentage.
|
|
81
|
+
* "count" names no dimension at all, so it defers to the declared unit
|
|
82
|
+
* ("{restart}", which renders bare the same way) instead of hiding it.
|
|
83
|
+
*/
|
|
84
|
+
static getMetricUnit(input) {
|
|
85
|
+
const catalogUnit = input.platform
|
|
86
|
+
? PlatformMetricUnitUtil.toConvertibleUnit(PlatformMetricUnitUtil.getCatalogUnit({
|
|
87
|
+
platform: input.platform,
|
|
88
|
+
metricName: input.metricName,
|
|
89
|
+
}))
|
|
90
|
+
: undefined;
|
|
91
|
+
if (catalogUnit) {
|
|
92
|
+
return catalogUnit;
|
|
93
|
+
}
|
|
94
|
+
const declaredUnit = (input.declaredUnit || "").trim();
|
|
95
|
+
return declaredUnit || undefined;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The unit map a platform monitor hands the criteria evaluator: one entry
|
|
99
|
+
* per metric name, keyed lowercased like MetricMonitorResponse's
|
|
100
|
+
* `nativeUnitsByMetricName`, holding getMetricUnit's answer. Metrics with
|
|
101
|
+
* no known unit are left out rather than mapped to "".
|
|
102
|
+
*/
|
|
103
|
+
static buildUnitsByMetricName(input) {
|
|
104
|
+
const unitsByMetricName = {};
|
|
105
|
+
for (const metricName of input.metricNames) {
|
|
106
|
+
if (!metricName) {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
const unit = PlatformMetricUnitUtil.getMetricUnit({
|
|
110
|
+
platform: input.platform,
|
|
111
|
+
metricName: metricName,
|
|
112
|
+
declaredUnit: input.declaredUnitsByMetricName.get(metricName.toLowerCase()),
|
|
113
|
+
});
|
|
114
|
+
if (unit) {
|
|
115
|
+
unitsByMetricName[metricName.toLowerCase()] = unit;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return unitsByMetricName;
|
|
119
|
+
}
|
|
120
|
+
static toConvertibleUnit(unit) {
|
|
121
|
+
if (!unit) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
switch (unit.toLowerCase()) {
|
|
125
|
+
case "ratio":
|
|
126
|
+
case "fraction":
|
|
127
|
+
return "1";
|
|
128
|
+
case "count":
|
|
129
|
+
case "counts":
|
|
130
|
+
return undefined;
|
|
131
|
+
default:
|
|
132
|
+
return unit;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
static lookupCatalogUnit(platform, metricName) {
|
|
136
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
137
|
+
switch (platform) {
|
|
138
|
+
case "kubernetes":
|
|
139
|
+
return (_a = getKubernetesMetricByMetricName(metricName)) === null || _a === void 0 ? void 0 : _a.unit;
|
|
140
|
+
case "proxmox":
|
|
141
|
+
return (_b = getProxmoxMetricByMetricName(metricName)) === null || _b === void 0 ? void 0 : _b.unit;
|
|
142
|
+
case "vmware":
|
|
143
|
+
return (_c = getVMwareMetricByMetricName(metricName)) === null || _c === void 0 ? void 0 : _c.unit;
|
|
144
|
+
case "dockerSwarm":
|
|
145
|
+
return (_d = getDockerSwarmMetricByMetricName(metricName)) === null || _d === void 0 ? void 0 : _d.unit;
|
|
146
|
+
case "ceph":
|
|
147
|
+
return (_e = getCephMetricByMetricName(metricName)) === null || _e === void 0 ? void 0 : _e.unit;
|
|
148
|
+
case "docker":
|
|
149
|
+
return (_f = getDockerMetricByMetricName(metricName)) === null || _f === void 0 ? void 0 : _f.unit;
|
|
150
|
+
case "podman":
|
|
151
|
+
return (_g = getPodmanMetricByMetricName(metricName)) === null || _g === void 0 ? void 0 : _g.unit;
|
|
152
|
+
case "host":
|
|
153
|
+
return (_h = getHostMetricByMetricName(metricName)) === null || _h === void 0 ? void 0 : _h.unit;
|
|
154
|
+
case "iot":
|
|
155
|
+
return (_j = getIoTMetricByMetricName(metricName)) === null || _j === void 0 ? void 0 : _j.unit;
|
|
156
|
+
default:
|
|
157
|
+
return undefined;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=PlatformMetricUnitUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlatformMetricUnitUtil.js","sourceRoot":"","sources":["../../../../Utils/Monitor/PlatformMetricUnitUtil.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,gCAAgC,EAAE,MAAM,8CAA8C,CAAC;AA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
|
+
/*
|
|
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
|