Skip to content

Commit 3f829c6

Browse files
fix: topology error fix due to change in metrics model (#1005)
1 parent 3b2f84b commit 3f829c6

File tree

3 files changed

+382
-146
lines changed

3 files changed

+382
-146
lines changed

projects/observability/src/pages/apis/api-detail/overview/api-overview.dashboard.ts

Lines changed: 198 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import { Color } from '@hypertrace/common';
22
import { DashboardDefaultConfiguration, MetricAggregationType } from '@hypertrace/distributed-tracing';
33
import { LegendPosition } from '../../../../shared/components/legend/legend.component';
4+
import {
5+
defaultPrimaryEdgeMetricCategories,
6+
defaultSecondaryEdgeMetricCategories
7+
} from '../../../../shared/dashboard/widgets/topology/metric/edge-metric-category';
8+
import {
9+
defaultPrimaryNodeMetricCategories,
10+
defaultSecondaryNodeMetricCategories
11+
} from '../../../../shared/dashboard/widgets/topology/metric/node-metric-category';
412

513
// tslint:disable: max-file-line-count
614
export const apiOverviewDashboard: DashboardDefaultConfiguration = {
@@ -486,88 +494,200 @@ export const apiOverviewDashboard: DashboardDefaultConfiguration = {
486494
'upstream-entities': ['SERVICE'],
487495
'downstream-entities': ['API', 'BACKEND'],
488496
entity: 'API',
489-
'node-metrics': [
490-
{
491-
type: 'percentile-latency-metric-aggregation',
492-
'display-name': 'P99 Latency'
493-
},
494-
{
495-
type: 'error-percentage-metric-aggregation',
496-
aggregation: MetricAggregationType.Average,
497-
'display-name': 'Error Percentage'
498-
},
499-
{
500-
type: 'metric-aggregation',
501-
metric: 'duration',
502-
aggregation: MetricAggregationType.P50,
503-
'display-name': 'P50 Latency'
504-
},
505-
{
506-
type: 'metric-aggregation',
507-
metric: 'errorCount',
508-
aggregation: MetricAggregationType.Sum,
509-
'display-name': 'Errors'
510-
},
511-
{
512-
type: 'metric-aggregation',
513-
metric: 'errorCount',
514-
aggregation: MetricAggregationType.AvgrateSecond,
515-
'display-name': 'Errors/s'
516-
},
517-
{
518-
type: 'metric-aggregation',
519-
metric: 'numCalls',
520-
aggregation: MetricAggregationType.Sum,
521-
'display-name': 'Calls'
522-
},
523-
{
524-
type: 'metric-aggregation',
525-
metric: 'numCalls',
526-
aggregation: MetricAggregationType.AvgrateSecond,
527-
'display-name': 'Calls/s'
528-
}
529-
],
530-
'edge-metrics': [
531-
{
532-
type: 'percentile-latency-metric-aggregation',
533-
'display-name': 'P99 Latency'
534-
},
535-
{
536-
type: 'error-percentage-metric-aggregation',
537-
aggregation: MetricAggregationType.Average,
538-
'display-name': 'Error Percentage'
539-
},
540-
{
541-
type: 'metric-aggregation',
542-
metric: 'duration',
543-
aggregation: MetricAggregationType.P50,
544-
'display-name': 'P50 Latency'
497+
'node-metrics': {
498+
type: 'topology-metrics',
499+
primary: {
500+
type: 'topology-metric-with-category',
501+
specification: {
502+
type: 'percentile-latency-metric-aggregation',
503+
'display-name': 'P99 Latency'
504+
},
505+
categories: [
506+
{
507+
type: 'topology-metric-category',
508+
...defaultPrimaryNodeMetricCategories[0]
509+
},
510+
{
511+
type: 'topology-metric-category',
512+
...defaultPrimaryNodeMetricCategories[1]
513+
},
514+
{
515+
type: 'topology-metric-category',
516+
...defaultPrimaryNodeMetricCategories[2]
517+
},
518+
{
519+
type: 'topology-metric-category',
520+
...defaultPrimaryNodeMetricCategories[3]
521+
},
522+
{
523+
type: 'topology-metric-category',
524+
...defaultPrimaryNodeMetricCategories[4]
525+
}
526+
]
545527
},
546-
{
547-
type: 'metric-aggregation',
548-
metric: 'errorCount',
549-
aggregation: MetricAggregationType.Sum,
550-
'display-name': 'Errors'
528+
secondary: {
529+
type: 'topology-metric-with-category',
530+
specification: {
531+
type: 'error-percentage-metric-aggregation',
532+
aggregation: MetricAggregationType.Average,
533+
'display-name': 'Error %'
534+
},
535+
categories: [
536+
{
537+
type: 'topology-metric-category',
538+
...defaultSecondaryNodeMetricCategories[0]
539+
},
540+
{
541+
type: 'topology-metric-category',
542+
...defaultSecondaryNodeMetricCategories[1]
543+
}
544+
]
551545
},
552-
{
553-
type: 'metric-aggregation',
554-
metric: 'errorCount',
555-
aggregation: MetricAggregationType.AvgrateSecond,
556-
'display-name': 'Errors/s'
546+
others: [
547+
{
548+
type: 'topology-metric-with-category',
549+
specification: {
550+
type: 'metric-aggregation',
551+
metric: 'duration',
552+
aggregation: MetricAggregationType.P50,
553+
'display-name': 'P50 Latency'
554+
}
555+
},
556+
{
557+
type: 'topology-metric-with-category',
558+
specification: {
559+
type: 'metric-aggregation',
560+
metric: 'errorCount',
561+
aggregation: MetricAggregationType.Sum,
562+
'display-name': 'Errors'
563+
}
564+
},
565+
{
566+
type: 'topology-metric-with-category',
567+
specification: {
568+
type: 'metric-aggregation',
569+
metric: 'errorCount',
570+
aggregation: MetricAggregationType.AvgrateSecond,
571+
'display-name': 'Errors/s'
572+
}
573+
},
574+
{
575+
type: 'topology-metric-with-category',
576+
specification: {
577+
type: 'metric-aggregation',
578+
metric: 'numCalls',
579+
aggregation: MetricAggregationType.Sum,
580+
'display-name': 'Calls'
581+
}
582+
},
583+
{
584+
type: 'topology-metric-with-category',
585+
specification: {
586+
type: 'metric-aggregation',
587+
metric: 'numCalls',
588+
aggregation: MetricAggregationType.AvgrateSecond,
589+
'display-name': 'Calls/s'
590+
}
591+
}
592+
]
593+
},
594+
'edge-metrics': {
595+
type: 'topology-metrics',
596+
primary: {
597+
type: 'topology-metric-with-category',
598+
specification: {
599+
type: 'percentile-latency-metric-aggregation',
600+
'display-name': 'P99 Latency'
601+
},
602+
categories: [
603+
{
604+
type: 'topology-metric-category',
605+
...defaultPrimaryEdgeMetricCategories[0]
606+
},
607+
{
608+
type: 'topology-metric-category',
609+
...defaultPrimaryEdgeMetricCategories[1]
610+
},
611+
{
612+
type: 'topology-metric-category',
613+
...defaultPrimaryEdgeMetricCategories[2]
614+
},
615+
{
616+
type: 'topology-metric-category',
617+
...defaultPrimaryEdgeMetricCategories[3]
618+
},
619+
{
620+
type: 'topology-metric-category',
621+
...defaultPrimaryEdgeMetricCategories[4]
622+
}
623+
]
557624
},
558-
{
559-
type: 'metric-aggregation',
560-
metric: 'numCalls',
561-
aggregation: MetricAggregationType.Sum,
562-
'display-name': 'Calls'
625+
secondary: {
626+
type: 'topology-metric-with-category',
627+
specification: {
628+
type: 'error-percentage-metric-aggregation',
629+
aggregation: MetricAggregationType.Average,
630+
'display-name': 'Error %'
631+
},
632+
categories: [
633+
{
634+
type: 'topology-metric-category',
635+
...defaultSecondaryEdgeMetricCategories[0]
636+
},
637+
{
638+
type: 'topology-metric-category',
639+
...defaultSecondaryEdgeMetricCategories[1]
640+
}
641+
]
563642
},
564-
{
565-
type: 'metric-aggregation',
566-
metric: 'numCalls',
567-
aggregation: MetricAggregationType.AvgrateSecond,
568-
'display-name': 'Calls/s'
569-
}
570-
]
643+
others: [
644+
{
645+
type: 'topology-metric-with-category',
646+
specification: {
647+
type: 'metric-aggregation',
648+
metric: 'duration',
649+
aggregation: MetricAggregationType.P50,
650+
'display-name': 'P50 Latency'
651+
}
652+
},
653+
{
654+
type: 'topology-metric-with-category',
655+
specification: {
656+
type: 'metric-aggregation',
657+
metric: 'errorCount',
658+
aggregation: MetricAggregationType.Sum,
659+
'display-name': 'Errors'
660+
}
661+
},
662+
{
663+
type: 'topology-metric-with-category',
664+
specification: {
665+
type: 'metric-aggregation',
666+
metric: 'errorCount',
667+
aggregation: MetricAggregationType.AvgrateSecond,
668+
'display-name': 'Errors/s'
669+
}
670+
},
671+
{
672+
type: 'topology-metric-with-category',
673+
specification: {
674+
type: 'metric-aggregation',
675+
metric: 'numCalls',
676+
aggregation: MetricAggregationType.Sum,
677+
'display-name': 'Calls'
678+
}
679+
},
680+
{
681+
type: 'topology-metric-with-category',
682+
specification: {
683+
type: 'metric-aggregation',
684+
metric: 'numCalls',
685+
aggregation: MetricAggregationType.AvgrateSecond,
686+
'display-name': 'Calls/s'
687+
}
688+
}
689+
]
690+
}
571691
}
572692
}
573693
]

0 commit comments

Comments
 (0)