@oneuptime/common 11.5.9 → 11.5.11
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/1784401962564-MigrationName.ts +101 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +14 -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/1784401962564-MigrationName.js +40 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784401962564-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +14 -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 +4 -3
|
@@ -26,6 +26,20 @@ const buildQueryConfig: BuildQueryConfigFunction = (
|
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
type BuildGroupedQueryConfigFunction = (
|
|
30
|
+
variable: string,
|
|
31
|
+
groupByAttributeKeys: Array<string>,
|
|
32
|
+
) => MetricQueryConfigData;
|
|
33
|
+
|
|
34
|
+
const buildGroupedQueryConfig: BuildGroupedQueryConfigFunction = (
|
|
35
|
+
variable: string,
|
|
36
|
+
groupByAttributeKeys: Array<string>,
|
|
37
|
+
): MetricQueryConfigData => {
|
|
38
|
+
const config: MetricQueryConfigData = buildQueryConfig(variable);
|
|
39
|
+
config.metricQueryData.groupByAttributeKeys = groupByAttributeKeys;
|
|
40
|
+
return config;
|
|
41
|
+
};
|
|
42
|
+
|
|
29
43
|
type BuildResultFunction = (
|
|
30
44
|
points: Array<{ timestamp: string; value: number }>,
|
|
31
45
|
) => AggregatedResult;
|
|
@@ -43,6 +57,38 @@ const buildResult: BuildResultFunction = (
|
|
|
43
57
|
};
|
|
44
58
|
};
|
|
45
59
|
|
|
60
|
+
type BuildGroupedResultFunction = (
|
|
61
|
+
points: Array<{
|
|
62
|
+
timestamp: string;
|
|
63
|
+
value: number;
|
|
64
|
+
attributes: Record<string, string>;
|
|
65
|
+
}>,
|
|
66
|
+
) => AggregatedResult;
|
|
67
|
+
|
|
68
|
+
const buildGroupedResult: BuildGroupedResultFunction = (
|
|
69
|
+
points: Array<{
|
|
70
|
+
timestamp: string;
|
|
71
|
+
value: number;
|
|
72
|
+
attributes: Record<string, string>;
|
|
73
|
+
}>,
|
|
74
|
+
): AggregatedResult => {
|
|
75
|
+
return {
|
|
76
|
+
data: points.map(
|
|
77
|
+
(point: {
|
|
78
|
+
timestamp: string;
|
|
79
|
+
value: number;
|
|
80
|
+
attributes: Record<string, string>;
|
|
81
|
+
}) => {
|
|
82
|
+
return {
|
|
83
|
+
timestamp: new Date(point.timestamp),
|
|
84
|
+
value: point.value,
|
|
85
|
+
attributes: point.attributes,
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
),
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
|
|
46
92
|
describe("MetricFormulaEvaluator", () => {
|
|
47
93
|
describe("evaluateFormula", () => {
|
|
48
94
|
test("adds two series point-by-point", () => {
|
|
@@ -230,6 +276,402 @@ describe("MetricFormulaEvaluator", () => {
|
|
|
230
276
|
});
|
|
231
277
|
}).toThrow(/unknown variable/i);
|
|
232
278
|
});
|
|
279
|
+
|
|
280
|
+
test("throws a structural error for malformed formulas like a**b", () => {
|
|
281
|
+
expect(() => {
|
|
282
|
+
MetricFormulaEvaluator.evaluateFormula({
|
|
283
|
+
formula: "a ** b",
|
|
284
|
+
queryConfigs: [buildQueryConfig("a"), buildQueryConfig("b")],
|
|
285
|
+
formulaConfigs: [],
|
|
286
|
+
results: [
|
|
287
|
+
buildResult([{ timestamp: "2024-01-01T00:00:00.000Z", value: 2 }]),
|
|
288
|
+
buildResult([{ timestamp: "2024-01-01T00:00:00.000Z", value: 3 }]),
|
|
289
|
+
],
|
|
290
|
+
});
|
|
291
|
+
}).toThrow(/missing an operand/i);
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
describe("group-aware evaluation", () => {
|
|
296
|
+
const timestamps: Array<string> = [
|
|
297
|
+
"2024-01-01T00:00:00.000Z",
|
|
298
|
+
"2024-01-01T00:01:00.000Z",
|
|
299
|
+
];
|
|
300
|
+
|
|
301
|
+
test("evaluates grouped formulas once per group and stamps group attributes", () => {
|
|
302
|
+
const queryConfigs: Array<MetricQueryConfigData> = [
|
|
303
|
+
buildGroupedQueryConfig("a", ["host.name"]),
|
|
304
|
+
buildGroupedQueryConfig("b", ["host.name"]),
|
|
305
|
+
];
|
|
306
|
+
|
|
307
|
+
const results: Array<AggregatedResult> = [
|
|
308
|
+
buildGroupedResult([
|
|
309
|
+
{
|
|
310
|
+
timestamp: timestamps[0]!,
|
|
311
|
+
value: 10,
|
|
312
|
+
attributes: { "host.name": "web-1" },
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
timestamp: timestamps[0]!,
|
|
316
|
+
value: 40,
|
|
317
|
+
attributes: { "host.name": "web-2" },
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
timestamp: timestamps[1]!,
|
|
321
|
+
value: 20,
|
|
322
|
+
attributes: { "host.name": "web-1" },
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
timestamp: timestamps[1]!,
|
|
326
|
+
value: 80,
|
|
327
|
+
attributes: { "host.name": "web-2" },
|
|
328
|
+
},
|
|
329
|
+
]),
|
|
330
|
+
buildGroupedResult([
|
|
331
|
+
{
|
|
332
|
+
timestamp: timestamps[0]!,
|
|
333
|
+
value: 2,
|
|
334
|
+
attributes: { "host.name": "web-1" },
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
timestamp: timestamps[0]!,
|
|
338
|
+
value: 4,
|
|
339
|
+
attributes: { "host.name": "web-2" },
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
timestamp: timestamps[1]!,
|
|
343
|
+
value: 2,
|
|
344
|
+
attributes: { "host.name": "web-1" },
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
timestamp: timestamps[1]!,
|
|
348
|
+
value: 4,
|
|
349
|
+
attributes: { "host.name": "web-2" },
|
|
350
|
+
},
|
|
351
|
+
]),
|
|
352
|
+
];
|
|
353
|
+
|
|
354
|
+
const output: AggregatedResult = MetricFormulaEvaluator.evaluateFormula({
|
|
355
|
+
formula: "a / b",
|
|
356
|
+
queryConfigs,
|
|
357
|
+
formulaConfigs: [],
|
|
358
|
+
results,
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
// Groups are ordered by canonical label key: web-1 first, then web-2.
|
|
362
|
+
expect(output.data).toEqual([
|
|
363
|
+
{
|
|
364
|
+
timestamp: new Date(timestamps[0]!),
|
|
365
|
+
value: 5,
|
|
366
|
+
attributes: { "host.name": "web-1" },
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
timestamp: new Date(timestamps[1]!),
|
|
370
|
+
value: 10,
|
|
371
|
+
attributes: { "host.name": "web-1" },
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
timestamp: new Date(timestamps[0]!),
|
|
375
|
+
value: 10,
|
|
376
|
+
attributes: { "host.name": "web-2" },
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
timestamp: new Date(timestamps[1]!),
|
|
380
|
+
value: 20,
|
|
381
|
+
attributes: { "host.name": "web-2" },
|
|
382
|
+
},
|
|
383
|
+
]);
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
test("broadcasts an ungrouped variable across groups", () => {
|
|
387
|
+
const queryConfigs: Array<MetricQueryConfigData> = [
|
|
388
|
+
buildGroupedQueryConfig("a", ["host.name"]),
|
|
389
|
+
buildQueryConfig("b"),
|
|
390
|
+
];
|
|
391
|
+
|
|
392
|
+
const results: Array<AggregatedResult> = [
|
|
393
|
+
buildGroupedResult([
|
|
394
|
+
{
|
|
395
|
+
timestamp: timestamps[0]!,
|
|
396
|
+
value: 10,
|
|
397
|
+
attributes: { "host.name": "web-1" },
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
timestamp: timestamps[0]!,
|
|
401
|
+
value: 30,
|
|
402
|
+
attributes: { "host.name": "web-2" },
|
|
403
|
+
},
|
|
404
|
+
]),
|
|
405
|
+
buildResult([{ timestamp: timestamps[0]!, value: 2 }]),
|
|
406
|
+
];
|
|
407
|
+
|
|
408
|
+
const output: AggregatedResult = MetricFormulaEvaluator.evaluateFormula({
|
|
409
|
+
formula: "a / b",
|
|
410
|
+
queryConfigs,
|
|
411
|
+
formulaConfigs: [],
|
|
412
|
+
results,
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
expect(output.data).toEqual([
|
|
416
|
+
{
|
|
417
|
+
timestamp: new Date(timestamps[0]!),
|
|
418
|
+
value: 5,
|
|
419
|
+
attributes: { "host.name": "web-1" },
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
timestamp: new Date(timestamps[0]!),
|
|
423
|
+
value: 15,
|
|
424
|
+
attributes: { "host.name": "web-2" },
|
|
425
|
+
},
|
|
426
|
+
]);
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
test("throws a structural error when grouped variables share no groups", () => {
|
|
430
|
+
const queryConfigs: Array<MetricQueryConfigData> = [
|
|
431
|
+
buildGroupedQueryConfig("a", ["host.name"]),
|
|
432
|
+
buildGroupedQueryConfig("b", ["region"]),
|
|
433
|
+
];
|
|
434
|
+
|
|
435
|
+
const results: Array<AggregatedResult> = [
|
|
436
|
+
buildGroupedResult([
|
|
437
|
+
{
|
|
438
|
+
timestamp: timestamps[0]!,
|
|
439
|
+
value: 1,
|
|
440
|
+
attributes: { "host.name": "web-1" },
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
timestamp: timestamps[0]!,
|
|
444
|
+
value: 2,
|
|
445
|
+
attributes: { "host.name": "web-2" },
|
|
446
|
+
},
|
|
447
|
+
]),
|
|
448
|
+
buildGroupedResult([
|
|
449
|
+
{
|
|
450
|
+
timestamp: timestamps[0]!,
|
|
451
|
+
value: 3,
|
|
452
|
+
attributes: { region: "us-east" },
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
timestamp: timestamps[0]!,
|
|
456
|
+
value: 4,
|
|
457
|
+
attributes: { region: "eu-west" },
|
|
458
|
+
},
|
|
459
|
+
]),
|
|
460
|
+
];
|
|
461
|
+
|
|
462
|
+
expect(() => {
|
|
463
|
+
MetricFormulaEvaluator.evaluateFormula({
|
|
464
|
+
formula: "a + b",
|
|
465
|
+
queryConfigs,
|
|
466
|
+
formulaConfigs: [],
|
|
467
|
+
results,
|
|
468
|
+
});
|
|
469
|
+
}).toThrow(/no series groups in common/i);
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
test("joins a grouped variable that collapsed to a single series by group key (no cross-group broadcast)", () => {
|
|
473
|
+
/*
|
|
474
|
+
* Regression: $a and $b are both grouped by host.name, but in the
|
|
475
|
+
* charted window $b only returned rows for web-1 (web-2's
|
|
476
|
+
* denominator metric is missing). $b must NOT be treated as
|
|
477
|
+
* ungrouped-and-broadcast — that would compute a(web-2)/b(web-1)
|
|
478
|
+
* and stamp it as the web-2 series. Per the documented "groups
|
|
479
|
+
* present in ALL grouped variables" semantics, web-2 is dropped.
|
|
480
|
+
*/
|
|
481
|
+
const queryConfigs: Array<MetricQueryConfigData> = [
|
|
482
|
+
buildGroupedQueryConfig("a", ["host.name"]),
|
|
483
|
+
buildGroupedQueryConfig("b", ["host.name"]),
|
|
484
|
+
];
|
|
485
|
+
|
|
486
|
+
const results: Array<AggregatedResult> = [
|
|
487
|
+
buildGroupedResult([
|
|
488
|
+
{
|
|
489
|
+
timestamp: timestamps[0]!,
|
|
490
|
+
value: 10,
|
|
491
|
+
attributes: { "host.name": "web-1" },
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
timestamp: timestamps[0]!,
|
|
495
|
+
value: 40,
|
|
496
|
+
attributes: { "host.name": "web-2" },
|
|
497
|
+
},
|
|
498
|
+
]),
|
|
499
|
+
buildGroupedResult([
|
|
500
|
+
{
|
|
501
|
+
timestamp: timestamps[0]!,
|
|
502
|
+
value: 2,
|
|
503
|
+
attributes: { "host.name": "web-1" },
|
|
504
|
+
},
|
|
505
|
+
]),
|
|
506
|
+
];
|
|
507
|
+
|
|
508
|
+
const output: AggregatedResult = MetricFormulaEvaluator.evaluateFormula({
|
|
509
|
+
formula: "a / b",
|
|
510
|
+
queryConfigs,
|
|
511
|
+
formulaConfigs: [],
|
|
512
|
+
results,
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
// Only web-1 (the common group) is emitted — and with web-1 math.
|
|
516
|
+
expect(output.data).toEqual([
|
|
517
|
+
{
|
|
518
|
+
timestamp: new Date(timestamps[0]!),
|
|
519
|
+
value: 5,
|
|
520
|
+
attributes: { "host.name": "web-1" },
|
|
521
|
+
},
|
|
522
|
+
]);
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
test("still broadcasts a config-grouped variable whose result is EMPTY (degrades to gaps, not a structural error)", () => {
|
|
526
|
+
const queryConfigs: Array<MetricQueryConfigData> = [
|
|
527
|
+
buildGroupedQueryConfig("a", ["host.name"]),
|
|
528
|
+
buildGroupedQueryConfig("b", ["host.name"]),
|
|
529
|
+
];
|
|
530
|
+
|
|
531
|
+
const results: Array<AggregatedResult> = [
|
|
532
|
+
buildGroupedResult([
|
|
533
|
+
{
|
|
534
|
+
timestamp: timestamps[0]!,
|
|
535
|
+
value: 10,
|
|
536
|
+
attributes: { "host.name": "web-1" },
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
timestamp: timestamps[0]!,
|
|
540
|
+
value: 40,
|
|
541
|
+
attributes: { "host.name": "web-2" },
|
|
542
|
+
},
|
|
543
|
+
]),
|
|
544
|
+
buildGroupedResult([]),
|
|
545
|
+
];
|
|
546
|
+
|
|
547
|
+
const output: AggregatedResult = MetricFormulaEvaluator.evaluateFormula({
|
|
548
|
+
formula: "a / b",
|
|
549
|
+
queryConfigs,
|
|
550
|
+
formulaConfigs: [],
|
|
551
|
+
results,
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
// Every point misses $b, so every point is skipped silently.
|
|
555
|
+
expect(output.data).toEqual([]);
|
|
556
|
+
});
|
|
557
|
+
|
|
558
|
+
test("single-series inputs stay byte-identical to ungrouped behavior", () => {
|
|
559
|
+
/*
|
|
560
|
+
* The metric-monitor worker pre-buckets per series fingerprint and
|
|
561
|
+
* calls the evaluator with one series per variable — even though
|
|
562
|
+
* the query configs still carry groupByAttributeKeys and the rows
|
|
563
|
+
* still carry full attributes. Output must be exactly the legacy
|
|
564
|
+
* shape: unstamped {timestamp, value} rows.
|
|
565
|
+
*/
|
|
566
|
+
const queryConfigs: Array<MetricQueryConfigData> = [
|
|
567
|
+
buildGroupedQueryConfig("a", ["host.name"]),
|
|
568
|
+
buildGroupedQueryConfig("b", ["host.name"]),
|
|
569
|
+
];
|
|
570
|
+
|
|
571
|
+
const results: Array<AggregatedResult> = [
|
|
572
|
+
buildGroupedResult([
|
|
573
|
+
{
|
|
574
|
+
timestamp: timestamps[0]!,
|
|
575
|
+
value: 10,
|
|
576
|
+
attributes: { "host.name": "web-1", "process.pid": "42" },
|
|
577
|
+
},
|
|
578
|
+
]),
|
|
579
|
+
buildGroupedResult([
|
|
580
|
+
{
|
|
581
|
+
timestamp: timestamps[0]!,
|
|
582
|
+
value: 4,
|
|
583
|
+
attributes: { "host.name": "web-1", "process.pid": "43" },
|
|
584
|
+
},
|
|
585
|
+
]),
|
|
586
|
+
];
|
|
587
|
+
|
|
588
|
+
const output: AggregatedResult = MetricFormulaEvaluator.evaluateFormula({
|
|
589
|
+
formula: "a - b",
|
|
590
|
+
queryConfigs,
|
|
591
|
+
formulaConfigs: [],
|
|
592
|
+
results,
|
|
593
|
+
});
|
|
594
|
+
|
|
595
|
+
expect(output.data).toEqual([
|
|
596
|
+
{ timestamp: new Date(timestamps[0]!), value: 6 },
|
|
597
|
+
]);
|
|
598
|
+
expect(Object.keys(output.data[0]!)).toEqual(["timestamp", "value"]);
|
|
599
|
+
});
|
|
600
|
+
|
|
601
|
+
test("skips per-point gaps within a group silently", () => {
|
|
602
|
+
const queryConfigs: Array<MetricQueryConfigData> = [
|
|
603
|
+
buildGroupedQueryConfig("a", ["host.name"]),
|
|
604
|
+
buildGroupedQueryConfig("b", ["host.name"]),
|
|
605
|
+
];
|
|
606
|
+
|
|
607
|
+
const results: Array<AggregatedResult> = [
|
|
608
|
+
buildGroupedResult([
|
|
609
|
+
{
|
|
610
|
+
timestamp: timestamps[0]!,
|
|
611
|
+
value: 10,
|
|
612
|
+
attributes: { "host.name": "web-1" },
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
timestamp: timestamps[1]!,
|
|
616
|
+
value: 20,
|
|
617
|
+
attributes: { "host.name": "web-1" },
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
timestamp: timestamps[0]!,
|
|
621
|
+
value: 30,
|
|
622
|
+
attributes: { "host.name": "web-2" },
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
timestamp: timestamps[1]!,
|
|
626
|
+
value: 40,
|
|
627
|
+
attributes: { "host.name": "web-2" },
|
|
628
|
+
},
|
|
629
|
+
]),
|
|
630
|
+
buildGroupedResult([
|
|
631
|
+
// web-1 is missing the first timestamp for "b".
|
|
632
|
+
{
|
|
633
|
+
timestamp: timestamps[1]!,
|
|
634
|
+
value: 2,
|
|
635
|
+
attributes: { "host.name": "web-1" },
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
timestamp: timestamps[0]!,
|
|
639
|
+
value: 3,
|
|
640
|
+
attributes: { "host.name": "web-2" },
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
timestamp: timestamps[1]!,
|
|
644
|
+
value: 4,
|
|
645
|
+
attributes: { "host.name": "web-2" },
|
|
646
|
+
},
|
|
647
|
+
]),
|
|
648
|
+
];
|
|
649
|
+
|
|
650
|
+
const output: AggregatedResult = MetricFormulaEvaluator.evaluateFormula({
|
|
651
|
+
formula: "a / b",
|
|
652
|
+
queryConfigs,
|
|
653
|
+
formulaConfigs: [],
|
|
654
|
+
results,
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
expect(output.data).toEqual([
|
|
658
|
+
{
|
|
659
|
+
timestamp: new Date(timestamps[1]!),
|
|
660
|
+
value: 10,
|
|
661
|
+
attributes: { "host.name": "web-1" },
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
timestamp: new Date(timestamps[0]!),
|
|
665
|
+
value: 10,
|
|
666
|
+
attributes: { "host.name": "web-2" },
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
timestamp: new Date(timestamps[1]!),
|
|
670
|
+
value: 10,
|
|
671
|
+
attributes: { "host.name": "web-2" },
|
|
672
|
+
},
|
|
673
|
+
]);
|
|
674
|
+
});
|
|
233
675
|
});
|
|
234
676
|
|
|
235
677
|
describe("validateFormula", () => {
|
|
@@ -265,5 +707,37 @@ describe("MetricFormulaEvaluator", () => {
|
|
|
265
707
|
});
|
|
266
708
|
expect(message).toMatch(/required/i);
|
|
267
709
|
});
|
|
710
|
+
|
|
711
|
+
test("rejects doubled binary operators like a**b", () => {
|
|
712
|
+
const message: string | null = MetricFormulaEvaluator.validateFormula({
|
|
713
|
+
formula: "a ** b",
|
|
714
|
+
availableVariables: ["a", "b"],
|
|
715
|
+
});
|
|
716
|
+
expect(message).toMatch(/missing an operand/i);
|
|
717
|
+
});
|
|
718
|
+
|
|
719
|
+
test("rejects trailing operators like a+", () => {
|
|
720
|
+
const message: string | null = MetricFormulaEvaluator.validateFormula({
|
|
721
|
+
formula: "a +",
|
|
722
|
+
availableVariables: ["a"],
|
|
723
|
+
});
|
|
724
|
+
expect(message).toMatch(/missing an operand/i);
|
|
725
|
+
});
|
|
726
|
+
|
|
727
|
+
test("rejects empty parentheses", () => {
|
|
728
|
+
const message: string | null = MetricFormulaEvaluator.validateFormula({
|
|
729
|
+
formula: "()",
|
|
730
|
+
availableVariables: ["a"],
|
|
731
|
+
});
|
|
732
|
+
expect(message).toMatch(/empty/i);
|
|
733
|
+
});
|
|
734
|
+
|
|
735
|
+
test("rejects adjacent values with no operator", () => {
|
|
736
|
+
const message: string | null = MetricFormulaEvaluator.validateFormula({
|
|
737
|
+
formula: "a b",
|
|
738
|
+
availableVariables: ["a", "b"],
|
|
739
|
+
});
|
|
740
|
+
expect(message).toMatch(/single value/i);
|
|
741
|
+
});
|
|
268
742
|
});
|
|
269
743
|
});
|
|
@@ -234,13 +234,61 @@ describe("HeartbeatAvailabilityUtil.buildAvailabilitySeries", () => {
|
|
|
234
234
|
expect(downPoints(result).length).toBeGreaterThanOrEqual(2);
|
|
235
235
|
});
|
|
236
236
|
|
|
237
|
-
test("
|
|
237
|
+
test("5-minute buckets are used for windows over 3 hours", () => {
|
|
238
|
+
const windowEnd: Date = NOW;
|
|
239
|
+
const windowStart: Date = new Date(NOW.getTime() - 6 * 60 * MINUTE);
|
|
240
|
+
const bucketMs: number = 5 * MINUTE;
|
|
241
|
+
const base: number =
|
|
242
|
+
Math.floor(windowStart.getTime() / bucketMs) * bucketMs;
|
|
243
|
+
const rows: Array<AggregatedModel> = Array.from(
|
|
244
|
+
{ length: 74 },
|
|
245
|
+
(_: unknown, i: number): AggregatedModel => {
|
|
246
|
+
return row(new Date(base + i * bucketMs));
|
|
247
|
+
},
|
|
248
|
+
);
|
|
249
|
+
const result: HeartbeatAvailabilityResult = build(
|
|
250
|
+
rows,
|
|
251
|
+
windowStart,
|
|
252
|
+
windowEnd,
|
|
253
|
+
NOW,
|
|
254
|
+
);
|
|
255
|
+
expect(result.uptimePercent).toBe(100);
|
|
256
|
+
// ~72 five-minute buckets, not ~360 minute buckets.
|
|
257
|
+
expect(result.points.length).toBeLessThanOrEqual(74);
|
|
258
|
+
expect(result.points.length).toBeGreaterThan(60);
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
test("15-minute buckets are used for a 24-hour window", () => {
|
|
238
262
|
const windowEnd: Date = NOW;
|
|
239
263
|
const windowStart: Date = new Date(NOW.getTime() - 24 * 60 * MINUTE);
|
|
264
|
+
const bucketMs: number = 15 * MINUTE;
|
|
265
|
+
const base: number =
|
|
266
|
+
Math.floor(windowStart.getTime() / bucketMs) * bucketMs;
|
|
267
|
+
const rows: Array<AggregatedModel> = Array.from(
|
|
268
|
+
{ length: 98 },
|
|
269
|
+
(_: unknown, i: number): AggregatedModel => {
|
|
270
|
+
return row(new Date(base + i * bucketMs));
|
|
271
|
+
},
|
|
272
|
+
);
|
|
273
|
+
const result: HeartbeatAvailabilityResult = build(
|
|
274
|
+
rows,
|
|
275
|
+
windowStart,
|
|
276
|
+
windowEnd,
|
|
277
|
+
NOW,
|
|
278
|
+
);
|
|
279
|
+
expect(result.uptimePercent).toBe(100);
|
|
280
|
+
// ~96 fifteen-minute buckets, not ~1440 minute buckets.
|
|
281
|
+
expect(result.points.length).toBeLessThanOrEqual(98);
|
|
282
|
+
expect(result.points.length).toBeGreaterThan(90);
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
test("hour buckets are used for windows over 3 days", () => {
|
|
286
|
+
const windowEnd: Date = NOW;
|
|
287
|
+
const windowStart: Date = new Date(NOW.getTime() - 5 * 24 * 60 * MINUTE);
|
|
240
288
|
const hourMs: number = 60 * MINUTE;
|
|
241
289
|
const base: number = Math.floor(windowStart.getTime() / hourMs) * hourMs;
|
|
242
290
|
const rows: Array<AggregatedModel> = Array.from(
|
|
243
|
-
{ length:
|
|
291
|
+
{ length: 122 },
|
|
244
292
|
(_: unknown, i: number): AggregatedModel => {
|
|
245
293
|
return row(new Date(base + i * hourMs));
|
|
246
294
|
},
|
|
@@ -252,8 +300,8 @@ describe("HeartbeatAvailabilityUtil.buildAvailabilitySeries", () => {
|
|
|
252
300
|
NOW,
|
|
253
301
|
);
|
|
254
302
|
expect(result.uptimePercent).toBe(100);
|
|
255
|
-
// ~
|
|
256
|
-
expect(result.points.length).toBeLessThanOrEqual(
|
|
303
|
+
// ~120 hour buckets, not ~7200 minute buckets.
|
|
304
|
+
expect(result.points.length).toBeLessThanOrEqual(122);
|
|
257
305
|
});
|
|
258
306
|
|
|
259
307
|
test("returns null uptime when nothing is evaluable", () => {
|
|
@@ -4,6 +4,7 @@ enum AnalyticsTableName {
|
|
|
4
4
|
ExceptionInstance = "ExceptionItemV3",
|
|
5
5
|
Span = "SpanItemV3",
|
|
6
6
|
MonitorLog = "MonitorLogV3",
|
|
7
|
+
NetworkFlow = "NetworkFlowV1",
|
|
7
8
|
Profile = "ProfileItemV3",
|
|
8
9
|
ProfileSample = "ProfileSampleItemV3",
|
|
9
10
|
AuditLog = "AuditLogV2",
|
|
@@ -20,6 +21,16 @@ enum AnalyticsTableName {
|
|
|
20
21
|
* hostEntityKey instead of the raw host.name spelling.
|
|
21
22
|
*/
|
|
22
23
|
MetricItemAggMV1mByHostV2 = "MetricItemAggMV1mByHostV2",
|
|
24
|
+
/*
|
|
25
|
+
* Entity-keyed siblings of MetricItemAggMV1mByHostV2 — same layout,
|
|
26
|
+
* keyed by the other ingest-stamped scalar entity-key columns
|
|
27
|
+
* (serviceEntityKey / k8sClusterEntityKey / containerEntityKey) so
|
|
28
|
+
* entity-scoped chart queries can be served from a pre-aggregated
|
|
29
|
+
* rollup instead of scanning MetricItemV3.
|
|
30
|
+
*/
|
|
31
|
+
MetricItemAggMV1mByService = "MetricItemAggMV1mByService",
|
|
32
|
+
MetricItemAggMV1mByK8sCluster = "MetricItemAggMV1mByK8sCluster",
|
|
33
|
+
MetricItemAggMV1mByContainer = "MetricItemAggMV1mByContainer",
|
|
23
34
|
MetricBaselineHourly = "MetricBaselineHourly",
|
|
24
35
|
MutableMetric = "MutableMetricItem",
|
|
25
36
|
}
|
|
@@ -10,8 +10,9 @@ export default interface AggregateBy<TBaseModel extends GenericObject> {
|
|
|
10
10
|
aggregationType: AggregationType;
|
|
11
11
|
/**
|
|
12
12
|
* Optional explicit time-bucket size. When omitted (the default), the
|
|
13
|
-
* bucket size is derived from the query window (≤3h → minute, ≤
|
|
14
|
-
*
|
|
13
|
+
* bucket size is derived from the query window (≤3h → minute, ≤12h →
|
|
14
|
+
* 5 minutes, ≤24h → 15 minutes, ≤3d → 30 minutes, ≤7d → hour, ≤6w →
|
|
15
|
+
* day, …) — see AggregationIntervalUtil. Set this to pin a
|
|
15
16
|
* granularity independent of the window (e.g. `Day` buckets over a
|
|
16
17
|
* one-week window), or to `Total` to aggregate the whole window into a
|
|
17
18
|
* single value per group (no time bucketing). Invalid values are
|
|
@@ -38,4 +39,32 @@ export default interface AggregateBy<TBaseModel extends GenericObject> {
|
|
|
38
39
|
* `attributes` object containing exactly these keys.
|
|
39
40
|
*/
|
|
40
41
|
groupByAttributeKeys?: Array<string> | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Server-side Top-K group selection for grouped aggregations. When
|
|
44
|
+
* set (and the aggregation is grouped via `groupBy` /
|
|
45
|
+
* `groupByAttributeKeys`), the server ranks groups by `rankBy`
|
|
46
|
+
* (max or avg of the aggregated column) over the WHOLE query window,
|
|
47
|
+
* keeps only the top `count` groups, and reports the total number of
|
|
48
|
+
* matching groups via `AggregatedResult.totalGroups` — so a chart can
|
|
49
|
+
* plot the top 10 series without fetching every bucket of every
|
|
50
|
+
* group. Ignored for ungrouped aggregations. Plain JSON so it
|
|
51
|
+
* round-trips the API's serialize/deserialize unchanged.
|
|
52
|
+
*/
|
|
53
|
+
topK?:
|
|
54
|
+
| {
|
|
55
|
+
count: number;
|
|
56
|
+
rankBy: "max" | "avg";
|
|
57
|
+
}
|
|
58
|
+
| undefined;
|
|
59
|
+
/**
|
|
60
|
+
* What ClickHouse does when the aggregate's execution-time cap fires.
|
|
61
|
+
* 'break' (the default when omitted) returns the partial buckets
|
|
62
|
+
* computed so far — acceptable for chart rendering. Callers that
|
|
63
|
+
* ALERT on the result (the metric-monitor worker) must pass 'throw'
|
|
64
|
+
* so a timed-out evaluation fails loudly instead of silently scoring
|
|
65
|
+
* partial data as if it were complete. The server allow-lists the
|
|
66
|
+
* value before it reaches SQL: anything other than the exact string
|
|
67
|
+
* "throw" is treated as 'break'.
|
|
68
|
+
*/
|
|
69
|
+
timeoutOverflowMode?: "break" | "throw" | undefined;
|
|
41
70
|
}
|
|
@@ -2,4 +2,26 @@ import AggregatedModel from "./AggregatedModel";
|
|
|
2
2
|
|
|
3
3
|
export default interface AggregatedResult {
|
|
4
4
|
data: Array<AggregatedModel>;
|
|
5
|
+
/**
|
|
6
|
+
* Total number of distinct groups matching the query window, counted
|
|
7
|
+
* in the Top-K ranking phase. Only present for grouped aggregations
|
|
8
|
+
* executed with `AggregateBy.topK`; compare against `topK.count` to
|
|
9
|
+
* know how many series were left out.
|
|
10
|
+
*/
|
|
11
|
+
totalGroups?: number | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* True when the result is known (or heuristically likely) to be
|
|
14
|
+
* incomplete: the row count hit the applied LIMIT, or Top-K dropped
|
|
15
|
+
* groups (`totalGroups > topK.count`). Additive — absent/false means
|
|
16
|
+
* the window was fully served.
|
|
17
|
+
*/
|
|
18
|
+
truncated?: boolean | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Human-readable reason this result carries no data — e.g. a metric
|
|
21
|
+
* formula that failed structural validation (bad syntax, unknown
|
|
22
|
+
* variable, disjoint groups). Only set by client-side evaluation
|
|
23
|
+
* layers; never returned by the server. Chart layers should render it
|
|
24
|
+
* in place of the empty chart instead of showing a silent "no data".
|
|
25
|
+
*/
|
|
26
|
+
errorMessage?: string | undefined;
|
|
5
27
|
}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
export enum AggregationInterval {
|
|
2
2
|
Minute = "Minute",
|
|
3
|
+
/*
|
|
4
|
+
* The sub-hour tiers are served from the same 1-minute rollup as
|
|
5
|
+
* `Minute` (any bucket that is a whole multiple of a minute is >= the
|
|
6
|
+
* MV's resolution). Unlike the calendar units they are NOT valid
|
|
7
|
+
* ClickHouse `date_trunc`/INTERVAL-1 units, so SQL builders must go
|
|
8
|
+
* through AggregateUtil.buildBucketTimestampExpression instead of
|
|
9
|
+
* lowercasing the enum value into the statement.
|
|
10
|
+
*/
|
|
11
|
+
FiveMinutes = "FiveMinutes",
|
|
12
|
+
FifteenMinutes = "FifteenMinutes",
|
|
13
|
+
ThirtyMinutes = "ThirtyMinutes",
|
|
3
14
|
Hour = "Hour",
|
|
4
15
|
Day = "Day",
|
|
5
16
|
Week = "Week",
|