@oneuptime/common 11.5.8 → 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/AIAgentTaskPullRequest.ts +15 -6
- package/Models/DatabaseModels/AIRun.ts +37 -0
- package/Models/DatabaseModels/AIRunEvent.ts +34 -1
- 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 +328 -0
- package/Models/DatabaseModels/NetworkInterface.ts +58 -0
- package/Models/DatabaseModels/Project.ts +62 -0
- package/Models/DatabaseModels/StatusPage.ts +42 -0
- package/Models/DatabaseModels/User.ts +37 -0
- package/Server/API/AIAgentTaskAPI.ts +38 -12
- package/Server/API/AIAgentTaskLogAPI.ts +49 -0
- package/Server/API/AIChatAPI.ts +16 -0
- package/Server/API/AIReadinessAPI.ts +84 -0
- package/Server/API/BaseAnalyticsAPI.ts +23 -0
- package/Server/API/CodeFixRunAPI.ts +182 -0
- package/Server/API/EnterpriseLicenseAPI.ts +14 -0
- package/Server/API/TelemetryExceptionAPI.ts +6 -1
- package/Server/EnvironmentConfig.ts +84 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784124919694-AddAITaskNumberAndRunTranscript.ts +95 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784135099754-AllowNullAiAgentOnPullRequest.ts +52 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784137457184-AddEnableMcpServerToStatusPage.ts +30 -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/1784200000000-AddSnmpV3ColumnsToNetworkDeviceDiscoveryScan.ts +49 -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 +20 -0
- package/Server/Services/AIRunEventService.ts +15 -1
- package/Server/Services/AIRunService.ts +38 -1
- package/Server/Services/AnalyticsDatabaseService.ts +70 -1
- package/Server/Services/IncidentService.ts +13 -0
- package/Server/Services/Index.ts +10 -0
- package/Server/Services/LlmProviderService.ts +2 -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 +178 -0
- package/Server/Services/SpanService.ts +13 -9
- package/Server/Services/StatusPageService.ts +97 -0
- package/Server/Services/TeamMemberService.ts +11 -0
- package/Server/Services/TelemetryExceptionService.ts +19 -90
- package/Server/Services/UserService.ts +59 -0
- package/Server/Types/AnalyticsDatabase/AggregateBy.ts +37 -7
- package/Server/Types/Markdown.ts +9 -9
- package/Server/Types/MarkdownSlugify.ts +47 -0
- package/Server/Utils/AI/AIRunTranscript.ts +240 -0
- package/Server/Utils/AI/Chat/ChatAgentRunner.ts +9 -0
- package/Server/Utils/AI/Chat/ObservabilityChatPrompt.ts +119 -5
- package/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.ts +75 -0
- package/Server/Utils/AI/CodeFix/CodeFixReadiness.ts +235 -0
- package/Server/Utils/AI/SRE/Insights/FixRouting.ts +2 -3
- package/Server/Utils/AI/Toolbox/CodeTools.ts +883 -0
- package/Server/Utils/AI/Toolbox/CodeWriteTools.ts +519 -0
- package/Server/Utils/AI/Toolbox/Index.ts +27 -0
- package/Server/Utils/AI/Toolbox/ScheduledMaintenanceTools.ts +279 -0
- package/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.ts +19 -1
- package/Server/Utils/Attribution.ts +99 -0
- package/Server/Utils/CodeRepository/GitHub/GitHub.ts +600 -0
- package/Server/Utils/CodeRepository/StackTraceRepoResolver.ts +7 -2
- package/Server/Utils/LLM/LLMService.ts +397 -18
- 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 +19 -11
- 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/Models/StatusPageEnableMcpServer.test.ts +125 -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/Services/StatusPageServiceMcp.test.ts +223 -0
- package/Tests/Server/Services/TelemetryExceptionAIFixReadiness.test.ts +26 -3
- package/Tests/Server/Services/TelemetryExceptionCodeFixRun.test.ts +12 -0
- package/Tests/Server/Types/Markdown.test.ts +106 -0
- package/Tests/Server/Utils/AI/AIRunTranscript.test.ts +182 -0
- package/Tests/Server/Utils/AI/CodeFixReadiness.test.ts +411 -0
- package/Tests/Server/Utils/AI/CodeTools.test.ts +596 -0
- package/Tests/Server/Utils/AI/CodeWriteTools.test.ts +475 -0
- package/Tests/Server/Utils/AI/LLMServiceModelCompatibility.test.ts +548 -0
- package/Tests/Server/Utils/AI/ObservabilityChatPrompt.test.ts +142 -0
- package/Tests/Server/Utils/AI/ScheduledMaintenanceTools.test.ts +176 -0
- package/Tests/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.test.ts +63 -0
- package/Tests/Server/Utils/GitHubGetFileContent.test.ts +197 -0
- package/Tests/Server/Utils/Monitor/MonitorTemplateUtilNetworkDevice.test.ts +389 -0
- package/Tests/Server/Utils/Monitor/NetworkDeviceHydrationUtil.test.ts +502 -0
- package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +764 -0
- package/Tests/Types/AI/AIAgentTaskStatus.test.ts +7 -6
- package/Tests/Types/AI/AIChatPageContext.test.ts +0 -0
- package/Tests/Types/AI/AIRunStatus.test.ts +42 -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/Log/LogSeverity.test.ts +78 -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/BasicFormDropdownNormalization.test.tsx +167 -0
- package/Tests/UI/Components/Charts/AxisTickColor.test.tsx +66 -0
- package/Tests/UI/Components/XAxis.test.ts +5 -3
- package/Tests/UI/Utils/AIChatExport/ChatWidgetData.test.ts +319 -0
- package/Tests/UI/Utils/AIChatExport/ChatWidgetMarkdown.test.ts +188 -0
- 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/AI/AIAgentTaskStatus.ts +13 -0
- package/Types/AI/AIChatPageContext.ts +137 -0
- package/Types/AI/AIChatTypes.ts +44 -0
- package/Types/AI/AIFixReadiness.ts +46 -0
- package/Types/AI/AIRunStatus.ts +11 -0
- 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/Log/LogSeverity.ts +61 -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/Monitor/SnmpMonitor/SnmpVersion.ts +40 -0
- 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 +336 -3
- package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +118 -1
- package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +336 -3
- 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/Forms/BasicForm.tsx +26 -8
- 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 +1324 -0
- package/UI/Utils/AIChatExport/ChatWidgetData.ts +316 -0
- package/UI/Utils/AIChatExport/ChatWidgetMarkdown.ts +349 -0
- package/UI/Utils/AIChatExport/ConversationMarkdown.ts +177 -0
- package/UI/Utils/AIChatExport/MarkdownBlocks.ts +327 -0
- package/UI/Utils/AIChatExport/MarkdownSafety.ts +215 -0
- package/UI/Utils/DownloadFile.ts +54 -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/AIAgentTaskPullRequest.js +15 -7
- package/build/dist/Models/DatabaseModels/AIAgentTaskPullRequest.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AIRun.js +38 -0
- package/build/dist/Models/DatabaseModels/AIRun.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AIRunEvent.js +31 -0
- package/build/dist/Models/DatabaseModels/AIRunEvent.js.map +1 -1
- 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 +341 -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 +65 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPage.js +43 -0
- package/build/dist/Models/DatabaseModels/StatusPage.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/AIAgentTaskAPI.js +37 -11
- package/build/dist/Server/API/AIAgentTaskAPI.js.map +1 -1
- package/build/dist/Server/API/AIAgentTaskLogAPI.js +32 -7
- package/build/dist/Server/API/AIAgentTaskLogAPI.js.map +1 -1
- package/build/dist/Server/API/AIChatAPI.js +9 -0
- package/build/dist/Server/API/AIChatAPI.js.map +1 -1
- package/build/dist/Server/API/AIReadinessAPI.js +57 -0
- package/build/dist/Server/API/AIReadinessAPI.js.map +1 -0
- package/build/dist/Server/API/BaseAnalyticsAPI.js +19 -0
- package/build/dist/Server/API/BaseAnalyticsAPI.js.map +1 -1
- package/build/dist/Server/API/CodeFixRunAPI.js +142 -0
- package/build/dist/Server/API/CodeFixRunAPI.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/API/TelemetryExceptionAPI.js +4 -0
- package/build/dist/Server/API/TelemetryExceptionAPI.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/1784124919694-AddAITaskNumberAndRunTranscript.js +80 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784124919694-AddAITaskNumberAndRunTranscript.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784135099754-AllowNullAiAgentOnPullRequest.js +37 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784135099754-AllowNullAiAgentOnPullRequest.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784137457184-AddEnableMcpServerToStatusPage.js +23 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784137457184-AddEnableMcpServerToStatusPage.js.map +1 -0
- 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/1784200000000-AddSnmpV3ColumnsToNetworkDeviceDiscoveryScan.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784200000000-AddSnmpV3ColumnsToNetworkDeviceDiscoveryScan.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 +20 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AIRunEventService.js +8 -0
- package/build/dist/Server/Services/AIRunEventService.js.map +1 -1
- package/build/dist/Server/Services/AIRunService.js +29 -0
- package/build/dist/Server/Services/AIRunService.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/LlmProviderService.js +2 -0
- package/build/dist/Server/Services/LlmProviderService.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 +146 -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 +91 -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/TelemetryExceptionService.js +14 -61
- package/build/dist/Server/Services/TelemetryExceptionService.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/Types/Markdown.js +8 -8
- package/build/dist/Server/Types/Markdown.js.map +1 -1
- package/build/dist/Server/Types/MarkdownSlugify.js +47 -0
- package/build/dist/Server/Types/MarkdownSlugify.js.map +1 -0
- package/build/dist/Server/Utils/AI/AIRunTranscript.js +180 -0
- package/build/dist/Server/Utils/AI/AIRunTranscript.js.map +1 -0
- package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js +1 -0
- package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js +103 -5
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js.map +1 -1
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js +55 -0
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js.map +1 -1
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixReadiness.js +211 -0
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixReadiness.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/FixRouting.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/CodeTools.js +654 -0
- package/build/dist/Server/Utils/AI/Toolbox/CodeTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/CodeWriteTools.js +389 -0
- package/build/dist/Server/Utils/AI/Toolbox/CodeWriteTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/Index.js +19 -0
- package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/ScheduledMaintenanceTools.js +239 -0
- package/build/dist/Server/Utils/AI/Toolbox/ScheduledMaintenanceTools.js.map +1 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.js +19 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.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/CodeRepository/GitHub/GitHub.js +439 -0
- package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js.map +1 -1
- package/build/dist/Server/Utils/CodeRepository/StackTraceRepoResolver.js +1 -1
- package/build/dist/Server/Utils/CodeRepository/StackTraceRepoResolver.js.map +1 -1
- package/build/dist/Server/Utils/LLM/LLMService.js +275 -19
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- 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 +17 -11
- 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/AI/AIAgentTaskStatus.js +12 -0
- package/build/dist/Types/AI/AIAgentTaskStatus.js.map +1 -1
- package/build/dist/Types/AI/AIChatPageContext.js +101 -0
- package/build/dist/Types/AI/AIChatPageContext.js.map +1 -0
- package/build/dist/Types/AI/AIChatTypes.js +2 -0
- package/build/dist/Types/AI/AIChatTypes.js.map +1 -1
- package/build/dist/Types/AI/AIFixReadiness.js +9 -0
- package/build/dist/Types/AI/AIFixReadiness.js.map +1 -0
- package/build/dist/Types/AI/AIRunStatus.js +11 -0
- package/build/dist/Types/AI/AIRunStatus.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/Log/LogSeverity.js +56 -0
- package/build/dist/Types/Log/LogSeverity.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/Monitor/SnmpMonitor/SnmpVersion.js +38 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVersion.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 +217 -8
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +55 -4
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +217 -8
- 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/Forms/BasicForm.js +24 -6
- package/build/dist/UI/Components/Forms/BasicForm.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/AIChatExport/ChatWidgetData.js +217 -0
- package/build/dist/UI/Utils/AIChatExport/ChatWidgetData.js.map +1 -0
- package/build/dist/UI/Utils/AIChatExport/ChatWidgetMarkdown.js +234 -0
- package/build/dist/UI/Utils/AIChatExport/ChatWidgetMarkdown.js.map +1 -0
- package/build/dist/UI/Utils/AIChatExport/ConversationMarkdown.js +111 -0
- package/build/dist/UI/Utils/AIChatExport/ConversationMarkdown.js.map +1 -0
- package/build/dist/UI/Utils/AIChatExport/MarkdownBlocks.js +233 -0
- package/build/dist/UI/Utils/AIChatExport/MarkdownBlocks.js.map +1 -0
- package/build/dist/UI/Utils/AIChatExport/MarkdownSafety.js +134 -0
- package/build/dist/UI/Utils/AIChatExport/MarkdownSafety.js.map +1 -0
- package/build/dist/UI/Utils/DownloadFile.js +41 -0
- package/build/dist/UI/Utils/DownloadFile.js.map +1 -0
- 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 +6 -2
|
@@ -18,6 +18,7 @@ import HttpPhaseTimings from "../../../Types/Monitor/HttpPhaseTimings";
|
|
|
18
18
|
import MonitorMetricType from "../../../Types/Monitor/MonitorMetricType";
|
|
19
19
|
import PingMonitorResponse from "../../../Types/Monitor/PingMonitor/PingMonitorResponse";
|
|
20
20
|
import SnmpInterface from "../../../Types/Monitor/SnmpMonitor/SnmpInterface";
|
|
21
|
+
import { SnmpOidResponse } from "../../../Types/Monitor/SnmpMonitor/SnmpMonitorResponse";
|
|
21
22
|
import ProbeMonitorResponse from "../../../Types/Probe/ProbeMonitorResponse";
|
|
22
23
|
import ServerMonitorResponse from "../../../Types/Monitor/ServerMonitor/ServerMonitorResponse";
|
|
23
24
|
import SyntheticMonitorResponse from "../../../Types/Monitor/SyntheticMonitors/SyntheticMonitorResponse";
|
|
@@ -976,6 +977,62 @@ export default class MonitorMetricUtil {
|
|
|
976
977
|
}
|
|
977
978
|
}
|
|
978
979
|
|
|
980
|
+
/*
|
|
981
|
+
* Polled OID values (vendor-template CPU/memory/temperature and custom
|
|
982
|
+
* OIDs). Without this the values users poll every check can gate
|
|
983
|
+
* criteria but can never be charted or evaluated over time. One series
|
|
984
|
+
* per OID, keyed by the oid/oidName attributes; non-numeric values
|
|
985
|
+
* (strings, OIDs, MACs) are skipped — they carry no chartable signal.
|
|
986
|
+
*/
|
|
987
|
+
const snmpOidResponses: Array<SnmpOidResponse> | undefined = (
|
|
988
|
+
data.dataToProcess as ProbeMonitorResponse
|
|
989
|
+
).snmpResponse?.oidResponses;
|
|
990
|
+
|
|
991
|
+
if (snmpOidResponses && snmpOidResponses.length > 0) {
|
|
992
|
+
// Same unbounded-write cap rationale as the interface block above.
|
|
993
|
+
const oidResponsesToEmit: Array<SnmpOidResponse> = snmpOidResponses.slice(
|
|
994
|
+
0,
|
|
995
|
+
50,
|
|
996
|
+
);
|
|
997
|
+
|
|
998
|
+
if (oidResponsesToEmit.length < snmpOidResponses.length) {
|
|
999
|
+
logger.warn(
|
|
1000
|
+
`Monitor ${data.monitorId.toString()}: emitting metrics for first ${oidResponsesToEmit.length} of ${snmpOidResponses.length} SNMP OID responses`,
|
|
1001
|
+
);
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
for (const oidResponse of oidResponsesToEmit) {
|
|
1005
|
+
const numericValue: number | undefined =
|
|
1006
|
+
typeof oidResponse.value === "number" && isFinite(oidResponse.value)
|
|
1007
|
+
? oidResponse.value
|
|
1008
|
+
: undefined;
|
|
1009
|
+
|
|
1010
|
+
if (numericValue === undefined) {
|
|
1011
|
+
continue;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
await this.pushMonitorMetric({
|
|
1015
|
+
projectId: data.projectId,
|
|
1016
|
+
monitorId: data.monitorId,
|
|
1017
|
+
monitorName: data.monitorName,
|
|
1018
|
+
probeName: data.probeName,
|
|
1019
|
+
metricName: MonitorMetricType.SnmpOidValue,
|
|
1020
|
+
value: numericValue,
|
|
1021
|
+
description: "Value of a polled SNMP OID",
|
|
1022
|
+
unit: "",
|
|
1023
|
+
extraAttributes: {
|
|
1024
|
+
probeId: (
|
|
1025
|
+
data.dataToProcess as ProbeMonitorResponse
|
|
1026
|
+
).probeId.toString(),
|
|
1027
|
+
oid: oidResponse.oid,
|
|
1028
|
+
oidName: oidResponse.name || oidResponse.oid,
|
|
1029
|
+
},
|
|
1030
|
+
metricRows: metricRows,
|
|
1031
|
+
metricNameServiceNameMap: metricNameServiceNameMap,
|
|
1032
|
+
});
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
|
|
979
1036
|
if ((data.dataToProcess as ProbeMonitorResponse).httpTimings) {
|
|
980
1037
|
const httpTimings: HttpPhaseTimings = (
|
|
981
1038
|
data.dataToProcess as ProbeMonitorResponse
|
|
@@ -15,6 +15,10 @@ import SyntheticMonitorResponse from "../../../Types/Monitor/SyntheticMonitors/S
|
|
|
15
15
|
import SnmpMonitorResponse, {
|
|
16
16
|
SnmpOidResponse,
|
|
17
17
|
} from "../../../Types/Monitor/SnmpMonitor/SnmpMonitorResponse";
|
|
18
|
+
import SnmpInterface from "../../../Types/Monitor/SnmpMonitor/SnmpInterface";
|
|
19
|
+
import SnmpTrap, {
|
|
20
|
+
SnmpTrapVarbind,
|
|
21
|
+
} from "../../../Types/Monitor/SnmpMonitor/SnmpTrap";
|
|
18
22
|
import DnsMonitorResponse, {
|
|
19
23
|
DnsRecordResponse,
|
|
20
24
|
} from "../../../Types/Monitor/DnsMonitor/DnsMonitorResponse";
|
|
@@ -277,6 +281,96 @@ export default class MonitorTemplateUtil {
|
|
|
277
281
|
}
|
|
278
282
|
}
|
|
279
283
|
}
|
|
284
|
+
|
|
285
|
+
/*
|
|
286
|
+
* Interface walk results (populated when interface monitoring is
|
|
287
|
+
* enabled on the monitor step). Counts follow the same semantics as
|
|
288
|
+
* NetworkInventoryUtil: administratively disabled interfaces are
|
|
289
|
+
* intentionally down and never count as failures, so
|
|
290
|
+
* `interfacesDown` / `downInterfaces` only cover interfaces that are
|
|
291
|
+
* admin-up but oper-down. Lets templates say
|
|
292
|
+
* "{{downInterfaces.0.name}} on {{sysName}} is down".
|
|
293
|
+
*/
|
|
294
|
+
if (snmpResponse?.interfaces && snmpResponse.interfaces.length > 0) {
|
|
295
|
+
const interfaces: Array<SnmpInterface> = snmpResponse.interfaces;
|
|
296
|
+
|
|
297
|
+
const downInterfaces: Array<SnmpInterface> = interfaces.filter(
|
|
298
|
+
(snmpInterface: SnmpInterface) => {
|
|
299
|
+
return (
|
|
300
|
+
snmpInterface.isAdministrativelyUp &&
|
|
301
|
+
!snmpInterface.isOperationallyUp
|
|
302
|
+
);
|
|
303
|
+
},
|
|
304
|
+
);
|
|
305
|
+
|
|
306
|
+
storageMap["interfacesTotal"] = interfaces.length;
|
|
307
|
+
storageMap["interfacesUp"] = interfaces.filter(
|
|
308
|
+
(snmpInterface: SnmpInterface) => {
|
|
309
|
+
return (
|
|
310
|
+
snmpInterface.isAdministrativelyUp &&
|
|
311
|
+
snmpInterface.isOperationallyUp
|
|
312
|
+
);
|
|
313
|
+
},
|
|
314
|
+
).length;
|
|
315
|
+
storageMap["interfacesDown"] = downInterfaces.length;
|
|
316
|
+
storageMap["downInterfaces"] = downInterfaces.map(
|
|
317
|
+
(snmpInterface: SnmpInterface) => {
|
|
318
|
+
return {
|
|
319
|
+
name: snmpInterface.name,
|
|
320
|
+
alias: snmpInterface.alias || "",
|
|
321
|
+
interfaceIndex: snmpInterface.interfaceIndex,
|
|
322
|
+
};
|
|
323
|
+
},
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
if (snmpResponse?.interfaceWalkFailure) {
|
|
328
|
+
storageMap["interfaceWalkFailure"] =
|
|
329
|
+
snmpResponse.interfaceWalkFailure;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/*
|
|
333
|
+
* Device system identity (SNMPv2 system group), when collected.
|
|
334
|
+
* Missing fields default to "" so templates render blank instead of
|
|
335
|
+
* a raw {{placeholder}} — but never clobber a value the user already
|
|
336
|
+
* exposed via a custom OID named sysName/sysDescr/etc. above.
|
|
337
|
+
*/
|
|
338
|
+
if (snmpResponse?.systemInfo) {
|
|
339
|
+
const systemInfoFields: Array<[string, string | undefined]> = [
|
|
340
|
+
["sysName", snmpResponse.systemInfo.sysName],
|
|
341
|
+
["sysDescr", snmpResponse.systemInfo.sysDescr],
|
|
342
|
+
["sysObjectId", snmpResponse.systemInfo.sysObjectId],
|
|
343
|
+
["sysLocation", snmpResponse.systemInfo.sysLocation],
|
|
344
|
+
];
|
|
345
|
+
|
|
346
|
+
for (const [fieldName, fieldValue] of systemInfoFields) {
|
|
347
|
+
if (fieldValue || storageMap[fieldName] === undefined) {
|
|
348
|
+
storageMap[fieldName] = fieldValue || "";
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/*
|
|
354
|
+
* Trap payload — only present when this check was triggered by an
|
|
355
|
+
* SNMP trap received by a probe's trap receiver (rather than a
|
|
356
|
+
* scheduled poll).
|
|
357
|
+
*/
|
|
358
|
+
const snmpTrapResponse: SnmpTrap | undefined = (
|
|
359
|
+
data.dataToProcess as ProbeMonitorResponse
|
|
360
|
+
).snmpTrapResponse;
|
|
361
|
+
|
|
362
|
+
if (snmpTrapResponse) {
|
|
363
|
+
storageMap["trapOid"] = snmpTrapResponse.trapOid;
|
|
364
|
+
storageMap["trapSourceIp"] = snmpTrapResponse.sourceIpAddress;
|
|
365
|
+
storageMap["trapVarbinds"] = snmpTrapResponse.varbinds.map(
|
|
366
|
+
(varbind: SnmpTrapVarbind) => {
|
|
367
|
+
return {
|
|
368
|
+
oid: varbind.oid,
|
|
369
|
+
value: varbind.value,
|
|
370
|
+
};
|
|
371
|
+
},
|
|
372
|
+
);
|
|
373
|
+
}
|
|
280
374
|
}
|
|
281
375
|
|
|
282
376
|
if (data.monitorType === MonitorType.DNS) {
|
|
@@ -4,7 +4,9 @@ import MonitorSteps from "../../../Types/Monitor/MonitorSteps";
|
|
|
4
4
|
import QueryHelper from "../../Types/Database/QueryHelper";
|
|
5
5
|
import LIMIT_MAX from "../../../Types/Database/LimitMax";
|
|
6
6
|
import MonitorType from "../../../Types/Monitor/MonitorType";
|
|
7
|
-
import SnmpVersion
|
|
7
|
+
import SnmpVersion, {
|
|
8
|
+
SnmpVersionUtil,
|
|
9
|
+
} from "../../../Types/Monitor/SnmpMonitor/SnmpVersion";
|
|
8
10
|
import SnmpV3Auth from "../../../Types/Monitor/SnmpMonitor/SnmpV3Auth";
|
|
9
11
|
import SnmpSecurityLevel from "../../../Types/Monitor/SnmpMonitor/SnmpSecurityLevel";
|
|
10
12
|
import SnmpAuthProtocol from "../../../Types/Monitor/SnmpMonitor/SnmpAuthProtocol";
|
|
@@ -128,6 +130,21 @@ export default class NetworkDeviceHydrationUtil {
|
|
|
128
130
|
* snmpV3* columns (the current storage), falling back to the deprecated
|
|
129
131
|
* snmpV3Auth JSON column so devices created before the columns existed keep
|
|
130
132
|
* working. Returns undefined when no v3 username is configured.
|
|
133
|
+
*
|
|
134
|
+
* The protocol columns are passed through as stored, on purpose. It is
|
|
135
|
+
* tempting to validate them here with SnmpSecurityLevelUtil /
|
|
136
|
+
* SnmpAuthProtocolUtil / SnmpPrivProtocolUtil, but this runs server-side
|
|
137
|
+
* inside the probe's monitor-list request, and that request claims its
|
|
138
|
+
* monitors — advancing nextPingAt — before hydration runs. A throw here
|
|
139
|
+
* would 500 the whole batch, so one malformed row would stall up to a
|
|
140
|
+
* hundred unrelated monitors of every type, every cycle, with nothing
|
|
141
|
+
* recorded against them.
|
|
142
|
+
*
|
|
143
|
+
* The probe validates instead, in SnmpMonitor.buildV3User, where a bad value
|
|
144
|
+
* fails exactly one monitor and shows up as its failure cause. Parsing here
|
|
145
|
+
* would defeat that by folding an unreadable value into undefined, which the
|
|
146
|
+
* probe cannot tell from "never configured" — and would therefore poll with
|
|
147
|
+
* a silently defaulted algorithm.
|
|
131
148
|
*/
|
|
132
149
|
private static buildSnmpV3Auth(
|
|
133
150
|
device: NetworkDevice,
|
|
@@ -162,16 +179,7 @@ export default class NetworkDeviceHydrationUtil {
|
|
|
162
179
|
|
|
163
180
|
// Tolerates both enum values ("2c") and enum keys ("V2c") in stored config.
|
|
164
181
|
private static parseSnmpVersion(value: string | undefined): SnmpVersion {
|
|
165
|
-
|
|
166
|
-
case "1":
|
|
167
|
-
case "v1":
|
|
168
|
-
return SnmpVersion.V1;
|
|
169
|
-
case "3":
|
|
170
|
-
case "v3":
|
|
171
|
-
return SnmpVersion.V3;
|
|
172
|
-
default:
|
|
173
|
-
return SnmpVersion.V2c;
|
|
174
|
-
}
|
|
182
|
+
return SnmpVersionUtil.parse(value);
|
|
175
183
|
}
|
|
176
184
|
|
|
177
185
|
/*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Monitor from "../../../Models/DatabaseModels/Monitor";
|
|
2
|
+
import NetworkDevice from "../../../Models/DatabaseModels/NetworkDevice";
|
|
2
3
|
import NetworkInterface from "../../../Models/DatabaseModels/NetworkInterface";
|
|
3
4
|
import NetworkDeviceService from "../../Services/NetworkDeviceService";
|
|
4
5
|
import NetworkInterfaceService from "../../Services/NetworkInterfaceService";
|
|
@@ -6,6 +7,10 @@ import LIMIT_MAX from "../../../Types/Database/LimitMax";
|
|
|
6
7
|
import MonitorStep from "../../../Types/Monitor/MonitorStep";
|
|
7
8
|
import SnmpInterface from "../../../Types/Monitor/SnmpMonitor/SnmpInterface";
|
|
8
9
|
import LldpNeighbor from "../../../Types/Monitor/SnmpMonitor/LldpNeighbor";
|
|
10
|
+
import CdpNeighbor from "../../../Types/Monitor/SnmpMonitor/CdpNeighbor";
|
|
11
|
+
import SnmpSystemInfo from "../../../Types/Monitor/SnmpMonitor/SnmpSystemInfo";
|
|
12
|
+
import SnmpEntityInfo from "../../../Types/Monitor/SnmpMonitor/SnmpEntityInfo";
|
|
13
|
+
import SnmpVendorTemplateUtil from "../../../Types/Monitor/SnmpMonitor/SnmpVendorTemplate";
|
|
9
14
|
import ProbeMonitorResponse from "../../../Types/Probe/ProbeMonitorResponse";
|
|
10
15
|
import ObjectID from "../../../Types/ObjectID";
|
|
11
16
|
import OneUptimeDate from "../../../Types/Date";
|
|
@@ -41,21 +46,63 @@ export default class NetworkInventoryUtil {
|
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
const deviceId: ObjectID = new ObjectID(deviceIdAsString);
|
|
49
|
+
|
|
50
|
+
/*
|
|
51
|
+
* The device id is read from the monitor's step JSON, which a user can
|
|
52
|
+
* set to any UUID through the Monitor API (the dashboard dropdown is
|
|
53
|
+
* scoped, but the API is not). Confirm the device actually belongs to
|
|
54
|
+
* this monitor's project before writing anything with isRoot — without
|
|
55
|
+
* this guard a crafted step could point at another project's device and
|
|
56
|
+
* overwrite its inventory (or spawn interfaces under it).
|
|
57
|
+
*/
|
|
58
|
+
const ownedDevice: NetworkDevice | null =
|
|
59
|
+
await NetworkDeviceService.findOneBy({
|
|
60
|
+
query: {
|
|
61
|
+
_id: deviceId,
|
|
62
|
+
projectId: data.monitor.projectId,
|
|
63
|
+
},
|
|
64
|
+
select: {
|
|
65
|
+
_id: true,
|
|
66
|
+
},
|
|
67
|
+
props: {
|
|
68
|
+
isRoot: true,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
if (!ownedDevice) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
44
76
|
const walkedInterfaces: Array<SnmpInterface> =
|
|
45
77
|
data.dataToProcess.snmpResponse?.interfaces || [];
|
|
46
|
-
const systemInfo:
|
|
47
|
-
|
|
48
|
-
|
|
78
|
+
const systemInfo: SnmpSystemInfo | undefined =
|
|
79
|
+
data.dataToProcess.snmpResponse?.systemInfo;
|
|
80
|
+
const entityInfo: SnmpEntityInfo | undefined =
|
|
81
|
+
data.dataToProcess.snmpResponse?.entityInfo;
|
|
49
82
|
const lldpNeighbors: Array<LldpNeighbor> | undefined =
|
|
50
83
|
data.dataToProcess.snmpResponse?.lldpNeighbors;
|
|
84
|
+
const cdpNeighbors: Array<CdpNeighbor> | undefined =
|
|
85
|
+
data.dataToProcess.snmpResponse?.cdpNeighbors;
|
|
51
86
|
|
|
52
87
|
const now: Date = OneUptimeDate.getCurrentDate();
|
|
53
88
|
|
|
89
|
+
/*
|
|
90
|
+
* lastSeenAt is "last time the device actually answered", not "last time
|
|
91
|
+
* we tried": the device list's status pill and the topology map both
|
|
92
|
+
* derive up/down from its freshness, so bumping it on a failed poll
|
|
93
|
+
* would paint an unreachable device green. A poll where the probe could
|
|
94
|
+
* not reach the device reports isOnline === false; treat anything else
|
|
95
|
+
* (reachable, or a monitor type that reports no reachability) as seen.
|
|
96
|
+
*/
|
|
97
|
+
const isDeviceReachable: boolean = data.dataToProcess.isOnline !== false;
|
|
98
|
+
|
|
54
99
|
try {
|
|
55
100
|
// --- Device enrichment + cached counts ---
|
|
56
|
-
const deviceUpdate: Record<string, unknown> = {
|
|
57
|
-
|
|
58
|
-
|
|
101
|
+
const deviceUpdate: Record<string, unknown> = {};
|
|
102
|
+
|
|
103
|
+
if (isDeviceReachable) {
|
|
104
|
+
deviceUpdate["lastSeenAt"] = now;
|
|
105
|
+
}
|
|
59
106
|
|
|
60
107
|
if (systemInfo?.sysDescr) {
|
|
61
108
|
deviceUpdate["sysDescr"] = systemInfo.sysDescr.substring(0, 500);
|
|
@@ -63,15 +110,66 @@ export default class NetworkInventoryUtil {
|
|
|
63
110
|
if (systemInfo?.sysName) {
|
|
64
111
|
deviceUpdate["sysName"] = systemInfo.sysName.substring(0, 100);
|
|
65
112
|
}
|
|
113
|
+
if (systemInfo?.sysObjectId) {
|
|
114
|
+
deviceUpdate["sysObjectId"] = systemInfo.sysObjectId.substring(0, 100);
|
|
115
|
+
}
|
|
116
|
+
if (systemInfo?.sysLocation) {
|
|
117
|
+
deviceUpdate["sysLocation"] = systemInfo.sysLocation.substring(0, 100);
|
|
118
|
+
}
|
|
119
|
+
if (systemInfo?.sysContact) {
|
|
120
|
+
deviceUpdate["sysContact"] = systemInfo.sysContact.substring(0, 100);
|
|
121
|
+
}
|
|
122
|
+
if (systemInfo?.sysUpTimeSeconds !== undefined) {
|
|
123
|
+
deviceUpdate["lastRebootedAt"] = new Date(
|
|
124
|
+
now.getTime() - systemInfo.sysUpTimeSeconds * 1000,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/*
|
|
129
|
+
* Vendor: ENTITY-MIB manufacturer when the device implements it,
|
|
130
|
+
* otherwise fingerprinted from the sysObjectID enterprise arc.
|
|
131
|
+
*/
|
|
132
|
+
const vendor: string | undefined =
|
|
133
|
+
entityInfo?.manufacturer ||
|
|
134
|
+
SnmpVendorTemplateUtil.getVendorNameBySysObjectId(
|
|
135
|
+
systemInfo?.sysObjectId,
|
|
136
|
+
);
|
|
137
|
+
if (vendor) {
|
|
138
|
+
deviceUpdate["vendor"] = vendor.substring(0, 100);
|
|
139
|
+
}
|
|
140
|
+
if (entityInfo?.model) {
|
|
141
|
+
deviceUpdate["deviceModel"] = entityInfo.model.substring(0, 100);
|
|
142
|
+
}
|
|
143
|
+
if (entityInfo?.serialNumber) {
|
|
144
|
+
deviceUpdate["serialNumber"] = entityInfo.serialNumber.substring(
|
|
145
|
+
0,
|
|
146
|
+
100,
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
if (entityInfo?.firmwareVersion) {
|
|
150
|
+
deviceUpdate["firmwareVersion"] = entityInfo.firmwareVersion.substring(
|
|
151
|
+
0,
|
|
152
|
+
100,
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
if (entityInfo?.softwareVersion) {
|
|
156
|
+
deviceUpdate["softwareVersion"] = entityInfo.softwareVersion.substring(
|
|
157
|
+
0,
|
|
158
|
+
100,
|
|
159
|
+
);
|
|
160
|
+
}
|
|
66
161
|
|
|
67
162
|
/*
|
|
68
163
|
* Store the LLDP snapshot (capped) whenever the walk ran, even if it
|
|
69
164
|
* found nothing — clearing stale neighbors is as important as adding
|
|
70
|
-
* new ones for keeping the topology accurate.
|
|
165
|
+
* new ones for keeping the topology accurate. Same for CDP.
|
|
71
166
|
*/
|
|
72
167
|
if (lldpNeighbors !== undefined) {
|
|
73
168
|
deviceUpdate["lldpNeighbors"] = lldpNeighbors.slice(0, 256);
|
|
74
169
|
}
|
|
170
|
+
if (cdpNeighbors !== undefined) {
|
|
171
|
+
deviceUpdate["cdpNeighbors"] = cdpNeighbors.slice(0, 256);
|
|
172
|
+
}
|
|
75
173
|
|
|
76
174
|
if (walkedInterfaces.length > 0) {
|
|
77
175
|
deviceUpdate["interfacesTotal"] = walkedInterfaces.length;
|
|
@@ -87,13 +185,16 @@ export default class NetworkInventoryUtil {
|
|
|
87
185
|
).length;
|
|
88
186
|
}
|
|
89
187
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
188
|
+
// An unreachable poll with no walk data leaves nothing worth writing.
|
|
189
|
+
if (Object.keys(deviceUpdate).length > 0) {
|
|
190
|
+
await NetworkDeviceService.updateOneById({
|
|
191
|
+
id: deviceId,
|
|
192
|
+
data: deviceUpdate as any,
|
|
193
|
+
props: {
|
|
194
|
+
isRoot: true,
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
}
|
|
97
198
|
|
|
98
199
|
if (walkedInterfaces.length === 0) {
|
|
99
200
|
return;
|
|
@@ -138,6 +239,10 @@ export default class NetworkInventoryUtil {
|
|
|
138
239
|
const interfaceData: Record<string, unknown> = {
|
|
139
240
|
name: (walked.name || "").substring(0, 100),
|
|
140
241
|
alias: walked.alias ? walked.alias.substring(0, 100) : null,
|
|
242
|
+
macAddress: walked.macAddress
|
|
243
|
+
? walked.macAddress.substring(0, 100)
|
|
244
|
+
: null,
|
|
245
|
+
interfaceType: walked.interfaceType ?? null,
|
|
141
246
|
isOperationallyUp: walked.isOperationallyUp,
|
|
142
247
|
isAdministrativelyUp: walked.isAdministrativelyUp,
|
|
143
248
|
speedInMbps:
|
|
@@ -174,6 +279,12 @@ export default class NetworkInventoryUtil {
|
|
|
174
279
|
if (walked.alias) {
|
|
175
280
|
newInterface.alias = walked.alias.substring(0, 100);
|
|
176
281
|
}
|
|
282
|
+
if (walked.macAddress) {
|
|
283
|
+
newInterface.macAddress = walked.macAddress.substring(0, 100);
|
|
284
|
+
}
|
|
285
|
+
if (walked.interfaceType !== undefined) {
|
|
286
|
+
newInterface.interfaceType = walked.interfaceType;
|
|
287
|
+
}
|
|
177
288
|
newInterface.isMonitored = true;
|
|
178
289
|
newInterface.isOperationallyUp = walked.isOperationallyUp;
|
|
179
290
|
newInterface.isAdministrativelyUp = walked.isAdministrativelyUp;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { AnalyticsHost, AnalyticsKey } from "../EnvironmentConfig";
|
|
2
|
+
import UserService from "../Services/UserService";
|
|
3
|
+
import HTTPErrorResponse from "../../Types/API/HTTPErrorResponse";
|
|
4
|
+
import HTTPResponse from "../../Types/API/HTTPResponse";
|
|
5
|
+
import URL from "../../Types/API/URL";
|
|
6
|
+
import { JSONObject } from "../../Types/JSON";
|
|
7
|
+
import ObjectID from "../../Types/ObjectID";
|
|
8
|
+
import User from "../../Models/DatabaseModels/User";
|
|
9
|
+
import API from "../../Utils/API";
|
|
10
|
+
import logger from "./Logger";
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Server-side product analytics (PostHog).
|
|
14
|
+
*
|
|
15
|
+
* Client-side events are lost to ad blockers — common with OneUptime's
|
|
16
|
+
* developer audience — so revenue and activation events are also captured
|
|
17
|
+
* here, where they cannot be blocked.
|
|
18
|
+
*
|
|
19
|
+
* Events are identified by the user's email (the same distinct id the
|
|
20
|
+
* frontends use via posthog.identify) so server and client events join into
|
|
21
|
+
* one person profile.
|
|
22
|
+
*
|
|
23
|
+
* No-ops when ANALYTICS_KEY / ANALYTICS_HOST are not configured (the default
|
|
24
|
+
* for self-hosted installs). Never throws — analytics must not break the
|
|
25
|
+
* product.
|
|
26
|
+
*/
|
|
27
|
+
export default class ProductAnalytics {
|
|
28
|
+
public static isConfigured(): boolean {
|
|
29
|
+
return Boolean(AnalyticsKey && AnalyticsHost);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public static capture(data: {
|
|
33
|
+
event: string;
|
|
34
|
+
distinctId: string;
|
|
35
|
+
properties?: JSONObject | undefined;
|
|
36
|
+
}): void {
|
|
37
|
+
try {
|
|
38
|
+
if (!this.isConfigured()) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (!data.distinctId) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
API.post<JSONObject>({
|
|
47
|
+
url: URL.fromString(AnalyticsHost.toString()).addRoute("/capture/"),
|
|
48
|
+
data: {
|
|
49
|
+
api_key: AnalyticsKey,
|
|
50
|
+
event: data.event,
|
|
51
|
+
distinct_id: data.distinctId,
|
|
52
|
+
properties: {
|
|
53
|
+
source: "oneuptime-server",
|
|
54
|
+
...(data.properties || {}),
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
})
|
|
58
|
+
.then((result: HTTPResponse<JSONObject> | HTTPErrorResponse) => {
|
|
59
|
+
/*
|
|
60
|
+
* API.post resolves (does not reject) on HTTP error statuses, so a
|
|
61
|
+
* misconfigured ANALYTICS_KEY (401) or malformed body (400) must be
|
|
62
|
+
* surfaced here or events vanish with no log signal.
|
|
63
|
+
*/
|
|
64
|
+
if (result instanceof HTTPErrorResponse) {
|
|
65
|
+
logger.error(
|
|
66
|
+
`ProductAnalytics capture failed for event ${data.event}: HTTP ${result.statusCode} ${result.message}`,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
.catch((err: Error) => {
|
|
71
|
+
logger.error("ProductAnalytics capture failed:");
|
|
72
|
+
logger.error(err);
|
|
73
|
+
});
|
|
74
|
+
} catch (err) {
|
|
75
|
+
/*
|
|
76
|
+
* e.g. URL.fromString throws on a malformed ANALYTICS_HOST. Analytics
|
|
77
|
+
* runs inside request-path hooks (signup, project create, plan change)
|
|
78
|
+
* and must never fail those requests.
|
|
79
|
+
*/
|
|
80
|
+
logger.error("ProductAnalytics capture failed:");
|
|
81
|
+
logger.error(err as Error);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/*
|
|
86
|
+
* Capture an event attributed to a user by id, resolving the user's email
|
|
87
|
+
* to use as the distinct id. Skips silently when the user cannot be
|
|
88
|
+
* resolved (e.g. records created by probes, workflows or API keys).
|
|
89
|
+
*/
|
|
90
|
+
public static captureForUser(data: {
|
|
91
|
+
userId: ObjectID | undefined | null;
|
|
92
|
+
event: string;
|
|
93
|
+
properties?: JSONObject | undefined;
|
|
94
|
+
}): void {
|
|
95
|
+
try {
|
|
96
|
+
if (!this.isConfigured()) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (!data.userId) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
UserService.findOneById({
|
|
105
|
+
id: data.userId,
|
|
106
|
+
select: {
|
|
107
|
+
email: true,
|
|
108
|
+
},
|
|
109
|
+
props: {
|
|
110
|
+
isRoot: true,
|
|
111
|
+
},
|
|
112
|
+
})
|
|
113
|
+
.then((user: User | null) => {
|
|
114
|
+
if (!user || !user.email) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
this.capture({
|
|
119
|
+
event: data.event,
|
|
120
|
+
distinctId: user.email.toString(),
|
|
121
|
+
properties: data.properties,
|
|
122
|
+
});
|
|
123
|
+
})
|
|
124
|
+
.catch((err: Error) => {
|
|
125
|
+
logger.error("ProductAnalytics captureForUser failed:");
|
|
126
|
+
logger.error(err);
|
|
127
|
+
});
|
|
128
|
+
} catch (err) {
|
|
129
|
+
logger.error("ProductAnalytics captureForUser failed:");
|
|
130
|
+
logger.error(err as Error);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -26,6 +26,8 @@ export default class TelemetryUtil {
|
|
|
26
26
|
name: true,
|
|
27
27
|
description: true,
|
|
28
28
|
unit: true,
|
|
29
|
+
isMonotonic: true,
|
|
30
|
+
aggregationTemporality: true,
|
|
29
31
|
},
|
|
30
32
|
props: {
|
|
31
33
|
isRoot: true,
|
|
@@ -66,6 +68,30 @@ export default class TelemetryUtil {
|
|
|
66
68
|
metricType.unit = metricTypeInMap.unit || "";
|
|
67
69
|
}
|
|
68
70
|
|
|
71
|
+
/*
|
|
72
|
+
* Counter semantics (isMonotonic / aggregationTemporality) are only
|
|
73
|
+
* known on OTel metric ingest paths — other callers (monitor
|
|
74
|
+
* metrics, heartbeat metrics) never set them, so an undefined
|
|
75
|
+
* incoming value means "unknown", not "clear the stored value".
|
|
76
|
+
*/
|
|
77
|
+
if (
|
|
78
|
+
metricTypeInMap.isMonotonic !== undefined &&
|
|
79
|
+
metricType.isMonotonic !== metricTypeInMap.isMonotonic
|
|
80
|
+
) {
|
|
81
|
+
isSame = false;
|
|
82
|
+
metricType.isMonotonic = metricTypeInMap.isMonotonic;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (
|
|
86
|
+
metricTypeInMap.aggregationTemporality !== undefined &&
|
|
87
|
+
metricType.aggregationTemporality !==
|
|
88
|
+
metricTypeInMap.aggregationTemporality
|
|
89
|
+
) {
|
|
90
|
+
isSame = false;
|
|
91
|
+
metricType.aggregationTemporality =
|
|
92
|
+
metricTypeInMap.aggregationTemporality;
|
|
93
|
+
}
|
|
94
|
+
|
|
69
95
|
// check if services are same
|
|
70
96
|
|
|
71
97
|
for (const serviceId of servicesInMap) {
|
|
@@ -92,6 +118,12 @@ export default class TelemetryUtil {
|
|
|
92
118
|
services: metricType.services || [],
|
|
93
119
|
description: metricTypeInMap.description || "",
|
|
94
120
|
unit: metricTypeInMap.unit || "",
|
|
121
|
+
...(metricType.isMonotonic !== undefined
|
|
122
|
+
? { isMonotonic: metricType.isMonotonic }
|
|
123
|
+
: {}),
|
|
124
|
+
...(metricType.aggregationTemporality !== undefined
|
|
125
|
+
? { aggregationTemporality: metricType.aggregationTemporality }
|
|
126
|
+
: {}),
|
|
95
127
|
},
|
|
96
128
|
props: {
|
|
97
129
|
isRoot: true,
|
|
@@ -104,6 +136,13 @@ export default class TelemetryUtil {
|
|
|
104
136
|
metricType.name = metricName;
|
|
105
137
|
metricType.description = metricTypeInMap.description || "";
|
|
106
138
|
metricType.unit = metricTypeInMap.unit || "";
|
|
139
|
+
if (metricTypeInMap.isMonotonic !== undefined) {
|
|
140
|
+
metricType.isMonotonic = metricTypeInMap.isMonotonic;
|
|
141
|
+
}
|
|
142
|
+
if (metricTypeInMap.aggregationTemporality !== undefined) {
|
|
143
|
+
metricType.aggregationTemporality =
|
|
144
|
+
metricTypeInMap.aggregationTemporality;
|
|
145
|
+
}
|
|
107
146
|
metricType.projectId = data.projectId;
|
|
108
147
|
metricType.services = [];
|
|
109
148
|
|
|
@@ -888,3 +888,24 @@ export default class TelemetryEntity {
|
|
|
888
888
|
return out;
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* `container.id` is the container identity (mirrors the container
|
|
894
|
+
* resolver above — id-only). Read-side helper in the mold of
|
|
895
|
+
* `EntityKey.keyForHost` & co.; it lives here rather than in the
|
|
896
|
+
* isomorphic EntityKey module because its only consumer today is the
|
|
897
|
+
* server-side container metric-rollup read path
|
|
898
|
+
* (`MetricService.tryBuildEntityAggregateMVStatement` against
|
|
899
|
+
* `MetricItemAggMV1mByContainer`), so there is no reason to widen the
|
|
900
|
+
* browser bundle. Pass the raw `container.id` attribute value.
|
|
901
|
+
*/
|
|
902
|
+
export function keyForContainer(
|
|
903
|
+
projectId: string,
|
|
904
|
+
containerId: string,
|
|
905
|
+
): string {
|
|
906
|
+
return computeEntityKeyShared({
|
|
907
|
+
projectId,
|
|
908
|
+
entityType: EntityType.Container,
|
|
909
|
+
identifyingAttributes: { "container.id": containerId },
|
|
910
|
+
});
|
|
911
|
+
}
|