@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.
Files changed (405) hide show
  1. package/Models/AnalyticsModels/Metric.ts +78 -0
  2. package/Server/API/AIAgentDataAPI.ts +6 -1
  3. package/Server/API/BillingAPI.ts +28 -6
  4. package/Server/API/CommonAPI.ts +11 -0
  5. package/Server/API/DashboardAPI.ts +6 -2
  6. package/Server/API/DashboardDomainAPI.ts +10 -3
  7. package/Server/API/GitHubAPI.ts +58 -14
  8. package/Server/API/MicrosoftTeamsAPI.ts +97 -33
  9. package/Server/API/OpenSourceDeploymentAPI.ts +2 -2
  10. package/Server/API/SlackAPI.ts +107 -36
  11. package/Server/API/StatusAPI.ts +37 -16
  12. package/Server/API/StatusPageAPI.ts +97 -23
  13. package/Server/API/StatusPageDomainAPI.ts +6 -3
  14. package/Server/API/TelemetryAPI.ts +81 -0
  15. package/Server/API/UserAPI.ts +3 -3
  16. package/Server/API/UserCallAPI.ts +5 -2
  17. package/Server/API/UserEmailAPI.ts +5 -2
  18. package/Server/API/UserPushAPI.ts +9 -3
  19. package/Server/API/UserSmsAPI.ts +5 -2
  20. package/Server/API/UserWhatsAppAPI.ts +5 -2
  21. package/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.ts +47 -0
  22. package/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.ts +35 -0
  23. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
  24. package/Server/Middleware/NotificationMiddleware.ts +2 -2
  25. package/Server/Middleware/ProjectAuthorization.ts +6 -0
  26. package/Server/Middleware/SCIMAuthorization.ts +2 -1
  27. package/Server/Middleware/SlackAuthorization.ts +28 -10
  28. package/Server/Middleware/TelemetryIngest.ts +16 -3
  29. package/Server/Middleware/UserAuthorization.ts +22 -5
  30. package/Server/Middleware/WhatsAppAuthorization.ts +15 -4
  31. package/Server/Services/AIAgentService.ts +13 -6
  32. package/Server/Services/AIService.ts +9 -3
  33. package/Server/Services/AlertEpisodeFeedService.ts +17 -5
  34. package/Server/Services/AlertEpisodeService.ts +34 -3
  35. package/Server/Services/AlertEpisodeStateTimelineService.ts +80 -22
  36. package/Server/Services/AlertFeedService.ts +17 -5
  37. package/Server/Services/AlertGroupingEngineService.ts +36 -7
  38. package/Server/Services/AlertService.ts +60 -8
  39. package/Server/Services/AlertStateTimelineService.ts +29 -7
  40. package/Server/Services/AnalyticsDatabaseService.ts +59 -25
  41. package/Server/Services/BillingInvoiceService.ts +7 -3
  42. package/Server/Services/BillingService.ts +9 -2
  43. package/Server/Services/DashboardDomainService.ts +56 -22
  44. package/Server/Services/DashboardService.ts +11 -4
  45. package/Server/Services/DatabaseService.ts +31 -11
  46. package/Server/Services/IncidentEpisodeFeedService.ts +17 -5
  47. package/Server/Services/IncidentEpisodeService.ts +34 -3
  48. package/Server/Services/IncidentEpisodeStateTimelineService.ts +80 -22
  49. package/Server/Services/IncidentFeedService.ts +33 -9
  50. package/Server/Services/IncidentGroupingEngineService.ts +35 -6
  51. package/Server/Services/IncidentService.ts +103 -9
  52. package/Server/Services/IncidentSlaRuleService.ts +16 -4
  53. package/Server/Services/IncidentSlaService.ts +20 -4
  54. package/Server/Services/IncidentStateTimelineService.ts +120 -31
  55. package/Server/Services/KubernetesClusterService.ts +62 -14
  56. package/Server/Services/LabelService.ts +14 -1
  57. package/Server/Services/MonitorFeedService.ts +33 -9
  58. package/Server/Services/MonitorProbeService.ts +31 -2
  59. package/Server/Services/MonitorService.ts +35 -4
  60. package/Server/Services/MonitorStatusTimelineService.ts +68 -20
  61. package/Server/Services/NotificationService.ts +4 -2
  62. package/Server/Services/OnCallDutyPolicyEscalationRuleService.ts +53 -9
  63. package/Server/Services/OnCallDutyPolicyEscalationRuleUserService.ts +9 -2
  64. package/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts +29 -8
  65. package/Server/Services/OnCallDutyPolicyFeedService.ts +33 -8
  66. package/Server/Services/OnCallDutyPolicyScheduleService.ts +97 -24
  67. package/Server/Services/OnCallDutyPolicyService.ts +2 -1
  68. package/Server/Services/OpenTelemetryIngestService.ts +51 -20
  69. package/Server/Services/ProbeService.ts +16 -7
  70. package/Server/Services/ProjectService.ts +29 -11
  71. package/Server/Services/ScheduledMaintenanceFeedService.ts +17 -4
  72. package/Server/Services/ScheduledMaintenanceService.ts +52 -6
  73. package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +72 -20
  74. package/Server/Services/StatusPageDomainService.ts +59 -23
  75. package/Server/Services/StatusPageService.ts +26 -8
  76. package/Server/Services/StatusPageSubscriberService.ts +382 -111
  77. package/Server/Services/TeamMemberService.ts +9 -3
  78. package/Server/Services/TelemetryAttributeService.ts +117 -4
  79. package/Server/Services/UserNotificationRuleService.ts +9 -3
  80. package/Server/Services/UserService.ts +6 -4
  81. package/Server/Services/UserWhatsAppService.ts +9 -3
  82. package/Server/Services/WorkflowService.ts +7 -3
  83. package/Server/Services/WorkspaceNotificationRuleService.ts +398 -156
  84. package/Server/Types/Domain.ts +15 -5
  85. package/Server/Types/Workflow/Components/API/Post.ts +22 -8
  86. package/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.ts +12 -4
  87. package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +10 -0
  88. package/Server/Utils/CodeRepository/CodeRepository.ts +62 -13
  89. package/Server/Utils/Express.ts +1 -0
  90. package/Server/Utils/Greenlock/Greenlock.ts +75 -20
  91. package/Server/Utils/LLM/LLMService.ts +22 -7
  92. package/Server/Utils/Logger.ts +93 -13
  93. package/Server/Utils/Monitor/MonitorAlert.ts +15 -3
  94. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +15 -5
  95. package/Server/Utils/Monitor/MonitorIncident.ts +17 -3
  96. package/Server/Utils/Monitor/MonitorStatusTimeline.ts +6 -1
  97. package/Server/Utils/Profiling.ts +11 -5
  98. package/Server/Utils/Realtime.ts +90 -31
  99. package/Server/Utils/Response.ts +2 -2
  100. package/Server/Utils/StartServer.ts +43 -9
  101. package/Server/Utils/Telemetry/SpanUtil.ts +90 -0
  102. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.ts +58 -15
  103. package/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.ts +58 -15
  104. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts +19 -3
  105. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts +87 -22
  106. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.ts +12 -3
  107. package/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.ts +25 -7
  108. package/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.ts +55 -8
  109. package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +100 -22
  110. package/Server/Utils/Workspace/Slack/Actions/Alert.ts +35 -9
  111. package/Server/Utils/Workspace/Slack/Actions/AlertEpisode.ts +32 -8
  112. package/Server/Utils/Workspace/Slack/Actions/Auth.ts +3 -1
  113. package/Server/Utils/Workspace/Slack/Actions/Incident.ts +52 -11
  114. package/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.ts +4 -1
  115. package/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.ts +89 -20
  116. package/Server/Utils/Workspace/Slack/Slack.ts +498 -247
  117. package/Server/Utils/Workspace/Workspace.ts +33 -11
  118. package/Server/Utils/Workspace/WorkspaceBase.ts +3 -1
  119. package/Server/Utils/Workspace/WorkspaceMessages/Alert.ts +8 -2
  120. package/Tests/Server/Middleware/UserAuthorization.test.ts +1 -1
  121. package/Tests/Server/Services/AnalyticsDatabaseService.test.ts +12 -3
  122. package/UI/Components/BulkUpdate/BulkUpdateForm.tsx +60 -38
  123. package/UI/Components/Charts/Area/AreaChart.tsx +35 -1
  124. package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +7 -0
  125. package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +33 -0
  126. package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +33 -0
  127. package/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.ts +14 -0
  128. package/UI/Components/Charts/Line/LineChart.tsx +35 -1
  129. package/UI/Components/Charts/Types/ExemplarPoint.ts +6 -0
  130. package/UI/Components/Dictionary/Dictionary.tsx +13 -1
  131. package/UI/Components/Filters/FiltersForm.tsx +2 -0
  132. package/UI/Components/Filters/JSONFilter.tsx +5 -1
  133. package/UI/Components/Filters/Types/Filter.ts +2 -0
  134. package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +3 -3
  135. package/UI/Components/ModelTable/BaseModelTable.tsx +10 -6
  136. package/UI/Components/Navbar/NavBar.tsx +10 -0
  137. package/build/dist/Models/AnalyticsModels/Metric.js +70 -0
  138. package/build/dist/Models/AnalyticsModels/Metric.js.map +1 -1
  139. package/build/dist/Server/API/AIAgentDataAPI.js +6 -6
  140. package/build/dist/Server/API/AIAgentDataAPI.js.map +1 -1
  141. package/build/dist/Server/API/BillingAPI.js +13 -13
  142. package/build/dist/Server/API/BillingAPI.js.map +1 -1
  143. package/build/dist/Server/API/CommonAPI.js +5 -0
  144. package/build/dist/Server/API/CommonAPI.js.map +1 -1
  145. package/build/dist/Server/API/DashboardAPI.js +2 -2
  146. package/build/dist/Server/API/DashboardAPI.js.map +1 -1
  147. package/build/dist/Server/API/DashboardDomainAPI.js +3 -3
  148. package/build/dist/Server/API/DashboardDomainAPI.js.map +1 -1
  149. package/build/dist/Server/API/GitHubAPI.js +19 -19
  150. package/build/dist/Server/API/GitHubAPI.js.map +1 -1
  151. package/build/dist/Server/API/MicrosoftTeamsAPI.js +34 -34
  152. package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
  153. package/build/dist/Server/API/OpenSourceDeploymentAPI.js +2 -2
  154. package/build/dist/Server/API/OpenSourceDeploymentAPI.js.map +1 -1
  155. package/build/dist/Server/API/SlackAPI.js +38 -38
  156. package/build/dist/Server/API/SlackAPI.js.map +1 -1
  157. package/build/dist/Server/API/StatusAPI.js +16 -16
  158. package/build/dist/Server/API/StatusAPI.js.map +1 -1
  159. package/build/dist/Server/API/StatusPageAPI.js +52 -52
  160. package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
  161. package/build/dist/Server/API/StatusPageDomainAPI.js +3 -3
  162. package/build/dist/Server/API/StatusPageDomainAPI.js.map +1 -1
  163. package/build/dist/Server/API/TelemetryAPI.js +39 -0
  164. package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
  165. package/build/dist/Server/API/UserAPI.js +3 -3
  166. package/build/dist/Server/API/UserAPI.js.map +1 -1
  167. package/build/dist/Server/API/UserCallAPI.js +2 -2
  168. package/build/dist/Server/API/UserCallAPI.js.map +1 -1
  169. package/build/dist/Server/API/UserEmailAPI.js +2 -2
  170. package/build/dist/Server/API/UserEmailAPI.js.map +1 -1
  171. package/build/dist/Server/API/UserPushAPI.js +3 -3
  172. package/build/dist/Server/API/UserPushAPI.js.map +1 -1
  173. package/build/dist/Server/API/UserSmsAPI.js +2 -2
  174. package/build/dist/Server/API/UserSmsAPI.js.map +1 -1
  175. package/build/dist/Server/API/UserWhatsAppAPI.js +2 -2
  176. package/build/dist/Server/API/UserWhatsAppAPI.js.map +1 -1
  177. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.js +40 -0
  178. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.js.map +1 -0
  179. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.js +18 -0
  180. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.js.map +1 -0
  181. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
  182. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  183. package/build/dist/Server/Middleware/NotificationMiddleware.js +2 -2
  184. package/build/dist/Server/Middleware/NotificationMiddleware.js.map +1 -1
  185. package/build/dist/Server/Middleware/ProjectAuthorization.js +5 -0
  186. package/build/dist/Server/Middleware/ProjectAuthorization.js.map +1 -1
  187. package/build/dist/Server/Middleware/SCIMAuthorization.js +2 -2
  188. package/build/dist/Server/Middleware/SCIMAuthorization.js.map +1 -1
  189. package/build/dist/Server/Middleware/SlackAuthorization.js +10 -10
  190. package/build/dist/Server/Middleware/SlackAuthorization.js.map +1 -1
  191. package/build/dist/Server/Middleware/TelemetryIngest.js +9 -4
  192. package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
  193. package/build/dist/Server/Middleware/UserAuthorization.js +10 -5
  194. package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
  195. package/build/dist/Server/Middleware/WhatsAppAuthorization.js +6 -6
  196. package/build/dist/Server/Middleware/WhatsAppAuthorization.js.map +1 -1
  197. package/build/dist/Server/Services/AIAgentService.js +13 -7
  198. package/build/dist/Server/Services/AIAgentService.js.map +1 -1
  199. package/build/dist/Server/Services/AIService.js +9 -2
  200. package/build/dist/Server/Services/AIService.js.map +1 -1
  201. package/build/dist/Server/Services/AlertEpisodeFeedService.js +17 -5
  202. package/build/dist/Server/Services/AlertEpisodeFeedService.js.map +1 -1
  203. package/build/dist/Server/Services/AlertEpisodeService.js +40 -10
  204. package/build/dist/Server/Services/AlertEpisodeService.js.map +1 -1
  205. package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js +81 -24
  206. package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js.map +1 -1
  207. package/build/dist/Server/Services/AlertFeedService.js +17 -5
  208. package/build/dist/Server/Services/AlertFeedService.js.map +1 -1
  209. package/build/dist/Server/Services/AlertGroupingEngineService.js +44 -28
  210. package/build/dist/Server/Services/AlertGroupingEngineService.js.map +1 -1
  211. package/build/dist/Server/Services/AlertService.js +72 -20
  212. package/build/dist/Server/Services/AlertService.js.map +1 -1
  213. package/build/dist/Server/Services/AlertStateTimelineService.js +36 -13
  214. package/build/dist/Server/Services/AlertStateTimelineService.js.map +1 -1
  215. package/build/dist/Server/Services/AnalyticsDatabaseService.js +52 -28
  216. package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
  217. package/build/dist/Server/Services/BillingInvoiceService.js +7 -2
  218. package/build/dist/Server/Services/BillingInvoiceService.js.map +1 -1
  219. package/build/dist/Server/Services/BillingService.js +8 -8
  220. package/build/dist/Server/Services/BillingService.js.map +1 -1
  221. package/build/dist/Server/Services/DashboardDomainService.js +49 -27
  222. package/build/dist/Server/Services/DashboardDomainService.js.map +1 -1
  223. package/build/dist/Server/Services/DashboardService.js +11 -4
  224. package/build/dist/Server/Services/DashboardService.js.map +1 -1
  225. package/build/dist/Server/Services/DatabaseService.js +32 -12
  226. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  227. package/build/dist/Server/Services/IncidentEpisodeFeedService.js +17 -5
  228. package/build/dist/Server/Services/IncidentEpisodeFeedService.js.map +1 -1
  229. package/build/dist/Server/Services/IncidentEpisodeService.js +40 -10
  230. package/build/dist/Server/Services/IncidentEpisodeService.js.map +1 -1
  231. package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js +81 -24
  232. package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js.map +1 -1
  233. package/build/dist/Server/Services/IncidentFeedService.js +34 -10
  234. package/build/dist/Server/Services/IncidentFeedService.js.map +1 -1
  235. package/build/dist/Server/Services/IncidentGroupingEngineService.js +43 -29
  236. package/build/dist/Server/Services/IncidentGroupingEngineService.js.map +1 -1
  237. package/build/dist/Server/Services/IncidentService.js +116 -28
  238. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  239. package/build/dist/Server/Services/IncidentSlaRuleService.js +19 -11
  240. package/build/dist/Server/Services/IncidentSlaRuleService.js.map +1 -1
  241. package/build/dist/Server/Services/IncidentSlaService.js +21 -14
  242. package/build/dist/Server/Services/IncidentSlaService.js.map +1 -1
  243. package/build/dist/Server/Services/IncidentStateTimelineService.js +130 -37
  244. package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
  245. package/build/dist/Server/Services/KubernetesClusterService.js +51 -14
  246. package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
  247. package/build/dist/Server/Services/LabelService.js +10 -1
  248. package/build/dist/Server/Services/LabelService.js.map +1 -1
  249. package/build/dist/Server/Services/MonitorFeedService.js +34 -10
  250. package/build/dist/Server/Services/MonitorFeedService.js.map +1 -1
  251. package/build/dist/Server/Services/MonitorProbeService.js +23 -3
  252. package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
  253. package/build/dist/Server/Services/MonitorService.js +42 -11
  254. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  255. package/build/dist/Server/Services/MonitorStatusTimelineService.js +69 -21
  256. package/build/dist/Server/Services/MonitorStatusTimelineService.js.map +1 -1
  257. package/build/dist/Server/Services/NotificationService.js +4 -3
  258. package/build/dist/Server/Services/NotificationService.js.map +1 -1
  259. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js +49 -12
  260. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js.map +1 -1
  261. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js +9 -3
  262. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js.map +1 -1
  263. package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js +26 -11
  264. package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js.map +1 -1
  265. package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js +34 -10
  266. package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js.map +1 -1
  267. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +94 -37
  268. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
  269. package/build/dist/Server/Services/OnCallDutyPolicyService.js +1 -1
  270. package/build/dist/Server/Services/OnCallDutyPolicyService.js.map +1 -1
  271. package/build/dist/Server/Services/OpenTelemetryIngestService.js +45 -17
  272. package/build/dist/Server/Services/OpenTelemetryIngestService.js.map +1 -1
  273. package/build/dist/Server/Services/ProbeService.js +13 -7
  274. package/build/dist/Server/Services/ProbeService.js.map +1 -1
  275. package/build/dist/Server/Services/ProjectService.js +41 -21
  276. package/build/dist/Server/Services/ProjectService.js.map +1 -1
  277. package/build/dist/Server/Services/ScheduledMaintenanceFeedService.js +17 -5
  278. package/build/dist/Server/Services/ScheduledMaintenanceFeedService.js.map +1 -1
  279. package/build/dist/Server/Services/ScheduledMaintenanceService.js +71 -24
  280. package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
  281. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +72 -24
  282. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
  283. package/build/dist/Server/Services/StatusPageDomainService.js +55 -29
  284. package/build/dist/Server/Services/StatusPageDomainService.js.map +1 -1
  285. package/build/dist/Server/Services/StatusPageService.js +29 -9
  286. package/build/dist/Server/Services/StatusPageService.js.map +1 -1
  287. package/build/dist/Server/Services/StatusPageSubscriberService.js +393 -130
  288. package/build/dist/Server/Services/StatusPageSubscriberService.js.map +1 -1
  289. package/build/dist/Server/Services/TeamMemberService.js +10 -2
  290. package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
  291. package/build/dist/Server/Services/TelemetryAttributeService.js +83 -6
  292. package/build/dist/Server/Services/TelemetryAttributeService.js.map +1 -1
  293. package/build/dist/Server/Services/UserNotificationRuleService.js +10 -2
  294. package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
  295. package/build/dist/Server/Services/UserService.js +8 -3
  296. package/build/dist/Server/Services/UserService.js.map +1 -1
  297. package/build/dist/Server/Services/UserWhatsAppService.js +10 -2
  298. package/build/dist/Server/Services/UserWhatsAppService.js.map +1 -1
  299. package/build/dist/Server/Services/WorkflowService.js +7 -2
  300. package/build/dist/Server/Services/WorkflowService.js.map +1 -1
  301. package/build/dist/Server/Services/WorkspaceNotificationRuleService.js +367 -180
  302. package/build/dist/Server/Services/WorkspaceNotificationRuleService.js.map +1 -1
  303. package/build/dist/Server/Types/Domain.js +12 -6
  304. package/build/dist/Server/Types/Domain.js.map +1 -1
  305. package/build/dist/Server/Types/Workflow/Components/API/Post.js +11 -7
  306. package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
  307. package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js +11 -4
  308. package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js.map +1 -1
  309. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +7 -0
  310. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
  311. package/build/dist/Server/Utils/CodeRepository/CodeRepository.js +45 -17
  312. package/build/dist/Server/Utils/CodeRepository/CodeRepository.js.map +1 -1
  313. package/build/dist/Server/Utils/Express.js.map +1 -1
  314. package/build/dist/Server/Utils/Greenlock/Greenlock.js +36 -29
  315. package/build/dist/Server/Utils/Greenlock/Greenlock.js.map +1 -1
  316. package/build/dist/Server/Utils/LLM/LLMService.js +18 -6
  317. package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
  318. package/build/dist/Server/Utils/Logger.js +61 -13
  319. package/build/dist/Server/Utils/Logger.js.map +1 -1
  320. package/build/dist/Server/Utils/Monitor/MonitorAlert.js +23 -20
  321. package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
  322. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +13 -4
  323. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  324. package/build/dist/Server/Utils/Monitor/MonitorIncident.js +25 -22
  325. package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
  326. package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js +6 -3
  327. package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js.map +1 -1
  328. package/build/dist/Server/Utils/Profiling.js +9 -6
  329. package/build/dist/Server/Utils/Profiling.js.map +1 -1
  330. package/build/dist/Server/Utils/Realtime.js +50 -34
  331. package/build/dist/Server/Utils/Realtime.js.map +1 -1
  332. package/build/dist/Server/Utils/Response.js +2 -2
  333. package/build/dist/Server/Utils/Response.js.map +1 -1
  334. package/build/dist/Server/Utils/StartServer.js +23 -11
  335. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  336. package/build/dist/Server/Utils/Telemetry/SpanUtil.js +52 -0
  337. package/build/dist/Server/Utils/Telemetry/SpanUtil.js.map +1 -0
  338. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js +58 -15
  339. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js.map +1 -1
  340. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js +58 -15
  341. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js.map +1 -1
  342. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js +19 -5
  343. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js.map +1 -1
  344. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js +90 -26
  345. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js.map +1 -1
  346. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js +12 -3
  347. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js.map +1 -1
  348. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js +25 -7
  349. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js.map +1 -1
  350. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js +58 -19
  351. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js.map +1 -1
  352. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +102 -29
  353. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
  354. package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js +38 -9
  355. package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js.map +1 -1
  356. package/build/dist/Server/Utils/Workspace/Slack/Actions/AlertEpisode.js +34 -8
  357. package/build/dist/Server/Utils/Workspace/Slack/Actions/AlertEpisode.js.map +1 -1
  358. package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js +3 -1
  359. package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js.map +1 -1
  360. package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js +55 -13
  361. package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js.map +1 -1
  362. package/build/dist/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.js +5 -1
  363. package/build/dist/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.js.map +1 -1
  364. package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js +91 -26
  365. package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js.map +1 -1
  366. package/build/dist/Server/Utils/Workspace/Slack/Slack.js +355 -270
  367. package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
  368. package/build/dist/Server/Utils/Workspace/Workspace.js +21 -12
  369. package/build/dist/Server/Utils/Workspace/Workspace.js.map +1 -1
  370. package/build/dist/Server/Utils/Workspace/WorkspaceBase.js +3 -1
  371. package/build/dist/Server/Utils/Workspace/WorkspaceBase.js.map +1 -1
  372. package/build/dist/Server/Utils/Workspace/WorkspaceMessages/Alert.js +9 -2
  373. package/build/dist/Server/Utils/Workspace/WorkspaceMessages/Alert.js.map +1 -1
  374. package/build/dist/Tests/Server/Middleware/UserAuthorization.test.js +1 -1
  375. package/build/dist/Tests/Server/Middleware/UserAuthorization.test.js.map +1 -1
  376. package/build/dist/Tests/Server/Services/AnalyticsDatabaseService.test.js +12 -6
  377. package/build/dist/Tests/Server/Services/AnalyticsDatabaseService.test.js.map +1 -1
  378. package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.js +31 -30
  379. package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.js.map +1 -1
  380. package/build/dist/UI/Components/Charts/Area/AreaChart.js +20 -2
  381. package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
  382. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +2 -2
  383. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
  384. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +9 -2
  385. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
  386. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +9 -2
  387. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
  388. package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.js +2 -0
  389. package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.js.map +1 -0
  390. package/build/dist/UI/Components/Charts/Line/LineChart.js +20 -2
  391. package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
  392. package/build/dist/UI/Components/Charts/Types/ExemplarPoint.js +2 -0
  393. package/build/dist/UI/Components/Charts/Types/ExemplarPoint.js.map +1 -0
  394. package/build/dist/UI/Components/Dictionary/Dictionary.js +9 -1
  395. package/build/dist/UI/Components/Dictionary/Dictionary.js.map +1 -1
  396. package/build/dist/UI/Components/Filters/FiltersForm.js +1 -1
  397. package/build/dist/UI/Components/Filters/FiltersForm.js.map +1 -1
  398. package/build/dist/UI/Components/Filters/JSONFilter.js +1 -1
  399. package/build/dist/UI/Components/Filters/JSONFilter.js.map +1 -1
  400. package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +3 -3
  401. package/build/dist/UI/Components/ModelTable/BaseModelTable.js +9 -5
  402. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  403. package/build/dist/UI/Components/Navbar/NavBar.js +9 -1
  404. package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
  405. package/package.json +1 -1
@@ -26,7 +26,7 @@ import Select from "../Types/AnalyticsDatabase/Select";
26
26
  import UpdateBy from "../Types/AnalyticsDatabase/UpdateBy";
27
27
  import { SQL, Statement } from "../Utils/AnalyticsDatabase/Statement";
28
28
  import StatementGenerator from "../Utils/AnalyticsDatabase/StatementGenerator";
29
- import logger from "../Utils/Logger";
29
+ import logger, { LogAttributes } from "../Utils/Logger";
30
30
  import Realtime from "../Utils/Realtime";
31
31
  import StreamUtil from "../Utils/Stream";
32
32
  import BaseService from "./BaseService";
@@ -122,12 +122,14 @@ export default class AnalyticsDatabaseService<
122
122
 
123
123
  logger.debug(
124
124
  `ClickHouse insert succeeded for table ${tableName} at ${OneUptimeDate.toString(OneUptimeDate.getCurrentDate())}`,
125
+ { tableName } as LogAttributes,
125
126
  );
126
127
  } catch (error) {
127
128
  logger.error(
128
129
  `ClickHouse insert failed for table ${tableName} at ${OneUptimeDate.toString(OneUptimeDate.getCurrentDate())}`,
130
+ { tableName } as LogAttributes,
129
131
  );
130
- logger.error(error);
132
+ logger.error(error, { tableName } as LogAttributes);
131
133
  throw error;
132
134
  }
133
135
  }
@@ -202,8 +204,12 @@ export default class AnalyticsDatabaseService<
202
204
  const dbResult: ResultSet<"JSON"> =
203
205
  await this.executeQuery(countStatement);
204
206
 
205
- logger.debug(`${this.model.tableName} Count Statement executed`);
206
- logger.debug(countStatement);
207
+ logger.debug(`${this.model.tableName} Count Statement executed`, {
208
+ tableName: this.model.tableName,
209
+ } as LogAttributes);
210
+ logger.debug(countStatement, {
211
+ tableName: this.model.tableName,
212
+ } as LogAttributes);
207
213
 
208
214
  const resultInJSON: ResponseJSON<JSONObject> =
209
215
  await dbResult.json<JSONObject>();
@@ -220,8 +226,12 @@ export default class AnalyticsDatabaseService<
220
226
  );
221
227
  }
222
228
 
223
- logger.debug(`Result: `);
224
- logger.debug(countPositive.toNumber());
229
+ logger.debug(`Result: `, {
230
+ tableName: this.model.tableName,
231
+ } as LogAttributes);
232
+ logger.debug(countPositive.toNumber(), {
233
+ tableName: this.model.tableName,
234
+ } as LogAttributes);
225
235
 
226
236
  countPositive = await this.onCountSuccess(countPositive);
227
237
  return countPositive;
@@ -249,6 +259,21 @@ export default class AnalyticsDatabaseService<
249
259
 
250
260
  @CaptureSpan()
251
261
  public async dropColumnInDatabase(columnName: string): Promise<void> {
262
+ /*
263
+ * Drop any skip index associated with this column before dropping the column itself.
264
+ * ClickHouse will reject a column drop if a skip index depends on it.
265
+ */
266
+ const column: AnalyticsTableColumn | undefined =
267
+ this.model.tableColumns.find((col: AnalyticsTableColumn) => {
268
+ return col.key === columnName;
269
+ });
270
+
271
+ if (column?.skipIndex) {
272
+ await this.execute(
273
+ this.statementGenerator.toDropSkipIndexStatement(column.skipIndex.name),
274
+ );
275
+ }
276
+
252
277
  await this.execute(
253
278
  this.statementGenerator.toDropColumnStatement(columnName),
254
279
  );
@@ -296,6 +321,7 @@ export default class AnalyticsDatabaseService<
296
321
  if (currentCodec === data.expectedCodecValue) {
297
322
  logger.info(
298
323
  `${tableName}.${data.columnName} already has ${data.expectedCodecValue}, skipping`,
324
+ { tableName } as LogAttributes,
299
325
  );
300
326
  return;
301
327
  }
@@ -305,6 +331,7 @@ export default class AnalyticsDatabaseService<
305
331
  );
306
332
  logger.info(
307
333
  `Applied ${data.codec} codec to ${tableName}.${data.columnName} (async)`,
334
+ { tableName } as LogAttributes,
308
335
  );
309
336
  }
310
337
 
@@ -397,7 +424,9 @@ export default class AnalyticsDatabaseService<
397
424
  findStatement.statement,
398
425
  );
399
426
 
400
- logger.debug(`${this.model.tableName} Aggregate Statement executed`);
427
+ logger.debug(`${this.model.tableName} Aggregate Statement executed`, {
428
+ tableName: this.model.tableName,
429
+ } as LogAttributes);
401
430
 
402
431
  const responseJSON: ResponseJSON<JSONObject> =
403
432
  await dbResult.json<JSONObject>();
@@ -524,8 +553,12 @@ export default class AnalyticsDatabaseService<
524
553
  findStatement.statement,
525
554
  );
526
555
 
527
- logger.debug(`${this.model.tableName} Find Statement executed`);
528
- logger.debug(findStatement.statement);
556
+ logger.debug(`${this.model.tableName} Find Statement executed`, {
557
+ tableName: this.model.tableName,
558
+ } as LogAttributes);
559
+ logger.debug(findStatement.statement, {
560
+ tableName: this.model.tableName,
561
+ } as LogAttributes);
529
562
 
530
563
  const responseJSON: ResponseJSON<JSONObject> =
531
564
  await dbResult.json<JSONObject>();
@@ -656,8 +689,8 @@ export default class AnalyticsDatabaseService<
656
689
  }}
657
690
  `);
658
691
  }
659
- logger.debug(`${this.model.tableName} Count Statement`);
660
- logger.debug(statement);
692
+ logger.debug(`${this.model.tableName} Count Statement`, { tableName: this.model.tableName } as LogAttributes);
693
+ logger.debug(statement, { tableName: this.model.tableName } as LogAttributes);
661
694
 
662
695
  return statement;
663
696
  }
@@ -716,8 +749,8 @@ export default class AnalyticsDatabaseService<
716
749
  }}
717
750
  `);
718
751
 
719
- logger.debug(`${this.model.tableName} Aggregate Statement`);
720
- logger.debug(statement);
752
+ logger.debug(`${this.model.tableName} Aggregate Statement`, { tableName: this.model.tableName } as LogAttributes);
753
+ logger.debug(statement, { tableName: this.model.tableName } as LogAttributes);
721
754
 
722
755
  return { statement, columns: select.columns };
723
756
  }
@@ -780,8 +813,8 @@ export default class AnalyticsDatabaseService<
780
813
  }}
781
814
  `);
782
815
 
783
- logger.debug(`${this.model.tableName} Find Statement`);
784
- logger.debug(statement);
816
+ logger.debug(`${this.model.tableName} Find Statement`, { tableName: this.model.tableName } as LogAttributes);
817
+ logger.debug(statement, { tableName: this.model.tableName } as LogAttributes);
785
818
 
786
819
  return { statement, columns: select.columns };
787
820
  }
@@ -801,8 +834,8 @@ export default class AnalyticsDatabaseService<
801
834
  ALTER TABLE ${databaseName}.${this.model.tableName}
802
835
  DELETE WHERE TRUE `.append(whereStatement);
803
836
 
804
- logger.debug(`${this.model.tableName} Delete Statement`);
805
- logger.debug(statement);
837
+ logger.debug(`${this.model.tableName} Delete Statement`, { tableName: this.model.tableName } as LogAttributes);
838
+ logger.debug(statement, { tableName: this.model.tableName } as LogAttributes);
806
839
 
807
840
  return statement;
808
841
  }
@@ -855,8 +888,8 @@ export default class AnalyticsDatabaseService<
855
888
 
856
889
  await this.execute(deleteStatement);
857
890
 
858
- logger.debug(`${this.model.tableName} Delete Statement executed`);
859
- logger.debug(deleteStatement);
891
+ logger.debug(`${this.model.tableName} Delete Statement executed`, { tableName: this.model.tableName } as LogAttributes);
892
+ logger.debug(deleteStatement, { tableName: this.model.tableName } as LogAttributes);
860
893
  } catch (error) {
861
894
  await this.onDeleteError(error as Exception);
862
895
  throw this.getException(error as Exception);
@@ -914,8 +947,8 @@ export default class AnalyticsDatabaseService<
914
947
 
915
948
  await this.execute(statement);
916
949
 
917
- logger.debug(`${this.model.tableName} Update Statement executed`);
918
- logger.debug(statement);
950
+ logger.debug(`${this.model.tableName} Update Statement executed`, { tableName: this.model.tableName } as LogAttributes);
951
+ logger.debug(statement, { tableName: this.model.tableName } as LogAttributes);
919
952
  } catch (error) {
920
953
  await this.onUpdateError(error as Exception);
921
954
  throw this.getException(error as Exception);
@@ -1143,8 +1176,8 @@ export default class AnalyticsDatabaseService<
1143
1176
 
1144
1177
  await this.execute(insertStatement);
1145
1178
 
1146
- logger.debug(`${this.model.tableName} Create Statement executed`);
1147
- logger.debug(insertStatement);
1179
+ logger.debug(`${this.model.tableName} Create Statement executed`, { tableName: this.model.tableName } as LogAttributes);
1180
+ logger.debug(insertStatement, { tableName: this.model.tableName } as LogAttributes);
1148
1181
 
1149
1182
  if (!createBy.props.ignoreHooks) {
1150
1183
  for (let i: number = 0; i < items.length; i++) {
@@ -1212,7 +1245,8 @@ export default class AnalyticsDatabaseService<
1212
1245
  logger.warn(
1213
1246
  `Realtime is not initialized. Skipping emitModelEvent for ${
1214
1247
  this.getModel().tableName
1215
- }`
1248
+ }`,
1249
+ { tableName: this.getModel().tableName } as LogAttributes,
1216
1250
  );
1217
1251
  }
1218
1252
  }
@@ -1294,7 +1328,7 @@ export default class AnalyticsDatabaseService<
1294
1328
  ...ClusterKeyAuthorization.getClusterKeyHeaders(),
1295
1329
  },
1296
1330
  }).catch((error: Error) => {
1297
- logger.error(error);
1331
+ logger.error(error, { projectId: projectId?.toString(), tableName: this.getModel().tableName } as LogAttributes);
1298
1332
  });
1299
1333
  }
1300
1334
  }
@@ -15,7 +15,7 @@ import SubscriptionStatus, {
15
15
  } from "../../Types/Billing/SubscriptionStatus";
16
16
  import ObjectID from "../../Types/ObjectID";
17
17
  import Semaphore, { SemaphoreMutex } from "../Infrastructure/Semaphore";
18
- import logger from "../Utils/Logger";
18
+ import logger, { LogAttributes } from "../Utils/Logger";
19
19
  import OneUptimeDate from "../../Types/Date";
20
20
  import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
21
21
 
@@ -51,7 +51,9 @@ export class Service extends DatabaseService<Model> {
51
51
  " at " +
52
52
  OneUptimeDate.getCurrentDateAsFormattedString(),
53
53
  );
54
- logger.error(err);
54
+ logger.error(err, {
55
+ projectId: data.projectId?.toString(),
56
+ } as LogAttributes);
55
57
  }
56
58
 
57
59
  let project: Project | null = await ProjectService.findOneById({
@@ -183,7 +185,9 @@ export class Service extends DatabaseService<Model> {
183
185
  " at " +
184
186
  OneUptimeDate.getCurrentDateAsFormattedString(),
185
187
  );
186
- logger.error(err);
188
+ logger.error(err, {
189
+ projectId: data.projectId?.toString(),
190
+ } as LogAttributes);
187
191
  }
188
192
  }
189
193
  }
@@ -7,7 +7,7 @@ import {
7
7
  import Project from "../../Models/DatabaseModels/Project";
8
8
  import ServerMeteredPlan from "../Types/Billing/MeteredPlan/ServerMeteredPlan";
9
9
  import Errors from "../Utils/Errors";
10
- import logger from "../Utils/Logger";
10
+ import logger, { LogAttributes } from "../Utils/Logger";
11
11
  import BaseService from "./BaseService";
12
12
  import MailService from "./MailService";
13
13
  import ProjectService from "./ProjectService";
@@ -821,7 +821,7 @@ export class BillingService extends BaseService {
821
821
  try {
822
822
  await this.stripe.subscriptions.del(subscriptionId);
823
823
  } catch (err) {
824
- logger.error(err);
824
+ logger.error(err, { subscriptionId } as LogAttributes);
825
825
  }
826
826
  }
827
827
 
@@ -981,6 +981,7 @@ export class BillingService extends BaseService {
981
981
  if (!stripeInvoice) {
982
982
  logger.error(
983
983
  `[Invoice Email] Invoice ${invoiceId} not found in Stripe`,
984
+ { projectId: projectId?.toString() } as LogAttributes,
984
985
  );
985
986
  return;
986
987
  }
@@ -994,6 +995,7 @@ export class BillingService extends BaseService {
994
995
  if (!toEmail) {
995
996
  logger.error(
996
997
  `[Invoice Email] No recipient email found for invoice ${invoiceId}`,
998
+ { projectId: projectId?.toString() } as LogAttributes,
997
999
  );
998
1000
  return;
999
1001
  }
@@ -1049,6 +1051,7 @@ export class BillingService extends BaseService {
1049
1051
  } catch (err) {
1050
1052
  logger.error(
1051
1053
  `[Invoice Email] Failed to send invoice ${invoiceId} by email: ${err}`,
1054
+ { projectId: projectId?.toString() } as LogAttributes,
1052
1055
  );
1053
1056
  // Don't throw - sending email is not critical
1054
1057
  }
@@ -1092,6 +1095,7 @@ export class BillingService extends BaseService {
1092
1095
  } catch (err) {
1093
1096
  logger.error(
1094
1097
  `[Invoice Email] Failed to check invoice email preference for customer ${customerId}: ${err}`,
1098
+ { customerId } as LogAttributes,
1095
1099
  );
1096
1100
  return false;
1097
1101
  }
@@ -1125,6 +1129,7 @@ export class BillingService extends BaseService {
1125
1129
  if (!invoice || !invoice.id) {
1126
1130
  logger.error(
1127
1131
  `[Invoice Email] Failed to create invoice for customer ${customerId}`,
1132
+ { projectId: projectId?.toString() } as LogAttributes,
1128
1133
  );
1129
1134
  throw new APIException(Errors.BillingService.INVOICE_NOT_GENERATED);
1130
1135
  }
@@ -1165,6 +1170,7 @@ export class BillingService extends BaseService {
1165
1170
  } catch (err) {
1166
1171
  logger.error(
1167
1172
  `[Invoice Email] Failed to pay invoice ${invoice.id}, voiding: ${err}`,
1173
+ { projectId: projectId?.toString() } as LogAttributes,
1168
1174
  );
1169
1175
  // mark invoice as failed and do not collect payment.
1170
1176
  await this.voidInvoice(invoice.id!);
@@ -1382,6 +1388,7 @@ export class BillingService extends BaseService {
1382
1388
  } catch (err) {
1383
1389
  logger.error(
1384
1390
  `[Invoice Email] Failed to send invoice by email for invoice ${invoice.id}: ${err}`,
1391
+ { customerId } as LogAttributes,
1385
1392
  );
1386
1393
  // Don't throw - webhook should still return success
1387
1394
  }
@@ -2,7 +2,7 @@ import CreateBy from "../Types/Database/CreateBy";
2
2
  import DeleteBy from "../Types/Database/DeleteBy";
3
3
  import { OnCreate, OnDelete } from "../Types/Database/Hooks";
4
4
  import GreenlockUtil from "../Utils/Greenlock/Greenlock";
5
- import logger from "../Utils/Logger";
5
+ import logger, { LogAttributes } from "../Utils/Logger";
6
6
  import DatabaseService from "./DatabaseService";
7
7
  import DomainService from "./DomainService";
8
8
  import HTTPErrorResponse from "../../Types/API/HTTPErrorResponse";
@@ -164,6 +164,7 @@ export class Service extends DatabaseService<DashboardDomain> {
164
164
 
165
165
  logger.debug(
166
166
  "Ordering SSL for domain: " + dashboardDomain.fullDomain,
167
+ { fullDomain: dashboardDomain.fullDomain } as LogAttributes,
167
168
  );
168
169
 
169
170
  await GreenlockUtil.orderCert({
@@ -173,7 +174,10 @@ export class Service extends DatabaseService<DashboardDomain> {
173
174
  },
174
175
  });
175
176
 
176
- logger.debug("SSL ordered for domain: " + dashboardDomain.fullDomain);
177
+ logger.debug(
178
+ "SSL ordered for domain: " + dashboardDomain.fullDomain,
179
+ { fullDomain: dashboardDomain.fullDomain } as LogAttributes,
180
+ );
177
181
 
178
182
  await this.updateOneById({
179
183
  id: dashboardDomain.id!,
@@ -241,7 +245,7 @@ export class Service extends DatabaseService<DashboardDomain> {
241
245
 
242
246
  return true;
243
247
  } catch (err) {
244
- logger.error(err);
248
+ logger.error(err, { fullDomain: fulldomain } as LogAttributes);
245
249
  return false;
246
250
  }
247
251
  }
@@ -283,7 +287,9 @@ export class Service extends DatabaseService<DashboardDomain> {
283
287
  @CaptureSpan()
284
288
  public async isCnameValid(fullDomain: string): Promise<boolean> {
285
289
  try {
286
- logger.debug("Checking for CNAME " + fullDomain);
290
+ logger.debug("Checking for CNAME " + fullDomain, {
291
+ fullDomain,
292
+ } as LogAttributes);
287
293
 
288
294
  const dashboardDomain: DashboardDomain | null = await this.findOneBy({
289
295
  query: {
@@ -304,7 +310,10 @@ export class Service extends DatabaseService<DashboardDomain> {
304
310
 
305
311
  const token: string = dashboardDomain.cnameVerificationToken!;
306
312
 
307
- logger.debug("Checking for CNAME " + fullDomain + " with token " + token);
313
+ logger.debug(
314
+ "Checking for CNAME " + fullDomain + " with token " + token,
315
+ { fullDomain } as LogAttributes,
316
+ );
308
317
 
309
318
  try {
310
319
  const result: HTTPErrorResponse | HTTPResponse<JSONObject> =
@@ -317,8 +326,10 @@ export class Service extends DatabaseService<DashboardDomain> {
317
326
  ),
318
327
  });
319
328
 
320
- logger.debug("CNAME verification result");
321
- logger.debug(result);
329
+ logger.debug("CNAME verification result", {
330
+ fullDomain,
331
+ } as LogAttributes);
332
+ logger.debug(result, { fullDomain } as LogAttributes);
322
333
 
323
334
  if (result.isSuccess()) {
324
335
  await this.updateCnameStatusForDashboardDomain({
@@ -329,8 +340,10 @@ export class Service extends DatabaseService<DashboardDomain> {
329
340
  return true;
330
341
  }
331
342
  } catch (err) {
332
- logger.debug("Failed checking for CNAME " + fullDomain);
333
- logger.debug(err);
343
+ logger.debug("Failed checking for CNAME " + fullDomain, {
344
+ fullDomain,
345
+ } as LogAttributes);
346
+ logger.debug(err, { fullDomain } as LogAttributes);
334
347
  }
335
348
 
336
349
  try {
@@ -344,8 +357,10 @@ export class Service extends DatabaseService<DashboardDomain> {
344
357
  ),
345
358
  });
346
359
 
347
- logger.debug("CNAME verification result for https");
348
- logger.debug(resultHttps);
360
+ logger.debug("CNAME verification result for https", {
361
+ fullDomain,
362
+ } as LogAttributes);
363
+ logger.debug(resultHttps, { fullDomain } as LogAttributes);
349
364
 
350
365
  if (resultHttps.isSuccess()) {
351
366
  await this.updateCnameStatusForDashboardDomain({
@@ -356,8 +371,10 @@ export class Service extends DatabaseService<DashboardDomain> {
356
371
  return true;
357
372
  }
358
373
  } catch (err) {
359
- logger.debug("Failed checking for CNAME " + fullDomain);
360
- logger.debug(err);
374
+ logger.debug("Failed checking for CNAME " + fullDomain, {
375
+ fullDomain,
376
+ } as LogAttributes);
377
+ logger.debug(err, { fullDomain } as LogAttributes);
361
378
  }
362
379
 
363
380
  try {
@@ -374,6 +391,7 @@ export class Service extends DatabaseService<DashboardDomain> {
374
391
  if (!cnameRecord) {
375
392
  logger.debug(
376
393
  `No CNAME record found for ${fullDomain}. Expected record: ${DashboardCNameRecord}`,
394
+ { fullDomain } as LogAttributes,
377
395
  );
378
396
  await this.updateCnameStatusForDashboardDomain({
379
397
  domain: fullDomain,
@@ -389,6 +407,7 @@ export class Service extends DatabaseService<DashboardDomain> {
389
407
  ) {
390
408
  logger.debug(
391
409
  `CNAME record for ${fullDomain} matches the expected record: ${DashboardCNameRecord}`,
410
+ { fullDomain } as LogAttributes,
392
411
  );
393
412
 
394
413
  await this.updateCnameStatusForDashboardDomain({
@@ -401,11 +420,14 @@ export class Service extends DatabaseService<DashboardDomain> {
401
420
 
402
421
  logger.debug(
403
422
  `CNAME record for ${fullDomain} is ${cnameRecord} and it does not match the expected record: ${DashboardCNameRecord}`,
423
+ { fullDomain } as LogAttributes,
404
424
  );
405
425
  }
406
426
  } catch (err) {
407
- logger.debug("Failed checking for CNAME " + fullDomain);
408
- logger.debug(err);
427
+ logger.debug("Failed checking for CNAME " + fullDomain, {
428
+ fullDomain,
429
+ } as LogAttributes);
430
+ logger.debug(err, { fullDomain } as LogAttributes);
409
431
  }
410
432
 
411
433
  await this.updateCnameStatusForDashboardDomain({
@@ -455,6 +477,7 @@ export class Service extends DatabaseService<DashboardDomain> {
455
477
 
456
478
  logger.debug(
457
479
  `DashboardCerts:RemoveCerts - Checking CNAME ${dashboardDomain.fullDomain}`,
480
+ { fullDomain: dashboardDomain.fullDomain } as LogAttributes,
458
481
  );
459
482
 
460
483
  const isValid: boolean = await this.isSSLProvisioned(
@@ -483,8 +506,11 @@ export class Service extends DatabaseService<DashboardDomain> {
483
506
  } catch (err) {
484
507
  logger.error(
485
508
  "Cannot order cert for domain: " + dashboardDomain.fullDomain,
509
+ { fullDomain: dashboardDomain.fullDomain } as LogAttributes,
486
510
  );
487
- logger.error(err);
511
+ logger.error(err, {
512
+ fullDomain: dashboardDomain.fullDomain,
513
+ } as LogAttributes);
488
514
  }
489
515
  }
490
516
  } else {
@@ -525,10 +551,14 @@ export class Service extends DatabaseService<DashboardDomain> {
525
551
 
526
552
  for (const domain of domains) {
527
553
  try {
528
- logger.debug("Ordering SSL for domain: " + domain.fullDomain);
554
+ logger.debug("Ordering SSL for domain: " + domain.fullDomain, {
555
+ fullDomain: domain.fullDomain,
556
+ } as LogAttributes);
529
557
  await this.orderCert(domain);
530
558
  } catch (e) {
531
- logger.error(e);
559
+ logger.error(e, {
560
+ fullDomain: domain.fullDomain,
561
+ } as LogAttributes);
532
562
  }
533
563
  }
534
564
 
@@ -566,7 +596,7 @@ export class Service extends DatabaseService<DashboardDomain> {
566
596
  try {
567
597
  await this.isCnameValid(domain.fullDomain as string);
568
598
  } catch (e) {
569
- logger.error(e);
599
+ logger.error(e, { fullDomain: domain.fullDomain } as LogAttributes);
570
600
  }
571
601
  }
572
602
  }
@@ -591,7 +621,9 @@ export class Service extends DatabaseService<DashboardDomain> {
591
621
  },
592
622
  });
593
623
 
594
- logger.debug(`DomainModel removed from greenlock: ${domain}`);
624
+ logger.debug(`DomainModel removed from greenlock: ${domain}`, {
625
+ fullDomain: domain,
626
+ } as LogAttributes);
595
627
  },
596
628
  });
597
629
  }
@@ -637,8 +669,10 @@ export class Service extends DatabaseService<DashboardDomain> {
637
669
  try {
638
670
  await this.orderCert(domain);
639
671
  } catch (err) {
640
- logger.error("Cannot order cert for domain: " + domain.fullDomain);
641
- logger.error(err);
672
+ logger.error("Cannot order cert for domain: " + domain.fullDomain, {
673
+ fullDomain: domain.fullDomain,
674
+ } as LogAttributes);
675
+ logger.error(err, { fullDomain: domain.fullDomain } as LogAttributes);
642
676
  }
643
677
  }
644
678
  }
@@ -3,7 +3,7 @@ import { OnCreate } from "../Types/Database/Hooks";
3
3
  import CookieUtil from "../Utils/Cookie";
4
4
  import { ExpressRequest } from "../Utils/Express";
5
5
  import JSONWebToken from "../Utils/JsonWebToken";
6
- import logger from "../Utils/Logger";
6
+ import logger, { LogAttributes } from "../Utils/Logger";
7
7
  import DatabaseService from "./DatabaseService";
8
8
  import BadDataException from "../../Types/Exception/BadDataException";
9
9
  import NotAuthenticatedException from "../../Types/Exception/NotAuthenticatedException";
@@ -140,7 +140,9 @@ export class Service extends DatabaseService<Model> {
140
140
  req.ips[0];
141
141
 
142
142
  if (!ipAccessedFrom) {
143
- logger.error("IP address not found in request.");
143
+ logger.error("IP address not found in request.", {
144
+ dashboardId: dashboardId?.toString(),
145
+ } as LogAttributes);
144
146
  return {
145
147
  hasReadAccess: false,
146
148
  error: new ForbiddenException(
@@ -160,6 +162,7 @@ export class Service extends DatabaseService<Model> {
160
162
  if (!isIPWhitelisted) {
161
163
  logger.error(
162
164
  `IP address ${ipAccessedFrom} is not whitelisted for dashboard ${dashboardId.toString()}.`,
165
+ { dashboardId: dashboardId?.toString() } as LogAttributes,
163
166
  );
164
167
 
165
168
  return {
@@ -206,7 +209,9 @@ export class Service extends DatabaseService<Model> {
206
209
  };
207
210
  }
208
211
  } catch (err) {
209
- logger.error(err);
212
+ logger.error(err, {
213
+ dashboardId: dashboardId?.toString(),
214
+ } as LogAttributes);
210
215
  }
211
216
 
212
217
  return {
@@ -238,7 +243,9 @@ export class Service extends DatabaseService<Model> {
238
243
  payload["type"] === DASHBOARD_MASTER_PASSWORD_COOKIE_IDENTIFIER
239
244
  );
240
245
  } catch (err) {
241
- logger.error(err);
246
+ logger.error(err, {
247
+ dashboardId: data.dashboardId?.toString(),
248
+ } as LogAttributes);
242
249
  }
243
250
 
244
251
  return false;
@@ -30,7 +30,7 @@ import UpdateByID from "../Types/Database/UpdateByID";
30
30
  import UpdateByIDAndFetch from "../Types/Database/UpdateByIDAndFetch";
31
31
  import UpdateOneBy from "../Types/Database/UpdateOneBy";
32
32
  import Encryption from "../Utils/Encryption";
33
- import logger from "../Utils/Logger";
33
+ import logger, { LogAttributes } from "../Utils/Logger";
34
34
  import BaseService from "./BaseService";
35
35
  import BaseModel from "../../Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel";
36
36
  import { WorkflowRoute } from "../../ServiceRoute";
@@ -585,11 +585,17 @@ class DatabaseService<TBaseModel extends BaseModel> extends BaseService {
585
585
  projectId: ObjectID,
586
586
  modelEventType: ModelEventType,
587
587
  ): Promise<void> {
588
- logger.debug("Realtime Events Enabled");
589
- logger.debug(this.model.enableRealtimeEventsOn);
588
+ logger.debug("Realtime Events Enabled", {
589
+ projectId: projectId?.toString(),
590
+ } as LogAttributes);
591
+ logger.debug(this.model.enableRealtimeEventsOn, {
592
+ projectId: projectId?.toString(),
593
+ } as LogAttributes);
590
594
 
591
595
  if (Realtime.isInitialized() && this.model.enableRealtimeEventsOn) {
592
- logger.debug("Emitting realtime event");
596
+ logger.debug("Emitting realtime event", {
597
+ projectId: projectId?.toString(),
598
+ } as LogAttributes);
593
599
  let shouldEmitEvent: boolean = false;
594
600
 
595
601
  if (
@@ -614,19 +620,27 @@ class DatabaseService<TBaseModel extends BaseModel> extends BaseService {
614
620
  }
615
621
 
616
622
  if (!shouldEmitEvent) {
617
- logger.debug("Realtime event not enabled for this event type");
623
+ logger.debug("Realtime event not enabled for this event type", {
624
+ projectId: projectId?.toString(),
625
+ } as LogAttributes);
618
626
  return;
619
627
  }
620
628
 
621
- logger.debug("Emitting realtime event");
629
+ logger.debug("Emitting realtime event", {
630
+ projectId: projectId?.toString(),
631
+ } as LogAttributes);
622
632
  Realtime.emitModelEvent({
623
633
  tenantId: projectId,
624
634
  eventType: modelEventType,
625
635
  modelId: modelId,
626
636
  modelType: this.modelType,
627
637
  }).catch((err: Error) => {
628
- logger.error("Cannot emit realtime event");
629
- logger.error(err);
638
+ logger.error("Cannot emit realtime event", {
639
+ projectId: projectId?.toString(),
640
+ } as LogAttributes);
641
+ logger.error(err, {
642
+ projectId: projectId?.toString(),
643
+ } as LogAttributes);
630
644
  });
631
645
  }
632
646
  }
@@ -659,7 +673,9 @@ class DatabaseService<TBaseModel extends BaseModel> extends BaseService {
659
673
  ...ClusterKeyAuthorization.getClusterKeyHeaders(),
660
674
  },
661
675
  }).catch((error: Error) => {
662
- logger.error(error);
676
+ logger.error(error, {
677
+ projectId: projectId?.toString(),
678
+ } as LogAttributes);
663
679
  });
664
680
  }
665
681
  }
@@ -1531,8 +1547,12 @@ class DatabaseService<TBaseModel extends BaseModel> extends BaseService {
1531
1547
  ...data,
1532
1548
  } as any;
1533
1549
 
1534
- logger.debug("Updated Item");
1535
- logger.debug(JSON.stringify(updatedItem, null, 2));
1550
+ logger.debug("Updated Item", {
1551
+ projectId: updateBy.props.tenantId?.toString(),
1552
+ } as LogAttributes);
1553
+ logger.debug(JSON.stringify(updatedItem, null, 2), {
1554
+ projectId: updateBy.props.tenantId?.toString(),
1555
+ } as LogAttributes);
1536
1556
 
1537
1557
  await this.getRepository().save(updatedItem);
1538
1558