@oneuptime/common 10.0.52 → 10.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. package/Models/AnalyticsModels/Metric.ts +78 -0
  2. package/Server/API/AIAgentDataAPI.ts +6 -1
  3. package/Server/API/BillingAPI.ts +28 -6
  4. package/Server/API/CommonAPI.ts +11 -0
  5. package/Server/API/DashboardAPI.ts +6 -2
  6. package/Server/API/DashboardDomainAPI.ts +10 -3
  7. package/Server/API/GitHubAPI.ts +58 -14
  8. package/Server/API/MicrosoftTeamsAPI.ts +97 -33
  9. package/Server/API/OpenSourceDeploymentAPI.ts +2 -2
  10. package/Server/API/SlackAPI.ts +107 -36
  11. package/Server/API/StatusAPI.ts +37 -16
  12. package/Server/API/StatusPageAPI.ts +97 -23
  13. package/Server/API/StatusPageDomainAPI.ts +6 -3
  14. package/Server/API/TelemetryAPI.ts +81 -0
  15. package/Server/API/UserAPI.ts +3 -3
  16. package/Server/API/UserCallAPI.ts +5 -2
  17. package/Server/API/UserEmailAPI.ts +5 -2
  18. package/Server/API/UserPushAPI.ts +9 -3
  19. package/Server/API/UserSmsAPI.ts +5 -2
  20. package/Server/API/UserWhatsAppAPI.ts +5 -2
  21. package/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.ts +47 -0
  22. package/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.ts +35 -0
  23. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
  24. package/Server/Middleware/NotificationMiddleware.ts +2 -2
  25. package/Server/Middleware/ProjectAuthorization.ts +6 -0
  26. package/Server/Middleware/SCIMAuthorization.ts +2 -1
  27. package/Server/Middleware/SlackAuthorization.ts +28 -10
  28. package/Server/Middleware/TelemetryIngest.ts +16 -3
  29. package/Server/Middleware/UserAuthorization.ts +22 -5
  30. package/Server/Middleware/WhatsAppAuthorization.ts +15 -4
  31. package/Server/Services/AIAgentService.ts +13 -6
  32. package/Server/Services/AIService.ts +9 -3
  33. package/Server/Services/AlertEpisodeFeedService.ts +17 -5
  34. package/Server/Services/AlertEpisodeService.ts +34 -3
  35. package/Server/Services/AlertEpisodeStateTimelineService.ts +80 -22
  36. package/Server/Services/AlertFeedService.ts +17 -5
  37. package/Server/Services/AlertGroupingEngineService.ts +36 -7
  38. package/Server/Services/AlertService.ts +60 -8
  39. package/Server/Services/AlertStateTimelineService.ts +29 -7
  40. package/Server/Services/AnalyticsDatabaseService.ts +59 -25
  41. package/Server/Services/BillingInvoiceService.ts +7 -3
  42. package/Server/Services/BillingService.ts +9 -2
  43. package/Server/Services/DashboardDomainService.ts +56 -22
  44. package/Server/Services/DashboardService.ts +11 -4
  45. package/Server/Services/DatabaseService.ts +31 -11
  46. package/Server/Services/IncidentEpisodeFeedService.ts +17 -5
  47. package/Server/Services/IncidentEpisodeService.ts +34 -3
  48. package/Server/Services/IncidentEpisodeStateTimelineService.ts +80 -22
  49. package/Server/Services/IncidentFeedService.ts +33 -9
  50. package/Server/Services/IncidentGroupingEngineService.ts +35 -6
  51. package/Server/Services/IncidentService.ts +103 -9
  52. package/Server/Services/IncidentSlaRuleService.ts +16 -4
  53. package/Server/Services/IncidentSlaService.ts +20 -4
  54. package/Server/Services/IncidentStateTimelineService.ts +120 -31
  55. package/Server/Services/KubernetesClusterService.ts +62 -14
  56. package/Server/Services/LabelService.ts +14 -1
  57. package/Server/Services/MonitorFeedService.ts +33 -9
  58. package/Server/Services/MonitorProbeService.ts +31 -2
  59. package/Server/Services/MonitorService.ts +35 -4
  60. package/Server/Services/MonitorStatusTimelineService.ts +68 -20
  61. package/Server/Services/NotificationService.ts +4 -2
  62. package/Server/Services/OnCallDutyPolicyEscalationRuleService.ts +53 -9
  63. package/Server/Services/OnCallDutyPolicyEscalationRuleUserService.ts +9 -2
  64. package/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts +29 -8
  65. package/Server/Services/OnCallDutyPolicyFeedService.ts +33 -8
  66. package/Server/Services/OnCallDutyPolicyScheduleService.ts +97 -24
  67. package/Server/Services/OnCallDutyPolicyService.ts +2 -1
  68. package/Server/Services/OpenTelemetryIngestService.ts +51 -20
  69. package/Server/Services/ProbeService.ts +16 -7
  70. package/Server/Services/ProjectService.ts +29 -11
  71. package/Server/Services/ScheduledMaintenanceFeedService.ts +17 -4
  72. package/Server/Services/ScheduledMaintenanceService.ts +52 -6
  73. package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +72 -20
  74. package/Server/Services/StatusPageDomainService.ts +59 -23
  75. package/Server/Services/StatusPageService.ts +26 -8
  76. package/Server/Services/StatusPageSubscriberService.ts +382 -111
  77. package/Server/Services/TeamMemberService.ts +9 -3
  78. package/Server/Services/TelemetryAttributeService.ts +117 -4
  79. package/Server/Services/UserNotificationRuleService.ts +9 -3
  80. package/Server/Services/UserService.ts +6 -4
  81. package/Server/Services/UserWhatsAppService.ts +9 -3
  82. package/Server/Services/WorkflowService.ts +7 -3
  83. package/Server/Services/WorkspaceNotificationRuleService.ts +398 -156
  84. package/Server/Types/Domain.ts +15 -5
  85. package/Server/Types/Workflow/Components/API/Post.ts +22 -8
  86. package/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.ts +12 -4
  87. package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +10 -0
  88. package/Server/Utils/CodeRepository/CodeRepository.ts +62 -13
  89. package/Server/Utils/Express.ts +1 -0
  90. package/Server/Utils/Greenlock/Greenlock.ts +75 -20
  91. package/Server/Utils/LLM/LLMService.ts +22 -7
  92. package/Server/Utils/Logger.ts +93 -13
  93. package/Server/Utils/Monitor/MonitorAlert.ts +15 -3
  94. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +15 -5
  95. package/Server/Utils/Monitor/MonitorIncident.ts +17 -3
  96. package/Server/Utils/Monitor/MonitorStatusTimeline.ts +6 -1
  97. package/Server/Utils/Profiling.ts +11 -5
  98. package/Server/Utils/Realtime.ts +90 -31
  99. package/Server/Utils/Response.ts +2 -2
  100. package/Server/Utils/StartServer.ts +43 -9
  101. package/Server/Utils/Telemetry/SpanUtil.ts +90 -0
  102. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.ts +58 -15
  103. package/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.ts +58 -15
  104. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts +19 -3
  105. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts +87 -22
  106. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.ts +12 -3
  107. package/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.ts +25 -7
  108. package/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.ts +55 -8
  109. package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +100 -22
  110. package/Server/Utils/Workspace/Slack/Actions/Alert.ts +35 -9
  111. package/Server/Utils/Workspace/Slack/Actions/AlertEpisode.ts +32 -8
  112. package/Server/Utils/Workspace/Slack/Actions/Auth.ts +3 -1
  113. package/Server/Utils/Workspace/Slack/Actions/Incident.ts +52 -11
  114. package/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.ts +4 -1
  115. package/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.ts +89 -20
  116. package/Server/Utils/Workspace/Slack/Slack.ts +498 -247
  117. package/Server/Utils/Workspace/Workspace.ts +33 -11
  118. package/Server/Utils/Workspace/WorkspaceBase.ts +3 -1
  119. package/Server/Utils/Workspace/WorkspaceMessages/Alert.ts +8 -2
  120. package/Tests/Server/Middleware/UserAuthorization.test.ts +1 -1
  121. package/Tests/Server/Services/AnalyticsDatabaseService.test.ts +12 -3
  122. package/UI/Components/BulkUpdate/BulkUpdateForm.tsx +60 -38
  123. package/UI/Components/Charts/Area/AreaChart.tsx +35 -1
  124. package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +7 -0
  125. package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +33 -0
  126. package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +33 -0
  127. package/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.ts +14 -0
  128. package/UI/Components/Charts/Line/LineChart.tsx +35 -1
  129. package/UI/Components/Charts/Types/ExemplarPoint.ts +6 -0
  130. package/UI/Components/Dictionary/Dictionary.tsx +13 -1
  131. package/UI/Components/Filters/FiltersForm.tsx +2 -0
  132. package/UI/Components/Filters/JSONFilter.tsx +5 -1
  133. package/UI/Components/Filters/Types/Filter.ts +2 -0
  134. package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +3 -3
  135. package/UI/Components/ModelTable/BaseModelTable.tsx +10 -6
  136. package/UI/Components/Navbar/NavBar.tsx +10 -0
  137. package/build/dist/Models/AnalyticsModels/Metric.js +70 -0
  138. package/build/dist/Models/AnalyticsModels/Metric.js.map +1 -1
  139. package/build/dist/Server/API/AIAgentDataAPI.js +6 -6
  140. package/build/dist/Server/API/AIAgentDataAPI.js.map +1 -1
  141. package/build/dist/Server/API/BillingAPI.js +13 -13
  142. package/build/dist/Server/API/BillingAPI.js.map +1 -1
  143. package/build/dist/Server/API/CommonAPI.js +5 -0
  144. package/build/dist/Server/API/CommonAPI.js.map +1 -1
  145. package/build/dist/Server/API/DashboardAPI.js +2 -2
  146. package/build/dist/Server/API/DashboardAPI.js.map +1 -1
  147. package/build/dist/Server/API/DashboardDomainAPI.js +3 -3
  148. package/build/dist/Server/API/DashboardDomainAPI.js.map +1 -1
  149. package/build/dist/Server/API/GitHubAPI.js +19 -19
  150. package/build/dist/Server/API/GitHubAPI.js.map +1 -1
  151. package/build/dist/Server/API/MicrosoftTeamsAPI.js +34 -34
  152. package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
  153. package/build/dist/Server/API/OpenSourceDeploymentAPI.js +2 -2
  154. package/build/dist/Server/API/OpenSourceDeploymentAPI.js.map +1 -1
  155. package/build/dist/Server/API/SlackAPI.js +38 -38
  156. package/build/dist/Server/API/SlackAPI.js.map +1 -1
  157. package/build/dist/Server/API/StatusAPI.js +16 -16
  158. package/build/dist/Server/API/StatusAPI.js.map +1 -1
  159. package/build/dist/Server/API/StatusPageAPI.js +52 -52
  160. package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
  161. package/build/dist/Server/API/StatusPageDomainAPI.js +3 -3
  162. package/build/dist/Server/API/StatusPageDomainAPI.js.map +1 -1
  163. package/build/dist/Server/API/TelemetryAPI.js +39 -0
  164. package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
  165. package/build/dist/Server/API/UserAPI.js +3 -3
  166. package/build/dist/Server/API/UserAPI.js.map +1 -1
  167. package/build/dist/Server/API/UserCallAPI.js +2 -2
  168. package/build/dist/Server/API/UserCallAPI.js.map +1 -1
  169. package/build/dist/Server/API/UserEmailAPI.js +2 -2
  170. package/build/dist/Server/API/UserEmailAPI.js.map +1 -1
  171. package/build/dist/Server/API/UserPushAPI.js +3 -3
  172. package/build/dist/Server/API/UserPushAPI.js.map +1 -1
  173. package/build/dist/Server/API/UserSmsAPI.js +2 -2
  174. package/build/dist/Server/API/UserSmsAPI.js.map +1 -1
  175. package/build/dist/Server/API/UserWhatsAppAPI.js +2 -2
  176. package/build/dist/Server/API/UserWhatsAppAPI.js.map +1 -1
  177. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.js +40 -0
  178. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064921-MigrationName.js.map +1 -0
  179. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.js +18 -0
  180. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1775735059360-MigrationName.js.map +1 -0
  181. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
  182. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  183. package/build/dist/Server/Middleware/NotificationMiddleware.js +2 -2
  184. package/build/dist/Server/Middleware/NotificationMiddleware.js.map +1 -1
  185. package/build/dist/Server/Middleware/ProjectAuthorization.js +5 -0
  186. package/build/dist/Server/Middleware/ProjectAuthorization.js.map +1 -1
  187. package/build/dist/Server/Middleware/SCIMAuthorization.js +2 -2
  188. package/build/dist/Server/Middleware/SCIMAuthorization.js.map +1 -1
  189. package/build/dist/Server/Middleware/SlackAuthorization.js +10 -10
  190. package/build/dist/Server/Middleware/SlackAuthorization.js.map +1 -1
  191. package/build/dist/Server/Middleware/TelemetryIngest.js +9 -4
  192. package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
  193. package/build/dist/Server/Middleware/UserAuthorization.js +10 -5
  194. package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
  195. package/build/dist/Server/Middleware/WhatsAppAuthorization.js +6 -6
  196. package/build/dist/Server/Middleware/WhatsAppAuthorization.js.map +1 -1
  197. package/build/dist/Server/Services/AIAgentService.js +13 -7
  198. package/build/dist/Server/Services/AIAgentService.js.map +1 -1
  199. package/build/dist/Server/Services/AIService.js +9 -2
  200. package/build/dist/Server/Services/AIService.js.map +1 -1
  201. package/build/dist/Server/Services/AlertEpisodeFeedService.js +17 -5
  202. package/build/dist/Server/Services/AlertEpisodeFeedService.js.map +1 -1
  203. package/build/dist/Server/Services/AlertEpisodeService.js +40 -10
  204. package/build/dist/Server/Services/AlertEpisodeService.js.map +1 -1
  205. package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js +81 -24
  206. package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js.map +1 -1
  207. package/build/dist/Server/Services/AlertFeedService.js +17 -5
  208. package/build/dist/Server/Services/AlertFeedService.js.map +1 -1
  209. package/build/dist/Server/Services/AlertGroupingEngineService.js +44 -28
  210. package/build/dist/Server/Services/AlertGroupingEngineService.js.map +1 -1
  211. package/build/dist/Server/Services/AlertService.js +72 -20
  212. package/build/dist/Server/Services/AlertService.js.map +1 -1
  213. package/build/dist/Server/Services/AlertStateTimelineService.js +36 -13
  214. package/build/dist/Server/Services/AlertStateTimelineService.js.map +1 -1
  215. package/build/dist/Server/Services/AnalyticsDatabaseService.js +52 -28
  216. package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
  217. package/build/dist/Server/Services/BillingInvoiceService.js +7 -2
  218. package/build/dist/Server/Services/BillingInvoiceService.js.map +1 -1
  219. package/build/dist/Server/Services/BillingService.js +8 -8
  220. package/build/dist/Server/Services/BillingService.js.map +1 -1
  221. package/build/dist/Server/Services/DashboardDomainService.js +49 -27
  222. package/build/dist/Server/Services/DashboardDomainService.js.map +1 -1
  223. package/build/dist/Server/Services/DashboardService.js +11 -4
  224. package/build/dist/Server/Services/DashboardService.js.map +1 -1
  225. package/build/dist/Server/Services/DatabaseService.js +32 -12
  226. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  227. package/build/dist/Server/Services/IncidentEpisodeFeedService.js +17 -5
  228. package/build/dist/Server/Services/IncidentEpisodeFeedService.js.map +1 -1
  229. package/build/dist/Server/Services/IncidentEpisodeService.js +40 -10
  230. package/build/dist/Server/Services/IncidentEpisodeService.js.map +1 -1
  231. package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js +81 -24
  232. package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js.map +1 -1
  233. package/build/dist/Server/Services/IncidentFeedService.js +34 -10
  234. package/build/dist/Server/Services/IncidentFeedService.js.map +1 -1
  235. package/build/dist/Server/Services/IncidentGroupingEngineService.js +43 -29
  236. package/build/dist/Server/Services/IncidentGroupingEngineService.js.map +1 -1
  237. package/build/dist/Server/Services/IncidentService.js +116 -28
  238. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  239. package/build/dist/Server/Services/IncidentSlaRuleService.js +19 -11
  240. package/build/dist/Server/Services/IncidentSlaRuleService.js.map +1 -1
  241. package/build/dist/Server/Services/IncidentSlaService.js +21 -14
  242. package/build/dist/Server/Services/IncidentSlaService.js.map +1 -1
  243. package/build/dist/Server/Services/IncidentStateTimelineService.js +130 -37
  244. package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
  245. package/build/dist/Server/Services/KubernetesClusterService.js +51 -14
  246. package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
  247. package/build/dist/Server/Services/LabelService.js +10 -1
  248. package/build/dist/Server/Services/LabelService.js.map +1 -1
  249. package/build/dist/Server/Services/MonitorFeedService.js +34 -10
  250. package/build/dist/Server/Services/MonitorFeedService.js.map +1 -1
  251. package/build/dist/Server/Services/MonitorProbeService.js +23 -3
  252. package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
  253. package/build/dist/Server/Services/MonitorService.js +42 -11
  254. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  255. package/build/dist/Server/Services/MonitorStatusTimelineService.js +69 -21
  256. package/build/dist/Server/Services/MonitorStatusTimelineService.js.map +1 -1
  257. package/build/dist/Server/Services/NotificationService.js +4 -3
  258. package/build/dist/Server/Services/NotificationService.js.map +1 -1
  259. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js +49 -12
  260. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js.map +1 -1
  261. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js +9 -3
  262. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js.map +1 -1
  263. package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js +26 -11
  264. package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js.map +1 -1
  265. package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js +34 -10
  266. package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js.map +1 -1
  267. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +94 -37
  268. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
  269. package/build/dist/Server/Services/OnCallDutyPolicyService.js +1 -1
  270. package/build/dist/Server/Services/OnCallDutyPolicyService.js.map +1 -1
  271. package/build/dist/Server/Services/OpenTelemetryIngestService.js +45 -17
  272. package/build/dist/Server/Services/OpenTelemetryIngestService.js.map +1 -1
  273. package/build/dist/Server/Services/ProbeService.js +13 -7
  274. package/build/dist/Server/Services/ProbeService.js.map +1 -1
  275. package/build/dist/Server/Services/ProjectService.js +41 -21
  276. package/build/dist/Server/Services/ProjectService.js.map +1 -1
  277. package/build/dist/Server/Services/ScheduledMaintenanceFeedService.js +17 -5
  278. package/build/dist/Server/Services/ScheduledMaintenanceFeedService.js.map +1 -1
  279. package/build/dist/Server/Services/ScheduledMaintenanceService.js +71 -24
  280. package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
  281. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +72 -24
  282. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
  283. package/build/dist/Server/Services/StatusPageDomainService.js +55 -29
  284. package/build/dist/Server/Services/StatusPageDomainService.js.map +1 -1
  285. package/build/dist/Server/Services/StatusPageService.js +29 -9
  286. package/build/dist/Server/Services/StatusPageService.js.map +1 -1
  287. package/build/dist/Server/Services/StatusPageSubscriberService.js +393 -130
  288. package/build/dist/Server/Services/StatusPageSubscriberService.js.map +1 -1
  289. package/build/dist/Server/Services/TeamMemberService.js +10 -2
  290. package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
  291. package/build/dist/Server/Services/TelemetryAttributeService.js +83 -6
  292. package/build/dist/Server/Services/TelemetryAttributeService.js.map +1 -1
  293. package/build/dist/Server/Services/UserNotificationRuleService.js +10 -2
  294. package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
  295. package/build/dist/Server/Services/UserService.js +8 -3
  296. package/build/dist/Server/Services/UserService.js.map +1 -1
  297. package/build/dist/Server/Services/UserWhatsAppService.js +10 -2
  298. package/build/dist/Server/Services/UserWhatsAppService.js.map +1 -1
  299. package/build/dist/Server/Services/WorkflowService.js +7 -2
  300. package/build/dist/Server/Services/WorkflowService.js.map +1 -1
  301. package/build/dist/Server/Services/WorkspaceNotificationRuleService.js +367 -180
  302. package/build/dist/Server/Services/WorkspaceNotificationRuleService.js.map +1 -1
  303. package/build/dist/Server/Types/Domain.js +12 -6
  304. package/build/dist/Server/Types/Domain.js.map +1 -1
  305. package/build/dist/Server/Types/Workflow/Components/API/Post.js +11 -7
  306. package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
  307. package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js +11 -4
  308. package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js.map +1 -1
  309. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +7 -0
  310. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
  311. package/build/dist/Server/Utils/CodeRepository/CodeRepository.js +45 -17
  312. package/build/dist/Server/Utils/CodeRepository/CodeRepository.js.map +1 -1
  313. package/build/dist/Server/Utils/Express.js.map +1 -1
  314. package/build/dist/Server/Utils/Greenlock/Greenlock.js +36 -29
  315. package/build/dist/Server/Utils/Greenlock/Greenlock.js.map +1 -1
  316. package/build/dist/Server/Utils/LLM/LLMService.js +18 -6
  317. package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
  318. package/build/dist/Server/Utils/Logger.js +61 -13
  319. package/build/dist/Server/Utils/Logger.js.map +1 -1
  320. package/build/dist/Server/Utils/Monitor/MonitorAlert.js +23 -20
  321. package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
  322. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +13 -4
  323. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  324. package/build/dist/Server/Utils/Monitor/MonitorIncident.js +25 -22
  325. package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
  326. package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js +6 -3
  327. package/build/dist/Server/Utils/Monitor/MonitorStatusTimeline.js.map +1 -1
  328. package/build/dist/Server/Utils/Profiling.js +9 -6
  329. package/build/dist/Server/Utils/Profiling.js.map +1 -1
  330. package/build/dist/Server/Utils/Realtime.js +50 -34
  331. package/build/dist/Server/Utils/Realtime.js.map +1 -1
  332. package/build/dist/Server/Utils/Response.js +2 -2
  333. package/build/dist/Server/Utils/Response.js.map +1 -1
  334. package/build/dist/Server/Utils/StartServer.js +23 -11
  335. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  336. package/build/dist/Server/Utils/Telemetry/SpanUtil.js +52 -0
  337. package/build/dist/Server/Utils/Telemetry/SpanUtil.js.map +1 -0
  338. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js +58 -15
  339. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js.map +1 -1
  340. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js +58 -15
  341. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js.map +1 -1
  342. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js +19 -5
  343. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js.map +1 -1
  344. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js +90 -26
  345. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js.map +1 -1
  346. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js +12 -3
  347. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Monitor.js.map +1 -1
  348. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js +25 -7
  349. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/OnCallDutyPolicy.js.map +1 -1
  350. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js +58 -19
  351. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js.map +1 -1
  352. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +102 -29
  353. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
  354. package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js +38 -9
  355. package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js.map +1 -1
  356. package/build/dist/Server/Utils/Workspace/Slack/Actions/AlertEpisode.js +34 -8
  357. package/build/dist/Server/Utils/Workspace/Slack/Actions/AlertEpisode.js.map +1 -1
  358. package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js +3 -1
  359. package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.js.map +1 -1
  360. package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js +55 -13
  361. package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js.map +1 -1
  362. package/build/dist/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.js +5 -1
  363. package/build/dist/Server/Utils/Workspace/Slack/Actions/IncidentEpisode.js.map +1 -1
  364. package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js +91 -26
  365. package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js.map +1 -1
  366. package/build/dist/Server/Utils/Workspace/Slack/Slack.js +355 -270
  367. package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
  368. package/build/dist/Server/Utils/Workspace/Workspace.js +21 -12
  369. package/build/dist/Server/Utils/Workspace/Workspace.js.map +1 -1
  370. package/build/dist/Server/Utils/Workspace/WorkspaceBase.js +3 -1
  371. package/build/dist/Server/Utils/Workspace/WorkspaceBase.js.map +1 -1
  372. package/build/dist/Server/Utils/Workspace/WorkspaceMessages/Alert.js +9 -2
  373. package/build/dist/Server/Utils/Workspace/WorkspaceMessages/Alert.js.map +1 -1
  374. package/build/dist/Tests/Server/Middleware/UserAuthorization.test.js +1 -1
  375. package/build/dist/Tests/Server/Middleware/UserAuthorization.test.js.map +1 -1
  376. package/build/dist/Tests/Server/Services/AnalyticsDatabaseService.test.js +12 -6
  377. package/build/dist/Tests/Server/Services/AnalyticsDatabaseService.test.js.map +1 -1
  378. package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.js +31 -30
  379. package/build/dist/UI/Components/BulkUpdate/BulkUpdateForm.js.map +1 -1
  380. package/build/dist/UI/Components/Charts/Area/AreaChart.js +20 -2
  381. package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
  382. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +2 -2
  383. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
  384. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +9 -2
  385. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
  386. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +9 -2
  387. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
  388. package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.js +2 -0
  389. package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedExemplarPoint.js.map +1 -0
  390. package/build/dist/UI/Components/Charts/Line/LineChart.js +20 -2
  391. package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
  392. package/build/dist/UI/Components/Charts/Types/ExemplarPoint.js +2 -0
  393. package/build/dist/UI/Components/Charts/Types/ExemplarPoint.js.map +1 -0
  394. package/build/dist/UI/Components/Dictionary/Dictionary.js +9 -1
  395. package/build/dist/UI/Components/Dictionary/Dictionary.js.map +1 -1
  396. package/build/dist/UI/Components/Filters/FiltersForm.js +1 -1
  397. package/build/dist/UI/Components/Filters/FiltersForm.js.map +1 -1
  398. package/build/dist/UI/Components/Filters/JSONFilter.js +1 -1
  399. package/build/dist/UI/Components/Filters/JSONFilter.js.map +1 -1
  400. package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +3 -3
  401. package/build/dist/UI/Components/ModelTable/BaseModelTable.js +9 -5
  402. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  403. package/build/dist/UI/Components/Navbar/NavBar.js +9 -1
  404. package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
  405. package/package.json +1 -1
@@ -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" +
@@ -6,7 +6,6 @@ import ConfirmModal, {
6
6
  } from "../Modal/ConfirmModal";
7
7
  import ProgressBar, { ProgressBarSize } from "../ProgressBar/ProgressBar";
8
8
  import ShortcutKey from "../ShortcutKey/ShortcutKey";
9
- import SimpleLogViewer from "../SimpleLogViewer/SimpleLogViewer";
10
9
  import { Green, Red } from "../../../Types/BrandColors";
11
10
  import { LIMIT_PER_PROJECT } from "../../../Types/Database/LimitMax";
12
11
  import GenericObject from "../../../Types/GenericObject";
@@ -83,8 +82,6 @@ const BulkUpdateForm: <T extends GenericObject>(
83
82
  const [actionInProgress, setActionInProgress] =
84
83
  React.useState<boolean>(false);
85
84
 
86
- const [actionName, setActionName] = React.useState<string>("");
87
-
88
85
  if (props.selectedItems.length === 0) {
89
86
  return <></>;
90
87
  }
@@ -102,44 +99,71 @@ const BulkUpdateForm: <T extends GenericObject>(
102
99
  }
103
100
 
104
101
  if (!actionInProgress && progressInfo) {
102
+ const hasFailures: boolean = progressInfo.failed.length > 0;
103
+ const hasSuccesses: boolean = progressInfo.successItems.length > 0;
104
+
105
105
  return (
106
- <div className="mt-1 mb-1 space-y-1">
107
- <div className="flex">
108
- <Icon
109
- className="h-5 w-5"
110
- icon={IconProp.CheckCircle}
111
- color={Green}
112
- />
113
- <div className="ml-1 font-medium">
114
- {progressInfo.successItems.length} {props.pluralLabel} Succeeded
115
- </div>
116
- </div>
117
- {progressInfo.failed.length > 0 && (
118
- <div>
119
- <div className="flex mt-3">
120
- <Icon className="h-5 w-5" icon={IconProp.Close} color={Red} />
121
- <div className="ml-1 font-medium">
122
- {progressInfo.failed.length} {props.pluralLabel} Failed. Here
123
- is more information:
106
+ <div className="space-y-4">
107
+ {/* Summary counts */}
108
+ <div className="flex flex-col space-y-3">
109
+ {hasSuccesses && (
110
+ <div className="flex items-center rounded-lg bg-green-50 p-3">
111
+ <Icon
112
+ className="h-5 w-5 flex-shrink-0"
113
+ icon={IconProp.CheckCircle}
114
+ color={Green}
115
+ />
116
+ <div className="ml-2 text-sm font-medium text-green-800">
117
+ {progressInfo.successItems.length}{" "}
118
+ {progressInfo.successItems.length === 1
119
+ ? props.singularLabel
120
+ : props.pluralLabel}{" "}
121
+ succeeded
124
122
  </div>
125
123
  </div>
126
- <div>
127
- <SimpleLogViewer>
128
- {progressInfo.failed.map(
129
- (failedItem: BulkActionFailed<T>, i: number) => {
130
- return (
131
- <div className="flex mb-2" key={i}>
132
- {actionName}{" "}
133
- {props.itemToString
134
- ? props.itemToString(failedItem.item)
135
- : ""}{" "}
136
- {"Failed: "}
124
+ )}
125
+ {hasFailures && (
126
+ <div className="flex items-center rounded-lg bg-red-50 p-3">
127
+ <Icon
128
+ className="h-5 w-5 flex-shrink-0"
129
+ icon={IconProp.Close}
130
+ color={Red}
131
+ />
132
+ <div className="ml-2 text-sm font-medium text-red-800">
133
+ {progressInfo.failed.length}{" "}
134
+ {progressInfo.failed.length === 1
135
+ ? props.singularLabel
136
+ : props.pluralLabel}{" "}
137
+ failed
138
+ </div>
139
+ </div>
140
+ )}
141
+ </div>
142
+
143
+ {/* Failure details */}
144
+ {hasFailures && (
145
+ <div className="rounded-lg border border-gray-200 overflow-hidden">
146
+ <div className="max-h-64 overflow-y-auto divide-y divide-gray-200">
147
+ {progressInfo.failed.map(
148
+ (failedItem: BulkActionFailed<T>, i: number) => {
149
+ const itemName: string = props.itemToString
150
+ ? props.itemToString(failedItem.item)
151
+ : "";
152
+
153
+ return (
154
+ <div className="px-4 py-3 text-sm" key={i}>
155
+ {itemName && (
156
+ <div className="font-medium text-gray-900">
157
+ {itemName}
158
+ </div>
159
+ )}
160
+ <div className="text-gray-500 mt-0.5">
137
161
  {failedItem.failedMessage}
138
162
  </div>
139
- );
140
- },
141
- )}
142
- </SimpleLogViewer>
163
+ </div>
164
+ );
165
+ },
166
+ )}
143
167
  </div>
144
168
  </div>
145
169
  )}
@@ -217,7 +241,6 @@ const BulkUpdateForm: <T extends GenericObject>(
217
241
  },
218
242
  onBulkActionStart: () => {
219
243
  setShowProgressInfoModal(true);
220
- setActionName(button.title);
221
244
  setProgressInfo({
222
245
  inProgressItems: props.selectedItems,
223
246
  successItems: [],
@@ -231,7 +254,6 @@ const BulkUpdateForm: <T extends GenericObject>(
231
254
  },
232
255
  onBulkActionEnd: () => {
233
256
  setActionInProgress(false);
234
- setActionName("");
235
257
  },
236
258
  };
237
259
 
@@ -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
+ }
@@ -28,6 +28,8 @@ export interface ComponentProps {
28
28
  addButtonSuffix?: string | undefined;
29
29
  valueTypes?: Array<ValueType>; // by default it'll be Text
30
30
  keys?: Array<string> | undefined;
31
+ valueSuggestions?: Record<string, Array<string>> | undefined;
32
+ onKeySelected?: ((key: string) => void) | undefined;
31
33
  }
32
34
 
33
35
  interface Item {
@@ -160,6 +162,11 @@ const DictionaryForm: FunctionComponent<ComponentProps> = (
160
162
  newData[index]!.key = value;
161
163
  setData(newData);
162
164
  onDataChange(newData);
165
+
166
+ // If this key matches one of the known keys, notify parent to fetch values
167
+ if (props.onKeySelected && props.keys?.includes(value)) {
168
+ props.onKeySelected(value);
169
+ }
163
170
  }}
164
171
  />
165
172
  </div>
@@ -212,9 +219,14 @@ const DictionaryForm: FunctionComponent<ComponentProps> = (
212
219
  />
213
220
  </div>
214
221
  {item.type === ValueType.Text && (
215
- <Input
222
+ <AutocompleteTextInput
216
223
  value={item.value.toString()}
217
224
  placeholder={props.valuePlaceholder}
225
+ suggestions={
226
+ item.key && props.valueSuggestions?.[item.key]
227
+ ? props.valueSuggestions[item.key]
228
+ : undefined
229
+ }
218
230
  onChange={(value: string) => {
219
231
  const newData: Array<Item> = [...data];
220
232
  newData[index]!.value = value;
@@ -128,6 +128,8 @@ const FiltersForm: FiltersFormFunction = <T extends GenericObject>(
128
128
  filterData={props.filterData}
129
129
  onFilterChanged={changeFilterData}
130
130
  jsonKeys={filter.jsonKeys}
131
+ jsonValueSuggestions={filter.jsonValueSuggestions}
132
+ onJsonKeySelected={filter.onJsonKeySelected}
131
133
  />
132
134
  </div>
133
135
  );