@oneuptime/common 11.6.1 → 11.7.0
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 +4 -0
- package/Models/AnalyticsModels/KubernetesCostAllocation.ts +842 -0
- package/Models/AnalyticsModels/NetworkFlow.ts +54 -0
- package/Models/AnalyticsModels/SloHistory.ts +243 -0
- package/Models/DatabaseModels/Index.ts +20 -0
- package/Models/DatabaseModels/NetworkDevice.ts +453 -6
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +7 -6
- package/Models/DatabaseModels/NetworkEndpoint.ts +753 -0
- package/Models/DatabaseModels/NetworkSite.ts +1155 -0
- package/Models/DatabaseModels/NetworkSiteAssignmentRule.ts +517 -0
- package/Models/DatabaseModels/NetworkSiteLink.ts +611 -0
- package/Models/DatabaseModels/NetworkSiteStatusTimeline.ts +520 -0
- package/Models/DatabaseModels/NetworkSiteType.ts +499 -0
- package/Models/DatabaseModels/ServiceLevelObjective.ts +1115 -0
- package/Models/DatabaseModels/ServiceLevelObjectiveBurnRateRule.ts +762 -0
- package/Models/DatabaseModels/ServiceLevelObjectiveOwnerTeam.ts +444 -0
- package/Models/DatabaseModels/ServiceLevelObjectiveOwnerUser.ts +443 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784757142154-AddNetworkSiteHierarchyAndEndpoints.ts +359 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784897317860-AddNetworkSiteAlerting.ts +48 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784970388777-AddNetworkDevicePollingColumns.ts +65 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784986826214-AddNetworkSiteTypeTable.ts +88 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784987015619-AddServiceLevelObjective.ts +391 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785066759532-MigrationName.ts +30 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +12 -0
- package/Server/Services/AnalyticsDatabaseService.ts +25 -9
- package/Server/Services/Index.ts +24 -0
- package/Server/Services/KubernetesCostAllocationService.ts +14 -0
- package/Server/Services/MetricService.ts +21 -2
- package/Server/Services/MonitorService.ts +22 -0
- package/Server/Services/NetworkDeviceService.ts +438 -2
- package/Server/Services/NetworkEndpointService.ts +414 -0
- package/Server/Services/NetworkSiteAssignmentRuleService.ts +98 -0
- package/Server/Services/NetworkSiteLinkService.ts +10 -0
- package/Server/Services/NetworkSiteService.ts +1254 -0
- package/Server/Services/NetworkSiteStatusTimelineService.ts +10 -0
- package/Server/Services/NetworkSiteTypeService.ts +10 -0
- package/Server/Services/ProjectService.ts +122 -2
- package/Server/Services/ServiceLevelObjectiveBurnRateRuleService.ts +457 -0
- package/Server/Services/ServiceLevelObjectiveOwnerTeamService.ts +10 -0
- package/Server/Services/ServiceLevelObjectiveOwnerUserService.ts +10 -0
- package/Server/Services/ServiceLevelObjectiveService.ts +685 -0
- package/Server/Services/SloHistoryService.ts +101 -0
- package/Server/Services/UserNotificationSettingService.ts +37 -0
- package/Server/Types/AnalyticsDatabase/AggregateBy.ts +9 -0
- package/Server/Types/Database/Permissions/OwnerTableRegistry.ts +15 -0
- package/Server/Utils/AnalyticsDatabase/Statement.ts +39 -3
- package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +87 -48
- package/Server/Utils/Memory.ts +9 -1
- package/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.ts +190 -12
- package/Server/Utils/Monitor/Data/OuiVendors.json +6920 -0
- package/Server/Utils/Monitor/DnsResolutionCache.ts +129 -0
- package/Server/Utils/Monitor/MonitorResource.ts +4 -30
- package/Server/Utils/Monitor/NetworkDeviceHydrationUtil.ts +214 -39
- package/Server/Utils/Monitor/NetworkDeviceMetricUtil.ts +343 -0
- package/Server/Utils/Monitor/NetworkDeviceWalkUtil.ts +251 -0
- package/Server/Utils/Monitor/NetworkInventoryUtil.ts +176 -142
- package/Server/Utils/Monitor/OuiLookupUtil.ts +49 -0
- package/Server/Utils/Monitor/SnmpInterfaceRateUtil.ts +17 -13
- package/Server/Utils/WhatsAppTemplateUtil.ts +7 -3
- package/Tests/Models/AnalyticsModels/KubernetesCostAllocation.test.ts +135 -0
- package/Tests/Models/NetworkSiteHierarchy.test.ts +134 -0
- package/Tests/Server/Services/AnalyticsDatabaseService.test.ts +239 -0
- package/Tests/Server/Services/KubernetesCostAllocationAggregate.test.ts +338 -0
- package/Tests/Server/Services/MetricServiceAggregate.test.ts +142 -0
- package/Tests/Server/Services/NetworkDeviceSiteAssignment.test.ts +484 -0
- package/Tests/Server/Services/NetworkEndpointServiceUpsert.test.ts +686 -0
- package/Tests/Server/Services/NetworkSiteAssignmentRuleService.test.ts +185 -0
- package/Tests/Server/Services/NetworkSiteService.test.ts +1354 -0
- package/Tests/Server/Services/ServiceLevelObjectiveBurnRateRuleService.test.ts +1313 -0
- package/Tests/Server/Services/ServiceLevelObjectiveService.test.ts +1988 -0
- package/Tests/Server/Utils/AnalyticsDatabase/Statement.test.ts +22 -0
- package/Tests/Server/Utils/AnalyticsDatabase/StatementGenerator.test.ts +404 -0
- package/Tests/Server/Utils/Encryption.test.ts +70 -0
- package/Tests/Server/Utils/FileAttachmentMarkdownUtil.test.ts +225 -0
- package/Tests/Server/Utils/JsonWebToken.test.ts +175 -0
- package/Tests/Server/Utils/LocalFile.test.ts +258 -0
- package/Tests/Server/Utils/Memory.test.ts +213 -0
- package/Tests/Server/Utils/Monitor/Criteria/LogMonitorCriteria.test.ts +30 -0
- package/Tests/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.test.ts +385 -0
- package/Tests/Server/Utils/Monitor/DnsResolutionCache.test.ts +194 -0
- package/Tests/Server/Utils/Monitor/NetworkDeviceHydrationUtil.test.ts +155 -0
- package/Tests/Server/Utils/Monitor/NetworkDeviceWalkUtil.test.ts +600 -0
- package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +151 -124
- package/Tests/Server/Utils/Monitor/SnmpInterfaceRateUtil.test.ts +496 -0
- package/Tests/Server/Utils/MonitorCriteriaDataExtractor.test.ts +175 -0
- package/Tests/Server/Utils/MonitorCriteriaMessageFormatter.test.ts +282 -0
- package/Tests/Server/Utils/OuiLookupUtil.test.ts +59 -0
- package/Tests/Server/Utils/SeriesResourceLabels.test.ts +117 -0
- package/Tests/Server/Utils/StackTraceParser.test.ts +370 -0
- package/Tests/Server/Utils/Stream.test.ts +87 -0
- package/Tests/Server/Utils/ValidateGlobalProviderProjectTeams.test.ts +221 -0
- package/Tests/Server/Utils/WhatsAppTemplateUtil.test.ts +199 -0
- package/Tests/Types/Database/CompareOperatorWireSerialization.test.ts +33 -0
- package/Tests/Types/Email.test.ts +198 -0
- package/Tests/Types/Kubernetes/KubernetesObjectParser.test.ts +177 -0
- package/Tests/Types/Log/LogQueryToFilter.test.ts +111 -0
- package/Tests/Types/Monitor/MonitorCriteria.test.ts +155 -0
- package/Tests/Types/Monitor/MonitorCriteriaInstance.test.ts +465 -0
- package/Tests/Types/Monitor/MonitorStep.test.ts +183 -0
- package/Tests/Types/Monitor/MonitorStepNetworkDeviceMonitor.test.ts +141 -1
- package/Tests/Types/Monitor/MonitorSteps.test.ts +183 -0
- package/Tests/Types/Monitor/MonitorType.test.ts +59 -1
- package/Tests/Types/Monitor/NetworkDeviceAlertPack.test.ts +97 -0
- package/Tests/Types/Monitor/SnmpEndpointDiscovery.test.ts +151 -0
- package/Tests/Types/Monitor/SnmpVendorTemplate.test.ts +110 -6
- package/Tests/Types/NetworkSite/DefaultNetworkSiteType.test.ts +129 -0
- package/Tests/Types/SerializableObjectDictionary.test.ts +166 -0
- package/Tests/Types/Time/RangeStartAndEndDateTime.test.ts +98 -0
- package/Tests/Types/WebsiteRequest.test.ts +230 -0
- package/Tests/UI/Components/EntityFilterRoundTrip.test.tsx +103 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableUrlState.test.tsx +612 -0
- package/Tests/UI/Components/ModelTable/FilterDataToQuery.test.ts +275 -0
- package/Tests/UI/Utils/LogExport.test.ts +159 -0
- package/Tests/UI/Utils/Navigation.test.ts +183 -0
- package/Tests/UI/Utils/TableFilterUrlState.test.ts +539 -0
- package/Tests/UI/Utils/TableViewUrlState.test.ts +272 -0
- package/Tests/Utils/Base64.test.ts +51 -0
- package/Tests/Utils/Boolean.test.ts +76 -0
- package/Tests/Utils/Crypto.test.ts +48 -0
- package/Tests/Utils/Dashboard/DashboardSloComponent.test.ts +259 -0
- package/Tests/Utils/Dashboard/ModelQueryVariableInterpolation.test.ts +162 -0
- package/Tests/Utils/Enum.test.ts +54 -0
- package/Tests/Utils/IpCanonicalUtil.test.ts +85 -0
- package/Tests/Utils/Memory.test.ts +44 -0
- package/Tests/Utils/Metrics/MetricSeriesFingerprint.test.ts +160 -0
- package/Tests/Utils/Monitor/EndpointAttachmentUtil.test.ts +836 -0
- package/Tests/Utils/Monitor/MonitorMetricType.test.ts +218 -0
- package/Tests/Utils/Monitor/NetworkTopologyUtil.test.ts +447 -0
- package/Tests/Utils/NetworkSite/CidrMatchUtil.test.ts +440 -0
- package/Tests/Utils/NetworkSite/MaterializedPathUtil.test.ts +205 -0
- package/Tests/Utils/NetworkSite/SiteStatusRollupUtil.test.ts +221 -0
- package/Tests/Utils/NetworkSite/SiteUptimeUtil.test.ts +283 -0
- package/Tests/Utils/ObjectUtil.test.ts +30 -0
- package/Tests/Utils/Slo/SloBurnRateRuleState.test.ts +124 -0
- package/Tests/Utils/Slo/SloDuration.test.ts +148 -0
- package/Tests/Utils/Slo/SloHealth.test.ts +334 -0
- package/Tests/Utils/Slo/SloStatusColor.test.ts +89 -0
- package/Tests/Utils/Slo/SloUtil.test.ts +1980 -0
- package/Tests/Utils/Slo/SloWidgetFormat.test.ts +605 -0
- package/Tests/Utils/TechStack.test.ts +50 -0
- package/Tests/Utils/Traces/CriticalPath.test.ts +178 -0
- package/Types/AnalyticsDatabase/AnalyticsTableName.ts +10 -0
- package/Types/BaseDatabase/EqualTo.ts +9 -1
- package/Types/BaseDatabase/EqualToOrNull.ts +9 -1
- package/Types/BaseDatabase/NotEqual.ts +9 -1
- package/Types/Dashboard/DashboardComponentType.ts +1 -0
- package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +1 -0
- package/Types/Dashboard/DashboardComponents/DashboardSloComponent.ts +42 -0
- package/Types/Dashboard/DashboardTemplates.ts +214 -0
- package/Types/Email/EmailTemplateType.ts +2 -0
- package/Types/Kubernetes/KubernetesCostIngest.ts +79 -0
- package/Types/Monitor/CriteriaFilter.ts +9 -0
- package/Types/Monitor/MonitorStep.ts +5 -8
- package/Types/Monitor/MonitorStepNetworkDeviceMonitor.ts +27 -5
- package/Types/Monitor/MonitorType.ts +15 -5
- package/Types/Monitor/SnmpMonitor/ArpEntry.ts +14 -0
- package/Types/Monitor/SnmpMonitor/FdbEntry.ts +18 -0
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.ts +10 -3
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +31 -5
- package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.ts +12 -0
- package/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.ts +231 -3
- package/Types/NetworkSite/DefaultNetworkSiteType.ts +20 -0
- package/Types/NotificationSetting/NotificationSettingEventType.ts +4 -0
- package/Types/Permission.ts +449 -0
- package/Types/ServiceLevelObjective/SliType.ts +6 -0
- package/Types/ServiceLevelObjective/SloMultiMonitorMode.ts +6 -0
- package/Types/ServiceLevelObjective/SloStatus.ts +9 -0
- package/Types/ServiceLevelObjective/SloWindowType.ts +6 -0
- package/Types/Telemetry/ServiceType.ts +1 -0
- package/UI/Components/Filters/EntityFilter.tsx +16 -0
- package/UI/Components/Filters/FilterViewer.tsx +22 -5
- package/UI/Components/List/List.tsx +8 -0
- package/UI/Components/ModelTable/BaseModelTable.tsx +309 -106
- package/UI/Components/ModelTable/FilterDataToQuery.ts +172 -0
- package/UI/Components/Navbar/NavBar.tsx +16 -2
- package/UI/Components/Navbar/NavBarMenuModal.tsx +3 -3
- package/UI/Utils/Navigation.ts +10 -0
- package/UI/Utils/TableFilterUrlState.ts +204 -17
- package/UI/Utils/TableViewUrlState.ts +165 -0
- package/Utils/Dashboard/Components/DashboardSloComponent.ts +114 -0
- package/Utils/Dashboard/Components/Index.ts +7 -0
- package/Utils/IpCanonicalUtil.ts +134 -0
- package/Utils/Monitor/EndpointAttachmentUtil.ts +508 -0
- package/Utils/Monitor/NetworkTopologyUtil.ts +157 -5
- package/Utils/NetworkSite/CidrMatchUtil.ts +296 -0
- package/Utils/NetworkSite/MaterializedPathUtil.ts +115 -0
- package/Utils/NetworkSite/SiteStatusRollupUtil.ts +97 -0
- package/Utils/NetworkSite/SiteUptimeUtil.ts +111 -0
- package/Utils/Slo/SloBurnRateRuleState.ts +91 -0
- package/Utils/Slo/SloDuration.ts +165 -0
- package/Utils/Slo/SloEvaluation.ts +22 -0
- package/Utils/Slo/SloHealth.ts +302 -0
- package/Utils/Slo/SloStatusColor.ts +54 -0
- package/Utils/Slo/SloUtil.ts +637 -0
- package/Utils/Slo/SloWidgetFormat.ts +383 -0
- package/build/dist/Models/AnalyticsModels/Index.js +4 -0
- package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js +713 -0
- package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/NetworkFlow.js +44 -0
- package/build/dist/Models/AnalyticsModels/NetworkFlow.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/SloHistory.js +218 -0
- package/build/dist/Models/AnalyticsModels/SloHistory.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Index.js +20 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +458 -6
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +0 -6
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkEndpoint.js +779 -0
- package/build/dist/Models/DatabaseModels/NetworkEndpoint.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkSite.js +1180 -0
- package/build/dist/Models/DatabaseModels/NetworkSite.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteAssignmentRule.js +534 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteAssignmentRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteLink.js +629 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteLink.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteStatusTimeline.js +538 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteStatusTimeline.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteType.js +522 -0
- package/build/dist/Models/DatabaseModels/NetworkSiteType.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjective.js +1134 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjective.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveBurnRateRule.js +769 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveBurnRateRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveOwnerTeam.js +460 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveOwnerTeam.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveOwnerUser.js +459 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveOwnerUser.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784757142154-AddNetworkSiteHierarchyAndEndpoints.js +130 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784757142154-AddNetworkSiteHierarchyAndEndpoints.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784897317860-AddNetworkSiteAlerting.js +31 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784897317860-AddNetworkSiteAlerting.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784970388777-AddNetworkDevicePollingColumns.js +36 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784970388777-AddNetworkDevicePollingColumns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784986826214-AddNetworkSiteTypeTable.js +49 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784986826214-AddNetworkSiteTypeTable.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784987015619-AddServiceLevelObjective.js +140 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784987015619-AddServiceLevelObjective.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785066759532-MigrationName.js +21 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785066759532-MigrationName.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 +23 -6
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +24 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/KubernetesCostAllocationService.js +12 -0
- package/build/dist/Server/Services/KubernetesCostAllocationService.js.map +1 -0
- package/build/dist/Server/Services/MetricService.js +21 -3
- package/build/dist/Server/Services/MetricService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +19 -0
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceService.js +351 -1
- package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
- package/build/dist/Server/Services/NetworkEndpointService.js +319 -0
- package/build/dist/Server/Services/NetworkEndpointService.js.map +1 -0
- package/build/dist/Server/Services/NetworkSiteAssignmentRuleService.js +90 -0
- package/build/dist/Server/Services/NetworkSiteAssignmentRuleService.js.map +1 -0
- package/build/dist/Server/Services/NetworkSiteLinkService.js +9 -0
- package/build/dist/Server/Services/NetworkSiteLinkService.js.map +1 -0
- package/build/dist/Server/Services/NetworkSiteService.js +1038 -0
- package/build/dist/Server/Services/NetworkSiteService.js.map +1 -0
- package/build/dist/Server/Services/NetworkSiteStatusTimelineService.js +9 -0
- package/build/dist/Server/Services/NetworkSiteStatusTimelineService.js.map +1 -0
- package/build/dist/Server/Services/NetworkSiteTypeService.js +9 -0
- package/build/dist/Server/Services/NetworkSiteTypeService.js.map +1 -0
- package/build/dist/Server/Services/ProjectService.js +98 -2
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/ServiceLevelObjectiveBurnRateRuleService.js +358 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveBurnRateRuleService.js.map +1 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveOwnerTeamService.js +9 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveOwnerTeamService.js.map +1 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveOwnerUserService.js +9 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveOwnerUserService.js.map +1 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveService.js +588 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveService.js.map +1 -0
- package/build/dist/Server/Services/SloHistoryService.js +77 -0
- package/build/dist/Server/Services/SloHistoryService.js.map +1 -0
- package/build/dist/Server/Services/UserNotificationSettingService.js +20 -0
- package/build/dist/Server/Services/UserNotificationSettingService.js.map +1 -1
- package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js +9 -0
- package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js +15 -0
- package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/Statement.js +31 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/Statement.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +76 -48
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
- package/build/dist/Server/Utils/Memory.js +9 -1
- package/build/dist/Server/Utils/Memory.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js +132 -10
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Data/OuiVendors.json +6920 -0
- package/build/dist/Server/Utils/Monitor/DnsResolutionCache.js +77 -0
- package/build/dist/Server/Utils/Monitor/DnsResolutionCache.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorResource.js +21 -41
- package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js +152 -40
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceMetricUtil.js +262 -0
- package/build/dist/Server/Utils/Monitor/NetworkDeviceMetricUtil.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js +201 -0
- package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +152 -120
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/OuiLookupUtil.js +44 -0
- package/build/dist/Server/Utils/Monitor/OuiLookupUtil.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/SnmpInterfaceRateUtil.js +10 -10
- package/build/dist/Server/Utils/Monitor/SnmpInterfaceRateUtil.js.map +1 -1
- package/build/dist/Server/Utils/WhatsAppTemplateUtil.js +5 -0
- package/build/dist/Server/Utils/WhatsAppTemplateUtil.js.map +1 -1
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +10 -0
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
- package/build/dist/Types/BaseDatabase/EqualTo.js +9 -1
- package/build/dist/Types/BaseDatabase/EqualTo.js.map +1 -1
- package/build/dist/Types/BaseDatabase/EqualToOrNull.js +9 -1
- package/build/dist/Types/BaseDatabase/EqualToOrNull.js.map +1 -1
- package/build/dist/Types/BaseDatabase/NotEqual.js +9 -1
- package/build/dist/Types/BaseDatabase/NotEqual.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponentType.js +1 -0
- package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardSloComponent.js +23 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardSloComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardTemplates.js +205 -0
- package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
- package/build/dist/Types/Email/EmailTemplateType.js +1 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/Kubernetes/KubernetesCostIngest.js +21 -0
- package/build/dist/Types/Kubernetes/KubernetesCostIngest.js.map +1 -0
- package/build/dist/Types/Monitor/CriteriaFilter.js +1 -0
- package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +5 -5
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepNetworkDeviceMonitor.js +8 -0
- package/build/dist/Types/Monitor/MonitorStepNetworkDeviceMonitor.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorType.js +15 -5
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/ArpEntry.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/ArpEntry.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/FdbEntry.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/FdbEntry.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +9 -3
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js +217 -3
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js.map +1 -1
- package/build/dist/Types/NetworkSite/DefaultNetworkSiteType.js +21 -0
- package/build/dist/Types/NetworkSite/DefaultNetworkSiteType.js.map +1 -0
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js +3 -0
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js.map +1 -1
- package/build/dist/Types/Permission.js +409 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/ServiceLevelObjective/SliType.js +7 -0
- package/build/dist/Types/ServiceLevelObjective/SliType.js.map +1 -0
- package/build/dist/Types/ServiceLevelObjective/SloMultiMonitorMode.js +7 -0
- package/build/dist/Types/ServiceLevelObjective/SloMultiMonitorMode.js.map +1 -0
- package/build/dist/Types/ServiceLevelObjective/SloStatus.js +10 -0
- package/build/dist/Types/ServiceLevelObjective/SloStatus.js.map +1 -0
- package/build/dist/Types/ServiceLevelObjective/SloWindowType.js +7 -0
- package/build/dist/Types/ServiceLevelObjective/SloWindowType.js.map +1 -0
- package/build/dist/Types/Telemetry/ServiceType.js +1 -0
- package/build/dist/Types/Telemetry/ServiceType.js.map +1 -1
- package/build/dist/UI/Components/Filters/EntityFilter.js +15 -0
- package/build/dist/UI/Components/Filters/EntityFilter.js.map +1 -1
- package/build/dist/UI/Components/Filters/FilterViewer.js +19 -4
- package/build/dist/UI/Components/Filters/FilterViewer.js.map +1 -1
- package/build/dist/UI/Components/List/List.js +1 -1
- package/build/dist/UI/Components/List/List.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +235 -89
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/FilterDataToQuery.js +96 -0
- package/build/dist/UI/Components/ModelTable/FilterDataToQuery.js.map +1 -0
- package/build/dist/UI/Components/Navbar/NavBar.js +14 -2
- package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +3 -2
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
- package/build/dist/UI/Utils/Navigation.js +9 -0
- package/build/dist/UI/Utils/Navigation.js.map +1 -1
- package/build/dist/UI/Utils/TableFilterUrlState.js +159 -15
- package/build/dist/UI/Utils/TableFilterUrlState.js.map +1 -1
- package/build/dist/UI/Utils/TableViewUrlState.js +103 -0
- package/build/dist/UI/Utils/TableViewUrlState.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardSloComponent.js +93 -0
- package/build/dist/Utils/Dashboard/Components/DashboardSloComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/Index.js +4 -0
- package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
- package/build/dist/Utils/IpCanonicalUtil.js +110 -0
- package/build/dist/Utils/IpCanonicalUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/EndpointAttachmentUtil.js +311 -0
- package/build/dist/Utils/Monitor/EndpointAttachmentUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +98 -5
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
- package/build/dist/Utils/NetworkSite/CidrMatchUtil.js +222 -0
- package/build/dist/Utils/NetworkSite/CidrMatchUtil.js.map +1 -0
- package/build/dist/Utils/NetworkSite/MaterializedPathUtil.js +89 -0
- package/build/dist/Utils/NetworkSite/MaterializedPathUtil.js.map +1 -0
- package/build/dist/Utils/NetworkSite/SiteStatusRollupUtil.js +60 -0
- package/build/dist/Utils/NetworkSite/SiteStatusRollupUtil.js.map +1 -0
- package/build/dist/Utils/NetworkSite/SiteUptimeUtil.js +76 -0
- package/build/dist/Utils/NetworkSite/SiteUptimeUtil.js.map +1 -0
- package/build/dist/Utils/Slo/SloBurnRateRuleState.js +35 -0
- package/build/dist/Utils/Slo/SloBurnRateRuleState.js.map +1 -0
- package/build/dist/Utils/Slo/SloDuration.js +87 -0
- package/build/dist/Utils/Slo/SloDuration.js.map +1 -0
- package/build/dist/Utils/Slo/SloEvaluation.js +21 -0
- package/build/dist/Utils/Slo/SloEvaluation.js.map +1 -0
- package/build/dist/Utils/Slo/SloHealth.js +179 -0
- package/build/dist/Utils/Slo/SloHealth.js.map +1 -0
- package/build/dist/Utils/Slo/SloStatusColor.js +18 -0
- package/build/dist/Utils/Slo/SloStatusColor.js.map +1 -0
- package/build/dist/Utils/Slo/SloUtil.js +393 -0
- package/build/dist/Utils/Slo/SloUtil.js.map +1 -0
- package/build/dist/Utils/Slo/SloWidgetFormat.js +174 -0
- package/build/dist/Utils/Slo/SloWidgetFormat.js.map +1 -0
- package/package.json +2 -2
- package/Types/Dashboard/DashboardComponents/Index.ts +0 -7
- package/build/dist/Types/Dashboard/DashboardComponents/Index.js +0 -8
- package/build/dist/Types/Dashboard/DashboardComponents/Index.js.map +0 -1
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import SliType from "../../Types/ServiceLevelObjective/SliType";
|
|
2
|
+
import SloMultiMonitorMode from "../../Types/ServiceLevelObjective/SloMultiMonitorMode";
|
|
3
|
+
import SloStatus from "../../Types/ServiceLevelObjective/SloStatus";
|
|
4
|
+
import SloWindowType from "../../Types/ServiceLevelObjective/SloWindowType";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The "should I be worried, and about what?" layer of the SLO UI.
|
|
8
|
+
*
|
|
9
|
+
* Two things live here, both pure and both previously inlined (and
|
|
10
|
+
* subtly wrong) in the React pages:
|
|
11
|
+
*
|
|
12
|
+
* 1. The remaining-budget tier that drives every red/amber/green in the
|
|
13
|
+
* SLO surfaces. The pages hardcoded `remaining <= 20`, which silently
|
|
14
|
+
* disagreed with any SLO whose `atRiskThresholdPercentage` was not the
|
|
15
|
+
* default 20 — an SLO could render green while the worker had already
|
|
16
|
+
* moved it to At Risk.
|
|
17
|
+
*
|
|
18
|
+
* 2. The reason an SLO is not producing numbers. `Misconfigured` and
|
|
19
|
+
* `Paused` are the two statuses that mean "we are not measuring
|
|
20
|
+
* anything", and the pages showed them as a bare grey pill with no
|
|
21
|
+
* explanation and no way to act. The reasons here mirror exactly the
|
|
22
|
+
* guard clauses in the evaluation worker (EvaluateSlos.evaluateSlo).
|
|
23
|
+
*
|
|
24
|
+
* Kept free of React so both the SLO pages and the dashboard SLO widget
|
|
25
|
+
* can import it, and so every branch is unit-testable without a DOM.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/** The DB default for `ServiceLevelObjective.atRiskThresholdPercentage`. */
|
|
29
|
+
export const DEFAULT_AT_RISK_THRESHOLD_PERCENTAGE: number = 20;
|
|
30
|
+
|
|
31
|
+
/** The DB default for `ServiceLevelObjective.windowDays`. */
|
|
32
|
+
export const DEFAULT_ROLLING_WINDOW_DAYS: number = 30;
|
|
33
|
+
|
|
34
|
+
export enum SloBudgetTier {
|
|
35
|
+
/** The worker has not evaluated this SLO yet — assert nothing. */
|
|
36
|
+
Unknown = "Unknown",
|
|
37
|
+
Healthy = "Healthy",
|
|
38
|
+
AtRisk = "AtRisk",
|
|
39
|
+
Exhausted = "Exhausted",
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
type ToFiniteNumberFunction = (
|
|
43
|
+
value: number | undefined | null,
|
|
44
|
+
) => number | null;
|
|
45
|
+
|
|
46
|
+
const toFiniteNumber: ToFiniteNumberFunction = (
|
|
47
|
+
value: number | undefined | null,
|
|
48
|
+
): number | null => {
|
|
49
|
+
if (typeof value !== "number" || !isFinite(value)) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return value;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Tier from the SIGNED remaining-budget percentage, using the SLO's own
|
|
58
|
+
* at-risk threshold rather than a hardcoded 20.
|
|
59
|
+
*
|
|
60
|
+
* Boundaries match SloUtil.computeSloStatus (`<= 0` is exhausted, `<=
|
|
61
|
+
* threshold` is at risk) so the colour never contradicts the status pill
|
|
62
|
+
* the worker computed. The hysteresis SloUtil applies is deliberately NOT
|
|
63
|
+
* reproduced here: this function colours a number the user is looking at,
|
|
64
|
+
* and hysteresis depends on the previous status, which is not part of
|
|
65
|
+
* "what does this number mean".
|
|
66
|
+
*/
|
|
67
|
+
export type GetSloBudgetTierFunction = (data: {
|
|
68
|
+
errorBudgetRemainingPercentage: number | undefined | null;
|
|
69
|
+
atRiskThresholdPercentage?: number | undefined | null;
|
|
70
|
+
}) => SloBudgetTier;
|
|
71
|
+
|
|
72
|
+
export const getSloBudgetTier: GetSloBudgetTierFunction = (data: {
|
|
73
|
+
errorBudgetRemainingPercentage: number | undefined | null;
|
|
74
|
+
atRiskThresholdPercentage?: number | undefined | null;
|
|
75
|
+
}): SloBudgetTier => {
|
|
76
|
+
const remaining: number | null = toFiniteNumber(
|
|
77
|
+
data.errorBudgetRemainingPercentage,
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
if (remaining === null) {
|
|
81
|
+
return SloBudgetTier.Unknown;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (remaining <= 0) {
|
|
85
|
+
return SloBudgetTier.Exhausted;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const threshold: number =
|
|
89
|
+
toFiniteNumber(data.atRiskThresholdPercentage) ??
|
|
90
|
+
DEFAULT_AT_RISK_THRESHOLD_PERCENTAGE;
|
|
91
|
+
|
|
92
|
+
if (remaining <= threshold) {
|
|
93
|
+
return SloBudgetTier.AtRisk;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return SloBudgetTier.Healthy;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export enum SloNoticeType {
|
|
100
|
+
Info = "Info",
|
|
101
|
+
Warning = "Warning",
|
|
102
|
+
Danger = "Danger",
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface SloNotice {
|
|
106
|
+
type: SloNoticeType;
|
|
107
|
+
title: string;
|
|
108
|
+
/** One sentence of "here is what to do about it". */
|
|
109
|
+
body: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The fields a notice can be derived from. Declared structurally rather
|
|
114
|
+
* than importing the database model so this stays dependency-free and
|
|
115
|
+
* tests can pass plain objects.
|
|
116
|
+
*/
|
|
117
|
+
export interface SloNoticeData {
|
|
118
|
+
isEnabled?: boolean | undefined | null;
|
|
119
|
+
sloStatus?: SloStatus | undefined | null;
|
|
120
|
+
sliType?: SliType | undefined | null;
|
|
121
|
+
/** Number of monitors currently attached. */
|
|
122
|
+
monitorCount?: number | undefined | null;
|
|
123
|
+
/** Of the attached monitors, how many have active monitoring disabled. */
|
|
124
|
+
disabledMonitorCount?: number | undefined | null;
|
|
125
|
+
targetPercentage?: number | undefined | null;
|
|
126
|
+
lastEvaluatedAt?: Date | string | undefined | null;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The single most important thing to tell the user about this SLO right
|
|
131
|
+
* now, or null when the SLO is measuring normally.
|
|
132
|
+
*
|
|
133
|
+
* Ordered by how completely each condition stops the SLO from producing
|
|
134
|
+
* numbers, so the banner always names the root cause rather than a
|
|
135
|
+
* downstream symptom: a disabled SLO is not evaluated at all, so saying
|
|
136
|
+
* "no monitors attached" would send the user to fix the wrong thing.
|
|
137
|
+
*
|
|
138
|
+
* Every branch mirrors a guard in the evaluation worker
|
|
139
|
+
* (App/FeatureSet/Workers/Jobs/Slo/EvaluateSlos.ts):
|
|
140
|
+
* isEnabled=false -> the SLO is skipped entirely by getDueSlos()
|
|
141
|
+
* sliType != Uptime -> Misconfigured (Metric SLIs are not built yet)
|
|
142
|
+
* monitorCount == 0 -> Misconfigured
|
|
143
|
+
* target outside (0,100) -> Misconfigured
|
|
144
|
+
* all monitors disabled -> Paused
|
|
145
|
+
*/
|
|
146
|
+
export type GetSloNoticeFunction = (data: SloNoticeData) => SloNotice | null;
|
|
147
|
+
|
|
148
|
+
export const getSloNotice: GetSloNoticeFunction = (
|
|
149
|
+
data: SloNoticeData,
|
|
150
|
+
): SloNotice | null => {
|
|
151
|
+
if (data.isEnabled === false) {
|
|
152
|
+
return {
|
|
153
|
+
type: SloNoticeType.Info,
|
|
154
|
+
title: "This SLO is disabled",
|
|
155
|
+
body: "It is not being evaluated and its burn rate rules will not fire alerts. Turn Enabled back on in SLO Details to resume measuring.",
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const monitorCount: number = toFiniteNumber(data.monitorCount) ?? 0;
|
|
160
|
+
|
|
161
|
+
if (data.sloStatus === SloStatus.Misconfigured) {
|
|
162
|
+
if (data.sliType && data.sliType !== SliType.MonitorUptime) {
|
|
163
|
+
return {
|
|
164
|
+
type: SloNoticeType.Warning,
|
|
165
|
+
title: "This SLO cannot be evaluated",
|
|
166
|
+
body: `Only "${SliType.MonitorUptime}" SLIs are supported today. Change the SLI type to Monitor Uptime and attach the monitors this objective measures.`,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (monitorCount === 0) {
|
|
171
|
+
return {
|
|
172
|
+
type: SloNoticeType.Warning,
|
|
173
|
+
title: "No monitors attached",
|
|
174
|
+
body: "An SLO measures uptime from its monitors, so it cannot be evaluated without at least one. Add monitors in SLO Details below.",
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const target: number | null = toFiniteNumber(data.targetPercentage);
|
|
179
|
+
|
|
180
|
+
if (target === null || target <= 0 || target >= 100) {
|
|
181
|
+
return {
|
|
182
|
+
type: SloNoticeType.Warning,
|
|
183
|
+
title: "The target is out of range",
|
|
184
|
+
body: "A target must be greater than 0 and less than 100 — a 100% target leaves no error budget to track. Set a target such as 99.9 in SLO Details below.",
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return {
|
|
189
|
+
type: SloNoticeType.Warning,
|
|
190
|
+
title: "This SLO cannot be evaluated",
|
|
191
|
+
body: "Check that it has monitors attached and a target below 100%, then wait a few minutes for the next evaluation.",
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (data.sloStatus === SloStatus.Paused) {
|
|
196
|
+
return {
|
|
197
|
+
type: SloNoticeType.Info,
|
|
198
|
+
title: "Measurement is paused",
|
|
199
|
+
body: "Every monitor attached to this SLO has active monitoring disabled — by hand, by a manual incident, or by a scheduled maintenance event — so there is no signal to measure. The SLO resumes automatically when a monitor starts reporting again.",
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (!data.lastEvaluatedAt) {
|
|
204
|
+
return {
|
|
205
|
+
type: SloNoticeType.Info,
|
|
206
|
+
title: "Not evaluated yet",
|
|
207
|
+
body: "OneUptime evaluates SLOs every few minutes. The first numbers will appear shortly after this SLO is created.",
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return null;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* True when a rolling-window SLO is younger than its own window, so the
|
|
216
|
+
* budget it is measuring against is smaller than the full-window budget.
|
|
217
|
+
*
|
|
218
|
+
* The SLI denominator is clamped forward to the earliest monitor event
|
|
219
|
+
* (SloUtil.computeAnyDownSli), which means `errorBudgetTotalSeconds` for a
|
|
220
|
+
* young SLO is proportionally short — a 30-day SLO with a week of data
|
|
221
|
+
* carries a 7-day budget. Both the SLOs Overview and the Error Budgets
|
|
222
|
+
* doc promise the dashboard flags this as "window not yet full"; this is
|
|
223
|
+
* the detection behind that flag.
|
|
224
|
+
*
|
|
225
|
+
* Two cases are excluded on purpose:
|
|
226
|
+
*
|
|
227
|
+
* - Calendar-month windows: their budget is fixed at the FULL period from
|
|
228
|
+
* day one (never prorated), so the concept does not apply.
|
|
229
|
+
*
|
|
230
|
+
* - Monitor Seconds Average: its denominator is the SUM of monitored
|
|
231
|
+
* seconds ACROSS monitors (SloUtil.computeMonitorSecondsAverageSli), so
|
|
232
|
+
* `errorBudgetTotalSeconds` scales with the monitor count and cannot be
|
|
233
|
+
* compared against a single-window budget. A five-monitor SLO with a
|
|
234
|
+
* week of data would carry 35 monitor-days against a 30-day yardstick
|
|
235
|
+
* and read as mature. Rather than guess at a monitor count the caller
|
|
236
|
+
* may not have loaded, say nothing — a missing hint beats a wrong one.
|
|
237
|
+
*
|
|
238
|
+
* The 1% tolerance absorbs the gap between "now" and the worker's last
|
|
239
|
+
* evaluation — without it, a fully mature SLO would flicker the banner on
|
|
240
|
+
* every evaluation cycle.
|
|
241
|
+
*/
|
|
242
|
+
const WINDOW_FULL_TOLERANCE_FRACTION: number = 0.99;
|
|
243
|
+
|
|
244
|
+
export type IsRollingWindowNotYetFullFunction = (data: {
|
|
245
|
+
windowType?: SloWindowType | undefined | null;
|
|
246
|
+
windowDays?: number | undefined | null;
|
|
247
|
+
targetPercentage?: number | undefined | null;
|
|
248
|
+
errorBudgetTotalSeconds?: number | undefined | null;
|
|
249
|
+
multiMonitorMode?: SloMultiMonitorMode | undefined | null;
|
|
250
|
+
}) => boolean;
|
|
251
|
+
|
|
252
|
+
export const isRollingWindowNotYetFull: IsRollingWindowNotYetFullFunction =
|
|
253
|
+
(data: {
|
|
254
|
+
windowType?: SloWindowType | undefined | null;
|
|
255
|
+
windowDays?: number | undefined | null;
|
|
256
|
+
targetPercentage?: number | undefined | null;
|
|
257
|
+
errorBudgetTotalSeconds?: number | undefined | null;
|
|
258
|
+
multiMonitorMode?: SloMultiMonitorMode | undefined | null;
|
|
259
|
+
}): boolean => {
|
|
260
|
+
if (data.windowType === SloWindowType.CalendarMonth) {
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (data.multiMonitorMode === SloMultiMonitorMode.MonitorSecondsAverage) {
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const budgetTotalSeconds: number | null = toFiniteNumber(
|
|
269
|
+
data.errorBudgetTotalSeconds,
|
|
270
|
+
);
|
|
271
|
+
const target: number | null = toFiniteNumber(data.targetPercentage);
|
|
272
|
+
|
|
273
|
+
/*
|
|
274
|
+
* Not evaluated yet, or a target that would make the full-window budget
|
|
275
|
+
* meaningless: the "not evaluated" notice already covers the first case,
|
|
276
|
+
* and the Misconfigured notice covers the second.
|
|
277
|
+
*/
|
|
278
|
+
if (
|
|
279
|
+
budgetTotalSeconds === null ||
|
|
280
|
+
budgetTotalSeconds <= 0 ||
|
|
281
|
+
target === null ||
|
|
282
|
+
target <= 0 ||
|
|
283
|
+
target >= 100
|
|
284
|
+
) {
|
|
285
|
+
return false;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const windowDays: number =
|
|
289
|
+
toFiniteNumber(data.windowDays) ?? DEFAULT_ROLLING_WINDOW_DAYS;
|
|
290
|
+
|
|
291
|
+
if (windowDays <= 0) {
|
|
292
|
+
return false;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
const fullWindowBudgetSeconds: number =
|
|
296
|
+
(1 - target / 100) * windowDays * 24 * 60 * 60;
|
|
297
|
+
|
|
298
|
+
return (
|
|
299
|
+
budgetTotalSeconds <
|
|
300
|
+
fullWindowBudgetSeconds * WINDOW_FULL_TOLERANCE_FRACTION
|
|
301
|
+
);
|
|
302
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Gray500, Green, Red, Yellow } from "../../Types/BrandColors";
|
|
2
|
+
import Color from "../../Types/Color";
|
|
3
|
+
import SloStatus from "../../Types/ServiceLevelObjective/SloStatus";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The single source of truth for the SloStatus -> pill colour mapping.
|
|
7
|
+
*
|
|
8
|
+
* Healthy -> Green
|
|
9
|
+
* At Risk -> Yellow
|
|
10
|
+
* Budget Exhausted -> Red
|
|
11
|
+
* Misconfigured -> Gray (nothing to measure — not a reliability signal)
|
|
12
|
+
* Paused -> Gray (deliberately not being measured)
|
|
13
|
+
* unknown/unset -> Gray (the worker has not evaluated the SLO yet, so
|
|
14
|
+
* claiming any RAG colour would be a guess)
|
|
15
|
+
*
|
|
16
|
+
* Kept free of React so both the SLO pages and the dashboard SLO widget
|
|
17
|
+
* can import it, and so it is unit-testable without a DOM.
|
|
18
|
+
*/
|
|
19
|
+
export type GetSloStatusColorFunction = (
|
|
20
|
+
status: SloStatus | undefined | null,
|
|
21
|
+
) => Color;
|
|
22
|
+
|
|
23
|
+
export const getSloStatusColor: GetSloStatusColorFunction = (
|
|
24
|
+
status: SloStatus | undefined | null,
|
|
25
|
+
): Color => {
|
|
26
|
+
if (status === SloStatus.Healthy) {
|
|
27
|
+
return Green;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (status === SloStatus.AtRisk) {
|
|
31
|
+
return Yellow;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (status === SloStatus.BudgetExhausted) {
|
|
35
|
+
return Red;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return Gray500;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Text for the status pill. An SLO the worker has not touched yet has a
|
|
43
|
+
* null `sloStatus`; render that as "Unknown" rather than defaulting to
|
|
44
|
+
* "Healthy", which would assert a reliability claim we cannot back.
|
|
45
|
+
*/
|
|
46
|
+
export type GetSloStatusTextFunction = (
|
|
47
|
+
status: SloStatus | undefined | null,
|
|
48
|
+
) => string;
|
|
49
|
+
|
|
50
|
+
export const getSloStatusText: GetSloStatusTextFunction = (
|
|
51
|
+
status: SloStatus | undefined | null,
|
|
52
|
+
): string => {
|
|
53
|
+
return status || "Unknown";
|
|
54
|
+
};
|