@oneuptime/common 10.0.52 → 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/TelemetryAPI.ts +81 -0
- 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/LabelService.ts +14 -1
- package/Server/Services/MonitorFeedService.ts +33 -9
- package/Server/Services/MonitorProbeService.ts +31 -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 +29 -11
- 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/TelemetryAttributeService.ts +117 -4
- 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/BulkUpdate/BulkUpdateForm.tsx +60 -38
- 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/Dictionary/Dictionary.tsx +13 -1
- package/UI/Components/Filters/FiltersForm.tsx +2 -0
- package/UI/Components/Filters/JSONFilter.tsx +5 -1
- package/UI/Components/Filters/Types/Filter.ts +2 -0
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +3 -3
- package/UI/Components/ModelTable/BaseModelTable.tsx +10 -6
- 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/TelemetryAPI.js +39 -0
- package/build/dist/Server/API/TelemetryAPI.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/LabelService.js +10 -1
- package/build/dist/Server/Services/LabelService.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 +23 -3
- 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 +41 -21
- 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/TelemetryAttributeService.js +83 -6
- package/build/dist/Server/Services/TelemetryAttributeService.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/BulkUpdate/BulkUpdateForm.js +31 -30
- package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.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/Dictionary/Dictionary.js +9 -1
- package/build/dist/UI/Components/Dictionary/Dictionary.js.map +1 -1
- package/build/dist/UI/Components/Filters/FiltersForm.js +1 -1
- package/build/dist/UI/Components/Filters/FiltersForm.js.map +1 -1
- package/build/dist/UI/Components/Filters/JSONFilter.js +1 -1
- package/build/dist/UI/Components/Filters/JSONFilter.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +3 -3
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +9 -5
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- 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
|
@@ -21,9 +21,13 @@ import Express, {
|
|
|
21
21
|
RequestHandler,
|
|
22
22
|
headerValueToString,
|
|
23
23
|
} from "./Express";
|
|
24
|
-
import logger
|
|
24
|
+
import logger, {
|
|
25
|
+
getLogAttributesFromRequest,
|
|
26
|
+
type LogAttributes,
|
|
27
|
+
} from "./Logger";
|
|
25
28
|
import "./Process";
|
|
26
29
|
import Response from "./Response";
|
|
30
|
+
import SpanUtil from "./Telemetry/SpanUtil";
|
|
27
31
|
import { api } from "@opentelemetry/sdk-node";
|
|
28
32
|
import StatusCode from "../../Types/API/StatusCode";
|
|
29
33
|
import HTTPErrorResponse from "../../Types/API/HTTPErrorResponse";
|
|
@@ -38,6 +42,7 @@ import Typeof from "../../Types/Typeof";
|
|
|
38
42
|
import CookieParser from "cookie-parser";
|
|
39
43
|
import cors from "cors";
|
|
40
44
|
import zlib from "zlib";
|
|
45
|
+
import crypto from "crypto";
|
|
41
46
|
import path from "path";
|
|
42
47
|
import "ejs";
|
|
43
48
|
// Make sure we have stack trace for debugging.
|
|
@@ -60,7 +65,10 @@ const jsonBodyParserMiddleware: RequestHandler = ExpressJson({
|
|
|
60
65
|
extended: true,
|
|
61
66
|
verify: (req: ExpressRequest, _res: ExpressResponse, buf: Buffer) => {
|
|
62
67
|
(req as OneUptimeRequest).rawBody = buf.toString();
|
|
63
|
-
logger.debug(
|
|
68
|
+
logger.debug(
|
|
69
|
+
`Raw JSON Body for signature verification captured`,
|
|
70
|
+
getLogAttributesFromRequest(req as OneUptimeRequest),
|
|
71
|
+
);
|
|
64
72
|
},
|
|
65
73
|
}); // 50 MB limit.
|
|
66
74
|
|
|
@@ -72,6 +80,7 @@ const urlEncodedMiddleware: RequestHandler = ExpressUrlEncoded({
|
|
|
72
80
|
(req as OneUptimeRequest).rawBody = buf.toString(); // Also set rawBody for consistency
|
|
73
81
|
logger.debug(
|
|
74
82
|
`Raw Form Url Encoded Body: ${(req as OneUptimeRequest).rawFormUrlEncodedBody}`,
|
|
83
|
+
getLogAttributesFromRequest(req as OneUptimeRequest),
|
|
75
84
|
);
|
|
76
85
|
},
|
|
77
86
|
}); // 50 MB limit.
|
|
@@ -150,7 +159,10 @@ app.use((req: OneUptimeRequest, res: ExpressResponse, next: NextFunction) => {
|
|
|
150
159
|
const buffer: Buffer = Buffer.concat(buffers);
|
|
151
160
|
zlib.gunzip(buffer as Uint8Array, (err: unknown, decoded: Buffer) => {
|
|
152
161
|
if (err) {
|
|
153
|
-
logger.error(
|
|
162
|
+
logger.error(
|
|
163
|
+
err,
|
|
164
|
+
getLogAttributesFromRequest(req as OneUptimeRequest),
|
|
165
|
+
);
|
|
154
166
|
return Response.sendErrorResponse(
|
|
155
167
|
req,
|
|
156
168
|
res,
|
|
@@ -195,6 +207,18 @@ app.use((_req: ExpressRequest, _res: ExpressResponse, next: NextFunction) => {
|
|
|
195
207
|
next();
|
|
196
208
|
});
|
|
197
209
|
|
|
210
|
+
app.use((req: ExpressRequest, _res: ExpressResponse, next: NextFunction) => {
|
|
211
|
+
const requestId: string = crypto.randomUUID();
|
|
212
|
+
(req as OneUptimeRequest).requestId = requestId;
|
|
213
|
+
|
|
214
|
+
// Tag the current span with requestId so all downstream spans inherit context
|
|
215
|
+
SpanUtil.addAttributesToCurrentSpan({
|
|
216
|
+
requestId: requestId,
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
next();
|
|
220
|
+
});
|
|
221
|
+
|
|
198
222
|
export interface InitFuctionOptions {
|
|
199
223
|
appName: string;
|
|
200
224
|
port?: Port | undefined;
|
|
@@ -286,12 +310,18 @@ const init: InitFunction = async (
|
|
|
286
310
|
next: NextFunction,
|
|
287
311
|
) => {
|
|
288
312
|
try {
|
|
289
|
-
|
|
313
|
+
const renderLogAttributes: LogAttributes =
|
|
314
|
+
getLogAttributesFromRequest(_req as OneUptimeRequest);
|
|
315
|
+
|
|
316
|
+
logger.debug("Rendering index page", renderLogAttributes);
|
|
290
317
|
|
|
291
318
|
let variables: JSONObject = {};
|
|
292
319
|
|
|
293
320
|
if (data.getVariablesToRenderIndexPage) {
|
|
294
|
-
logger.debug(
|
|
321
|
+
logger.debug(
|
|
322
|
+
"Getting variables to render index page",
|
|
323
|
+
renderLogAttributes,
|
|
324
|
+
);
|
|
295
325
|
try {
|
|
296
326
|
const variablesToRenderIndexPage: JSONObject =
|
|
297
327
|
await data.getVariablesToRenderIndexPage(_req, res);
|
|
@@ -300,16 +330,20 @@ const init: InitFunction = async (
|
|
|
300
330
|
...variablesToRenderIndexPage,
|
|
301
331
|
};
|
|
302
332
|
} catch (error) {
|
|
303
|
-
logger.error(error);
|
|
333
|
+
logger.error(error, renderLogAttributes);
|
|
304
334
|
}
|
|
305
335
|
}
|
|
306
336
|
|
|
307
|
-
logger.debug(
|
|
308
|
-
|
|
337
|
+
logger.debug(
|
|
338
|
+
"Rendering index page with variables: ",
|
|
339
|
+
renderLogAttributes,
|
|
340
|
+
);
|
|
341
|
+
logger.debug(variables, renderLogAttributes);
|
|
309
342
|
|
|
310
343
|
if (res.headersSent) {
|
|
311
344
|
logger.debug(
|
|
312
345
|
"Response already sent while preparing index page. Skipping render.",
|
|
346
|
+
renderLogAttributes,
|
|
313
347
|
);
|
|
314
348
|
return;
|
|
315
349
|
}
|
|
@@ -369,7 +403,7 @@ const addDefaultRoutes: PromiseVoidFunction = async (): Promise<void> => {
|
|
|
369
403
|
res: ExpressResponse,
|
|
370
404
|
next: NextFunction,
|
|
371
405
|
) => {
|
|
372
|
-
logger.error(err);
|
|
406
|
+
logger.error(err, getLogAttributesFromRequest(_req as OneUptimeRequest));
|
|
373
407
|
|
|
374
408
|
// Mark span as error.
|
|
375
409
|
if (err) {
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import OpenTelemetryAPI, { Span } from "@opentelemetry/api";
|
|
2
|
+
import { DisableTelemetry } from "../../EnvironmentConfig";
|
|
3
|
+
|
|
4
|
+
export interface SpanAttributes {
|
|
5
|
+
userId?: string | undefined;
|
|
6
|
+
projectId?: string | undefined;
|
|
7
|
+
requestId?: string | undefined;
|
|
8
|
+
incidentId?: string | undefined;
|
|
9
|
+
alertId?: string | undefined;
|
|
10
|
+
monitorId?: string | undefined;
|
|
11
|
+
statusPageId?: string | undefined;
|
|
12
|
+
scheduledMaintenanceId?: string | undefined;
|
|
13
|
+
onCallDutyPolicyId?: string | undefined;
|
|
14
|
+
onCallDutyPolicyScheduleId?: string | undefined;
|
|
15
|
+
incidentEpisodeId?: string | undefined;
|
|
16
|
+
alertEpisodeId?: string | undefined;
|
|
17
|
+
workspaceType?: string | undefined;
|
|
18
|
+
channelId?: string | undefined;
|
|
19
|
+
[key: string]: string | number | boolean | undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default class SpanUtil {
|
|
23
|
+
/**
|
|
24
|
+
* Add attributes to the currently active span.
|
|
25
|
+
* Safe to call even when there is no active span or telemetry is disabled.
|
|
26
|
+
*/
|
|
27
|
+
public static addAttributesToCurrentSpan(attributes: SpanAttributes): void {
|
|
28
|
+
if (DisableTelemetry) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const span: Span | undefined = OpenTelemetryAPI.trace.getActiveSpan();
|
|
33
|
+
|
|
34
|
+
if (!span) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
this.addAttributesToSpan({ span, attributes });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Add attributes to a specific span.
|
|
43
|
+
*/
|
|
44
|
+
public static addAttributesToSpan(data: {
|
|
45
|
+
span: Span;
|
|
46
|
+
attributes: SpanAttributes;
|
|
47
|
+
}): void {
|
|
48
|
+
const { span, attributes } = data;
|
|
49
|
+
|
|
50
|
+
for (const key in attributes) {
|
|
51
|
+
const value: string | number | boolean | undefined = attributes[key];
|
|
52
|
+
|
|
53
|
+
if (value !== undefined && value !== null) {
|
|
54
|
+
span.setAttribute(key, value);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Build span attributes from a request-like object.
|
|
61
|
+
* Similar to getLogAttributesFromRequest in Logger but for spans.
|
|
62
|
+
*/
|
|
63
|
+
public static getSpanAttributesFromRequest(
|
|
64
|
+
req?: {
|
|
65
|
+
requestId?: string;
|
|
66
|
+
tenantId?: { toString(): string };
|
|
67
|
+
userAuthorization?: { userId?: { toString(): string } };
|
|
68
|
+
} | null,
|
|
69
|
+
): SpanAttributes {
|
|
70
|
+
if (!req) {
|
|
71
|
+
return {};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const attributes: SpanAttributes = {};
|
|
75
|
+
|
|
76
|
+
if (req.requestId) {
|
|
77
|
+
attributes["requestId"] = req.requestId;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (req.tenantId) {
|
|
81
|
+
attributes["projectId"] = req.tenantId.toString();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (req.userAuthorization?.userId) {
|
|
85
|
+
attributes["userId"] = req.userAuthorization.userId.toString();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return attributes;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -49,7 +49,10 @@ export default class MicrosoftTeamsAlertActions {
|
|
|
49
49
|
}): Promise<void> {
|
|
50
50
|
const { teamsRequest, action } = data;
|
|
51
51
|
|
|
52
|
-
logger.debug("Handling Microsoft Teams alert action:"
|
|
52
|
+
logger.debug("Handling Microsoft Teams alert action:", {
|
|
53
|
+
projectId: teamsRequest.projectId.toString(),
|
|
54
|
+
actionType: action.actionType,
|
|
55
|
+
});
|
|
53
56
|
logger.debug(action);
|
|
54
57
|
|
|
55
58
|
try {
|
|
@@ -73,11 +76,17 @@ export default class MicrosoftTeamsAlertActions {
|
|
|
73
76
|
break;
|
|
74
77
|
|
|
75
78
|
default:
|
|
76
|
-
logger.debug("Unhandled alert action: " + action.actionType
|
|
79
|
+
logger.debug("Unhandled alert action: " + action.actionType, {
|
|
80
|
+
projectId: teamsRequest.projectId.toString(),
|
|
81
|
+
actionType: action.actionType,
|
|
82
|
+
});
|
|
77
83
|
break;
|
|
78
84
|
}
|
|
79
85
|
} catch (error) {
|
|
80
|
-
logger.error("Error handling Microsoft Teams alert action:"
|
|
86
|
+
logger.error("Error handling Microsoft Teams alert action:", {
|
|
87
|
+
projectId: teamsRequest.projectId.toString(),
|
|
88
|
+
actionType: action.actionType,
|
|
89
|
+
});
|
|
81
90
|
logger.error(error);
|
|
82
91
|
}
|
|
83
92
|
|
|
@@ -92,11 +101,16 @@ export default class MicrosoftTeamsAlertActions {
|
|
|
92
101
|
const alertId: string = data.action.actionValue || "";
|
|
93
102
|
|
|
94
103
|
if (!alertId) {
|
|
95
|
-
logger.error("No alert ID provided for acknowledge action"
|
|
104
|
+
logger.error("No alert ID provided for acknowledge action", {
|
|
105
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
106
|
+
});
|
|
96
107
|
return;
|
|
97
108
|
}
|
|
98
109
|
|
|
99
|
-
logger.debug("Acknowledging alert: " + alertId
|
|
110
|
+
logger.debug("Acknowledging alert: " + alertId, {
|
|
111
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
112
|
+
alertId: alertId,
|
|
113
|
+
});
|
|
100
114
|
|
|
101
115
|
try {
|
|
102
116
|
const alert: Alert | null = await AlertService.findOneBy({
|
|
@@ -119,12 +133,18 @@ export default class MicrosoftTeamsAlertActions {
|
|
|
119
133
|
});
|
|
120
134
|
|
|
121
135
|
if (!alert) {
|
|
122
|
-
logger.error("Alert not found: " + alertId
|
|
136
|
+
logger.error("Alert not found: " + alertId, {
|
|
137
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
138
|
+
alertId: alertId,
|
|
139
|
+
});
|
|
123
140
|
return;
|
|
124
141
|
}
|
|
125
142
|
|
|
126
143
|
if (alert.currentAlertState?.isAcknowledgedState) {
|
|
127
|
-
logger.debug("Alert is already acknowledged"
|
|
144
|
+
logger.debug("Alert is already acknowledged", {
|
|
145
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
146
|
+
alertId: alertId,
|
|
147
|
+
});
|
|
128
148
|
return;
|
|
129
149
|
}
|
|
130
150
|
|
|
@@ -139,9 +159,15 @@ export default class MicrosoftTeamsAlertActions {
|
|
|
139
159
|
oneUptimeUserId,
|
|
140
160
|
);
|
|
141
161
|
|
|
142
|
-
logger.debug("Alert acknowledged successfully"
|
|
162
|
+
logger.debug("Alert acknowledged successfully", {
|
|
163
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
164
|
+
alertId: alertId,
|
|
165
|
+
});
|
|
143
166
|
} catch (error) {
|
|
144
|
-
logger.error("Error acknowledging alert:"
|
|
167
|
+
logger.error("Error acknowledging alert:", {
|
|
168
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
169
|
+
alertId: alertId,
|
|
170
|
+
});
|
|
145
171
|
logger.error(error);
|
|
146
172
|
}
|
|
147
173
|
}
|
|
@@ -154,11 +180,16 @@ export default class MicrosoftTeamsAlertActions {
|
|
|
154
180
|
const alertId: string = data.action.actionValue || "";
|
|
155
181
|
|
|
156
182
|
if (!alertId) {
|
|
157
|
-
logger.error("No alert ID provided for resolve action"
|
|
183
|
+
logger.error("No alert ID provided for resolve action", {
|
|
184
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
185
|
+
});
|
|
158
186
|
return;
|
|
159
187
|
}
|
|
160
188
|
|
|
161
|
-
logger.debug("Resolving alert: " + alertId
|
|
189
|
+
logger.debug("Resolving alert: " + alertId, {
|
|
190
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
191
|
+
alertId: alertId,
|
|
192
|
+
});
|
|
162
193
|
|
|
163
194
|
try {
|
|
164
195
|
const alert: Alert | null = await AlertService.findOneBy({
|
|
@@ -181,12 +212,18 @@ export default class MicrosoftTeamsAlertActions {
|
|
|
181
212
|
});
|
|
182
213
|
|
|
183
214
|
if (!alert) {
|
|
184
|
-
logger.error("Alert not found: " + alertId
|
|
215
|
+
logger.error("Alert not found: " + alertId, {
|
|
216
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
217
|
+
alertId: alertId,
|
|
218
|
+
});
|
|
185
219
|
return;
|
|
186
220
|
}
|
|
187
221
|
|
|
188
222
|
if (alert.currentAlertState?.isResolvedState) {
|
|
189
|
-
logger.debug("Alert is already resolved"
|
|
223
|
+
logger.debug("Alert is already resolved", {
|
|
224
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
225
|
+
alertId: alertId,
|
|
226
|
+
});
|
|
190
227
|
return;
|
|
191
228
|
}
|
|
192
229
|
|
|
@@ -198,9 +235,15 @@ export default class MicrosoftTeamsAlertActions {
|
|
|
198
235
|
|
|
199
236
|
await AlertService.resolveAlert(new ObjectID(alertId), oneUptimeUserId);
|
|
200
237
|
|
|
201
|
-
logger.debug("Alert resolved successfully"
|
|
238
|
+
logger.debug("Alert resolved successfully", {
|
|
239
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
240
|
+
alertId: alertId,
|
|
241
|
+
});
|
|
202
242
|
} catch (error) {
|
|
203
|
-
logger.error("Error resolving alert:"
|
|
243
|
+
logger.error("Error resolving alert:", {
|
|
244
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
245
|
+
alertId: alertId,
|
|
246
|
+
});
|
|
204
247
|
logger.error(error);
|
|
205
248
|
}
|
|
206
249
|
}
|
|
@@ -58,7 +58,10 @@ export default class MicrosoftTeamsAlertEpisodeActions {
|
|
|
58
58
|
}): Promise<void> {
|
|
59
59
|
const { teamsRequest, action } = data;
|
|
60
60
|
|
|
61
|
-
logger.debug("Handling Microsoft Teams alert episode action:"
|
|
61
|
+
logger.debug("Handling Microsoft Teams alert episode action:", {
|
|
62
|
+
projectId: teamsRequest.projectId.toString(),
|
|
63
|
+
actionType: action.actionType,
|
|
64
|
+
});
|
|
62
65
|
logger.debug(action);
|
|
63
66
|
|
|
64
67
|
try {
|
|
@@ -82,11 +85,17 @@ export default class MicrosoftTeamsAlertEpisodeActions {
|
|
|
82
85
|
break;
|
|
83
86
|
|
|
84
87
|
default:
|
|
85
|
-
logger.debug("Unhandled alert episode action: " + action.actionType
|
|
88
|
+
logger.debug("Unhandled alert episode action: " + action.actionType, {
|
|
89
|
+
projectId: teamsRequest.projectId.toString(),
|
|
90
|
+
actionType: action.actionType,
|
|
91
|
+
});
|
|
86
92
|
break;
|
|
87
93
|
}
|
|
88
94
|
} catch (error) {
|
|
89
|
-
logger.error("Error handling Microsoft Teams alert episode action:"
|
|
95
|
+
logger.error("Error handling Microsoft Teams alert episode action:", {
|
|
96
|
+
projectId: teamsRequest.projectId.toString(),
|
|
97
|
+
actionType: action.actionType,
|
|
98
|
+
});
|
|
90
99
|
logger.error(error);
|
|
91
100
|
}
|
|
92
101
|
|
|
@@ -101,11 +110,16 @@ export default class MicrosoftTeamsAlertEpisodeActions {
|
|
|
101
110
|
const episodeId: string = data.action.actionValue || "";
|
|
102
111
|
|
|
103
112
|
if (!episodeId) {
|
|
104
|
-
logger.error("No episode ID provided for acknowledge action"
|
|
113
|
+
logger.error("No episode ID provided for acknowledge action", {
|
|
114
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
115
|
+
});
|
|
105
116
|
return;
|
|
106
117
|
}
|
|
107
118
|
|
|
108
|
-
logger.debug("Acknowledging alert episode: " + episodeId
|
|
119
|
+
logger.debug("Acknowledging alert episode: " + episodeId, {
|
|
120
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
121
|
+
alertEpisodeId: episodeId,
|
|
122
|
+
});
|
|
109
123
|
|
|
110
124
|
try {
|
|
111
125
|
const episode: AlertEpisode | null = await AlertEpisodeService.findOneBy({
|
|
@@ -128,12 +142,18 @@ export default class MicrosoftTeamsAlertEpisodeActions {
|
|
|
128
142
|
});
|
|
129
143
|
|
|
130
144
|
if (!episode) {
|
|
131
|
-
logger.error("Alert episode not found: " + episodeId
|
|
145
|
+
logger.error("Alert episode not found: " + episodeId, {
|
|
146
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
147
|
+
alertEpisodeId: episodeId,
|
|
148
|
+
});
|
|
132
149
|
return;
|
|
133
150
|
}
|
|
134
151
|
|
|
135
152
|
if (episode.currentAlertState?.isAcknowledgedState) {
|
|
136
|
-
logger.debug("Alert episode is already acknowledged"
|
|
153
|
+
logger.debug("Alert episode is already acknowledged", {
|
|
154
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
155
|
+
alertEpisodeId: episodeId,
|
|
156
|
+
});
|
|
137
157
|
return;
|
|
138
158
|
}
|
|
139
159
|
|
|
@@ -148,9 +168,15 @@ export default class MicrosoftTeamsAlertEpisodeActions {
|
|
|
148
168
|
oneUptimeUserId,
|
|
149
169
|
);
|
|
150
170
|
|
|
151
|
-
logger.debug("Alert episode acknowledged successfully"
|
|
171
|
+
logger.debug("Alert episode acknowledged successfully", {
|
|
172
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
173
|
+
alertEpisodeId: episodeId,
|
|
174
|
+
});
|
|
152
175
|
} catch (error) {
|
|
153
|
-
logger.error("Error acknowledging alert episode:"
|
|
176
|
+
logger.error("Error acknowledging alert episode:", {
|
|
177
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
178
|
+
alertEpisodeId: episodeId,
|
|
179
|
+
});
|
|
154
180
|
logger.error(error);
|
|
155
181
|
}
|
|
156
182
|
}
|
|
@@ -163,11 +189,16 @@ export default class MicrosoftTeamsAlertEpisodeActions {
|
|
|
163
189
|
const episodeId: string = data.action.actionValue || "";
|
|
164
190
|
|
|
165
191
|
if (!episodeId) {
|
|
166
|
-
logger.error("No episode ID provided for resolve action"
|
|
192
|
+
logger.error("No episode ID provided for resolve action", {
|
|
193
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
194
|
+
});
|
|
167
195
|
return;
|
|
168
196
|
}
|
|
169
197
|
|
|
170
|
-
logger.debug("Resolving alert episode: " + episodeId
|
|
198
|
+
logger.debug("Resolving alert episode: " + episodeId, {
|
|
199
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
200
|
+
alertEpisodeId: episodeId,
|
|
201
|
+
});
|
|
171
202
|
|
|
172
203
|
try {
|
|
173
204
|
const episode: AlertEpisode | null = await AlertEpisodeService.findOneBy({
|
|
@@ -190,12 +221,18 @@ export default class MicrosoftTeamsAlertEpisodeActions {
|
|
|
190
221
|
});
|
|
191
222
|
|
|
192
223
|
if (!episode) {
|
|
193
|
-
logger.error("Alert episode not found: " + episodeId
|
|
224
|
+
logger.error("Alert episode not found: " + episodeId, {
|
|
225
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
226
|
+
alertEpisodeId: episodeId,
|
|
227
|
+
});
|
|
194
228
|
return;
|
|
195
229
|
}
|
|
196
230
|
|
|
197
231
|
if (episode.currentAlertState?.isResolvedState) {
|
|
198
|
-
logger.debug("Alert episode is already resolved"
|
|
232
|
+
logger.debug("Alert episode is already resolved", {
|
|
233
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
234
|
+
alertEpisodeId: episodeId,
|
|
235
|
+
});
|
|
199
236
|
return;
|
|
200
237
|
}
|
|
201
238
|
|
|
@@ -210,9 +247,15 @@ export default class MicrosoftTeamsAlertEpisodeActions {
|
|
|
210
247
|
oneUptimeUserId,
|
|
211
248
|
);
|
|
212
249
|
|
|
213
|
-
logger.debug("Alert episode resolved successfully"
|
|
250
|
+
logger.debug("Alert episode resolved successfully", {
|
|
251
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
252
|
+
alertEpisodeId: episodeId,
|
|
253
|
+
});
|
|
214
254
|
} catch (error) {
|
|
215
|
-
logger.error("Error resolving alert episode:"
|
|
255
|
+
logger.error("Error resolving alert episode:", {
|
|
256
|
+
projectId: data.teamsRequest.projectId.toString(),
|
|
257
|
+
alertEpisodeId: episodeId,
|
|
258
|
+
});
|
|
216
259
|
logger.error(error);
|
|
217
260
|
}
|
|
218
261
|
}
|
|
@@ -100,7 +100,9 @@ export default class MicrosoftTeamsAuthAction {
|
|
|
100
100
|
|
|
101
101
|
// Find the project associated with this team
|
|
102
102
|
if (!teamId) {
|
|
103
|
-
logger.debug("No team ID found in payload"
|
|
103
|
+
logger.debug("No team ID found in payload", {
|
|
104
|
+
tenantId: tenantId,
|
|
105
|
+
});
|
|
104
106
|
return {
|
|
105
107
|
isAuthorized: false,
|
|
106
108
|
projectId: new ObjectID(""),
|
|
@@ -130,7 +132,10 @@ export default class MicrosoftTeamsAuthAction {
|
|
|
130
132
|
},
|
|
131
133
|
});
|
|
132
134
|
} catch (error) {
|
|
133
|
-
logger.debug("Error finding project auth token:"
|
|
135
|
+
logger.debug("Error finding project auth token:", {
|
|
136
|
+
teamId: teamId,
|
|
137
|
+
tenantId: tenantId,
|
|
138
|
+
});
|
|
134
139
|
logger.debug(error);
|
|
135
140
|
return {
|
|
136
141
|
isAuthorized: false,
|
|
@@ -142,7 +147,10 @@ export default class MicrosoftTeamsAuthAction {
|
|
|
142
147
|
}
|
|
143
148
|
|
|
144
149
|
if (!projectAuthToken) {
|
|
145
|
-
logger.debug(`No project auth token found for team: ${teamId}
|
|
150
|
+
logger.debug(`No project auth token found for team: ${teamId}`, {
|
|
151
|
+
teamId: teamId,
|
|
152
|
+
tenantId: tenantId,
|
|
153
|
+
});
|
|
146
154
|
return {
|
|
147
155
|
isAuthorized: false,
|
|
148
156
|
projectId: new ObjectID(""),
|
|
@@ -219,6 +227,10 @@ export default class MicrosoftTeamsAuthAction {
|
|
|
219
227
|
if (workspaceUserAuthToken && workspaceUserAuthToken.userId) {
|
|
220
228
|
logger.debug(
|
|
221
229
|
"Found OneUptime user for Teams user: " + data.teamsUserId,
|
|
230
|
+
{
|
|
231
|
+
projectId: data.projectId.toString(),
|
|
232
|
+
workspaceUserId: data.teamsUserId,
|
|
233
|
+
},
|
|
222
234
|
);
|
|
223
235
|
return workspaceUserAuthToken.userId;
|
|
224
236
|
}
|
|
@@ -229,6 +241,10 @@ export default class MicrosoftTeamsAuthAction {
|
|
|
229
241
|
} catch (error) {
|
|
230
242
|
logger.error(
|
|
231
243
|
"Error finding OneUptime user for Teams user: " + data.teamsUserId,
|
|
244
|
+
{
|
|
245
|
+
projectId: data.projectId.toString(),
|
|
246
|
+
workspaceUserId: data.teamsUserId,
|
|
247
|
+
},
|
|
232
248
|
);
|
|
233
249
|
logger.error(error);
|
|
234
250
|
throw error;
|