@oneuptime/common 10.0.38 → 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 (294) 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/Types/Workflow/Components/Conditions/IfElse.ts +68 -21
  32. package/Server/Utils/Cookie.ts +48 -0
  33. package/Server/Utils/Monitor/Criteria/ProfileMonitorCriteria.ts +34 -0
  34. package/Server/Utils/Monitor/DataToProcess.ts +3 -1
  35. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +299 -0
  36. package/Server/Utils/Profile/PprofEncoder.ts +225 -0
  37. package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +53 -16
  38. package/Server/Utils/Workspace/Slack/Slack.ts +26 -6
  39. package/ServiceRoute.ts +2 -0
  40. package/Types/AnalyticsDatabase/AnalyticsTableName.ts +2 -0
  41. package/Types/CookieName.ts +1 -0
  42. package/Types/Dashboard/Chart/ChartType.ts +5 -0
  43. package/Types/Dashboard/DashboardComponentType.ts +4 -0
  44. package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +10 -0
  45. package/Types/Dashboard/DashboardComponents/DashboardChartComponent.ts +1 -2
  46. package/Types/Dashboard/DashboardComponents/DashboardGaugeComponent.ts +17 -0
  47. package/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.ts +15 -0
  48. package/Types/Dashboard/DashboardComponents/DashboardTableComponent.ts +14 -0
  49. package/Types/Dashboard/DashboardComponents/DashboardTextComponent.ts +1 -0
  50. package/Types/Dashboard/DashboardComponents/DashboardTraceListComponent.ts +13 -0
  51. package/Types/Dashboard/DashboardComponents/DashboardValueComponent.ts +2 -0
  52. package/Types/Dashboard/DashboardTemplates.ts +964 -0
  53. package/Types/Dashboard/DashboardVariable.ts +23 -0
  54. package/Types/Dashboard/DashboardViewConfig.ts +59 -0
  55. package/Types/Dashboard/MasterPassword.ts +10 -0
  56. package/Types/Icon/IconProp.ts +1 -0
  57. package/Types/Incident/IncidentMetricType.ts +3 -0
  58. package/Types/MeteredPlan/ProductType.ts +1 -0
  59. package/Types/Metrics/MetricQueryConfigData.ts +3 -0
  60. package/Types/Monitor/CriteriaFilter.ts +3 -0
  61. package/Types/Monitor/KubernetesAlertTemplates.ts +78 -7
  62. package/Types/Monitor/MetricMonitor/MetricMonitorResponse.ts +20 -0
  63. package/Types/Monitor/MonitorStep.ts +25 -0
  64. package/Types/Monitor/MonitorStepProfileMonitor.ts +96 -0
  65. package/Types/Monitor/MonitorType.ts +11 -0
  66. package/Types/Monitor/ProfileMonitor/ProfileMonitorResponse.ts +12 -0
  67. package/Types/Permission.ts +87 -0
  68. package/Types/Telemetry/TelemetryType.ts +1 -0
  69. package/Types/Workflow/Component.ts +1 -0
  70. package/Types/Workflow/Components/Condition.ts +24 -0
  71. package/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryItem.ts +1 -0
  72. package/UI/Components/Button/Button.tsx +1 -1
  73. package/UI/Components/Card/Card.tsx +8 -4
  74. package/UI/Components/Charts/Area/AreaChart.tsx +4 -0
  75. package/UI/Components/Charts/Bar/BarChart.tsx +4 -0
  76. package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +26 -0
  77. package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +26 -0
  78. package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +26 -0
  79. package/UI/Components/Charts/Line/LineChart.tsx +4 -0
  80. package/UI/Components/Charts/Types/ReferenceLineProps.ts +6 -0
  81. package/UI/Components/Icon/Icon.tsx +33 -0
  82. package/UI/Components/ModelTable/BaseModelTable.tsx +13 -10
  83. package/UI/Components/MoreMenu/MoreMenu.tsx +15 -2
  84. package/UI/Components/MoreMenu/MoreMenuItem.tsx +4 -4
  85. package/UI/Components/Workflow/Component.tsx +450 -209
  86. package/UI/Components/Workflow/ComponentPortViewer.tsx +57 -20
  87. package/UI/Components/Workflow/ComponentReturnValueViewer.tsx +65 -25
  88. package/UI/Components/Workflow/ComponentSettingsModal.tsx +202 -37
  89. package/UI/Components/Workflow/ComponentsModal.tsx +180 -93
  90. package/UI/Components/Workflow/Utils.ts +32 -1
  91. package/UI/Components/Workflow/Workflow.tsx +105 -9
  92. package/UI/Config.ts +9 -0
  93. package/Utils/Dashboard/Components/DashboardChartComponent.ts +53 -22
  94. package/Utils/Dashboard/Components/DashboardGaugeComponent.ts +124 -0
  95. package/Utils/Dashboard/Components/DashboardLogStreamComponent.ts +110 -0
  96. package/Utils/Dashboard/Components/DashboardTableComponent.ts +86 -0
  97. package/Utils/Dashboard/Components/DashboardTextComponent.ts +32 -7
  98. package/Utils/Dashboard/Components/DashboardTraceListComponent.ts +86 -0
  99. package/Utils/Dashboard/Components/DashboardValueComponent.ts +39 -3
  100. package/Utils/Dashboard/Components/Index.ts +28 -0
  101. package/Utils/ValueFormatter.ts +170 -0
  102. package/build/dist/Models/AnalyticsModels/Index.js +4 -0
  103. package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
  104. package/build/dist/Models/AnalyticsModels/Profile.js +621 -0
  105. package/build/dist/Models/AnalyticsModels/Profile.js.map +1 -0
  106. package/build/dist/Models/AnalyticsModels/ProfileSample.js +497 -0
  107. package/build/dist/Models/AnalyticsModels/ProfileSample.js.map +1 -0
  108. package/build/dist/Models/DatabaseModels/Dashboard.js +365 -0
  109. package/build/dist/Models/DatabaseModels/Dashboard.js.map +1 -1
  110. package/build/dist/Models/DatabaseModels/DashboardDomain.js +691 -0
  111. package/build/dist/Models/DatabaseModels/DashboardDomain.js.map +1 -0
  112. package/build/dist/Models/DatabaseModels/Index.js +2 -0
  113. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  114. package/build/dist/Models/DatabaseModels/StatusPage.js +42 -0
  115. package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
  116. package/build/dist/Server/API/DashboardAPI.js +293 -0
  117. package/build/dist/Server/API/DashboardAPI.js.map +1 -0
  118. package/build/dist/Server/API/DashboardDomainAPI.js +124 -0
  119. package/build/dist/Server/API/DashboardDomainAPI.js.map +1 -0
  120. package/build/dist/Server/API/StatusPageAPI.js +26 -2
  121. package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
  122. package/build/dist/Server/API/TelemetryAPI.js +222 -0
  123. package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
  124. package/build/dist/Server/EnvironmentConfig.js +4 -0
  125. package/build/dist/Server/EnvironmentConfig.js.map +1 -1
  126. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742177-MigrationName.js +40 -0
  127. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742177-MigrationName.js.map +1 -0
  128. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742178-MigrationName.js +12 -0
  129. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742178-MigrationName.js.map +1 -0
  130. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742179-MigrationName.js +23 -0
  131. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774524742179-MigrationName.js.map +1 -0
  132. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064919-MigrationName.js +26 -0
  133. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774559064919-MigrationName.js.map +1 -0
  134. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
  135. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  136. package/build/dist/Server/Middleware/UserAuthorization.js +41 -0
  137. package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
  138. package/build/dist/Server/Services/DashboardDomainService.js +595 -0
  139. package/build/dist/Server/Services/DashboardDomainService.js.map +1 -0
  140. package/build/dist/Server/Services/DashboardService.js +117 -3
  141. package/build/dist/Server/Services/DashboardService.js.map +1 -1
  142. package/build/dist/Server/Services/IncidentService.js +231 -55
  143. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  144. package/build/dist/Server/Services/IncidentStateTimelineService.js +1 -1
  145. package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
  146. package/build/dist/Server/Services/Index.js +6 -0
  147. package/build/dist/Server/Services/Index.js.map +1 -1
  148. package/build/dist/Server/Services/MonitorService.js +5 -2
  149. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  150. package/build/dist/Server/Services/ProfileAggregationService.js +356 -0
  151. package/build/dist/Server/Services/ProfileAggregationService.js.map +1 -0
  152. package/build/dist/Server/Services/ProfileSampleService.js +9 -0
  153. package/build/dist/Server/Services/ProfileSampleService.js.map +1 -0
  154. package/build/dist/Server/Services/ProfileService.js +9 -0
  155. package/build/dist/Server/Services/ProfileService.js.map +1 -0
  156. package/build/dist/Server/Services/TelemetryUsageBillingService.js +61 -4
  157. package/build/dist/Server/Services/TelemetryUsageBillingService.js.map +1 -1
  158. package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js +13 -1
  159. package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js.map +1 -1
  160. package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js +8 -0
  161. package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js.map +1 -1
  162. package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js +49 -19
  163. package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js.map +1 -1
  164. package/build/dist/Server/Utils/Cookie.js +36 -0
  165. package/build/dist/Server/Utils/Cookie.js.map +1 -1
  166. package/build/dist/Server/Utils/Monitor/Criteria/ProfileMonitorCriteria.js +34 -0
  167. package/build/dist/Server/Utils/Monitor/Criteria/ProfileMonitorCriteria.js.map +1 -0
  168. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +173 -0
  169. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  170. package/build/dist/Server/Utils/Profile/PprofEncoder.js +129 -0
  171. package/build/dist/Server/Utils/Profile/PprofEncoder.js.map +1 -0
  172. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +36 -14
  173. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
  174. package/build/dist/Server/Utils/Workspace/Slack/Slack.js +23 -6
  175. package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
  176. package/build/dist/ServiceRoute.js +1 -0
  177. package/build/dist/ServiceRoute.js.map +1 -1
  178. package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +2 -0
  179. package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
  180. package/build/dist/Types/CookieName.js +1 -0
  181. package/build/dist/Types/CookieName.js.map +1 -1
  182. package/build/dist/Types/Dashboard/Chart/ChartType.js +5 -0
  183. package/build/dist/Types/Dashboard/Chart/ChartType.js.map +1 -1
  184. package/build/dist/Types/Dashboard/DashboardComponentType.js +4 -0
  185. package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
  186. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +1 -0
  187. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
  188. package/build/dist/Types/Dashboard/DashboardComponents/DashboardGaugeComponent.js +2 -0
  189. package/build/dist/Types/Dashboard/DashboardComponents/DashboardGaugeComponent.js.map +1 -0
  190. package/build/dist/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.js +2 -0
  191. package/build/dist/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.js.map +1 -0
  192. package/build/dist/Types/Dashboard/DashboardComponents/DashboardTableComponent.js +2 -0
  193. package/build/dist/Types/Dashboard/DashboardComponents/DashboardTableComponent.js.map +1 -0
  194. package/build/dist/Types/Dashboard/DashboardComponents/DashboardTraceListComponent.js +2 -0
  195. package/build/dist/Types/Dashboard/DashboardComponents/DashboardTraceListComponent.js.map +1 -0
  196. package/build/dist/Types/Dashboard/DashboardTemplates.js +853 -0
  197. package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -0
  198. package/build/dist/Types/Dashboard/DashboardVariable.js +7 -0
  199. package/build/dist/Types/Dashboard/DashboardVariable.js.map +1 -0
  200. package/build/dist/Types/Dashboard/DashboardViewConfig.js +50 -1
  201. package/build/dist/Types/Dashboard/DashboardViewConfig.js.map +1 -1
  202. package/build/dist/Types/Dashboard/MasterPassword.js +5 -0
  203. package/build/dist/Types/Dashboard/MasterPassword.js.map +1 -0
  204. package/build/dist/Types/Icon/IconProp.js +1 -0
  205. package/build/dist/Types/Icon/IconProp.js.map +1 -1
  206. package/build/dist/Types/Incident/IncidentMetricType.js +3 -0
  207. package/build/dist/Types/Incident/IncidentMetricType.js.map +1 -1
  208. package/build/dist/Types/MeteredPlan/ProductType.js +1 -0
  209. package/build/dist/Types/MeteredPlan/ProductType.js.map +1 -1
  210. package/build/dist/Types/Metrics/MetricQueryConfigData.js +1 -0
  211. package/build/dist/Types/Metrics/MetricQueryConfigData.js.map +1 -1
  212. package/build/dist/Types/Monitor/CriteriaFilter.js +2 -0
  213. package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
  214. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +58 -7
  215. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
  216. package/build/dist/Types/Monitor/MonitorStep.js +15 -0
  217. package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
  218. package/build/dist/Types/Monitor/MonitorStepProfileMonitor.js +59 -0
  219. package/build/dist/Types/Monitor/MonitorStepProfileMonitor.js.map +1 -0
  220. package/build/dist/Types/Monitor/MonitorType.js +10 -0
  221. package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
  222. package/build/dist/Types/Monitor/ProfileMonitor/ProfileMonitorResponse.js +2 -0
  223. package/build/dist/Types/Monitor/ProfileMonitor/ProfileMonitorResponse.js.map +1 -0
  224. package/build/dist/Types/Permission.js +75 -0
  225. package/build/dist/Types/Permission.js.map +1 -1
  226. package/build/dist/Types/Telemetry/TelemetryType.js +1 -0
  227. package/build/dist/Types/Telemetry/TelemetryType.js.map +1 -1
  228. package/build/dist/Types/Workflow/Component.js +1 -0
  229. package/build/dist/Types/Workflow/Component.js.map +1 -1
  230. package/build/dist/Types/Workflow/Components/Condition.js +24 -0
  231. package/build/dist/Types/Workflow/Components/Condition.js.map +1 -1
  232. package/build/dist/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryItem.js +1 -0
  233. package/build/dist/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryItem.js.map +1 -1
  234. package/build/dist/UI/Components/Button/Button.js +1 -1
  235. package/build/dist/UI/Components/Button/Button.js.map +1 -1
  236. package/build/dist/UI/Components/Card/Card.js +4 -4
  237. package/build/dist/UI/Components/Card/Card.js.map +1 -1
  238. package/build/dist/UI/Components/Charts/Area/AreaChart.js +1 -1
  239. package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
  240. package/build/dist/UI/Components/Charts/Bar/BarChart.js +1 -1
  241. package/build/dist/UI/Components/Charts/Bar/BarChart.js.map +1 -1
  242. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +5 -2
  243. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
  244. package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +5 -2
  245. package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
  246. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +6 -3
  247. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
  248. package/build/dist/UI/Components/Charts/Line/LineChart.js +1 -1
  249. package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
  250. package/build/dist/UI/Components/Charts/Types/ReferenceLineProps.js +2 -0
  251. package/build/dist/UI/Components/Charts/Types/ReferenceLineProps.js.map +1 -0
  252. package/build/dist/UI/Components/Icon/Icon.js +11 -0
  253. package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
  254. package/build/dist/UI/Components/ModelTable/BaseModelTable.js +12 -9
  255. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  256. package/build/dist/UI/Components/MoreMenu/MoreMenu.js +8 -2
  257. package/build/dist/UI/Components/MoreMenu/MoreMenu.js.map +1 -1
  258. package/build/dist/UI/Components/MoreMenu/MoreMenuItem.js +4 -4
  259. package/build/dist/UI/Components/MoreMenu/MoreMenuItem.js.map +1 -1
  260. package/build/dist/UI/Components/Workflow/Component.js +311 -143
  261. package/build/dist/UI/Components/Workflow/Component.js.map +1 -1
  262. package/build/dist/UI/Components/Workflow/ComponentPortViewer.js +44 -18
  263. package/build/dist/UI/Components/Workflow/ComponentPortViewer.js.map +1 -1
  264. package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js +48 -22
  265. package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js.map +1 -1
  266. package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js +127 -21
  267. package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js.map +1 -1
  268. package/build/dist/UI/Components/Workflow/ComponentsModal.js +107 -52
  269. package/build/dist/UI/Components/Workflow/ComponentsModal.js.map +1 -1
  270. package/build/dist/UI/Components/Workflow/Utils.js +28 -1
  271. package/build/dist/UI/Components/Workflow/Utils.js.map +1 -1
  272. package/build/dist/UI/Components/Workflow/Workflow.js +87 -12
  273. package/build/dist/UI/Components/Workflow/Workflow.js.map +1 -1
  274. package/build/dist/UI/Config.js +3 -1
  275. package/build/dist/UI/Config.js.map +1 -1
  276. package/build/dist/Utils/Dashboard/Components/DashboardChartComponent.js +50 -21
  277. package/build/dist/Utils/Dashboard/Components/DashboardChartComponent.js.map +1 -1
  278. package/build/dist/Utils/Dashboard/Components/DashboardGaugeComponent.js +104 -0
  279. package/build/dist/Utils/Dashboard/Components/DashboardGaugeComponent.js.map +1 -0
  280. package/build/dist/Utils/Dashboard/Components/DashboardLogStreamComponent.js +91 -0
  281. package/build/dist/Utils/Dashboard/Components/DashboardLogStreamComponent.js.map +1 -0
  282. package/build/dist/Utils/Dashboard/Components/DashboardTableComponent.js +70 -0
  283. package/build/dist/Utils/Dashboard/Components/DashboardTableComponent.js.map +1 -0
  284. package/build/dist/Utils/Dashboard/Components/DashboardTextComponent.js +28 -7
  285. package/build/dist/Utils/Dashboard/Components/DashboardTextComponent.js.map +1 -1
  286. package/build/dist/Utils/Dashboard/Components/DashboardTraceListComponent.js +70 -0
  287. package/build/dist/Utils/Dashboard/Components/DashboardTraceListComponent.js.map +1 -0
  288. package/build/dist/Utils/Dashboard/Components/DashboardValueComponent.js +34 -3
  289. package/build/dist/Utils/Dashboard/Components/DashboardValueComponent.js.map +1 -1
  290. package/build/dist/Utils/Dashboard/Components/Index.js +16 -0
  291. package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
  292. package/build/dist/Utils/ValueFormatter.js +132 -0
  293. package/build/dist/Utils/ValueFormatter.js.map +1 -0
  294. package/package.json +1 -1
@@ -0,0 +1,853 @@
1
+ import { ObjectType } from "../JSON";
2
+ import DashboardSize from "./DashboardSize";
3
+ import DashboardComponentType from "./DashboardComponentType";
4
+ import DashboardChartType from "./Chart/ChartType";
5
+ import ObjectID from "../ObjectID";
6
+ import IconProp from "../Icon/IconProp";
7
+ import MetricsAggregationType from "../Metrics/MetricsAggregationType";
8
+ import IncidentMetricType from "../Incident/IncidentMetricType";
9
+ import MonitorMetricType from "../Monitor/MonitorMetricType";
10
+ export var DashboardTemplateType;
11
+ (function (DashboardTemplateType) {
12
+ DashboardTemplateType["Blank"] = "Blank";
13
+ DashboardTemplateType["Monitor"] = "Monitor";
14
+ DashboardTemplateType["Incident"] = "Incident";
15
+ DashboardTemplateType["Kubernetes"] = "Kubernetes";
16
+ })(DashboardTemplateType || (DashboardTemplateType = {}));
17
+ export const DashboardTemplates = [
18
+ {
19
+ type: DashboardTemplateType.Blank,
20
+ name: "Blank Dashboard",
21
+ description: "Start from scratch with an empty dashboard.",
22
+ icon: IconProp.Add,
23
+ },
24
+ {
25
+ type: DashboardTemplateType.Monitor,
26
+ name: "Monitor Dashboard",
27
+ description: "Response time, uptime, error rate, throughput charts, health gauges, and logs.",
28
+ icon: IconProp.Heartbeat,
29
+ },
30
+ {
31
+ type: DashboardTemplateType.Incident,
32
+ name: "Incident Dashboard",
33
+ description: "MTTR/MTTA gauges, incident trends, severity breakdown, duration tables, logs, and traces.",
34
+ icon: IconProp.Alert,
35
+ },
36
+ {
37
+ type: DashboardTemplateType.Kubernetes,
38
+ name: "Kubernetes Dashboard",
39
+ description: "CPU/memory gauges, pod and node metrics, network I/O, restart trends, and cluster logs.",
40
+ icon: IconProp.Kubernetes,
41
+ },
42
+ ];
43
+ function buildMetricQueryConfig(config) {
44
+ var _a, _b;
45
+ return {
46
+ metricAliasData: {
47
+ metricVariable: "a",
48
+ title: undefined,
49
+ description: undefined,
50
+ legend: (_a = config.legend) !== null && _a !== void 0 ? _a : undefined,
51
+ legendUnit: (_b = config.legendUnit) !== null && _b !== void 0 ? _b : undefined,
52
+ },
53
+ metricQueryData: {
54
+ filterData: {
55
+ metricName: config.metricName,
56
+ aggegationType: config.aggregationType,
57
+ },
58
+ groupBy: undefined,
59
+ },
60
+ };
61
+ }
62
+ function buildMetricQueryData(config) {
63
+ return {
64
+ metricQueryData: {
65
+ filterData: {
66
+ metricName: config.metricName,
67
+ aggegationType: config.aggregationType,
68
+ },
69
+ groupBy: undefined,
70
+ },
71
+ };
72
+ }
73
+ // -- Component factory helpers --
74
+ function createTextComponent(data) {
75
+ var _a;
76
+ return {
77
+ _type: ObjectType.DashboardComponent,
78
+ componentType: DashboardComponentType.Text,
79
+ componentId: ObjectID.generate(),
80
+ topInDashboardUnits: data.top,
81
+ leftInDashboardUnits: data.left,
82
+ widthInDashboardUnits: data.width,
83
+ heightInDashboardUnits: data.height,
84
+ minHeightInDashboardUnits: 1,
85
+ minWidthInDashboardUnits: 3,
86
+ arguments: {
87
+ text: data.text,
88
+ isBold: (_a = data.isBold) !== null && _a !== void 0 ? _a : false,
89
+ isItalic: false,
90
+ isUnderline: false,
91
+ isMarkdown: false,
92
+ },
93
+ };
94
+ }
95
+ function createValueComponent(data) {
96
+ return {
97
+ _type: ObjectType.DashboardComponent,
98
+ componentType: DashboardComponentType.Value,
99
+ componentId: ObjectID.generate(),
100
+ topInDashboardUnits: data.top,
101
+ leftInDashboardUnits: data.left,
102
+ widthInDashboardUnits: data.width,
103
+ heightInDashboardUnits: 1,
104
+ minHeightInDashboardUnits: 1,
105
+ minWidthInDashboardUnits: 1,
106
+ arguments: {
107
+ title: data.title,
108
+ metricQueryConfig: data.metricConfig
109
+ ? buildMetricQueryData(data.metricConfig)
110
+ : {
111
+ metricQueryData: {
112
+ filterData: {},
113
+ groupBy: undefined,
114
+ },
115
+ },
116
+ },
117
+ };
118
+ }
119
+ function createChartComponent(data) {
120
+ return {
121
+ _type: ObjectType.DashboardComponent,
122
+ componentType: DashboardComponentType.Chart,
123
+ componentId: ObjectID.generate(),
124
+ topInDashboardUnits: data.top,
125
+ leftInDashboardUnits: data.left,
126
+ widthInDashboardUnits: data.width,
127
+ heightInDashboardUnits: data.height,
128
+ minHeightInDashboardUnits: 3,
129
+ minWidthInDashboardUnits: 6,
130
+ arguments: {
131
+ chartTitle: data.title,
132
+ chartType: data.chartType,
133
+ metricQueryConfig: data.metricConfig
134
+ ? buildMetricQueryConfig(data.metricConfig)
135
+ : {
136
+ metricAliasData: {
137
+ metricVariable: "a",
138
+ title: undefined,
139
+ description: undefined,
140
+ legend: undefined,
141
+ legendUnit: undefined,
142
+ },
143
+ metricQueryData: {
144
+ filterData: {},
145
+ groupBy: undefined,
146
+ },
147
+ },
148
+ },
149
+ };
150
+ }
151
+ function createLogStreamComponent(data) {
152
+ return {
153
+ _type: ObjectType.DashboardComponent,
154
+ componentType: DashboardComponentType.LogStream,
155
+ componentId: ObjectID.generate(),
156
+ topInDashboardUnits: data.top,
157
+ leftInDashboardUnits: data.left,
158
+ widthInDashboardUnits: data.width,
159
+ heightInDashboardUnits: data.height,
160
+ minHeightInDashboardUnits: 3,
161
+ minWidthInDashboardUnits: 6,
162
+ arguments: {
163
+ title: data.title,
164
+ maxRows: 50,
165
+ },
166
+ };
167
+ }
168
+ function createGaugeComponent(data) {
169
+ var _a, _b;
170
+ return {
171
+ _type: ObjectType.DashboardComponent,
172
+ componentType: DashboardComponentType.Gauge,
173
+ componentId: ObjectID.generate(),
174
+ topInDashboardUnits: data.top,
175
+ leftInDashboardUnits: data.left,
176
+ widthInDashboardUnits: data.width,
177
+ heightInDashboardUnits: data.height,
178
+ minHeightInDashboardUnits: 3,
179
+ minWidthInDashboardUnits: 3,
180
+ arguments: {
181
+ gaugeTitle: data.title,
182
+ minValue: (_a = data.minValue) !== null && _a !== void 0 ? _a : 0,
183
+ maxValue: (_b = data.maxValue) !== null && _b !== void 0 ? _b : 100,
184
+ warningThreshold: data.warningThreshold,
185
+ criticalThreshold: data.criticalThreshold,
186
+ metricQueryConfig: data.metricConfig
187
+ ? buildMetricQueryData(data.metricConfig)
188
+ : {
189
+ metricQueryData: {
190
+ filterData: {},
191
+ groupBy: undefined,
192
+ },
193
+ },
194
+ },
195
+ };
196
+ }
197
+ function createTableComponent(data) {
198
+ var _a;
199
+ return {
200
+ _type: ObjectType.DashboardComponent,
201
+ componentType: DashboardComponentType.Table,
202
+ componentId: ObjectID.generate(),
203
+ topInDashboardUnits: data.top,
204
+ leftInDashboardUnits: data.left,
205
+ widthInDashboardUnits: data.width,
206
+ heightInDashboardUnits: data.height,
207
+ minHeightInDashboardUnits: 3,
208
+ minWidthInDashboardUnits: 6,
209
+ arguments: {
210
+ tableTitle: data.title,
211
+ maxRows: (_a = data.maxRows) !== null && _a !== void 0 ? _a : 20,
212
+ metricQueryConfig: data.metricConfig
213
+ ? buildMetricQueryData(data.metricConfig)
214
+ : {
215
+ metricQueryData: {
216
+ filterData: {},
217
+ groupBy: undefined,
218
+ },
219
+ },
220
+ },
221
+ };
222
+ }
223
+ function createTraceListComponent(data) {
224
+ var _a;
225
+ return {
226
+ _type: ObjectType.DashboardComponent,
227
+ componentType: DashboardComponentType.TraceList,
228
+ componentId: ObjectID.generate(),
229
+ topInDashboardUnits: data.top,
230
+ leftInDashboardUnits: data.left,
231
+ widthInDashboardUnits: data.width,
232
+ heightInDashboardUnits: data.height,
233
+ minHeightInDashboardUnits: 3,
234
+ minWidthInDashboardUnits: 6,
235
+ arguments: {
236
+ title: data.title,
237
+ maxRows: (_a = data.maxRows) !== null && _a !== void 0 ? _a : 20,
238
+ },
239
+ };
240
+ }
241
+ // -- Dashboard configs --
242
+ function createMonitorDashboardConfig() {
243
+ const components = [
244
+ // Row 0: Title
245
+ createTextComponent({
246
+ text: "Monitor Dashboard",
247
+ top: 0,
248
+ left: 0,
249
+ width: 12,
250
+ height: 1,
251
+ isBold: true,
252
+ }),
253
+ // Row 1: Key metric values
254
+ createValueComponent({
255
+ title: "Response Time",
256
+ top: 1,
257
+ left: 0,
258
+ width: 3,
259
+ metricConfig: {
260
+ metricName: MonitorMetricType.ResponseTime,
261
+ aggregationType: MetricsAggregationType.Avg,
262
+ legendUnit: "ms",
263
+ },
264
+ }),
265
+ createValueComponent({
266
+ title: "Uptime %",
267
+ top: 1,
268
+ left: 3,
269
+ width: 3,
270
+ metricConfig: {
271
+ metricName: MonitorMetricType.IsOnline,
272
+ aggregationType: MetricsAggregationType.Avg,
273
+ legendUnit: "%",
274
+ },
275
+ }),
276
+ createValueComponent({
277
+ title: "Error Rate",
278
+ top: 1,
279
+ left: 6,
280
+ width: 3,
281
+ metricConfig: {
282
+ metricName: MonitorMetricType.ResponseStatusCode,
283
+ aggregationType: MetricsAggregationType.Count,
284
+ },
285
+ }),
286
+ createValueComponent({
287
+ title: "Execution Time",
288
+ top: 1,
289
+ left: 9,
290
+ width: 3,
291
+ metricConfig: {
292
+ metricName: MonitorMetricType.ExecutionTime,
293
+ aggregationType: MetricsAggregationType.Avg,
294
+ legendUnit: "ms",
295
+ },
296
+ }),
297
+ // Row 2-4: Charts
298
+ createChartComponent({
299
+ title: "Response Time Over Time",
300
+ chartType: DashboardChartType.Line,
301
+ top: 2,
302
+ left: 0,
303
+ width: 6,
304
+ height: 3,
305
+ metricConfig: {
306
+ metricName: MonitorMetricType.ResponseTime,
307
+ aggregationType: MetricsAggregationType.Avg,
308
+ legend: "Avg Response Time",
309
+ legendUnit: "ms",
310
+ },
311
+ }),
312
+ createChartComponent({
313
+ title: "Uptime Over Time",
314
+ chartType: DashboardChartType.Area,
315
+ top: 2,
316
+ left: 6,
317
+ width: 6,
318
+ height: 3,
319
+ metricConfig: {
320
+ metricName: MonitorMetricType.IsOnline,
321
+ aggregationType: MetricsAggregationType.Avg,
322
+ legend: "Online Status",
323
+ legendUnit: "%",
324
+ },
325
+ }),
326
+ // Row 5: Section header
327
+ createTextComponent({
328
+ text: "Health & Errors",
329
+ top: 5,
330
+ left: 0,
331
+ width: 12,
332
+ height: 1,
333
+ isBold: true,
334
+ }),
335
+ // Row 6-8: Gauges and error chart
336
+ createGaugeComponent({
337
+ title: "CPU Usage",
338
+ top: 6,
339
+ left: 0,
340
+ width: 3,
341
+ height: 3,
342
+ minValue: 0,
343
+ maxValue: 100,
344
+ warningThreshold: 70,
345
+ criticalThreshold: 90,
346
+ metricConfig: {
347
+ metricName: MonitorMetricType.CPUUsagePercent,
348
+ aggregationType: MetricsAggregationType.Avg,
349
+ },
350
+ }),
351
+ createGaugeComponent({
352
+ title: "Memory Usage",
353
+ top: 6,
354
+ left: 3,
355
+ width: 3,
356
+ height: 3,
357
+ minValue: 0,
358
+ maxValue: 100,
359
+ warningThreshold: 70,
360
+ criticalThreshold: 90,
361
+ metricConfig: {
362
+ metricName: MonitorMetricType.MemoryUsagePercent,
363
+ aggregationType: MetricsAggregationType.Avg,
364
+ },
365
+ }),
366
+ createChartComponent({
367
+ title: "Status Code Over Time",
368
+ chartType: DashboardChartType.Bar,
369
+ top: 6,
370
+ left: 6,
371
+ width: 6,
372
+ height: 3,
373
+ metricConfig: {
374
+ metricName: MonitorMetricType.ResponseStatusCode,
375
+ aggregationType: MetricsAggregationType.Count,
376
+ legend: "Status Codes",
377
+ },
378
+ }),
379
+ // Row 9: Section header
380
+ createTextComponent({
381
+ text: "Details",
382
+ top: 9,
383
+ left: 0,
384
+ width: 12,
385
+ height: 1,
386
+ isBold: true,
387
+ }),
388
+ // Row 10-12: Table and logs
389
+ createTableComponent({
390
+ title: "Response Time Breakdown",
391
+ top: 10,
392
+ left: 0,
393
+ width: 6,
394
+ height: 3,
395
+ metricConfig: {
396
+ metricName: MonitorMetricType.ResponseTime,
397
+ aggregationType: MetricsAggregationType.Avg,
398
+ },
399
+ }),
400
+ createLogStreamComponent({
401
+ title: "Recent Logs",
402
+ top: 10,
403
+ left: 6,
404
+ width: 6,
405
+ height: 3,
406
+ }),
407
+ ];
408
+ return {
409
+ _type: ObjectType.DashboardViewConfig,
410
+ components,
411
+ heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 13),
412
+ };
413
+ }
414
+ function createIncidentDashboardConfig() {
415
+ const components = [
416
+ // Row 0: Title
417
+ createTextComponent({
418
+ text: "Incident Dashboard",
419
+ top: 0,
420
+ left: 0,
421
+ width: 12,
422
+ height: 1,
423
+ isBold: true,
424
+ }),
425
+ // Row 1: Key incident metrics
426
+ createValueComponent({
427
+ title: "Incident Count",
428
+ top: 1,
429
+ left: 0,
430
+ width: 3,
431
+ metricConfig: {
432
+ metricName: IncidentMetricType.IncidentCount,
433
+ aggregationType: MetricsAggregationType.Sum,
434
+ },
435
+ }),
436
+ createValueComponent({
437
+ title: "MTTR",
438
+ top: 1,
439
+ left: 3,
440
+ width: 3,
441
+ metricConfig: {
442
+ metricName: IncidentMetricType.TimeToResolve,
443
+ aggregationType: MetricsAggregationType.Avg,
444
+ legendUnit: "min",
445
+ },
446
+ }),
447
+ createValueComponent({
448
+ title: "MTTA",
449
+ top: 1,
450
+ left: 6,
451
+ width: 3,
452
+ metricConfig: {
453
+ metricName: IncidentMetricType.TimeToAcknowledge,
454
+ aggregationType: MetricsAggregationType.Avg,
455
+ legendUnit: "min",
456
+ },
457
+ }),
458
+ createValueComponent({
459
+ title: "Avg Duration",
460
+ top: 1,
461
+ left: 9,
462
+ width: 3,
463
+ metricConfig: {
464
+ metricName: IncidentMetricType.IncidentDuration,
465
+ aggregationType: MetricsAggregationType.Avg,
466
+ legendUnit: "min",
467
+ },
468
+ }),
469
+ // Row 2-4: Incident trends
470
+ createChartComponent({
471
+ title: "Incidents Over Time",
472
+ chartType: DashboardChartType.Bar,
473
+ top: 2,
474
+ left: 0,
475
+ width: 6,
476
+ height: 3,
477
+ metricConfig: {
478
+ metricName: IncidentMetricType.IncidentCount,
479
+ aggregationType: MetricsAggregationType.Sum,
480
+ legend: "Incidents",
481
+ },
482
+ }),
483
+ createChartComponent({
484
+ title: "Incident Duration Over Time",
485
+ chartType: DashboardChartType.Line,
486
+ top: 2,
487
+ left: 6,
488
+ width: 6,
489
+ height: 3,
490
+ metricConfig: {
491
+ metricName: IncidentMetricType.IncidentDuration,
492
+ aggregationType: MetricsAggregationType.Avg,
493
+ legend: "Avg Duration",
494
+ legendUnit: "min",
495
+ },
496
+ }),
497
+ // Row 5: Section header
498
+ createTextComponent({
499
+ text: "Response Performance",
500
+ top: 5,
501
+ left: 0,
502
+ width: 12,
503
+ height: 1,
504
+ isBold: true,
505
+ }),
506
+ // Row 6-8: Gauges for MTTR/MTTA and resolution chart
507
+ createGaugeComponent({
508
+ title: "MTTR (minutes)",
509
+ top: 6,
510
+ left: 0,
511
+ width: 3,
512
+ height: 3,
513
+ minValue: 0,
514
+ maxValue: 120,
515
+ warningThreshold: 60,
516
+ criticalThreshold: 90,
517
+ metricConfig: {
518
+ metricName: IncidentMetricType.TimeToResolve,
519
+ aggregationType: MetricsAggregationType.Avg,
520
+ },
521
+ }),
522
+ createGaugeComponent({
523
+ title: "MTTA (minutes)",
524
+ top: 6,
525
+ left: 3,
526
+ width: 3,
527
+ height: 3,
528
+ minValue: 0,
529
+ maxValue: 60,
530
+ warningThreshold: 15,
531
+ criticalThreshold: 30,
532
+ metricConfig: {
533
+ metricName: IncidentMetricType.TimeToAcknowledge,
534
+ aggregationType: MetricsAggregationType.Avg,
535
+ },
536
+ }),
537
+ createChartComponent({
538
+ title: "MTTR and MTTA Over Time",
539
+ chartType: DashboardChartType.Area,
540
+ top: 6,
541
+ left: 6,
542
+ width: 6,
543
+ height: 3,
544
+ metricConfig: {
545
+ metricName: IncidentMetricType.TimeToResolve,
546
+ aggregationType: MetricsAggregationType.Avg,
547
+ legend: "MTTR",
548
+ legendUnit: "min",
549
+ },
550
+ }),
551
+ // Row 9: Section header
552
+ createTextComponent({
553
+ text: "Breakdown & Analysis",
554
+ top: 9,
555
+ left: 0,
556
+ width: 12,
557
+ height: 1,
558
+ isBold: true,
559
+ }),
560
+ // Row 10-12: Severity breakdown and time in state
561
+ createChartComponent({
562
+ title: "Severity Changes Over Time",
563
+ chartType: DashboardChartType.Pie,
564
+ top: 10,
565
+ left: 0,
566
+ width: 6,
567
+ height: 3,
568
+ metricConfig: {
569
+ metricName: IncidentMetricType.SeverityChange,
570
+ aggregationType: MetricsAggregationType.Count,
571
+ legend: "Severity Changes",
572
+ },
573
+ }),
574
+ createChartComponent({
575
+ title: "Time in State",
576
+ chartType: DashboardChartType.StackedArea,
577
+ top: 10,
578
+ left: 6,
579
+ width: 6,
580
+ height: 3,
581
+ metricConfig: {
582
+ metricName: IncidentMetricType.TimeInState,
583
+ aggregationType: MetricsAggregationType.Avg,
584
+ legend: "Time in State",
585
+ legendUnit: "min",
586
+ },
587
+ }),
588
+ // Row 13: Section header
589
+ createTextComponent({
590
+ text: "Incident Details",
591
+ top: 13,
592
+ left: 0,
593
+ width: 12,
594
+ height: 1,
595
+ isBold: true,
596
+ }),
597
+ // Row 14-16: Tables
598
+ createTableComponent({
599
+ title: "Incidents by Duration",
600
+ top: 14,
601
+ left: 0,
602
+ width: 6,
603
+ height: 3,
604
+ metricConfig: {
605
+ metricName: IncidentMetricType.IncidentDuration,
606
+ aggregationType: MetricsAggregationType.Max,
607
+ },
608
+ }),
609
+ createTableComponent({
610
+ title: "Postmortem Completion Time",
611
+ top: 14,
612
+ left: 6,
613
+ width: 6,
614
+ height: 3,
615
+ metricConfig: {
616
+ metricName: IncidentMetricType.PostmortemCompletionTime,
617
+ aggregationType: MetricsAggregationType.Avg,
618
+ },
619
+ }),
620
+ // Row 17-19: Logs and traces
621
+ createLogStreamComponent({
622
+ title: "Recent Incident Logs",
623
+ top: 17,
624
+ left: 0,
625
+ width: 6,
626
+ height: 3,
627
+ }),
628
+ createTraceListComponent({
629
+ title: "Recent Traces",
630
+ top: 17,
631
+ left: 6,
632
+ width: 6,
633
+ height: 3,
634
+ }),
635
+ ];
636
+ return {
637
+ _type: ObjectType.DashboardViewConfig,
638
+ components,
639
+ heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 20),
640
+ };
641
+ }
642
+ function createKubernetesDashboardConfig() {
643
+ const components = [
644
+ // Row 0: Title
645
+ createTextComponent({
646
+ text: "Kubernetes Dashboard",
647
+ top: 0,
648
+ left: 0,
649
+ width: 12,
650
+ height: 1,
651
+ isBold: true,
652
+ }),
653
+ // Row 1: Key cluster metrics
654
+ createValueComponent({
655
+ title: "CPU Usage",
656
+ top: 1,
657
+ left: 0,
658
+ width: 3,
659
+ metricConfig: {
660
+ metricName: "k8s.pod.cpu.utilization",
661
+ aggregationType: MetricsAggregationType.Avg,
662
+ legendUnit: "%",
663
+ },
664
+ }),
665
+ createValueComponent({
666
+ title: "Memory Usage",
667
+ top: 1,
668
+ left: 3,
669
+ width: 3,
670
+ metricConfig: {
671
+ metricName: "k8s.pod.memory.usage",
672
+ aggregationType: MetricsAggregationType.Avg,
673
+ legendUnit: "bytes",
674
+ },
675
+ }),
676
+ createValueComponent({
677
+ title: "Pod Count",
678
+ top: 1,
679
+ left: 6,
680
+ width: 3,
681
+ metricConfig: {
682
+ metricName: "k8s.pod.phase",
683
+ aggregationType: MetricsAggregationType.Sum,
684
+ },
685
+ }),
686
+ createValueComponent({
687
+ title: "Node Ready",
688
+ top: 1,
689
+ left: 9,
690
+ width: 3,
691
+ metricConfig: {
692
+ metricName: "k8s.node.condition_ready",
693
+ aggregationType: MetricsAggregationType.Sum,
694
+ },
695
+ }),
696
+ // Row 2-4: Resource usage charts
697
+ createChartComponent({
698
+ title: "CPU Usage Over Time",
699
+ chartType: DashboardChartType.Line,
700
+ top: 2,
701
+ left: 0,
702
+ width: 6,
703
+ height: 3,
704
+ metricConfig: {
705
+ metricName: "k8s.pod.cpu.utilization",
706
+ aggregationType: MetricsAggregationType.Avg,
707
+ legend: "CPU Utilization",
708
+ legendUnit: "%",
709
+ },
710
+ }),
711
+ createChartComponent({
712
+ title: "Memory Usage Over Time",
713
+ chartType: DashboardChartType.Area,
714
+ top: 2,
715
+ left: 6,
716
+ width: 6,
717
+ height: 3,
718
+ metricConfig: {
719
+ metricName: "k8s.pod.memory.usage",
720
+ aggregationType: MetricsAggregationType.Avg,
721
+ legend: "Memory Usage",
722
+ legendUnit: "bytes",
723
+ },
724
+ }),
725
+ // Row 5: Section header
726
+ createTextComponent({
727
+ text: "Resource Health",
728
+ top: 5,
729
+ left: 0,
730
+ width: 12,
731
+ height: 1,
732
+ isBold: true,
733
+ }),
734
+ // Row 6-8: Gauges and pod chart
735
+ createGaugeComponent({
736
+ title: "CPU Utilization",
737
+ top: 6,
738
+ left: 0,
739
+ width: 3,
740
+ height: 3,
741
+ minValue: 0,
742
+ maxValue: 100,
743
+ warningThreshold: 70,
744
+ criticalThreshold: 90,
745
+ metricConfig: {
746
+ metricName: "k8s.node.cpu.utilization",
747
+ aggregationType: MetricsAggregationType.Avg,
748
+ },
749
+ }),
750
+ createGaugeComponent({
751
+ title: "Memory Utilization",
752
+ top: 6,
753
+ left: 3,
754
+ width: 3,
755
+ height: 3,
756
+ minValue: 0,
757
+ maxValue: 100,
758
+ warningThreshold: 70,
759
+ criticalThreshold: 90,
760
+ metricConfig: {
761
+ metricName: "k8s.node.memory.usage",
762
+ aggregationType: MetricsAggregationType.Avg,
763
+ },
764
+ }),
765
+ createChartComponent({
766
+ title: "Pod Count Over Time",
767
+ chartType: DashboardChartType.StackedArea,
768
+ top: 6,
769
+ left: 6,
770
+ width: 6,
771
+ height: 3,
772
+ metricConfig: {
773
+ metricName: "k8s.pod.phase",
774
+ aggregationType: MetricsAggregationType.Sum,
775
+ legend: "Pods",
776
+ },
777
+ }),
778
+ // Row 9: Section header
779
+ createTextComponent({
780
+ text: "Workload Details",
781
+ top: 9,
782
+ left: 0,
783
+ width: 12,
784
+ height: 1,
785
+ isBold: true,
786
+ }),
787
+ // Row 10-12: Network, restarts
788
+ createChartComponent({
789
+ title: "Network I/O",
790
+ chartType: DashboardChartType.Area,
791
+ top: 10,
792
+ left: 0,
793
+ width: 6,
794
+ height: 3,
795
+ metricConfig: {
796
+ metricName: "k8s.pod.network.io",
797
+ aggregationType: MetricsAggregationType.Sum,
798
+ legend: "Network I/O",
799
+ legendUnit: "bytes",
800
+ },
801
+ }),
802
+ createChartComponent({
803
+ title: "Container Restarts Over Time",
804
+ chartType: DashboardChartType.Bar,
805
+ top: 10,
806
+ left: 6,
807
+ width: 6,
808
+ height: 3,
809
+ metricConfig: {
810
+ metricName: "k8s.container.restarts",
811
+ aggregationType: MetricsAggregationType.Max,
812
+ legend: "Restarts",
813
+ },
814
+ }),
815
+ // Row 13-15: Table and logs
816
+ createTableComponent({
817
+ title: "Deployment Replicas",
818
+ top: 13,
819
+ left: 0,
820
+ width: 6,
821
+ height: 3,
822
+ metricConfig: {
823
+ metricName: "k8s.deployment.available_replicas",
824
+ aggregationType: MetricsAggregationType.Min,
825
+ },
826
+ }),
827
+ createLogStreamComponent({
828
+ title: "Cluster Logs",
829
+ top: 13,
830
+ left: 6,
831
+ width: 6,
832
+ height: 3,
833
+ }),
834
+ ];
835
+ return {
836
+ _type: ObjectType.DashboardViewConfig,
837
+ components,
838
+ heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 16),
839
+ };
840
+ }
841
+ export function getTemplateConfig(type) {
842
+ switch (type) {
843
+ case DashboardTemplateType.Monitor:
844
+ return createMonitorDashboardConfig();
845
+ case DashboardTemplateType.Incident:
846
+ return createIncidentDashboardConfig();
847
+ case DashboardTemplateType.Kubernetes:
848
+ return createKubernetesDashboardConfig();
849
+ case DashboardTemplateType.Blank:
850
+ return null;
851
+ }
852
+ }
853
+ //# sourceMappingURL=DashboardTemplates.js.map