@oneuptime/common 10.0.53 → 10.0.55
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/Metric.ts +78 -0
- package/Server/API/AIAgentDataAPI.ts +6 -1
- package/Server/API/BillingAPI.ts +28 -6
- package/Server/API/CommonAPI.ts +11 -0
- package/Server/API/DashboardAPI.ts +6 -2
- package/Server/API/DashboardDomainAPI.ts +10 -3
- package/Server/API/GitHubAPI.ts +58 -14
- package/Server/API/MicrosoftTeamsAPI.ts +97 -33
- package/Server/API/OpenSourceDeploymentAPI.ts +2 -2
- package/Server/API/SlackAPI.ts +107 -36
- package/Server/API/StatusAPI.ts +37 -16
- package/Server/API/StatusPageAPI.ts +97 -23
- package/Server/API/StatusPageDomainAPI.ts +6 -3
- package/Server/API/UserAPI.ts +3 -3
- package/Server/API/UserCallAPI.ts +5 -2
- package/Server/API/UserEmailAPI.ts +5 -2
- package/Server/API/UserPushAPI.ts +9 -3
- package/Server/API/UserSmsAPI.ts +5 -2
- package/Server/API/UserWhatsAppAPI.ts +5 -2
- package/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.ts +47 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.ts +35 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
- package/Server/Middleware/NotificationMiddleware.ts +2 -2
- package/Server/Middleware/ProjectAuthorization.ts +6 -0
- package/Server/Middleware/SCIMAuthorization.ts +2 -1
- package/Server/Middleware/SlackAuthorization.ts +28 -10
- package/Server/Middleware/TelemetryIngest.ts +16 -3
- package/Server/Middleware/UserAuthorization.ts +22 -5
- package/Server/Middleware/WhatsAppAuthorization.ts +15 -4
- package/Server/Services/AIAgentService.ts +13 -6
- package/Server/Services/AIService.ts +9 -3
- package/Server/Services/AlertEpisodeFeedService.ts +17 -5
- package/Server/Services/AlertEpisodeService.ts +34 -3
- package/Server/Services/AlertEpisodeStateTimelineService.ts +80 -22
- package/Server/Services/AlertFeedService.ts +17 -5
- package/Server/Services/AlertGroupingEngineService.ts +36 -7
- package/Server/Services/AlertService.ts +60 -8
- package/Server/Services/AlertStateTimelineService.ts +29 -7
- package/Server/Services/AnalyticsDatabaseService.ts +59 -25
- package/Server/Services/BillingInvoiceService.ts +7 -3
- package/Server/Services/BillingService.ts +9 -2
- package/Server/Services/DashboardDomainService.ts +56 -22
- package/Server/Services/DashboardService.ts +11 -4
- package/Server/Services/DatabaseService.ts +31 -11
- package/Server/Services/IncidentEpisodeFeedService.ts +17 -5
- package/Server/Services/IncidentEpisodeService.ts +34 -3
- package/Server/Services/IncidentEpisodeStateTimelineService.ts +80 -22
- package/Server/Services/IncidentFeedService.ts +33 -9
- package/Server/Services/IncidentGroupingEngineService.ts +35 -6
- package/Server/Services/IncidentService.ts +103 -9
- package/Server/Services/IncidentSlaRuleService.ts +16 -4
- package/Server/Services/IncidentSlaService.ts +20 -4
- package/Server/Services/IncidentStateTimelineService.ts +120 -31
- package/Server/Services/KubernetesClusterService.ts +62 -14
- package/Server/Services/MonitorFeedService.ts +33 -9
- package/Server/Services/MonitorProbeService.ts +46 -23
- package/Server/Services/MonitorService.ts +35 -4
- package/Server/Services/MonitorStatusTimelineService.ts +68 -20
- package/Server/Services/NotificationService.ts +4 -2
- package/Server/Services/OnCallDutyPolicyEscalationRuleService.ts +53 -9
- package/Server/Services/OnCallDutyPolicyEscalationRuleUserService.ts +9 -2
- package/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts +29 -8
- package/Server/Services/OnCallDutyPolicyFeedService.ts +33 -8
- package/Server/Services/OnCallDutyPolicyScheduleService.ts +97 -24
- package/Server/Services/OnCallDutyPolicyService.ts +2 -1
- package/Server/Services/OpenTelemetryIngestService.ts +51 -20
- package/Server/Services/ProbeService.ts +16 -7
- package/Server/Services/ProjectService.ts +21 -7
- package/Server/Services/ScheduledMaintenanceFeedService.ts +17 -4
- package/Server/Services/ScheduledMaintenanceService.ts +52 -6
- package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +72 -20
- package/Server/Services/StatusPageDomainService.ts +59 -23
- package/Server/Services/StatusPageService.ts +26 -8
- package/Server/Services/StatusPageSubscriberService.ts +382 -111
- package/Server/Services/TeamMemberService.ts +9 -3
- package/Server/Services/UserNotificationRuleService.ts +9 -3
- package/Server/Services/UserService.ts +6 -4
- package/Server/Services/UserWhatsAppService.ts +9 -3
- package/Server/Services/WorkflowService.ts +7 -3
- package/Server/Services/WorkspaceNotificationRuleService.ts +398 -156
- package/Server/Types/Domain.ts +15 -5
- package/Server/Types/Workflow/Components/API/Post.ts +22 -8
- package/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.ts +12 -4
- package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +10 -0
- package/Server/Utils/CodeRepository/CodeRepository.ts +62 -13
- package/Server/Utils/Express.ts +1 -0
- package/Server/Utils/Greenlock/Greenlock.ts +75 -20
- package/Server/Utils/LLM/LLMService.ts +22 -7
- package/Server/Utils/Logger.ts +93 -13
- package/Server/Utils/Monitor/MonitorAlert.ts +15 -3
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +15 -5
- package/Server/Utils/Monitor/MonitorIncident.ts +17 -3
- package/Server/Utils/Monitor/MonitorStatusTimeline.ts +6 -1
- package/Server/Utils/Profiling.ts +11 -5
- package/Server/Utils/Realtime.ts +90 -31
- package/Server/Utils/Response.ts +2 -2
- package/Server/Utils/StartServer.ts +43 -9
- package/Server/Utils/Telemetry/SpanUtil.ts +90 -0
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.ts +58 -15
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.ts +58 -15
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts +19 -3
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts +87 -22
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.ts +12 -3
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.ts +25 -7
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.ts +55 -8
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +100 -22
- package/Server/Utils/Workspace/Slack/Actions/Alert.ts +35 -9
- package/Server/Utils/Workspace/Slack/Actions/AlertEpisode.ts +32 -8
- package/Server/Utils/Workspace/Slack/Actions/Auth.ts +3 -1
- package/Server/Utils/Workspace/Slack/Actions/Incident.ts +52 -11
- package/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.ts +4 -1
- package/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.ts +89 -20
- package/Server/Utils/Workspace/Slack/Slack.ts +498 -247
- package/Server/Utils/Workspace/Workspace.ts +33 -11
- package/Server/Utils/Workspace/WorkspaceBase.ts +3 -1
- package/Server/Utils/Workspace/WorkspaceMessages/Alert.ts +8 -2
- package/Tests/Server/Middleware/UserAuthorization.test.ts +1 -1
- package/Tests/Server/Services/AnalyticsDatabaseService.test.ts +12 -3
- package/UI/Components/Charts/Area/AreaChart.tsx +35 -1
- package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +7 -0
- package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +33 -0
- package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +33 -0
- package/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.ts +14 -0
- package/UI/Components/Charts/Line/LineChart.tsx +35 -1
- package/UI/Components/Charts/Types/ExemplarPoint.ts +6 -0
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +3 -3
- package/UI/Components/Navbar/NavBar.tsx +10 -0
- package/build/dist/Models/AnalyticsModels/Metric.js +70 -0
- package/build/dist/Models/AnalyticsModels/Metric.js.map +1 -1
- package/build/dist/Server/API/AIAgentDataAPI.js +6 -6
- package/build/dist/Server/API/AIAgentDataAPI.js.map +1 -1
- package/build/dist/Server/API/BillingAPI.js +13 -13
- package/build/dist/Server/API/BillingAPI.js.map +1 -1
- package/build/dist/Server/API/CommonAPI.js +5 -0
- package/build/dist/Server/API/CommonAPI.js.map +1 -1
- package/build/dist/Server/API/DashboardAPI.js +2 -2
- package/build/dist/Server/API/DashboardAPI.js.map +1 -1
- package/build/dist/Server/API/DashboardDomainAPI.js +3 -3
- package/build/dist/Server/API/DashboardDomainAPI.js.map +1 -1
- package/build/dist/Server/API/GitHubAPI.js +19 -19
- package/build/dist/Server/API/GitHubAPI.js.map +1 -1
- package/build/dist/Server/API/MicrosoftTeamsAPI.js +34 -34
- package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
- package/build/dist/Server/API/OpenSourceDeploymentAPI.js +2 -2
- package/build/dist/Server/API/OpenSourceDeploymentAPI.js.map +1 -1
- package/build/dist/Server/API/SlackAPI.js +38 -38
- package/build/dist/Server/API/SlackAPI.js.map +1 -1
- package/build/dist/Server/API/StatusAPI.js +16 -16
- package/build/dist/Server/API/StatusAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +52 -52
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageDomainAPI.js +3 -3
- package/build/dist/Server/API/StatusPageDomainAPI.js.map +1 -1
- package/build/dist/Server/API/UserAPI.js +3 -3
- package/build/dist/Server/API/UserAPI.js.map +1 -1
- package/build/dist/Server/API/UserCallAPI.js +2 -2
- package/build/dist/Server/API/UserCallAPI.js.map +1 -1
- package/build/dist/Server/API/UserEmailAPI.js +2 -2
- package/build/dist/Server/API/UserEmailAPI.js.map +1 -1
- package/build/dist/Server/API/UserPushAPI.js +3 -3
- package/build/dist/Server/API/UserPushAPI.js.map +1 -1
- package/build/dist/Server/API/UserSmsAPI.js +2 -2
- package/build/dist/Server/API/UserSmsAPI.js.map +1 -1
- package/build/dist/Server/API/UserWhatsAppAPI.js +2 -2
- package/build/dist/Server/API/UserWhatsAppAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.js +40 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/NotificationMiddleware.js +2 -2
- package/build/dist/Server/Middleware/NotificationMiddleware.js.map +1 -1
- package/build/dist/Server/Middleware/ProjectAuthorization.js +5 -0
- package/build/dist/Server/Middleware/ProjectAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/SCIMAuthorization.js +2 -2
- package/build/dist/Server/Middleware/SCIMAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/SlackAuthorization.js +10 -10
- package/build/dist/Server/Middleware/SlackAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/TelemetryIngest.js +9 -4
- package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
- package/build/dist/Server/Middleware/UserAuthorization.js +10 -5
- package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/WhatsAppAuthorization.js +6 -6
- package/build/dist/Server/Middleware/WhatsAppAuthorization.js.map +1 -1
- package/build/dist/Server/Services/AIAgentService.js +13 -7
- package/build/dist/Server/Services/AIAgentService.js.map +1 -1
- package/build/dist/Server/Services/AIService.js +9 -2
- package/build/dist/Server/Services/AIService.js.map +1 -1
- package/build/dist/Server/Services/AlertEpisodeFeedService.js +17 -5
- package/build/dist/Server/Services/AlertEpisodeFeedService.js.map +1 -1
- package/build/dist/Server/Services/AlertEpisodeService.js +40 -10
- package/build/dist/Server/Services/AlertEpisodeService.js.map +1 -1
- package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js +81 -24
- package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/AlertFeedService.js +17 -5
- package/build/dist/Server/Services/AlertFeedService.js.map +1 -1
- package/build/dist/Server/Services/AlertGroupingEngineService.js +44 -28
- package/build/dist/Server/Services/AlertGroupingEngineService.js.map +1 -1
- package/build/dist/Server/Services/AlertService.js +72 -20
- package/build/dist/Server/Services/AlertService.js.map +1 -1
- package/build/dist/Server/Services/AlertStateTimelineService.js +36 -13
- package/build/dist/Server/Services/AlertStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js +52 -28
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/BillingInvoiceService.js +7 -2
- package/build/dist/Server/Services/BillingInvoiceService.js.map +1 -1
- package/build/dist/Server/Services/BillingService.js +8 -8
- package/build/dist/Server/Services/BillingService.js.map +1 -1
- package/build/dist/Server/Services/DashboardDomainService.js +49 -27
- package/build/dist/Server/Services/DashboardDomainService.js.map +1 -1
- package/build/dist/Server/Services/DashboardService.js +11 -4
- package/build/dist/Server/Services/DashboardService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +32 -12
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeFeedService.js +17 -5
- package/build/dist/Server/Services/IncidentEpisodeFeedService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeService.js +40 -10
- package/build/dist/Server/Services/IncidentEpisodeService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js +81 -24
- package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/IncidentFeedService.js +34 -10
- package/build/dist/Server/Services/IncidentFeedService.js.map +1 -1
- package/build/dist/Server/Services/IncidentGroupingEngineService.js +43 -29
- package/build/dist/Server/Services/IncidentGroupingEngineService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +116 -28
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentSlaRuleService.js +19 -11
- package/build/dist/Server/Services/IncidentSlaRuleService.js.map +1 -1
- package/build/dist/Server/Services/IncidentSlaService.js +21 -14
- package/build/dist/Server/Services/IncidentSlaService.js.map +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js +130 -37
- package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/KubernetesClusterService.js +51 -14
- package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
- package/build/dist/Server/Services/MonitorFeedService.js +34 -10
- package/build/dist/Server/Services/MonitorFeedService.js.map +1 -1
- package/build/dist/Server/Services/MonitorProbeService.js +32 -16
- package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +42 -11
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/MonitorStatusTimelineService.js +69 -21
- package/build/dist/Server/Services/MonitorStatusTimelineService.js.map +1 -1
- package/build/dist/Server/Services/NotificationService.js +4 -3
- package/build/dist/Server/Services/NotificationService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js +49 -12
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js +9 -3
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js +26 -11
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js +34 -10
- package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +94 -37
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyService.js +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyService.js.map +1 -1
- package/build/dist/Server/Services/OpenTelemetryIngestService.js +45 -17
- package/build/dist/Server/Services/OpenTelemetryIngestService.js.map +1 -1
- package/build/dist/Server/Services/ProbeService.js +13 -7
- package/build/dist/Server/Services/ProbeService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +33 -17
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceFeedService.js +17 -5
- package/build/dist/Server/Services/ScheduledMaintenanceFeedService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceService.js +71 -24
- package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +72 -24
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageDomainService.js +55 -29
- package/build/dist/Server/Services/StatusPageDomainService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +29 -9
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageSubscriberService.js +393 -130
- package/build/dist/Server/Services/StatusPageSubscriberService.js.map +1 -1
- package/build/dist/Server/Services/TeamMemberService.js +10 -2
- package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationRuleService.js +10 -2
- package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +8 -3
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Services/UserWhatsAppService.js +10 -2
- package/build/dist/Server/Services/UserWhatsAppService.js.map +1 -1
- package/build/dist/Server/Services/WorkflowService.js +7 -2
- package/build/dist/Server/Services/WorkflowService.js.map +1 -1
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.js +367 -180
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Types/Domain.js +12 -6
- package/build/dist/Server/Types/Domain.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Post.js +11 -7
- package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js +11 -4
- package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +7 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
- package/build/dist/Server/Utils/CodeRepository/CodeRepository.js +45 -17
- package/build/dist/Server/Utils/CodeRepository/CodeRepository.js.map +1 -1
- package/build/dist/Server/Utils/Express.js.map +1 -1
- package/build/dist/Server/Utils/Greenlock/Greenlock.js +36 -29
- package/build/dist/Server/Utils/Greenlock/Greenlock.js.map +1 -1
- package/build/dist/Server/Utils/LLM/LLMService.js +18 -6
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- package/build/dist/Server/Utils/Logger.js +61 -13
- package/build/dist/Server/Utils/Logger.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +23 -20
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +13 -4
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +25 -22
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js +6 -3
- package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js.map +1 -1
- package/build/dist/Server/Utils/Profiling.js +9 -6
- package/build/dist/Server/Utils/Profiling.js.map +1 -1
- package/build/dist/Server/Utils/Realtime.js +50 -34
- package/build/dist/Server/Utils/Realtime.js.map +1 -1
- package/build/dist/Server/Utils/Response.js +2 -2
- package/build/dist/Server/Utils/Response.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js +23 -11
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/SpanUtil.js +52 -0
- package/build/dist/Server/Utils/Telemetry/SpanUtil.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js +58 -15
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js +58 -15
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js +19 -5
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js +90 -26
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js +12 -3
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js +25 -7
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js +58 -19
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +102 -29
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js +38 -9
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/AlertEpisode.js +34 -8
- package/build/dist/Server/Utils/Workspace/Slack/Actions/AlertEpisode.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js +3 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js +55 -13
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.js +5 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js +91 -26
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js +355 -270
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Workspace.js +21 -12
- package/build/dist/Server/Utils/Workspace/Workspace.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/WorkspaceBase.js +3 -1
- package/build/dist/Server/Utils/Workspace/WorkspaceBase.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/WorkspaceMessages/Alert.js +9 -2
- package/build/dist/Server/Utils/Workspace/WorkspaceMessages/Alert.js.map +1 -1
- package/build/dist/Tests/Server/Middleware/UserAuthorization.test.js +1 -1
- package/build/dist/Tests/Server/Middleware/UserAuthorization.test.js.map +1 -1
- package/build/dist/Tests/Server/Services/AnalyticsDatabaseService.test.js +12 -6
- package/build/dist/Tests/Server/Services/AnalyticsDatabaseService.test.js.map +1 -1
- package/build/dist/UI/Components/Charts/Area/AreaChart.js +20 -2
- package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +2 -2
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +9 -2
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +9 -2
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.js +2 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.js.map +1 -0
- package/build/dist/UI/Components/Charts/Line/LineChart.js +20 -2
- package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Types/ExemplarPoint.js +2 -0
- package/build/dist/UI/Components/Charts/Types/ExemplarPoint.js.map +1 -0
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +3 -3
- package/build/dist/UI/Components/Navbar/NavBar.js +9 -1
- package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
- package/package.json +1 -1
|
@@ -45,7 +45,7 @@ import Metric, {
|
|
|
45
45
|
} from "../../Models/AnalyticsModels/Metric";
|
|
46
46
|
import OneUptimeDate from "../../Types/Date";
|
|
47
47
|
import TelemetryUtil from "../Utils/Telemetry/Telemetry";
|
|
48
|
-
import logger from "../Utils/Logger";
|
|
48
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
49
49
|
import IncidentFeedService from "./IncidentFeedService";
|
|
50
50
|
import IncidentSlaService from "./IncidentSlaService";
|
|
51
51
|
import { IncidentFeedEventType } from "../../Models/DatabaseModels/IncidentFeed";
|
|
@@ -691,6 +691,11 @@ export class Service extends DatabaseService<Model> {
|
|
|
691
691
|
} catch (error) {
|
|
692
692
|
logger.error(
|
|
693
693
|
`Workspace operations failed in IncidentService.onCreateSuccess: ${error}`,
|
|
694
|
+
{
|
|
695
|
+
projectId: createdItem.projectId?.toString(),
|
|
696
|
+
incidentId: createdItem.id?.toString(),
|
|
697
|
+
userId: createdItem.createdByUserId?.toString(),
|
|
698
|
+
} as LogAttributes,
|
|
694
699
|
);
|
|
695
700
|
return Promise.resolve();
|
|
696
701
|
}
|
|
@@ -701,6 +706,11 @@ export class Service extends DatabaseService<Model> {
|
|
|
701
706
|
} catch (error) {
|
|
702
707
|
logger.error(
|
|
703
708
|
`Create incident feed failed in IncidentService.onCreateSuccess: ${error}`,
|
|
709
|
+
{
|
|
710
|
+
projectId: createdItem.projectId?.toString(),
|
|
711
|
+
incidentId: createdItem.id?.toString(),
|
|
712
|
+
userId: createdItem.createdByUserId?.toString(),
|
|
713
|
+
} as LogAttributes,
|
|
704
714
|
);
|
|
705
715
|
return Promise.resolve();
|
|
706
716
|
}
|
|
@@ -711,6 +721,11 @@ export class Service extends DatabaseService<Model> {
|
|
|
711
721
|
} catch (error) {
|
|
712
722
|
logger.error(
|
|
713
723
|
`Handle incident state change failed in IncidentService.onCreateSuccess: ${error}`,
|
|
724
|
+
{
|
|
725
|
+
projectId: createdItem.projectId?.toString(),
|
|
726
|
+
incidentId: createdItem.id?.toString(),
|
|
727
|
+
userId: createdItem.createdByUserId?.toString(),
|
|
728
|
+
} as LogAttributes,
|
|
714
729
|
);
|
|
715
730
|
return Promise.resolve();
|
|
716
731
|
}
|
|
@@ -739,6 +754,11 @@ export class Service extends DatabaseService<Model> {
|
|
|
739
754
|
} catch (error) {
|
|
740
755
|
logger.error(
|
|
741
756
|
`Add owners failed in IncidentService.onCreateSuccess: ${error}`,
|
|
757
|
+
{
|
|
758
|
+
projectId: createdItem.projectId?.toString(),
|
|
759
|
+
incidentId: createdItem.id?.toString(),
|
|
760
|
+
userId: createdItem.createdByUserId?.toString(),
|
|
761
|
+
} as LogAttributes,
|
|
742
762
|
);
|
|
743
763
|
return Promise.resolve();
|
|
744
764
|
}
|
|
@@ -755,6 +775,11 @@ export class Service extends DatabaseService<Model> {
|
|
|
755
775
|
} catch (error) {
|
|
756
776
|
logger.error(
|
|
757
777
|
`Monitor status change failed in IncidentService.onCreateSuccess: ${error}`,
|
|
778
|
+
{
|
|
779
|
+
projectId: createdItem.projectId?.toString(),
|
|
780
|
+
incidentId: createdItem.id?.toString(),
|
|
781
|
+
userId: createdItem.createdByUserId?.toString(),
|
|
782
|
+
} as LogAttributes,
|
|
758
783
|
);
|
|
759
784
|
return Promise.resolve();
|
|
760
785
|
}
|
|
@@ -767,6 +792,11 @@ export class Service extends DatabaseService<Model> {
|
|
|
767
792
|
} catch (error) {
|
|
768
793
|
logger.error(
|
|
769
794
|
`Disable active monitoring failed in IncidentService.onCreateSuccess: ${error}`,
|
|
795
|
+
{
|
|
796
|
+
projectId: createdItem.projectId?.toString(),
|
|
797
|
+
incidentId: createdItem.id?.toString(),
|
|
798
|
+
userId: createdItem.createdByUserId?.toString(),
|
|
799
|
+
} as LogAttributes,
|
|
770
800
|
);
|
|
771
801
|
return Promise.resolve();
|
|
772
802
|
}
|
|
@@ -783,6 +813,11 @@ export class Service extends DatabaseService<Model> {
|
|
|
783
813
|
} catch (error) {
|
|
784
814
|
logger.error(
|
|
785
815
|
`On-call duty policy execution failed in IncidentService.onCreateSuccess: ${error}`,
|
|
816
|
+
{
|
|
817
|
+
projectId: createdItem.projectId?.toString(),
|
|
818
|
+
incidentId: createdItem.id?.toString(),
|
|
819
|
+
userId: createdItem.createdByUserId?.toString(),
|
|
820
|
+
} as LogAttributes,
|
|
786
821
|
);
|
|
787
822
|
return Promise.resolve();
|
|
788
823
|
}
|
|
@@ -794,6 +829,11 @@ export class Service extends DatabaseService<Model> {
|
|
|
794
829
|
} catch (error) {
|
|
795
830
|
logger.error(
|
|
796
831
|
`Incident grouping failed in IncidentService.onCreateSuccess: ${error}`,
|
|
832
|
+
{
|
|
833
|
+
projectId: createdItem.projectId?.toString(),
|
|
834
|
+
incidentId: createdItem.id?.toString(),
|
|
835
|
+
userId: createdItem.createdByUserId?.toString(),
|
|
836
|
+
} as LogAttributes,
|
|
797
837
|
);
|
|
798
838
|
}
|
|
799
839
|
})
|
|
@@ -814,12 +854,22 @@ export class Service extends DatabaseService<Model> {
|
|
|
814
854
|
} catch (error) {
|
|
815
855
|
logger.error(
|
|
816
856
|
`SLA creation failed in IncidentService.onCreateSuccess: ${error}`,
|
|
857
|
+
{
|
|
858
|
+
projectId: createdItem.projectId?.toString(),
|
|
859
|
+
incidentId: createdItem.id?.toString(),
|
|
860
|
+
userId: createdItem.createdByUserId?.toString(),
|
|
861
|
+
} as LogAttributes,
|
|
817
862
|
);
|
|
818
863
|
}
|
|
819
864
|
})
|
|
820
865
|
.catch((error: Error) => {
|
|
821
866
|
logger.error(
|
|
822
867
|
`Critical error in IncidentService sequential operations: ${error}`,
|
|
868
|
+
{
|
|
869
|
+
projectId: createdItem.projectId?.toString(),
|
|
870
|
+
incidentId: createdItem.id?.toString(),
|
|
871
|
+
userId: createdItem.createdByUserId?.toString(),
|
|
872
|
+
} as LogAttributes,
|
|
823
873
|
);
|
|
824
874
|
});
|
|
825
875
|
|
|
@@ -866,7 +916,13 @@ export class Service extends DatabaseService<Model> {
|
|
|
866
916
|
});
|
|
867
917
|
}
|
|
868
918
|
} catch (error) {
|
|
869
|
-
logger.error(
|
|
919
|
+
logger.error(
|
|
920
|
+
`Error in handleIncidentWorkspaceOperationsAsync: ${error}`,
|
|
921
|
+
{
|
|
922
|
+
projectId: createdItem.projectId?.toString(),
|
|
923
|
+
incidentId: createdItem.id?.toString(),
|
|
924
|
+
} as LogAttributes,
|
|
925
|
+
);
|
|
870
926
|
throw error;
|
|
871
927
|
}
|
|
872
928
|
}
|
|
@@ -945,7 +1001,11 @@ ${incident.remediationNotes || "No remediation notes provided."}
|
|
|
945
1001
|
},
|
|
946
1002
|
});
|
|
947
1003
|
} catch (error) {
|
|
948
|
-
logger.error(`Error in createIncidentFeedAsync: ${error}
|
|
1004
|
+
logger.error(`Error in createIncidentFeedAsync: ${error}`, {
|
|
1005
|
+
projectId: incident.projectId?.toString(),
|
|
1006
|
+
incidentId: incident.id?.toString(),
|
|
1007
|
+
userId: incident.createdByUserId?.toString(),
|
|
1008
|
+
} as LogAttributes);
|
|
949
1009
|
throw error;
|
|
950
1010
|
}
|
|
951
1011
|
}
|
|
@@ -984,7 +1044,10 @@ ${incident.remediationNotes || "No remediation notes provided."}
|
|
|
984
1044
|
},
|
|
985
1045
|
});
|
|
986
1046
|
} catch (error) {
|
|
987
|
-
logger.error(`Error in handleIncidentStateChangeAsync: ${error}
|
|
1047
|
+
logger.error(`Error in handleIncidentStateChangeAsync: ${error}`, {
|
|
1048
|
+
projectId: createdItem.projectId?.toString(),
|
|
1049
|
+
incidentId: createdItem.id?.toString(),
|
|
1050
|
+
} as LogAttributes);
|
|
988
1051
|
throw error;
|
|
989
1052
|
}
|
|
990
1053
|
}
|
|
@@ -1014,7 +1077,10 @@ ${incident.remediationNotes || "No remediation notes provided."}
|
|
|
1014
1077
|
await Promise.allSettled(policyPromises);
|
|
1015
1078
|
}
|
|
1016
1079
|
} catch (error) {
|
|
1017
|
-
logger.error(`Error in executeOnCallDutyPoliciesAsync: ${error}
|
|
1080
|
+
logger.error(`Error in executeOnCallDutyPoliciesAsync: ${error}`, {
|
|
1081
|
+
projectId: createdItem.projectId?.toString(),
|
|
1082
|
+
incidentId: createdItem.id?.toString(),
|
|
1083
|
+
} as LogAttributes);
|
|
1018
1084
|
throw error;
|
|
1019
1085
|
}
|
|
1020
1086
|
}
|
|
@@ -1045,7 +1111,10 @@ ${incident.remediationNotes || "No remediation notes provided."}
|
|
|
1045
1111
|
);
|
|
1046
1112
|
}
|
|
1047
1113
|
} catch (error) {
|
|
1048
|
-
logger.error(`Error in handleMonitorStatusChangeAsync: ${error}
|
|
1114
|
+
logger.error(`Error in handleMonitorStatusChangeAsync: ${error}`, {
|
|
1115
|
+
projectId: createdItem.projectId?.toString(),
|
|
1116
|
+
incidentId: createdItem.id?.toString(),
|
|
1117
|
+
} as LogAttributes);
|
|
1049
1118
|
throw error;
|
|
1050
1119
|
}
|
|
1051
1120
|
}
|
|
@@ -1425,12 +1494,19 @@ ${incident.remediationNotes || "No remediation notes provided."}
|
|
|
1425
1494
|
},
|
|
1426
1495
|
projectId: projectId,
|
|
1427
1496
|
}).catch((err: Error) => {
|
|
1428
|
-
logger.error(err
|
|
1497
|
+
logger.error(err, {
|
|
1498
|
+
projectId: projectId?.toString(),
|
|
1499
|
+
incidentId: incidentId?.toString(),
|
|
1500
|
+
} as LogAttributes);
|
|
1429
1501
|
});
|
|
1430
1502
|
}
|
|
1431
1503
|
} catch (metricError) {
|
|
1432
1504
|
logger.error(
|
|
1433
1505
|
`Failed to emit postmortem completion time metric: ${metricError}`,
|
|
1506
|
+
{
|
|
1507
|
+
projectId: projectId?.toString(),
|
|
1508
|
+
incidentId: incidentId?.toString(),
|
|
1509
|
+
} as LogAttributes,
|
|
1434
1510
|
);
|
|
1435
1511
|
}
|
|
1436
1512
|
}
|
|
@@ -1566,6 +1642,10 @@ ${incidentSeverity.name}
|
|
|
1566
1642
|
} catch (slaError) {
|
|
1567
1643
|
logger.error(
|
|
1568
1644
|
`SLA recalculation failed in IncidentService.onUpdateSuccess: ${slaError}`,
|
|
1645
|
+
{
|
|
1646
|
+
projectId: projectId?.toString(),
|
|
1647
|
+
incidentId: incidentId?.toString(),
|
|
1648
|
+
} as LogAttributes,
|
|
1569
1649
|
);
|
|
1570
1650
|
}
|
|
1571
1651
|
|
|
@@ -1617,11 +1697,18 @@ ${incidentSeverity.name}
|
|
|
1617
1697
|
},
|
|
1618
1698
|
projectId: projectId,
|
|
1619
1699
|
}).catch((err: Error) => {
|
|
1620
|
-
logger.error(err
|
|
1700
|
+
logger.error(err, {
|
|
1701
|
+
projectId: projectId?.toString(),
|
|
1702
|
+
incidentId: incidentId?.toString(),
|
|
1703
|
+
} as LogAttributes);
|
|
1621
1704
|
});
|
|
1622
1705
|
} catch (metricError) {
|
|
1623
1706
|
logger.error(
|
|
1624
1707
|
`Failed to emit severity change metric: ${metricError}`,
|
|
1708
|
+
{
|
|
1709
|
+
projectId: projectId?.toString(),
|
|
1710
|
+
incidentId: incidentId?.toString(),
|
|
1711
|
+
} as LogAttributes,
|
|
1625
1712
|
);
|
|
1626
1713
|
}
|
|
1627
1714
|
}
|
|
@@ -2571,7 +2658,10 @@ ${incidentSeverity.name}
|
|
|
2571
2658
|
metricNameServiceNameMap: metricTypesMap,
|
|
2572
2659
|
projectId: incident.projectId,
|
|
2573
2660
|
}).catch((err: Error) => {
|
|
2574
|
-
logger.error(err
|
|
2661
|
+
logger.error(err, {
|
|
2662
|
+
projectId: incident.projectId?.toString(),
|
|
2663
|
+
incidentId: incident.id?.toString(),
|
|
2664
|
+
} as LogAttributes);
|
|
2575
2665
|
});
|
|
2576
2666
|
}
|
|
2577
2667
|
|
|
@@ -2680,6 +2770,10 @@ ${incidentSeverity.name}
|
|
|
2680
2770
|
});
|
|
2681
2771
|
logger.info(
|
|
2682
2772
|
`Updated Incident ${incident.id} current state to ${latestTimeline.incidentStateId}`,
|
|
2773
|
+
{
|
|
2774
|
+
projectId: incident.projectId?.toString(),
|
|
2775
|
+
incidentId: incident.id?.toString(),
|
|
2776
|
+
} as LogAttributes,
|
|
2683
2777
|
);
|
|
2684
2778
|
}
|
|
2685
2779
|
}
|
|
@@ -9,7 +9,7 @@ import Label from "../../Models/DatabaseModels/Label";
|
|
|
9
9
|
import Monitor from "../../Models/DatabaseModels/Monitor";
|
|
10
10
|
import ObjectID from "../../Types/ObjectID";
|
|
11
11
|
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
12
|
-
import logger from "../Utils/Logger";
|
|
12
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
13
13
|
import { IsBillingEnabled } from "../EnvironmentConfig";
|
|
14
14
|
import MonitorService from "./MonitorService";
|
|
15
15
|
import IncidentService from "./IncidentService";
|
|
@@ -60,6 +60,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
60
60
|
}): Promise<Model | null> {
|
|
61
61
|
logger.debug(
|
|
62
62
|
`Finding matching SLA rule for incident ${data.incidentId} in project ${data.projectId}`,
|
|
63
|
+
{ projectId: data.projectId?.toString() } as LogAttributes,
|
|
63
64
|
);
|
|
64
65
|
|
|
65
66
|
// Get the incident if not provided
|
|
@@ -90,7 +91,9 @@ export class Service extends DatabaseService<Model> {
|
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
if (!incident) {
|
|
93
|
-
logger.warn(`Incident ${data.incidentId} not found
|
|
94
|
+
logger.warn(`Incident ${data.incidentId} not found`, {
|
|
95
|
+
projectId: data.projectId?.toString(),
|
|
96
|
+
} as LogAttributes);
|
|
94
97
|
return null;
|
|
95
98
|
}
|
|
96
99
|
|
|
@@ -137,7 +140,9 @@ export class Service extends DatabaseService<Model> {
|
|
|
137
140
|
});
|
|
138
141
|
|
|
139
142
|
if (rules.length === 0) {
|
|
140
|
-
logger.debug(`No enabled SLA rules found for project ${data.projectId}
|
|
143
|
+
logger.debug(`No enabled SLA rules found for project ${data.projectId}`, {
|
|
144
|
+
projectId: data.projectId?.toString(),
|
|
145
|
+
} as LogAttributes);
|
|
141
146
|
return null;
|
|
142
147
|
}
|
|
143
148
|
|
|
@@ -148,12 +153,15 @@ export class Service extends DatabaseService<Model> {
|
|
|
148
153
|
if (matches) {
|
|
149
154
|
logger.debug(
|
|
150
155
|
`Incident ${data.incidentId} matches SLA rule ${rule.name || rule.id}`,
|
|
156
|
+
{ projectId: data.projectId?.toString() } as LogAttributes,
|
|
151
157
|
);
|
|
152
158
|
return rule;
|
|
153
159
|
}
|
|
154
160
|
}
|
|
155
161
|
|
|
156
|
-
logger.debug(`Incident ${data.incidentId} did not match any SLA rules
|
|
162
|
+
logger.debug(`Incident ${data.incidentId} did not match any SLA rules`, {
|
|
163
|
+
projectId: data.projectId?.toString(),
|
|
164
|
+
} as LogAttributes);
|
|
157
165
|
return null;
|
|
158
166
|
}
|
|
159
167
|
|
|
@@ -164,6 +172,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
164
172
|
): Promise<boolean> {
|
|
165
173
|
logger.debug(
|
|
166
174
|
`Checking if incident ${incident.id} matches SLA rule ${rule.name || rule.id}`,
|
|
175
|
+
{ projectId: incident.projectId?.toString() } as LogAttributes,
|
|
167
176
|
);
|
|
168
177
|
|
|
169
178
|
// Check monitor IDs - if monitors are specified, incident must have at least one of them
|
|
@@ -321,6 +330,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
321
330
|
} catch {
|
|
322
331
|
logger.warn(
|
|
323
332
|
`Invalid regex pattern in SLA rule ${rule.id}: ${rule.incidentTitlePattern}`,
|
|
333
|
+
{ projectId: incident.projectId?.toString() } as LogAttributes,
|
|
324
334
|
);
|
|
325
335
|
return false;
|
|
326
336
|
}
|
|
@@ -340,6 +350,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
340
350
|
} catch {
|
|
341
351
|
logger.warn(
|
|
342
352
|
`Invalid regex pattern in SLA rule ${rule.id}: ${rule.incidentDescriptionPattern}`,
|
|
353
|
+
{ projectId: incident.projectId?.toString() } as LogAttributes,
|
|
343
354
|
);
|
|
344
355
|
return false;
|
|
345
356
|
}
|
|
@@ -348,6 +359,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
348
359
|
// If no criteria specified (all fields empty), rule matches all incidents
|
|
349
360
|
logger.debug(
|
|
350
361
|
`SLA rule ${rule.name || rule.id} matched incident ${incident.id} (all criteria passed)`,
|
|
362
|
+
{ projectId: incident.projectId?.toString() } as LogAttributes,
|
|
351
363
|
);
|
|
352
364
|
return true;
|
|
353
365
|
}
|
|
@@ -6,7 +6,7 @@ import ObjectID from "../../Types/ObjectID";
|
|
|
6
6
|
import OneUptimeDate from "../../Types/Date";
|
|
7
7
|
import IncidentSlaStatus from "../../Types/Incident/IncidentSlaStatus";
|
|
8
8
|
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
9
|
-
import logger from "../Utils/Logger";
|
|
9
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
10
10
|
import { IsBillingEnabled } from "../EnvironmentConfig";
|
|
11
11
|
import IncidentSlaRuleService from "./IncidentSlaRuleService";
|
|
12
12
|
import IncidentService from "./IncidentService";
|
|
@@ -30,6 +30,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
30
30
|
}): Promise<Model | null> {
|
|
31
31
|
logger.debug(
|
|
32
32
|
`Creating SLA record for incident ${data.incidentId} in project ${data.projectId}`,
|
|
33
|
+
{ projectId: data.projectId?.toString() } as LogAttributes,
|
|
33
34
|
);
|
|
34
35
|
|
|
35
36
|
// Find matching rule
|
|
@@ -52,6 +53,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
52
53
|
if (!matchingRule || !matchingRule.id) {
|
|
53
54
|
logger.debug(
|
|
54
55
|
`No matching SLA rule found for incident ${data.incidentId}`,
|
|
56
|
+
{ projectId: data.projectId?.toString() } as LogAttributes,
|
|
55
57
|
);
|
|
56
58
|
return null;
|
|
57
59
|
}
|
|
@@ -101,12 +103,14 @@ export class Service extends DatabaseService<Model> {
|
|
|
101
103
|
|
|
102
104
|
logger.info(
|
|
103
105
|
`Created SLA record ${createdSla.id} for incident ${data.incidentId} with rule ${matchingRule.name || matchingRule.id}`,
|
|
106
|
+
{ projectId: data.projectId?.toString() } as LogAttributes,
|
|
104
107
|
);
|
|
105
108
|
|
|
106
109
|
return createdSla;
|
|
107
110
|
} catch (error) {
|
|
108
111
|
logger.error(
|
|
109
112
|
`Error creating SLA record for incident ${data.incidentId}: ${error}`,
|
|
113
|
+
{ projectId: data.projectId?.toString() } as LogAttributes,
|
|
110
114
|
);
|
|
111
115
|
return null;
|
|
112
116
|
}
|
|
@@ -119,6 +123,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
119
123
|
}): Promise<void> {
|
|
120
124
|
logger.debug(
|
|
121
125
|
`Marking incident ${data.incidentId} as responded at ${data.respondedAt}`,
|
|
126
|
+
{ incidentId: data.incidentId?.toString() } as LogAttributes,
|
|
122
127
|
);
|
|
123
128
|
|
|
124
129
|
// Find all active SLA records for this incident
|
|
@@ -153,7 +158,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
153
158
|
},
|
|
154
159
|
});
|
|
155
160
|
|
|
156
|
-
logger.info(
|
|
161
|
+
logger.info(
|
|
162
|
+
`Marked SLA ${sla.id} as responded at ${data.respondedAt}`,
|
|
163
|
+
{ incidentId: data.incidentId?.toString() } as LogAttributes,
|
|
164
|
+
);
|
|
157
165
|
}
|
|
158
166
|
}
|
|
159
167
|
}
|
|
@@ -165,6 +173,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
165
173
|
}): Promise<void> {
|
|
166
174
|
logger.debug(
|
|
167
175
|
`Marking incident ${data.incidentId} as resolved at ${data.resolvedAt}`,
|
|
176
|
+
{ incidentId: data.incidentId?.toString() } as LogAttributes,
|
|
168
177
|
);
|
|
169
178
|
|
|
170
179
|
// Find all active SLA records for this incident
|
|
@@ -231,6 +240,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
231
240
|
|
|
232
241
|
logger.info(
|
|
233
242
|
`Marked SLA ${sla.id} as resolved with status ${finalStatus}`,
|
|
243
|
+
{ incidentId: data.incidentId?.toString() } as LogAttributes,
|
|
234
244
|
);
|
|
235
245
|
}
|
|
236
246
|
}
|
|
@@ -239,7 +249,9 @@ export class Service extends DatabaseService<Model> {
|
|
|
239
249
|
public async recalculateDeadlines(data: {
|
|
240
250
|
incidentId: ObjectID;
|
|
241
251
|
}): Promise<void> {
|
|
242
|
-
logger.debug(`Recalculating deadlines for incident ${data.incidentId}
|
|
252
|
+
logger.debug(`Recalculating deadlines for incident ${data.incidentId}`, {
|
|
253
|
+
incidentId: data.incidentId?.toString(),
|
|
254
|
+
} as LogAttributes);
|
|
243
255
|
|
|
244
256
|
// Get the incident to find the new severity and project
|
|
245
257
|
const incident: Incident | null = await IncidentService.findOneById({
|
|
@@ -266,7 +278,9 @@ export class Service extends DatabaseService<Model> {
|
|
|
266
278
|
});
|
|
267
279
|
|
|
268
280
|
if (!incident || !incident.projectId) {
|
|
269
|
-
logger.warn(`Incident ${data.incidentId} not found
|
|
281
|
+
logger.warn(`Incident ${data.incidentId} not found`, {
|
|
282
|
+
projectId: incident?.projectId?.toString(),
|
|
283
|
+
} as LogAttributes);
|
|
270
284
|
return;
|
|
271
285
|
}
|
|
272
286
|
|
|
@@ -338,11 +352,13 @@ export class Service extends DatabaseService<Model> {
|
|
|
338
352
|
|
|
339
353
|
logger.info(
|
|
340
354
|
`Recalculated SLA ${sla.id} with new rule ${newMatchingRule.name || newMatchingRule.id}`,
|
|
355
|
+
{ projectId: incident.projectId?.toString() } as LogAttributes,
|
|
341
356
|
);
|
|
342
357
|
} else if (!newMatchingRule) {
|
|
343
358
|
// No matching rule anymore, but keep the existing SLA record
|
|
344
359
|
logger.debug(
|
|
345
360
|
`No matching SLA rule found after severity change for incident ${data.incidentId}, keeping existing SLA`,
|
|
361
|
+
{ projectId: incident.projectId?.toString() } as LogAttributes,
|
|
346
362
|
);
|
|
347
363
|
}
|
|
348
364
|
}
|