@oneuptime/common 10.0.53 → 10.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (380) 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/UserAPI.ts +3 -3
  15. package/Server/API/UserCallAPI.ts +5 -2
  16. package/Server/API/UserEmailAPI.ts +5 -2
  17. package/Server/API/UserPushAPI.ts +9 -3
  18. package/Server/API/UserSmsAPI.ts +5 -2
  19. package/Server/API/UserWhatsAppAPI.ts +5 -2
  20. package/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.ts +47 -0
  21. package/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.ts +35 -0
  22. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
  23. package/Server/Middleware/NotificationMiddleware.ts +2 -2
  24. package/Server/Middleware/ProjectAuthorization.ts +6 -0
  25. package/Server/Middleware/SCIMAuthorization.ts +2 -1
  26. package/Server/Middleware/SlackAuthorization.ts +28 -10
  27. package/Server/Middleware/TelemetryIngest.ts +16 -3
  28. package/Server/Middleware/UserAuthorization.ts +22 -5
  29. package/Server/Middleware/WhatsAppAuthorization.ts +15 -4
  30. package/Server/Services/AIAgentService.ts +13 -6
  31. package/Server/Services/AIService.ts +9 -3
  32. package/Server/Services/AlertEpisodeFeedService.ts +17 -5
  33. package/Server/Services/AlertEpisodeService.ts +34 -3
  34. package/Server/Services/AlertEpisodeStateTimelineService.ts +80 -22
  35. package/Server/Services/AlertFeedService.ts +17 -5
  36. package/Server/Services/AlertGroupingEngineService.ts +36 -7
  37. package/Server/Services/AlertService.ts +60 -8
  38. package/Server/Services/AlertStateTimelineService.ts +29 -7
  39. package/Server/Services/AnalyticsDatabaseService.ts +59 -25
  40. package/Server/Services/BillingInvoiceService.ts +7 -3
  41. package/Server/Services/BillingService.ts +9 -2
  42. package/Server/Services/DashboardDomainService.ts +56 -22
  43. package/Server/Services/DashboardService.ts +11 -4
  44. package/Server/Services/DatabaseService.ts +31 -11
  45. package/Server/Services/IncidentEpisodeFeedService.ts +17 -5
  46. package/Server/Services/IncidentEpisodeService.ts +34 -3
  47. package/Server/Services/IncidentEpisodeStateTimelineService.ts +80 -22
  48. package/Server/Services/IncidentFeedService.ts +33 -9
  49. package/Server/Services/IncidentGroupingEngineService.ts +35 -6
  50. package/Server/Services/IncidentService.ts +103 -9
  51. package/Server/Services/IncidentSlaRuleService.ts +16 -4
  52. package/Server/Services/IncidentSlaService.ts +20 -4
  53. package/Server/Services/IncidentStateTimelineService.ts +120 -31
  54. package/Server/Services/KubernetesClusterService.ts +62 -14
  55. package/Server/Services/MonitorFeedService.ts +33 -9
  56. package/Server/Services/MonitorProbeService.ts +46 -23
  57. package/Server/Services/MonitorService.ts +35 -4
  58. package/Server/Services/MonitorStatusTimelineService.ts +68 -20
  59. package/Server/Services/NotificationService.ts +4 -2
  60. package/Server/Services/OnCallDutyPolicyEscalationRuleService.ts +53 -9
  61. package/Server/Services/OnCallDutyPolicyEscalationRuleUserService.ts +9 -2
  62. package/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts +29 -8
  63. package/Server/Services/OnCallDutyPolicyFeedService.ts +33 -8
  64. package/Server/Services/OnCallDutyPolicyScheduleService.ts +97 -24
  65. package/Server/Services/OnCallDutyPolicyService.ts +2 -1
  66. package/Server/Services/OpenTelemetryIngestService.ts +51 -20
  67. package/Server/Services/ProbeService.ts +16 -7
  68. package/Server/Services/ProjectService.ts +21 -7
  69. package/Server/Services/ScheduledMaintenanceFeedService.ts +17 -4
  70. package/Server/Services/ScheduledMaintenanceService.ts +52 -6
  71. package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +72 -20
  72. package/Server/Services/StatusPageDomainService.ts +59 -23
  73. package/Server/Services/StatusPageService.ts +26 -8
  74. package/Server/Services/StatusPageSubscriberService.ts +382 -111
  75. package/Server/Services/TeamMemberService.ts +9 -3
  76. package/Server/Services/UserNotificationRuleService.ts +9 -3
  77. package/Server/Services/UserService.ts +6 -4
  78. package/Server/Services/UserWhatsAppService.ts +9 -3
  79. package/Server/Services/WorkflowService.ts +7 -3
  80. package/Server/Services/WorkspaceNotificationRuleService.ts +398 -156
  81. package/Server/Types/Domain.ts +15 -5
  82. package/Server/Types/Workflow/Components/API/Post.ts +22 -8
  83. package/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.ts +12 -4
  84. package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +10 -0
  85. package/Server/Utils/CodeRepository/CodeRepository.ts +62 -13
  86. package/Server/Utils/Express.ts +1 -0
  87. package/Server/Utils/Greenlock/Greenlock.ts +75 -20
  88. package/Server/Utils/LLM/LLMService.ts +22 -7
  89. package/Server/Utils/Logger.ts +93 -13
  90. package/Server/Utils/Monitor/MonitorAlert.ts +15 -3
  91. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +15 -5
  92. package/Server/Utils/Monitor/MonitorIncident.ts +17 -3
  93. package/Server/Utils/Monitor/MonitorStatusTimeline.ts +6 -1
  94. package/Server/Utils/Profiling.ts +11 -5
  95. package/Server/Utils/Realtime.ts +90 -31
  96. package/Server/Utils/Response.ts +2 -2
  97. package/Server/Utils/StartServer.ts +43 -9
  98. package/Server/Utils/Telemetry/SpanUtil.ts +90 -0
  99. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.ts +58 -15
  100. package/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.ts +58 -15
  101. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts +19 -3
  102. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts +87 -22
  103. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.ts +12 -3
  104. package/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.ts +25 -7
  105. package/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.ts +55 -8
  106. package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +100 -22
  107. package/Server/Utils/Workspace/Slack/Actions/Alert.ts +35 -9
  108. package/Server/Utils/Workspace/Slack/Actions/AlertEpisode.ts +32 -8
  109. package/Server/Utils/Workspace/Slack/Actions/Auth.ts +3 -1
  110. package/Server/Utils/Workspace/Slack/Actions/Incident.ts +52 -11
  111. package/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.ts +4 -1
  112. package/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.ts +89 -20
  113. package/Server/Utils/Workspace/Slack/Slack.ts +498 -247
  114. package/Server/Utils/Workspace/Workspace.ts +33 -11
  115. package/Server/Utils/Workspace/WorkspaceBase.ts +3 -1
  116. package/Server/Utils/Workspace/WorkspaceMessages/Alert.ts +8 -2
  117. package/Tests/Server/Middleware/UserAuthorization.test.ts +1 -1
  118. package/Tests/Server/Services/AnalyticsDatabaseService.test.ts +12 -3
  119. package/UI/Components/Charts/Area/AreaChart.tsx +35 -1
  120. package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +7 -0
  121. package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +33 -0
  122. package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +33 -0
  123. package/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.ts +14 -0
  124. package/UI/Components/Charts/Line/LineChart.tsx +35 -1
  125. package/UI/Components/Charts/Types/ExemplarPoint.ts +6 -0
  126. package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +3 -3
  127. package/UI/Components/Navbar/NavBar.tsx +10 -0
  128. package/build/dist/Models/AnalyticsModels/Metric.js +70 -0
  129. package/build/dist/Models/AnalyticsModels/Metric.js.map +1 -1
  130. package/build/dist/Server/API/AIAgentDataAPI.js +6 -6
  131. package/build/dist/Server/API/AIAgentDataAPI.js.map +1 -1
  132. package/build/dist/Server/API/BillingAPI.js +13 -13
  133. package/build/dist/Server/API/BillingAPI.js.map +1 -1
  134. package/build/dist/Server/API/CommonAPI.js +5 -0
  135. package/build/dist/Server/API/CommonAPI.js.map +1 -1
  136. package/build/dist/Server/API/DashboardAPI.js +2 -2
  137. package/build/dist/Server/API/DashboardAPI.js.map +1 -1
  138. package/build/dist/Server/API/DashboardDomainAPI.js +3 -3
  139. package/build/dist/Server/API/DashboardDomainAPI.js.map +1 -1
  140. package/build/dist/Server/API/GitHubAPI.js +19 -19
  141. package/build/dist/Server/API/GitHubAPI.js.map +1 -1
  142. package/build/dist/Server/API/MicrosoftTeamsAPI.js +34 -34
  143. package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
  144. package/build/dist/Server/API/OpenSourceDeploymentAPI.js +2 -2
  145. package/build/dist/Server/API/OpenSourceDeploymentAPI.js.map +1 -1
  146. package/build/dist/Server/API/SlackAPI.js +38 -38
  147. package/build/dist/Server/API/SlackAPI.js.map +1 -1
  148. package/build/dist/Server/API/StatusAPI.js +16 -16
  149. package/build/dist/Server/API/StatusAPI.js.map +1 -1
  150. package/build/dist/Server/API/StatusPageAPI.js +52 -52
  151. package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
  152. package/build/dist/Server/API/StatusPageDomainAPI.js +3 -3
  153. package/build/dist/Server/API/StatusPageDomainAPI.js.map +1 -1
  154. package/build/dist/Server/API/UserAPI.js +3 -3
  155. package/build/dist/Server/API/UserAPI.js.map +1 -1
  156. package/build/dist/Server/API/UserCallAPI.js +2 -2
  157. package/build/dist/Server/API/UserCallAPI.js.map +1 -1
  158. package/build/dist/Server/API/UserEmailAPI.js +2 -2
  159. package/build/dist/Server/API/UserEmailAPI.js.map +1 -1
  160. package/build/dist/Server/API/UserPushAPI.js +3 -3
  161. package/build/dist/Server/API/UserPushAPI.js.map +1 -1
  162. package/build/dist/Server/API/UserSmsAPI.js +2 -2
  163. package/build/dist/Server/API/UserSmsAPI.js.map +1 -1
  164. package/build/dist/Server/API/UserWhatsAppAPI.js +2 -2
  165. package/build/dist/Server/API/UserWhatsAppAPI.js.map +1 -1
  166. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.js +40 -0
  167. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.js.map +1 -0
  168. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.js +18 -0
  169. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.js.map +1 -0
  170. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
  171. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  172. package/build/dist/Server/Middleware/NotificationMiddleware.js +2 -2
  173. package/build/dist/Server/Middleware/NotificationMiddleware.js.map +1 -1
  174. package/build/dist/Server/Middleware/ProjectAuthorization.js +5 -0
  175. package/build/dist/Server/Middleware/ProjectAuthorization.js.map +1 -1
  176. package/build/dist/Server/Middleware/SCIMAuthorization.js +2 -2
  177. package/build/dist/Server/Middleware/SCIMAuthorization.js.map +1 -1
  178. package/build/dist/Server/Middleware/SlackAuthorization.js +10 -10
  179. package/build/dist/Server/Middleware/SlackAuthorization.js.map +1 -1
  180. package/build/dist/Server/Middleware/TelemetryIngest.js +9 -4
  181. package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
  182. package/build/dist/Server/Middleware/UserAuthorization.js +10 -5
  183. package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
  184. package/build/dist/Server/Middleware/WhatsAppAuthorization.js +6 -6
  185. package/build/dist/Server/Middleware/WhatsAppAuthorization.js.map +1 -1
  186. package/build/dist/Server/Services/AIAgentService.js +13 -7
  187. package/build/dist/Server/Services/AIAgentService.js.map +1 -1
  188. package/build/dist/Server/Services/AIService.js +9 -2
  189. package/build/dist/Server/Services/AIService.js.map +1 -1
  190. package/build/dist/Server/Services/AlertEpisodeFeedService.js +17 -5
  191. package/build/dist/Server/Services/AlertEpisodeFeedService.js.map +1 -1
  192. package/build/dist/Server/Services/AlertEpisodeService.js +40 -10
  193. package/build/dist/Server/Services/AlertEpisodeService.js.map +1 -1
  194. package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js +81 -24
  195. package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js.map +1 -1
  196. package/build/dist/Server/Services/AlertFeedService.js +17 -5
  197. package/build/dist/Server/Services/AlertFeedService.js.map +1 -1
  198. package/build/dist/Server/Services/AlertGroupingEngineService.js +44 -28
  199. package/build/dist/Server/Services/AlertGroupingEngineService.js.map +1 -1
  200. package/build/dist/Server/Services/AlertService.js +72 -20
  201. package/build/dist/Server/Services/AlertService.js.map +1 -1
  202. package/build/dist/Server/Services/AlertStateTimelineService.js +36 -13
  203. package/build/dist/Server/Services/AlertStateTimelineService.js.map +1 -1
  204. package/build/dist/Server/Services/AnalyticsDatabaseService.js +52 -28
  205. package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
  206. package/build/dist/Server/Services/BillingInvoiceService.js +7 -2
  207. package/build/dist/Server/Services/BillingInvoiceService.js.map +1 -1
  208. package/build/dist/Server/Services/BillingService.js +8 -8
  209. package/build/dist/Server/Services/BillingService.js.map +1 -1
  210. package/build/dist/Server/Services/DashboardDomainService.js +49 -27
  211. package/build/dist/Server/Services/DashboardDomainService.js.map +1 -1
  212. package/build/dist/Server/Services/DashboardService.js +11 -4
  213. package/build/dist/Server/Services/DashboardService.js.map +1 -1
  214. package/build/dist/Server/Services/DatabaseService.js +32 -12
  215. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  216. package/build/dist/Server/Services/IncidentEpisodeFeedService.js +17 -5
  217. package/build/dist/Server/Services/IncidentEpisodeFeedService.js.map +1 -1
  218. package/build/dist/Server/Services/IncidentEpisodeService.js +40 -10
  219. package/build/dist/Server/Services/IncidentEpisodeService.js.map +1 -1
  220. package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js +81 -24
  221. package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js.map +1 -1
  222. package/build/dist/Server/Services/IncidentFeedService.js +34 -10
  223. package/build/dist/Server/Services/IncidentFeedService.js.map +1 -1
  224. package/build/dist/Server/Services/IncidentGroupingEngineService.js +43 -29
  225. package/build/dist/Server/Services/IncidentGroupingEngineService.js.map +1 -1
  226. package/build/dist/Server/Services/IncidentService.js +116 -28
  227. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  228. package/build/dist/Server/Services/IncidentSlaRuleService.js +19 -11
  229. package/build/dist/Server/Services/IncidentSlaRuleService.js.map +1 -1
  230. package/build/dist/Server/Services/IncidentSlaService.js +21 -14
  231. package/build/dist/Server/Services/IncidentSlaService.js.map +1 -1
  232. package/build/dist/Server/Services/IncidentStateTimelineService.js +130 -37
  233. package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
  234. package/build/dist/Server/Services/KubernetesClusterService.js +51 -14
  235. package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
  236. package/build/dist/Server/Services/MonitorFeedService.js +34 -10
  237. package/build/dist/Server/Services/MonitorFeedService.js.map +1 -1
  238. package/build/dist/Server/Services/MonitorProbeService.js +32 -16
  239. package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
  240. package/build/dist/Server/Services/MonitorService.js +42 -11
  241. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  242. package/build/dist/Server/Services/MonitorStatusTimelineService.js +69 -21
  243. package/build/dist/Server/Services/MonitorStatusTimelineService.js.map +1 -1
  244. package/build/dist/Server/Services/NotificationService.js +4 -3
  245. package/build/dist/Server/Services/NotificationService.js.map +1 -1
  246. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js +49 -12
  247. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js.map +1 -1
  248. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js +9 -3
  249. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js.map +1 -1
  250. package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js +26 -11
  251. package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js.map +1 -1
  252. package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js +34 -10
  253. package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js.map +1 -1
  254. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +94 -37
  255. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
  256. package/build/dist/Server/Services/OnCallDutyPolicyService.js +1 -1
  257. package/build/dist/Server/Services/OnCallDutyPolicyService.js.map +1 -1
  258. package/build/dist/Server/Services/OpenTelemetryIngestService.js +45 -17
  259. package/build/dist/Server/Services/OpenTelemetryIngestService.js.map +1 -1
  260. package/build/dist/Server/Services/ProbeService.js +13 -7
  261. package/build/dist/Server/Services/ProbeService.js.map +1 -1
  262. package/build/dist/Server/Services/ProjectService.js +33 -17
  263. package/build/dist/Server/Services/ProjectService.js.map +1 -1
  264. package/build/dist/Server/Services/ScheduledMaintenanceFeedService.js +17 -5
  265. package/build/dist/Server/Services/ScheduledMaintenanceFeedService.js.map +1 -1
  266. package/build/dist/Server/Services/ScheduledMaintenanceService.js +71 -24
  267. package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
  268. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +72 -24
  269. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
  270. package/build/dist/Server/Services/StatusPageDomainService.js +55 -29
  271. package/build/dist/Server/Services/StatusPageDomainService.js.map +1 -1
  272. package/build/dist/Server/Services/StatusPageService.js +29 -9
  273. package/build/dist/Server/Services/StatusPageService.js.map +1 -1
  274. package/build/dist/Server/Services/StatusPageSubscriberService.js +393 -130
  275. package/build/dist/Server/Services/StatusPageSubscriberService.js.map +1 -1
  276. package/build/dist/Server/Services/TeamMemberService.js +10 -2
  277. package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
  278. package/build/dist/Server/Services/UserNotificationRuleService.js +10 -2
  279. package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
  280. package/build/dist/Server/Services/UserService.js +8 -3
  281. package/build/dist/Server/Services/UserService.js.map +1 -1
  282. package/build/dist/Server/Services/UserWhatsAppService.js +10 -2
  283. package/build/dist/Server/Services/UserWhatsAppService.js.map +1 -1
  284. package/build/dist/Server/Services/WorkflowService.js +7 -2
  285. package/build/dist/Server/Services/WorkflowService.js.map +1 -1
  286. package/build/dist/Server/Services/WorkspaceNotificationRuleService.js +367 -180
  287. package/build/dist/Server/Services/WorkspaceNotificationRuleService.js.map +1 -1
  288. package/build/dist/Server/Types/Domain.js +12 -6
  289. package/build/dist/Server/Types/Domain.js.map +1 -1
  290. package/build/dist/Server/Types/Workflow/Components/API/Post.js +11 -7
  291. package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
  292. package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js +11 -4
  293. package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js.map +1 -1
  294. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +7 -0
  295. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
  296. package/build/dist/Server/Utils/CodeRepository/CodeRepository.js +45 -17
  297. package/build/dist/Server/Utils/CodeRepository/CodeRepository.js.map +1 -1
  298. package/build/dist/Server/Utils/Express.js.map +1 -1
  299. package/build/dist/Server/Utils/Greenlock/Greenlock.js +36 -29
  300. package/build/dist/Server/Utils/Greenlock/Greenlock.js.map +1 -1
  301. package/build/dist/Server/Utils/LLM/LLMService.js +18 -6
  302. package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
  303. package/build/dist/Server/Utils/Logger.js +61 -13
  304. package/build/dist/Server/Utils/Logger.js.map +1 -1
  305. package/build/dist/Server/Utils/Monitor/MonitorAlert.js +23 -20
  306. package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
  307. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +13 -4
  308. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  309. package/build/dist/Server/Utils/Monitor/MonitorIncident.js +25 -22
  310. package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
  311. package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js +6 -3
  312. package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js.map +1 -1
  313. package/build/dist/Server/Utils/Profiling.js +9 -6
  314. package/build/dist/Server/Utils/Profiling.js.map +1 -1
  315. package/build/dist/Server/Utils/Realtime.js +50 -34
  316. package/build/dist/Server/Utils/Realtime.js.map +1 -1
  317. package/build/dist/Server/Utils/Response.js +2 -2
  318. package/build/dist/Server/Utils/Response.js.map +1 -1
  319. package/build/dist/Server/Utils/StartServer.js +23 -11
  320. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  321. package/build/dist/Server/Utils/Telemetry/SpanUtil.js +52 -0
  322. package/build/dist/Server/Utils/Telemetry/SpanUtil.js.map +1 -0
  323. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js +58 -15
  324. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js.map +1 -1
  325. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js +58 -15
  326. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js.map +1 -1
  327. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js +19 -5
  328. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js.map +1 -1
  329. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js +90 -26
  330. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js.map +1 -1
  331. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js +12 -3
  332. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js.map +1 -1
  333. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js +25 -7
  334. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js.map +1 -1
  335. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js +58 -19
  336. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js.map +1 -1
  337. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +102 -29
  338. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
  339. package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js +38 -9
  340. package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js.map +1 -1
  341. package/build/dist/Server/Utils/Workspace/Slack/Actions/AlertEpisode.js +34 -8
  342. package/build/dist/Server/Utils/Workspace/Slack/Actions/AlertEpisode.js.map +1 -1
  343. package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js +3 -1
  344. package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js.map +1 -1
  345. package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js +55 -13
  346. package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js.map +1 -1
  347. package/build/dist/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.js +5 -1
  348. package/build/dist/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.js.map +1 -1
  349. package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js +91 -26
  350. package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js.map +1 -1
  351. package/build/dist/Server/Utils/Workspace/Slack/Slack.js +355 -270
  352. package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
  353. package/build/dist/Server/Utils/Workspace/Workspace.js +21 -12
  354. package/build/dist/Server/Utils/Workspace/Workspace.js.map +1 -1
  355. package/build/dist/Server/Utils/Workspace/WorkspaceBase.js +3 -1
  356. package/build/dist/Server/Utils/Workspace/WorkspaceBase.js.map +1 -1
  357. package/build/dist/Server/Utils/Workspace/WorkspaceMessages/Alert.js +9 -2
  358. package/build/dist/Server/Utils/Workspace/WorkspaceMessages/Alert.js.map +1 -1
  359. package/build/dist/Tests/Server/Middleware/UserAuthorization.test.js +1 -1
  360. package/build/dist/Tests/Server/Middleware/UserAuthorization.test.js.map +1 -1
  361. package/build/dist/Tests/Server/Services/AnalyticsDatabaseService.test.js +12 -6
  362. package/build/dist/Tests/Server/Services/AnalyticsDatabaseService.test.js.map +1 -1
  363. package/build/dist/UI/Components/Charts/Area/AreaChart.js +20 -2
  364. package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
  365. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +2 -2
  366. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
  367. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +9 -2
  368. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
  369. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +9 -2
  370. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
  371. package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.js +2 -0
  372. package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.js.map +1 -0
  373. package/build/dist/UI/Components/Charts/Line/LineChart.js +20 -2
  374. package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
  375. package/build/dist/UI/Components/Charts/Types/ExemplarPoint.js +2 -0
  376. package/build/dist/UI/Components/Charts/Types/ExemplarPoint.js.map +1 -0
  377. package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +3 -3
  378. package/build/dist/UI/Components/Navbar/NavBar.js +9 -1
  379. package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
  380. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import logger from "../Utils/Logger";
1
+ import logger, { LogAttributes } from "../Utils/Logger";
2
2
  import DomainCommon from "../../Types/Domain";
3
3
  import { PromiseRejectErrorFunction } from "../../Types/FunctionTypes";
4
4
  import dns from "dns";
@@ -13,9 +13,14 @@ export default class Domain extends DomainCommon {
13
13
  dns.resolveCname(
14
14
  data.domain,
15
15
  (err: Error | null, addresses: string[]) => {
16
+ const domainLogAttributes: LogAttributes = {
17
+ domain: data.domain,
18
+ };
19
+
16
20
  if (err) {
17
21
  logger.debug(
18
22
  `DNS CNAME lookup failed for domain ${data.domain}: ${err.message}`,
23
+ domainLogAttributes,
19
24
  );
20
25
 
21
26
  // Handle specific DNS error types with user-friendly messages
@@ -89,9 +94,14 @@ export default class Domain extends DomainCommon {
89
94
  dns.resolveTxt(
90
95
  domain.toString(),
91
96
  (err: Error | null, data: Array<Array<string>>) => {
97
+ const domainLogAttributes: LogAttributes = {
98
+ domain: domain.toString(),
99
+ };
100
+
92
101
  if (err) {
93
102
  logger.debug(
94
103
  `DNS TXT lookup failed for domain ${domain.toString()}: ${err.message}`,
104
+ domainLogAttributes,
95
105
  );
96
106
 
97
107
  // Handle specific DNS error types with user-friendly messages
@@ -136,10 +146,10 @@ export default class Domain extends DomainCommon {
136
146
  );
137
147
  }
138
148
 
139
- logger.debug("Verify TXT Record");
140
- logger.debug("Domain " + domain.toString());
141
- logger.debug("Data: ");
142
- logger.debug(data);
149
+ logger.debug("Verify TXT Record", domainLogAttributes);
150
+ logger.debug("Domain " + domain.toString(), domainLogAttributes);
151
+ logger.debug("Data: ", domainLogAttributes);
152
+ logger.debug(data, domainLogAttributes);
143
153
 
144
154
  let isVerified: boolean = false;
145
155
  for (const item of data) {
@@ -12,7 +12,7 @@ import ComponentMetadata, {
12
12
  import ComponentID from "../../../../../Types/Workflow/ComponentID";
13
13
  import APIComponents from "../../../../../Types/Workflow/Components/API";
14
14
  import API from "../../../../../Utils/API";
15
- import logger from "../../../../Utils/Logger";
15
+ import logger, { LogAttributes } from "../../../../Utils/Logger";
16
16
  import CaptureSpan from "../../../../Utils/Telemetry/CaptureSpan";
17
17
 
18
18
  export default class ApiPost extends ComponentCode {
@@ -42,24 +42,35 @@ export default class ApiPost extends ComponentCode {
42
42
 
43
43
  let apiResult: HTTPResponse<JSONObject> | HTTPErrorResponse | null = null;
44
44
 
45
- logger.debug("API Post Component is running.");
45
+ const workflowLogAttributes: LogAttributes = {
46
+ projectId: options.projectId.toString(),
47
+ workflowId: options.workflowId.toString(),
48
+ };
49
+
50
+ logger.debug("API Post Component is running.", workflowLogAttributes);
46
51
 
47
52
  const url: URL = args["url"] as URL;
48
53
  if (!url) {
49
54
  throw options.onError(new BadDataException("URL is required"));
50
55
  }
51
56
 
52
- logger.debug(`URL: ${url}`);
57
+ logger.debug(`URL: ${url}`, workflowLogAttributes);
53
58
 
54
59
  const requestBody: JSONObject = args["request-body"] as JSONObject;
55
60
 
56
- logger.debug(`Request Body: ${JSON.stringify(requestBody)}`);
61
+ logger.debug(
62
+ `Request Body: ${JSON.stringify(requestBody)}`,
63
+ workflowLogAttributes,
64
+ );
57
65
 
58
66
  const requestHeaders: Dictionary<string> = args[
59
67
  "request-headers"
60
68
  ] as Dictionary<string>;
61
69
 
62
- logger.debug(`Request Headers: ${JSON.stringify(requestHeaders)}`);
70
+ logger.debug(
71
+ `Request Headers: ${JSON.stringify(requestHeaders)}`,
72
+ workflowLogAttributes,
73
+ );
63
74
 
64
75
  try {
65
76
  apiResult = await API.post({
@@ -68,7 +79,7 @@ export default class ApiPost extends ComponentCode {
68
79
  headers: args["request-headers"] as Dictionary<string>,
69
80
  });
70
81
 
71
- logger.debug("API Post Component is done.");
82
+ logger.debug("API Post Component is done.", workflowLogAttributes);
72
83
 
73
84
  return Promise.resolve({
74
85
  returnValues: ApiComponentUtils.getReturnValues(apiResult),
@@ -89,8 +100,11 @@ export default class ApiPost extends ComponentCode {
89
100
  });
90
101
  }
91
102
 
92
- logger.debug("API Post Component is done with error.");
93
- logger.debug(err);
103
+ logger.debug(
104
+ "API Post Component is done with error.",
105
+ workflowLogAttributes,
106
+ );
107
+ logger.debug(err, workflowLogAttributes);
94
108
 
95
109
  return Promise.resolve({
96
110
  returnValues: {
@@ -6,7 +6,7 @@ import {
6
6
  ExpressResponse,
7
7
  NextFunction,
8
8
  } from "../../../../Utils/Express";
9
- import logger from "../../../../Utils/Logger";
9
+ import logger, { LogAttributes } from "../../../../Utils/Logger";
10
10
  import Response from "../../../../Utils/Response";
11
11
  import Select from "../../../Database/Select";
12
12
  import { RunOptions, RunReturnType } from "../../ComponentCode";
@@ -131,8 +131,13 @@ export default class OnTriggerBaseModel<
131
131
 
132
132
  let select: Select<TBaseModel> = args["select"] as Select<TBaseModel>;
133
133
 
134
- logger.debug("Select: ");
135
- logger.debug(select);
134
+ const runLogAttributes: LogAttributes = {
135
+ projectId: options.projectId.toString(),
136
+ workflowId: options.workflowId.toString(),
137
+ };
138
+
139
+ logger.debug("Select: ", runLogAttributes);
140
+ logger.debug(select, runLogAttributes);
136
141
 
137
142
  if (select && typeof select === "string") {
138
143
  select = JSONFunctions.parse(select) as Select<TBaseModel>;
@@ -236,7 +241,10 @@ export default class OnTriggerBaseModel<
236
241
  listenOn = JSON.parse(listenOn);
237
242
  }
238
243
  } catch (err) {
239
- logger.error(err);
244
+ logger.error(err, {
245
+ projectId: req.params["projectId"],
246
+ workflowId: workflow.id?.toString(),
247
+ });
240
248
  continue;
241
249
  }
242
250
 
@@ -856,6 +856,16 @@ export default class StatementGenerator<TBaseModel extends AnalyticsBaseModel> {
856
856
  return statement;
857
857
  }
858
858
 
859
+ public toDropSkipIndexStatement(indexName: string): string {
860
+ const databaseName: string = this.database.getDatasourceOptions().database!;
861
+ const statement: string = `ALTER TABLE ${databaseName}.${this.model.tableName} DROP INDEX IF EXISTS ${indexName}`;
862
+
863
+ logger.debug(`${this.model.tableName} Drop Skip Index Statement`);
864
+ logger.debug(statement);
865
+
866
+ return statement;
867
+ }
868
+
859
869
  public toDropColumnStatement(columnName: string): string {
860
870
  const statement: string = `ALTER TABLE ${this.database.getDatasourceOptions()
861
871
  .database!}.${this.model.tableName} DROP COLUMN IF EXISTS ${columnName}`;
@@ -2,7 +2,7 @@ import path from "path";
2
2
  import fs from "fs";
3
3
  import Execute from "../Execute";
4
4
  import LocalFile from "../LocalFile";
5
- import logger from "../Logger";
5
+ import logger, { LogAttributes } from "../Logger";
6
6
  import CaptureSpan from "../Telemetry/CaptureSpan";
7
7
  import CodeRepositoryFile from "./CodeRepositoryFile";
8
8
  import Dictionary from "../../../Types/Dictionary";
@@ -91,11 +91,17 @@ export default class CodeRepositoryUtil {
91
91
  ]);
92
92
  await this.runGitCommand(data.repoPath, ["checkout", data.branchName]);
93
93
  } catch (error) {
94
+ const branchLogAttributes: LogAttributes = {
95
+ repoPath: data.repoPath,
96
+ branchName: data.branchName,
97
+ };
98
+
94
99
  logger.debug(
95
100
  `Branch ${data.branchName} not found. Creating a new branch instead.`,
101
+ branchLogAttributes,
96
102
  );
97
103
 
98
- logger.debug(error);
104
+ logger.debug(error, branchLogAttributes);
99
105
 
100
106
  await this.runGitCommand(data.repoPath, [
101
107
  "checkout",
@@ -172,7 +178,10 @@ export default class CodeRepositoryUtil {
172
178
  `${data.repoPath}/${data.directoryPath}`,
173
179
  );
174
180
 
175
- logger.debug("Deleting directory: " + totalPath);
181
+ logger.debug("Deleting directory: " + totalPath, {
182
+ repoPath: data.repoPath,
183
+ directoryPath: data.directoryPath,
184
+ });
176
185
 
177
186
  await LocalFile.deleteDirectory(totalPath);
178
187
  }
@@ -182,8 +191,14 @@ export default class CodeRepositoryUtil {
182
191
  repoPath: string;
183
192
  branchName: string;
184
193
  }): Promise<void> {
194
+ const createBranchLogAttributes: LogAttributes = {
195
+ repoPath: data.repoPath,
196
+ branchName: data.branchName,
197
+ };
198
+
185
199
  logger.debug(
186
200
  `Creating git branch '${data.branchName}' in ${path.resolve(data.repoPath)}`,
201
+ createBranchLogAttributes,
187
202
  );
188
203
 
189
204
  const stdout: string = await this.runGitCommand(data.repoPath, [
@@ -192,7 +207,7 @@ export default class CodeRepositoryUtil {
192
207
  data.branchName,
193
208
  ]);
194
209
 
195
- logger.debug(stdout);
210
+ logger.debug(stdout, createBranchLogAttributes);
196
211
  }
197
212
 
198
213
  @CaptureSpan()
@@ -200,8 +215,14 @@ export default class CodeRepositoryUtil {
200
215
  repoPath: string;
201
216
  branchName: string;
202
217
  }): Promise<void> {
218
+ const checkoutLogAttributes: LogAttributes = {
219
+ repoPath: data.repoPath,
220
+ branchName: data.branchName,
221
+ };
222
+
203
223
  logger.debug(
204
224
  `Checking out git branch '${data.branchName}' in ${path.resolve(data.repoPath)}`,
225
+ checkoutLogAttributes,
205
226
  );
206
227
 
207
228
  const stdout: string = await this.runGitCommand(data.repoPath, [
@@ -209,7 +230,7 @@ export default class CodeRepositoryUtil {
209
230
  data.branchName,
210
231
  ]);
211
232
 
212
- logger.debug(stdout);
233
+ logger.debug(stdout, checkoutLogAttributes);
213
234
  }
214
235
 
215
236
  @CaptureSpan()
@@ -249,13 +270,21 @@ export default class CodeRepositoryUtil {
249
270
  );
250
271
  }
251
272
 
273
+ const addFilesLogAttributes: LogAttributes = {
274
+ repoPath: data.repoPath,
275
+ };
276
+
252
277
  if (sanitizedRelativeFilePaths.length === 0) {
253
- logger.debug("git add skipped because no file paths were provided");
278
+ logger.debug(
279
+ "git add skipped because no file paths were provided",
280
+ addFilesLogAttributes,
281
+ );
254
282
  return;
255
283
  }
256
284
 
257
285
  logger.debug(
258
286
  `Adding ${sanitizedRelativeFilePaths.length} file(s) to git in ${path.resolve(data.repoPath)}`,
287
+ addFilesLogAttributes,
259
288
  );
260
289
 
261
290
  const stdout: string = await this.runGitCommand(data.repoPath, [
@@ -263,7 +292,7 @@ export default class CodeRepositoryUtil {
263
292
  ...sanitizedRelativeFilePaths,
264
293
  ]);
265
294
 
266
- logger.debug(stdout);
295
+ logger.debug(stdout, addFilesLogAttributes);
267
296
  }
268
297
 
269
298
  @CaptureSpan()
@@ -271,7 +300,14 @@ export default class CodeRepositoryUtil {
271
300
  repoPath: string;
272
301
  username: string;
273
302
  }): Promise<void> {
274
- logger.debug(`Setting git user.name in ${path.resolve(data.repoPath)}`);
303
+ const setUsernameLogAttributes: LogAttributes = {
304
+ repoPath: data.repoPath,
305
+ };
306
+
307
+ logger.debug(
308
+ `Setting git user.name in ${path.resolve(data.repoPath)}`,
309
+ setUsernameLogAttributes,
310
+ );
275
311
 
276
312
  const stdout: string = await this.runGitCommand(data.repoPath, [
277
313
  "config",
@@ -279,7 +315,7 @@ export default class CodeRepositoryUtil {
279
315
  data.username,
280
316
  ]);
281
317
 
282
- logger.debug(stdout);
318
+ logger.debug(stdout, setUsernameLogAttributes);
283
319
  }
284
320
 
285
321
  @CaptureSpan()
@@ -287,7 +323,11 @@ export default class CodeRepositoryUtil {
287
323
  repoPath: string;
288
324
  message: string;
289
325
  }): Promise<void> {
290
- logger.debug("Executing git commit");
326
+ const commitLogAttributes: LogAttributes = {
327
+ repoPath: data.repoPath,
328
+ };
329
+
330
+ logger.debug("Executing git commit", commitLogAttributes);
291
331
 
292
332
  const stdout: string = await Execute.executeCommandFile({
293
333
  command: "git",
@@ -295,7 +335,7 @@ export default class CodeRepositoryUtil {
295
335
  cwd: data.repoPath,
296
336
  });
297
337
 
298
- logger.debug(stdout);
338
+ logger.debug(stdout, commitLogAttributes);
299
339
  }
300
340
 
301
341
  @CaptureSpan()
@@ -323,7 +363,15 @@ export default class CodeRepositoryUtil {
323
363
  `./${relativeTarget}`,
324
364
  );
325
365
 
326
- logger.debug(`Getting last commit hash for ${gitArgument} in ${repoRoot}`);
366
+ const commitHashLogAttributes: LogAttributes = {
367
+ repoPath: data.repoPath,
368
+ filePath: data.filePath,
369
+ };
370
+
371
+ logger.debug(
372
+ `Getting last commit hash for ${gitArgument} in ${repoRoot}`,
373
+ commitHashLogAttributes,
374
+ );
327
375
 
328
376
  const hash: string = await this.runGitCommand(repoRoot, [
329
377
  "log",
@@ -332,7 +380,7 @@ export default class CodeRepositoryUtil {
332
380
  gitArgument,
333
381
  ]);
334
382
 
335
- logger.debug(hash);
383
+ logger.debug(hash, commitHashLogAttributes);
336
384
 
337
385
  return hash.trim();
338
386
  }
@@ -490,6 +538,7 @@ export default class CodeRepositoryUtil {
490
538
  return arg.includes(" ") ? `"${arg}"` : arg;
491
539
  })
492
540
  .join(" ")}`,
541
+ { repoPath },
493
542
  );
494
543
 
495
544
  return Execute.executeCommandFile({
@@ -37,6 +37,7 @@ export interface OneUptimeRequest extends express.Request {
37
37
  userType?: UserType;
38
38
  userAuthorization?: JSONWebTokenData;
39
39
  tenantId?: ObjectID;
40
+ requestId?: string;
40
41
  userGlobalAccessPermission?: UserGlobalAccessPermission;
41
42
  userTenantAccessPermission?: Dictionary<UserTenantAccessPermission>; // tenantId <-> UserTenantAccessPermission;
42
43
  rawFormUrlEncodedBody?: string;
@@ -6,7 +6,7 @@ import {
6
6
  import AcmeCertificateService from "../../Services/AcmeCertificateService";
7
7
  import AcmeChallengeService from "../../Services/AcmeChallengeService";
8
8
  import QueryHelper from "../../Types/Database/QueryHelper";
9
- import logger from "../Logger";
9
+ import logger, { LogAttributes } from "../Logger";
10
10
  import SortOrder from "../../../Types/BaseDatabase/SortOrder";
11
11
  import LIMIT_MAX from "../../../Types/Database/LimitMax";
12
12
  import OneUptimeDate from "../../../Types/Date";
@@ -56,6 +56,7 @@ export default class GreenlockUtil {
56
56
 
57
57
  logger.debug(
58
58
  `Found ${certificates.length} certificates which are expiring soon`,
59
+ { certificateCount: certificates.length },
59
60
  );
60
61
 
61
62
  // order certificate for each domain
@@ -65,7 +66,14 @@ export default class GreenlockUtil {
65
66
  continue;
66
67
  }
67
68
 
68
- logger.debug(`Renewing certificate for domain: ${certificate.domain}`);
69
+ const certLogAttributes: LogAttributes = {
70
+ domain: certificate.domain,
71
+ };
72
+
73
+ logger.debug(
74
+ `Renewing certificate for domain: ${certificate.domain}`,
75
+ certLogAttributes,
76
+ );
69
77
 
70
78
  try {
71
79
  //validate cname
@@ -76,6 +84,7 @@ export default class GreenlockUtil {
76
84
  if (!isValidCname) {
77
85
  logger.debug(
78
86
  `CNAME is not valid for domain: ${certificate.domain}`,
87
+ certLogAttributes,
79
88
  );
80
89
 
81
90
  // if cname is not valid then remove the domain
@@ -84,9 +93,13 @@ export default class GreenlockUtil {
84
93
 
85
94
  logger.error(
86
95
  `Cname is not valid for domain: ${certificate.domain}`,
96
+ certLogAttributes,
87
97
  );
88
98
  } else {
89
- logger.debug(`CNAME is valid for domain: ${certificate.domain}`);
99
+ logger.debug(
100
+ `CNAME is valid for domain: ${certificate.domain}`,
101
+ certLogAttributes,
102
+ );
90
103
 
91
104
  await GreenlockUtil.orderCert({
92
105
  domain: certificate.domain,
@@ -95,13 +108,15 @@ export default class GreenlockUtil {
95
108
 
96
109
  logger.debug(
97
110
  `Certificate renewed for domain: ${certificate.domain}`,
111
+ certLogAttributes,
98
112
  );
99
113
  }
100
114
  } catch (e) {
101
115
  logger.error(
102
116
  `Error renewing certificate for domain: ${certificate.domain}`,
117
+ certLogAttributes,
103
118
  );
104
- logger.error(e);
119
+ logger.error(e, certLogAttributes);
105
120
  }
106
121
  }
107
122
  } catch (e) {
@@ -127,7 +142,7 @@ export default class GreenlockUtil {
127
142
  },
128
143
  });
129
144
  } catch (err) {
130
- logger.error(`Error removing domain: ${domain}`);
145
+ logger.error(`Error removing domain: ${domain}`, { domain });
131
146
  throw err;
132
147
  }
133
148
  }
@@ -137,14 +152,20 @@ export default class GreenlockUtil {
137
152
  domain: string;
138
153
  validateCname: (domain: string) => Promise<boolean>;
139
154
  }): Promise<void> {
155
+ const orderLogAttributes: LogAttributes = {
156
+ domain: data.domain,
157
+ };
158
+
140
159
  try {
141
160
  logger.debug(
142
161
  `GreenlockUtil - Ordering certificate for domain: ${data.domain}`,
162
+ orderLogAttributes,
143
163
  );
144
164
 
145
165
  let { domain } = data;
146
166
 
147
167
  domain = domain.trim().toLowerCase();
168
+ orderLogAttributes["domain"] = domain;
148
169
 
149
170
  const acmeAccountKeyInBase64: string = LetsEncryptAccountKey;
150
171
 
@@ -163,20 +184,29 @@ export default class GreenlockUtil {
163
184
 
164
185
  //validate cname
165
186
 
166
- logger.debug(`Validating cname for domain: ${domain}`);
187
+ logger.debug(
188
+ `Validating cname for domain: ${domain}`,
189
+ orderLogAttributes,
190
+ );
167
191
 
168
192
  const isValidCname: boolean = await data.validateCname(domain);
169
193
 
170
194
  if (!isValidCname) {
171
- logger.debug(`CNAME is not valid for domain: ${domain}`);
172
- logger.debug(`Removing domain: ${domain}`);
195
+ logger.debug(
196
+ `CNAME is not valid for domain: ${domain}`,
197
+ orderLogAttributes,
198
+ );
199
+ logger.debug(`Removing domain: ${domain}`, orderLogAttributes);
173
200
 
174
201
  await GreenlockUtil.removeDomain(domain);
175
- logger.error(`Cname is not valid for domain: ${domain}`);
202
+ logger.error(
203
+ `Cname is not valid for domain: ${domain}`,
204
+ orderLogAttributes,
205
+ );
176
206
  throw new BadDataException("Cname is not valid for domain " + domain);
177
207
  }
178
208
 
179
- logger.debug(`Cname is valid for domain: ${domain}`);
209
+ logger.debug(`Cname is valid for domain: ${domain}`, orderLogAttributes);
180
210
 
181
211
  const client: acme.Client = new acme.Client({
182
212
  directoryUrl: acme.directory.letsencrypt.production,
@@ -187,7 +217,10 @@ export default class GreenlockUtil {
187
217
  commonName: domain,
188
218
  });
189
219
 
190
- logger.debug(`Ordering certificate for domain: ${domain}`);
220
+ logger.debug(
221
+ `Ordering certificate for domain: ${domain}`,
222
+ orderLogAttributes,
223
+ );
191
224
 
192
225
  const certificate: string = await client.auto({
193
226
  csr: certificateRequest,
@@ -204,6 +237,7 @@ export default class GreenlockUtil {
204
237
  if (challenge.type === "http-01") {
205
238
  logger.debug(
206
239
  `Creating challenge for domain: ${authz.identifier.value}`,
240
+ orderLogAttributes,
207
241
  );
208
242
 
209
243
  const acmeChallenge: AcmeChallenge = new AcmeChallenge();
@@ -220,6 +254,7 @@ export default class GreenlockUtil {
220
254
 
221
255
  logger.debug(
222
256
  `Challenge created for domain: ${authz.identifier.value}`,
257
+ orderLogAttributes,
223
258
  );
224
259
  }
225
260
  },
@@ -231,6 +266,7 @@ export default class GreenlockUtil {
231
266
 
232
267
  logger.debug(
233
268
  `Removing challenge for domain: ${authz.identifier.value}`,
269
+ orderLogAttributes,
234
270
  );
235
271
 
236
272
  if (challenge.type === "http-01") {
@@ -248,11 +284,15 @@ export default class GreenlockUtil {
248
284
 
249
285
  logger.debug(
250
286
  `Challenge removed for domain: ${authz.identifier.value}`,
287
+ orderLogAttributes,
251
288
  );
252
289
  },
253
290
  });
254
291
 
255
- logger.debug(`Certificate ordered for domain: ${domain}`);
292
+ logger.debug(
293
+ `Certificate ordered for domain: ${domain}`,
294
+ orderLogAttributes,
295
+ );
256
296
 
257
297
  // get expires at date from certificate
258
298
  const cert: acme.CertificateInfo =
@@ -260,8 +300,8 @@ export default class GreenlockUtil {
260
300
  const issuedAt: Date = cert.notBefore;
261
301
  const expiresAt: Date = cert.notAfter;
262
302
 
263
- logger.debug(`Certificate expires at: ${expiresAt}`);
264
- logger.debug(`Certificate issued at: ${issuedAt}`);
303
+ logger.debug(`Certificate expires at: ${expiresAt}`, orderLogAttributes);
304
+ logger.debug(`Certificate issued at: ${issuedAt}`, orderLogAttributes);
265
305
 
266
306
  // check if the certificate is already in the database.
267
307
  const existingCertificate: AcmeCertificate | null =
@@ -278,7 +318,10 @@ export default class GreenlockUtil {
278
318
  });
279
319
 
280
320
  if (existingCertificate) {
281
- logger.debug(`Updating certificate for domain: ${domain}`);
321
+ logger.debug(
322
+ `Updating certificate for domain: ${domain}`,
323
+ orderLogAttributes,
324
+ );
282
325
 
283
326
  // update the certificate
284
327
  await AcmeCertificateService.updateBy({
@@ -298,9 +341,15 @@ export default class GreenlockUtil {
298
341
  },
299
342
  });
300
343
 
301
- logger.debug(`Certificate updated for domain: ${domain}`);
344
+ logger.debug(
345
+ `Certificate updated for domain: ${domain}`,
346
+ orderLogAttributes,
347
+ );
302
348
  } else {
303
- logger.debug(`Creating certificate for domain: ${domain}`);
349
+ logger.debug(
350
+ `Creating certificate for domain: ${domain}`,
351
+ orderLogAttributes,
352
+ );
304
353
  // create the certificate
305
354
  const acmeCertificate: AcmeCertificate = new AcmeCertificate();
306
355
 
@@ -317,11 +366,17 @@ export default class GreenlockUtil {
317
366
  },
318
367
  });
319
368
 
320
- logger.debug(`Certificate created for domain: ${domain}`);
369
+ logger.debug(
370
+ `Certificate created for domain: ${domain}`,
371
+ orderLogAttributes,
372
+ );
321
373
  }
322
374
  } catch (e) {
323
- logger.error(`Error ordering certificate for domain: ${data.domain}`);
324
- logger.error(e);
375
+ logger.error(
376
+ `Error ordering certificate for domain: ${data.domain}`,
377
+ orderLogAttributes,
378
+ );
379
+ logger.error(e, orderLogAttributes);
325
380
 
326
381
  if (e instanceof Exception) {
327
382
  throw e;
@@ -5,7 +5,7 @@ import { JSONObject } from "../../../Types/JSON";
5
5
  import API from "../../../Utils/API";
6
6
  import LlmType from "../../../Types/LLM/LlmType";
7
7
  import BadDataException from "../../../Types/Exception/BadDataException";
8
- import logger from "../Logger";
8
+ import logger, { LogAttributes } from "../Logger";
9
9
  import CaptureSpan from "../Telemetry/CaptureSpan";
10
10
 
11
11
  export interface LLMMessage {
@@ -92,9 +92,14 @@ export default class LLMService {
92
92
  },
93
93
  });
94
94
 
95
+ const openAILogAttributes: LogAttributes = {
96
+ llmType: config.llmType,
97
+ modelName: modelName,
98
+ };
99
+
95
100
  if (response instanceof HTTPErrorResponse) {
96
- logger.error("Error from OpenAI API:");
97
- logger.error(response);
101
+ logger.error("Error from OpenAI API:", openAILogAttributes);
102
+ logger.error(response, openAILogAttributes);
98
103
  throw new BadDataException(
99
104
  `OpenAI API error: ${JSON.stringify(response.jsonData)}`,
100
105
  );
@@ -175,9 +180,14 @@ export default class LLMService {
175
180
  },
176
181
  });
177
182
 
183
+ const anthropicLogAttributes: LogAttributes = {
184
+ llmType: config.llmType,
185
+ modelName: modelName,
186
+ };
187
+
178
188
  if (response instanceof HTTPErrorResponse) {
179
- logger.error("Error from Anthropic API:");
180
- logger.error(response);
189
+ logger.error("Error from Anthropic API:", anthropicLogAttributes);
190
+ logger.error(response, anthropicLogAttributes);
181
191
  throw new BadDataException(
182
192
  `Anthropic API error: ${JSON.stringify(response.jsonData)}`,
183
193
  );
@@ -253,9 +263,14 @@ export default class LLMService {
253
263
  },
254
264
  });
255
265
 
266
+ const ollamaLogAttributes: LogAttributes = {
267
+ llmType: config.llmType,
268
+ modelName: modelName,
269
+ };
270
+
256
271
  if (response instanceof HTTPErrorResponse) {
257
- logger.error("Error from Ollama API:");
258
- logger.error(response);
272
+ logger.error("Error from Ollama API:", ollamaLogAttributes);
273
+ logger.error(response, ollamaLogAttributes);
259
274
  throw new BadDataException(
260
275
  `Ollama API error: ${JSON.stringify(response.jsonData)}`,
261
276
  );