@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
package/Server/API/UserSmsAPI.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
OneUptimeRequest,
|
|
11
11
|
} from "../Utils/Express";
|
|
12
12
|
import Response from "../Utils/Response";
|
|
13
|
-
import logger from "../Utils/Logger";
|
|
13
|
+
import logger, { getLogAttributesFromRequest } from "../Utils/Logger";
|
|
14
14
|
import BaseAPI from "./BaseAPI";
|
|
15
15
|
import BadDataException from "../../Types/Exception/BadDataException";
|
|
16
16
|
import ObjectID from "../../Types/ObjectID";
|
|
@@ -107,7 +107,10 @@ export default class UserSMSAPI extends BaseAPI<UserSMS, UserSMSServiceType> {
|
|
|
107
107
|
},
|
|
108
108
|
);
|
|
109
109
|
} catch (e) {
|
|
110
|
-
logger.error(
|
|
110
|
+
logger.error(
|
|
111
|
+
e,
|
|
112
|
+
getLogAttributesFromRequest(req as OneUptimeRequest),
|
|
113
|
+
);
|
|
111
114
|
}
|
|
112
115
|
|
|
113
116
|
return Response.sendEmptySuccessResponse(req, res);
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
OneUptimeRequest,
|
|
11
11
|
} from "../Utils/Express";
|
|
12
12
|
import Response from "../Utils/Response";
|
|
13
|
-
import logger from "../Utils/Logger";
|
|
13
|
+
import logger, { getLogAttributesFromRequest } from "../Utils/Logger";
|
|
14
14
|
import BaseAPI from "./BaseAPI";
|
|
15
15
|
import BadDataException from "../../Types/Exception/BadDataException";
|
|
16
16
|
import ObjectID from "../../Types/ObjectID";
|
|
@@ -116,7 +116,10 @@ export default class UserWhatsAppAPI extends BaseAPI<
|
|
|
116
116
|
},
|
|
117
117
|
);
|
|
118
118
|
} catch (e) {
|
|
119
|
-
logger.error(
|
|
119
|
+
logger.error(
|
|
120
|
+
e,
|
|
121
|
+
getLogAttributesFromRequest(req as OneUptimeRequest),
|
|
122
|
+
);
|
|
120
123
|
}
|
|
121
124
|
|
|
122
125
|
return Response.sendEmptySuccessResponse(req, res);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class MigrationName1774559064921 implements MigrationInterface {
|
|
4
|
+
public name = "MigrationName1774559064921";
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
/*
|
|
8
|
+
* First, deduplicate existing services by keeping the oldest one (smallest _id / earliest createdAt).
|
|
9
|
+
* Reassign any foreign key references from duplicate services to the kept service,
|
|
10
|
+
* then delete the duplicates.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Find and delete duplicate services, keeping the one with the earliest createdAt.
|
|
15
|
+
* For each (projectId, name) group with duplicates, keep the min(_id) row.
|
|
16
|
+
*/
|
|
17
|
+
await queryRunner.query(`
|
|
18
|
+
DELETE FROM "Service"
|
|
19
|
+
WHERE "_id" IN (
|
|
20
|
+
SELECT s."_id"
|
|
21
|
+
FROM "Service" s
|
|
22
|
+
INNER JOIN (
|
|
23
|
+
SELECT "projectId", LOWER("name") as lower_name, MIN("createdAt") as min_created
|
|
24
|
+
FROM "Service"
|
|
25
|
+
WHERE "deletedAt" IS NULL
|
|
26
|
+
GROUP BY "projectId", LOWER("name")
|
|
27
|
+
HAVING COUNT(*) > 1
|
|
28
|
+
) dups
|
|
29
|
+
ON s."projectId" = dups."projectId"
|
|
30
|
+
AND LOWER(s."name") = dups.lower_name
|
|
31
|
+
AND s."createdAt" > dups.min_created
|
|
32
|
+
AND s."deletedAt" IS NULL
|
|
33
|
+
)
|
|
34
|
+
`);
|
|
35
|
+
|
|
36
|
+
// Now add a unique index on (projectId, name) for non-deleted rows.
|
|
37
|
+
await queryRunner.query(
|
|
38
|
+
`CREATE UNIQUE INDEX "IDX_SERVICE_PROJECT_NAME_UNIQUE" ON "Service" ("projectId", LOWER("name")) WHERE "deletedAt" IS NULL`,
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
43
|
+
await queryRunner.query(
|
|
44
|
+
`DROP INDEX IF EXISTS "IDX_SERVICE_PROJECT_NAME_UNIQUE"`,
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class MigrationName1775735059360 implements MigrationInterface {
|
|
4
|
+
public name = "MigrationName1775735059360";
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(
|
|
8
|
+
`DROP INDEX "public"."IDX_SERVICE_PROJECT_NAME_UNIQUE"`,
|
|
9
|
+
);
|
|
10
|
+
await queryRunner.query(
|
|
11
|
+
`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "rotation" SET DEFAULT '{"_type":"Recurring","value":{"intervalType":"Day","intervalCount":{"_type":"PositiveNumber","value":1}}}'`,
|
|
12
|
+
);
|
|
13
|
+
await queryRunner.query(
|
|
14
|
+
`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type":"RestrictionTimes","value":{"restictionType":"None","dayRestrictionTimes":null,"weeklyRestrictionTimes":[]}}'`,
|
|
15
|
+
);
|
|
16
|
+
await queryRunner.query(
|
|
17
|
+
`ALTER TABLE "Workflow" ALTER COLUMN "webhookSecretKey" TYPE character varying`,
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
22
|
+
await queryRunner.query(
|
|
23
|
+
`ALTER TABLE "Workflow" ALTER COLUMN "webhookSecretKey" TYPE text`,
|
|
24
|
+
);
|
|
25
|
+
await queryRunner.query(
|
|
26
|
+
`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type": "RestrictionTimes", "value": {"restictionType": "None", "dayRestrictionTimes": null, "weeklyRestrictionTimes": []}}'`,
|
|
27
|
+
);
|
|
28
|
+
await queryRunner.query(
|
|
29
|
+
`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "rotation" SET DEFAULT '{"_type": "Recurring", "value": {"intervalType": "Day", "intervalCount": {"_type": "PositiveNumber", "value": 1}}}'`,
|
|
30
|
+
);
|
|
31
|
+
await queryRunner.query(
|
|
32
|
+
`CREATE UNIQUE INDEX "IDX_SERVICE_PROJECT_NAME_UNIQUE" ON "Service" ("projectId") WHERE ("deletedAt" IS NULL)`,
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -275,6 +275,8 @@ import { MigrationName1774524742178 } from "./1774524742178-MigrationName";
|
|
|
275
275
|
import { MigrationName1774524742179 } from "./1774524742179-MigrationName";
|
|
276
276
|
import { MigrationName1774559064919 } from "./1774559064919-MigrationName";
|
|
277
277
|
import { MigrationName1774559064920 } from "./1774559064920-MigrationName";
|
|
278
|
+
import { MigrationName1774559064921 } from "./1774559064921-MigrationName";
|
|
279
|
+
import { MigrationName1775735059360 } from "./1775735059360-MigrationName";
|
|
278
280
|
|
|
279
281
|
export default [
|
|
280
282
|
InitialMigration,
|
|
@@ -554,4 +556,6 @@ export default [
|
|
|
554
556
|
MigrationName1774524742179,
|
|
555
557
|
MigrationName1774559064919,
|
|
556
558
|
MigrationName1774559064920,
|
|
559
|
+
MigrationName1774559064921,
|
|
560
|
+
MigrationName1775735059360,
|
|
557
561
|
];
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "../Utils/Express";
|
|
7
7
|
import JSONWebToken from "../Utils/JsonWebToken";
|
|
8
8
|
import Response from "../Utils/Response";
|
|
9
|
-
import logger from "../Utils/Logger";
|
|
9
|
+
import logger, { getLogAttributesFromRequest } from "../Utils/Logger";
|
|
10
10
|
import { OnCallInputRequest } from "../../Types/Call/CallRequest";
|
|
11
11
|
import BadDataException from "../../Types/Exception/BadDataException";
|
|
12
12
|
import JSONFunctions from "../../Types/JSONFunctions";
|
|
@@ -62,7 +62,7 @@ export default class NotificationMiddleware {
|
|
|
62
62
|
JSONWebToken.decodeJsonPayload(token),
|
|
63
63
|
);
|
|
64
64
|
} catch (e) {
|
|
65
|
-
logger.error(e);
|
|
65
|
+
logger.error(e, getLogAttributesFromRequest(req as any));
|
|
66
66
|
return Response.sendErrorResponse(
|
|
67
67
|
req,
|
|
68
68
|
res,
|
|
@@ -19,6 +19,7 @@ import GlobalConfig from "../../Models/DatabaseModels/GlobalConfig";
|
|
|
19
19
|
import User from "../../Models/DatabaseModels/User";
|
|
20
20
|
import APIKeyAccessPermission from "../Utils/APIKey/AccessPermission";
|
|
21
21
|
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
22
|
+
import SpanUtil from "../Utils/Telemetry/SpanUtil";
|
|
22
23
|
|
|
23
24
|
export default class ProjectMiddleware {
|
|
24
25
|
@CaptureSpan()
|
|
@@ -75,6 +76,11 @@ export default class ProjectMiddleware {
|
|
|
75
76
|
|
|
76
77
|
if (tenantId) {
|
|
77
78
|
(req as OneUptimeRequest).tenantId = tenantId;
|
|
79
|
+
|
|
80
|
+
// Tag the current span with project context for observability
|
|
81
|
+
SpanUtil.addAttributesToCurrentSpan({
|
|
82
|
+
projectId: tenantId.toString(),
|
|
83
|
+
});
|
|
78
84
|
}
|
|
79
85
|
|
|
80
86
|
if (!apiKey) {
|
|
@@ -12,7 +12,7 @@ import StatusPageSCIM from "../../Models/DatabaseModels/StatusPageSCIM";
|
|
|
12
12
|
import NotAuthorizedException from "../../Types/Exception/NotAuthorizedException";
|
|
13
13
|
import BadRequestException from "../../Types/Exception/BadRequestException";
|
|
14
14
|
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
15
|
-
import logger from "../Utils/Logger";
|
|
15
|
+
import logger, { getLogAttributesFromRequest } from "../Utils/Logger";
|
|
16
16
|
|
|
17
17
|
export default class SCIMMiddleware {
|
|
18
18
|
@CaptureSpan()
|
|
@@ -44,6 +44,7 @@ export default class SCIMMiddleware {
|
|
|
44
44
|
`SCIM Authorization: scimId=${scimId}, bearerToken=${
|
|
45
45
|
bearerToken ? "***" : "missing"
|
|
46
46
|
}`,
|
|
47
|
+
getLogAttributesFromRequest(req as OneUptimeRequest),
|
|
47
48
|
);
|
|
48
49
|
|
|
49
50
|
if (!bearerToken) {
|
|
@@ -7,7 +7,7 @@ import Response from "../Utils/Response";
|
|
|
7
7
|
import BadDataException from "../../Types/Exception/BadDataException";
|
|
8
8
|
import { SlackAppSigningSecret } from "../EnvironmentConfig";
|
|
9
9
|
import crypto from "crypto";
|
|
10
|
-
import logger from "../Utils/Logger";
|
|
10
|
+
import logger, { getLogAttributesFromRequest } from "../Utils/Logger";
|
|
11
11
|
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
12
12
|
|
|
13
13
|
export default class SlackAuthorization {
|
|
@@ -17,10 +17,16 @@ export default class SlackAuthorization {
|
|
|
17
17
|
res: ExpressResponse,
|
|
18
18
|
next: NextFunction,
|
|
19
19
|
): Promise<void> {
|
|
20
|
-
logger.debug(
|
|
20
|
+
logger.debug(
|
|
21
|
+
"Starting Slack request authorization",
|
|
22
|
+
getLogAttributesFromRequest(req),
|
|
23
|
+
);
|
|
21
24
|
|
|
22
25
|
if (!SlackAppSigningSecret) {
|
|
23
|
-
logger.error(
|
|
26
|
+
logger.error(
|
|
27
|
+
"SLACK_APP_SIGNING_SECRET env variable not found.",
|
|
28
|
+
getLogAttributesFromRequest(req),
|
|
29
|
+
);
|
|
24
30
|
return Response.sendErrorResponse(
|
|
25
31
|
req,
|
|
26
32
|
res,
|
|
@@ -43,15 +49,21 @@ export default class SlackAuthorization {
|
|
|
43
49
|
(req as OneUptimeRequest).rawFormUrlEncodedBody ||
|
|
44
50
|
"";
|
|
45
51
|
|
|
46
|
-
logger.debug(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
logger.debug(
|
|
53
|
+
`slackSignature: ${slackSignature}`,
|
|
54
|
+
getLogAttributesFromRequest(req),
|
|
55
|
+
);
|
|
56
|
+
logger.debug(`timestamp: ${timestamp}`, getLogAttributesFromRequest(req));
|
|
57
|
+
logger.debug(`requestBody: `, getLogAttributesFromRequest(req));
|
|
58
|
+
logger.debug(requestBody, getLogAttributesFromRequest(req));
|
|
50
59
|
|
|
51
60
|
const baseString: string = `v0:${timestamp}:${requestBody}`;
|
|
52
61
|
const signature: string = `v0=${crypto.createHmac("sha256", slackSigningSecret).update(baseString).digest("hex")}`;
|
|
53
62
|
|
|
54
|
-
logger.debug(
|
|
63
|
+
logger.debug(
|
|
64
|
+
`Generated signature: ${signature}`,
|
|
65
|
+
getLogAttributesFromRequest(req),
|
|
66
|
+
);
|
|
55
67
|
|
|
56
68
|
// check if the signature is valid
|
|
57
69
|
if (
|
|
@@ -60,7 +72,10 @@ export default class SlackAuthorization {
|
|
|
60
72
|
Buffer.from(slackSignature) as Uint8Array,
|
|
61
73
|
)
|
|
62
74
|
) {
|
|
63
|
-
logger.error(
|
|
75
|
+
logger.error(
|
|
76
|
+
"Slack Signature Verification Failed.",
|
|
77
|
+
getLogAttributesFromRequest(req),
|
|
78
|
+
);
|
|
64
79
|
return Response.sendErrorResponse(
|
|
65
80
|
req,
|
|
66
81
|
res,
|
|
@@ -68,7 +83,10 @@ export default class SlackAuthorization {
|
|
|
68
83
|
);
|
|
69
84
|
}
|
|
70
85
|
|
|
71
|
-
logger.debug(
|
|
86
|
+
logger.debug(
|
|
87
|
+
"Slack request authorized successfully",
|
|
88
|
+
getLogAttributesFromRequest(req),
|
|
89
|
+
);
|
|
72
90
|
next();
|
|
73
91
|
}
|
|
74
92
|
}
|
|
@@ -9,8 +9,9 @@ import {
|
|
|
9
9
|
import TelemetryIngestionKeyService from "../../Server/Services/TelemetryIngestionKeyService";
|
|
10
10
|
import TelemetryIngestionKey from "../../Models/DatabaseModels/TelemetryIngestionKey";
|
|
11
11
|
import Response from "../Utils/Response";
|
|
12
|
-
import logger from "../Utils/Logger";
|
|
12
|
+
import logger, { getLogAttributesFromRequest } from "../Utils/Logger";
|
|
13
13
|
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
14
|
+
import SpanUtil from "../Utils/Telemetry/SpanUtil";
|
|
14
15
|
|
|
15
16
|
export interface TelemetryRequest extends ExpressRequest {
|
|
16
17
|
projectId: ObjectID; // Project ID
|
|
@@ -41,7 +42,10 @@ export default class TelemetryIngest {
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
if (!oneuptimeToken) {
|
|
44
|
-
logger.error(
|
|
45
|
+
logger.error(
|
|
46
|
+
"Missing header: x-oneuptime-token",
|
|
47
|
+
getLogAttributesFromRequest(req as any),
|
|
48
|
+
);
|
|
45
49
|
|
|
46
50
|
if (isOpenTelemetryAPI) {
|
|
47
51
|
/*
|
|
@@ -70,7 +74,10 @@ export default class TelemetryIngest {
|
|
|
70
74
|
});
|
|
71
75
|
|
|
72
76
|
if (!token) {
|
|
73
|
-
logger.error(
|
|
77
|
+
logger.error(
|
|
78
|
+
"Invalid service token: " + oneuptimeToken,
|
|
79
|
+
getLogAttributesFromRequest(req as any),
|
|
80
|
+
);
|
|
74
81
|
|
|
75
82
|
if (isOpenTelemetryAPI) {
|
|
76
83
|
/*
|
|
@@ -90,6 +97,7 @@ export default class TelemetryIngest {
|
|
|
90
97
|
if (!projectId) {
|
|
91
98
|
logger.error(
|
|
92
99
|
"Project ID not found for service token: " + oneuptimeToken,
|
|
100
|
+
getLogAttributesFromRequest(req as any),
|
|
93
101
|
);
|
|
94
102
|
|
|
95
103
|
if (isOpenTelemetryAPI) {
|
|
@@ -107,6 +115,11 @@ export default class TelemetryIngest {
|
|
|
107
115
|
|
|
108
116
|
(req as TelemetryRequest).projectId = projectId as ObjectID;
|
|
109
117
|
|
|
118
|
+
// Tag span with project context for telemetry ingestion observability
|
|
119
|
+
SpanUtil.addAttributesToCurrentSpan({
|
|
120
|
+
projectId: projectId.toString(),
|
|
121
|
+
});
|
|
122
|
+
|
|
110
123
|
next();
|
|
111
124
|
} catch (err) {
|
|
112
125
|
return next(err);
|
|
@@ -11,9 +11,10 @@ import {
|
|
|
11
11
|
} from "../Utils/Express";
|
|
12
12
|
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
13
13
|
import JSONWebToken from "../Utils/JsonWebToken";
|
|
14
|
-
import logger from "../Utils/Logger";
|
|
14
|
+
import logger, { getLogAttributesFromRequest } from "../Utils/Logger";
|
|
15
15
|
import Response from "../Utils/Response";
|
|
16
16
|
import ProjectMiddleware from "./ProjectAuthorization";
|
|
17
|
+
import SpanUtil from "../Utils/Telemetry/SpanUtil";
|
|
17
18
|
import { LIMIT_PER_PROJECT } from "../../Types/Database/LimitMax";
|
|
18
19
|
import OneUptimeDate from "../../Types/Date";
|
|
19
20
|
import Dictionary from "../../Types/Dictionary";
|
|
@@ -104,7 +105,10 @@ export default class UserMiddleware {
|
|
|
104
105
|
value as string,
|
|
105
106
|
).projectId?.toString();
|
|
106
107
|
} catch (err) {
|
|
107
|
-
logger.error(
|
|
108
|
+
logger.error(
|
|
109
|
+
err,
|
|
110
|
+
getLogAttributesFromRequest(req as OneUptimeRequest),
|
|
111
|
+
);
|
|
108
112
|
continue;
|
|
109
113
|
}
|
|
110
114
|
|
|
@@ -146,12 +150,15 @@ export default class UserMiddleware {
|
|
|
146
150
|
ssoTokens[projectId] = token;
|
|
147
151
|
}
|
|
148
152
|
} catch (err) {
|
|
149
|
-
logger.error(
|
|
153
|
+
logger.error(
|
|
154
|
+
err,
|
|
155
|
+
getLogAttributesFromRequest(req as OneUptimeRequest),
|
|
156
|
+
);
|
|
150
157
|
continue;
|
|
151
158
|
}
|
|
152
159
|
}
|
|
153
160
|
} catch (err) {
|
|
154
|
-
logger.error(err);
|
|
161
|
+
logger.error(err, getLogAttributesFromRequest(req as OneUptimeRequest));
|
|
155
162
|
}
|
|
156
163
|
}
|
|
157
164
|
|
|
@@ -217,7 +224,7 @@ export default class UserMiddleware {
|
|
|
217
224
|
oneuptimeRequest.userAuthorization = JSONWebToken.decode(accessToken);
|
|
218
225
|
} catch (err) {
|
|
219
226
|
// if the token is invalid or expired, return 401 so clients can refresh the token.
|
|
220
|
-
logger.error(err);
|
|
227
|
+
logger.error(err, getLogAttributesFromRequest(oneuptimeRequest));
|
|
221
228
|
return Response.sendErrorResponse(
|
|
222
229
|
req,
|
|
223
230
|
res,
|
|
@@ -235,6 +242,16 @@ export default class UserMiddleware {
|
|
|
235
242
|
|
|
236
243
|
const userId: string = oneuptimeRequest.userAuthorization.userId.toString();
|
|
237
244
|
|
|
245
|
+
// Tag the current span with user and project context for observability
|
|
246
|
+
SpanUtil.addAttributesToCurrentSpan({
|
|
247
|
+
userId: userId,
|
|
248
|
+
userType: oneuptimeRequest.userType,
|
|
249
|
+
...(tenantId ? { projectId: tenantId.toString() } : {}),
|
|
250
|
+
...(oneuptimeRequest.requestId
|
|
251
|
+
? { requestId: oneuptimeRequest.requestId }
|
|
252
|
+
: {}),
|
|
253
|
+
});
|
|
254
|
+
|
|
238
255
|
await UserService.updateOneBy({
|
|
239
256
|
query: {
|
|
240
257
|
_id: userId,
|
|
@@ -9,7 +9,7 @@ import GlobalConfig from "../../Models/DatabaseModels/GlobalConfig";
|
|
|
9
9
|
import GlobalConfigService from "../Services/GlobalConfigService";
|
|
10
10
|
import ObjectID from "../../Types/ObjectID";
|
|
11
11
|
import crypto from "crypto";
|
|
12
|
-
import logger from "../Utils/Logger";
|
|
12
|
+
import logger, { getLogAttributesFromRequest } from "../Utils/Logger";
|
|
13
13
|
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
14
14
|
|
|
15
15
|
export default class WhatsAppAuthorization {
|
|
@@ -19,7 +19,10 @@ export default class WhatsAppAuthorization {
|
|
|
19
19
|
res: ExpressResponse,
|
|
20
20
|
next: NextFunction,
|
|
21
21
|
): Promise<void> {
|
|
22
|
-
logger.debug(
|
|
22
|
+
logger.debug(
|
|
23
|
+
"Starting WhatsApp webhook signature verification",
|
|
24
|
+
getLogAttributesFromRequest(req),
|
|
25
|
+
);
|
|
23
26
|
|
|
24
27
|
const signature: string | undefined = req.headers["x-hub-signature-256"] as
|
|
25
28
|
| string
|
|
@@ -28,6 +31,7 @@ export default class WhatsAppAuthorization {
|
|
|
28
31
|
if (!signature) {
|
|
29
32
|
logger.error(
|
|
30
33
|
"WhatsApp webhook request missing X-Hub-Signature-256 header.",
|
|
34
|
+
getLogAttributesFromRequest(req),
|
|
31
35
|
);
|
|
32
36
|
return Response.sendErrorResponse(
|
|
33
37
|
req,
|
|
@@ -55,6 +59,7 @@ export default class WhatsAppAuthorization {
|
|
|
55
59
|
if (!appSecret) {
|
|
56
60
|
logger.error(
|
|
57
61
|
"Meta WhatsApp App Secret is not configured. Cannot verify webhook signature.",
|
|
62
|
+
getLogAttributesFromRequest(req),
|
|
58
63
|
);
|
|
59
64
|
return Response.sendErrorResponse(
|
|
60
65
|
req,
|
|
@@ -73,7 +78,10 @@ export default class WhatsAppAuthorization {
|
|
|
73
78
|
Buffer.from(signature) as Uint8Array,
|
|
74
79
|
)
|
|
75
80
|
) {
|
|
76
|
-
logger.error(
|
|
81
|
+
logger.error(
|
|
82
|
+
"WhatsApp webhook signature verification failed.",
|
|
83
|
+
getLogAttributesFromRequest(req),
|
|
84
|
+
);
|
|
77
85
|
return Response.sendErrorResponse(
|
|
78
86
|
req,
|
|
79
87
|
res,
|
|
@@ -81,7 +89,10 @@ export default class WhatsAppAuthorization {
|
|
|
81
89
|
);
|
|
82
90
|
}
|
|
83
91
|
|
|
84
|
-
logger.debug(
|
|
92
|
+
logger.debug(
|
|
93
|
+
"WhatsApp webhook signature verified successfully",
|
|
94
|
+
getLogAttributesFromRequest(req),
|
|
95
|
+
);
|
|
85
96
|
next();
|
|
86
97
|
}
|
|
87
98
|
}
|
|
@@ -19,7 +19,7 @@ import Dictionary from "../../Types/Dictionary";
|
|
|
19
19
|
import OneUptimeDate from "../../Types/Date";
|
|
20
20
|
import UserNotificationSettingService from "./UserNotificationSettingService";
|
|
21
21
|
import NotificationSettingEventType from "../../Types/NotificationSetting/NotificationSettingEventType";
|
|
22
|
-
import logger from "../Utils/Logger";
|
|
22
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
23
23
|
import { CallRequestMessage } from "../../Types/Call/CallRequest";
|
|
24
24
|
import { SMSMessage } from "../../Types/SMS/SMS";
|
|
25
25
|
import { EmailEnvelope } from "../../Types/Email/EmailMessage";
|
|
@@ -56,8 +56,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
56
56
|
OneUptimeDate.toString(lastAlive),
|
|
57
57
|
);
|
|
58
58
|
} catch (err) {
|
|
59
|
-
logger.error("Error in saving last alive in cache"
|
|
60
|
-
|
|
59
|
+
logger.error("Error in saving last alive in cache", {
|
|
60
|
+
aiAgentId: aiAgentId?.toString(),
|
|
61
|
+
} as LogAttributes);
|
|
62
|
+
logger.error(err, { aiAgentId: aiAgentId?.toString() } as LogAttributes);
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
|
|
@@ -95,8 +97,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
95
97
|
await this.saveLastAliveInCache(aiAgentId, now);
|
|
96
98
|
} catch (err) {
|
|
97
99
|
// failed to hit the cache, so we will hit the database
|
|
98
|
-
logger.error("Error in getting last alive from cache"
|
|
99
|
-
|
|
100
|
+
logger.error("Error in getting last alive from cache", {
|
|
101
|
+
aiAgentId: aiAgentId?.toString(),
|
|
102
|
+
} as LogAttributes);
|
|
103
|
+
logger.error(err, { aiAgentId: aiAgentId?.toString() } as LogAttributes);
|
|
100
104
|
}
|
|
101
105
|
|
|
102
106
|
return true;
|
|
@@ -485,8 +489,11 @@ export class Service extends DatabaseService<Model> {
|
|
|
485
489
|
} catch (e) {
|
|
486
490
|
logger.error(
|
|
487
491
|
"Error in sending AI agent status changed resource notification",
|
|
492
|
+
{ projectId: aiAgent.projectId?.toString() } as LogAttributes,
|
|
488
493
|
);
|
|
489
|
-
logger.error(e
|
|
494
|
+
logger.error(e, {
|
|
495
|
+
projectId: aiAgent.projectId?.toString(),
|
|
496
|
+
} as LogAttributes);
|
|
490
497
|
}
|
|
491
498
|
}
|
|
492
499
|
}
|
|
@@ -16,7 +16,7 @@ import LlmLogStatus from "../../Types/LlmLogStatus";
|
|
|
16
16
|
import ObjectID from "../../Types/ObjectID";
|
|
17
17
|
import BadDataException from "../../Types/Exception/BadDataException";
|
|
18
18
|
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
19
|
-
import logger from "../Utils/Logger";
|
|
19
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
20
20
|
|
|
21
21
|
export interface AILogRequest {
|
|
22
22
|
projectId: ObjectID;
|
|
@@ -200,8 +200,14 @@ export class Service extends BaseService {
|
|
|
200
200
|
// Check if auto-recharge is needed (do this async, don't wait)
|
|
201
201
|
AIBillingService.rechargeIfBalanceIsLow(request.projectId).catch(
|
|
202
202
|
(err: Error) => {
|
|
203
|
-
logger.error("Error during AI balance auto-recharge check:"
|
|
204
|
-
|
|
203
|
+
logger.error("Error during AI balance auto-recharge check:", {
|
|
204
|
+
projectId: request.projectId?.toString(),
|
|
205
|
+
userId: request.userId?.toString(),
|
|
206
|
+
} as LogAttributes);
|
|
207
|
+
logger.error(err, {
|
|
208
|
+
projectId: request.projectId?.toString(),
|
|
209
|
+
userId: request.userId?.toString(),
|
|
210
|
+
} as LogAttributes);
|
|
205
211
|
},
|
|
206
212
|
);
|
|
207
213
|
}
|
|
@@ -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 Model, {
|
|
10
10
|
AlertEpisodeFeedEventType,
|
|
@@ -107,12 +107,24 @@ export class Service extends DatabaseService<Model> {
|
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
} catch (e) {
|
|
110
|
-
logger.error("Error in sending notification to slack and teams"
|
|
111
|
-
|
|
110
|
+
logger.error("Error in sending notification to slack and teams", {
|
|
111
|
+
projectId: data.projectId?.toString(),
|
|
112
|
+
alertEpisodeId: data.alertEpisodeId?.toString(),
|
|
113
|
+
} as LogAttributes);
|
|
114
|
+
logger.error(e, {
|
|
115
|
+
projectId: data.projectId?.toString(),
|
|
116
|
+
alertEpisodeId: data.alertEpisodeId?.toString(),
|
|
117
|
+
} as LogAttributes);
|
|
112
118
|
}
|
|
113
119
|
} catch (error) {
|
|
114
|
-
logger.error("AlertEpisodeFeedService.createAlertEpisodeFeedItem"
|
|
115
|
-
|
|
120
|
+
logger.error("AlertEpisodeFeedService.createAlertEpisodeFeedItem", {
|
|
121
|
+
projectId: data.projectId?.toString(),
|
|
122
|
+
alertEpisodeId: data.alertEpisodeId?.toString(),
|
|
123
|
+
} as LogAttributes);
|
|
124
|
+
logger.error(error, {
|
|
125
|
+
projectId: data.projectId?.toString(),
|
|
126
|
+
alertEpisodeId: data.alertEpisodeId?.toString(),
|
|
127
|
+
} as LogAttributes);
|
|
116
128
|
// we dont want to throw the error here, as this is a non-critical operation
|
|
117
129
|
}
|
|
118
130
|
}
|
|
@@ -10,7 +10,7 @@ import AlertState from "../../Models/DatabaseModels/AlertState";
|
|
|
10
10
|
import AlertSeverity from "../../Models/DatabaseModels/AlertSeverity";
|
|
11
11
|
import SortOrder from "../../Types/BaseDatabase/SortOrder";
|
|
12
12
|
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
13
|
-
import logger from "../Utils/Logger";
|
|
13
|
+
import logger, { LogAttributes } from "../Utils/Logger";
|
|
14
14
|
import DatabaseCommonInteractionProps from "../../Types/BaseDatabase/DatabaseCommonInteractionProps";
|
|
15
15
|
import AlertEpisodeStateTimeline from "../../Models/DatabaseModels/AlertEpisodeStateTimeline";
|
|
16
16
|
import AlertEpisodeStateTimelineService from "./AlertEpisodeStateTimelineService";
|
|
@@ -134,6 +134,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
134
134
|
} catch (error) {
|
|
135
135
|
logger.error(
|
|
136
136
|
`Workspace operations failed in AlertEpisodeService.onCreateSuccess: ${error}`,
|
|
137
|
+
{
|
|
138
|
+
projectId: createdItem.projectId?.toString(),
|
|
139
|
+
alertEpisodeId: createdItem.id?.toString(),
|
|
140
|
+
} as LogAttributes,
|
|
137
141
|
);
|
|
138
142
|
}
|
|
139
143
|
})
|
|
@@ -152,6 +156,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
152
156
|
} catch (error) {
|
|
153
157
|
logger.error(
|
|
154
158
|
`Handle episode state change failed in AlertEpisodeService.onCreateSuccess: ${error}`,
|
|
159
|
+
{
|
|
160
|
+
projectId: createdItem.projectId?.toString(),
|
|
161
|
+
alertEpisodeId: createdItem.id?.toString(),
|
|
162
|
+
} as LogAttributes,
|
|
155
163
|
);
|
|
156
164
|
}
|
|
157
165
|
})
|
|
@@ -161,6 +169,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
161
169
|
} catch (error) {
|
|
162
170
|
logger.error(
|
|
163
171
|
`Create episode feed failed in AlertEpisodeService.onCreateSuccess: ${error}`,
|
|
172
|
+
{
|
|
173
|
+
projectId: createdItem.projectId?.toString(),
|
|
174
|
+
alertEpisodeId: createdItem.id?.toString(),
|
|
175
|
+
} as LogAttributes,
|
|
164
176
|
);
|
|
165
177
|
}
|
|
166
178
|
})
|
|
@@ -171,12 +183,20 @@ export class Service extends DatabaseService<Model> {
|
|
|
171
183
|
} catch (error) {
|
|
172
184
|
logger.error(
|
|
173
185
|
`On-call duty policy execution failed in AlertEpisodeService.onCreateSuccess: ${error}`,
|
|
186
|
+
{
|
|
187
|
+
projectId: createdItem.projectId?.toString(),
|
|
188
|
+
alertEpisodeId: createdItem.id?.toString(),
|
|
189
|
+
} as LogAttributes,
|
|
174
190
|
);
|
|
175
191
|
}
|
|
176
192
|
})
|
|
177
193
|
.catch((error: Error) => {
|
|
178
194
|
logger.error(
|
|
179
195
|
`Critical error in AlertEpisodeService.onCreateSuccess: ${error}`,
|
|
196
|
+
{
|
|
197
|
+
projectId: createdItem.projectId?.toString(),
|
|
198
|
+
alertEpisodeId: createdItem.id?.toString(),
|
|
199
|
+
} as LogAttributes,
|
|
180
200
|
);
|
|
181
201
|
});
|
|
182
202
|
|
|
@@ -223,7 +243,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
223
243
|
});
|
|
224
244
|
}
|
|
225
245
|
} catch (error) {
|
|
226
|
-
logger.error(`Error in handleEpisodeWorkspaceOperationsAsync: ${error}
|
|
246
|
+
logger.error(`Error in handleEpisodeWorkspaceOperationsAsync: ${error}`, {
|
|
247
|
+
projectId: createdItem.projectId?.toString(),
|
|
248
|
+
alertEpisodeId: createdItem.id?.toString(),
|
|
249
|
+
} as LogAttributes);
|
|
227
250
|
throw error;
|
|
228
251
|
}
|
|
229
252
|
}
|
|
@@ -350,7 +373,10 @@ export class Service extends DatabaseService<Model> {
|
|
|
350
373
|
feedInfoInMarkdown: feedInfoInMarkdown,
|
|
351
374
|
});
|
|
352
375
|
} catch (error) {
|
|
353
|
-
logger.error(`Error in executeEpisodeOnCallDutyPoliciesAsync: ${error}
|
|
376
|
+
logger.error(`Error in executeEpisodeOnCallDutyPoliciesAsync: ${error}`, {
|
|
377
|
+
projectId: createdItem.projectId?.toString(),
|
|
378
|
+
alertEpisodeId: createdItem.id?.toString(),
|
|
379
|
+
} as LogAttributes);
|
|
354
380
|
throw error;
|
|
355
381
|
}
|
|
356
382
|
}
|
|
@@ -485,6 +511,11 @@ export class Service extends DatabaseService<Model> {
|
|
|
485
511
|
} catch (error) {
|
|
486
512
|
logger.error(
|
|
487
513
|
`Failed to cascade state change to alert ${member.alertId.toString()}: ${error}`,
|
|
514
|
+
{
|
|
515
|
+
projectId: projectId.toString(),
|
|
516
|
+
alertEpisodeId: episodeId.toString(),
|
|
517
|
+
alertId: member.alertId.toString(),
|
|
518
|
+
} as LogAttributes,
|
|
488
519
|
);
|
|
489
520
|
}
|
|
490
521
|
}
|