@oneuptime/common 10.0.53 → 10.0.54
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 +4 -2
- 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 +4 -2
- 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
|
@@ -3,7 +3,7 @@ import CreateBy from "../Types/Database/CreateBy";
|
|
|
3
3
|
import DeleteBy from "../Types/Database/DeleteBy";
|
|
4
4
|
import { OnCreate, OnDelete } from "../Types/Database/Hooks";
|
|
5
5
|
import QueryHelper from "../Types/Database/QueryHelper";
|
|
6
|
-
import logger from "../Utils/Logger";
|
|
6
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
7
7
|
import DatabaseService from "./DatabaseService";
|
|
8
8
|
import MonitorService from "./MonitorService";
|
|
9
9
|
import UserService from "./UserService";
|
|
@@ -40,7 +40,10 @@ export class Service extends DatabaseService<MonitorStatusTimeline> {
|
|
|
40
40
|
namespace: "MonitorStatusTimeline.create",
|
|
41
41
|
});
|
|
42
42
|
} catch (e) {
|
|
43
|
-
logger.error(e
|
|
43
|
+
logger.error(e, {
|
|
44
|
+
projectId: createBy.data.projectId?.toString(),
|
|
45
|
+
monitorId: createBy.data.monitorId?.toString(),
|
|
46
|
+
} as LogAttributes);
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
if (!createBy.data.startsAt) {
|
|
@@ -98,8 +101,14 @@ export class Service extends DatabaseService<MonitorStatusTimeline> {
|
|
|
98
101
|
},
|
|
99
102
|
});
|
|
100
103
|
|
|
101
|
-
logger.debug("State Before this"
|
|
102
|
-
|
|
104
|
+
logger.debug("State Before this", {
|
|
105
|
+
projectId: createBy.data.projectId?.toString(),
|
|
106
|
+
monitorId: createBy.data.monitorId?.toString(),
|
|
107
|
+
} as LogAttributes);
|
|
108
|
+
logger.debug(stateBeforeThis, {
|
|
109
|
+
projectId: createBy.data.projectId?.toString(),
|
|
110
|
+
monitorId: createBy.data.monitorId?.toString(),
|
|
111
|
+
} as LogAttributes);
|
|
103
112
|
|
|
104
113
|
// If this is the first state, then do not notify the owner.
|
|
105
114
|
if (!stateBeforeThis) {
|
|
@@ -161,8 +170,14 @@ export class Service extends DatabaseService<MonitorStatusTimeline> {
|
|
|
161
170
|
}
|
|
162
171
|
}
|
|
163
172
|
|
|
164
|
-
logger.debug("State After this"
|
|
165
|
-
|
|
173
|
+
logger.debug("State After this", {
|
|
174
|
+
projectId: createBy.data.projectId?.toString(),
|
|
175
|
+
monitorId: createBy.data.monitorId?.toString(),
|
|
176
|
+
} as LogAttributes);
|
|
177
|
+
logger.debug(stateAfterThis, {
|
|
178
|
+
projectId: createBy.data.projectId?.toString(),
|
|
179
|
+
monitorId: createBy.data.monitorId?.toString(),
|
|
180
|
+
} as LogAttributes);
|
|
166
181
|
|
|
167
182
|
return {
|
|
168
183
|
createBy,
|
|
@@ -189,14 +204,32 @@ export class Service extends DatabaseService<MonitorStatusTimeline> {
|
|
|
189
204
|
|
|
190
205
|
// update the last status as ended.
|
|
191
206
|
|
|
192
|
-
logger.debug("Status Timeline Before this"
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
logger.debug(onCreate.carryForward.
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
207
|
+
logger.debug("Status Timeline Before this", {
|
|
208
|
+
projectId: createdItem.projectId?.toString(),
|
|
209
|
+
monitorId: createdItem.monitorId?.toString(),
|
|
210
|
+
} as LogAttributes);
|
|
211
|
+
logger.debug(onCreate.carryForward.statusTimelineBeforeThisStatus, {
|
|
212
|
+
projectId: createdItem.projectId?.toString(),
|
|
213
|
+
monitorId: createdItem.monitorId?.toString(),
|
|
214
|
+
} as LogAttributes);
|
|
215
|
+
|
|
216
|
+
logger.debug("Status Timeline After this", {
|
|
217
|
+
projectId: createdItem.projectId?.toString(),
|
|
218
|
+
monitorId: createdItem.monitorId?.toString(),
|
|
219
|
+
} as LogAttributes);
|
|
220
|
+
logger.debug(onCreate.carryForward.statusTimelineAfterThisStatus, {
|
|
221
|
+
projectId: createdItem.projectId?.toString(),
|
|
222
|
+
monitorId: createdItem.monitorId?.toString(),
|
|
223
|
+
} as LogAttributes);
|
|
224
|
+
|
|
225
|
+
logger.debug("Created Item", {
|
|
226
|
+
projectId: createdItem.projectId?.toString(),
|
|
227
|
+
monitorId: createdItem.monitorId?.toString(),
|
|
228
|
+
} as LogAttributes);
|
|
229
|
+
logger.debug(createdItem, {
|
|
230
|
+
projectId: createdItem.projectId?.toString(),
|
|
231
|
+
monitorId: createdItem.monitorId?.toString(),
|
|
232
|
+
} as LogAttributes);
|
|
200
233
|
|
|
201
234
|
/*
|
|
202
235
|
* now there are three cases.
|
|
@@ -204,7 +237,10 @@ export class Service extends DatabaseService<MonitorStatusTimeline> {
|
|
|
204
237
|
*/
|
|
205
238
|
if (!onCreate.carryForward.statusTimelineBeforeThisStatus) {
|
|
206
239
|
// This is the first status, no need to update previous status.
|
|
207
|
-
logger.debug("This is the first status."
|
|
240
|
+
logger.debug("This is the first status.", {
|
|
241
|
+
projectId: createdItem.projectId?.toString(),
|
|
242
|
+
monitorId: createdItem.monitorId?.toString(),
|
|
243
|
+
} as LogAttributes);
|
|
208
244
|
} else if (!onCreate.carryForward.statusTimelineAfterThisStatus) {
|
|
209
245
|
/*
|
|
210
246
|
* 2. This is the last status.
|
|
@@ -219,7 +255,10 @@ export class Service extends DatabaseService<MonitorStatusTimeline> {
|
|
|
219
255
|
isRoot: true,
|
|
220
256
|
},
|
|
221
257
|
});
|
|
222
|
-
logger.debug("This is the last status."
|
|
258
|
+
logger.debug("This is the last status.", {
|
|
259
|
+
projectId: createdItem.projectId?.toString(),
|
|
260
|
+
monitorId: createdItem.monitorId?.toString(),
|
|
261
|
+
} as LogAttributes);
|
|
223
262
|
} else {
|
|
224
263
|
/*
|
|
225
264
|
* 3. This is in the middle.
|
|
@@ -245,7 +284,10 @@ export class Service extends DatabaseService<MonitorStatusTimeline> {
|
|
|
245
284
|
isRoot: true,
|
|
246
285
|
},
|
|
247
286
|
});
|
|
248
|
-
logger.debug("This status is in the middle."
|
|
287
|
+
logger.debug("This status is in the middle.", {
|
|
288
|
+
projectId: createdItem.projectId?.toString(),
|
|
289
|
+
monitorId: createdItem.monitorId?.toString(),
|
|
290
|
+
} as LogAttributes);
|
|
249
291
|
}
|
|
250
292
|
|
|
251
293
|
if (!createdItem.endsAt) {
|
|
@@ -420,7 +462,9 @@ export class Service extends DatabaseService<MonitorStatusTimeline> {
|
|
|
420
462
|
|
|
421
463
|
if (!stateBeforeThis) {
|
|
422
464
|
// This is the first status, no need to update previous status.
|
|
423
|
-
logger.debug("This is the first status."
|
|
465
|
+
logger.debug("This is the first status.", {
|
|
466
|
+
monitorId: monitorId?.toString(),
|
|
467
|
+
} as LogAttributes);
|
|
424
468
|
} else if (!stateAfterThis) {
|
|
425
469
|
/*
|
|
426
470
|
* This is the last status.
|
|
@@ -435,7 +479,9 @@ export class Service extends DatabaseService<MonitorStatusTimeline> {
|
|
|
435
479
|
isRoot: true,
|
|
436
480
|
},
|
|
437
481
|
});
|
|
438
|
-
logger.debug("This is the last status."
|
|
482
|
+
logger.debug("This is the last status.", {
|
|
483
|
+
monitorId: monitorId?.toString(),
|
|
484
|
+
} as LogAttributes);
|
|
439
485
|
} else {
|
|
440
486
|
/*
|
|
441
487
|
* This status is in the middle.
|
|
@@ -461,7 +507,9 @@ export class Service extends DatabaseService<MonitorStatusTimeline> {
|
|
|
461
507
|
isRoot: true,
|
|
462
508
|
},
|
|
463
509
|
});
|
|
464
|
-
logger.debug("This status is in the middle."
|
|
510
|
+
logger.debug("This status is in the middle.", {
|
|
511
|
+
monitorId: monitorId?.toString(),
|
|
512
|
+
} as LogAttributes);
|
|
465
513
|
}
|
|
466
514
|
}
|
|
467
515
|
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
IsBillingEnabled,
|
|
3
3
|
NotificationSlackWebhookOnSubscriptionUpdate,
|
|
4
4
|
} from "../EnvironmentConfig";
|
|
5
|
-
import logger from "../Utils/Logger";
|
|
5
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
6
6
|
import BaseService from "./BaseService";
|
|
7
7
|
import BillingService from "./BillingService";
|
|
8
8
|
import ProjectService from "./ProjectService";
|
|
@@ -129,6 +129,7 @@ export class NotificationService extends BaseService {
|
|
|
129
129
|
}).catch((error: Exception) => {
|
|
130
130
|
logger.error(
|
|
131
131
|
"Error sending slack message for balance refill: " + error,
|
|
132
|
+
{ projectId: projectId?.toString() } as LogAttributes,
|
|
132
133
|
);
|
|
133
134
|
});
|
|
134
135
|
|
|
@@ -153,7 +154,7 @@ export class NotificationService extends BaseService {
|
|
|
153
154
|
project.name || ""
|
|
154
155
|
} and failed. Please make sure your payment method is upto date and has sufficient balance. You can add new payment methods in Project Settings.`,
|
|
155
156
|
);
|
|
156
|
-
logger.error(err);
|
|
157
|
+
logger.error(err, { projectId: projectId?.toString() } as LogAttributes);
|
|
157
158
|
throw err;
|
|
158
159
|
}
|
|
159
160
|
}
|
|
@@ -245,6 +246,7 @@ ${project.createdOwnerName && project.createdOwnerEmail ? `*Project Created By:*
|
|
|
245
246
|
}).catch((error: Exception) => {
|
|
246
247
|
logger.error(
|
|
247
248
|
"Error sending slack message for balance refill: " + error,
|
|
249
|
+
{ projectId: project.id?.toString() } as LogAttributes,
|
|
248
250
|
);
|
|
249
251
|
});
|
|
250
252
|
}
|
|
@@ -30,7 +30,7 @@ import OnCallDutyPolicyEscalationRuleTeam from "../../Models/DatabaseModels/OnCa
|
|
|
30
30
|
import OnCallDutyPolicyEscalationRuleUser from "../../Models/DatabaseModels/OnCallDutyPolicyEscalationRuleUser";
|
|
31
31
|
import OnCallDutyPolicyExecutionLogTimeline from "../../Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline";
|
|
32
32
|
import User from "../../Models/DatabaseModels/User";
|
|
33
|
-
import logger from "../Utils/Logger";
|
|
33
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
34
34
|
import OnCallDutyPolicyUserOverride from "../../Models/DatabaseModels/OnCallDutyPolicyUserOverride";
|
|
35
35
|
import OnCallDutyPolicyUserOverrideService from "./OnCallDutyPolicyUserOverrideService";
|
|
36
36
|
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
@@ -44,6 +44,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
44
44
|
}): Promise<ObjectID | null> {
|
|
45
45
|
logger.debug(
|
|
46
46
|
`Getting route alert to user id for userId: ${data.userId.toString()}`,
|
|
47
|
+
{
|
|
48
|
+
projectId: data.projectId.toString(),
|
|
49
|
+
userId: data.userId.toString(),
|
|
50
|
+
} as LogAttributes,
|
|
47
51
|
);
|
|
48
52
|
|
|
49
53
|
const currentDate: Date = OneUptimeDate.getCurrentDate();
|
|
@@ -70,7 +74,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
70
74
|
},
|
|
71
75
|
});
|
|
72
76
|
|
|
73
|
-
logger.debug(`Found alert routed to: ${JSON.stringify(alertRoutedTo)}
|
|
77
|
+
logger.debug(`Found alert routed to: ${JSON.stringify(alertRoutedTo)}`, {
|
|
78
|
+
projectId: data.projectId.toString(),
|
|
79
|
+
userId: data.userId.toString(),
|
|
80
|
+
} as LogAttributes);
|
|
74
81
|
|
|
75
82
|
// local override takes precedence over global override.
|
|
76
83
|
const localOverride: OnCallDutyPolicyUserOverride | undefined =
|
|
@@ -84,6 +91,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
84
91
|
if (localOverride && localOverride.routeAlertsToUserId) {
|
|
85
92
|
logger.debug(
|
|
86
93
|
`Route alert to user id found: ${localOverride.routeAlertsToUserId.toString()}`,
|
|
94
|
+
{
|
|
95
|
+
projectId: data.projectId.toString(),
|
|
96
|
+
userId: data.userId.toString(),
|
|
97
|
+
} as LogAttributes,
|
|
87
98
|
);
|
|
88
99
|
return localOverride.routeAlertsToUserId;
|
|
89
100
|
}
|
|
@@ -96,6 +107,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
96
107
|
if (globalOverride && globalOverride.routeAlertsToUserId) {
|
|
97
108
|
logger.debug(
|
|
98
109
|
`Route alert to user id found: ${globalOverride.routeAlertsToUserId.toString()}`,
|
|
110
|
+
{
|
|
111
|
+
projectId: data.projectId.toString(),
|
|
112
|
+
userId: data.userId.toString(),
|
|
113
|
+
} as LogAttributes,
|
|
99
114
|
);
|
|
100
115
|
return globalOverride.routeAlertsToUserId;
|
|
101
116
|
}
|
|
@@ -117,7 +132,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
117
132
|
onCallPolicyId: ObjectID;
|
|
118
133
|
},
|
|
119
134
|
): Promise<void> {
|
|
120
|
-
logger.debug(`Starting rule execution for ruleId: ${ruleId.toString()}
|
|
135
|
+
logger.debug(`Starting rule execution for ruleId: ${ruleId.toString()}`, {
|
|
136
|
+
projectId: options.projectId.toString(),
|
|
137
|
+
onCallDutyPolicyEscalationRuleId: ruleId.toString(),
|
|
138
|
+
} as LogAttributes);
|
|
121
139
|
|
|
122
140
|
const rule: Model | null = await this.findOneById({
|
|
123
141
|
id: ruleId,
|
|
@@ -137,7 +155,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
137
155
|
);
|
|
138
156
|
}
|
|
139
157
|
|
|
140
|
-
logger.debug(`Found rule: ${JSON.stringify(rule)}
|
|
158
|
+
logger.debug(`Found rule: ${JSON.stringify(rule)}`, {
|
|
159
|
+
projectId: options.projectId.toString(),
|
|
160
|
+
onCallDutyPolicyEscalationRuleId: ruleId.toString(),
|
|
161
|
+
} as LogAttributes);
|
|
141
162
|
|
|
142
163
|
await OnCallDutyPolicyExecutionLogService.updateOneById({
|
|
143
164
|
id: options.onCallPolicyExecutionLogId,
|
|
@@ -152,7 +173,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
152
173
|
},
|
|
153
174
|
});
|
|
154
175
|
|
|
155
|
-
logger.debug(`Updated execution log for ruleId: ${ruleId.toString()}
|
|
176
|
+
logger.debug(`Updated execution log for ruleId: ${ruleId.toString()}`, {
|
|
177
|
+
projectId: options.projectId.toString(),
|
|
178
|
+
onCallDutyPolicyEscalationRuleId: ruleId.toString(),
|
|
179
|
+
} as LogAttributes);
|
|
156
180
|
|
|
157
181
|
type GetNewLogFunction = () => OnCallDutyPolicyExecutionLogTimeline;
|
|
158
182
|
|
|
@@ -242,7 +266,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
242
266
|
},
|
|
243
267
|
});
|
|
244
268
|
|
|
245
|
-
logger.debug(`Found users in rule: ${JSON.stringify(usersInRule)}
|
|
269
|
+
logger.debug(`Found users in rule: ${JSON.stringify(usersInRule)}`, {
|
|
270
|
+
projectId: options.projectId.toString(),
|
|
271
|
+
onCallDutyPolicyEscalationRuleId: ruleId.toString(),
|
|
272
|
+
} as LogAttributes);
|
|
246
273
|
|
|
247
274
|
const teamsInRule: Array<OnCallDutyPolicyEscalationRuleTeam> =
|
|
248
275
|
await OnCallDutyPolicyEscalationRuleTeamService.findBy({
|
|
@@ -259,7 +286,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
259
286
|
},
|
|
260
287
|
});
|
|
261
288
|
|
|
262
|
-
logger.debug(`Found teams in rule: ${JSON.stringify(teamsInRule)}
|
|
289
|
+
logger.debug(`Found teams in rule: ${JSON.stringify(teamsInRule)}`, {
|
|
290
|
+
projectId: options.projectId.toString(),
|
|
291
|
+
onCallDutyPolicyEscalationRuleId: ruleId.toString(),
|
|
292
|
+
} as LogAttributes);
|
|
263
293
|
|
|
264
294
|
const schedulesInRule: Array<OnCallDutyPolicyEscalationRuleSchedule> =
|
|
265
295
|
await OnCallDutyPolicyEscalationRuleScheduleService.findBy({
|
|
@@ -276,7 +306,13 @@ export class Service extends DatabaseService<Model> {
|
|
|
276
306
|
},
|
|
277
307
|
});
|
|
278
308
|
|
|
279
|
-
logger.debug(
|
|
309
|
+
logger.debug(
|
|
310
|
+
`Found schedules in rule: ${JSON.stringify(schedulesInRule)}`,
|
|
311
|
+
{
|
|
312
|
+
projectId: options.projectId.toString(),
|
|
313
|
+
onCallDutyPolicyEscalationRuleId: ruleId.toString(),
|
|
314
|
+
} as LogAttributes,
|
|
315
|
+
);
|
|
280
316
|
|
|
281
317
|
type StartUserNotificationRuleExecutionFunction = (
|
|
282
318
|
userId: ObjectID,
|
|
@@ -307,6 +343,11 @@ export class Service extends DatabaseService<Model> {
|
|
|
307
343
|
|
|
308
344
|
logger.debug(
|
|
309
345
|
`Starting notification rule execution for userId: ${alertSentToUserId.toString()}`,
|
|
346
|
+
{
|
|
347
|
+
projectId: options.projectId.toString(),
|
|
348
|
+
onCallDutyPolicyEscalationRuleId: ruleId.toString(),
|
|
349
|
+
userId: alertSentToUserId.toString(),
|
|
350
|
+
} as LogAttributes,
|
|
310
351
|
);
|
|
311
352
|
let log: OnCallDutyPolicyExecutionLogTimeline = getNewLog();
|
|
312
353
|
log.statusMessage = "Sending notification to user.";
|
|
@@ -479,7 +520,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
479
520
|
});
|
|
480
521
|
}
|
|
481
522
|
|
|
482
|
-
logger.debug(`Completed rule execution for ruleId: ${ruleId.toString()}
|
|
523
|
+
logger.debug(`Completed rule execution for ruleId: ${ruleId.toString()}`, {
|
|
524
|
+
projectId: options.projectId.toString(),
|
|
525
|
+
onCallDutyPolicyEscalationRuleId: ruleId.toString(),
|
|
526
|
+
} as LogAttributes);
|
|
483
527
|
}
|
|
484
528
|
|
|
485
529
|
public constructor() {
|
|
@@ -23,7 +23,7 @@ import PushNotificationUtil from "../Utils/PushNotificationUtil";
|
|
|
23
23
|
import OnCallDutyPolicyTimeLogService from "./OnCallDutyPolicyTimeLogService";
|
|
24
24
|
import OneUptimeDate from "../../Types/Date";
|
|
25
25
|
import { createWhatsAppMessageFromTemplate } from "../Utils/WhatsAppTemplateUtil";
|
|
26
|
-
import logger from "../Utils/Logger";
|
|
26
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
27
27
|
import { WhatsAppMessagePayload } from "../../Types/WhatsApp/WhatsAppMessage";
|
|
28
28
|
|
|
29
29
|
export class Service extends DatabaseService<Model> {
|
|
@@ -183,6 +183,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
183
183
|
}).catch((error: Error) => {
|
|
184
184
|
logger.error(
|
|
185
185
|
`Error starting time log for user ${createdModel.user?.id}: ${error}`,
|
|
186
|
+
{
|
|
187
|
+
projectId: projectId?.toString(),
|
|
188
|
+
userId: createdModel.user?.id?.toString(),
|
|
189
|
+
} as LogAttributes,
|
|
186
190
|
);
|
|
187
191
|
});
|
|
188
192
|
}
|
|
@@ -267,7 +271,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
267
271
|
userId: userId,
|
|
268
272
|
endsAt: OneUptimeDate.getCurrentDate(),
|
|
269
273
|
}).catch((error: Error) => {
|
|
270
|
-
logger.error(`Error ending time log for user ${userId}: ${error}
|
|
274
|
+
logger.error(`Error ending time log for user ${userId}: ${error}`, {
|
|
275
|
+
projectId: projectId?.toString(),
|
|
276
|
+
userId: userId?.toString(),
|
|
277
|
+
} as LogAttributes);
|
|
271
278
|
});
|
|
272
279
|
}
|
|
273
280
|
}
|
|
@@ -7,7 +7,7 @@ import OnCallDutyExecutionLogTimelineStatus from "../../Types/OnCallDutyPolicy/O
|
|
|
7
7
|
import { Blue500, Green500, Red500, Yellow500 } from "../../Types/BrandColors";
|
|
8
8
|
import Color from "../../Types/Color";
|
|
9
9
|
import ObjectID from "../../Types/ObjectID";
|
|
10
|
-
import logger from "../Utils/Logger";
|
|
10
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
11
11
|
import { LIMIT_PER_PROJECT } from "../../Types/Database/LimitMax";
|
|
12
12
|
import AlertFeedService from "./AlertFeedService";
|
|
13
13
|
import { AlertFeedEventType } from "../../Models/DatabaseModels/AlertFeed";
|
|
@@ -76,6 +76,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
76
76
|
}): Promise<void> {
|
|
77
77
|
logger.debug(
|
|
78
78
|
"OnCallDutyPolicyExecutionLogTimelineService.addToIncidentFeed",
|
|
79
|
+
{
|
|
80
|
+
onCallDutyPolicyExecutionLogTimelineId:
|
|
81
|
+
data.onCallDutyPolicyExecutionLogTimelineId?.toString(),
|
|
82
|
+
} as LogAttributes,
|
|
79
83
|
);
|
|
80
84
|
|
|
81
85
|
const onCallDutyPolicyExecutionLogTimeline: Model | null =
|
|
@@ -123,8 +127,12 @@ export class Service extends DatabaseService<Model> {
|
|
|
123
127
|
},
|
|
124
128
|
});
|
|
125
129
|
|
|
126
|
-
logger.debug("OnCallDutyPolicyExecutionLogTimeline: "
|
|
127
|
-
|
|
130
|
+
logger.debug("OnCallDutyPolicyExecutionLogTimeline: ", {
|
|
131
|
+
projectId: onCallDutyPolicyExecutionLogTimeline?.projectId?.toString(),
|
|
132
|
+
} as LogAttributes);
|
|
133
|
+
logger.debug(onCallDutyPolicyExecutionLogTimeline, {
|
|
134
|
+
projectId: onCallDutyPolicyExecutionLogTimeline?.projectId?.toString(),
|
|
135
|
+
} as LogAttributes);
|
|
128
136
|
|
|
129
137
|
if (!onCallDutyPolicyExecutionLogTimeline) {
|
|
130
138
|
return;
|
|
@@ -146,7 +154,9 @@ export class Service extends DatabaseService<Model> {
|
|
|
146
154
|
const status: OnCallDutyExecutionLogTimelineStatus =
|
|
147
155
|
onCallDutyPolicyExecutionLogTimeline.status!;
|
|
148
156
|
|
|
149
|
-
logger.debug("Status: " + status
|
|
157
|
+
logger.debug("Status: " + status, {
|
|
158
|
+
projectId: onCallDutyPolicyExecutionLogTimeline?.projectId?.toString(),
|
|
159
|
+
} as LogAttributes);
|
|
150
160
|
|
|
151
161
|
if (
|
|
152
162
|
status &&
|
|
@@ -237,7 +247,10 @@ The on-call policy **[${onCallDutyPolicyExecutionLogTimeline.onCallDutyPolicy.na
|
|
|
237
247
|
})}** instead, because of an override rule.`;
|
|
238
248
|
}
|
|
239
249
|
|
|
240
|
-
logger.debug("Feed Info in Markdown: " + feedInfoInMarkdown
|
|
250
|
+
logger.debug("Feed Info in Markdown: " + feedInfoInMarkdown, {
|
|
251
|
+
projectId:
|
|
252
|
+
onCallDutyPolicyExecutionLogTimeline?.projectId?.toString(),
|
|
253
|
+
} as LogAttributes);
|
|
241
254
|
|
|
242
255
|
if (onCallDutyPolicyExecutionLogTimeline.triggeredByIncidentId) {
|
|
243
256
|
await IncidentFeedService.createIncidentFeedItem({
|
|
@@ -287,7 +300,10 @@ The on-call policy **[${onCallDutyPolicyExecutionLogTimeline.onCallDutyPolicy.na
|
|
|
287
300
|
});
|
|
288
301
|
}
|
|
289
302
|
|
|
290
|
-
logger.debug("Incident Feed created"
|
|
303
|
+
logger.debug("Incident Feed created", {
|
|
304
|
+
projectId:
|
|
305
|
+
onCallDutyPolicyExecutionLogTimeline?.projectId?.toString(),
|
|
306
|
+
} as LogAttributes);
|
|
291
307
|
}
|
|
292
308
|
}
|
|
293
309
|
}
|
|
@@ -297,8 +313,13 @@ The on-call policy **[${onCallDutyPolicyExecutionLogTimeline.onCallDutyPolicy.na
|
|
|
297
313
|
_onCreate: OnCreate<Model>,
|
|
298
314
|
createdItem: Model,
|
|
299
315
|
): Promise<Model> {
|
|
300
|
-
logger.debug(
|
|
301
|
-
|
|
316
|
+
logger.debug(
|
|
317
|
+
"OnCallDutyPolicyExecutionLogTimelineService.onCreateSuccess",
|
|
318
|
+
{ projectId: createdItem.projectId?.toString() } as LogAttributes,
|
|
319
|
+
);
|
|
320
|
+
logger.debug(createdItem, {
|
|
321
|
+
projectId: createdItem.projectId?.toString(),
|
|
322
|
+
} as LogAttributes);
|
|
302
323
|
|
|
303
324
|
await this.addToIncidentOrAlertFeed({
|
|
304
325
|
onCallDutyPolicyExecutionLogTimelineId: createdItem.id!,
|
|
@@ -4,7 +4,7 @@ import OneUptimeDate from "../../Types/Date";
|
|
|
4
4
|
import BadDataException from "../../Types/Exception/BadDataException";
|
|
5
5
|
import ObjectID from "../../Types/ObjectID";
|
|
6
6
|
import { IsBillingEnabled } from "../EnvironmentConfig";
|
|
7
|
-
import logger from "../Utils/Logger";
|
|
7
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
8
8
|
import DatabaseService from "./DatabaseService";
|
|
9
9
|
import OnCallDutyPolicyFeed, {
|
|
10
10
|
OnCallDutyPolicyFeedEventType,
|
|
@@ -45,8 +45,15 @@ export class Service extends DatabaseService<OnCallDutyPolicyFeed> {
|
|
|
45
45
|
try {
|
|
46
46
|
logger.debug(
|
|
47
47
|
"OnCallDutyPolicyFeedService.createOnCallDutyPolicyFeedItem",
|
|
48
|
+
{
|
|
49
|
+
projectId: data.projectId?.toString(),
|
|
50
|
+
onCallDutyPolicyId: data.onCallDutyPolicyId?.toString(),
|
|
51
|
+
} as LogAttributes,
|
|
48
52
|
);
|
|
49
|
-
logger.debug(data
|
|
53
|
+
logger.debug(data, {
|
|
54
|
+
projectId: data.projectId?.toString(),
|
|
55
|
+
onCallDutyPolicyId: data.onCallDutyPolicyId?.toString(),
|
|
56
|
+
} as LogAttributes);
|
|
50
57
|
|
|
51
58
|
const onCallDutyPolicyFeed: OnCallDutyPolicyFeed =
|
|
52
59
|
new OnCallDutyPolicyFeed();
|
|
@@ -99,8 +106,14 @@ export class Service extends DatabaseService<OnCallDutyPolicyFeed> {
|
|
|
99
106
|
},
|
|
100
107
|
});
|
|
101
108
|
|
|
102
|
-
logger.debug("On Call Duty Policy Feed created"
|
|
103
|
-
|
|
109
|
+
logger.debug("On Call Duty Policy Feed created", {
|
|
110
|
+
projectId: data.projectId?.toString(),
|
|
111
|
+
onCallDutyPolicyId: data.onCallDutyPolicyId?.toString(),
|
|
112
|
+
} as LogAttributes);
|
|
113
|
+
logger.debug(createdOnCallDutyPolicyFeed, {
|
|
114
|
+
projectId: data.projectId?.toString(),
|
|
115
|
+
onCallDutyPolicyId: data.onCallDutyPolicyId?.toString(),
|
|
116
|
+
} as LogAttributes);
|
|
104
117
|
|
|
105
118
|
try {
|
|
106
119
|
// send notification to slack and teams
|
|
@@ -116,14 +129,26 @@ export class Service extends DatabaseService<OnCallDutyPolicyFeed> {
|
|
|
116
129
|
});
|
|
117
130
|
}
|
|
118
131
|
} catch (e) {
|
|
119
|
-
logger.error("Error in sending notification to slack and teams"
|
|
120
|
-
|
|
132
|
+
logger.error("Error in sending notification to slack and teams", {
|
|
133
|
+
projectId: data.projectId?.toString(),
|
|
134
|
+
onCallDutyPolicyId: data.onCallDutyPolicyId?.toString(),
|
|
135
|
+
} as LogAttributes);
|
|
136
|
+
logger.error(e, {
|
|
137
|
+
projectId: data.projectId?.toString(),
|
|
138
|
+
onCallDutyPolicyId: data.onCallDutyPolicyId?.toString(),
|
|
139
|
+
} as LogAttributes);
|
|
121
140
|
|
|
122
141
|
// we dont throw this error as it is not a critical error
|
|
123
142
|
}
|
|
124
143
|
} catch (e) {
|
|
125
|
-
logger.error("Error in creating onCallDutyPolicy feed"
|
|
126
|
-
|
|
144
|
+
logger.error("Error in creating onCallDutyPolicy feed", {
|
|
145
|
+
projectId: data.projectId?.toString(),
|
|
146
|
+
onCallDutyPolicyId: data.onCallDutyPolicyId?.toString(),
|
|
147
|
+
} as LogAttributes);
|
|
148
|
+
logger.error(e, {
|
|
149
|
+
projectId: data.projectId?.toString(),
|
|
150
|
+
onCallDutyPolicyId: data.onCallDutyPolicyId?.toString(),
|
|
151
|
+
} as LogAttributes);
|
|
127
152
|
|
|
128
153
|
// we dont throw this error as it is not a critical error
|
|
129
154
|
}
|