@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.
@@ -7,10 +7,15 @@ import IconProp from "../Icon/IconProp";
7
7
  import MetricsAggregationType from "../Metrics/MetricsAggregationType";
8
8
  import IncidentMetricType from "../Incident/IncidentMetricType";
9
9
  import MonitorMetricType from "../Monitor/MonitorMetricType";
10
- import SpanMetricType from "../Span/SpanMetricType";
11
- import ExceptionMetricType from "../Exception/ExceptionMetricType";
12
- import ProfileMetricType from "../Profile/ProfileMetricType";
13
10
  import MetricDashboardMetricType from "../Metrics/MetricDashboardMetricType";
11
+ /*
12
+ * Trace / Exception / Profiles entries are intentionally not in this
13
+ * enum: their metric catalogs (SpanMetricType, ExceptionMetricType,
14
+ * ProfileMetricType) define names that are not emitted anywhere in the
15
+ * codebase, so the templates only ever rendered empty widgets. Reach
16
+ * for the Logs / Traces / Exceptions pages directly until those metrics
17
+ * exist.
18
+ */
14
19
  export var DashboardTemplateType;
15
20
  (function (DashboardTemplateType) {
16
21
  DashboardTemplateType["Blank"] = "Blank";
@@ -18,9 +23,6 @@ export var DashboardTemplateType;
18
23
  DashboardTemplateType["Incident"] = "Incident";
19
24
  DashboardTemplateType["Kubernetes"] = "Kubernetes";
20
25
  DashboardTemplateType["Metrics"] = "Metrics";
21
- DashboardTemplateType["Trace"] = "Trace";
22
- DashboardTemplateType["Exception"] = "Exception";
23
- DashboardTemplateType["Profiles"] = "Profiles";
24
26
  })(DashboardTemplateType || (DashboardTemplateType = {}));
25
27
  export const DashboardTemplates = [
26
28
  {
@@ -32,45 +34,27 @@ export const DashboardTemplates = [
32
34
  {
33
35
  type: DashboardTemplateType.Monitor,
34
36
  name: "Monitor Dashboard",
35
- description: "Response time, uptime, error rate, throughput charts, health gauges, and logs.",
37
+ description: "Response time, uptime, status codes, CPU/memory health gauges, and breakdown table for synthetic and server monitors.",
36
38
  icon: IconProp.Heartbeat,
37
39
  },
38
40
  {
39
41
  type: DashboardTemplateType.Incident,
40
42
  name: "Incident Dashboard",
41
- description: "MTTR/MTTA gauges, incident trends, severity breakdown, duration tables, logs, and traces.",
43
+ description: "Incident count, MTTR/MTTA gauges, duration trends, severity breakdown, time-in-state, and longest-incident tables.",
42
44
  icon: IconProp.Alert,
43
45
  },
44
46
  {
45
47
  type: DashboardTemplateType.Kubernetes,
46
48
  name: "Kubernetes Dashboard",
47
- description: "CPU/memory gauges, pod and node metrics, network I/O, restart trends, and cluster logs.",
49
+ description: "Pod/node CPU and memory averages, utilization gauges, live pod and node lists, network I/O, restarts, and cluster logs.",
48
50
  icon: IconProp.Kubernetes,
49
51
  },
50
52
  {
51
53
  type: DashboardTemplateType.Metrics,
52
54
  name: "Metrics Dashboard",
53
- description: "HTTP request rates, latency percentiles, error rates, system resource usage, and custom application metrics.",
55
+ description: "HTTP request rate, latency, error rate, CPU utilization gauge, memory usage, disk and network I/O, and runtime metrics.",
54
56
  icon: IconProp.ChartBar,
55
57
  },
56
- {
57
- type: DashboardTemplateType.Trace,
58
- name: "Trace Dashboard",
59
- description: "Span throughput, latency percentiles, error rates, service health, status breakdown, and recent traces.",
60
- icon: IconProp.Activity,
61
- },
62
- {
63
- type: DashboardTemplateType.Exception,
64
- name: "Exception Dashboard",
65
- description: "Exception counts, error rates, top exception types, resolution status, affected services, and logs.",
66
- icon: IconProp.Bug,
67
- },
68
- {
69
- type: DashboardTemplateType.Profiles,
70
- name: "Profiles Dashboard",
71
- description: "CPU profiles, memory allocations, heap usage, thread counts, top functions by CPU time, and flamegraph data.",
72
- icon: IconProp.Fire,
73
- },
74
58
  ];
75
59
  function buildMetricQueryConfig(config) {
76
60
  var _a, _b;
@@ -252,21 +236,41 @@ function createTableComponent(data) {
252
236
  },
253
237
  };
254
238
  }
255
- function createTraceListComponent(data) {
239
+ function createKubernetesPodListComponent(data) {
256
240
  var _a;
257
241
  return {
258
242
  _type: ObjectType.DashboardComponent,
259
- componentType: DashboardComponentType.TraceList,
243
+ componentType: DashboardComponentType.KubernetesPodList,
260
244
  componentId: ObjectID.generate(),
261
245
  topInDashboardUnits: data.top,
262
246
  leftInDashboardUnits: data.left,
263
247
  widthInDashboardUnits: data.width,
264
248
  heightInDashboardUnits: data.height,
265
249
  minHeightInDashboardUnits: 3,
266
- minWidthInDashboardUnits: 6,
250
+ minWidthInDashboardUnits: 4,
251
+ arguments: {
252
+ title: data.title,
253
+ maxRows: (_a = data.maxRows) !== null && _a !== void 0 ? _a : 20,
254
+ podPhases: data.podPhases,
255
+ },
256
+ };
257
+ }
258
+ function createKubernetesNodeListComponent(data) {
259
+ var _a;
260
+ return {
261
+ _type: ObjectType.DashboardComponent,
262
+ componentType: DashboardComponentType.KubernetesNodeList,
263
+ componentId: ObjectID.generate(),
264
+ topInDashboardUnits: data.top,
265
+ leftInDashboardUnits: data.left,
266
+ widthInDashboardUnits: data.width,
267
+ heightInDashboardUnits: data.height,
268
+ minHeightInDashboardUnits: 3,
269
+ minWidthInDashboardUnits: 4,
267
270
  arguments: {
268
271
  title: data.title,
269
272
  maxRows: (_a = data.maxRows) !== null && _a !== void 0 ? _a : 20,
273
+ readinessFilter: data.readinessFilter,
270
274
  },
271
275
  };
272
276
  }
@@ -294,19 +298,32 @@ function createMonitorDashboardConfig() {
294
298
  legendUnit: "ms",
295
299
  },
296
300
  }),
301
+ /*
302
+ * IsOnline is emitted as 0/1 with unit "" by MonitorMetricUtil, so
303
+ * `Avg` gives the uptime ratio in [0, 1] rather than a percent. We
304
+ * label the widget "Uptime (avg)" instead of "%" so the fractional
305
+ * display isn't misleading; flipping the storage to 0/100 + unit
306
+ * "%" would change criteria evaluation elsewhere in the codebase.
307
+ */
297
308
  createValueComponent({
298
- title: "Uptime %",
309
+ title: "Uptime (avg)",
299
310
  top: 1,
300
311
  left: 3,
301
312
  width: 3,
302
313
  metricConfig: {
303
314
  metricName: MonitorMetricType.IsOnline,
304
315
  aggregationType: MetricsAggregationType.Avg,
305
- legendUnit: "%",
306
316
  },
307
317
  }),
318
+ /*
319
+ * ResponseStatusCode is the literal HTTP status code (200, 404,
320
+ * 503, …). `Count` over it returns the total number of checks the
321
+ * monitor ran, not the error rate — the original "Error Rate" label
322
+ * was misleading. Filtering to status >= 400 would require attribute
323
+ * filters that the template helper doesn't expose, so we relabel.
324
+ */
308
325
  createValueComponent({
309
- title: "Error Rate",
326
+ title: "Total Checks",
310
327
  top: 1,
311
328
  left: 6,
312
329
  width: 3,
@@ -351,8 +368,7 @@ function createMonitorDashboardConfig() {
351
368
  metricConfig: {
352
369
  metricName: MonitorMetricType.IsOnline,
353
370
  aggregationType: MetricsAggregationType.Avg,
354
- legend: "Online Status",
355
- legendUnit: "%",
371
+ legend: "Uptime Ratio",
356
372
  },
357
373
  }),
358
374
  // Row 5: Section header
@@ -444,6 +460,21 @@ function createMonitorDashboardConfig() {
444
460
  };
445
461
  }
446
462
  function createIncidentDashboardConfig() {
463
+ /*
464
+ * Incident metrics (TimeToResolve, TimeToAcknowledge, IncidentDuration,
465
+ * TimeInState, PostmortemCompletionTime) are emitted with unit
466
+ * "seconds" by IncidentService. Templates previously passed
467
+ * `legendUnit: "min"` to relabel the chart legend, but that bypassed
468
+ * ValueFormatter's scale-aware formatting and rendered raw seconds
469
+ * with a "Minutes" suffix (e.g. a 1-hour incident showed as
470
+ * "3600 Minutes"). Gauges were authored against an implicit minute
471
+ * scale (maxValue 120, threshold 60/90) and compared bytes-of-seconds
472
+ * against minutes, so any incident over ~2 minutes pinned the gauge.
473
+ *
474
+ * We now drop the legendUnit overrides — ValueFormatter scales
475
+ * `seconds` to sec/min/hr/days based on magnitude — and reauthor the
476
+ * gauge ranges in seconds so the 0-100% sweep is meaningful.
477
+ */
447
478
  const components = [
448
479
  // Row 0: Title
449
480
  createTextComponent({
@@ -473,7 +504,6 @@ function createIncidentDashboardConfig() {
473
504
  metricConfig: {
474
505
  metricName: IncidentMetricType.TimeToResolve,
475
506
  aggregationType: MetricsAggregationType.Avg,
476
- legendUnit: "min",
477
507
  },
478
508
  }),
479
509
  createValueComponent({
@@ -484,7 +514,6 @@ function createIncidentDashboardConfig() {
484
514
  metricConfig: {
485
515
  metricName: IncidentMetricType.TimeToAcknowledge,
486
516
  aggregationType: MetricsAggregationType.Avg,
487
- legendUnit: "min",
488
517
  },
489
518
  }),
490
519
  createValueComponent({
@@ -495,7 +524,6 @@ function createIncidentDashboardConfig() {
495
524
  metricConfig: {
496
525
  metricName: IncidentMetricType.IncidentDuration,
497
526
  aggregationType: MetricsAggregationType.Avg,
498
- legendUnit: "min",
499
527
  },
500
528
  }),
501
529
  // Row 2-4: Incident trends
@@ -523,7 +551,6 @@ function createIncidentDashboardConfig() {
523
551
  metricName: IncidentMetricType.IncidentDuration,
524
552
  aggregationType: MetricsAggregationType.Avg,
525
553
  legend: "Avg Duration",
526
- legendUnit: "min",
527
554
  },
528
555
  }),
529
556
  // Row 5: Section header
@@ -535,32 +562,37 @@ function createIncidentDashboardConfig() {
535
562
  height: 1,
536
563
  isBold: true,
537
564
  }),
538
- // Row 6-8: Gauges for MTTR/MTTA and resolution chart
565
+ /*
566
+ * Row 6-8: MTTR/MTTA gauges. Ranges and thresholds are now in
567
+ * seconds (matching the stored metric unit). Targets: MTTR full
568
+ * scale 2 hours (warn at 1 hour, critical at 1.5 hours); MTTA full
569
+ * scale 1 hour (warn at 15 min, critical at 30 min).
570
+ */
539
571
  createGaugeComponent({
540
- title: "MTTR (minutes)",
572
+ title: "MTTR",
541
573
  top: 6,
542
574
  left: 0,
543
575
  width: 3,
544
576
  height: 3,
545
577
  minValue: 0,
546
- maxValue: 120,
547
- warningThreshold: 60,
548
- criticalThreshold: 90,
578
+ maxValue: 7200,
579
+ warningThreshold: 3600,
580
+ criticalThreshold: 5400,
549
581
  metricConfig: {
550
582
  metricName: IncidentMetricType.TimeToResolve,
551
583
  aggregationType: MetricsAggregationType.Avg,
552
584
  },
553
585
  }),
554
586
  createGaugeComponent({
555
- title: "MTTA (minutes)",
587
+ title: "MTTA",
556
588
  top: 6,
557
589
  left: 3,
558
590
  width: 3,
559
591
  height: 3,
560
592
  minValue: 0,
561
- maxValue: 60,
562
- warningThreshold: 15,
563
- criticalThreshold: 30,
593
+ maxValue: 3600,
594
+ warningThreshold: 900,
595
+ criticalThreshold: 1800,
564
596
  metricConfig: {
565
597
  metricName: IncidentMetricType.TimeToAcknowledge,
566
598
  aggregationType: MetricsAggregationType.Avg,
@@ -577,7 +609,6 @@ function createIncidentDashboardConfig() {
577
609
  metricName: IncidentMetricType.TimeToResolve,
578
610
  aggregationType: MetricsAggregationType.Avg,
579
611
  legend: "MTTR",
580
- legendUnit: "min",
581
612
  },
582
613
  }),
583
614
  // Row 9: Section header
@@ -614,7 +645,6 @@ function createIncidentDashboardConfig() {
614
645
  metricName: IncidentMetricType.TimeInState,
615
646
  aggregationType: MetricsAggregationType.Avg,
616
647
  legend: "Time in State",
617
- legendUnit: "min",
618
648
  },
619
649
  }),
620
650
  // Row 13: Section header
@@ -626,7 +656,13 @@ function createIncidentDashboardConfig() {
626
656
  height: 1,
627
657
  isBold: true,
628
658
  }),
629
- // Row 14-16: Tables
659
+ /*
660
+ * Row 14-16: Operational tables. Logs / traces were removed from the
661
+ * Incident template because incident records are not log/trace
662
+ * sources — they're rows in Postgres. Surfacing unrelated cluster
663
+ * logs and trace lists alongside MTTR/MTTA was a UX miss; if a user
664
+ * wants those views they live on dedicated Trace / Log pages.
665
+ */
630
666
  createTableComponent({
631
667
  title: "Incidents by Duration",
632
668
  top: 14,
@@ -649,29 +685,40 @@ function createIncidentDashboardConfig() {
649
685
  aggregationType: MetricsAggregationType.Avg,
650
686
  },
651
687
  }),
652
- // Row 17-19: Logs and traces
653
- createLogStreamComponent({
654
- title: "Recent Incident Logs",
655
- top: 17,
656
- left: 0,
657
- width: 6,
658
- height: 3,
659
- }),
660
- createTraceListComponent({
661
- title: "Recent Traces",
662
- top: 17,
663
- left: 6,
664
- width: 6,
665
- height: 3,
666
- }),
667
688
  ];
668
689
  return {
669
690
  _type: ObjectType.DashboardViewConfig,
670
691
  components,
671
- heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 20),
692
+ heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 17),
672
693
  };
673
694
  }
674
695
  function createKubernetesDashboardConfig() {
696
+ /*
697
+ * Layout notes:
698
+ *
699
+ * - "Pod Count" / "Node Ready" used to be Value widgets over k8s.pod.phase
700
+ * / k8s.node.condition_ready with `Sum` aggregation. Those metrics are
701
+ * per-resource gauges that re-emit `1` on every scrape, so summing
702
+ * across the dashboard window multiplied (pods * scrapes) and produced
703
+ * numbers in the hundreds for tiny clusters. The user-visible fix is
704
+ * to use the dedicated KubernetesPodList / KubernetesNodeList widgets
705
+ * below — they read the per-cluster snapshot in Postgres and show
706
+ * accurate counts in the widget header plus a live list of rows.
707
+ *
708
+ * - "Memory Utilization" used to be a 0-100 gauge over k8s.node.memory.usage,
709
+ * which is reported in bytes. A node with 8 GB of RAM produced a value
710
+ * in the 10^9 range against a 0-100 scale, so the gauge always pinned
711
+ * at the critical end with a meaningless absolute number. Without a
712
+ * first-class percent metric we replace it with a Value widget that
713
+ * renders the absolute usage via ValueFormatter (e.g. "8.3 GB").
714
+ *
715
+ * - CPU widgets use OTel's k8s.*.cpu.utilization, which the collector
716
+ * emits as a [0, 1] ratio with unit "1". DashboardValueComponent /
717
+ * DashboardGaugeComponent now scale that to a percent at render time
718
+ * when the metric name carries the `.utilization` suffix, so "0.05"
719
+ * reads as "5.00%" and gauge thresholds in the natural 0-100 scale work
720
+ * as expected.
721
+ */
675
722
  const components = [
676
723
  // Row 0: Title
677
724
  createTextComponent({
@@ -682,47 +729,48 @@ function createKubernetesDashboardConfig() {
682
729
  height: 1,
683
730
  isBold: true,
684
731
  }),
685
- // Row 1: Key cluster metrics
732
+ /*
733
+ * Row 1: Key cluster metrics — averages render with proper units via
734
+ * ValueFormatter (CPU utilization → "%", memory.usage → "MB"/"GB").
735
+ */
686
736
  createValueComponent({
687
- title: "CPU Usage",
737
+ title: "Pod CPU (avg)",
688
738
  top: 1,
689
739
  left: 0,
690
740
  width: 3,
691
741
  metricConfig: {
692
742
  metricName: "k8s.pod.cpu.utilization",
693
743
  aggregationType: MetricsAggregationType.Avg,
694
- legendUnit: "%",
695
744
  },
696
745
  }),
697
746
  createValueComponent({
698
- title: "Memory Usage",
747
+ title: "Pod Memory (avg)",
699
748
  top: 1,
700
749
  left: 3,
701
750
  width: 3,
702
751
  metricConfig: {
703
752
  metricName: "k8s.pod.memory.usage",
704
753
  aggregationType: MetricsAggregationType.Avg,
705
- legendUnit: "bytes",
706
754
  },
707
755
  }),
708
756
  createValueComponent({
709
- title: "Pod Count",
757
+ title: "Node CPU (avg)",
710
758
  top: 1,
711
759
  left: 6,
712
760
  width: 3,
713
761
  metricConfig: {
714
- metricName: "k8s.pod.phase",
715
- aggregationType: MetricsAggregationType.Sum,
762
+ metricName: "k8s.node.cpu.utilization",
763
+ aggregationType: MetricsAggregationType.Avg,
716
764
  },
717
765
  }),
718
766
  createValueComponent({
719
- title: "Node Ready",
767
+ title: "Node Memory (avg)",
720
768
  top: 1,
721
769
  left: 9,
722
770
  width: 3,
723
771
  metricConfig: {
724
- metricName: "k8s.node.condition_ready",
725
- aggregationType: MetricsAggregationType.Sum,
772
+ metricName: "k8s.node.memory.usage",
773
+ aggregationType: MetricsAggregationType.Avg,
726
774
  },
727
775
  }),
728
776
  // Row 2-4: Resource usage charts
@@ -737,7 +785,6 @@ function createKubernetesDashboardConfig() {
737
785
  metricName: "k8s.pod.cpu.utilization",
738
786
  aggregationType: MetricsAggregationType.Avg,
739
787
  legend: "CPU Utilization",
740
- legendUnit: "%",
741
788
  },
742
789
  }),
743
790
  createChartComponent({
@@ -751,91 +798,95 @@ function createKubernetesDashboardConfig() {
751
798
  metricName: "k8s.pod.memory.usage",
752
799
  aggregationType: MetricsAggregationType.Avg,
753
800
  legend: "Memory Usage",
754
- legendUnit: "bytes",
755
801
  },
756
802
  }),
757
803
  // Row 5: Section header
758
804
  createTextComponent({
759
- text: "Resource Health",
805
+ text: "Cluster Resources",
760
806
  top: 5,
761
807
  left: 0,
762
808
  width: 12,
763
809
  height: 1,
764
810
  isBold: true,
765
811
  }),
766
- // Row 6-8: Gauges and pod chart
767
- createGaugeComponent({
768
- title: "CPU Utilization",
812
+ /*
813
+ * Row 6-9: Pod and node lists query the Postgres snapshot, so the
814
+ * header shows the true current count and the body shows live rows
815
+ * (replacing the broken Sum-of-gauge Value widgets).
816
+ */
817
+ createKubernetesPodListComponent({
818
+ title: "Pods",
769
819
  top: 6,
770
820
  left: 0,
771
- width: 3,
772
- height: 3,
773
- minValue: 0,
774
- maxValue: 100,
775
- warningThreshold: 70,
776
- criticalThreshold: 90,
777
- metricConfig: {
778
- metricName: "k8s.node.cpu.utilization",
779
- aggregationType: MetricsAggregationType.Avg,
780
- },
821
+ width: 6,
822
+ height: 4,
823
+ maxRows: 25,
781
824
  }),
782
- createGaugeComponent({
783
- title: "Memory Utilization",
825
+ createKubernetesNodeListComponent({
826
+ title: "Nodes",
784
827
  top: 6,
785
- left: 3,
786
- width: 3,
828
+ left: 6,
829
+ width: 6,
830
+ height: 4,
831
+ maxRows: 25,
832
+ }),
833
+ // Row 10: Section header
834
+ createTextComponent({
835
+ text: "Resource Health",
836
+ top: 10,
837
+ left: 0,
838
+ width: 12,
839
+ height: 1,
840
+ isBold: true,
841
+ }),
842
+ /*
843
+ * Row 11-13: CPU gauge (auto-scaled from [0,1] to percent), and the
844
+ * network throughput chart. The old "Memory Utilization" gauge over
845
+ * raw bytes is gone — see top-of-function comment.
846
+ */
847
+ createGaugeComponent({
848
+ title: "Cluster CPU Utilization",
849
+ top: 11,
850
+ left: 0,
851
+ width: 4,
787
852
  height: 3,
788
853
  minValue: 0,
789
854
  maxValue: 100,
790
855
  warningThreshold: 70,
791
856
  criticalThreshold: 90,
792
857
  metricConfig: {
793
- metricName: "k8s.node.memory.usage",
858
+ metricName: "k8s.node.cpu.utilization",
794
859
  aggregationType: MetricsAggregationType.Avg,
795
860
  },
796
861
  }),
797
862
  createChartComponent({
798
- title: "Pod Count Over Time",
799
- chartType: DashboardChartType.StackedArea,
800
- top: 6,
801
- left: 6,
802
- width: 6,
863
+ title: "Network I/O",
864
+ chartType: DashboardChartType.Area,
865
+ top: 11,
866
+ left: 4,
867
+ width: 8,
803
868
  height: 3,
804
869
  metricConfig: {
805
- metricName: "k8s.pod.phase",
870
+ metricName: "k8s.pod.network.io",
806
871
  aggregationType: MetricsAggregationType.Sum,
807
- legend: "Pods",
872
+ legend: "Network I/O",
808
873
  },
809
874
  }),
810
- // Row 9: Section header
875
+ // Row 14: Section header
811
876
  createTextComponent({
812
- text: "Workload Details",
813
- top: 9,
877
+ text: "Workload Activity",
878
+ top: 14,
814
879
  left: 0,
815
880
  width: 12,
816
881
  height: 1,
817
882
  isBold: true,
818
883
  }),
819
- // Row 10-12: Network, restarts
820
- createChartComponent({
821
- title: "Network I/O",
822
- chartType: DashboardChartType.Area,
823
- top: 10,
824
- left: 0,
825
- width: 6,
826
- height: 3,
827
- metricConfig: {
828
- metricName: "k8s.pod.network.io",
829
- aggregationType: MetricsAggregationType.Sum,
830
- legend: "Network I/O",
831
- legendUnit: "bytes",
832
- },
833
- }),
884
+ // Row 15-17: Restarts and replicas
834
885
  createChartComponent({
835
886
  title: "Container Restarts Over Time",
836
887
  chartType: DashboardChartType.Bar,
837
- top: 10,
838
- left: 6,
888
+ top: 15,
889
+ left: 0,
839
890
  width: 6,
840
891
  height: 3,
841
892
  metricConfig: {
@@ -844,11 +895,10 @@ function createKubernetesDashboardConfig() {
844
895
  legend: "Restarts",
845
896
  },
846
897
  }),
847
- // Row 13-15: Table and logs
848
898
  createTableComponent({
849
899
  title: "Deployment Replicas",
850
- top: 13,
851
- left: 0,
900
+ top: 15,
901
+ left: 6,
852
902
  width: 6,
853
903
  height: 3,
854
904
  metricConfig: {
@@ -856,21 +906,43 @@ function createKubernetesDashboardConfig() {
856
906
  aggregationType: MetricsAggregationType.Min,
857
907
  },
858
908
  }),
909
+ // Row 18-20: Logs
859
910
  createLogStreamComponent({
860
911
  title: "Cluster Logs",
861
- top: 13,
862
- left: 6,
863
- width: 6,
912
+ top: 18,
913
+ left: 0,
914
+ width: 12,
864
915
  height: 3,
865
916
  }),
866
917
  ];
867
918
  return {
868
919
  _type: ObjectType.DashboardViewConfig,
869
920
  components,
870
- heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 16),
921
+ heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 21),
871
922
  };
872
923
  }
873
924
  function createMetricsDashboardConfig() {
925
+ /*
926
+ * Layout notes:
927
+ *
928
+ * - `system.cpu.utilization` and `process.cpu.utilization` are OTel
929
+ * ratio metrics with unit "1" reported in [0, 1]. DashboardValueComponent
930
+ * / DashboardGaugeComponent scale these to a percent at render time
931
+ * (see splitFormattedValue / isFractionScale), so the 0-100 gauge sweep
932
+ * and the percent display work without any special template config.
933
+ *
934
+ * - `system.memory.usage` is reported in bytes. A previous "Memory Usage"
935
+ * gauge compared bytes (10⁹ range) against a 0-100 sweep and pinned
936
+ * critical for any sane workload. We swapped it for a Value widget that
937
+ * renders the absolute usage via ValueFormatter (e.g. "8.3 GB"), since
938
+ * there is no first-class memory-utilization percent metric in OTel's
939
+ * default system instrumentation.
940
+ *
941
+ * - We also dropped explicit `legendUnit: "bytes"/"%"/"ms"` overrides
942
+ * where they duplicated the stored MetricType unit — ValueFormatter
943
+ * already auto-scales bytes/seconds/ms and renders ratio metrics as
944
+ * percent. Keeping overrides only when they add useful aliasing.
945
+ */
874
946
  const components = [
875
947
  // Row 0: Title
876
948
  createTextComponent({
@@ -1001,7 +1073,12 @@ function createMetricsDashboardConfig() {
1001
1073
  height: 1,
1002
1074
  isBold: true,
1003
1075
  }),
1004
- // Row 10-12: System resource gauges and charts
1076
+ /*
1077
+ * Row 10-12: System resource health. CPU has a percent gauge (auto-
1078
+ * scaled from [0, 1] ratio at render time); Memory has a Value widget
1079
+ * since `system.memory.usage` is bytes (auto-formatted to MB/GB) and
1080
+ * we don't have a first-class memory-utilization percent metric.
1081
+ */
1005
1082
  createGaugeComponent({
1006
1083
  title: "CPU Utilization",
1007
1084
  top: 10,
@@ -1017,16 +1094,11 @@ function createMetricsDashboardConfig() {
1017
1094
  aggregationType: MetricsAggregationType.Avg,
1018
1095
  },
1019
1096
  }),
1020
- createGaugeComponent({
1097
+ createValueComponent({
1021
1098
  title: "Memory Usage",
1022
1099
  top: 10,
1023
1100
  left: 3,
1024
1101
  width: 3,
1025
- height: 3,
1026
- minValue: 0,
1027
- maxValue: 100,
1028
- warningThreshold: 70,
1029
- criticalThreshold: 90,
1030
1102
  metricConfig: {
1031
1103
  metricName: MetricDashboardMetricType.SystemMemoryUsage,
1032
1104
  aggregationType: MetricsAggregationType.Avg,
@@ -1042,8 +1114,7 @@ function createMetricsDashboardConfig() {
1042
1114
  metricConfig: {
1043
1115
  metricName: MetricDashboardMetricType.SystemCpuUtilization,
1044
1116
  aggregationType: MetricsAggregationType.Avg,
1045
- legend: "CPU %",
1046
- legendUnit: "%",
1117
+ legend: "CPU",
1047
1118
  },
1048
1119
  }),
1049
1120
  // Row 13: Section header
@@ -1148,783 +1219,6 @@ function createMetricsDashboardConfig() {
1148
1219
  heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 24),
1149
1220
  };
1150
1221
  }
1151
- function createTraceDashboardConfig() {
1152
- const components = [
1153
- // Row 0: Title
1154
- createTextComponent({
1155
- text: "Trace Dashboard",
1156
- top: 0,
1157
- left: 0,
1158
- width: 12,
1159
- height: 1,
1160
- isBold: true,
1161
- }),
1162
- // Row 1: Key trace metrics
1163
- createValueComponent({
1164
- title: "Span Count",
1165
- top: 1,
1166
- left: 0,
1167
- width: 3,
1168
- metricConfig: {
1169
- metricName: SpanMetricType.SpanCount,
1170
- aggregationType: MetricsAggregationType.Sum,
1171
- },
1172
- }),
1173
- createValueComponent({
1174
- title: "Avg Duration",
1175
- top: 1,
1176
- left: 3,
1177
- width: 3,
1178
- metricConfig: {
1179
- metricName: SpanMetricType.SpanDuration,
1180
- aggregationType: MetricsAggregationType.Avg,
1181
- legendUnit: "ms",
1182
- },
1183
- }),
1184
- createValueComponent({
1185
- title: "Error Rate",
1186
- top: 1,
1187
- left: 6,
1188
- width: 3,
1189
- metricConfig: {
1190
- metricName: SpanMetricType.SpanErrorRate,
1191
- aggregationType: MetricsAggregationType.Avg,
1192
- legendUnit: "%",
1193
- },
1194
- }),
1195
- createValueComponent({
1196
- title: "Throughput",
1197
- top: 1,
1198
- left: 9,
1199
- width: 3,
1200
- metricConfig: {
1201
- metricName: SpanMetricType.SpanThroughput,
1202
- aggregationType: MetricsAggregationType.Sum,
1203
- legendUnit: "req/s",
1204
- },
1205
- }),
1206
- // Row 2-4: Throughput and duration charts
1207
- createChartComponent({
1208
- title: "Span Throughput Over Time",
1209
- chartType: DashboardChartType.Bar,
1210
- top: 2,
1211
- left: 0,
1212
- width: 6,
1213
- height: 3,
1214
- metricConfig: {
1215
- metricName: SpanMetricType.SpanCount,
1216
- aggregationType: MetricsAggregationType.Sum,
1217
- legend: "Spans",
1218
- },
1219
- }),
1220
- createChartComponent({
1221
- title: "Avg Span Duration Over Time",
1222
- chartType: DashboardChartType.Line,
1223
- top: 2,
1224
- left: 6,
1225
- width: 6,
1226
- height: 3,
1227
- metricConfig: {
1228
- metricName: SpanMetricType.SpanDuration,
1229
- aggregationType: MetricsAggregationType.Avg,
1230
- legend: "Avg Duration",
1231
- legendUnit: "ms",
1232
- },
1233
- }),
1234
- // Row 5: Section header
1235
- createTextComponent({
1236
- text: "Latency Percentiles",
1237
- top: 5,
1238
- left: 0,
1239
- width: 12,
1240
- height: 1,
1241
- isBold: true,
1242
- }),
1243
- // Row 6: Latency percentile values
1244
- createValueComponent({
1245
- title: "P50 Latency",
1246
- top: 6,
1247
- left: 0,
1248
- width: 3,
1249
- metricConfig: {
1250
- metricName: SpanMetricType.SpanP50Duration,
1251
- aggregationType: MetricsAggregationType.Avg,
1252
- legendUnit: "ms",
1253
- },
1254
- }),
1255
- createValueComponent({
1256
- title: "P90 Latency",
1257
- top: 6,
1258
- left: 3,
1259
- width: 3,
1260
- metricConfig: {
1261
- metricName: SpanMetricType.SpanP90Duration,
1262
- aggregationType: MetricsAggregationType.Avg,
1263
- legendUnit: "ms",
1264
- },
1265
- }),
1266
- createValueComponent({
1267
- title: "P95 Latency",
1268
- top: 6,
1269
- left: 6,
1270
- width: 3,
1271
- metricConfig: {
1272
- metricName: SpanMetricType.SpanP95Duration,
1273
- aggregationType: MetricsAggregationType.Avg,
1274
- legendUnit: "ms",
1275
- },
1276
- }),
1277
- createValueComponent({
1278
- title: "P99 Latency",
1279
- top: 6,
1280
- left: 9,
1281
- width: 3,
1282
- metricConfig: {
1283
- metricName: SpanMetricType.SpanP99Duration,
1284
- aggregationType: MetricsAggregationType.Avg,
1285
- legendUnit: "ms",
1286
- },
1287
- }),
1288
- // Row 7-9: Latency percentile charts
1289
- createChartComponent({
1290
- title: "Latency Percentiles Over Time",
1291
- chartType: DashboardChartType.Line,
1292
- top: 7,
1293
- left: 0,
1294
- width: 6,
1295
- height: 3,
1296
- metricConfig: {
1297
- metricName: SpanMetricType.SpanP95Duration,
1298
- aggregationType: MetricsAggregationType.Avg,
1299
- legend: "P95 Latency",
1300
- legendUnit: "ms",
1301
- },
1302
- }),
1303
- createChartComponent({
1304
- title: "Latency Distribution",
1305
- chartType: DashboardChartType.Histogram,
1306
- top: 7,
1307
- left: 6,
1308
- width: 6,
1309
- height: 3,
1310
- metricConfig: {
1311
- metricName: SpanMetricType.SpanDuration,
1312
- aggregationType: MetricsAggregationType.Count,
1313
- legend: "Latency Distribution",
1314
- legendUnit: "ms",
1315
- },
1316
- }),
1317
- // Row 10: Section header
1318
- createTextComponent({
1319
- text: "Error Analysis",
1320
- top: 10,
1321
- left: 0,
1322
- width: 12,
1323
- height: 1,
1324
- isBold: true,
1325
- }),
1326
- // Row 11-13: Error charts and status breakdown
1327
- createGaugeComponent({
1328
- title: "Error Rate",
1329
- top: 11,
1330
- left: 0,
1331
- width: 3,
1332
- height: 3,
1333
- minValue: 0,
1334
- maxValue: 100,
1335
- warningThreshold: 5,
1336
- criticalThreshold: 15,
1337
- metricConfig: {
1338
- metricName: SpanMetricType.SpanErrorRate,
1339
- aggregationType: MetricsAggregationType.Avg,
1340
- },
1341
- }),
1342
- createChartComponent({
1343
- title: "Errors Over Time",
1344
- chartType: DashboardChartType.Area,
1345
- top: 11,
1346
- left: 3,
1347
- width: 6,
1348
- height: 3,
1349
- metricConfig: {
1350
- metricName: SpanMetricType.SpanErrorCount,
1351
- aggregationType: MetricsAggregationType.Sum,
1352
- legend: "Errors",
1353
- },
1354
- }),
1355
- createChartComponent({
1356
- title: "Span Status Breakdown",
1357
- chartType: DashboardChartType.Pie,
1358
- top: 11,
1359
- left: 9,
1360
- width: 3,
1361
- height: 3,
1362
- metricConfig: {
1363
- metricName: SpanMetricType.SpanStatusOk,
1364
- aggregationType: MetricsAggregationType.Count,
1365
- legend: "Status",
1366
- },
1367
- }),
1368
- // Row 14: Section header
1369
- createTextComponent({
1370
- text: "Trace Details",
1371
- top: 14,
1372
- left: 0,
1373
- width: 12,
1374
- height: 1,
1375
- isBold: true,
1376
- }),
1377
- // Row 15-17: Table of slowest spans and request rate
1378
- createTableComponent({
1379
- title: "Slowest Spans",
1380
- top: 15,
1381
- left: 0,
1382
- width: 6,
1383
- height: 3,
1384
- metricConfig: {
1385
- metricName: SpanMetricType.SpanDuration,
1386
- aggregationType: MetricsAggregationType.Max,
1387
- },
1388
- }),
1389
- createChartComponent({
1390
- title: "Request Rate Over Time",
1391
- chartType: DashboardChartType.StackedArea,
1392
- top: 15,
1393
- left: 6,
1394
- width: 6,
1395
- height: 3,
1396
- metricConfig: {
1397
- metricName: SpanMetricType.SpanRequestRate,
1398
- aggregationType: MetricsAggregationType.Sum,
1399
- legend: "Request Rate",
1400
- legendUnit: "req/s",
1401
- },
1402
- }),
1403
- // Row 18-20: Recent traces and logs
1404
- createTraceListComponent({
1405
- title: "Recent Traces",
1406
- top: 18,
1407
- left: 0,
1408
- width: 6,
1409
- height: 3,
1410
- }),
1411
- createLogStreamComponent({
1412
- title: "Related Logs",
1413
- top: 18,
1414
- left: 6,
1415
- width: 6,
1416
- height: 3,
1417
- }),
1418
- ];
1419
- return {
1420
- _type: ObjectType.DashboardViewConfig,
1421
- components,
1422
- heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 21),
1423
- };
1424
- }
1425
- function createExceptionDashboardConfig() {
1426
- const components = [
1427
- // Row 0: Title
1428
- createTextComponent({
1429
- text: "Exception Dashboard",
1430
- top: 0,
1431
- left: 0,
1432
- width: 12,
1433
- height: 1,
1434
- isBold: true,
1435
- }),
1436
- // Row 1: Key exception metrics
1437
- createValueComponent({
1438
- title: "Total Exceptions",
1439
- top: 1,
1440
- left: 0,
1441
- width: 3,
1442
- metricConfig: {
1443
- metricName: ExceptionMetricType.ExceptionCount,
1444
- aggregationType: MetricsAggregationType.Sum,
1445
- },
1446
- }),
1447
- createValueComponent({
1448
- title: "Exception Rate",
1449
- top: 1,
1450
- left: 3,
1451
- width: 3,
1452
- metricConfig: {
1453
- metricName: ExceptionMetricType.ExceptionRate,
1454
- aggregationType: MetricsAggregationType.Avg,
1455
- legendUnit: "/min",
1456
- },
1457
- }),
1458
- createValueComponent({
1459
- title: "Unresolved",
1460
- top: 1,
1461
- left: 6,
1462
- width: 3,
1463
- metricConfig: {
1464
- metricName: ExceptionMetricType.UnresolvedExceptionCount,
1465
- aggregationType: MetricsAggregationType.Sum,
1466
- },
1467
- }),
1468
- createValueComponent({
1469
- title: "Affected Services",
1470
- top: 1,
1471
- left: 9,
1472
- width: 3,
1473
- metricConfig: {
1474
- metricName: ExceptionMetricType.ExceptionAffectedServiceCount,
1475
- aggregationType: MetricsAggregationType.Sum,
1476
- },
1477
- }),
1478
- // Row 2-4: Exception trends
1479
- createChartComponent({
1480
- title: "Exceptions Over Time",
1481
- chartType: DashboardChartType.Bar,
1482
- top: 2,
1483
- left: 0,
1484
- width: 6,
1485
- height: 3,
1486
- metricConfig: {
1487
- metricName: ExceptionMetricType.ExceptionCount,
1488
- aggregationType: MetricsAggregationType.Sum,
1489
- legend: "Exceptions",
1490
- },
1491
- }),
1492
- createChartComponent({
1493
- title: "Exception Rate Over Time",
1494
- chartType: DashboardChartType.Line,
1495
- top: 2,
1496
- left: 6,
1497
- width: 6,
1498
- height: 3,
1499
- metricConfig: {
1500
- metricName: ExceptionMetricType.ExceptionRate,
1501
- aggregationType: MetricsAggregationType.Avg,
1502
- legend: "Exception Rate",
1503
- legendUnit: "/min",
1504
- },
1505
- }),
1506
- // Row 5: Section header
1507
- createTextComponent({
1508
- text: "Exception Breakdown",
1509
- top: 5,
1510
- left: 0,
1511
- width: 12,
1512
- height: 1,
1513
- isBold: true,
1514
- }),
1515
- // Row 6-8: Exception type and service breakdown
1516
- createChartComponent({
1517
- title: "Exceptions by Type",
1518
- chartType: DashboardChartType.Pie,
1519
- top: 6,
1520
- left: 0,
1521
- width: 6,
1522
- height: 3,
1523
- metricConfig: {
1524
- metricName: ExceptionMetricType.ExceptionCountByType,
1525
- aggregationType: MetricsAggregationType.Count,
1526
- legend: "Exception Type",
1527
- },
1528
- }),
1529
- createChartComponent({
1530
- title: "Exceptions by Service",
1531
- chartType: DashboardChartType.Bar,
1532
- top: 6,
1533
- left: 6,
1534
- width: 6,
1535
- height: 3,
1536
- metricConfig: {
1537
- metricName: ExceptionMetricType.ExceptionCountByService,
1538
- aggregationType: MetricsAggregationType.Count,
1539
- legend: "Service",
1540
- },
1541
- }),
1542
- // Row 9: Section header
1543
- createTextComponent({
1544
- text: "Resolution Status",
1545
- top: 9,
1546
- left: 0,
1547
- width: 12,
1548
- height: 1,
1549
- isBold: true,
1550
- }),
1551
- // Row 10-12: Resolution gauges and resolution trends
1552
- createGaugeComponent({
1553
- title: "Unresolved Exceptions",
1554
- top: 10,
1555
- left: 0,
1556
- width: 3,
1557
- height: 3,
1558
- minValue: 0,
1559
- maxValue: 100,
1560
- warningThreshold: 25,
1561
- criticalThreshold: 50,
1562
- metricConfig: {
1563
- metricName: ExceptionMetricType.UnresolvedExceptionCount,
1564
- aggregationType: MetricsAggregationType.Sum,
1565
- },
1566
- }),
1567
- createGaugeComponent({
1568
- title: "Muted Exceptions",
1569
- top: 10,
1570
- left: 3,
1571
- width: 3,
1572
- height: 3,
1573
- minValue: 0,
1574
- maxValue: 100,
1575
- metricConfig: {
1576
- metricName: ExceptionMetricType.MutedExceptionCount,
1577
- aggregationType: MetricsAggregationType.Sum,
1578
- },
1579
- }),
1580
- createChartComponent({
1581
- title: "Resolution Status Over Time",
1582
- chartType: DashboardChartType.StackedArea,
1583
- top: 10,
1584
- left: 6,
1585
- width: 6,
1586
- height: 3,
1587
- metricConfig: {
1588
- metricName: ExceptionMetricType.ResolvedExceptionCount,
1589
- aggregationType: MetricsAggregationType.Sum,
1590
- legend: "Resolved",
1591
- },
1592
- }),
1593
- // Row 13: Section header
1594
- createTextComponent({
1595
- text: "Exception Recurrence",
1596
- top: 13,
1597
- left: 0,
1598
- width: 12,
1599
- height: 1,
1600
- isBold: true,
1601
- }),
1602
- // Row 14-16: Occurrence trends and top exceptions table
1603
- createChartComponent({
1604
- title: "Exception Occurrences Over Time",
1605
- chartType: DashboardChartType.Heatmap,
1606
- top: 14,
1607
- left: 0,
1608
- width: 6,
1609
- height: 3,
1610
- metricConfig: {
1611
- metricName: ExceptionMetricType.ExceptionOccurrenceCount,
1612
- aggregationType: MetricsAggregationType.Sum,
1613
- legend: "Occurrences",
1614
- },
1615
- }),
1616
- createTableComponent({
1617
- title: "Top Exceptions by Occurrence",
1618
- top: 14,
1619
- left: 6,
1620
- width: 6,
1621
- height: 3,
1622
- metricConfig: {
1623
- metricName: ExceptionMetricType.ExceptionOccurrenceCount,
1624
- aggregationType: MetricsAggregationType.Max,
1625
- },
1626
- }),
1627
- // Row 17: Section header
1628
- createTextComponent({
1629
- text: "Exception Details",
1630
- top: 17,
1631
- left: 0,
1632
- width: 12,
1633
- height: 1,
1634
- isBold: true,
1635
- }),
1636
- // Row 18-20: Logs and traces
1637
- createLogStreamComponent({
1638
- title: "Exception Logs",
1639
- top: 18,
1640
- left: 0,
1641
- width: 6,
1642
- height: 3,
1643
- }),
1644
- createTraceListComponent({
1645
- title: "Related Traces",
1646
- top: 18,
1647
- left: 6,
1648
- width: 6,
1649
- height: 3,
1650
- }),
1651
- ];
1652
- return {
1653
- _type: ObjectType.DashboardViewConfig,
1654
- components,
1655
- heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 21),
1656
- };
1657
- }
1658
- function createProfilesDashboardConfig() {
1659
- const components = [
1660
- // Row 0: Title
1661
- createTextComponent({
1662
- text: "Profiles Dashboard",
1663
- top: 0,
1664
- left: 0,
1665
- width: 12,
1666
- height: 1,
1667
- isBold: true,
1668
- }),
1669
- // Row 1: Key profile metrics
1670
- createValueComponent({
1671
- title: "Profile Count",
1672
- top: 1,
1673
- left: 0,
1674
- width: 3,
1675
- metricConfig: {
1676
- metricName: ProfileMetricType.ProfileCount,
1677
- aggregationType: MetricsAggregationType.Sum,
1678
- },
1679
- }),
1680
- createValueComponent({
1681
- title: "CPU Profile Duration",
1682
- top: 1,
1683
- left: 3,
1684
- width: 3,
1685
- metricConfig: {
1686
- metricName: ProfileMetricType.CpuProfileDuration,
1687
- aggregationType: MetricsAggregationType.Sum,
1688
- legendUnit: "ms",
1689
- },
1690
- }),
1691
- createValueComponent({
1692
- title: "Memory Allocations",
1693
- top: 1,
1694
- left: 6,
1695
- width: 3,
1696
- metricConfig: {
1697
- metricName: ProfileMetricType.MemoryAllocationCount,
1698
- aggregationType: MetricsAggregationType.Sum,
1699
- },
1700
- }),
1701
- createValueComponent({
1702
- title: "Thread Count",
1703
- top: 1,
1704
- left: 9,
1705
- width: 3,
1706
- metricConfig: {
1707
- metricName: ProfileMetricType.ThreadCount,
1708
- aggregationType: MetricsAggregationType.Avg,
1709
- },
1710
- }),
1711
- // Row 2-4: CPU profile charts
1712
- createChartComponent({
1713
- title: "CPU Profile Duration Over Time",
1714
- chartType: DashboardChartType.Line,
1715
- top: 2,
1716
- left: 0,
1717
- width: 6,
1718
- height: 3,
1719
- metricConfig: {
1720
- metricName: ProfileMetricType.CpuProfileDuration,
1721
- aggregationType: MetricsAggregationType.Avg,
1722
- legend: "CPU Duration",
1723
- legendUnit: "ms",
1724
- },
1725
- }),
1726
- createChartComponent({
1727
- title: "CPU Sample Count Over Time",
1728
- chartType: DashboardChartType.Bar,
1729
- top: 2,
1730
- left: 6,
1731
- width: 6,
1732
- height: 3,
1733
- metricConfig: {
1734
- metricName: ProfileMetricType.CpuProfileSampleCount,
1735
- aggregationType: MetricsAggregationType.Sum,
1736
- legend: "CPU Samples",
1737
- },
1738
- }),
1739
- // Row 5: Section header
1740
- createTextComponent({
1741
- text: "Memory Profiling",
1742
- top: 5,
1743
- left: 0,
1744
- width: 12,
1745
- height: 1,
1746
- isBold: true,
1747
- }),
1748
- // Row 6-8: Memory gauges and allocation charts
1749
- createGaugeComponent({
1750
- title: "Heap Usage",
1751
- top: 6,
1752
- left: 0,
1753
- width: 3,
1754
- height: 3,
1755
- minValue: 0,
1756
- maxValue: 100,
1757
- warningThreshold: 70,
1758
- criticalThreshold: 90,
1759
- metricConfig: {
1760
- metricName: ProfileMetricType.HeapUsage,
1761
- aggregationType: MetricsAggregationType.Avg,
1762
- },
1763
- }),
1764
- createChartComponent({
1765
- title: "Memory Allocation Size Over Time",
1766
- chartType: DashboardChartType.Area,
1767
- top: 6,
1768
- left: 3,
1769
- width: 6,
1770
- height: 3,
1771
- metricConfig: {
1772
- metricName: ProfileMetricType.MemoryAllocationSize,
1773
- aggregationType: MetricsAggregationType.Sum,
1774
- legend: "Allocation Size",
1775
- legendUnit: "bytes",
1776
- },
1777
- }),
1778
- createGaugeComponent({
1779
- title: "Thread Count",
1780
- top: 6,
1781
- left: 9,
1782
- width: 3,
1783
- height: 3,
1784
- minValue: 0,
1785
- maxValue: 500,
1786
- warningThreshold: 200,
1787
- criticalThreshold: 400,
1788
- metricConfig: {
1789
- metricName: ProfileMetricType.ThreadCount,
1790
- aggregationType: MetricsAggregationType.Avg,
1791
- },
1792
- }),
1793
- // Row 9: Section header
1794
- createTextComponent({
1795
- text: "Allocation Trends",
1796
- top: 9,
1797
- left: 0,
1798
- width: 12,
1799
- height: 1,
1800
- isBold: true,
1801
- }),
1802
- // Row 10-12: Allocation count trends and heap trends
1803
- createChartComponent({
1804
- title: "Memory Allocation Count Over Time",
1805
- chartType: DashboardChartType.Bar,
1806
- top: 10,
1807
- left: 0,
1808
- width: 6,
1809
- height: 3,
1810
- metricConfig: {
1811
- metricName: ProfileMetricType.MemoryAllocationCount,
1812
- aggregationType: MetricsAggregationType.Sum,
1813
- legend: "Allocations",
1814
- },
1815
- }),
1816
- createChartComponent({
1817
- title: "Heap Usage Over Time",
1818
- chartType: DashboardChartType.Area,
1819
- top: 10,
1820
- left: 6,
1821
- width: 6,
1822
- height: 3,
1823
- metricConfig: {
1824
- metricName: ProfileMetricType.HeapUsage,
1825
- aggregationType: MetricsAggregationType.Avg,
1826
- legend: "Heap",
1827
- legendUnit: "bytes",
1828
- },
1829
- }),
1830
- // Row 13: Section header
1831
- createTextComponent({
1832
- text: "Runtime & Concurrency",
1833
- top: 13,
1834
- left: 0,
1835
- width: 12,
1836
- height: 1,
1837
- isBold: true,
1838
- }),
1839
- // Row 14-16: Wall clock, goroutines/threads, sample rate
1840
- createChartComponent({
1841
- title: "Wall Clock Duration Over Time",
1842
- chartType: DashboardChartType.Line,
1843
- top: 14,
1844
- left: 0,
1845
- width: 6,
1846
- height: 3,
1847
- metricConfig: {
1848
- metricName: ProfileMetricType.WallClockDuration,
1849
- aggregationType: MetricsAggregationType.Avg,
1850
- legend: "Wall Clock",
1851
- legendUnit: "ms",
1852
- },
1853
- }),
1854
- createChartComponent({
1855
- title: "Goroutine / Thread Count Over Time",
1856
- chartType: DashboardChartType.StackedArea,
1857
- top: 14,
1858
- left: 6,
1859
- width: 6,
1860
- height: 3,
1861
- metricConfig: {
1862
- metricName: ProfileMetricType.GoroutineCount,
1863
- aggregationType: MetricsAggregationType.Avg,
1864
- legend: "Goroutines / Threads",
1865
- },
1866
- }),
1867
- // Row 17: Section header
1868
- createTextComponent({
1869
- text: "Hot Functions",
1870
- top: 17,
1871
- left: 0,
1872
- width: 12,
1873
- height: 1,
1874
- isBold: true,
1875
- }),
1876
- // Row 18-20: Top functions tables
1877
- createTableComponent({
1878
- title: "Top Functions by CPU Time",
1879
- top: 18,
1880
- left: 0,
1881
- width: 6,
1882
- height: 3,
1883
- metricConfig: {
1884
- metricName: ProfileMetricType.TopFunctionCpuTime,
1885
- aggregationType: MetricsAggregationType.Max,
1886
- },
1887
- }),
1888
- createTableComponent({
1889
- title: "Top Functions by Allocations",
1890
- top: 18,
1891
- left: 6,
1892
- width: 6,
1893
- height: 3,
1894
- metricConfig: {
1895
- metricName: ProfileMetricType.TopFunctionAllocations,
1896
- aggregationType: MetricsAggregationType.Max,
1897
- },
1898
- }),
1899
- // Row 21-23: Profile sample rate and logs
1900
- createChartComponent({
1901
- title: "Profile Sample Rate Over Time",
1902
- chartType: DashboardChartType.Line,
1903
- top: 21,
1904
- left: 0,
1905
- width: 6,
1906
- height: 3,
1907
- metricConfig: {
1908
- metricName: ProfileMetricType.ProfileSampleRate,
1909
- aggregationType: MetricsAggregationType.Avg,
1910
- legend: "Sample Rate",
1911
- legendUnit: "samples/s",
1912
- },
1913
- }),
1914
- createLogStreamComponent({
1915
- title: "Related Logs",
1916
- top: 21,
1917
- left: 6,
1918
- width: 6,
1919
- height: 3,
1920
- }),
1921
- ];
1922
- return {
1923
- _type: ObjectType.DashboardViewConfig,
1924
- components,
1925
- heightInDashboardUnits: Math.max(DashboardSize.heightInDashboardUnits, 24),
1926
- };
1927
- }
1928
1222
  export function getTemplateConfig(type) {
1929
1223
  switch (type) {
1930
1224
  case DashboardTemplateType.Monitor:
@@ -1935,12 +1229,6 @@ export function getTemplateConfig(type) {
1935
1229
  return createKubernetesDashboardConfig();
1936
1230
  case DashboardTemplateType.Metrics:
1937
1231
  return createMetricsDashboardConfig();
1938
- case DashboardTemplateType.Trace:
1939
- return createTraceDashboardConfig();
1940
- case DashboardTemplateType.Exception:
1941
- return createExceptionDashboardConfig();
1942
- case DashboardTemplateType.Profiles:
1943
- return createProfilesDashboardConfig();
1944
1232
  case DashboardTemplateType.Blank:
1945
1233
  return null;
1946
1234
  }