@oneuptime/common 10.2.14 → 10.2.16

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.
@@ -9,20 +9,22 @@ import IconProp from "../Icon/IconProp";
9
9
  import MetricsAggregationType from "../Metrics/MetricsAggregationType";
10
10
  import IncidentMetricType from "../Incident/IncidentMetricType";
11
11
  import MonitorMetricType from "../Monitor/MonitorMetricType";
12
- import SpanMetricType from "../Span/SpanMetricType";
13
- import ExceptionMetricType from "../Exception/ExceptionMetricType";
14
- import ProfileMetricType from "../Profile/ProfileMetricType";
15
12
  import MetricDashboardMetricType from "../Metrics/MetricDashboardMetricType";
16
13
 
14
+ /*
15
+ * Trace / Exception / Profiles entries are intentionally not in this
16
+ * enum: their metric catalogs (SpanMetricType, ExceptionMetricType,
17
+ * ProfileMetricType) define names that are not emitted anywhere in the
18
+ * codebase, so the templates only ever rendered empty widgets. Reach
19
+ * for the Logs / Traces / Exceptions pages directly until those metrics
20
+ * exist.
21
+ */
17
22
  export enum DashboardTemplateType {
18
23
  Blank = "Blank",
19
24
  Monitor = "Monitor",
20
25
  Incident = "Incident",
21
26
  Kubernetes = "Kubernetes",
22
27
  Metrics = "Metrics",
23
- Trace = "Trace",
24
- Exception = "Exception",
25
- Profiles = "Profiles",
26
28
  }
27
29
 
28
30
  export interface DashboardTemplate {
@@ -43,51 +45,30 @@ export const DashboardTemplates: Array<DashboardTemplate> = [
43
45
  type: DashboardTemplateType.Monitor,
44
46
  name: "Monitor Dashboard",
45
47
  description:
46
- "Response time, uptime, error rate, throughput charts, health gauges, and logs.",
48
+ "Response time, uptime, status codes, CPU/memory health gauges, and breakdown table for synthetic and server monitors.",
47
49
  icon: IconProp.Heartbeat,
48
50
  },
49
51
  {
50
52
  type: DashboardTemplateType.Incident,
51
53
  name: "Incident Dashboard",
52
54
  description:
53
- "MTTR/MTTA gauges, incident trends, severity breakdown, duration tables, logs, and traces.",
55
+ "Incident count, MTTR/MTTA gauges, duration trends, severity breakdown, time-in-state, and longest-incident tables.",
54
56
  icon: IconProp.Alert,
55
57
  },
56
58
  {
57
59
  type: DashboardTemplateType.Kubernetes,
58
60
  name: "Kubernetes Dashboard",
59
61
  description:
60
- "CPU/memory gauges, pod and node metrics, network I/O, restart trends, and cluster logs.",
62
+ "Pod/node CPU and memory averages, utilization gauges, live pod and node lists, network I/O, restarts, and cluster logs.",
61
63
  icon: IconProp.Kubernetes,
62
64
  },
63
65
  {
64
66
  type: DashboardTemplateType.Metrics,
65
67
  name: "Metrics Dashboard",
66
68
  description:
67
- "HTTP request rates, latency percentiles, error rates, system resource usage, and custom application metrics.",
69
+ "HTTP request rate, latency, error rate, CPU utilization gauge, memory usage, disk and network I/O, and runtime metrics.",
68
70
  icon: IconProp.ChartBar,
69
71
  },
70
- {
71
- type: DashboardTemplateType.Trace,
72
- name: "Trace Dashboard",
73
- description:
74
- "Span throughput, latency percentiles, error rates, service health, status breakdown, and recent traces.",
75
- icon: IconProp.Activity,
76
- },
77
- {
78
- type: DashboardTemplateType.Exception,
79
- name: "Exception Dashboard",
80
- description:
81
- "Exception counts, error rates, top exception types, resolution status, affected services, and logs.",
82
- icon: IconProp.Bug,
83
- },
84
- {
85
- type: DashboardTemplateType.Profiles,
86
- name: "Profiles Dashboard",
87
- description:
88
- "CPU profiles, memory allocations, heap usage, thread counts, top functions by CPU time, and flamegraph data.",
89
- icon: IconProp.Fire,
90
- },
91
72
  ];
92
73
 
93
74
  // -- Metric query config helpers --
@@ -330,27 +311,56 @@ function createTableComponent(data: {
330
311
  };
331
312
  }
332
313
 
333
- function createTraceListComponent(data: {
314
+ function createKubernetesPodListComponent(data: {
334
315
  title: string;
335
316
  top: number;
336
317
  left: number;
337
318
  width: number;
338
319
  height: number;
339
320
  maxRows?: number;
321
+ podPhases?: Array<string>;
340
322
  }): DashboardBaseComponent {
341
323
  return {
342
324
  _type: ObjectType.DashboardComponent,
343
- componentType: DashboardComponentType.TraceList,
325
+ componentType: DashboardComponentType.KubernetesPodList,
344
326
  componentId: ObjectID.generate(),
345
327
  topInDashboardUnits: data.top,
346
328
  leftInDashboardUnits: data.left,
347
329
  widthInDashboardUnits: data.width,
348
330
  heightInDashboardUnits: data.height,
349
331
  minHeightInDashboardUnits: 3,
350
- minWidthInDashboardUnits: 6,
332
+ minWidthInDashboardUnits: 4,
333
+ arguments: {
334
+ title: data.title,
335
+ maxRows: data.maxRows ?? 20,
336
+ podPhases: data.podPhases,
337
+ },
338
+ };
339
+ }
340
+
341
+ function createKubernetesNodeListComponent(data: {
342
+ title: string;
343
+ top: number;
344
+ left: number;
345
+ width: number;
346
+ height: number;
347
+ maxRows?: number;
348
+ readinessFilter?: string;
349
+ }): DashboardBaseComponent {
350
+ return {
351
+ _type: ObjectType.DashboardComponent,
352
+ componentType: DashboardComponentType.KubernetesNodeList,
353
+ componentId: ObjectID.generate(),
354
+ topInDashboardUnits: data.top,
355
+ leftInDashboardUnits: data.left,
356
+ widthInDashboardUnits: data.width,
357
+ heightInDashboardUnits: data.height,
358
+ minHeightInDashboardUnits: 3,
359
+ minWidthInDashboardUnits: 4,
351
360
  arguments: {
352
361
  title: data.title,
353
362
  maxRows: data.maxRows ?? 20,
363
+ readinessFilter: data.readinessFilter,
354
364
  },
355
365
  };
356
366
  }
@@ -381,19 +391,32 @@ function createMonitorDashboardConfig(): DashboardViewConfig {
381
391
  legendUnit: "ms",
382
392
  },
383
393
  }),
394
+ /*
395
+ * IsOnline is emitted as 0/1 with unit "" by MonitorMetricUtil, so
396
+ * `Avg` gives the uptime ratio in [0, 1] rather than a percent. We
397
+ * label the widget "Uptime (avg)" instead of "%" so the fractional
398
+ * display isn't misleading; flipping the storage to 0/100 + unit
399
+ * "%" would change criteria evaluation elsewhere in the codebase.
400
+ */
384
401
  createValueComponent({
385
- title: "Uptime %",
402
+ title: "Uptime (avg)",
386
403
  top: 1,
387
404
  left: 3,
388
405
  width: 3,
389
406
  metricConfig: {
390
407
  metricName: MonitorMetricType.IsOnline,
391
408
  aggregationType: MetricsAggregationType.Avg,
392
- legendUnit: "%",
393
409
  },
394
410
  }),
411
+ /*
412
+ * ResponseStatusCode is the literal HTTP status code (200, 404,
413
+ * 503, …). `Count` over it returns the total number of checks the
414
+ * monitor ran, not the error rate — the original "Error Rate" label
415
+ * was misleading. Filtering to status >= 400 would require attribute
416
+ * filters that the template helper doesn't expose, so we relabel.
417
+ */
395
418
  createValueComponent({
396
- title: "Error Rate",
419
+ title: "Total Checks",
397
420
  top: 1,
398
421
  left: 6,
399
422
  width: 3,
@@ -439,8 +462,7 @@ function createMonitorDashboardConfig(): DashboardViewConfig {
439
462
  metricConfig: {
440
463
  metricName: MonitorMetricType.IsOnline,
441
464
  aggregationType: MetricsAggregationType.Avg,
442
- legend: "Online Status",
443
- legendUnit: "%",
465
+ legend: "Uptime Ratio",
444
466
  },
445
467
  }),
446
468
 
@@ -538,6 +560,21 @@ function createMonitorDashboardConfig(): DashboardViewConfig {
538
560
  }
539
561
 
540
562
  function createIncidentDashboardConfig(): DashboardViewConfig {
563
+ /*
564
+ * Incident metrics (TimeToResolve, TimeToAcknowledge, IncidentDuration,
565
+ * TimeInState, PostmortemCompletionTime) are emitted with unit
566
+ * "seconds" by IncidentService. Templates previously passed
567
+ * `legendUnit: "min"` to relabel the chart legend, but that bypassed
568
+ * ValueFormatter's scale-aware formatting and rendered raw seconds
569
+ * with a "Minutes" suffix (e.g. a 1-hour incident showed as
570
+ * "3600 Minutes"). Gauges were authored against an implicit minute
571
+ * scale (maxValue 120, threshold 60/90) and compared bytes-of-seconds
572
+ * against minutes, so any incident over ~2 minutes pinned the gauge.
573
+ *
574
+ * We now drop the legendUnit overrides — ValueFormatter scales
575
+ * `seconds` to sec/min/hr/days based on magnitude — and reauthor the
576
+ * gauge ranges in seconds so the 0-100% sweep is meaningful.
577
+ */
541
578
  const components: Array<DashboardBaseComponent> = [
542
579
  // Row 0: Title
543
580
  createTextComponent({
@@ -568,7 +605,6 @@ function createIncidentDashboardConfig(): DashboardViewConfig {
568
605
  metricConfig: {
569
606
  metricName: IncidentMetricType.TimeToResolve,
570
607
  aggregationType: MetricsAggregationType.Avg,
571
- legendUnit: "min",
572
608
  },
573
609
  }),
574
610
  createValueComponent({
@@ -579,7 +615,6 @@ function createIncidentDashboardConfig(): DashboardViewConfig {
579
615
  metricConfig: {
580
616
  metricName: IncidentMetricType.TimeToAcknowledge,
581
617
  aggregationType: MetricsAggregationType.Avg,
582
- legendUnit: "min",
583
618
  },
584
619
  }),
585
620
  createValueComponent({
@@ -590,7 +625,6 @@ function createIncidentDashboardConfig(): DashboardViewConfig {
590
625
  metricConfig: {
591
626
  metricName: IncidentMetricType.IncidentDuration,
592
627
  aggregationType: MetricsAggregationType.Avg,
593
- legendUnit: "min",
594
628
  },
595
629
  }),
596
630
 
@@ -619,7 +653,6 @@ function createIncidentDashboardConfig(): DashboardViewConfig {
619
653
  metricName: IncidentMetricType.IncidentDuration,
620
654
  aggregationType: MetricsAggregationType.Avg,
621
655
  legend: "Avg Duration",
622
- legendUnit: "min",
623
656
  },
624
657
  }),
625
658
 
@@ -633,32 +666,37 @@ function createIncidentDashboardConfig(): DashboardViewConfig {
633
666
  isBold: true,
634
667
  }),
635
668
 
636
- // Row 6-8: Gauges for MTTR/MTTA and resolution chart
669
+ /*
670
+ * Row 6-8: MTTR/MTTA gauges. Ranges and thresholds are now in
671
+ * seconds (matching the stored metric unit). Targets: MTTR full
672
+ * scale 2 hours (warn at 1 hour, critical at 1.5 hours); MTTA full
673
+ * scale 1 hour (warn at 15 min, critical at 30 min).
674
+ */
637
675
  createGaugeComponent({
638
- title: "MTTR (minutes)",
676
+ title: "MTTR",
639
677
  top: 6,
640
678
  left: 0,
641
679
  width: 3,
642
680
  height: 3,
643
681
  minValue: 0,
644
- maxValue: 120,
645
- warningThreshold: 60,
646
- criticalThreshold: 90,
682
+ maxValue: 7200,
683
+ warningThreshold: 3600,
684
+ criticalThreshold: 5400,
647
685
  metricConfig: {
648
686
  metricName: IncidentMetricType.TimeToResolve,
649
687
  aggregationType: MetricsAggregationType.Avg,
650
688
  },
651
689
  }),
652
690
  createGaugeComponent({
653
- title: "MTTA (minutes)",
691
+ title: "MTTA",
654
692
  top: 6,
655
693
  left: 3,
656
694
  width: 3,
657
695
  height: 3,
658
696
  minValue: 0,
659
- maxValue: 60,
660
- warningThreshold: 15,
661
- criticalThreshold: 30,
697
+ maxValue: 3600,
698
+ warningThreshold: 900,
699
+ criticalThreshold: 1800,
662
700
  metricConfig: {
663
701
  metricName: IncidentMetricType.TimeToAcknowledge,
664
702
  aggregationType: MetricsAggregationType.Avg,
@@ -675,7 +713,6 @@ function createIncidentDashboardConfig(): DashboardViewConfig {
675
713
  metricName: IncidentMetricType.TimeToResolve,
676
714
  aggregationType: MetricsAggregationType.Avg,
677
715
  legend: "MTTR",
678
- legendUnit: "min",
679
716
  },
680
717
  }),
681
718
 
@@ -714,7 +751,6 @@ function createIncidentDashboardConfig(): DashboardViewConfig {
714
751
  metricName: IncidentMetricType.TimeInState,
715
752
  aggregationType: MetricsAggregationType.Avg,
716
753
  legend: "Time in State",
717
- legendUnit: "min",
718
754
  },
719
755
  }),
720
756
 
@@ -728,7 +764,13 @@ function createIncidentDashboardConfig(): DashboardViewConfig {
728
764
  isBold: true,
729
765
  }),
730
766
 
731
- // Row 14-16: Tables
767
+ /*
768
+ * Row 14-16: Operational tables. Logs / traces were removed from the
769
+ * Incident template because incident records are not log/trace
770
+ * sources — they're rows in Postgres. Surfacing unrelated cluster
771
+ * logs and trace lists alongside MTTR/MTTA was a UX miss; if a user
772
+ * wants those views they live on dedicated Trace / Log pages.
773
+ */
732
774
  createTableComponent({
733
775
  title: "Incidents by Duration",
734
776
  top: 14,
@@ -751,32 +793,42 @@ function createIncidentDashboardConfig(): DashboardViewConfig {
751
793
  aggregationType: MetricsAggregationType.Avg,
752
794
  },
753
795
  }),
754
-
755
- // Row 17-19: Logs and traces
756
- createLogStreamComponent({
757
- title: "Recent Incident Logs",
758
- top: 17,
759
- left: 0,
760
- width: 6,
761
- height: 3,
762
- }),
763
- createTraceListComponent({
764
- title: "Recent Traces",
765
- top: 17,
766
- left: 6,
767
- width: 6,
768
- height: 3,
769
- }),
770
796
  ];
771
797
 
772
798
  return {
773
799
  _type: ObjectType.DashboardViewConfig,
774
800
  components,
775
- heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 20),
801
+ heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 17),
776
802
  };
777
803
  }
778
804
 
779
805
  function createKubernetesDashboardConfig(): DashboardViewConfig {
806
+ /*
807
+ * Layout notes:
808
+ *
809
+ * - "Pod Count" / "Node Ready" used to be Value widgets over k8s.pod.phase
810
+ * / k8s.node.condition_ready with `Sum` aggregation. Those metrics are
811
+ * per-resource gauges that re-emit `1` on every scrape, so summing
812
+ * across the dashboard window multiplied (pods * scrapes) and produced
813
+ * numbers in the hundreds for tiny clusters. The user-visible fix is
814
+ * to use the dedicated KubernetesPodList / KubernetesNodeList widgets
815
+ * below — they read the per-cluster snapshot in Postgres and show
816
+ * accurate counts in the widget header plus a live list of rows.
817
+ *
818
+ * - "Memory Utilization" used to be a 0-100 gauge over k8s.node.memory.usage,
819
+ * which is reported in bytes. A node with 8 GB of RAM produced a value
820
+ * in the 10^9 range against a 0-100 scale, so the gauge always pinned
821
+ * at the critical end with a meaningless absolute number. Without a
822
+ * first-class percent metric we replace it with a Value widget that
823
+ * renders the absolute usage via ValueFormatter (e.g. "8.3 GB").
824
+ *
825
+ * - CPU widgets use OTel's k8s.*.cpu.utilization, which the collector
826
+ * emits as a [0, 1] ratio with unit "1". DashboardValueComponent /
827
+ * DashboardGaugeComponent now scale that to a percent at render time
828
+ * when the metric name carries the `.utilization` suffix, so "0.05"
829
+ * reads as "5.00%" and gauge thresholds in the natural 0-100 scale work
830
+ * as expected.
831
+ */
780
832
  const components: Array<DashboardBaseComponent> = [
781
833
  // Row 0: Title
782
834
  createTextComponent({
@@ -788,47 +840,48 @@ function createKubernetesDashboardConfig(): DashboardViewConfig {
788
840
  isBold: true,
789
841
  }),
790
842
 
791
- // Row 1: Key cluster metrics
843
+ /*
844
+ * Row 1: Key cluster metrics — averages render with proper units via
845
+ * ValueFormatter (CPU utilization → "%", memory.usage → "MB"/"GB").
846
+ */
792
847
  createValueComponent({
793
- title: "CPU Usage",
848
+ title: "Pod CPU (avg)",
794
849
  top: 1,
795
850
  left: 0,
796
851
  width: 3,
797
852
  metricConfig: {
798
853
  metricName: "k8s.pod.cpu.utilization",
799
854
  aggregationType: MetricsAggregationType.Avg,
800
- legendUnit: "%",
801
855
  },
802
856
  }),
803
857
  createValueComponent({
804
- title: "Memory Usage",
858
+ title: "Pod Memory (avg)",
805
859
  top: 1,
806
860
  left: 3,
807
861
  width: 3,
808
862
  metricConfig: {
809
863
  metricName: "k8s.pod.memory.usage",
810
864
  aggregationType: MetricsAggregationType.Avg,
811
- legendUnit: "bytes",
812
865
  },
813
866
  }),
814
867
  createValueComponent({
815
- title: "Pod Count",
868
+ title: "Node CPU (avg)",
816
869
  top: 1,
817
870
  left: 6,
818
871
  width: 3,
819
872
  metricConfig: {
820
- metricName: "k8s.pod.phase",
821
- aggregationType: MetricsAggregationType.Sum,
873
+ metricName: "k8s.node.cpu.utilization",
874
+ aggregationType: MetricsAggregationType.Avg,
822
875
  },
823
876
  }),
824
877
  createValueComponent({
825
- title: "Node Ready",
878
+ title: "Node Memory (avg)",
826
879
  top: 1,
827
880
  left: 9,
828
881
  width: 3,
829
882
  metricConfig: {
830
- metricName: "k8s.node.condition_ready",
831
- aggregationType: MetricsAggregationType.Sum,
883
+ metricName: "k8s.node.memory.usage",
884
+ aggregationType: MetricsAggregationType.Avg,
832
885
  },
833
886
  }),
834
887
 
@@ -844,7 +897,6 @@ function createKubernetesDashboardConfig(): DashboardViewConfig {
844
897
  metricName: "k8s.pod.cpu.utilization",
845
898
  aggregationType: MetricsAggregationType.Avg,
846
899
  legend: "CPU Utilization",
847
- legendUnit: "%",
848
900
  },
849
901
  }),
850
902
  createChartComponent({
@@ -858,13 +910,12 @@ function createKubernetesDashboardConfig(): DashboardViewConfig {
858
910
  metricName: "k8s.pod.memory.usage",
859
911
  aggregationType: MetricsAggregationType.Avg,
860
912
  legend: "Memory Usage",
861
- legendUnit: "bytes",
862
913
  },
863
914
  }),
864
915
 
865
916
  // Row 5: Section header
866
917
  createTextComponent({
867
- text: "Resource Health",
918
+ text: "Cluster Resources",
868
919
  top: 5,
869
920
  left: 0,
870
921
  width: 12,
@@ -872,81 +923,88 @@ function createKubernetesDashboardConfig(): DashboardViewConfig {
872
923
  isBold: true,
873
924
  }),
874
925
 
875
- // Row 6-8: Gauges and pod chart
876
- createGaugeComponent({
877
- title: "CPU Utilization",
926
+ /*
927
+ * Row 6-9: Pod and node lists query the Postgres snapshot, so the
928
+ * header shows the true current count and the body shows live rows
929
+ * (replacing the broken Sum-of-gauge Value widgets).
930
+ */
931
+ createKubernetesPodListComponent({
932
+ title: "Pods",
878
933
  top: 6,
879
934
  left: 0,
880
- width: 3,
881
- height: 3,
882
- minValue: 0,
883
- maxValue: 100,
884
- warningThreshold: 70,
885
- criticalThreshold: 90,
886
- metricConfig: {
887
- metricName: "k8s.node.cpu.utilization",
888
- aggregationType: MetricsAggregationType.Avg,
889
- },
935
+ width: 6,
936
+ height: 4,
937
+ maxRows: 25,
890
938
  }),
891
- createGaugeComponent({
892
- title: "Memory Utilization",
939
+ createKubernetesNodeListComponent({
940
+ title: "Nodes",
893
941
  top: 6,
894
- left: 3,
895
- width: 3,
942
+ left: 6,
943
+ width: 6,
944
+ height: 4,
945
+ maxRows: 25,
946
+ }),
947
+
948
+ // Row 10: Section header
949
+ createTextComponent({
950
+ text: "Resource Health",
951
+ top: 10,
952
+ left: 0,
953
+ width: 12,
954
+ height: 1,
955
+ isBold: true,
956
+ }),
957
+
958
+ /*
959
+ * Row 11-13: CPU gauge (auto-scaled from [0,1] to percent), and the
960
+ * network throughput chart. The old "Memory Utilization" gauge over
961
+ * raw bytes is gone — see top-of-function comment.
962
+ */
963
+ createGaugeComponent({
964
+ title: "Cluster CPU Utilization",
965
+ top: 11,
966
+ left: 0,
967
+ width: 4,
896
968
  height: 3,
897
969
  minValue: 0,
898
970
  maxValue: 100,
899
971
  warningThreshold: 70,
900
972
  criticalThreshold: 90,
901
973
  metricConfig: {
902
- metricName: "k8s.node.memory.usage",
974
+ metricName: "k8s.node.cpu.utilization",
903
975
  aggregationType: MetricsAggregationType.Avg,
904
976
  },
905
977
  }),
906
978
  createChartComponent({
907
- title: "Pod Count Over Time",
908
- chartType: DashboardChartType.StackedArea,
909
- top: 6,
910
- left: 6,
911
- width: 6,
979
+ title: "Network I/O",
980
+ chartType: DashboardChartType.Area,
981
+ top: 11,
982
+ left: 4,
983
+ width: 8,
912
984
  height: 3,
913
985
  metricConfig: {
914
- metricName: "k8s.pod.phase",
986
+ metricName: "k8s.pod.network.io",
915
987
  aggregationType: MetricsAggregationType.Sum,
916
- legend: "Pods",
988
+ legend: "Network I/O",
917
989
  },
918
990
  }),
919
991
 
920
- // Row 9: Section header
992
+ // Row 14: Section header
921
993
  createTextComponent({
922
- text: "Workload Details",
923
- top: 9,
994
+ text: "Workload Activity",
995
+ top: 14,
924
996
  left: 0,
925
997
  width: 12,
926
998
  height: 1,
927
999
  isBold: true,
928
1000
  }),
929
1001
 
930
- // Row 10-12: Network, restarts
931
- createChartComponent({
932
- title: "Network I/O",
933
- chartType: DashboardChartType.Area,
934
- top: 10,
935
- left: 0,
936
- width: 6,
937
- height: 3,
938
- metricConfig: {
939
- metricName: "k8s.pod.network.io",
940
- aggregationType: MetricsAggregationType.Sum,
941
- legend: "Network I/O",
942
- legendUnit: "bytes",
943
- },
944
- }),
1002
+ // Row 15-17: Restarts and replicas
945
1003
  createChartComponent({
946
1004
  title: "Container Restarts Over Time",
947
1005
  chartType: DashboardChartType.Bar,
948
- top: 10,
949
- left: 6,
1006
+ top: 15,
1007
+ left: 0,
950
1008
  width: 6,
951
1009
  height: 3,
952
1010
  metricConfig: {
@@ -955,12 +1013,10 @@ function createKubernetesDashboardConfig(): DashboardViewConfig {
955
1013
  legend: "Restarts",
956
1014
  },
957
1015
  }),
958
-
959
- // Row 13-15: Table and logs
960
1016
  createTableComponent({
961
1017
  title: "Deployment Replicas",
962
- top: 13,
963
- left: 0,
1018
+ top: 15,
1019
+ left: 6,
964
1020
  width: 6,
965
1021
  height: 3,
966
1022
  metricConfig: {
@@ -968,11 +1024,13 @@ function createKubernetesDashboardConfig(): DashboardViewConfig {
968
1024
  aggregationType: MetricsAggregationType.Min,
969
1025
  },
970
1026
  }),
1027
+
1028
+ // Row 18-20: Logs
971
1029
  createLogStreamComponent({
972
1030
  title: "Cluster Logs",
973
- top: 13,
974
- left: 6,
975
- width: 6,
1031
+ top: 18,
1032
+ left: 0,
1033
+ width: 12,
976
1034
  height: 3,
977
1035
  }),
978
1036
  ];
@@ -980,11 +1038,32 @@ function createKubernetesDashboardConfig(): DashboardViewConfig {
980
1038
  return {
981
1039
  _type: ObjectType.DashboardViewConfig,
982
1040
  components,
983
- heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 16),
1041
+ heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 21),
984
1042
  };
985
1043
  }
986
1044
 
987
1045
  function createMetricsDashboardConfig(): DashboardViewConfig {
1046
+ /*
1047
+ * Layout notes:
1048
+ *
1049
+ * - `system.cpu.utilization` and `process.cpu.utilization` are OTel
1050
+ * ratio metrics with unit "1" reported in [0, 1]. DashboardValueComponent
1051
+ * / DashboardGaugeComponent scale these to a percent at render time
1052
+ * (see splitFormattedValue / isFractionScale), so the 0-100 gauge sweep
1053
+ * and the percent display work without any special template config.
1054
+ *
1055
+ * - `system.memory.usage` is reported in bytes. A previous "Memory Usage"
1056
+ * gauge compared bytes (10⁹ range) against a 0-100 sweep and pinned
1057
+ * critical for any sane workload. We swapped it for a Value widget that
1058
+ * renders the absolute usage via ValueFormatter (e.g. "8.3 GB"), since
1059
+ * there is no first-class memory-utilization percent metric in OTel's
1060
+ * default system instrumentation.
1061
+ *
1062
+ * - We also dropped explicit `legendUnit: "bytes"/"%"/"ms"` overrides
1063
+ * where they duplicated the stored MetricType unit — ValueFormatter
1064
+ * already auto-scales bytes/seconds/ms and renders ratio metrics as
1065
+ * percent. Keeping overrides only when they add useful aliasing.
1066
+ */
988
1067
  const components: Array<DashboardBaseComponent> = [
989
1068
  // Row 0: Title
990
1069
  createTextComponent({
@@ -1121,7 +1200,12 @@ function createMetricsDashboardConfig(): DashboardViewConfig {
1121
1200
  isBold: true,
1122
1201
  }),
1123
1202
 
1124
- // Row 10-12: System resource gauges and charts
1203
+ /*
1204
+ * Row 10-12: System resource health. CPU has a percent gauge (auto-
1205
+ * scaled from [0, 1] ratio at render time); Memory has a Value widget
1206
+ * since `system.memory.usage` is bytes (auto-formatted to MB/GB) and
1207
+ * we don't have a first-class memory-utilization percent metric.
1208
+ */
1125
1209
  createGaugeComponent({
1126
1210
  title: "CPU Utilization",
1127
1211
  top: 10,
@@ -1137,16 +1221,11 @@ function createMetricsDashboardConfig(): DashboardViewConfig {
1137
1221
  aggregationType: MetricsAggregationType.Avg,
1138
1222
  },
1139
1223
  }),
1140
- createGaugeComponent({
1224
+ createValueComponent({
1141
1225
  title: "Memory Usage",
1142
1226
  top: 10,
1143
1227
  left: 3,
1144
1228
  width: 3,
1145
- height: 3,
1146
- minValue: 0,
1147
- maxValue: 100,
1148
- warningThreshold: 70,
1149
- criticalThreshold: 90,
1150
1229
  metricConfig: {
1151
1230
  metricName: MetricDashboardMetricType.SystemMemoryUsage,
1152
1231
  aggregationType: MetricsAggregationType.Avg,
@@ -1162,8 +1241,7 @@ function createMetricsDashboardConfig(): DashboardViewConfig {
1162
1241
  metricConfig: {
1163
1242
  metricName: MetricDashboardMetricType.SystemCpuUtilization,
1164
1243
  aggregationType: MetricsAggregationType.Avg,
1165
- legend: "CPU %",
1166
- legendUnit: "%",
1244
+ legend: "CPU",
1167
1245
  },
1168
1246
  }),
1169
1247
 
@@ -1275,820 +1353,6 @@ function createMetricsDashboardConfig(): DashboardViewConfig {
1275
1353
  };
1276
1354
  }
1277
1355
 
1278
- function createTraceDashboardConfig(): DashboardViewConfig {
1279
- const components: Array<DashboardBaseComponent> = [
1280
- // Row 0: Title
1281
- createTextComponent({
1282
- text: "Trace Dashboard",
1283
- top: 0,
1284
- left: 0,
1285
- width: 12,
1286
- height: 1,
1287
- isBold: true,
1288
- }),
1289
-
1290
- // Row 1: Key trace metrics
1291
- createValueComponent({
1292
- title: "Span Count",
1293
- top: 1,
1294
- left: 0,
1295
- width: 3,
1296
- metricConfig: {
1297
- metricName: SpanMetricType.SpanCount,
1298
- aggregationType: MetricsAggregationType.Sum,
1299
- },
1300
- }),
1301
- createValueComponent({
1302
- title: "Avg Duration",
1303
- top: 1,
1304
- left: 3,
1305
- width: 3,
1306
- metricConfig: {
1307
- metricName: SpanMetricType.SpanDuration,
1308
- aggregationType: MetricsAggregationType.Avg,
1309
- legendUnit: "ms",
1310
- },
1311
- }),
1312
- createValueComponent({
1313
- title: "Error Rate",
1314
- top: 1,
1315
- left: 6,
1316
- width: 3,
1317
- metricConfig: {
1318
- metricName: SpanMetricType.SpanErrorRate,
1319
- aggregationType: MetricsAggregationType.Avg,
1320
- legendUnit: "%",
1321
- },
1322
- }),
1323
- createValueComponent({
1324
- title: "Throughput",
1325
- top: 1,
1326
- left: 9,
1327
- width: 3,
1328
- metricConfig: {
1329
- metricName: SpanMetricType.SpanThroughput,
1330
- aggregationType: MetricsAggregationType.Sum,
1331
- legendUnit: "req/s",
1332
- },
1333
- }),
1334
-
1335
- // Row 2-4: Throughput and duration charts
1336
- createChartComponent({
1337
- title: "Span Throughput Over Time",
1338
- chartType: DashboardChartType.Bar,
1339
- top: 2,
1340
- left: 0,
1341
- width: 6,
1342
- height: 3,
1343
- metricConfig: {
1344
- metricName: SpanMetricType.SpanCount,
1345
- aggregationType: MetricsAggregationType.Sum,
1346
- legend: "Spans",
1347
- },
1348
- }),
1349
- createChartComponent({
1350
- title: "Avg Span Duration Over Time",
1351
- chartType: DashboardChartType.Line,
1352
- top: 2,
1353
- left: 6,
1354
- width: 6,
1355
- height: 3,
1356
- metricConfig: {
1357
- metricName: SpanMetricType.SpanDuration,
1358
- aggregationType: MetricsAggregationType.Avg,
1359
- legend: "Avg Duration",
1360
- legendUnit: "ms",
1361
- },
1362
- }),
1363
-
1364
- // Row 5: Section header
1365
- createTextComponent({
1366
- text: "Latency Percentiles",
1367
- top: 5,
1368
- left: 0,
1369
- width: 12,
1370
- height: 1,
1371
- isBold: true,
1372
- }),
1373
-
1374
- // Row 6: Latency percentile values
1375
- createValueComponent({
1376
- title: "P50 Latency",
1377
- top: 6,
1378
- left: 0,
1379
- width: 3,
1380
- metricConfig: {
1381
- metricName: SpanMetricType.SpanP50Duration,
1382
- aggregationType: MetricsAggregationType.Avg,
1383
- legendUnit: "ms",
1384
- },
1385
- }),
1386
- createValueComponent({
1387
- title: "P90 Latency",
1388
- top: 6,
1389
- left: 3,
1390
- width: 3,
1391
- metricConfig: {
1392
- metricName: SpanMetricType.SpanP90Duration,
1393
- aggregationType: MetricsAggregationType.Avg,
1394
- legendUnit: "ms",
1395
- },
1396
- }),
1397
- createValueComponent({
1398
- title: "P95 Latency",
1399
- top: 6,
1400
- left: 6,
1401
- width: 3,
1402
- metricConfig: {
1403
- metricName: SpanMetricType.SpanP95Duration,
1404
- aggregationType: MetricsAggregationType.Avg,
1405
- legendUnit: "ms",
1406
- },
1407
- }),
1408
- createValueComponent({
1409
- title: "P99 Latency",
1410
- top: 6,
1411
- left: 9,
1412
- width: 3,
1413
- metricConfig: {
1414
- metricName: SpanMetricType.SpanP99Duration,
1415
- aggregationType: MetricsAggregationType.Avg,
1416
- legendUnit: "ms",
1417
- },
1418
- }),
1419
-
1420
- // Row 7-9: Latency percentile charts
1421
- createChartComponent({
1422
- title: "Latency Percentiles Over Time",
1423
- chartType: DashboardChartType.Line,
1424
- top: 7,
1425
- left: 0,
1426
- width: 6,
1427
- height: 3,
1428
- metricConfig: {
1429
- metricName: SpanMetricType.SpanP95Duration,
1430
- aggregationType: MetricsAggregationType.Avg,
1431
- legend: "P95 Latency",
1432
- legendUnit: "ms",
1433
- },
1434
- }),
1435
- createChartComponent({
1436
- title: "Latency Distribution",
1437
- chartType: DashboardChartType.Histogram,
1438
- top: 7,
1439
- left: 6,
1440
- width: 6,
1441
- height: 3,
1442
- metricConfig: {
1443
- metricName: SpanMetricType.SpanDuration,
1444
- aggregationType: MetricsAggregationType.Count,
1445
- legend: "Latency Distribution",
1446
- legendUnit: "ms",
1447
- },
1448
- }),
1449
-
1450
- // Row 10: Section header
1451
- createTextComponent({
1452
- text: "Error Analysis",
1453
- top: 10,
1454
- left: 0,
1455
- width: 12,
1456
- height: 1,
1457
- isBold: true,
1458
- }),
1459
-
1460
- // Row 11-13: Error charts and status breakdown
1461
- createGaugeComponent({
1462
- title: "Error Rate",
1463
- top: 11,
1464
- left: 0,
1465
- width: 3,
1466
- height: 3,
1467
- minValue: 0,
1468
- maxValue: 100,
1469
- warningThreshold: 5,
1470
- criticalThreshold: 15,
1471
- metricConfig: {
1472
- metricName: SpanMetricType.SpanErrorRate,
1473
- aggregationType: MetricsAggregationType.Avg,
1474
- },
1475
- }),
1476
- createChartComponent({
1477
- title: "Errors Over Time",
1478
- chartType: DashboardChartType.Area,
1479
- top: 11,
1480
- left: 3,
1481
- width: 6,
1482
- height: 3,
1483
- metricConfig: {
1484
- metricName: SpanMetricType.SpanErrorCount,
1485
- aggregationType: MetricsAggregationType.Sum,
1486
- legend: "Errors",
1487
- },
1488
- }),
1489
- createChartComponent({
1490
- title: "Span Status Breakdown",
1491
- chartType: DashboardChartType.Pie,
1492
- top: 11,
1493
- left: 9,
1494
- width: 3,
1495
- height: 3,
1496
- metricConfig: {
1497
- metricName: SpanMetricType.SpanStatusOk,
1498
- aggregationType: MetricsAggregationType.Count,
1499
- legend: "Status",
1500
- },
1501
- }),
1502
-
1503
- // Row 14: Section header
1504
- createTextComponent({
1505
- text: "Trace Details",
1506
- top: 14,
1507
- left: 0,
1508
- width: 12,
1509
- height: 1,
1510
- isBold: true,
1511
- }),
1512
-
1513
- // Row 15-17: Table of slowest spans and request rate
1514
- createTableComponent({
1515
- title: "Slowest Spans",
1516
- top: 15,
1517
- left: 0,
1518
- width: 6,
1519
- height: 3,
1520
- metricConfig: {
1521
- metricName: SpanMetricType.SpanDuration,
1522
- aggregationType: MetricsAggregationType.Max,
1523
- },
1524
- }),
1525
- createChartComponent({
1526
- title: "Request Rate Over Time",
1527
- chartType: DashboardChartType.StackedArea,
1528
- top: 15,
1529
- left: 6,
1530
- width: 6,
1531
- height: 3,
1532
- metricConfig: {
1533
- metricName: SpanMetricType.SpanRequestRate,
1534
- aggregationType: MetricsAggregationType.Sum,
1535
- legend: "Request Rate",
1536
- legendUnit: "req/s",
1537
- },
1538
- }),
1539
-
1540
- // Row 18-20: Recent traces and logs
1541
- createTraceListComponent({
1542
- title: "Recent Traces",
1543
- top: 18,
1544
- left: 0,
1545
- width: 6,
1546
- height: 3,
1547
- }),
1548
- createLogStreamComponent({
1549
- title: "Related Logs",
1550
- top: 18,
1551
- left: 6,
1552
- width: 6,
1553
- height: 3,
1554
- }),
1555
- ];
1556
-
1557
- return {
1558
- _type: ObjectType.DashboardViewConfig,
1559
- components,
1560
- heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 21),
1561
- };
1562
- }
1563
-
1564
- function createExceptionDashboardConfig(): DashboardViewConfig {
1565
- const components: Array<DashboardBaseComponent> = [
1566
- // Row 0: Title
1567
- createTextComponent({
1568
- text: "Exception Dashboard",
1569
- top: 0,
1570
- left: 0,
1571
- width: 12,
1572
- height: 1,
1573
- isBold: true,
1574
- }),
1575
-
1576
- // Row 1: Key exception metrics
1577
- createValueComponent({
1578
- title: "Total Exceptions",
1579
- top: 1,
1580
- left: 0,
1581
- width: 3,
1582
- metricConfig: {
1583
- metricName: ExceptionMetricType.ExceptionCount,
1584
- aggregationType: MetricsAggregationType.Sum,
1585
- },
1586
- }),
1587
- createValueComponent({
1588
- title: "Exception Rate",
1589
- top: 1,
1590
- left: 3,
1591
- width: 3,
1592
- metricConfig: {
1593
- metricName: ExceptionMetricType.ExceptionRate,
1594
- aggregationType: MetricsAggregationType.Avg,
1595
- legendUnit: "/min",
1596
- },
1597
- }),
1598
- createValueComponent({
1599
- title: "Unresolved",
1600
- top: 1,
1601
- left: 6,
1602
- width: 3,
1603
- metricConfig: {
1604
- metricName: ExceptionMetricType.UnresolvedExceptionCount,
1605
- aggregationType: MetricsAggregationType.Sum,
1606
- },
1607
- }),
1608
- createValueComponent({
1609
- title: "Affected Services",
1610
- top: 1,
1611
- left: 9,
1612
- width: 3,
1613
- metricConfig: {
1614
- metricName: ExceptionMetricType.ExceptionAffectedServiceCount,
1615
- aggregationType: MetricsAggregationType.Sum,
1616
- },
1617
- }),
1618
-
1619
- // Row 2-4: Exception trends
1620
- createChartComponent({
1621
- title: "Exceptions Over Time",
1622
- chartType: DashboardChartType.Bar,
1623
- top: 2,
1624
- left: 0,
1625
- width: 6,
1626
- height: 3,
1627
- metricConfig: {
1628
- metricName: ExceptionMetricType.ExceptionCount,
1629
- aggregationType: MetricsAggregationType.Sum,
1630
- legend: "Exceptions",
1631
- },
1632
- }),
1633
- createChartComponent({
1634
- title: "Exception Rate Over Time",
1635
- chartType: DashboardChartType.Line,
1636
- top: 2,
1637
- left: 6,
1638
- width: 6,
1639
- height: 3,
1640
- metricConfig: {
1641
- metricName: ExceptionMetricType.ExceptionRate,
1642
- aggregationType: MetricsAggregationType.Avg,
1643
- legend: "Exception Rate",
1644
- legendUnit: "/min",
1645
- },
1646
- }),
1647
-
1648
- // Row 5: Section header
1649
- createTextComponent({
1650
- text: "Exception Breakdown",
1651
- top: 5,
1652
- left: 0,
1653
- width: 12,
1654
- height: 1,
1655
- isBold: true,
1656
- }),
1657
-
1658
- // Row 6-8: Exception type and service breakdown
1659
- createChartComponent({
1660
- title: "Exceptions by Type",
1661
- chartType: DashboardChartType.Pie,
1662
- top: 6,
1663
- left: 0,
1664
- width: 6,
1665
- height: 3,
1666
- metricConfig: {
1667
- metricName: ExceptionMetricType.ExceptionCountByType,
1668
- aggregationType: MetricsAggregationType.Count,
1669
- legend: "Exception Type",
1670
- },
1671
- }),
1672
- createChartComponent({
1673
- title: "Exceptions by Service",
1674
- chartType: DashboardChartType.Bar,
1675
- top: 6,
1676
- left: 6,
1677
- width: 6,
1678
- height: 3,
1679
- metricConfig: {
1680
- metricName: ExceptionMetricType.ExceptionCountByService,
1681
- aggregationType: MetricsAggregationType.Count,
1682
- legend: "Service",
1683
- },
1684
- }),
1685
-
1686
- // Row 9: Section header
1687
- createTextComponent({
1688
- text: "Resolution Status",
1689
- top: 9,
1690
- left: 0,
1691
- width: 12,
1692
- height: 1,
1693
- isBold: true,
1694
- }),
1695
-
1696
- // Row 10-12: Resolution gauges and resolution trends
1697
- createGaugeComponent({
1698
- title: "Unresolved Exceptions",
1699
- top: 10,
1700
- left: 0,
1701
- width: 3,
1702
- height: 3,
1703
- minValue: 0,
1704
- maxValue: 100,
1705
- warningThreshold: 25,
1706
- criticalThreshold: 50,
1707
- metricConfig: {
1708
- metricName: ExceptionMetricType.UnresolvedExceptionCount,
1709
- aggregationType: MetricsAggregationType.Sum,
1710
- },
1711
- }),
1712
- createGaugeComponent({
1713
- title: "Muted Exceptions",
1714
- top: 10,
1715
- left: 3,
1716
- width: 3,
1717
- height: 3,
1718
- minValue: 0,
1719
- maxValue: 100,
1720
- metricConfig: {
1721
- metricName: ExceptionMetricType.MutedExceptionCount,
1722
- aggregationType: MetricsAggregationType.Sum,
1723
- },
1724
- }),
1725
- createChartComponent({
1726
- title: "Resolution Status Over Time",
1727
- chartType: DashboardChartType.StackedArea,
1728
- top: 10,
1729
- left: 6,
1730
- width: 6,
1731
- height: 3,
1732
- metricConfig: {
1733
- metricName: ExceptionMetricType.ResolvedExceptionCount,
1734
- aggregationType: MetricsAggregationType.Sum,
1735
- legend: "Resolved",
1736
- },
1737
- }),
1738
-
1739
- // Row 13: Section header
1740
- createTextComponent({
1741
- text: "Exception Recurrence",
1742
- top: 13,
1743
- left: 0,
1744
- width: 12,
1745
- height: 1,
1746
- isBold: true,
1747
- }),
1748
-
1749
- // Row 14-16: Occurrence trends and top exceptions table
1750
- createChartComponent({
1751
- title: "Exception Occurrences Over Time",
1752
- chartType: DashboardChartType.Heatmap,
1753
- top: 14,
1754
- left: 0,
1755
- width: 6,
1756
- height: 3,
1757
- metricConfig: {
1758
- metricName: ExceptionMetricType.ExceptionOccurrenceCount,
1759
- aggregationType: MetricsAggregationType.Sum,
1760
- legend: "Occurrences",
1761
- },
1762
- }),
1763
- createTableComponent({
1764
- title: "Top Exceptions by Occurrence",
1765
- top: 14,
1766
- left: 6,
1767
- width: 6,
1768
- height: 3,
1769
- metricConfig: {
1770
- metricName: ExceptionMetricType.ExceptionOccurrenceCount,
1771
- aggregationType: MetricsAggregationType.Max,
1772
- },
1773
- }),
1774
-
1775
- // Row 17: Section header
1776
- createTextComponent({
1777
- text: "Exception Details",
1778
- top: 17,
1779
- left: 0,
1780
- width: 12,
1781
- height: 1,
1782
- isBold: true,
1783
- }),
1784
-
1785
- // Row 18-20: Logs and traces
1786
- createLogStreamComponent({
1787
- title: "Exception Logs",
1788
- top: 18,
1789
- left: 0,
1790
- width: 6,
1791
- height: 3,
1792
- }),
1793
- createTraceListComponent({
1794
- title: "Related Traces",
1795
- top: 18,
1796
- left: 6,
1797
- width: 6,
1798
- height: 3,
1799
- }),
1800
- ];
1801
-
1802
- return {
1803
- _type: ObjectType.DashboardViewConfig,
1804
- components,
1805
- heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 21),
1806
- };
1807
- }
1808
-
1809
- function createProfilesDashboardConfig(): DashboardViewConfig {
1810
- const components: Array<DashboardBaseComponent> = [
1811
- // Row 0: Title
1812
- createTextComponent({
1813
- text: "Profiles Dashboard",
1814
- top: 0,
1815
- left: 0,
1816
- width: 12,
1817
- height: 1,
1818
- isBold: true,
1819
- }),
1820
-
1821
- // Row 1: Key profile metrics
1822
- createValueComponent({
1823
- title: "Profile Count",
1824
- top: 1,
1825
- left: 0,
1826
- width: 3,
1827
- metricConfig: {
1828
- metricName: ProfileMetricType.ProfileCount,
1829
- aggregationType: MetricsAggregationType.Sum,
1830
- },
1831
- }),
1832
- createValueComponent({
1833
- title: "CPU Profile Duration",
1834
- top: 1,
1835
- left: 3,
1836
- width: 3,
1837
- metricConfig: {
1838
- metricName: ProfileMetricType.CpuProfileDuration,
1839
- aggregationType: MetricsAggregationType.Sum,
1840
- legendUnit: "ms",
1841
- },
1842
- }),
1843
- createValueComponent({
1844
- title: "Memory Allocations",
1845
- top: 1,
1846
- left: 6,
1847
- width: 3,
1848
- metricConfig: {
1849
- metricName: ProfileMetricType.MemoryAllocationCount,
1850
- aggregationType: MetricsAggregationType.Sum,
1851
- },
1852
- }),
1853
- createValueComponent({
1854
- title: "Thread Count",
1855
- top: 1,
1856
- left: 9,
1857
- width: 3,
1858
- metricConfig: {
1859
- metricName: ProfileMetricType.ThreadCount,
1860
- aggregationType: MetricsAggregationType.Avg,
1861
- },
1862
- }),
1863
-
1864
- // Row 2-4: CPU profile charts
1865
- createChartComponent({
1866
- title: "CPU Profile Duration Over Time",
1867
- chartType: DashboardChartType.Line,
1868
- top: 2,
1869
- left: 0,
1870
- width: 6,
1871
- height: 3,
1872
- metricConfig: {
1873
- metricName: ProfileMetricType.CpuProfileDuration,
1874
- aggregationType: MetricsAggregationType.Avg,
1875
- legend: "CPU Duration",
1876
- legendUnit: "ms",
1877
- },
1878
- }),
1879
- createChartComponent({
1880
- title: "CPU Sample Count Over Time",
1881
- chartType: DashboardChartType.Bar,
1882
- top: 2,
1883
- left: 6,
1884
- width: 6,
1885
- height: 3,
1886
- metricConfig: {
1887
- metricName: ProfileMetricType.CpuProfileSampleCount,
1888
- aggregationType: MetricsAggregationType.Sum,
1889
- legend: "CPU Samples",
1890
- },
1891
- }),
1892
-
1893
- // Row 5: Section header
1894
- createTextComponent({
1895
- text: "Memory Profiling",
1896
- top: 5,
1897
- left: 0,
1898
- width: 12,
1899
- height: 1,
1900
- isBold: true,
1901
- }),
1902
-
1903
- // Row 6-8: Memory gauges and allocation charts
1904
- createGaugeComponent({
1905
- title: "Heap Usage",
1906
- top: 6,
1907
- left: 0,
1908
- width: 3,
1909
- height: 3,
1910
- minValue: 0,
1911
- maxValue: 100,
1912
- warningThreshold: 70,
1913
- criticalThreshold: 90,
1914
- metricConfig: {
1915
- metricName: ProfileMetricType.HeapUsage,
1916
- aggregationType: MetricsAggregationType.Avg,
1917
- },
1918
- }),
1919
- createChartComponent({
1920
- title: "Memory Allocation Size Over Time",
1921
- chartType: DashboardChartType.Area,
1922
- top: 6,
1923
- left: 3,
1924
- width: 6,
1925
- height: 3,
1926
- metricConfig: {
1927
- metricName: ProfileMetricType.MemoryAllocationSize,
1928
- aggregationType: MetricsAggregationType.Sum,
1929
- legend: "Allocation Size",
1930
- legendUnit: "bytes",
1931
- },
1932
- }),
1933
- createGaugeComponent({
1934
- title: "Thread Count",
1935
- top: 6,
1936
- left: 9,
1937
- width: 3,
1938
- height: 3,
1939
- minValue: 0,
1940
- maxValue: 500,
1941
- warningThreshold: 200,
1942
- criticalThreshold: 400,
1943
- metricConfig: {
1944
- metricName: ProfileMetricType.ThreadCount,
1945
- aggregationType: MetricsAggregationType.Avg,
1946
- },
1947
- }),
1948
-
1949
- // Row 9: Section header
1950
- createTextComponent({
1951
- text: "Allocation Trends",
1952
- top: 9,
1953
- left: 0,
1954
- width: 12,
1955
- height: 1,
1956
- isBold: true,
1957
- }),
1958
-
1959
- // Row 10-12: Allocation count trends and heap trends
1960
- createChartComponent({
1961
- title: "Memory Allocation Count Over Time",
1962
- chartType: DashboardChartType.Bar,
1963
- top: 10,
1964
- left: 0,
1965
- width: 6,
1966
- height: 3,
1967
- metricConfig: {
1968
- metricName: ProfileMetricType.MemoryAllocationCount,
1969
- aggregationType: MetricsAggregationType.Sum,
1970
- legend: "Allocations",
1971
- },
1972
- }),
1973
- createChartComponent({
1974
- title: "Heap Usage Over Time",
1975
- chartType: DashboardChartType.Area,
1976
- top: 10,
1977
- left: 6,
1978
- width: 6,
1979
- height: 3,
1980
- metricConfig: {
1981
- metricName: ProfileMetricType.HeapUsage,
1982
- aggregationType: MetricsAggregationType.Avg,
1983
- legend: "Heap",
1984
- legendUnit: "bytes",
1985
- },
1986
- }),
1987
-
1988
- // Row 13: Section header
1989
- createTextComponent({
1990
- text: "Runtime & Concurrency",
1991
- top: 13,
1992
- left: 0,
1993
- width: 12,
1994
- height: 1,
1995
- isBold: true,
1996
- }),
1997
-
1998
- // Row 14-16: Wall clock, goroutines/threads, sample rate
1999
- createChartComponent({
2000
- title: "Wall Clock Duration Over Time",
2001
- chartType: DashboardChartType.Line,
2002
- top: 14,
2003
- left: 0,
2004
- width: 6,
2005
- height: 3,
2006
- metricConfig: {
2007
- metricName: ProfileMetricType.WallClockDuration,
2008
- aggregationType: MetricsAggregationType.Avg,
2009
- legend: "Wall Clock",
2010
- legendUnit: "ms",
2011
- },
2012
- }),
2013
- createChartComponent({
2014
- title: "Goroutine / Thread Count Over Time",
2015
- chartType: DashboardChartType.StackedArea,
2016
- top: 14,
2017
- left: 6,
2018
- width: 6,
2019
- height: 3,
2020
- metricConfig: {
2021
- metricName: ProfileMetricType.GoroutineCount,
2022
- aggregationType: MetricsAggregationType.Avg,
2023
- legend: "Goroutines / Threads",
2024
- },
2025
- }),
2026
-
2027
- // Row 17: Section header
2028
- createTextComponent({
2029
- text: "Hot Functions",
2030
- top: 17,
2031
- left: 0,
2032
- width: 12,
2033
- height: 1,
2034
- isBold: true,
2035
- }),
2036
-
2037
- // Row 18-20: Top functions tables
2038
- createTableComponent({
2039
- title: "Top Functions by CPU Time",
2040
- top: 18,
2041
- left: 0,
2042
- width: 6,
2043
- height: 3,
2044
- metricConfig: {
2045
- metricName: ProfileMetricType.TopFunctionCpuTime,
2046
- aggregationType: MetricsAggregationType.Max,
2047
- },
2048
- }),
2049
- createTableComponent({
2050
- title: "Top Functions by Allocations",
2051
- top: 18,
2052
- left: 6,
2053
- width: 6,
2054
- height: 3,
2055
- metricConfig: {
2056
- metricName: ProfileMetricType.TopFunctionAllocations,
2057
- aggregationType: MetricsAggregationType.Max,
2058
- },
2059
- }),
2060
-
2061
- // Row 21-23: Profile sample rate and logs
2062
- createChartComponent({
2063
- title: "Profile Sample Rate Over Time",
2064
- chartType: DashboardChartType.Line,
2065
- top: 21,
2066
- left: 0,
2067
- width: 6,
2068
- height: 3,
2069
- metricConfig: {
2070
- metricName: ProfileMetricType.ProfileSampleRate,
2071
- aggregationType: MetricsAggregationType.Avg,
2072
- legend: "Sample Rate",
2073
- legendUnit: "samples/s",
2074
- },
2075
- }),
2076
- createLogStreamComponent({
2077
- title: "Related Logs",
2078
- top: 21,
2079
- left: 6,
2080
- width: 6,
2081
- height: 3,
2082
- }),
2083
- ];
2084
-
2085
- return {
2086
- _type: ObjectType.DashboardViewConfig,
2087
- components,
2088
- heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 24),
2089
- };
2090
- }
2091
-
2092
1356
  export function getTemplateConfig(
2093
1357
  type: DashboardTemplateType,
2094
1358
  ): DashboardViewConfig | null {
@@ -2101,12 +1365,6 @@ export function getTemplateConfig(
2101
1365
  return createKubernetesDashboardConfig();
2102
1366
  case DashboardTemplateType.Metrics:
2103
1367
  return createMetricsDashboardConfig();
2104
- case DashboardTemplateType.Trace:
2105
- return createTraceDashboardConfig();
2106
- case DashboardTemplateType.Exception:
2107
- return createExceptionDashboardConfig();
2108
- case DashboardTemplateType.Profiles:
2109
- return createProfilesDashboardConfig();
2110
1368
  case DashboardTemplateType.Blank:
2111
1369
  return null;
2112
1370
  }