@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
|
@@ -18,6 +18,7 @@ import TableMetadata from "../../Types/Database/TableMetadata";
|
|
|
18
18
|
import Email from "../../Types/Email";
|
|
19
19
|
import HashedString from "../../Types/HashedString";
|
|
20
20
|
import IconProp from "../../Types/Icon/IconProp";
|
|
21
|
+
import { JSONObject } from "../../Types/JSON";
|
|
21
22
|
import Name from "../../Types/Name";
|
|
22
23
|
import ObjectID from "../../Types/ObjectID";
|
|
23
24
|
import Permission from "../../Types/Permission";
|
|
@@ -618,6 +619,42 @@ class User extends UserModel {
|
|
|
618
619
|
})
|
|
619
620
|
public utmUrl?: string = undefined;
|
|
620
621
|
|
|
622
|
+
@ColumnAccessControl({
|
|
623
|
+
create: [Permission.Public],
|
|
624
|
+
read: [],
|
|
625
|
+
update: [],
|
|
626
|
+
})
|
|
627
|
+
@TableColumn({
|
|
628
|
+
type: TableColumnType.JSON,
|
|
629
|
+
hideColumnInDocumentation: true,
|
|
630
|
+
title: "Ad Click IDs",
|
|
631
|
+
description:
|
|
632
|
+
"Ad platform click identifiers (gclid, fbclid, msclkid, etc.) captured on the visit that led to signup. Used for offline conversion uploads to ad platforms.",
|
|
633
|
+
})
|
|
634
|
+
@Column({
|
|
635
|
+
type: ColumnType.JSON,
|
|
636
|
+
nullable: true,
|
|
637
|
+
})
|
|
638
|
+
public clickIds?: JSONObject = undefined;
|
|
639
|
+
|
|
640
|
+
@ColumnAccessControl({
|
|
641
|
+
create: [Permission.Public],
|
|
642
|
+
read: [],
|
|
643
|
+
update: [],
|
|
644
|
+
})
|
|
645
|
+
@TableColumn({
|
|
646
|
+
type: TableColumnType.JSON,
|
|
647
|
+
hideColumnInDocumentation: true,
|
|
648
|
+
title: "First Touch Attribution",
|
|
649
|
+
description:
|
|
650
|
+
"UTM parameters, click IDs, landing URL and referrer from the visitor's first attributed visit. The utm* columns hold last-touch values.",
|
|
651
|
+
})
|
|
652
|
+
@Column({
|
|
653
|
+
type: ColumnType.JSON,
|
|
654
|
+
nullable: true,
|
|
655
|
+
})
|
|
656
|
+
public firstTouchAttribution?: JSONObject = undefined;
|
|
657
|
+
|
|
621
658
|
@ColumnAccessControl({
|
|
622
659
|
create: [],
|
|
623
660
|
read: [],
|
|
@@ -327,6 +327,23 @@ export default class BaseAnalyticsAPI<
|
|
|
327
327
|
);
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
+
/*
|
|
331
|
+
* Server-side clamp on the client-sent aggregate limit — nothing else
|
|
332
|
+
* bounds it, so an arbitrary client could request limit=999999999
|
|
333
|
+
* rows. Clamped to LIMIT_PER_PROJECT (never lower): grouped chart
|
|
334
|
+
* queries legitimately use the full 10k (groups × buckets).
|
|
335
|
+
* Non-numeric/absent limits are left untouched for the service layer's
|
|
336
|
+
* own defaulting.
|
|
337
|
+
*/
|
|
338
|
+
public static clampAggregateLimit(
|
|
339
|
+
aggregateBy: AggregateBy<AnalyticsDataModel>,
|
|
340
|
+
): void {
|
|
341
|
+
const requestedLimit: number = Number(aggregateBy.limit);
|
|
342
|
+
if (Number.isFinite(requestedLimit) && requestedLimit > LIMIT_PER_PROJECT) {
|
|
343
|
+
aggregateBy.limit = LIMIT_PER_PROJECT;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
330
347
|
@CaptureSpan()
|
|
331
348
|
public async getAggregate(
|
|
332
349
|
req: ExpressRequest,
|
|
@@ -357,6 +374,12 @@ export default class BaseAnalyticsAPI<
|
|
|
357
374
|
throw new BadRequestException("AggregateBy is required");
|
|
358
375
|
}
|
|
359
376
|
|
|
377
|
+
/*
|
|
378
|
+
* Applied before the cache key is computed so an over-limit request
|
|
379
|
+
* shares the cache slot of its clamped equivalent.
|
|
380
|
+
*/
|
|
381
|
+
BaseAnalyticsAPI.clampAggregateLimit(aggregateBy);
|
|
382
|
+
|
|
360
383
|
const databaseProps: DatabaseCommonInteractionProps =
|
|
361
384
|
await CommonAPI.getDatabaseCommonInteractionProps(req);
|
|
362
385
|
|
|
@@ -32,6 +32,7 @@ export interface LicenseInstanceUpsert {
|
|
|
32
32
|
// Usage fields are only set on report-user-count, not on validate.
|
|
33
33
|
userCount?: number | undefined;
|
|
34
34
|
userEmailHashes?: Array<string> | undefined;
|
|
35
|
+
masterAdminEmails?: Array<string> | undefined;
|
|
35
36
|
lastReportedAt?: Date | undefined;
|
|
36
37
|
}
|
|
37
38
|
|
|
@@ -215,6 +216,10 @@ export default class EnterpriseLicenseAPI extends BaseAPI<
|
|
|
215
216
|
EnterpriseLicenseUsageUtil.sanitizeUserEmailHashes(
|
|
216
217
|
req.body["userEmailHashes"],
|
|
217
218
|
);
|
|
219
|
+
const masterAdminEmails: Array<string> =
|
|
220
|
+
EnterpriseLicenseUsageUtil.sanitizeMasterAdminEmails(
|
|
221
|
+
req.body["masterAdminEmails"],
|
|
222
|
+
);
|
|
218
223
|
|
|
219
224
|
if (instanceId) {
|
|
220
225
|
/*
|
|
@@ -227,6 +232,7 @@ export default class EnterpriseLicenseAPI extends BaseAPI<
|
|
|
227
232
|
host: instanceHost || undefined,
|
|
228
233
|
userCount: userCount,
|
|
229
234
|
userEmailHashes: userEmailHashes,
|
|
235
|
+
masterAdminEmails: masterAdminEmails,
|
|
230
236
|
lastReportedAt: reportedAt,
|
|
231
237
|
});
|
|
232
238
|
}
|
|
@@ -372,6 +378,10 @@ export default class EnterpriseLicenseAPI extends BaseAPI<
|
|
|
372
378
|
newInstance.userEmailHashes = data.userEmailHashes;
|
|
373
379
|
}
|
|
374
380
|
|
|
381
|
+
if (data.masterAdminEmails !== undefined) {
|
|
382
|
+
newInstance.masterAdminEmails = data.masterAdminEmails;
|
|
383
|
+
}
|
|
384
|
+
|
|
375
385
|
if (data.lastReportedAt !== undefined) {
|
|
376
386
|
newInstance.lastReportedAt = data.lastReportedAt;
|
|
377
387
|
}
|
|
@@ -432,6 +442,10 @@ export default class EnterpriseLicenseAPI extends BaseAPI<
|
|
|
432
442
|
updateData.userEmailHashes = data.userEmailHashes;
|
|
433
443
|
}
|
|
434
444
|
|
|
445
|
+
if (data.masterAdminEmails !== undefined) {
|
|
446
|
+
updateData.masterAdminEmails = data.masterAdminEmails;
|
|
447
|
+
}
|
|
448
|
+
|
|
435
449
|
if (data.lastReportedAt !== undefined) {
|
|
436
450
|
updateData.lastReportedAt = data.lastReportedAt;
|
|
437
451
|
}
|
|
@@ -337,6 +337,90 @@ export const SubscriptionPlans: Array<SubscriptionPlan> =
|
|
|
337
337
|
export const AnalyticsKey: string = process.env["ANALYTICS_KEY"] || "";
|
|
338
338
|
export const AnalyticsHost: string = process.env["ANALYTICS_HOST"] || "";
|
|
339
339
|
|
|
340
|
+
/*
|
|
341
|
+
* Google Ads offline conversion uploads (MarketingConversions worker job).
|
|
342
|
+
* Server-only secrets — must never be added to FRONTEND_ENV_ALLOW_LIST.
|
|
343
|
+
*/
|
|
344
|
+
export const GoogleAdsDeveloperToken: string =
|
|
345
|
+
process.env["GOOGLE_ADS_DEVELOPER_TOKEN"] || "";
|
|
346
|
+
export const GoogleAdsOAuthClientId: string =
|
|
347
|
+
process.env["GOOGLE_ADS_OAUTH_CLIENT_ID"] || "";
|
|
348
|
+
export const GoogleAdsOAuthClientSecret: string =
|
|
349
|
+
process.env["GOOGLE_ADS_OAUTH_CLIENT_SECRET"] || "";
|
|
350
|
+
export const GoogleAdsOAuthRefreshToken: string =
|
|
351
|
+
process.env["GOOGLE_ADS_OAUTH_REFRESH_TOKEN"] || "";
|
|
352
|
+
// Digits only, no dashes (e.g. 1234567890).
|
|
353
|
+
export const GoogleAdsCustomerId: string =
|
|
354
|
+
process.env["GOOGLE_ADS_CUSTOMER_ID"] || "";
|
|
355
|
+
// Manager (MCC) account id when the OAuth user accesses the account via a manager.
|
|
356
|
+
export const GoogleAdsLoginCustomerId: string =
|
|
357
|
+
process.env["GOOGLE_ADS_LOGIN_CUSTOMER_ID"] || "";
|
|
358
|
+
/*
|
|
359
|
+
* Google sunsets Ads API versions roughly yearly (v20 died 2026-06-10) —
|
|
360
|
+
* keep this default on a currently supported version and prefer setting
|
|
361
|
+
* GOOGLE_ADS_API_VERSION explicitly in production.
|
|
362
|
+
*/
|
|
363
|
+
export const GoogleAdsApiVersion: string =
|
|
364
|
+
process.env["GOOGLE_ADS_API_VERSION"] || "v23";
|
|
365
|
+
// Numeric conversion action ids from Google Ads (Goals -> Conversions).
|
|
366
|
+
export const GoogleAdsSignUpConversionActionId: string =
|
|
367
|
+
process.env["GOOGLE_ADS_SIGNUP_CONVERSION_ACTION_ID"] || "";
|
|
368
|
+
export const GoogleAdsPaidSubscriptionConversionActionId: string =
|
|
369
|
+
process.env["GOOGLE_ADS_PAID_SUBSCRIPTION_CONVERSION_ACTION_ID"] || "";
|
|
370
|
+
|
|
371
|
+
// Meta (Facebook) Conversions API. Server-only secrets.
|
|
372
|
+
export const MetaConversionsPixelId: string =
|
|
373
|
+
process.env["META_CONVERSIONS_PIXEL_ID"] || "";
|
|
374
|
+
export const MetaConversionsAccessToken: string =
|
|
375
|
+
process.env["META_CONVERSIONS_ACCESS_TOKEN"] || "";
|
|
376
|
+
export const MetaGraphApiVersion: string =
|
|
377
|
+
process.env["META_GRAPH_API_VERSION"] || "v22.0";
|
|
378
|
+
|
|
379
|
+
// Microsoft Advertising (Bing Ads) offline conversions. Server-only secrets.
|
|
380
|
+
export const MicrosoftAdsDeveloperToken: string =
|
|
381
|
+
process.env["MICROSOFT_ADS_DEVELOPER_TOKEN"] || "";
|
|
382
|
+
export const MicrosoftAdsOAuthClientId: string =
|
|
383
|
+
process.env["MICROSOFT_ADS_OAUTH_CLIENT_ID"] || "";
|
|
384
|
+
export const MicrosoftAdsOAuthClientSecret: string =
|
|
385
|
+
process.env["MICROSOFT_ADS_OAUTH_CLIENT_SECRET"] || "";
|
|
386
|
+
export const MicrosoftAdsOAuthRefreshToken: string =
|
|
387
|
+
process.env["MICROSOFT_ADS_OAUTH_REFRESH_TOKEN"] || "";
|
|
388
|
+
export const MicrosoftAdsCustomerId: string =
|
|
389
|
+
process.env["MICROSOFT_ADS_CUSTOMER_ID"] || "";
|
|
390
|
+
export const MicrosoftAdsAccountId: string =
|
|
391
|
+
process.env["MICROSOFT_ADS_ACCOUNT_ID"] || "";
|
|
392
|
+
// Offline conversion goals are matched by NAME in Microsoft Advertising.
|
|
393
|
+
export const MicrosoftAdsSignUpConversionName: string =
|
|
394
|
+
process.env["MICROSOFT_ADS_SIGNUP_CONVERSION_NAME"] || "";
|
|
395
|
+
export const MicrosoftAdsPaidSubscriptionConversionName: string =
|
|
396
|
+
process.env["MICROSOFT_ADS_PAID_SUBSCRIPTION_CONVERSION_NAME"] || "";
|
|
397
|
+
|
|
398
|
+
// LinkedIn Conversions API. Server-only secrets.
|
|
399
|
+
export const LinkedInConversionsAccessToken: string =
|
|
400
|
+
process.env["LINKEDIN_CONVERSIONS_ACCESS_TOKEN"] || "";
|
|
401
|
+
/*
|
|
402
|
+
* LinkedIn publishes a new Marketing API version monthly and supports each
|
|
403
|
+
* for ~12 months — keep this default recent and prefer setting
|
|
404
|
+
* LINKEDIN_API_VERSION explicitly in production.
|
|
405
|
+
*/
|
|
406
|
+
export const LinkedInApiVersion: string =
|
|
407
|
+
process.env["LINKEDIN_API_VERSION"] || "202606";
|
|
408
|
+
// Numeric conversion rule ids (urn:lla:llaPartnerConversion:{id}).
|
|
409
|
+
export const LinkedInSignUpConversionId: string =
|
|
410
|
+
process.env["LINKEDIN_SIGNUP_CONVERSION_ID"] || "";
|
|
411
|
+
export const LinkedInPaidSubscriptionConversionId: string =
|
|
412
|
+
process.env["LINKEDIN_PAID_SUBSCRIPTION_CONVERSION_ID"] || "";
|
|
413
|
+
|
|
414
|
+
// Reddit Conversions API. Server-only secrets.
|
|
415
|
+
export const RedditAdsOAuthClientId: string =
|
|
416
|
+
process.env["REDDIT_ADS_OAUTH_CLIENT_ID"] || "";
|
|
417
|
+
export const RedditAdsOAuthClientSecret: string =
|
|
418
|
+
process.env["REDDIT_ADS_OAUTH_CLIENT_SECRET"] || "";
|
|
419
|
+
export const RedditAdsOAuthRefreshToken: string =
|
|
420
|
+
process.env["REDDIT_ADS_OAUTH_REFRESH_TOKEN"] || "";
|
|
421
|
+
export const RedditAdsAccountId: string =
|
|
422
|
+
process.env["REDDIT_ADS_ACCOUNT_ID"] || "";
|
|
423
|
+
|
|
340
424
|
export const DisableAutomaticIncidentCreation: boolean =
|
|
341
425
|
process.env["DISABLE_AUTOMATIC_INCIDENT_CREATION"] === "true";
|
|
342
426
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* OpenTelemetry stamps isMonotonic / aggregationTemporality on every
|
|
5
|
+
* ClickHouse metric row at ingest, but the browser only ever reads the
|
|
6
|
+
* Postgres MetricType catalog (name/description/unit). Denormalize both
|
|
7
|
+
* counter-semantics fields onto the catalog so the metric explorer can
|
|
8
|
+
* auto-suggest a rate view for cumulative monotonic counters.
|
|
9
|
+
*
|
|
10
|
+
* Both columns are nullable: NULL means "not reported yet" (rows created
|
|
11
|
+
* before this migration, or metrics whose instrument type carries no
|
|
12
|
+
* monotonicity — e.g. gauges). The ingest upsert only writes the fields
|
|
13
|
+
* when OTel actually reported them, so NULLs are never clobbered with
|
|
14
|
+
* fabricated values.
|
|
15
|
+
*/
|
|
16
|
+
export class AddCounterSemanticsToMetricType1784191414522
|
|
17
|
+
implements MigrationInterface
|
|
18
|
+
{
|
|
19
|
+
public name = "AddCounterSemanticsToMetricType1784191414522";
|
|
20
|
+
|
|
21
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
22
|
+
await queryRunner.query(
|
|
23
|
+
`ALTER TABLE "MetricType" ADD "isMonotonic" boolean`,
|
|
24
|
+
);
|
|
25
|
+
await queryRunner.query(
|
|
26
|
+
`ALTER TABLE "MetricType" ADD "aggregationTemporality" character varying(100)`,
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
31
|
+
await queryRunner.query(
|
|
32
|
+
`ALTER TABLE "MetricType" DROP COLUMN "aggregationTemporality"`,
|
|
33
|
+
);
|
|
34
|
+
await queryRunner.query(
|
|
35
|
+
`ALTER TABLE "MetricType" DROP COLUMN "isMonotonic"`,
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* MetricSavedView historically served only the metric LIST page. The
|
|
5
|
+
* metrics EXPLORER page now mounts its own saved-views control on the
|
|
6
|
+
* same table, so each row needs to say which surface it belongs to —
|
|
7
|
+
* otherwise the two controls would cross-list each other's views.
|
|
8
|
+
*
|
|
9
|
+
* The column is nullable on purpose: every pre-existing row was created
|
|
10
|
+
* by the list page, and readers treat NULL as "list". No backfill needed.
|
|
11
|
+
*/
|
|
12
|
+
export class AddViewTypeToMetricSavedView1784191414600
|
|
13
|
+
implements MigrationInterface
|
|
14
|
+
{
|
|
15
|
+
public name = "AddViewTypeToMetricSavedView1784191414600";
|
|
16
|
+
|
|
17
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
18
|
+
await queryRunner.query(
|
|
19
|
+
`ALTER TABLE "MetricSavedView" ADD "viewType" character varying(100)`,
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
24
|
+
await queryRunner.query(
|
|
25
|
+
`ALTER TABLE "MetricSavedView" DROP COLUMN "viewType"`,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Generated with generate-postgres-migration, then pruned: the generator
|
|
5
|
+
* also emitted a DROP + re-ADD of NetworkDeviceDiscoveryScan.snmpV3AuthKey /
|
|
6
|
+
* snmpV3PrivKey (text -> varchar type churn that would destroy stored keys)
|
|
7
|
+
* and unrelated OnCallDutyPolicyScheduleLayer default churn. Only the
|
|
8
|
+
* statements for the new inventory/discovery columns were kept.
|
|
9
|
+
*/
|
|
10
|
+
export class AddNetworkDeviceInventoryAndDiscoverySchedule1784211212164
|
|
11
|
+
implements MigrationInterface
|
|
12
|
+
{
|
|
13
|
+
public name = "AddNetworkDeviceInventoryAndDiscoverySchedule1784211212164";
|
|
14
|
+
|
|
15
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
16
|
+
await queryRunner.query(
|
|
17
|
+
`ALTER TABLE "NetworkDevice" ADD "sysObjectId" character varying(100)`,
|
|
18
|
+
);
|
|
19
|
+
await queryRunner.query(
|
|
20
|
+
`ALTER TABLE "NetworkDevice" ADD "sysLocation" character varying(100)`,
|
|
21
|
+
);
|
|
22
|
+
await queryRunner.query(
|
|
23
|
+
`ALTER TABLE "NetworkDevice" ADD "sysContact" character varying(100)`,
|
|
24
|
+
);
|
|
25
|
+
await queryRunner.query(
|
|
26
|
+
`ALTER TABLE "NetworkDevice" ADD "vendor" character varying(100)`,
|
|
27
|
+
);
|
|
28
|
+
await queryRunner.query(
|
|
29
|
+
`ALTER TABLE "NetworkDevice" ADD "deviceModel" character varying(100)`,
|
|
30
|
+
);
|
|
31
|
+
await queryRunner.query(
|
|
32
|
+
`ALTER TABLE "NetworkDevice" ADD "serialNumber" character varying(100)`,
|
|
33
|
+
);
|
|
34
|
+
await queryRunner.query(
|
|
35
|
+
`ALTER TABLE "NetworkDevice" ADD "firmwareVersion" character varying(100)`,
|
|
36
|
+
);
|
|
37
|
+
await queryRunner.query(
|
|
38
|
+
`ALTER TABLE "NetworkDevice" ADD "softwareVersion" character varying(100)`,
|
|
39
|
+
);
|
|
40
|
+
await queryRunner.query(
|
|
41
|
+
`ALTER TABLE "NetworkDevice" ADD "lastRebootedAt" TIMESTAMP WITH TIME ZONE`,
|
|
42
|
+
);
|
|
43
|
+
await queryRunner.query(
|
|
44
|
+
`ALTER TABLE "NetworkDevice" ADD "cdpNeighbors" jsonb`,
|
|
45
|
+
);
|
|
46
|
+
await queryRunner.query(
|
|
47
|
+
`ALTER TABLE "NetworkDeviceDiscoveryScan" ADD "isRecurring" boolean NOT NULL DEFAULT false`,
|
|
48
|
+
);
|
|
49
|
+
await queryRunner.query(
|
|
50
|
+
`ALTER TABLE "NetworkDeviceDiscoveryScan" ADD "rescanIntervalInMinutes" integer`,
|
|
51
|
+
);
|
|
52
|
+
await queryRunner.query(
|
|
53
|
+
`ALTER TABLE "NetworkDeviceDiscoveryScan" ADD "nextScanAt" TIMESTAMP WITH TIME ZONE`,
|
|
54
|
+
);
|
|
55
|
+
await queryRunner.query(
|
|
56
|
+
`ALTER TABLE "NetworkInterface" ADD "macAddress" character varying(100)`,
|
|
57
|
+
);
|
|
58
|
+
await queryRunner.query(
|
|
59
|
+
`ALTER TABLE "NetworkInterface" ADD "interfaceType" integer`,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
64
|
+
await queryRunner.query(
|
|
65
|
+
`ALTER TABLE "NetworkInterface" DROP COLUMN "interfaceType"`,
|
|
66
|
+
);
|
|
67
|
+
await queryRunner.query(
|
|
68
|
+
`ALTER TABLE "NetworkInterface" DROP COLUMN "macAddress"`,
|
|
69
|
+
);
|
|
70
|
+
await queryRunner.query(
|
|
71
|
+
`ALTER TABLE "NetworkDeviceDiscoveryScan" DROP COLUMN "nextScanAt"`,
|
|
72
|
+
);
|
|
73
|
+
await queryRunner.query(
|
|
74
|
+
`ALTER TABLE "NetworkDeviceDiscoveryScan" DROP COLUMN "rescanIntervalInMinutes"`,
|
|
75
|
+
);
|
|
76
|
+
await queryRunner.query(
|
|
77
|
+
`ALTER TABLE "NetworkDeviceDiscoveryScan" DROP COLUMN "isRecurring"`,
|
|
78
|
+
);
|
|
79
|
+
await queryRunner.query(
|
|
80
|
+
`ALTER TABLE "NetworkDevice" DROP COLUMN "cdpNeighbors"`,
|
|
81
|
+
);
|
|
82
|
+
await queryRunner.query(
|
|
83
|
+
`ALTER TABLE "NetworkDevice" DROP COLUMN "lastRebootedAt"`,
|
|
84
|
+
);
|
|
85
|
+
await queryRunner.query(
|
|
86
|
+
`ALTER TABLE "NetworkDevice" DROP COLUMN "softwareVersion"`,
|
|
87
|
+
);
|
|
88
|
+
await queryRunner.query(
|
|
89
|
+
`ALTER TABLE "NetworkDevice" DROP COLUMN "firmwareVersion"`,
|
|
90
|
+
);
|
|
91
|
+
await queryRunner.query(
|
|
92
|
+
`ALTER TABLE "NetworkDevice" DROP COLUMN "serialNumber"`,
|
|
93
|
+
);
|
|
94
|
+
await queryRunner.query(
|
|
95
|
+
`ALTER TABLE "NetworkDevice" DROP COLUMN "deviceModel"`,
|
|
96
|
+
);
|
|
97
|
+
await queryRunner.query(`ALTER TABLE "NetworkDevice" DROP COLUMN "vendor"`);
|
|
98
|
+
await queryRunner.query(
|
|
99
|
+
`ALTER TABLE "NetworkDevice" DROP COLUMN "sysContact"`,
|
|
100
|
+
);
|
|
101
|
+
await queryRunner.query(
|
|
102
|
+
`ALTER TABLE "NetworkDevice" DROP COLUMN "sysLocation"`,
|
|
103
|
+
);
|
|
104
|
+
await queryRunner.query(
|
|
105
|
+
`ALTER TABLE "NetworkDevice" DROP COLUMN "sysObjectId"`,
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class AddEnterpriseLicenseNotificationColumns1784218257664
|
|
4
|
+
implements MigrationInterface
|
|
5
|
+
{
|
|
6
|
+
public name: string = "AddEnterpriseLicenseNotificationColumns1784218257664";
|
|
7
|
+
|
|
8
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
9
|
+
await queryRunner.query(
|
|
10
|
+
`ALTER TABLE "GlobalConfig" ADD "enterpriseLicenseNotificationEmail" character varying(100)`,
|
|
11
|
+
);
|
|
12
|
+
await queryRunner.query(
|
|
13
|
+
`ALTER TABLE "GlobalConfig" ADD "enterpriseLicenseExpiryReminderDays" integer`,
|
|
14
|
+
);
|
|
15
|
+
await queryRunner.query(
|
|
16
|
+
`ALTER TABLE "EnterpriseLicenseInstance" ADD "masterAdminEmails" jsonb`,
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
21
|
+
await queryRunner.query(
|
|
22
|
+
`ALTER TABLE "EnterpriseLicenseInstance" DROP COLUMN "masterAdminEmails"`,
|
|
23
|
+
);
|
|
24
|
+
await queryRunner.query(
|
|
25
|
+
`ALTER TABLE "GlobalConfig" DROP COLUMN "enterpriseLicenseExpiryReminderDays"`,
|
|
26
|
+
);
|
|
27
|
+
await queryRunner.query(
|
|
28
|
+
`ALTER TABLE "GlobalConfig" DROP COLUMN "enterpriseLicenseNotificationEmail"`,
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class AddAttributionColumnsToUserAndProject1784293516000
|
|
4
|
+
implements MigrationInterface
|
|
5
|
+
{
|
|
6
|
+
public name: string = "AddAttributionColumnsToUserAndProject1784293516000";
|
|
7
|
+
|
|
8
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
9
|
+
await queryRunner.query(`ALTER TABLE "User" ADD "clickIds" jsonb`);
|
|
10
|
+
await queryRunner.query(
|
|
11
|
+
`ALTER TABLE "User" ADD "firstTouchAttribution" jsonb`,
|
|
12
|
+
);
|
|
13
|
+
await queryRunner.query(`ALTER TABLE "Project" ADD "clickIds" jsonb`);
|
|
14
|
+
await queryRunner.query(
|
|
15
|
+
`ALTER TABLE "Project" ADD "firstTouchAttribution" jsonb`,
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
20
|
+
await queryRunner.query(
|
|
21
|
+
`ALTER TABLE "Project" DROP COLUMN "firstTouchAttribution"`,
|
|
22
|
+
);
|
|
23
|
+
await queryRunner.query(`ALTER TABLE "Project" DROP COLUMN "clickIds"`);
|
|
24
|
+
await queryRunner.query(
|
|
25
|
+
`ALTER TABLE "User" DROP COLUMN "firstTouchAttribution"`,
|
|
26
|
+
);
|
|
27
|
+
await queryRunner.query(`ALTER TABLE "User" DROP COLUMN "clickIds"`);
|
|
28
|
+
}
|
|
29
|
+
}
|
package/Server/Infrastructure/Postgres/SchemaMigrations/1784298000000-AddMarketingConversionTable.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class AddMarketingConversionTable1784298000000
|
|
4
|
+
implements MigrationInterface
|
|
5
|
+
{
|
|
6
|
+
public name: string = "AddMarketingConversionTable1784298000000";
|
|
7
|
+
|
|
8
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
9
|
+
await queryRunner.query(
|
|
10
|
+
`CREATE TABLE "MarketingConversion" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "conversionType" character varying(100) NOT NULL, "userId" uuid, "projectId" uuid, "email" character varying(100), "clickIds" jsonb NOT NULL, "conversionAt" TIMESTAMP WITH TIME ZONE NOT NULL, "conversionValueInUSDCents" integer, "uploadState" jsonb, CONSTRAINT "PK_MarketingConversion_id" PRIMARY KEY ("_id"))`,
|
|
11
|
+
);
|
|
12
|
+
await queryRunner.query(
|
|
13
|
+
`CREATE INDEX "idx_marketing_conversion_user_id" ON "MarketingConversion" ("userId")`,
|
|
14
|
+
);
|
|
15
|
+
await queryRunner.query(
|
|
16
|
+
`CREATE INDEX "idx_marketing_conversion_project_id" ON "MarketingConversion" ("projectId")`,
|
|
17
|
+
);
|
|
18
|
+
await queryRunner.query(
|
|
19
|
+
`CREATE UNIQUE INDEX "uq_marketing_conversion_type_user" ON "MarketingConversion" ("conversionType", "userId")`,
|
|
20
|
+
);
|
|
21
|
+
await queryRunner.query(
|
|
22
|
+
`CREATE UNIQUE INDEX "uq_marketing_conversion_type_project" ON "MarketingConversion" ("conversionType", "projectId")`,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
27
|
+
await queryRunner.query(
|
|
28
|
+
`DROP INDEX "uq_marketing_conversion_type_project"`,
|
|
29
|
+
);
|
|
30
|
+
await queryRunner.query(`DROP INDEX "uq_marketing_conversion_type_user"`);
|
|
31
|
+
await queryRunner.query(`DROP INDEX "idx_marketing_conversion_project_id"`);
|
|
32
|
+
await queryRunner.query(`DROP INDEX "idx_marketing_conversion_user_id"`);
|
|
33
|
+
await queryRunner.query(`DROP TABLE "MarketingConversion"`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -454,7 +454,13 @@ import { BackfillCodeFixTaskType1784105912819 } from "./1784105912819-BackfillCo
|
|
|
454
454
|
import { AddAITaskNumberAndRunTranscript1784124919694 } from "./1784124919694-AddAITaskNumberAndRunTranscript";
|
|
455
455
|
import { AllowNullAiAgentOnPullRequest1784135099754 } from "./1784135099754-AllowNullAiAgentOnPullRequest";
|
|
456
456
|
import { AddEnableMcpServerToStatusPage1784137457184 } from "./1784137457184-AddEnableMcpServerToStatusPage";
|
|
457
|
+
import { AddCounterSemanticsToMetricType1784191414522 } from "./1784191414522-AddCounterSemanticsToMetricType";
|
|
458
|
+
import { AddViewTypeToMetricSavedView1784191414600 } from "./1784191414600-AddViewTypeToMetricSavedView";
|
|
457
459
|
import { AddSnmpV3ColumnsToNetworkDeviceDiscoveryScan1784200000000 } from "./1784200000000-AddSnmpV3ColumnsToNetworkDeviceDiscoveryScan";
|
|
460
|
+
import { AddNetworkDeviceInventoryAndDiscoverySchedule1784211212164 } from "./1784211212164-AddNetworkDeviceInventoryAndDiscoverySchedule";
|
|
461
|
+
import { AddEnterpriseLicenseNotificationColumns1784218257664 } from "./1784218257664-AddEnterpriseLicenseNotificationColumns";
|
|
462
|
+
import { AddAttributionColumnsToUserAndProject1784293516000 } from "./1784293516000-AddAttributionColumnsToUserAndProject";
|
|
463
|
+
import { AddMarketingConversionTable1784298000000 } from "./1784298000000-AddMarketingConversionTable";
|
|
458
464
|
|
|
459
465
|
export default [
|
|
460
466
|
InitialMigration,
|
|
@@ -913,5 +919,11 @@ export default [
|
|
|
913
919
|
AddAITaskNumberAndRunTranscript1784124919694,
|
|
914
920
|
AllowNullAiAgentOnPullRequest1784135099754,
|
|
915
921
|
AddEnableMcpServerToStatusPage1784137457184,
|
|
922
|
+
AddCounterSemanticsToMetricType1784191414522,
|
|
923
|
+
AddViewTypeToMetricSavedView1784191414600,
|
|
916
924
|
AddSnmpV3ColumnsToNetworkDeviceDiscoveryScan1784200000000,
|
|
925
|
+
AddNetworkDeviceInventoryAndDiscoverySchedule1784211212164,
|
|
926
|
+
AddEnterpriseLicenseNotificationColumns1784218257664,
|
|
927
|
+
AddAttributionColumnsToUserAndProject1784293516000,
|
|
928
|
+
AddMarketingConversionTable1784298000000,
|
|
917
929
|
];
|
|
@@ -29,7 +29,10 @@ import Select from "../Types/AnalyticsDatabase/Select";
|
|
|
29
29
|
import UpdateBy from "../Types/AnalyticsDatabase/UpdateBy";
|
|
30
30
|
import { SQL, Statement } from "../Utils/AnalyticsDatabase/Statement";
|
|
31
31
|
import StatementGenerator from "../Utils/AnalyticsDatabase/StatementGenerator";
|
|
32
|
-
import {
|
|
32
|
+
import {
|
|
33
|
+
getQuerySettings,
|
|
34
|
+
TimeoutOverflowMode,
|
|
35
|
+
} from "../Utils/AnalyticsDatabase/QuerySettingsHelper";
|
|
33
36
|
import {
|
|
34
37
|
getStorageTableName,
|
|
35
38
|
onClusterClause,
|
|
@@ -892,8 +895,47 @@ export default class AnalyticsDatabaseService<
|
|
|
892
895
|
aggregatedItems.push(aggregatedModel);
|
|
893
896
|
}
|
|
894
897
|
|
|
898
|
+
/*
|
|
899
|
+
* Top-K statements (see MetricService) carry the pre-trim group
|
|
900
|
+
* count as a constant `__total_groups` column on every row; lift
|
|
901
|
+
* it off the first row into result metadata. The per-row copy
|
|
902
|
+
* loop above only projects timestamp/value/group-by columns, so
|
|
903
|
+
* the helper column never reaches the rows themselves.
|
|
904
|
+
*/
|
|
905
|
+
let totalGroups: number | undefined = undefined;
|
|
906
|
+
const firstItem: JSONObject | undefined = items[0];
|
|
907
|
+
if (firstItem && firstItem["__total_groups"] !== undefined) {
|
|
908
|
+
const parsedTotalGroups: number = Number(firstItem["__total_groups"]);
|
|
909
|
+
if (Number.isFinite(parsedTotalGroups)) {
|
|
910
|
+
totalGroups = parsedTotalGroups;
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
/*
|
|
915
|
+
* Truncation detection. Row-count == LIMIT is a heuristic (an
|
|
916
|
+
* exactly-full window reads as truncated), but a false positive
|
|
917
|
+
* only over-warns; the silent-data-loss case it exists to catch
|
|
918
|
+
* (groups × buckets > limit dropping the oldest buckets) is
|
|
919
|
+
* always flagged. Top-K truncation is exact: the ranking phase
|
|
920
|
+
* counted every matching group.
|
|
921
|
+
*/
|
|
922
|
+
const appliedLimit: number = Number(aggregateBy.limit);
|
|
923
|
+
let truncated: boolean =
|
|
924
|
+
Number.isFinite(appliedLimit) &&
|
|
925
|
+
appliedLimit > 0 &&
|
|
926
|
+
items.length >= appliedLimit;
|
|
927
|
+
if (
|
|
928
|
+
aggregateBy.topK &&
|
|
929
|
+
totalGroups !== undefined &&
|
|
930
|
+
totalGroups > aggregateBy.topK.count
|
|
931
|
+
) {
|
|
932
|
+
truncated = true;
|
|
933
|
+
}
|
|
934
|
+
|
|
895
935
|
return {
|
|
896
936
|
data: aggregatedItems,
|
|
937
|
+
...(totalGroups !== undefined ? { totalGroups } : {}),
|
|
938
|
+
truncated,
|
|
897
939
|
};
|
|
898
940
|
} catch (error) {
|
|
899
941
|
await this.onFindError(error as Exception);
|
|
@@ -1194,6 +1236,24 @@ export default class AnalyticsDatabaseService<
|
|
|
1194
1236
|
return statement;
|
|
1195
1237
|
}
|
|
1196
1238
|
|
|
1239
|
+
/**
|
|
1240
|
+
* The timeout_overflow_mode an aggregate statement should carry.
|
|
1241
|
+
* Callers that render charts keep the 'break' default (partial
|
|
1242
|
+
* buckets are acceptable there); callers that ALERT on the result —
|
|
1243
|
+
* the metric-monitor worker — pass 'throw' so a timed-out evaluation
|
|
1244
|
+
* fails loudly instead of silently scoring partial data.
|
|
1245
|
+
*
|
|
1246
|
+
* Allow-listed, never passed through: aggregateBy is deserialized
|
|
1247
|
+
* wholesale from API clients and this setting is emitted into SQL as
|
|
1248
|
+
* a trusted literal (see QuerySettingsHelper), so anything other than
|
|
1249
|
+
* the exact string "throw" degrades to the 'break' default.
|
|
1250
|
+
*/
|
|
1251
|
+
protected getTimeoutOverflowMode(
|
|
1252
|
+
aggregateBy: AggregateBy<TBaseModel>,
|
|
1253
|
+
): TimeoutOverflowMode {
|
|
1254
|
+
return aggregateBy.timeoutOverflowMode === "throw" ? "throw" : "break";
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1197
1257
|
public toAggregateStatement(aggregateBy: AggregateBy<TBaseModel>): {
|
|
1198
1258
|
statement: Statement;
|
|
1199
1259
|
columns: Array<string>;
|
|
@@ -1306,6 +1366,13 @@ export default class AnalyticsDatabaseService<
|
|
|
1306
1366
|
/*
|
|
1307
1367
|
* Aggregation read-path settings.
|
|
1308
1368
|
*
|
|
1369
|
+
* - max_execution_time=45: cap aggregate runtime below the
|
|
1370
|
+
* ClickHouse client's 58s request_timeout, same as the count/find
|
|
1371
|
+
* statements — a wide-window aggregate over a large table would
|
|
1372
|
+
* otherwise run until the HTTP client disconnects. The overflow
|
|
1373
|
+
* mode defaults to 'break' (partial buckets are acceptable for
|
|
1374
|
+
* chart rendering) but alerting callers opt into 'throw' via
|
|
1375
|
+
* aggregateBy.timeoutOverflowMode — see getTimeoutOverflowMode.
|
|
1309
1376
|
* - optimize_aggregation_in_order: when GROUP BY is a prefix of the
|
|
1310
1377
|
* sort key (we always group by a time bucket and the time column
|
|
1311
1378
|
* is at the tail of every analytics primary key), ClickHouse can
|
|
@@ -1322,6 +1389,8 @@ export default class AnalyticsDatabaseService<
|
|
|
1322
1389
|
*/
|
|
1323
1390
|
statement.append(
|
|
1324
1391
|
getQuerySettings({
|
|
1392
|
+
maxExecutionTimeInSeconds: 45,
|
|
1393
|
+
timeoutOverflowMode: this.getTimeoutOverflowMode(aggregateBy),
|
|
1325
1394
|
additionalSettings: {
|
|
1326
1395
|
optimize_aggregation_in_order: 1,
|
|
1327
1396
|
optimize_move_to_prewhere: 1,
|
|
@@ -56,6 +56,7 @@ import ServiceType from "../../Types/Telemetry/ServiceType";
|
|
|
56
56
|
import OneUptimeDate from "../../Types/Date";
|
|
57
57
|
import TelemetryUtil from "../Utils/Telemetry/Telemetry";
|
|
58
58
|
import logger, { LogAttributes } from "../Utils/Logger";
|
|
59
|
+
import ProductAnalytics from "../Utils/ProductAnalytics";
|
|
59
60
|
import Semaphore, { SemaphoreMutex } from "../Infrastructure/Semaphore";
|
|
60
61
|
import IncidentFeedService from "./IncidentFeedService";
|
|
61
62
|
import IncidentSlaService from "./IncidentSlaService";
|
|
@@ -907,6 +908,18 @@ export class Service extends DatabaseService<Model> {
|
|
|
907
908
|
throw new BadDataException("id is required");
|
|
908
909
|
}
|
|
909
910
|
|
|
911
|
+
/*
|
|
912
|
+
* Activation event for marketing funnels. Only fires for human-declared
|
|
913
|
+
* incidents (captureForUser skips when there is no user).
|
|
914
|
+
*/
|
|
915
|
+
ProductAnalytics.captureForUser({
|
|
916
|
+
userId: onCreate.createBy.props.userId || createdItem.createdByUserId,
|
|
917
|
+
event: "server/incident_created",
|
|
918
|
+
properties: {
|
|
919
|
+
project_id: createdItem.projectId.toString(),
|
|
920
|
+
},
|
|
921
|
+
});
|
|
922
|
+
|
|
910
923
|
// Get incident data for feed creation
|
|
911
924
|
const incident: Model | null = await this.findOneById({
|
|
912
925
|
id: createdItem.id,
|