@oneuptime/common 11.5.9 → 11.5.10
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/AnalyticsModels/Index.ts +13 -0
- package/Models/AnalyticsModels/MetricItemAggMV1mByContainer.ts +178 -0
- package/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.ts +179 -0
- package/Models/AnalyticsModels/MetricItemAggMV1mByService.ts +179 -0
- package/Models/AnalyticsModels/NetworkFlow.ts +397 -0
- package/Models/DatabaseModels/EnterpriseLicenseInstance.ts +18 -0
- package/Models/DatabaseModels/GlobalConfig.ts +36 -0
- package/Models/DatabaseModels/Index.ts +2 -0
- package/Models/DatabaseModels/MarketingConversion.ts +198 -0
- package/Models/DatabaseModels/MetricSavedView.ts +34 -0
- package/Models/DatabaseModels/MetricType.ts +74 -0
- package/Models/DatabaseModels/NetworkDevice.ts +332 -0
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +113 -0
- package/Models/DatabaseModels/NetworkInterface.ts +58 -0
- package/Models/DatabaseModels/Project.ts +37 -0
- package/Models/DatabaseModels/User.ts +37 -0
- package/Server/API/BaseAnalyticsAPI.ts +23 -0
- package/Server/API/EnterpriseLicenseAPI.ts +14 -0
- package/Server/EnvironmentConfig.ts +84 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784191414522-AddCounterSemanticsToMetricType.ts +38 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784191414600-AddViewTypeToMetricSavedView.ts +28 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784211212164-AddNetworkDeviceInventoryAndDiscoverySchedule.ts +108 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784218257664-AddEnterpriseLicenseNotificationColumns.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784293516000-AddAttributionColumnsToUserAndProject.ts +29 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784298000000-AddMarketingConversionTable.ts +35 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +12 -0
- package/Server/Services/AnalyticsDatabaseService.ts +70 -1
- package/Server/Services/IncidentService.ts +13 -0
- package/Server/Services/Index.ts +10 -0
- package/Server/Services/MarketingConversionService.ts +10 -0
- package/Server/Services/MetricItemAggMV1mByContainerService.ts +31 -0
- package/Server/Services/MetricItemAggMV1mByK8sClusterService.ts +31 -0
- package/Server/Services/MetricItemAggMV1mByServiceService.ts +31 -0
- package/Server/Services/MetricService.ts +970 -122
- package/Server/Services/MonitorService.ts +14 -0
- package/Server/Services/NetworkDeviceOwnerTeamService.ts +42 -0
- package/Server/Services/NetworkDeviceOwnerUserService.ts +106 -0
- package/Server/Services/NetworkFlowService.ts +11 -0
- package/Server/Services/OnCallDutyPolicyService.ts +11 -1
- package/Server/Services/ProjectService.ts +136 -0
- package/Server/Services/SpanService.ts +13 -9
- package/Server/Services/StatusPageService.ts +10 -0
- package/Server/Services/TeamMemberService.ts +11 -0
- package/Server/Services/UserService.ts +59 -0
- package/Server/Types/AnalyticsDatabase/AggregateBy.ts +37 -7
- package/Server/Utils/Attribution.ts +99 -0
- package/Server/Utils/Marketing/ConversionUploadProvider.ts +103 -0
- package/Server/Utils/Marketing/ConversionUploadProviders.ts +22 -0
- package/Server/Utils/Marketing/Providers/GoogleAds.ts +270 -0
- package/Server/Utils/Marketing/Providers/LinkedIn.ts +147 -0
- package/Server/Utils/Marketing/Providers/Meta.ts +148 -0
- package/Server/Utils/Marketing/Providers/MicrosoftAds.ts +196 -0
- package/Server/Utils/Marketing/Providers/Reddit.ts +178 -0
- package/Server/Utils/Monitor/MonitorAlert.ts +71 -7
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +31 -19
- package/Server/Utils/Monitor/MonitorIncident.ts +71 -7
- package/Server/Utils/Monitor/MonitorMetricUtil.ts +57 -0
- package/Server/Utils/Monitor/MonitorTemplateUtil.ts +94 -0
- package/Server/Utils/Monitor/NetworkDeviceHydrationUtil.ts +15 -0
- package/Server/Utils/Monitor/NetworkInventoryUtil.ts +125 -14
- package/Server/Utils/ProductAnalytics.ts +133 -0
- package/Server/Utils/Telemetry/Telemetry.ts +39 -0
- package/Server/Utils/Telemetry/TelemetryEntity.ts +21 -0
- package/Tests/Server/API/BaseAnalyticsAPI.test.ts +72 -0
- package/Tests/Server/Infrastructure/SemaphorePermit.test.ts +9 -1
- package/Tests/Server/Services/AnalyticsDatabaseService.test.ts +21 -2
- package/Tests/Server/Services/MetricEntityMVKeyParity.test.ts +173 -0
- package/Tests/Server/Services/MetricServiceAggregate.test.ts +1391 -0
- package/Tests/Server/Services/NetworkDeviceOwnerServices.test.ts +260 -0
- package/Tests/Server/Utils/Monitor/MonitorTemplateUtilNetworkDevice.test.ts +389 -0
- package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +764 -0
- package/Tests/Types/BaseDatabase/AggregationIntervalUtil.test.ts +111 -2
- package/Tests/Types/Database/EndsWith.test.ts +64 -0
- package/Tests/Types/Database/GreaterThan.test.ts +62 -0
- package/Tests/Types/Database/GreaterThanOrEqual.test.ts +65 -0
- package/Tests/Types/Database/GreaterThanOrNull.test.ts +63 -0
- package/Tests/Types/Database/Includes.test.ts +65 -0
- package/Tests/Types/Database/IncludesAll.test.ts +65 -0
- package/Tests/Types/Database/IncludesNone.test.ts +65 -0
- package/Tests/Types/Database/IsNull.test.ts +44 -0
- package/Tests/Types/Database/LessThan.test.ts +62 -0
- package/Tests/Types/Database/LessThanOrEqual.test.ts +62 -0
- package/Tests/Types/Database/LessThanOrNull.test.ts +62 -0
- package/Tests/Types/Database/MultiSearch.test.ts +81 -0
- package/Tests/Types/Database/NotContains.test.ts +64 -0
- package/Tests/Types/Database/NotNull.test.ts +44 -0
- package/Tests/Types/Database/StartsWith.test.ts +64 -0
- package/Tests/Types/Monitor/MonitorStepSqlMonitor.test.ts +83 -1
- package/Tests/Types/Monitor/SnmpV3EnumParsing.test.ts +247 -0
- package/Tests/Types/Monitor/SnmpVendorTemplate.test.ts +263 -0
- package/Tests/UI/Components/XAxis.test.ts +5 -3
- package/Tests/Utils/EnterpriseLicenseUsage.test.ts +76 -0
- package/Tests/Utils/Metrics/MetricExplorerUrl.test.ts +622 -0
- package/Tests/Utils/Metrics/MetricFormulaEvaluator.test.ts +474 -0
- package/Tests/Utils/Telemetry/HeartbeatAvailability.test.ts +52 -4
- package/Types/AnalyticsDatabase/AnalyticsTableName.ts +11 -0
- package/Types/BaseDatabase/AggregateBy.ts +31 -2
- package/Types/BaseDatabase/AggregatedResult.ts +22 -0
- package/Types/BaseDatabase/AggregationInterval.ts +11 -0
- package/Types/BaseDatabase/AggregationIntervalUtil.ts +30 -5
- package/Types/Dashboard/DashboardComponents/DashboardTraceChartComponent.ts +16 -0
- package/Types/Email/EmailTemplateType.ts +3 -0
- package/Types/Marketing/MarketingConversion.ts +11 -0
- package/Types/Metrics/MetricQueryConfigData.ts +21 -0
- package/Types/Metrics/MetricQueryData.ts +8 -0
- package/Types/Metrics/MetricViewData.ts +8 -0
- package/Types/Monitor/MonitorMetricType.ts +8 -0
- package/Types/Monitor/MonitorStep.ts +9 -0
- package/Types/Monitor/MonitorStepSqlMonitor.ts +12 -0
- package/Types/Monitor/MonitorType.ts +2 -1
- package/Types/Monitor/SSLMonitor/SslMonitorResponse.ts +17 -12
- package/Types/Monitor/SnmpMonitor/CdpNeighbor.ts +13 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +37 -3
- package/Types/Monitor/SnmpMonitor/SnmpAuthProtocol.ts +46 -0
- package/Types/Monitor/SnmpMonitor/SnmpEntityInfo.ts +15 -0
- package/Types/Monitor/SnmpMonitor/SnmpInterface.ts +8 -0
- package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.ts +17 -8
- package/Types/Monitor/SnmpMonitor/SnmpPrivProtocol.ts +53 -0
- package/Types/Monitor/SnmpMonitor/SnmpSecurityLevel.ts +43 -0
- package/Types/Monitor/SnmpMonitor/SnmpSystemInfo.ts +16 -0
- package/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.ts +119 -3
- package/Types/NetFlow/NetworkFlowRecord.ts +25 -0
- package/Types/Syslog/SyslogMessage.ts +18 -0
- package/Types/Telemetry/TelemetrySavedViewState.ts +9 -0
- package/Types/Telemetry/TelemetrySavedViewType.ts +12 -0
- package/UI/Components/Charts/Area/AreaChart.tsx +51 -0
- package/UI/Components/Charts/Bar/BarChart.tsx +51 -1
- package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +97 -26
- package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +328 -1
- package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +115 -0
- package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +328 -1
- package/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.ts +7 -0
- package/UI/Components/Charts/ChartLibrary/Types/FormattedReferenceRegion.ts +15 -0
- package/UI/Components/Charts/ChartLibrary/Types/FormattedTimeReferenceLine.ts +13 -0
- package/UI/Components/Charts/Line/LineChart.tsx +51 -0
- package/UI/Components/Charts/Types/ReferenceRegionProps.ts +12 -0
- package/UI/Components/Charts/Types/TimeReferenceLineProps.ts +12 -0
- package/UI/Components/Charts/Types/XAxis/XAxisPrecision.ts +1 -0
- package/UI/Components/Charts/Utils/DataPoint.ts +0 -0
- package/UI/Components/Charts/Utils/TimeAnnotation.ts +169 -0
- package/UI/Components/Charts/Utils/XAxis.ts +28 -4
- package/UI/Components/Icon/Icon.tsx +33 -13
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +9 -0
- package/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.ts +67 -0
- package/UI/Components/Page/ModelPage.tsx +6 -1
- package/UI/Components/TelemetryViewer/components/SavedViewsDropdown.tsx +33 -4
- package/UI/Styles/Theme.css +10 -0
- package/UI/Utils/User.ts +41 -2
- package/Utils/Analytics.ts +8 -6
- package/Utils/EnterpriseLicense/EnterpriseLicenseUsage.ts +74 -0
- package/Utils/Metrics/MetricExplorerUrl.ts +771 -0
- package/Utils/Metrics/MetricFormulaEvaluator.ts +410 -46
- package/Utils/Monitor/NetworkTopologyUtil.ts +261 -49
- package/Utils/ValueFormatter.ts +22 -1
- package/build/dist/Models/AnalyticsModels/Index.js +13 -0
- package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByContainer.js +159 -0
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByContainer.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.js +158 -0
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByService.js +160 -0
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByService.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/NetworkFlow.js +351 -0
- package/build/dist/Models/AnalyticsModels/NetworkFlow.js.map +1 -0
- package/build/dist/Models/DatabaseModels/EnterpriseLicenseInstance.js +19 -0
- package/build/dist/Models/DatabaseModels/EnterpriseLicenseInstance.js.map +1 -1
- package/build/dist/Models/DatabaseModels/GlobalConfig.js +38 -0
- package/build/dist/Models/DatabaseModels/GlobalConfig.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MarketingConversion.js +219 -0
- package/build/dist/Models/DatabaseModels/MarketingConversion.js.map +1 -0
- package/build/dist/Models/DatabaseModels/MetricSavedView.js +35 -0
- package/build/dist/Models/DatabaseModels/MetricSavedView.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MetricType.js +76 -0
- package/build/dist/Models/DatabaseModels/MetricType.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +341 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +116 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkInterface.js +60 -0
- package/build/dist/Models/DatabaseModels/NetworkInterface.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +38 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/User.js +38 -0
- package/build/dist/Models/DatabaseModels/User.js.map +1 -1
- package/build/dist/Server/API/BaseAnalyticsAPI.js +19 -0
- package/build/dist/Server/API/BaseAnalyticsAPI.js.map +1 -1
- package/build/dist/Server/API/EnterpriseLicenseAPI.js +8 -0
- package/build/dist/Server/API/EnterpriseLicenseAPI.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +51 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414522-AddCounterSemanticsToMetricType.js +27 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414522-AddCounterSemanticsToMetricType.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414600-AddViewTypeToMetricSavedView.js +21 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414600-AddViewTypeToMetricSavedView.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784211212164-AddNetworkDeviceInventoryAndDiscoverySchedule.js +47 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784211212164-AddNetworkDeviceInventoryAndDiscoverySchedule.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784218257664-AddEnterpriseLicenseNotificationColumns.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784218257664-AddEnterpriseLicenseNotificationColumns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784293516000-AddAttributionColumnsToUserAndProject.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784293516000-AddAttributionColumnsToUserAndProject.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784298000000-AddMarketingConversionTable.js +20 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784298000000-AddMarketingConversionTable.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js +58 -4
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +12 -0
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +10 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/MarketingConversionService.js +9 -0
- package/build/dist/Server/Services/MarketingConversionService.js.map +1 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByContainerService.js +29 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByContainerService.js.map +1 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByK8sClusterService.js +29 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByK8sClusterService.js.map +1 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByServiceService.js +29 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByServiceService.js.map +1 -0
- package/build/dist/Server/Services/MetricService.js +761 -125
- package/build/dist/Server/Services/MetricService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +18 -5
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js +44 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js +88 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js.map +1 -1
- package/build/dist/Server/Services/NetworkFlowService.js +9 -0
- package/build/dist/Server/Services/NetworkFlowService.js.map +1 -0
- package/build/dist/Server/Services/OnCallDutyPolicyService.js +15 -6
- package/build/dist/Server/Services/OnCallDutyPolicyService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +107 -6
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/SpanService.js +8 -6
- package/build/dist/Server/Services/SpanService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +10 -0
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/TeamMemberService.js +11 -0
- package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +52 -0
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js +33 -7
- package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js.map +1 -1
- package/build/dist/Server/Utils/Attribution.js +74 -0
- package/build/dist/Server/Utils/Attribution.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js +40 -0
- package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/ConversionUploadProviders.js +20 -0
- package/build/dist/Server/Utils/Marketing/ConversionUploadProviders.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js +177 -0
- package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js +113 -0
- package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/Providers/Meta.js +109 -0
- package/build/dist/Server/Utils/Marketing/Providers/Meta.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js +130 -0
- package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/Providers/Reddit.js +126 -0
- package/build/dist/Server/Utils/Marketing/Providers/Reddit.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +53 -9
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +21 -10
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +54 -11
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js +43 -3
- package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js +68 -0
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js +15 -0
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +100 -15
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
- package/build/dist/Server/Utils/ProductAnalytics.js +111 -0
- package/build/dist/Server/Utils/ProductAnalytics.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/Telemetry.js +32 -5
- package/build/dist/Server/Utils/Telemetry/Telemetry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +17 -0
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +11 -0
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
- package/build/dist/Types/BaseDatabase/AggregationInterval.js +11 -0
- package/build/dist/Types/BaseDatabase/AggregationInterval.js.map +1 -1
- package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js +33 -5
- package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js.map +1 -1
- package/build/dist/Types/Email/EmailTemplateType.js +2 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/Marketing/MarketingConversion.js +13 -0
- package/build/dist/Types/Marketing/MarketingConversion.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorMetricType.js +7 -0
- package/build/dist/Types/Monitor/MonitorMetricType.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +6 -0
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepSqlMonitor.js +3 -0
- package/build/dist/Types/Monitor/MonitorStepSqlMonitor.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorType.js +2 -1
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/CdpNeighbor.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/CdpNeighbor.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpAuthProtocol.js +41 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpAuthProtocol.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpEntityInfo.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpEntityInfo.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpPrivProtocol.js +48 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpPrivProtocol.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpSecurityLevel.js +38 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpSecurityLevel.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpSystemInfo.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpSystemInfo.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js +96 -3
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js.map +1 -1
- package/build/dist/Types/NetFlow/NetworkFlowRecord.js +2 -0
- package/build/dist/Types/NetFlow/NetworkFlowRecord.js.map +1 -0
- package/build/dist/Types/Syslog/SyslogMessage.js +2 -0
- package/build/dist/Types/Syslog/SyslogMessage.js.map +1 -0
- package/build/dist/Types/Telemetry/TelemetrySavedViewState.js +0 -7
- package/build/dist/Types/Telemetry/TelemetrySavedViewState.js.map +1 -1
- package/build/dist/Types/Telemetry/TelemetrySavedViewType.js +13 -0
- package/build/dist/Types/Telemetry/TelemetrySavedViewType.js.map +1 -0
- package/build/dist/UI/Components/Charts/Area/AreaChart.js +25 -1
- package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Bar/BarChart.js +26 -2
- package/build/dist/UI/Components/Charts/Bar/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +36 -12
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +208 -6
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +52 -3
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +208 -6
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.js +6 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedReferenceRegion.js +2 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedReferenceRegion.js.map +1 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedTimeReferenceLine.js +2 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedTimeReferenceLine.js.map +1 -0
- package/build/dist/UI/Components/Charts/Line/LineChart.js +25 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Types/ReferenceRegionProps.js +2 -0
- package/build/dist/UI/Components/Charts/Types/ReferenceRegionProps.js.map +1 -0
- package/build/dist/UI/Components/Charts/Types/TimeReferenceLineProps.js +2 -0
- package/build/dist/UI/Components/Charts/Types/TimeReferenceLineProps.js.map +1 -0
- package/build/dist/UI/Components/Charts/Types/XAxis/XAxisPrecision.js +1 -0
- package/build/dist/UI/Components/Charts/Types/XAxis/XAxisPrecision.js.map +1 -1
- package/build/dist/UI/Components/Charts/Utils/DataPoint.js +0 -0
- package/build/dist/UI/Components/Charts/Utils/DataPoint.js.map +1 -1
- package/build/dist/UI/Components/Charts/Utils/TimeAnnotation.js +121 -0
- package/build/dist/UI/Components/Charts/Utils/TimeAnnotation.js.map +1 -0
- package/build/dist/UI/Components/Charts/Utils/XAxis.js +27 -4
- package/build/dist/UI/Components/Charts/Utils/XAxis.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +15 -8
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js +58 -0
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js.map +1 -1
- package/build/dist/UI/Components/Page/ModelPage.js +7 -1
- package/build/dist/UI/Components/Page/ModelPage.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js +10 -4
- package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js.map +1 -1
- package/build/dist/UI/Utils/User.js +35 -2
- package/build/dist/UI/Utils/User.js.map +1 -1
- package/build/dist/Utils/Analytics.js +8 -5
- package/build/dist/Utils/Analytics.js.map +1 -1
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseUsage.js +57 -0
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseUsage.js.map +1 -1
- package/build/dist/Utils/Metrics/MetricExplorerUrl.js +418 -0
- package/build/dist/Utils/Metrics/MetricExplorerUrl.js.map +1 -0
- package/build/dist/Utils/Metrics/MetricFormulaEvaluator.js +296 -37
- package/build/dist/Utils/Metrics/MetricFormulaEvaluator.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +176 -40
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
- package/build/dist/Utils/ValueFormatter.js +20 -1
- package/build/dist/Utils/ValueFormatter.js.map +1 -1
- package/package.json +2 -2
|
@@ -3,10 +3,14 @@ import Log from "./Log";
|
|
|
3
3
|
import Metric from "./Metric";
|
|
4
4
|
import MetricItemAggMV1m from "./MetricItemAggMV1m";
|
|
5
5
|
import MetricItemAggMV1mByHostV2 from "./MetricItemAggMV1mByHostV2";
|
|
6
|
+
import MetricItemAggMV1mByService from "./MetricItemAggMV1mByService";
|
|
7
|
+
import MetricItemAggMV1mByK8sCluster from "./MetricItemAggMV1mByK8sCluster";
|
|
8
|
+
import MetricItemAggMV1mByContainer from "./MetricItemAggMV1mByContainer";
|
|
6
9
|
import MetricBaselineHourly from "./MetricBaselineHourly";
|
|
7
10
|
import Span from "./Span";
|
|
8
11
|
import ExceptionInstance from "./ExceptionInstance";
|
|
9
12
|
import MonitorLog from "./MonitorLog";
|
|
13
|
+
import NetworkFlow from "./NetworkFlow";
|
|
10
14
|
import Profile from "./Profile";
|
|
11
15
|
import ProfileSample from "./ProfileSample";
|
|
12
16
|
import AuditLog from "./AuditLog";
|
|
@@ -26,9 +30,18 @@ const AnalyticsModels: Array<{ new (): AnalyticsBaseModel }> = [
|
|
|
26
30
|
* boot-time schema sync doesn't resurrect the dropped V1 table.
|
|
27
31
|
*/
|
|
28
32
|
MetricItemAggMV1mByHostV2,
|
|
33
|
+
/*
|
|
34
|
+
* Entity-keyed siblings of the host rollup (serviceEntityKey /
|
|
35
|
+
* k8sClusterEntityKey / containerEntityKey), serving the other
|
|
36
|
+
* entity-scoped chart paths in MetricService.
|
|
37
|
+
*/
|
|
38
|
+
MetricItemAggMV1mByService,
|
|
39
|
+
MetricItemAggMV1mByK8sCluster,
|
|
40
|
+
MetricItemAggMV1mByContainer,
|
|
29
41
|
MetricBaselineHourly,
|
|
30
42
|
ExceptionInstance,
|
|
31
43
|
MonitorLog,
|
|
44
|
+
NetworkFlow,
|
|
32
45
|
Profile,
|
|
33
46
|
ProfileSample,
|
|
34
47
|
AuditLog,
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import AnalyticsBaseModel from "./AnalyticsBaseModel/AnalyticsBaseModel";
|
|
2
|
+
import AnalyticsTableEngine from "../../Types/AnalyticsDatabase/AnalyticsTableEngine";
|
|
3
|
+
import AnalyticsTableName from "../../Types/AnalyticsDatabase/AnalyticsTableName";
|
|
4
|
+
import AnalyticsTableColumn from "../../Types/AnalyticsDatabase/TableColumn";
|
|
5
|
+
import TableColumnType from "../../Types/AnalyticsDatabase/TableColumnType";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Per-(container, minute) pre-aggregated rollup of `MetricItemV3` value
|
|
9
|
+
* samples — sibling of `MetricItemAggMV1mByHostV2`, keyed by the stable
|
|
10
|
+
* 16-hex `containerEntityKey` the ingest pipeline stamps on every row
|
|
11
|
+
* whose resource carries a container identity. Container identity is
|
|
12
|
+
* `container.id` ONLY (see the container resolver in
|
|
13
|
+
* Common/Server/Utils/Telemetry/TelemetryEntity), so the read side can
|
|
14
|
+
* derive the key directly from the incoming `resource.container.id`
|
|
15
|
+
* filter via `keyForContainer` — no registry lookup needed (containers
|
|
16
|
+
* are a membership-only entity type that never mints registry rows).
|
|
17
|
+
*
|
|
18
|
+
* Populated by `MetricItemAggMV1mByContainer_mv` (declared below;
|
|
19
|
+
* created idempotently by boot schema-sync — the service is registered
|
|
20
|
+
* in AnalyticsServices — and backfilled from `MetricItemV3` by the
|
|
21
|
+
* AddMetricEntityMinuteAggregateMaterializedViews migration). Rows whose
|
|
22
|
+
* resource carries no container entity (`containerEntityKey = ''`) are
|
|
23
|
+
* filtered out so the rollup stays small.
|
|
24
|
+
*
|
|
25
|
+
* Read access goes through
|
|
26
|
+
* `MetricService.tryBuildEntityAggregateMVStatement` for single
|
|
27
|
+
* `resource.container.id` equality filters.
|
|
28
|
+
*
|
|
29
|
+
* No CRUD API; read-only infrastructure populated entirely by the MV.
|
|
30
|
+
*/
|
|
31
|
+
export default class MetricItemAggMV1mByContainer extends AnalyticsBaseModel {
|
|
32
|
+
public constructor() {
|
|
33
|
+
const projectIdColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
34
|
+
key: "projectId",
|
|
35
|
+
title: "Project ID",
|
|
36
|
+
description: "ID of project (tenant key, replicated from MetricItemV3)",
|
|
37
|
+
required: true,
|
|
38
|
+
type: TableColumnType.Text,
|
|
39
|
+
isTenantId: true,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const nameColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
43
|
+
key: "name",
|
|
44
|
+
title: "Metric Name",
|
|
45
|
+
description: "Metric name (replicated from MetricItemV3)",
|
|
46
|
+
required: true,
|
|
47
|
+
type: TableColumnType.Text,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const containerEntityKeyColumn: AnalyticsTableColumn =
|
|
51
|
+
new AnalyticsTableColumn({
|
|
52
|
+
key: "containerEntityKey",
|
|
53
|
+
title: "Container Entity Key",
|
|
54
|
+
description:
|
|
55
|
+
"Stable 16-hex container entity key (keyForContainer — container.id only) replicated from MetricItemV3.containerEntityKey at insert time. Rows without one are filtered out by the MV's WHERE clause so this column is always populated for rows that exist.",
|
|
56
|
+
required: true,
|
|
57
|
+
type: TableColumnType.Text,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const bucketTimeColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
61
|
+
key: "bucketTime",
|
|
62
|
+
title: "Bucket Time",
|
|
63
|
+
description:
|
|
64
|
+
"Start of the 1-minute bucket this row aggregates. Computed by the MV as toStartOfMinute(time).",
|
|
65
|
+
required: true,
|
|
66
|
+
type: TableColumnType.Date,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const valueSumStateColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
70
|
+
key: "valueSumState",
|
|
71
|
+
title: "Sum (state)",
|
|
72
|
+
description:
|
|
73
|
+
"AggregateFunction(sum, Float64) state for valueSum. Read via sumMerge(valueSumState).",
|
|
74
|
+
required: true,
|
|
75
|
+
type: TableColumnType.AggregateFunction,
|
|
76
|
+
aggregateFunctionDefinition: "sum, Float64",
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const valueCountStateColumn: AnalyticsTableColumn =
|
|
80
|
+
new AnalyticsTableColumn({
|
|
81
|
+
key: "valueCountState",
|
|
82
|
+
title: "Count (state)",
|
|
83
|
+
description:
|
|
84
|
+
"AggregateFunction(count, Float64) state for valueCount. Read via countMerge(valueCountState).",
|
|
85
|
+
required: true,
|
|
86
|
+
type: TableColumnType.AggregateFunction,
|
|
87
|
+
aggregateFunctionDefinition: "count, Float64",
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const valueMinStateColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
91
|
+
key: "valueMinState",
|
|
92
|
+
title: "Min (state)",
|
|
93
|
+
description:
|
|
94
|
+
"AggregateFunction(min, Float64) state. Read via minMerge(valueMinState).",
|
|
95
|
+
required: true,
|
|
96
|
+
type: TableColumnType.AggregateFunction,
|
|
97
|
+
aggregateFunctionDefinition: "min, Float64",
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const valueMaxStateColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
101
|
+
key: "valueMaxState",
|
|
102
|
+
title: "Max (state)",
|
|
103
|
+
description:
|
|
104
|
+
"AggregateFunction(max, Float64) state. Read via maxMerge(valueMaxState).",
|
|
105
|
+
required: true,
|
|
106
|
+
type: TableColumnType.AggregateFunction,
|
|
107
|
+
aggregateFunctionDefinition: "max, Float64",
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
const retentionDateColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
111
|
+
key: "retentionDate",
|
|
112
|
+
title: "Retention Date",
|
|
113
|
+
description:
|
|
114
|
+
"Date after which this row is eligible for TTL deletion. Computed by the MV as max(retentionDate) per bucket — inherits from the source MetricItemV3 rows.",
|
|
115
|
+
required: true,
|
|
116
|
+
type: TableColumnType.Date,
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
super({
|
|
120
|
+
tableName: AnalyticsTableName.MetricItemAggMV1mByContainer,
|
|
121
|
+
tableEngine: AnalyticsTableEngine.AggregatingMergeTree,
|
|
122
|
+
singularName: "Metric 1-Minute Aggregate (By Container Entity Key)",
|
|
123
|
+
pluralName: "Metric 1-Minute Aggregates (By Container Entity Key)",
|
|
124
|
+
tableColumns: [
|
|
125
|
+
projectIdColumn,
|
|
126
|
+
nameColumn,
|
|
127
|
+
containerEntityKeyColumn,
|
|
128
|
+
bucketTimeColumn,
|
|
129
|
+
valueSumStateColumn,
|
|
130
|
+
valueCountStateColumn,
|
|
131
|
+
valueMinStateColumn,
|
|
132
|
+
valueMaxStateColumn,
|
|
133
|
+
retentionDateColumn,
|
|
134
|
+
],
|
|
135
|
+
projections: [],
|
|
136
|
+
/*
|
|
137
|
+
* Per-container materialized view, reading the ingest-stamped
|
|
138
|
+
* `containerEntityKey` scalar column (contract C3) rather than the
|
|
139
|
+
* raw attributes map. Canonical definition; created idempotently by
|
|
140
|
+
* the analytics schema-sync on boot
|
|
141
|
+
* (MetricItemAggMV1mByContainerService is registered in
|
|
142
|
+
* AnalyticsServices, so a wiped ClickHouse volume self-heals) and
|
|
143
|
+
* backfilled by the AddMetricEntityMinuteAggregateMaterializedViews
|
|
144
|
+
* migration. Rows without a container entity are filtered out so
|
|
145
|
+
* the per-container MV stays small.
|
|
146
|
+
*/
|
|
147
|
+
materializedViews: [
|
|
148
|
+
{
|
|
149
|
+
name: "MetricItemAggMV1mByContainer_mv",
|
|
150
|
+
query: `CREATE MATERIALIZED VIEW IF NOT EXISTS MetricItemAggMV1mByContainer_mv
|
|
151
|
+
TO MetricItemAggMV1mByContainer
|
|
152
|
+
AS
|
|
153
|
+
SELECT
|
|
154
|
+
projectId,
|
|
155
|
+
name,
|
|
156
|
+
containerEntityKey,
|
|
157
|
+
toStartOfMinute(time) AS bucketTime,
|
|
158
|
+
sumState(toFloat64(coalesce(value, sum, 0))) AS valueSumState,
|
|
159
|
+
countState(toFloat64(coalesce(value, sum, 0))) AS valueCountState,
|
|
160
|
+
minState(toFloat64(coalesce(value, sum, 0))) AS valueMinState,
|
|
161
|
+
maxState(toFloat64(coalesce(value, sum, 0))) AS valueMaxState,
|
|
162
|
+
max(retentionDate) AS retentionDate
|
|
163
|
+
FROM MetricItemV3
|
|
164
|
+
WHERE containerEntityKey != ''
|
|
165
|
+
GROUP BY projectId, name, containerEntityKey, bucketTime`,
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
sortKeys: ["projectId", "name", "containerEntityKey", "bucketTime"],
|
|
169
|
+
primaryKeys: ["projectId", "name", "containerEntityKey", "bucketTime"],
|
|
170
|
+
partitionKey: "toYYYYMM(bucketTime)",
|
|
171
|
+
// Align with this MV's GROUP BY (projectId, name, containerEntityKey).
|
|
172
|
+
shardingKey: "cityHash64(projectId, name, containerEntityKey)",
|
|
173
|
+
tableSettings:
|
|
174
|
+
"ttl_only_drop_parts = 1, non_replicated_deduplication_window = 10000",
|
|
175
|
+
ttlExpression: "retentionDate DELETE",
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import AnalyticsBaseModel from "./AnalyticsBaseModel/AnalyticsBaseModel";
|
|
2
|
+
import AnalyticsTableEngine from "../../Types/AnalyticsDatabase/AnalyticsTableEngine";
|
|
3
|
+
import AnalyticsTableName from "../../Types/AnalyticsDatabase/AnalyticsTableName";
|
|
4
|
+
import AnalyticsTableColumn from "../../Types/AnalyticsDatabase/TableColumn";
|
|
5
|
+
import TableColumnType from "../../Types/AnalyticsDatabase/TableColumnType";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Per-(k8s cluster, minute) pre-aggregated rollup of `MetricItemV3` value
|
|
9
|
+
* samples — sibling of `MetricItemAggMV1mByHostV2`, keyed by the stable
|
|
10
|
+
* 16-hex `k8sClusterEntityKey` the ingest pipeline stamps on every row
|
|
11
|
+
* whose resource carries a Kubernetes cluster identity. Cluster identity
|
|
12
|
+
* is `k8s.cluster.name` ONLY (see `TelemetryEntity.k8sClusterIdentity`),
|
|
13
|
+
* so the read side can derive the key directly from the incoming
|
|
14
|
+
* `resource.k8s.cluster.name` filter via
|
|
15
|
+
* `EntityKey.keyForKubernetesCluster` — no registry lookup needed.
|
|
16
|
+
*
|
|
17
|
+
* Populated by `MetricItemAggMV1mByK8sCluster_mv` (declared below;
|
|
18
|
+
* created idempotently by boot schema-sync — the service is registered
|
|
19
|
+
* in AnalyticsServices — and backfilled from `MetricItemV3` by the
|
|
20
|
+
* AddMetricEntityMinuteAggregateMaterializedViews migration). Rows whose
|
|
21
|
+
* resource carries no cluster entity (`k8sClusterEntityKey = ''`) are
|
|
22
|
+
* filtered out so the rollup stays small.
|
|
23
|
+
*
|
|
24
|
+
* Read access goes through
|
|
25
|
+
* `MetricService.tryBuildEntityAggregateMVStatement` — the dominant path
|
|
26
|
+
* for the Kubernetes cluster detail page's Metrics tab.
|
|
27
|
+
*
|
|
28
|
+
* No CRUD API; read-only infrastructure populated entirely by the MV.
|
|
29
|
+
*/
|
|
30
|
+
export default class MetricItemAggMV1mByK8sCluster extends AnalyticsBaseModel {
|
|
31
|
+
public constructor() {
|
|
32
|
+
const projectIdColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
33
|
+
key: "projectId",
|
|
34
|
+
title: "Project ID",
|
|
35
|
+
description: "ID of project (tenant key, replicated from MetricItemV3)",
|
|
36
|
+
required: true,
|
|
37
|
+
type: TableColumnType.Text,
|
|
38
|
+
isTenantId: true,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const nameColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
42
|
+
key: "name",
|
|
43
|
+
title: "Metric Name",
|
|
44
|
+
description: "Metric name (replicated from MetricItemV3)",
|
|
45
|
+
required: true,
|
|
46
|
+
type: TableColumnType.Text,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const k8sClusterEntityKeyColumn: AnalyticsTableColumn =
|
|
50
|
+
new AnalyticsTableColumn({
|
|
51
|
+
key: "k8sClusterEntityKey",
|
|
52
|
+
title: "Kubernetes Cluster Entity Key",
|
|
53
|
+
description:
|
|
54
|
+
"Stable 16-hex k8s cluster entity key (EntityKey.keyForKubernetesCluster) replicated from MetricItemV3.k8sClusterEntityKey at insert time. Rows without one are filtered out by the MV's WHERE clause so this column is always populated for rows that exist.",
|
|
55
|
+
required: true,
|
|
56
|
+
type: TableColumnType.Text,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const bucketTimeColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
60
|
+
key: "bucketTime",
|
|
61
|
+
title: "Bucket Time",
|
|
62
|
+
description:
|
|
63
|
+
"Start of the 1-minute bucket this row aggregates. Computed by the MV as toStartOfMinute(time).",
|
|
64
|
+
required: true,
|
|
65
|
+
type: TableColumnType.Date,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const valueSumStateColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
69
|
+
key: "valueSumState",
|
|
70
|
+
title: "Sum (state)",
|
|
71
|
+
description:
|
|
72
|
+
"AggregateFunction(sum, Float64) state for valueSum. Read via sumMerge(valueSumState).",
|
|
73
|
+
required: true,
|
|
74
|
+
type: TableColumnType.AggregateFunction,
|
|
75
|
+
aggregateFunctionDefinition: "sum, Float64",
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const valueCountStateColumn: AnalyticsTableColumn =
|
|
79
|
+
new AnalyticsTableColumn({
|
|
80
|
+
key: "valueCountState",
|
|
81
|
+
title: "Count (state)",
|
|
82
|
+
description:
|
|
83
|
+
"AggregateFunction(count, Float64) state for valueCount. Read via countMerge(valueCountState).",
|
|
84
|
+
required: true,
|
|
85
|
+
type: TableColumnType.AggregateFunction,
|
|
86
|
+
aggregateFunctionDefinition: "count, Float64",
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const valueMinStateColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
90
|
+
key: "valueMinState",
|
|
91
|
+
title: "Min (state)",
|
|
92
|
+
description:
|
|
93
|
+
"AggregateFunction(min, Float64) state. Read via minMerge(valueMinState).",
|
|
94
|
+
required: true,
|
|
95
|
+
type: TableColumnType.AggregateFunction,
|
|
96
|
+
aggregateFunctionDefinition: "min, Float64",
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const valueMaxStateColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
100
|
+
key: "valueMaxState",
|
|
101
|
+
title: "Max (state)",
|
|
102
|
+
description:
|
|
103
|
+
"AggregateFunction(max, Float64) state. Read via maxMerge(valueMaxState).",
|
|
104
|
+
required: true,
|
|
105
|
+
type: TableColumnType.AggregateFunction,
|
|
106
|
+
aggregateFunctionDefinition: "max, Float64",
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const retentionDateColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
110
|
+
key: "retentionDate",
|
|
111
|
+
title: "Retention Date",
|
|
112
|
+
description:
|
|
113
|
+
"Date after which this row is eligible for TTL deletion. Computed by the MV as max(retentionDate) per bucket — inherits from the source MetricItemV3 rows.",
|
|
114
|
+
required: true,
|
|
115
|
+
type: TableColumnType.Date,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
super({
|
|
119
|
+
tableName: AnalyticsTableName.MetricItemAggMV1mByK8sCluster,
|
|
120
|
+
tableEngine: AnalyticsTableEngine.AggregatingMergeTree,
|
|
121
|
+
singularName:
|
|
122
|
+
"Metric 1-Minute Aggregate (By Kubernetes Cluster Entity Key)",
|
|
123
|
+
pluralName:
|
|
124
|
+
"Metric 1-Minute Aggregates (By Kubernetes Cluster Entity Key)",
|
|
125
|
+
tableColumns: [
|
|
126
|
+
projectIdColumn,
|
|
127
|
+
nameColumn,
|
|
128
|
+
k8sClusterEntityKeyColumn,
|
|
129
|
+
bucketTimeColumn,
|
|
130
|
+
valueSumStateColumn,
|
|
131
|
+
valueCountStateColumn,
|
|
132
|
+
valueMinStateColumn,
|
|
133
|
+
valueMaxStateColumn,
|
|
134
|
+
retentionDateColumn,
|
|
135
|
+
],
|
|
136
|
+
projections: [],
|
|
137
|
+
/*
|
|
138
|
+
* Per-cluster materialized view, reading the ingest-stamped
|
|
139
|
+
* `k8sClusterEntityKey` scalar column (contract C3) rather than the
|
|
140
|
+
* raw attributes map. Canonical definition; created idempotently by
|
|
141
|
+
* the analytics schema-sync on boot
|
|
142
|
+
* (MetricItemAggMV1mByK8sClusterService is registered in
|
|
143
|
+
* AnalyticsServices, so a wiped ClickHouse volume self-heals) and
|
|
144
|
+
* backfilled by the AddMetricEntityMinuteAggregateMaterializedViews
|
|
145
|
+
* migration. Rows without a cluster entity are filtered out so the
|
|
146
|
+
* per-cluster MV stays small.
|
|
147
|
+
*/
|
|
148
|
+
materializedViews: [
|
|
149
|
+
{
|
|
150
|
+
name: "MetricItemAggMV1mByK8sCluster_mv",
|
|
151
|
+
query: `CREATE MATERIALIZED VIEW IF NOT EXISTS MetricItemAggMV1mByK8sCluster_mv
|
|
152
|
+
TO MetricItemAggMV1mByK8sCluster
|
|
153
|
+
AS
|
|
154
|
+
SELECT
|
|
155
|
+
projectId,
|
|
156
|
+
name,
|
|
157
|
+
k8sClusterEntityKey,
|
|
158
|
+
toStartOfMinute(time) AS bucketTime,
|
|
159
|
+
sumState(toFloat64(coalesce(value, sum, 0))) AS valueSumState,
|
|
160
|
+
countState(toFloat64(coalesce(value, sum, 0))) AS valueCountState,
|
|
161
|
+
minState(toFloat64(coalesce(value, sum, 0))) AS valueMinState,
|
|
162
|
+
maxState(toFloat64(coalesce(value, sum, 0))) AS valueMaxState,
|
|
163
|
+
max(retentionDate) AS retentionDate
|
|
164
|
+
FROM MetricItemV3
|
|
165
|
+
WHERE k8sClusterEntityKey != ''
|
|
166
|
+
GROUP BY projectId, name, k8sClusterEntityKey, bucketTime`,
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
sortKeys: ["projectId", "name", "k8sClusterEntityKey", "bucketTime"],
|
|
170
|
+
primaryKeys: ["projectId", "name", "k8sClusterEntityKey", "bucketTime"],
|
|
171
|
+
partitionKey: "toYYYYMM(bucketTime)",
|
|
172
|
+
// Align with this MV's GROUP BY (projectId, name, k8sClusterEntityKey).
|
|
173
|
+
shardingKey: "cityHash64(projectId, name, k8sClusterEntityKey)",
|
|
174
|
+
tableSettings:
|
|
175
|
+
"ttl_only_drop_parts = 1, non_replicated_deduplication_window = 10000",
|
|
176
|
+
ttlExpression: "retentionDate DELETE",
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import AnalyticsBaseModel from "./AnalyticsBaseModel/AnalyticsBaseModel";
|
|
2
|
+
import AnalyticsTableEngine from "../../Types/AnalyticsDatabase/AnalyticsTableEngine";
|
|
3
|
+
import AnalyticsTableName from "../../Types/AnalyticsDatabase/AnalyticsTableName";
|
|
4
|
+
import AnalyticsTableColumn from "../../Types/AnalyticsDatabase/TableColumn";
|
|
5
|
+
import TableColumnType from "../../Types/AnalyticsDatabase/TableColumnType";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Per-(service, minute) pre-aggregated rollup of `MetricItemV3` value
|
|
9
|
+
* samples — sibling of `MetricItemAggMV1mByHostV2`, keyed by the stable
|
|
10
|
+
* 16-hex `serviceEntityKey` the ingest pipeline stamps on every row whose
|
|
11
|
+
* resource carries a service identity (service.name, plus
|
|
12
|
+
* service.namespace when present — see the service resolver in
|
|
13
|
+
* Common/Server/Utils/Telemetry/TelemetryEntity).
|
|
14
|
+
*
|
|
15
|
+
* Because the namespace is folded into the key at ingest, ONE
|
|
16
|
+
* `service.name` can map to SEVERAL serviceEntityKeys (one per
|
|
17
|
+
* namespace variant). The read side therefore never derives a single
|
|
18
|
+
* key from the name: `MetricService.tryBuildEntityAggregateMVStatement`
|
|
19
|
+
* resolves the full key set from the Postgres TelemetryEntity registry
|
|
20
|
+
* and compiles `serviceEntityKey IN (<keys>)`, falling back to the raw
|
|
21
|
+
* table when the registry has no rows for the name.
|
|
22
|
+
*
|
|
23
|
+
* Populated by `MetricItemAggMV1mByService_mv` (declared below; created
|
|
24
|
+
* idempotently by boot schema-sync — the service is registered in
|
|
25
|
+
* AnalyticsServices — and backfilled from `MetricItemV3` by the
|
|
26
|
+
* AddMetricEntityMinuteAggregateMaterializedViews migration). Rows whose
|
|
27
|
+
* resource carries no service entity (`serviceEntityKey = ''`) are
|
|
28
|
+
* filtered out.
|
|
29
|
+
*
|
|
30
|
+
* No CRUD API; read-only infrastructure populated entirely by the MV.
|
|
31
|
+
*/
|
|
32
|
+
export default class MetricItemAggMV1mByService extends AnalyticsBaseModel {
|
|
33
|
+
public constructor() {
|
|
34
|
+
const projectIdColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
35
|
+
key: "projectId",
|
|
36
|
+
title: "Project ID",
|
|
37
|
+
description: "ID of project (tenant key, replicated from MetricItemV3)",
|
|
38
|
+
required: true,
|
|
39
|
+
type: TableColumnType.Text,
|
|
40
|
+
isTenantId: true,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const nameColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
44
|
+
key: "name",
|
|
45
|
+
title: "Metric Name",
|
|
46
|
+
description: "Metric name (replicated from MetricItemV3)",
|
|
47
|
+
required: true,
|
|
48
|
+
type: TableColumnType.Text,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const serviceEntityKeyColumn: AnalyticsTableColumn =
|
|
52
|
+
new AnalyticsTableColumn({
|
|
53
|
+
key: "serviceEntityKey",
|
|
54
|
+
title: "Service Entity Key",
|
|
55
|
+
description:
|
|
56
|
+
"Stable 16-hex service entity key (EntityKey.keyForService — service.name + optional service.namespace) replicated from MetricItemV3.serviceEntityKey at insert time. Rows without one are filtered out by the MV's WHERE clause so this column is always populated for rows that exist.",
|
|
57
|
+
required: true,
|
|
58
|
+
type: TableColumnType.Text,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const bucketTimeColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
62
|
+
key: "bucketTime",
|
|
63
|
+
title: "Bucket Time",
|
|
64
|
+
description:
|
|
65
|
+
"Start of the 1-minute bucket this row aggregates. Computed by the MV as toStartOfMinute(time).",
|
|
66
|
+
required: true,
|
|
67
|
+
type: TableColumnType.Date,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const valueSumStateColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
71
|
+
key: "valueSumState",
|
|
72
|
+
title: "Sum (state)",
|
|
73
|
+
description:
|
|
74
|
+
"AggregateFunction(sum, Float64) state for valueSum. Read via sumMerge(valueSumState).",
|
|
75
|
+
required: true,
|
|
76
|
+
type: TableColumnType.AggregateFunction,
|
|
77
|
+
aggregateFunctionDefinition: "sum, Float64",
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const valueCountStateColumn: AnalyticsTableColumn =
|
|
81
|
+
new AnalyticsTableColumn({
|
|
82
|
+
key: "valueCountState",
|
|
83
|
+
title: "Count (state)",
|
|
84
|
+
description:
|
|
85
|
+
"AggregateFunction(count, Float64) state for valueCount. Read via countMerge(valueCountState).",
|
|
86
|
+
required: true,
|
|
87
|
+
type: TableColumnType.AggregateFunction,
|
|
88
|
+
aggregateFunctionDefinition: "count, Float64",
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const valueMinStateColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
92
|
+
key: "valueMinState",
|
|
93
|
+
title: "Min (state)",
|
|
94
|
+
description:
|
|
95
|
+
"AggregateFunction(min, Float64) state. Read via minMerge(valueMinState).",
|
|
96
|
+
required: true,
|
|
97
|
+
type: TableColumnType.AggregateFunction,
|
|
98
|
+
aggregateFunctionDefinition: "min, Float64",
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const valueMaxStateColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
102
|
+
key: "valueMaxState",
|
|
103
|
+
title: "Max (state)",
|
|
104
|
+
description:
|
|
105
|
+
"AggregateFunction(max, Float64) state. Read via maxMerge(valueMaxState).",
|
|
106
|
+
required: true,
|
|
107
|
+
type: TableColumnType.AggregateFunction,
|
|
108
|
+
aggregateFunctionDefinition: "max, Float64",
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
const retentionDateColumn: AnalyticsTableColumn = new AnalyticsTableColumn({
|
|
112
|
+
key: "retentionDate",
|
|
113
|
+
title: "Retention Date",
|
|
114
|
+
description:
|
|
115
|
+
"Date after which this row is eligible for TTL deletion. Computed by the MV as max(retentionDate) per bucket — inherits from the source MetricItemV3 rows.",
|
|
116
|
+
required: true,
|
|
117
|
+
type: TableColumnType.Date,
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
super({
|
|
121
|
+
tableName: AnalyticsTableName.MetricItemAggMV1mByService,
|
|
122
|
+
tableEngine: AnalyticsTableEngine.AggregatingMergeTree,
|
|
123
|
+
singularName: "Metric 1-Minute Aggregate (By Service Entity Key)",
|
|
124
|
+
pluralName: "Metric 1-Minute Aggregates (By Service Entity Key)",
|
|
125
|
+
tableColumns: [
|
|
126
|
+
projectIdColumn,
|
|
127
|
+
nameColumn,
|
|
128
|
+
serviceEntityKeyColumn,
|
|
129
|
+
bucketTimeColumn,
|
|
130
|
+
valueSumStateColumn,
|
|
131
|
+
valueCountStateColumn,
|
|
132
|
+
valueMinStateColumn,
|
|
133
|
+
valueMaxStateColumn,
|
|
134
|
+
retentionDateColumn,
|
|
135
|
+
],
|
|
136
|
+
projections: [],
|
|
137
|
+
/*
|
|
138
|
+
* Per-service materialized view, reading the ingest-stamped
|
|
139
|
+
* `serviceEntityKey` scalar column (contract C3) rather than the
|
|
140
|
+
* raw attributes map. Canonical definition; created idempotently by
|
|
141
|
+
* the analytics schema-sync on boot (MetricItemAggMV1mByServiceService
|
|
142
|
+
* is registered in AnalyticsServices, so a wiped ClickHouse volume
|
|
143
|
+
* self-heals) and backfilled by the
|
|
144
|
+
* AddMetricEntityMinuteAggregateMaterializedViews migration. Rows
|
|
145
|
+
* without a service entity are filtered out so the per-service MV
|
|
146
|
+
* stays smaller than the raw table.
|
|
147
|
+
*/
|
|
148
|
+
materializedViews: [
|
|
149
|
+
{
|
|
150
|
+
name: "MetricItemAggMV1mByService_mv",
|
|
151
|
+
query: `CREATE MATERIALIZED VIEW IF NOT EXISTS MetricItemAggMV1mByService_mv
|
|
152
|
+
TO MetricItemAggMV1mByService
|
|
153
|
+
AS
|
|
154
|
+
SELECT
|
|
155
|
+
projectId,
|
|
156
|
+
name,
|
|
157
|
+
serviceEntityKey,
|
|
158
|
+
toStartOfMinute(time) AS bucketTime,
|
|
159
|
+
sumState(toFloat64(coalesce(value, sum, 0))) AS valueSumState,
|
|
160
|
+
countState(toFloat64(coalesce(value, sum, 0))) AS valueCountState,
|
|
161
|
+
minState(toFloat64(coalesce(value, sum, 0))) AS valueMinState,
|
|
162
|
+
maxState(toFloat64(coalesce(value, sum, 0))) AS valueMaxState,
|
|
163
|
+
max(retentionDate) AS retentionDate
|
|
164
|
+
FROM MetricItemV3
|
|
165
|
+
WHERE serviceEntityKey != ''
|
|
166
|
+
GROUP BY projectId, name, serviceEntityKey, bucketTime`,
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
sortKeys: ["projectId", "name", "serviceEntityKey", "bucketTime"],
|
|
170
|
+
primaryKeys: ["projectId", "name", "serviceEntityKey", "bucketTime"],
|
|
171
|
+
partitionKey: "toYYYYMM(bucketTime)",
|
|
172
|
+
// Align with this MV's GROUP BY (projectId, name, serviceEntityKey).
|
|
173
|
+
shardingKey: "cityHash64(projectId, name, serviceEntityKey)",
|
|
174
|
+
tableSettings:
|
|
175
|
+
"ttl_only_drop_parts = 1, non_replicated_deduplication_window = 10000",
|
|
176
|
+
ttlExpression: "retentionDate DELETE",
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|