@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
@@ -7,7 +7,7 @@ import ObjectID from "../../../Types/ObjectID";
7
7
  import WorkspaceMessagePayload, {
8
8
  WorkspacePayloadMarkdown,
9
9
  } from "../../../Types/Workspace/WorkspaceMessagePayload";
10
- import logger from "../Logger";
10
+ import logger, { LogAttributes } from "../Logger";
11
11
  import WorkspaceProjectAuthTokenService from "../../Services/WorkspaceProjectAuthTokenService";
12
12
  import WorkspaceProjectAuthToken, {
13
13
  SlackMiscData,
@@ -157,8 +157,15 @@ export default class WorkspaceUtil {
157
157
  projectId: ObjectID;
158
158
  messagePayloadsByWorkspace: Array<WorkspaceMessagePayload>;
159
159
  }): Promise<Array<WorkspaceSendMessageResponse>> {
160
- logger.debug("postToWorkspaceChannels called with data:");
161
- logger.debug(JSON.stringify(data, null, 2));
160
+ const workspaceLogAttributes: LogAttributes = {
161
+ projectId: data.projectId?.toString(),
162
+ };
163
+
164
+ logger.debug(
165
+ "postToWorkspaceChannels called with data:",
166
+ workspaceLogAttributes,
167
+ );
168
+ logger.debug(JSON.stringify(data, null, 2), workspaceLogAttributes);
162
169
 
163
170
  const responses: Array<WorkspaceSendMessageResponse> = [];
164
171
 
@@ -214,9 +221,12 @@ export default class WorkspaceUtil {
214
221
  responses.push(result);
215
222
  }
216
223
 
217
- logger.debug("Message posted to workspace channels successfully");
218
- logger.debug("Returning thread IDs");
219
- logger.debug(JSON.stringify(responses, null, 2));
224
+ logger.debug(
225
+ "Message posted to workspace channels successfully",
226
+ workspaceLogAttributes,
227
+ );
228
+ logger.debug("Returning thread IDs", workspaceLogAttributes);
229
+ logger.debug(JSON.stringify(responses, null, 2), workspaceLogAttributes);
220
230
 
221
231
  return responses;
222
232
  }
@@ -229,8 +239,15 @@ export default class WorkspaceUtil {
229
239
  workspaceMessagePayload: WorkspaceMessagePayload;
230
240
  projectId: ObjectID;
231
241
  }): Promise<WorkspaceSendMessageResponse> {
232
- logger.debug("postToWorkspaceChannels called with data:");
233
- logger.debug(data);
242
+ const postLogAttributes: LogAttributes = {
243
+ projectId: data.projectId?.toString(),
244
+ };
245
+
246
+ logger.debug(
247
+ "postToWorkspaceChannels called with data:",
248
+ postLogAttributes,
249
+ );
250
+ logger.debug(data, postLogAttributes);
234
251
 
235
252
  const result: WorkspaceSendMessageResponse =
236
253
  await WorkspaceUtil.getWorkspaceTypeUtil(data.workspaceType).sendMessage({
@@ -240,9 +257,12 @@ export default class WorkspaceUtil {
240
257
  projectId: data.projectId,
241
258
  });
242
259
 
243
- logger.debug("Message posted to workspace channels successfully");
244
- logger.debug("Returning thread IDs");
245
- logger.debug(result);
260
+ logger.debug(
261
+ "Message posted to workspace channels successfully",
262
+ postLogAttributes,
263
+ );
264
+ logger.debug("Returning thread IDs", postLogAttributes);
265
+ logger.debug(result, postLogAttributes);
246
266
 
247
267
  return result;
248
268
  }
@@ -283,6 +303,7 @@ export default class WorkspaceUtil {
283
303
  if (!params.teamId) {
284
304
  logger.error(
285
305
  "Team ID is required for Microsoft Teams channel messages",
306
+ { projectId: params.projectId?.toString() },
286
307
  );
287
308
  return [];
288
309
  }
@@ -312,6 +333,7 @@ export default class WorkspaceUtil {
312
333
  default:
313
334
  logger.debug(
314
335
  `Unsupported workspace type for channel messages: ${params.workspaceType}`,
336
+ { projectId: params.projectId?.toString() },
315
337
  );
316
338
  return [];
317
339
  }
@@ -343,7 +343,9 @@ export default class WorkspaceBase {
343
343
  );
344
344
  break;
345
345
  default:
346
- logger.error("Unknown block type: " + block._type);
346
+ logger.error("Unknown block type: " + block._type, {
347
+ blockType: block._type,
348
+ });
347
349
  break;
348
350
  }
349
351
  }
@@ -35,8 +35,14 @@ export default class AlertWorkspaceMessages {
35
35
  );
36
36
  } catch (err) {
37
37
  // log the error and continue.
38
- logger.error("Error in createChannelsAndInviteUsersToChannels");
39
- logger.error(err);
38
+ logger.error("Error in createChannelsAndInviteUsersToChannels", {
39
+ projectId: data.projectId?.toString(),
40
+ alertId: data.alertId?.toString(),
41
+ });
42
+ logger.error(err, {
43
+ projectId: data.projectId?.toString(),
44
+ alertId: data.alertId?.toString(),
45
+ });
40
46
  return null;
41
47
  }
42
48
  }
@@ -123,7 +123,7 @@ describe("UserMiddleware", () => {
123
123
 
124
124
  expect(result).toEqual({});
125
125
  expect(spyDecode).toHaveBeenCalledWith(mockedAccessToken);
126
- expect(spyErrorLogger).toHaveBeenCalledWith(error);
126
+ expect(spyErrorLogger).toHaveBeenCalledWith(error, undefined);
127
127
  });
128
128
 
129
129
  test("should return an empty object when the decoded sso-token object doesn't have projectId property", () => {
@@ -96,8 +96,11 @@ describe("AnalyticsDatabaseService", () => {
96
96
  expect(logger.debug).toHaveBeenNthCalledWith(
97
97
  1,
98
98
  "<table-name> Count Statement",
99
+ { tableName: "<table-name>" },
99
100
  );
100
- expect(logger.debug).toHaveBeenNthCalledWith(2, statement);
101
+ expect(logger.debug).toHaveBeenNthCalledWith(2, statement, {
102
+ tableName: "<table-name>",
103
+ });
101
104
 
102
105
  expect(statement.query).toBe(
103
106
  "SELECT\n" +
@@ -201,8 +204,11 @@ describe("AnalyticsDatabaseService", () => {
201
204
  expect(jest.mocked(logger.debug)).toHaveBeenNthCalledWith(
202
205
  1,
203
206
  "<table-name> Find Statement",
207
+ { tableName: "<table-name>" },
204
208
  );
205
- expect(jest.mocked(logger.debug)).toHaveBeenNthCalledWith(2, statement);
209
+ expect(jest.mocked(logger.debug)).toHaveBeenNthCalledWith(2, statement, {
210
+ tableName: "<table-name>",
211
+ });
206
212
 
207
213
  expect(statement.query).toBe(
208
214
  "SELECT <select-statement> FROM {p0:Identifier}.{p1:Identifier} WHERE TRUE <where-statement> ORDER BY <sort-statement> LIMIT {p2:Int32} OFFSET {p3:Int32}",
@@ -340,8 +346,11 @@ describe("AnalyticsDatabaseService", () => {
340
346
  expect(logger.debug).toHaveBeenNthCalledWith(
341
347
  1,
342
348
  "<table-name> Delete Statement",
349
+ { tableName: "<table-name>" },
343
350
  );
344
- expect(logger.debug).toHaveBeenNthCalledWith(2, statement);
351
+ expect(logger.debug).toHaveBeenNthCalledWith(2, statement, {
352
+ tableName: "<table-name>",
353
+ });
345
354
 
346
355
  expect(statement.query).toBe(
347
356
  "ALTER TABLE {p0:Identifier}.{p1:Identifier}\n" +
@@ -1,12 +1,20 @@
1
1
  import { AreaChart } from "../ChartLibrary/AreaChart/AreaChart";
2
- import React, { FunctionComponent, ReactElement, useEffect } from "react";
2
+ import React, {
3
+ FunctionComponent,
4
+ ReactElement,
5
+ useEffect,
6
+ useMemo,
7
+ } from "react";
3
8
  import SeriesPoint from "../Types/SeriesPoints";
4
9
  import { XAxis } from "../Types/XAxis/XAxis";
5
10
  import YAxis from "../Types/YAxis/YAxis";
6
11
  import ChartCurve from "../Types/ChartCurve";
7
12
  import ChartDataPoint from "../ChartLibrary/Types/ChartDataPoint";
13
+ import FormattedExemplarPoint from "../ChartLibrary/Types/FormattedExemplarPoint";
8
14
  import DataPointUtil from "../Utils/DataPoint";
9
15
  import ChartReferenceLineProps from "../Types/ReferenceLineProps";
16
+ import ExemplarPoint from "../Types/ExemplarPoint";
17
+ import XAxisUtil from "../Utils/XAxis";
10
18
  import NoDataMessage from "../ChartGroup/NoDataMessage";
11
19
 
12
20
  export interface ComponentProps {
@@ -17,6 +25,8 @@ export interface ComponentProps {
17
25
  sync: boolean;
18
26
  heightInPx?: number | undefined;
19
27
  referenceLines?: Array<ChartReferenceLineProps> | undefined;
28
+ exemplarPoints?: Array<ExemplarPoint> | undefined;
29
+ onExemplarClick?: ((exemplar: ExemplarPoint) => void) | undefined;
20
30
  }
21
31
 
22
32
  export interface AreaInternalProps extends ComponentProps {
@@ -42,6 +52,26 @@ const AreaChartElement: FunctionComponent<AreaInternalProps> = (
42
52
  setRecords(records);
43
53
  }, [props.data]);
44
54
 
55
+ // Format exemplar x values to match the chart's x-axis labels
56
+ const formattedExemplars: Array<FormattedExemplarPoint> = useMemo(() => {
57
+ if (!props.exemplarPoints || props.exemplarPoints.length === 0) {
58
+ return [];
59
+ }
60
+
61
+ const formatter: (value: Date) => string = XAxisUtil.getFormatter({
62
+ xAxisMax: props.xAxis.options.max,
63
+ xAxisMin: props.xAxis.options.min,
64
+ });
65
+
66
+ return props.exemplarPoints.map((exemplar: ExemplarPoint) => {
67
+ return {
68
+ formattedX: formatter(exemplar.x),
69
+ y: exemplar.y,
70
+ original: exemplar,
71
+ };
72
+ });
73
+ }, [props.exemplarPoints, props.xAxis]);
74
+
45
75
  const className: string = props.heightInPx ? `` : "h-80";
46
76
  const style: React.CSSProperties = props.heightInPx
47
77
  ? { height: `${props.heightInPx}px` }
@@ -83,6 +113,10 @@ const AreaChartElement: FunctionComponent<AreaInternalProps> = (
83
113
  yAxisWidth={60}
84
114
  onValueChange={() => {}}
85
115
  referenceLines={props.referenceLines}
116
+ formattedExemplarPoints={
117
+ formattedExemplars.length > 0 ? formattedExemplars : undefined
118
+ }
119
+ onExemplarClick={props.onExemplarClick}
86
120
  />
87
121
  {hasNoData && <NoDataMessage />}
88
122
  </div>
@@ -7,6 +7,7 @@ import BarChartElement, {
7
7
  import AreaChartElement, {
8
8
  ComponentProps as AreaChartProps,
9
9
  } from "../Area/AreaChart";
10
+ import ExemplarPoint from "../Types/ExemplarPoint";
10
11
  import Icon, { SizeProp } from "../../Icon/Icon";
11
12
  import IconProp from "../../../../Types/Icon/IconProp";
12
13
  import Modal, { ModalWidth } from "../../Modal/Modal";
@@ -33,6 +34,8 @@ export interface Chart {
33
34
  type: ChartType;
34
35
  props: LineChartProps | BarChartProps | AreaChartProps;
35
36
  metricInfo?: ChartMetricInfo | undefined;
37
+ exemplarPoints?: Array<ExemplarPoint> | undefined;
38
+ onExemplarClick?: ((exemplar: ExemplarPoint) => void) | undefined;
36
39
  }
37
40
 
38
41
  export interface ComponentProps {
@@ -67,6 +70,8 @@ const ChartGroup: FunctionComponent<ComponentProps> = (
67
70
  {...(chart.props as LineChartProps)}
68
71
  syncid={syncId}
69
72
  heightInPx={props.heightInPx}
73
+ exemplarPoints={chart.exemplarPoints}
74
+ onExemplarClick={chart.onExemplarClick}
70
75
  />
71
76
  );
72
77
  case ChartType.BAR:
@@ -85,6 +90,8 @@ const ChartGroup: FunctionComponent<ComponentProps> = (
85
90
  {...(chart.props as AreaChartProps)}
86
91
  syncid={syncId}
87
92
  heightInPx={props.heightInPx}
93
+ exemplarPoints={chart.exemplarPoints}
94
+ onExemplarClick={chart.onExemplarClick}
88
95
  />
89
96
  );
90
97
  default:
@@ -11,6 +11,7 @@ import {
11
11
  Dot,
12
12
  Label,
13
13
  Legend as RechartsLegend,
14
+ ReferenceDot,
14
15
  ReferenceLine,
15
16
  ResponsiveContainer,
16
17
  Tooltip,
@@ -18,6 +19,8 @@ import {
18
19
  YAxis,
19
20
  } from "recharts";
20
21
  import ChartReferenceLineProps from "../../Types/ReferenceLineProps";
22
+ import ExemplarPoint from "../../Types/ExemplarPoint";
23
+ import FormattedExemplarPoint from "../Types/FormattedExemplarPoint";
21
24
  import { AxisDomain } from "recharts/types/util/types";
22
25
 
23
26
  import { useOnWindowResize } from "../Utils/UseWindowOnResize";
@@ -557,6 +560,8 @@ interface AreaChartProps extends React.HTMLAttributes<HTMLDivElement> {
557
560
  customTooltip?: React.ComponentType<TooltipProps>;
558
561
  syncid?: string | undefined;
559
562
  referenceLines?: Array<ChartReferenceLineProps> | undefined;
563
+ formattedExemplarPoints?: Array<FormattedExemplarPoint> | undefined;
564
+ onExemplarClick?: ((exemplar: ExemplarPoint) => void) | undefined;
560
565
  }
561
566
 
562
567
  const AreaChart: React.ForwardRefExoticComponent<
@@ -1000,6 +1005,34 @@ const AreaChart: React.ForwardRefExoticComponent<
1000
1005
  );
1001
1006
  },
1002
1007
  )}
1008
+ {/* Exemplar dots - clickable markers linking to traces */}
1009
+ {props.formattedExemplarPoints?.map(
1010
+ (exemplar: FormattedExemplarPoint, exemplarIndex: number) => {
1011
+ return (
1012
+ <ReferenceDot
1013
+ key={`exemplar-${exemplarIndex}`}
1014
+ x={exemplar.formattedX}
1015
+ y={exemplar.y}
1016
+ r={5}
1017
+ fill="#7c3aed"
1018
+ stroke="#ffffff"
1019
+ strokeWidth={2}
1020
+ style={{ cursor: "pointer" }}
1021
+ onClick={() => {
1022
+ props.onExemplarClick?.(exemplar.original);
1023
+ }}
1024
+ >
1025
+ <Label
1026
+ value="E"
1027
+ position="center"
1028
+ fill="#ffffff"
1029
+ fontSize={8}
1030
+ fontWeight={700}
1031
+ />
1032
+ </ReferenceDot>
1033
+ );
1034
+ },
1035
+ )}
1003
1036
  </RechartsAreaChart>
1004
1037
  </ResponsiveContainer>
1005
1038
  </div>
@@ -12,6 +12,7 @@ import {
12
12
  Line,
13
13
  Legend as RechartsLegend,
14
14
  LineChart as RechartsLineChart,
15
+ ReferenceDot,
15
16
  ReferenceLine,
16
17
  ResponsiveContainer,
17
18
  Tooltip,
@@ -19,6 +20,8 @@ import {
19
20
  YAxis,
20
21
  } from "recharts";
21
22
  import ChartReferenceLineProps from "../../Types/ReferenceLineProps";
23
+ import ExemplarPoint from "../../Types/ExemplarPoint";
24
+ import FormattedExemplarPoint from "../Types/FormattedExemplarPoint";
22
25
  import { AxisDomain } from "recharts/types/util/types";
23
26
 
24
27
  import { useOnWindowResize } from "../Utils/UseWindowOnResize";
@@ -574,6 +577,8 @@ interface LineChartProps extends React.HTMLAttributes<HTMLDivElement> {
574
577
  customTooltip?: React.ComponentType<TooltipProps>;
575
578
  syncid?: string | undefined;
576
579
  referenceLines?: Array<ChartReferenceLineProps> | undefined;
580
+ formattedExemplarPoints?: Array<FormattedExemplarPoint> | undefined;
581
+ onExemplarClick?: ((exemplar: ExemplarPoint) => void) | undefined;
577
582
  }
578
583
 
579
584
  const LineChart: React.ForwardRefExoticComponent<
@@ -1018,6 +1023,34 @@ const LineChart: React.ForwardRefExoticComponent<
1018
1023
  );
1019
1024
  },
1020
1025
  )}
1026
+ {/* Exemplar dots - clickable markers linking to traces */}
1027
+ {props.formattedExemplarPoints?.map(
1028
+ (exemplar: FormattedExemplarPoint, exemplarIndex: number) => {
1029
+ return (
1030
+ <ReferenceDot
1031
+ key={`exemplar-${exemplarIndex}`}
1032
+ x={exemplar.formattedX}
1033
+ y={exemplar.y}
1034
+ r={5}
1035
+ fill="#7c3aed"
1036
+ stroke="#ffffff"
1037
+ strokeWidth={2}
1038
+ style={{ cursor: "pointer" }}
1039
+ onClick={() => {
1040
+ props.onExemplarClick?.(exemplar.original);
1041
+ }}
1042
+ >
1043
+ <Label
1044
+ value="E"
1045
+ position="center"
1046
+ fill="#ffffff"
1047
+ fontSize={8}
1048
+ fontWeight={700}
1049
+ />
1050
+ </ReferenceDot>
1051
+ );
1052
+ },
1053
+ )}
1021
1054
  </RechartsLineChart>
1022
1055
  </ResponsiveContainer>
1023
1056
  </div>
@@ -0,0 +1,14 @@
1
+ import ExemplarPoint from "../../Types/ExemplarPoint";
2
+
3
+ /**
4
+ * An exemplar point with a formatted x-axis label that matches the chart's
5
+ * x-axis formatting. Used internally by chart library components.
6
+ */
7
+ export default interface FormattedExemplarPoint {
8
+ /** The formatted x-axis label (e.g. "12:30", "Feb 22") */
9
+ formattedX: string;
10
+ /** The y value */
11
+ y: number;
12
+ /** The original exemplar data for click handling */
13
+ original: ExemplarPoint;
14
+ }
@@ -1,12 +1,20 @@
1
1
  import { LineChart } from "../ChartLibrary/LineChart/LineChart";
2
- import React, { FunctionComponent, ReactElement, useEffect } from "react";
2
+ import React, {
3
+ FunctionComponent,
4
+ ReactElement,
5
+ useEffect,
6
+ useMemo,
7
+ } from "react";
3
8
  import SeriesPoint from "../Types/SeriesPoints";
4
9
  import { XAxis } from "../Types/XAxis/XAxis";
5
10
  import YAxis from "../Types/YAxis/YAxis";
6
11
  import ChartCurve from "../Types/ChartCurve";
7
12
  import ChartDataPoint from "../ChartLibrary/Types/ChartDataPoint";
13
+ import FormattedExemplarPoint from "../ChartLibrary/Types/FormattedExemplarPoint";
8
14
  import DataPointUtil from "../Utils/DataPoint";
9
15
  import ChartReferenceLineProps from "../Types/ReferenceLineProps";
16
+ import ExemplarPoint from "../Types/ExemplarPoint";
17
+ import XAxisUtil from "../Utils/XAxis";
10
18
  import NoDataMessage from "../ChartGroup/NoDataMessage";
11
19
 
12
20
  export interface ComponentProps {
@@ -17,6 +25,8 @@ export interface ComponentProps {
17
25
  sync: boolean;
18
26
  heightInPx?: number | undefined;
19
27
  referenceLines?: Array<ChartReferenceLineProps> | undefined;
28
+ exemplarPoints?: Array<ExemplarPoint> | undefined;
29
+ onExemplarClick?: ((exemplar: ExemplarPoint) => void) | undefined;
20
30
  }
21
31
 
22
32
  export interface LineInternalProps extends ComponentProps {
@@ -42,6 +52,26 @@ const LineChartElement: FunctionComponent<LineInternalProps> = (
42
52
  setRecords(records);
43
53
  }, [props.data]);
44
54
 
55
+ // Format exemplar x values to match the chart's x-axis labels
56
+ const formattedExemplars: Array<FormattedExemplarPoint> = useMemo(() => {
57
+ if (!props.exemplarPoints || props.exemplarPoints.length === 0) {
58
+ return [];
59
+ }
60
+
61
+ const formatter: (value: Date) => string = XAxisUtil.getFormatter({
62
+ xAxisMax: props.xAxis.options.max,
63
+ xAxisMin: props.xAxis.options.min,
64
+ });
65
+
66
+ return props.exemplarPoints.map((exemplar: ExemplarPoint) => {
67
+ return {
68
+ formattedX: formatter(exemplar.x),
69
+ y: exemplar.y,
70
+ original: exemplar,
71
+ };
72
+ });
73
+ }, [props.exemplarPoints, props.xAxis]);
74
+
45
75
  const className: string = props.heightInPx ? `` : "h-80";
46
76
  const style: React.CSSProperties = props.heightInPx
47
77
  ? { height: `${props.heightInPx}px` }
@@ -82,6 +112,10 @@ const LineChartElement: FunctionComponent<LineInternalProps> = (
82
112
  yAxisWidth={60}
83
113
  onValueChange={() => {}}
84
114
  referenceLines={props.referenceLines}
115
+ formattedExemplarPoints={
116
+ formattedExemplars.length > 0 ? formattedExemplars : undefined
117
+ }
118
+ onExemplarClick={props.onExemplarClick}
85
119
  />
86
120
  {hasNoData && <NoDataMessage />}
87
121
  </div>
@@ -0,0 +1,6 @@
1
+ export default interface ExemplarPoint {
2
+ x: Date;
3
+ y: number;
4
+ traceId: string;
5
+ spanId?: string | undefined;
6
+ }
@@ -327,7 +327,7 @@ const MarkdownViewer: FunctionComponent<ComponentProps> = (
327
327
  p: ({ ...props }: any) => {
328
328
  return (
329
329
  <p
330
- className="text-sm mt-2 mb-3 text-gray-700 leading-relaxed"
330
+ className="text-sm mt-2 mb-1 text-gray-700 leading-relaxed"
331
331
  {...props}
332
332
  />
333
333
  );
@@ -391,10 +391,10 @@ const MarkdownViewer: FunctionComponent<ComponentProps> = (
391
391
  );
392
392
  },
393
393
  ul: ({ ...props }: any) => {
394
- return <ul className="list-disc pl-6 mt-1 mb-3" {...props} />;
394
+ return <ul className="list-disc pl-6 mt-0 mb-1" {...props} />;
395
395
  },
396
396
  ol: ({ ...props }: any) => {
397
- return <ol className="list-decimal pl-6 mt-1 mb-3" {...props} />;
397
+ return <ol className="list-decimal pl-6 mt-0 mb-1" {...props} />;
398
398
  },
399
399
  blockquote: ({ children, ...props }: any) => {
400
400
  return (
@@ -3,6 +3,7 @@ import React, {
3
3
  ReactElement,
4
4
  useState,
5
5
  useEffect,
6
+ useRef,
6
7
  } from "react";
7
8
  import Route from "../../../Types/API/Route";
8
9
  import URL from "../../../Types/API/URL";
@@ -60,6 +61,8 @@ const Navbar: FunctionComponent<ComponentProps> = (
60
61
  const [moreMenuTimeout, setMoreMenuTimeout] = useState<ReturnType<
61
62
  typeof setTimeout
62
63
  > | null>(null);
64
+ const suppressShowRef: React.MutableRefObject<boolean> =
65
+ useRef<boolean>(false);
63
66
 
64
67
  // Use the existing outside click hook for mobile menu
65
68
  const {
@@ -108,9 +111,16 @@ const Navbar: FunctionComponent<ComponentProps> = (
108
111
  }
109
112
 
110
113
  setIsMoreMenuVisible(false);
114
+ suppressShowRef.current = true;
115
+ setTimeout(() => {
116
+ suppressShowRef.current = false;
117
+ }, 300);
111
118
  };
112
119
 
113
120
  const showMoreMenu: () => void = (): void => {
121
+ if (suppressShowRef.current) {
122
+ return;
123
+ }
114
124
  if (moreMenuTimeout) {
115
125
  clearTimeout(moreMenuTimeout);
116
126
  }
@@ -494,6 +494,62 @@ export default class Metric extends AnalyticsBaseModel {
494
494
  update: [],
495
495
  },
496
496
  });
497
+ const traceIdColumn = new AnalyticsTableColumn({
498
+ key: "traceId",
499
+ title: "Trace ID",
500
+ description: "Trace ID from an exemplar associated with this metric data point",
501
+ required: false,
502
+ type: TableColumnType.Text,
503
+ skipIndex: {
504
+ name: "idx_trace_id",
505
+ type: SkipIndexType.BloomFilter,
506
+ params: [0.01],
507
+ granularity: 1,
508
+ },
509
+ accessControl: {
510
+ read: [
511
+ Permission.ProjectOwner,
512
+ Permission.ProjectAdmin,
513
+ Permission.ProjectMember,
514
+ Permission.ReadTelemetryServiceLog,
515
+ ],
516
+ create: [
517
+ Permission.ProjectOwner,
518
+ Permission.ProjectAdmin,
519
+ Permission.ProjectMember,
520
+ Permission.CreateTelemetryServiceLog,
521
+ ],
522
+ update: [],
523
+ },
524
+ });
525
+ const spanIdColumn = new AnalyticsTableColumn({
526
+ key: "spanId",
527
+ title: "Span ID",
528
+ description: "Span ID from an exemplar associated with this metric data point",
529
+ required: false,
530
+ type: TableColumnType.Text,
531
+ skipIndex: {
532
+ name: "idx_span_id",
533
+ type: SkipIndexType.BloomFilter,
534
+ params: [0.01],
535
+ granularity: 1,
536
+ },
537
+ accessControl: {
538
+ read: [
539
+ Permission.ProjectOwner,
540
+ Permission.ProjectAdmin,
541
+ Permission.ProjectMember,
542
+ Permission.ReadTelemetryServiceLog,
543
+ ],
544
+ create: [
545
+ Permission.ProjectOwner,
546
+ Permission.ProjectAdmin,
547
+ Permission.ProjectMember,
548
+ Permission.CreateTelemetryServiceLog,
549
+ ],
550
+ update: [],
551
+ },
552
+ });
497
553
  const retentionDateColumn = new AnalyticsTableColumn({
498
554
  key: "retentionDate",
499
555
  title: "Retention Date",
@@ -555,6 +611,8 @@ export default class Metric extends AnalyticsBaseModel {
555
611
  maxColumn,
556
612
  bucketCountsColumn,
557
613
  explicitBoundsColumn,
614
+ traceIdColumn,
615
+ spanIdColumn,
558
616
  retentionDateColumn,
559
617
  ],
560
618
  projections: [],
@@ -684,6 +742,18 @@ export default class Metric extends AnalyticsBaseModel {
684
742
  set explicitBounds(v) {
685
743
  this.setColumnValue("explicitBounds", v);
686
744
  }
745
+ get traceId() {
746
+ return this.getColumnValue("traceId");
747
+ }
748
+ set traceId(v) {
749
+ this.setColumnValue("traceId", v);
750
+ }
751
+ get spanId() {
752
+ return this.getColumnValue("spanId");
753
+ }
754
+ set spanId(v) {
755
+ this.setColumnValue("spanId", v);
756
+ }
687
757
  get retentionDate() {
688
758
  return this.getColumnValue("retentionDate");
689
759
  }