@oneuptime/common 10.0.39 → 10.0.40

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 (282) hide show
  1. package/Models/AnalyticsModels/Index.ts +4 -0
  2. package/Models/AnalyticsModels/Profile.ts +687 -0
  3. package/Models/AnalyticsModels/ProfileSample.ts +547 -0
  4. package/Models/DatabaseModels/Dashboard.ts +357 -0
  5. package/Models/DatabaseModels/DashboardDomain.ts +658 -0
  6. package/Models/DatabaseModels/Index.ts +2 -0
  7. package/Models/DatabaseModels/StatusPage.ts +41 -0
  8. package/Server/API/DashboardAPI.ts +408 -0
  9. package/Server/API/DashboardDomainAPI.ts +235 -0
  10. package/Server/API/StatusPageAPI.ts +36 -2
  11. package/Server/API/TelemetryAPI.ts +393 -0
  12. package/Server/EnvironmentConfig.ts +12 -0
  13. package/Server/Infrastructure/Postgres/SchemaMigrations/1774524742177-MigrationName.ts +97 -0
  14. package/Server/Infrastructure/Postgres/SchemaMigrations/1774524742178-MigrationName.ts +17 -0
  15. package/Server/Infrastructure/Postgres/SchemaMigrations/1774524742179-MigrationName.ts +50 -0
  16. package/Server/Infrastructure/Postgres/SchemaMigrations/1774559064919-MigrationName.ts +59 -0
  17. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
  18. package/Server/Middleware/UserAuthorization.ts +96 -1
  19. package/Server/Services/DashboardDomainService.ts +647 -0
  20. package/Server/Services/DashboardService.ts +174 -3
  21. package/Server/Services/IncidentService.ts +295 -50
  22. package/Server/Services/IncidentStateTimelineService.ts +1 -0
  23. package/Server/Services/Index.ts +6 -0
  24. package/Server/Services/MonitorService.ts +5 -0
  25. package/Server/Services/ProfileAggregationService.ts +559 -0
  26. package/Server/Services/ProfileSampleService.ts +11 -0
  27. package/Server/Services/ProfileService.ts +11 -0
  28. package/Server/Services/TelemetryUsageBillingService.ts +77 -3
  29. package/Server/Services/WorkspaceNotificationSummaryService.ts +15 -1
  30. package/Server/Types/Billing/MeteredPlan/AllMeteredPlans.ts +9 -0
  31. package/Server/Utils/Cookie.ts +48 -0
  32. package/Server/Utils/Monitor/Criteria/ProfileMonitorCriteria.ts +34 -0
  33. package/Server/Utils/Monitor/DataToProcess.ts +3 -1
  34. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +299 -0
  35. package/Server/Utils/Profile/PprofEncoder.ts +225 -0
  36. package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +53 -16
  37. package/Server/Utils/Workspace/Slack/Slack.ts +26 -6
  38. package/ServiceRoute.ts +2 -0
  39. package/Types/AnalyticsDatabase/AnalyticsTableName.ts +2 -0
  40. package/Types/CookieName.ts +1 -0
  41. package/Types/Dashboard/Chart/ChartType.ts +5 -0
  42. package/Types/Dashboard/DashboardComponentType.ts +4 -0
  43. package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +10 -0
  44. package/Types/Dashboard/DashboardComponents/DashboardChartComponent.ts +1 -2
  45. package/Types/Dashboard/DashboardComponents/DashboardGaugeComponent.ts +17 -0
  46. package/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.ts +15 -0
  47. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.ts +14 -0
  48. package/Types/Dashboard/DashboardComponents/DashboardTextComponent.ts +1 -0
  49. package/Types/Dashboard/DashboardComponents/DashboardTraceListComponent.ts +13 -0
  50. package/Types/Dashboard/DashboardComponents/DashboardValueComponent.ts +2 -0
  51. package/Types/Dashboard/DashboardTemplates.ts +964 -0
  52. package/Types/Dashboard/DashboardVariable.ts +23 -0
  53. package/Types/Dashboard/DashboardViewConfig.ts +59 -0
  54. package/Types/Dashboard/MasterPassword.ts +10 -0
  55. package/Types/Icon/IconProp.ts +1 -0
  56. package/Types/Incident/IncidentMetricType.ts +3 -0
  57. package/Types/MeteredPlan/ProductType.ts +1 -0
  58. package/Types/Metrics/MetricQueryConfigData.ts +3 -0
  59. package/Types/Monitor/CriteriaFilter.ts +3 -0
  60. package/Types/Monitor/KubernetesAlertTemplates.ts +78 -7
  61. package/Types/Monitor/MetricMonitor/MetricMonitorResponse.ts +20 -0
  62. package/Types/Monitor/MonitorStep.ts +25 -0
  63. package/Types/Monitor/MonitorStepProfileMonitor.ts +96 -0
  64. package/Types/Monitor/MonitorType.ts +11 -0
  65. package/Types/Monitor/ProfileMonitor/ProfileMonitorResponse.ts +12 -0
  66. package/Types/Permission.ts +87 -0
  67. package/Types/Telemetry/TelemetryType.ts +1 -0
  68. package/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryItem.ts +1 -0
  69. package/UI/Components/Button/Button.tsx +1 -1
  70. package/UI/Components/Card/Card.tsx +8 -4
  71. package/UI/Components/Charts/Area/AreaChart.tsx +4 -0
  72. package/UI/Components/Charts/Bar/BarChart.tsx +4 -0
  73. package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +26 -0
  74. package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +26 -0
  75. package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +26 -0
  76. package/UI/Components/Charts/Line/LineChart.tsx +4 -0
  77. package/UI/Components/Charts/Types/ReferenceLineProps.ts +6 -0
  78. package/UI/Components/Icon/Icon.tsx +33 -0
  79. package/UI/Components/ModelTable/BaseModelTable.tsx +13 -10
  80. package/UI/Components/MoreMenu/MoreMenu.tsx +15 -2
  81. package/UI/Components/MoreMenu/MoreMenuItem.tsx +4 -4
  82. package/UI/Components/Workflow/Component.tsx +450 -209
  83. package/UI/Components/Workflow/ComponentPortViewer.tsx +57 -20
  84. package/UI/Components/Workflow/ComponentReturnValueViewer.tsx +65 -25
  85. package/UI/Components/Workflow/ComponentSettingsModal.tsx +202 -37
  86. package/UI/Components/Workflow/ComponentsModal.tsx +180 -93
  87. package/UI/Components/Workflow/Workflow.tsx +105 -9
  88. package/UI/Config.ts +9 -0
  89. package/Utils/Dashboard/Components/DashboardChartComponent.ts +53 -22
  90. package/Utils/Dashboard/Components/DashboardGaugeComponent.ts +124 -0
  91. package/Utils/Dashboard/Components/DashboardLogStreamComponent.ts +110 -0
  92. package/Utils/Dashboard/Components/DashboardTableComponent.ts +86 -0
  93. package/Utils/Dashboard/Components/DashboardTextComponent.ts +32 -7
  94. package/Utils/Dashboard/Components/DashboardTraceListComponent.ts +86 -0
  95. package/Utils/Dashboard/Components/DashboardValueComponent.ts +39 -3
  96. package/Utils/Dashboard/Components/Index.ts +28 -0
  97. package/Utils/ValueFormatter.ts +170 -0
  98. package/build/dist/Models/AnalyticsModels/Index.js +4 -0
  99. package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
  100. package/build/dist/Models/AnalyticsModels/Profile.js +621 -0
  101. package/build/dist/Models/AnalyticsModels/Profile.js.map +1 -0
  102. package/build/dist/Models/AnalyticsModels/ProfileSample.js +497 -0
  103. package/build/dist/Models/AnalyticsModels/ProfileSample.js.map +1 -0
  104. package/build/dist/Models/DatabaseModels/Dashboard.js +365 -0
  105. package/build/dist/Models/DatabaseModels/Dashboard.js.map +1 -1
  106. package/build/dist/Models/DatabaseModels/DashboardDomain.js +691 -0
  107. package/build/dist/Models/DatabaseModels/DashboardDomain.js.map +1 -0
  108. package/build/dist/Models/DatabaseModels/Index.js +2 -0
  109. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  110. package/build/dist/Models/DatabaseModels/StatusPage.js +42 -0
  111. package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
  112. package/build/dist/Server/API/DashboardAPI.js +293 -0
  113. package/build/dist/Server/API/DashboardAPI.js.map +1 -0
  114. package/build/dist/Server/API/DashboardDomainAPI.js +124 -0
  115. package/build/dist/Server/API/DashboardDomainAPI.js.map +1 -0
  116. package/build/dist/Server/API/StatusPageAPI.js +26 -2
  117. package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
  118. package/build/dist/Server/API/TelemetryAPI.js +222 -0
  119. package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
  120. package/build/dist/Server/EnvironmentConfig.js +4 -0
  121. package/build/dist/Server/EnvironmentConfig.js.map +1 -1
  122. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742177-MigrationName.js +40 -0
  123. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742177-MigrationName.js.map +1 -0
  124. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742178-MigrationName.js +12 -0
  125. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742178-MigrationName.js.map +1 -0
  126. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742179-MigrationName.js +23 -0
  127. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742179-MigrationName.js.map +1 -0
  128. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064919-MigrationName.js +26 -0
  129. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064919-MigrationName.js.map +1 -0
  130. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
  131. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  132. package/build/dist/Server/Middleware/UserAuthorization.js +41 -0
  133. package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
  134. package/build/dist/Server/Services/DashboardDomainService.js +595 -0
  135. package/build/dist/Server/Services/DashboardDomainService.js.map +1 -0
  136. package/build/dist/Server/Services/DashboardService.js +117 -3
  137. package/build/dist/Server/Services/DashboardService.js.map +1 -1
  138. package/build/dist/Server/Services/IncidentService.js +231 -55
  139. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  140. package/build/dist/Server/Services/IncidentStateTimelineService.js +1 -1
  141. package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
  142. package/build/dist/Server/Services/Index.js +6 -0
  143. package/build/dist/Server/Services/Index.js.map +1 -1
  144. package/build/dist/Server/Services/MonitorService.js +5 -2
  145. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  146. package/build/dist/Server/Services/ProfileAggregationService.js +356 -0
  147. package/build/dist/Server/Services/ProfileAggregationService.js.map +1 -0
  148. package/build/dist/Server/Services/ProfileSampleService.js +9 -0
  149. package/build/dist/Server/Services/ProfileSampleService.js.map +1 -0
  150. package/build/dist/Server/Services/ProfileService.js +9 -0
  151. package/build/dist/Server/Services/ProfileService.js.map +1 -0
  152. package/build/dist/Server/Services/TelemetryUsageBillingService.js +61 -4
  153. package/build/dist/Server/Services/TelemetryUsageBillingService.js.map +1 -1
  154. package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js +13 -1
  155. package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js.map +1 -1
  156. package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js +8 -0
  157. package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js.map +1 -1
  158. package/build/dist/Server/Utils/Cookie.js +36 -0
  159. package/build/dist/Server/Utils/Cookie.js.map +1 -1
  160. package/build/dist/Server/Utils/Monitor/Criteria/ProfileMonitorCriteria.js +34 -0
  161. package/build/dist/Server/Utils/Monitor/Criteria/ProfileMonitorCriteria.js.map +1 -0
  162. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +173 -0
  163. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  164. package/build/dist/Server/Utils/Profile/PprofEncoder.js +129 -0
  165. package/build/dist/Server/Utils/Profile/PprofEncoder.js.map +1 -0
  166. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +36 -14
  167. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
  168. package/build/dist/Server/Utils/Workspace/Slack/Slack.js +23 -6
  169. package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
  170. package/build/dist/ServiceRoute.js +1 -0
  171. package/build/dist/ServiceRoute.js.map +1 -1
  172. package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +2 -0
  173. package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
  174. package/build/dist/Types/CookieName.js +1 -0
  175. package/build/dist/Types/CookieName.js.map +1 -1
  176. package/build/dist/Types/Dashboard/Chart/ChartType.js +5 -0
  177. package/build/dist/Types/Dashboard/Chart/ChartType.js.map +1 -1
  178. package/build/dist/Types/Dashboard/DashboardComponentType.js +4 -0
  179. package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
  180. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +1 -0
  181. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
  182. package/build/dist/Types/Dashboard/DashboardComponents/DashboardGaugeComponent.js +2 -0
  183. package/build/dist/Types/Dashboard/DashboardComponents/DashboardGaugeComponent.js.map +1 -0
  184. package/build/dist/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.js +2 -0
  185. package/build/dist/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.js.map +1 -0
  186. package/build/dist/Types/Dashboard/DashboardComponents/DashboardTableComponent.js +2 -0
  187. package/build/dist/Types/Dashboard/DashboardComponents/DashboardTableComponent.js.map +1 -0
  188. package/build/dist/Types/Dashboard/DashboardComponents/DashboardTraceListComponent.js +2 -0
  189. package/build/dist/Types/Dashboard/DashboardComponents/DashboardTraceListComponent.js.map +1 -0
  190. package/build/dist/Types/Dashboard/DashboardTemplates.js +853 -0
  191. package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -0
  192. package/build/dist/Types/Dashboard/DashboardVariable.js +7 -0
  193. package/build/dist/Types/Dashboard/DashboardVariable.js.map +1 -0
  194. package/build/dist/Types/Dashboard/DashboardViewConfig.js +50 -1
  195. package/build/dist/Types/Dashboard/DashboardViewConfig.js.map +1 -1
  196. package/build/dist/Types/Dashboard/MasterPassword.js +5 -0
  197. package/build/dist/Types/Dashboard/MasterPassword.js.map +1 -0
  198. package/build/dist/Types/Icon/IconProp.js +1 -0
  199. package/build/dist/Types/Icon/IconProp.js.map +1 -1
  200. package/build/dist/Types/Incident/IncidentMetricType.js +3 -0
  201. package/build/dist/Types/Incident/IncidentMetricType.js.map +1 -1
  202. package/build/dist/Types/MeteredPlan/ProductType.js +1 -0
  203. package/build/dist/Types/MeteredPlan/ProductType.js.map +1 -1
  204. package/build/dist/Types/Metrics/MetricQueryConfigData.js +1 -0
  205. package/build/dist/Types/Metrics/MetricQueryConfigData.js.map +1 -1
  206. package/build/dist/Types/Monitor/CriteriaFilter.js +2 -0
  207. package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
  208. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +58 -7
  209. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
  210. package/build/dist/Types/Monitor/MonitorStep.js +15 -0
  211. package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
  212. package/build/dist/Types/Monitor/MonitorStepProfileMonitor.js +59 -0
  213. package/build/dist/Types/Monitor/MonitorStepProfileMonitor.js.map +1 -0
  214. package/build/dist/Types/Monitor/MonitorType.js +10 -0
  215. package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
  216. package/build/dist/Types/Monitor/ProfileMonitor/ProfileMonitorResponse.js +2 -0
  217. package/build/dist/Types/Monitor/ProfileMonitor/ProfileMonitorResponse.js.map +1 -0
  218. package/build/dist/Types/Permission.js +75 -0
  219. package/build/dist/Types/Permission.js.map +1 -1
  220. package/build/dist/Types/Telemetry/TelemetryType.js +1 -0
  221. package/build/dist/Types/Telemetry/TelemetryType.js.map +1 -1
  222. package/build/dist/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryItem.js +1 -0
  223. package/build/dist/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryItem.js.map +1 -1
  224. package/build/dist/UI/Components/Button/Button.js +1 -1
  225. package/build/dist/UI/Components/Button/Button.js.map +1 -1
  226. package/build/dist/UI/Components/Card/Card.js +4 -4
  227. package/build/dist/UI/Components/Card/Card.js.map +1 -1
  228. package/build/dist/UI/Components/Charts/Area/AreaChart.js +1 -1
  229. package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
  230. package/build/dist/UI/Components/Charts/Bar/BarChart.js +1 -1
  231. package/build/dist/UI/Components/Charts/Bar/BarChart.js.map +1 -1
  232. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +5 -2
  233. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
  234. package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +5 -2
  235. package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
  236. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +6 -3
  237. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
  238. package/build/dist/UI/Components/Charts/Line/LineChart.js +1 -1
  239. package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
  240. package/build/dist/UI/Components/Charts/Types/ReferenceLineProps.js +2 -0
  241. package/build/dist/UI/Components/Charts/Types/ReferenceLineProps.js.map +1 -0
  242. package/build/dist/UI/Components/Icon/Icon.js +11 -0
  243. package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
  244. package/build/dist/UI/Components/ModelTable/BaseModelTable.js +12 -9
  245. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  246. package/build/dist/UI/Components/MoreMenu/MoreMenu.js +8 -2
  247. package/build/dist/UI/Components/MoreMenu/MoreMenu.js.map +1 -1
  248. package/build/dist/UI/Components/MoreMenu/MoreMenuItem.js +4 -4
  249. package/build/dist/UI/Components/MoreMenu/MoreMenuItem.js.map +1 -1
  250. package/build/dist/UI/Components/Workflow/Component.js +311 -143
  251. package/build/dist/UI/Components/Workflow/Component.js.map +1 -1
  252. package/build/dist/UI/Components/Workflow/ComponentPortViewer.js +44 -18
  253. package/build/dist/UI/Components/Workflow/ComponentPortViewer.js.map +1 -1
  254. package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js +48 -22
  255. package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js.map +1 -1
  256. package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js +127 -21
  257. package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js.map +1 -1
  258. package/build/dist/UI/Components/Workflow/ComponentsModal.js +107 -52
  259. package/build/dist/UI/Components/Workflow/ComponentsModal.js.map +1 -1
  260. package/build/dist/UI/Components/Workflow/Workflow.js +87 -12
  261. package/build/dist/UI/Components/Workflow/Workflow.js.map +1 -1
  262. package/build/dist/UI/Config.js +3 -1
  263. package/build/dist/UI/Config.js.map +1 -1
  264. package/build/dist/Utils/Dashboard/Components/DashboardChartComponent.js +50 -21
  265. package/build/dist/Utils/Dashboard/Components/DashboardChartComponent.js.map +1 -1
  266. package/build/dist/Utils/Dashboard/Components/DashboardGaugeComponent.js +104 -0
  267. package/build/dist/Utils/Dashboard/Components/DashboardGaugeComponent.js.map +1 -0
  268. package/build/dist/Utils/Dashboard/Components/DashboardLogStreamComponent.js +91 -0
  269. package/build/dist/Utils/Dashboard/Components/DashboardLogStreamComponent.js.map +1 -0
  270. package/build/dist/Utils/Dashboard/Components/DashboardTableComponent.js +70 -0
  271. package/build/dist/Utils/Dashboard/Components/DashboardTableComponent.js.map +1 -0
  272. package/build/dist/Utils/Dashboard/Components/DashboardTextComponent.js +28 -7
  273. package/build/dist/Utils/Dashboard/Components/DashboardTextComponent.js.map +1 -1
  274. package/build/dist/Utils/Dashboard/Components/DashboardTraceListComponent.js +70 -0
  275. package/build/dist/Utils/Dashboard/Components/DashboardTraceListComponent.js.map +1 -0
  276. package/build/dist/Utils/Dashboard/Components/DashboardValueComponent.js +34 -3
  277. package/build/dist/Utils/Dashboard/Components/DashboardValueComponent.js.map +1 -1
  278. package/build/dist/Utils/Dashboard/Components/Index.js +16 -0
  279. package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
  280. package/build/dist/Utils/ValueFormatter.js +132 -0
  281. package/build/dist/Utils/ValueFormatter.js.map +1 -0
  282. package/package.json +1 -1
@@ -0,0 +1,225 @@
1
+ import { JSONObject } from "../../../Types/JSON";
2
+ import zlib from "zlib";
3
+
4
+ /**
5
+ * Encodes profile data into a simplified pprof-compatible JSON format.
6
+ * This produces a gzipped JSON representation that captures the essential
7
+ * profile information (stacktraces, values, metadata) in a format that
8
+ * can be consumed by tools that support pprof JSON.
9
+ *
10
+ * For full protobuf pprof support, a protobuf serializer (e.g., protobufjs
11
+ * with the pprof proto) would be needed. This implementation provides a
12
+ * practical export format.
13
+ */
14
+
15
+ export interface PprofSample {
16
+ stacktrace: Array<string>;
17
+ value: number;
18
+ labels: JSONObject | undefined;
19
+ }
20
+
21
+ export interface PprofProfile {
22
+ profileId: string;
23
+ profileType: string;
24
+ unit: string;
25
+ periodType: string;
26
+ period: number;
27
+ startTimeNanos: number;
28
+ endTimeNanos: number;
29
+ durationNanos: number;
30
+ samples: Array<PprofSample>;
31
+ }
32
+
33
+ export interface PprofFunction {
34
+ id: number;
35
+ name: number; // string table index
36
+ filename: number; // string table index
37
+ }
38
+
39
+ export interface PprofLocation {
40
+ id: number;
41
+ line: Array<{
42
+ functionId: number;
43
+ line: number;
44
+ }>;
45
+ }
46
+
47
+ export interface PprofProto {
48
+ stringTable: Array<string>;
49
+ functions: Array<PprofFunction>;
50
+ locations: Array<PprofLocation>;
51
+ samples: Array<{
52
+ locationId: Array<number>;
53
+ value: Array<number>;
54
+ label: Array<{ key: number; str: number }>;
55
+ }>;
56
+ sampleType: Array<{ type: number; unit: number }>;
57
+ periodType: { type: number; unit: number };
58
+ period: number;
59
+ timeNanos: number;
60
+ durationNanos: number;
61
+ }
62
+
63
+ export default class PprofEncoder {
64
+ /**
65
+ * Build a pprof-like JSON structure from denormalized profile data.
66
+ * The output is a JSON object that mirrors the pprof proto structure,
67
+ * using string table indirection for compact representation.
68
+ */
69
+ public static encode(profile: PprofProfile): PprofProto {
70
+ const stringTable: Array<string> = [""];
71
+ const stringIndex: Map<string, number> = new Map([["", 0]]);
72
+
73
+ const getStringIndex: (s: string) => number = (s: string): number => {
74
+ const existing: number | undefined = stringIndex.get(s);
75
+ if (existing !== undefined) {
76
+ return existing;
77
+ }
78
+ const idx: number = stringTable.length;
79
+ stringTable.push(s);
80
+ stringIndex.set(s, idx);
81
+ return idx;
82
+ };
83
+
84
+ const functions: Array<PprofFunction> = [];
85
+ const functionIndex: Map<string, number> = new Map();
86
+ const locations: Array<PprofLocation> = [];
87
+ const locationIndex: Map<string, number> = new Map();
88
+
89
+ const getOrCreateFunction: (name: string, fileName: string) => number = (
90
+ name: string,
91
+ fileName: string,
92
+ ): number => {
93
+ const key: string = `${name}@${fileName}`;
94
+ const existing: number | undefined = functionIndex.get(key);
95
+ if (existing !== undefined) {
96
+ return existing;
97
+ }
98
+ const id: number = functions.length + 1;
99
+ functions.push({
100
+ id,
101
+ name: getStringIndex(name),
102
+ filename: getStringIndex(fileName),
103
+ });
104
+ functionIndex.set(key, id);
105
+ return id;
106
+ };
107
+
108
+ const getOrCreateLocation: (
109
+ functionName: string,
110
+ fileName: string,
111
+ lineNumber: number,
112
+ ) => number = (
113
+ functionName: string,
114
+ fileName: string,
115
+ lineNumber: number,
116
+ ): number => {
117
+ const key: string = `${functionName}@${fileName}:${lineNumber}`;
118
+ const existing: number | undefined = locationIndex.get(key);
119
+ if (existing !== undefined) {
120
+ return existing;
121
+ }
122
+ const funcId: number = getOrCreateFunction(functionName, fileName);
123
+ const id: number = locations.length + 1;
124
+ locations.push({
125
+ id,
126
+ line: [{ functionId: funcId, line: lineNumber }],
127
+ });
128
+ locationIndex.set(key, id);
129
+ return id;
130
+ };
131
+
132
+ // Build samples
133
+ const pprofSamples: Array<{
134
+ locationId: Array<number>;
135
+ value: Array<number>;
136
+ label: Array<{ key: number; str: number }>;
137
+ }> = [];
138
+
139
+ for (const sample of profile.samples) {
140
+ const locationIds: Array<number> = [];
141
+
142
+ // Parse each frame in the stacktrace
143
+ for (const frame of sample.stacktrace) {
144
+ const atIndex: number = frame.indexOf("@");
145
+ let functionName: string = frame;
146
+ let fileName: string = "";
147
+ let lineNumber: number = 0;
148
+
149
+ if (atIndex !== -1) {
150
+ functionName = frame.substring(0, atIndex);
151
+ const rest: string = frame.substring(atIndex + 1);
152
+ const lastColon: number = rest.lastIndexOf(":");
153
+ if (lastColon !== -1) {
154
+ fileName = rest.substring(0, lastColon);
155
+ lineNumber = parseInt(rest.substring(lastColon + 1), 10) || 0;
156
+ } else {
157
+ fileName = rest;
158
+ }
159
+ }
160
+
161
+ locationIds.push(
162
+ getOrCreateLocation(functionName, fileName, lineNumber),
163
+ );
164
+ }
165
+
166
+ // Build labels
167
+ const labels: Array<{ key: number; str: number }> = [];
168
+ if (sample.labels) {
169
+ for (const [key, value] of Object.entries(sample.labels)) {
170
+ labels.push({
171
+ key: getStringIndex(key),
172
+ str: getStringIndex(String(value)),
173
+ });
174
+ }
175
+ }
176
+
177
+ pprofSamples.push({
178
+ locationId: locationIds,
179
+ value: [sample.value],
180
+ label: labels,
181
+ });
182
+ }
183
+
184
+ // Build sample type
185
+ const typeIdx: number = getStringIndex(profile.profileType);
186
+ const unitIdx: number = getStringIndex(profile.unit || "count");
187
+ const periodTypeIdx: number = getStringIndex(
188
+ profile.periodType || profile.profileType,
189
+ );
190
+
191
+ return {
192
+ stringTable,
193
+ functions,
194
+ locations,
195
+ samples: pprofSamples,
196
+ sampleType: [{ type: typeIdx, unit: unitIdx }],
197
+ periodType: { type: periodTypeIdx, unit: unitIdx },
198
+ period: profile.period,
199
+ timeNanos: profile.startTimeNanos,
200
+ durationNanos: profile.durationNanos,
201
+ };
202
+ }
203
+
204
+ /**
205
+ * Encode and gzip the pprof JSON for download.
206
+ */
207
+ public static async encodeAndCompress(
208
+ profile: PprofProfile,
209
+ ): Promise<Buffer> {
210
+ const pprofData: PprofProto = PprofEncoder.encode(profile);
211
+ const jsonString: string = JSON.stringify(pprofData);
212
+
213
+ return new Promise<Buffer>(
214
+ (resolve: (value: Buffer) => void, reject: (reason: Error) => void) => {
215
+ zlib.gzip(jsonString, (err: Error | null, result: Buffer) => {
216
+ if (err) {
217
+ reject(err);
218
+ } else {
219
+ resolve(result);
220
+ }
221
+ });
222
+ },
223
+ );
224
+ }
225
+ }
@@ -1023,12 +1023,43 @@ export default class MicrosoftTeamsUtil extends WorkspaceBase {
1023
1023
  logger.debug("Sending message to Microsoft Teams with data:");
1024
1024
  logger.debug(data);
1025
1025
 
1026
- const adaptiveCard: JSONObject = this.buildAdaptiveCardFromMessageBlocks({
1027
- messageBlocks: data.workspaceMessagePayload.messageBlocks,
1028
- });
1026
+ /*
1027
+ * Teams adaptive cards have a ~28KB payload limit.
1028
+ * Split message blocks into chunks of 40 to avoid hitting the limit.
1029
+ */
1030
+ const maxBlocksPerCard: number = 40;
1031
+ const allMessageBlocks: Array<WorkspaceMessageBlock> =
1032
+ data.workspaceMessagePayload.messageBlocks;
1029
1033
 
1030
- logger.debug("Adaptive card built successfully:");
1031
- logger.debug(JSON.stringify(adaptiveCard, null, 2));
1034
+ const adaptiveCards: Array<JSONObject> = [];
1035
+
1036
+ if (allMessageBlocks.length <= maxBlocksPerCard) {
1037
+ adaptiveCards.push(
1038
+ this.buildAdaptiveCardFromMessageBlocks({
1039
+ messageBlocks: allMessageBlocks,
1040
+ }),
1041
+ );
1042
+ } else {
1043
+ for (
1044
+ let i: number = 0;
1045
+ i < allMessageBlocks.length;
1046
+ i += maxBlocksPerCard
1047
+ ) {
1048
+ const chunk: Array<WorkspaceMessageBlock> = allMessageBlocks.slice(
1049
+ i,
1050
+ i + maxBlocksPerCard,
1051
+ );
1052
+ adaptiveCards.push(
1053
+ this.buildAdaptiveCardFromMessageBlocks({
1054
+ messageBlocks: chunk,
1055
+ }),
1056
+ );
1057
+ }
1058
+ }
1059
+
1060
+ logger.debug(
1061
+ `Built ${adaptiveCards.length} adaptive card(s) from ${allMessageBlocks.length} message blocks`,
1062
+ );
1032
1063
 
1033
1064
  const workspaceChannelsToPostTo: Array<WorkspaceChannel> = [];
1034
1065
 
@@ -1122,18 +1153,24 @@ export default class MicrosoftTeamsUtil extends WorkspaceBase {
1122
1153
  );
1123
1154
  }
1124
1155
 
1125
- const thread: WorkspaceThread = await this.sendAdaptiveCardToChannel({
1126
- authToken: data.authToken,
1127
- teamId: data.workspaceMessagePayload.teamId!,
1128
- workspaceChannel: channel,
1129
- adaptiveCard: adaptiveCard,
1130
- projectId: data.projectId,
1131
- });
1156
+ // Send each adaptive card chunk to the channel
1157
+ let lastThread: WorkspaceThread | undefined;
1158
+ for (const adaptiveCard of adaptiveCards) {
1159
+ lastThread = await this.sendAdaptiveCardToChannel({
1160
+ authToken: data.authToken,
1161
+ teamId: data.workspaceMessagePayload.teamId!,
1162
+ workspaceChannel: channel,
1163
+ adaptiveCard: adaptiveCard,
1164
+ projectId: data.projectId,
1165
+ });
1166
+ }
1132
1167
 
1133
- logger.debug(
1134
- `Message sent successfully to channel ${channel.name}, thread: ${JSON.stringify(thread)}`,
1135
- );
1136
- workspaceMessageResponse.threads.push(thread);
1168
+ if (lastThread) {
1169
+ logger.debug(
1170
+ `Message sent successfully to channel ${channel.name}, thread: ${JSON.stringify(lastThread)}`,
1171
+ );
1172
+ workspaceMessageResponse.threads.push(lastThread);
1173
+ }
1137
1174
  } catch (e) {
1138
1175
  logger.error(`Error sending message to channel ID ${channel.id}:`);
1139
1176
  logger.error(e);
@@ -1129,13 +1129,33 @@ export default class SlackUtil extends WorkspaceBase {
1129
1129
  }
1130
1130
  }
1131
1131
 
1132
- const thread: WorkspaceThread = await this.sendPayloadBlocksToChannel({
1133
- authToken: data.authToken,
1134
- workspaceChannel: channel,
1135
- blocks: blocks,
1136
- });
1132
+ // Slack has a limit of 50 blocks per message. Split into batches if needed.
1133
+ const maxBlocksPerMessage: number = 50;
1134
+ let lastThread: WorkspaceThread | undefined;
1137
1135
 
1138
- workspaspaceMessageResponse.threads.push(thread);
1136
+ if (blocks.length <= maxBlocksPerMessage) {
1137
+ lastThread = await this.sendPayloadBlocksToChannel({
1138
+ authToken: data.authToken,
1139
+ workspaceChannel: channel,
1140
+ blocks: blocks,
1141
+ });
1142
+ } else {
1143
+ for (let i: number = 0; i < blocks.length; i += maxBlocksPerMessage) {
1144
+ const chunk: Array<JSONObject> = blocks.slice(
1145
+ i,
1146
+ i + maxBlocksPerMessage,
1147
+ );
1148
+ lastThread = await this.sendPayloadBlocksToChannel({
1149
+ authToken: data.authToken,
1150
+ workspaceChannel: channel,
1151
+ blocks: chunk,
1152
+ });
1153
+ }
1154
+ }
1155
+
1156
+ if (lastThread) {
1157
+ workspaspaceMessageResponse.threads.push(lastThread);
1158
+ }
1139
1159
 
1140
1160
  logger.debug(`Message sent to channel ID ${channel.id} successfully.`);
1141
1161
  } catch (e) {
package/ServiceRoute.ts CHANGED
@@ -35,3 +35,5 @@ export const RealtimeRoute: Route = new Route("/realtime/socket");
35
35
  export const DocsRoute: Route = new Route("/docs");
36
36
 
37
37
  export const StatusPageApiRoute: Route = new Route("/status-page-api");
38
+
39
+ export const PublicDashboardRoute: Route = new Route("/public-dashboard");
@@ -4,6 +4,8 @@ enum AnalyticsTableName {
4
4
  ExceptionInstance = "ExceptionItemV2",
5
5
  Span = "SpanItemV2",
6
6
  MonitorLog = "MonitorLogV2",
7
+ Profile = "ProfileItemV2",
8
+ ProfileSample = "ProfileSampleItemV2",
7
9
  }
8
10
 
9
11
  export default AnalyticsTableName;
@@ -8,6 +8,7 @@ enum CookieName {
8
8
  IsMasterAdmin = "user-is-master-admin",
9
9
  ProfilePicID = "user-profile-pic-id",
10
10
  StatusPageMasterPassword = "status-page-master-password",
11
+ DashboardMasterPassword = "dashboard-master-password",
11
12
  }
12
13
 
13
14
  export default CookieName;
@@ -1,6 +1,11 @@
1
1
  enum DashboardChartType {
2
2
  Line = "Line",
3
3
  Bar = "Bar",
4
+ Area = "Area",
5
+ StackedArea = "Stacked Area",
6
+ Pie = "Pie",
7
+ Heatmap = "Heatmap",
8
+ Histogram = "Histogram",
4
9
  }
5
10
 
6
11
  export default DashboardChartType;
@@ -2,6 +2,10 @@ enum DashboardComponentType {
2
2
  Chart = `Chart`,
3
3
  Value = `Value`,
4
4
  Text = `Text`,
5
+ Table = `Table`,
6
+ Gauge = `Gauge`,
7
+ LogStream = `LogStream`,
8
+ TraceList = `TraceList`,
5
9
  }
6
10
 
7
11
  export default DashboardComponentType;
@@ -9,10 +9,19 @@ export enum ComponentInputType {
9
9
  Number = "Number",
10
10
  Decimal = "Decimal",
11
11
  MetricsQueryConfig = "MetricsQueryConfig",
12
+ MetricsQueryConfigs = "MetricsQueryConfigs",
12
13
  LongText = "Long Text",
13
14
  Dropdown = "Dropdown",
14
15
  }
15
16
 
17
+ export interface ComponentArgumentSection {
18
+ name: string;
19
+ description?: string | undefined;
20
+ icon?: string | undefined;
21
+ defaultCollapsed?: boolean | undefined;
22
+ order: number;
23
+ }
24
+
16
25
  export interface ComponentArgument<T extends DashboardBaseComponent> {
17
26
  name: string;
18
27
  description: string;
@@ -22,4 +31,5 @@ export interface ComponentArgument<T extends DashboardBaseComponent> {
22
31
  isAdvanced?: boolean | undefined;
23
32
  placeholder?: string | undefined;
24
33
  dropdownOptions?: Array<DropdownOption> | undefined;
34
+ section?: ComponentArgumentSection | undefined;
25
35
  }
@@ -9,10 +9,9 @@ export default interface DashboardChartComponent extends BaseComponent {
9
9
  componentId: ObjectID;
10
10
  arguments: {
11
11
  metricQueryConfig?: MetricQueryConfigData | undefined;
12
+ metricQueryConfigs?: Array<MetricQueryConfigData> | undefined;
12
13
  chartTitle?: string | undefined;
13
14
  chartDescription?: string | undefined;
14
- legendText?: string | undefined;
15
- legendUnit?: string | undefined;
16
15
  chartType?: DashboardChartType | undefined;
17
16
  };
18
17
  }
@@ -0,0 +1,17 @@
1
+ import MetricQueryConfigData from "../../Metrics/MetricQueryConfigData";
2
+ import ObjectID from "../../ObjectID";
3
+ import DashboardComponentType from "../DashboardComponentType";
4
+ import BaseComponent from "./DashboardBaseComponent";
5
+
6
+ export default interface DashboardGaugeComponent extends BaseComponent {
7
+ componentType: DashboardComponentType.Gauge;
8
+ componentId: ObjectID;
9
+ arguments: {
10
+ metricQueryConfig?: MetricQueryConfigData | undefined;
11
+ gaugeTitle?: string | undefined;
12
+ minValue?: number | undefined;
13
+ maxValue?: number | undefined;
14
+ warningThreshold?: number | undefined;
15
+ criticalThreshold?: number | undefined;
16
+ };
17
+ }
@@ -0,0 +1,15 @@
1
+ import ObjectID from "../../ObjectID";
2
+ import DashboardComponentType from "../DashboardComponentType";
3
+ import BaseComponent from "./DashboardBaseComponent";
4
+
5
+ export default interface DashboardLogStreamComponent extends BaseComponent {
6
+ componentType: DashboardComponentType.LogStream;
7
+ componentId: ObjectID;
8
+ arguments: {
9
+ title?: string | undefined;
10
+ severityFilter?: string | undefined;
11
+ bodyContains?: string | undefined;
12
+ attributeFilterQuery?: string | undefined;
13
+ maxRows?: number | undefined;
14
+ };
15
+ }
@@ -0,0 +1,14 @@
1
+ import MetricQueryConfigData from "../../Metrics/MetricQueryConfigData";
2
+ import ObjectID from "../../ObjectID";
3
+ import DashboardComponentType from "../DashboardComponentType";
4
+ import BaseComponent from "./DashboardBaseComponent";
5
+
6
+ export default interface DashboardTableComponent extends BaseComponent {
7
+ componentType: DashboardComponentType.Table;
8
+ componentId: ObjectID;
9
+ arguments: {
10
+ metricQueryConfig?: MetricQueryConfigData | undefined;
11
+ tableTitle?: string | undefined;
12
+ maxRows?: number | undefined;
13
+ };
14
+ }
@@ -10,5 +10,6 @@ export default interface DashboardTextComponent extends BaseComponent {
10
10
  isBold: boolean;
11
11
  isItalic: boolean;
12
12
  isUnderline: boolean;
13
+ isMarkdown?: boolean | undefined;
13
14
  };
14
15
  }
@@ -0,0 +1,13 @@
1
+ import ObjectID from "../../ObjectID";
2
+ import DashboardComponentType from "../DashboardComponentType";
3
+ import BaseComponent from "./DashboardBaseComponent";
4
+
5
+ export default interface DashboardTraceListComponent extends BaseComponent {
6
+ componentType: DashboardComponentType.TraceList;
7
+ componentId: ObjectID;
8
+ arguments: {
9
+ title?: string | undefined;
10
+ statusFilter?: string | undefined;
11
+ maxRows?: number | undefined;
12
+ };
13
+ }
@@ -9,5 +9,7 @@ export default interface DashboardValueComponent extends BaseComponent {
9
9
  arguments: {
10
10
  metricQueryConfig?: MetricQueryConfigData | undefined;
11
11
  title: string;
12
+ warningThreshold?: number | undefined;
13
+ criticalThreshold?: number | undefined;
12
14
  };
13
15
  }