diff --git a/projects/observability/src/pages/apis/api-detail/overview/api-overview.dashboard.ts b/projects/observability/src/pages/apis/api-detail/overview/api-overview.dashboard.ts index dfa20929a..14e8d755e 100644 --- a/projects/observability/src/pages/apis/api-detail/overview/api-overview.dashboard.ts +++ b/projects/observability/src/pages/apis/api-detail/overview/api-overview.dashboard.ts @@ -1,6 +1,14 @@ import { Color } from '@hypertrace/common'; import { DashboardDefaultConfiguration, MetricAggregationType } from '@hypertrace/distributed-tracing'; import { LegendPosition } from '../../../../shared/components/legend/legend.component'; +import { + defaultPrimaryEdgeMetricCategories, + defaultSecondaryEdgeMetricCategories +} from '../../../../shared/dashboard/widgets/topology/metric/edge-metric-category'; +import { + defaultPrimaryNodeMetricCategories, + defaultSecondaryNodeMetricCategories +} from '../../../../shared/dashboard/widgets/topology/metric/node-metric-category'; // tslint:disable: max-file-line-count export const apiOverviewDashboard: DashboardDefaultConfiguration = { @@ -486,88 +494,200 @@ export const apiOverviewDashboard: DashboardDefaultConfiguration = { 'upstream-entities': ['SERVICE'], 'downstream-entities': ['API', 'BACKEND'], entity: 'API', - 'node-metrics': [ - { - type: 'percentile-latency-metric-aggregation', - 'display-name': 'P99 Latency' - }, - { - type: 'error-percentage-metric-aggregation', - aggregation: MetricAggregationType.Average, - 'display-name': 'Error Percentage' - }, - { - type: 'metric-aggregation', - metric: 'duration', - aggregation: MetricAggregationType.P50, - 'display-name': 'P50 Latency' - }, - { - type: 'metric-aggregation', - metric: 'errorCount', - aggregation: MetricAggregationType.Sum, - 'display-name': 'Errors' - }, - { - type: 'metric-aggregation', - metric: 'errorCount', - aggregation: MetricAggregationType.AvgrateSecond, - 'display-name': 'Errors/s' - }, - { - type: 'metric-aggregation', - metric: 'numCalls', - aggregation: MetricAggregationType.Sum, - 'display-name': 'Calls' - }, - { - type: 'metric-aggregation', - metric: 'numCalls', - aggregation: MetricAggregationType.AvgrateSecond, - 'display-name': 'Calls/s' - } - ], - 'edge-metrics': [ - { - type: 'percentile-latency-metric-aggregation', - 'display-name': 'P99 Latency' - }, - { - type: 'error-percentage-metric-aggregation', - aggregation: MetricAggregationType.Average, - 'display-name': 'Error Percentage' - }, - { - type: 'metric-aggregation', - metric: 'duration', - aggregation: MetricAggregationType.P50, - 'display-name': 'P50 Latency' + 'node-metrics': { + type: 'topology-metrics', + primary: { + type: 'topology-metric-with-category', + specification: { + type: 'percentile-latency-metric-aggregation', + 'display-name': 'P99 Latency' + }, + categories: [ + { + type: 'topology-metric-category', + ...defaultPrimaryNodeMetricCategories[0] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryNodeMetricCategories[1] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryNodeMetricCategories[2] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryNodeMetricCategories[3] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryNodeMetricCategories[4] + } + ] }, - { - type: 'metric-aggregation', - metric: 'errorCount', - aggregation: MetricAggregationType.Sum, - 'display-name': 'Errors' + secondary: { + type: 'topology-metric-with-category', + specification: { + type: 'error-percentage-metric-aggregation', + aggregation: MetricAggregationType.Average, + 'display-name': 'Error %' + }, + categories: [ + { + type: 'topology-metric-category', + ...defaultSecondaryNodeMetricCategories[0] + }, + { + type: 'topology-metric-category', + ...defaultSecondaryNodeMetricCategories[1] + } + ] }, - { - type: 'metric-aggregation', - metric: 'errorCount', - aggregation: MetricAggregationType.AvgrateSecond, - 'display-name': 'Errors/s' + others: [ + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'duration', + aggregation: MetricAggregationType.P50, + 'display-name': 'P50 Latency' + } + }, + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'errorCount', + aggregation: MetricAggregationType.Sum, + 'display-name': 'Errors' + } + }, + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'errorCount', + aggregation: MetricAggregationType.AvgrateSecond, + 'display-name': 'Errors/s' + } + }, + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'numCalls', + aggregation: MetricAggregationType.Sum, + 'display-name': 'Calls' + } + }, + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'numCalls', + aggregation: MetricAggregationType.AvgrateSecond, + 'display-name': 'Calls/s' + } + } + ] + }, + 'edge-metrics': { + type: 'topology-metrics', + primary: { + type: 'topology-metric-with-category', + specification: { + type: 'percentile-latency-metric-aggregation', + 'display-name': 'P99 Latency' + }, + categories: [ + { + type: 'topology-metric-category', + ...defaultPrimaryEdgeMetricCategories[0] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryEdgeMetricCategories[1] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryEdgeMetricCategories[2] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryEdgeMetricCategories[3] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryEdgeMetricCategories[4] + } + ] }, - { - type: 'metric-aggregation', - metric: 'numCalls', - aggregation: MetricAggregationType.Sum, - 'display-name': 'Calls' + secondary: { + type: 'topology-metric-with-category', + specification: { + type: 'error-percentage-metric-aggregation', + aggregation: MetricAggregationType.Average, + 'display-name': 'Error %' + }, + categories: [ + { + type: 'topology-metric-category', + ...defaultSecondaryEdgeMetricCategories[0] + }, + { + type: 'topology-metric-category', + ...defaultSecondaryEdgeMetricCategories[1] + } + ] }, - { - type: 'metric-aggregation', - metric: 'numCalls', - aggregation: MetricAggregationType.AvgrateSecond, - 'display-name': 'Calls/s' - } - ] + others: [ + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'duration', + aggregation: MetricAggregationType.P50, + 'display-name': 'P50 Latency' + } + }, + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'errorCount', + aggregation: MetricAggregationType.Sum, + 'display-name': 'Errors' + } + }, + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'errorCount', + aggregation: MetricAggregationType.AvgrateSecond, + 'display-name': 'Errors/s' + } + }, + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'numCalls', + aggregation: MetricAggregationType.Sum, + 'display-name': 'Calls' + } + }, + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'numCalls', + aggregation: MetricAggregationType.AvgrateSecond, + 'display-name': 'Calls/s' + } + } + ] + } } } ] diff --git a/projects/observability/src/pages/apis/service-detail/overview/service-overview.dashboard.ts b/projects/observability/src/pages/apis/service-detail/overview/service-overview.dashboard.ts index c9378e7fe..c3cae70ce 100644 --- a/projects/observability/src/pages/apis/service-detail/overview/service-overview.dashboard.ts +++ b/projects/observability/src/pages/apis/service-detail/overview/service-overview.dashboard.ts @@ -1,6 +1,14 @@ import { Color } from '@hypertrace/common'; import { DashboardDefaultConfiguration, MetricAggregationType } from '@hypertrace/distributed-tracing'; import { LegendPosition } from '../../../../shared/components/legend/legend.component'; +import { + defaultPrimaryEdgeMetricCategories, + defaultSecondaryEdgeMetricCategories +} from '../../../../shared/dashboard/widgets/topology/metric/edge-metric-category'; +import { + defaultPrimaryNodeMetricCategories, + defaultSecondaryNodeMetricCategories +} from '../../../../shared/dashboard/widgets/topology/metric/node-metric-category'; import { ObservabilityEntityType } from '../../../../shared/graphql/model/schema/entity'; // tslint:disable: max-file-line-count @@ -529,78 +537,182 @@ export const serviceOverviewDashboard: DashboardDefaultConfiguration = { type: 'topology-data-source', 'downstream-entities': ['API', 'BACKEND'], entity: 'SERVICE', - 'node-metrics': [ - { - type: 'percentile-latency-metric-aggregation', - 'display-name': 'P99 Latency' - }, - { - type: 'metric-aggregation', - metric: 'duration', - aggregation: MetricAggregationType.P50, - 'display-name': 'P50 Latency' - }, - { - type: 'error-percentage-metric-aggregation', - aggregation: MetricAggregationType.Average, - 'display-name': 'Error %' - }, - - { - type: 'metric-aggregation', - metric: 'errorCount', - aggregation: MetricAggregationType.Sum, - 'display-name': 'Error Count' - }, - { - type: 'metric-aggregation', - metric: 'numCalls', - aggregation: MetricAggregationType.AvgrateSecond, - 'display-name': 'Call Rate/sec' - }, - { - type: 'metric-aggregation', - metric: 'numCalls', - aggregation: MetricAggregationType.Sum, - 'display-name': 'Call Count' - } - ], - 'edge-metrics': [ - { - type: 'percentile-latency-metric-aggregation', - 'display-name': 'P99 Latency' - }, - { - type: 'metric-aggregation', - metric: 'duration', - aggregation: MetricAggregationType.P50, - 'display-name': 'P50 Latency' + 'node-metrics': { + type: 'topology-metrics', + primary: { + type: 'topology-metric-with-category', + specification: { + type: 'percentile-latency-metric-aggregation', + 'display-name': 'P99 Latency' + }, + categories: [ + { + type: 'topology-metric-category', + ...defaultPrimaryNodeMetricCategories[0] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryNodeMetricCategories[1] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryNodeMetricCategories[2] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryNodeMetricCategories[3] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryNodeMetricCategories[4] + } + ] }, - { - type: 'error-percentage-metric-aggregation', - aggregation: MetricAggregationType.Average, - 'display-name': 'Error %' + secondary: { + type: 'topology-metric-with-category', + specification: { + type: 'error-percentage-metric-aggregation', + aggregation: MetricAggregationType.Average, + 'display-name': 'Error %' + }, + categories: [ + { + type: 'topology-metric-category', + ...defaultSecondaryNodeMetricCategories[0] + }, + { + type: 'topology-metric-category', + ...defaultSecondaryNodeMetricCategories[1] + } + ] }, - - { - type: 'metric-aggregation', - metric: 'errorCount', - aggregation: MetricAggregationType.Sum, - 'display-name': 'Error Count' + others: [ + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'duration', + aggregation: MetricAggregationType.P50, + 'display-name': 'P50 Latency' + } + }, + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'errorCount', + aggregation: MetricAggregationType.Sum, + 'display-name': 'Error Count' + } + }, + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'numCalls', + aggregation: MetricAggregationType.AvgrateSecond, + 'display-name': 'Call Rate/sec' + } + }, + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'numCalls', + aggregation: MetricAggregationType.Sum, + 'display-name': 'Call Count' + } + } + ] + }, + 'edge-metrics': { + type: 'topology-metrics', + primary: { + type: 'topology-metric-with-category', + specification: { + type: 'percentile-latency-metric-aggregation', + 'display-name': 'P99 Latency' + }, + categories: [ + { + type: 'topology-metric-category', + ...defaultPrimaryEdgeMetricCategories[0] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryEdgeMetricCategories[1] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryEdgeMetricCategories[2] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryEdgeMetricCategories[3] + }, + { + type: 'topology-metric-category', + ...defaultPrimaryEdgeMetricCategories[4] + } + ] }, - { - type: 'metric-aggregation', - metric: 'numCalls', - aggregation: MetricAggregationType.AvgrateSecond, - 'display-name': 'Call Rate/sec' + secondary: { + type: 'topology-metric-with-category', + specification: { + type: 'error-percentage-metric-aggregation', + aggregation: MetricAggregationType.Average, + 'display-name': 'Error %' + }, + categories: [ + { + type: 'topology-metric-category', + ...defaultSecondaryEdgeMetricCategories[0] + }, + { + type: 'topology-metric-category', + ...defaultSecondaryEdgeMetricCategories[1] + } + ] }, - { - type: 'metric-aggregation', - metric: 'numCalls', - aggregation: MetricAggregationType.Sum, - 'display-name': 'Call Count' - } - ] + others: [ + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'duration', + aggregation: MetricAggregationType.P50, + 'display-name': 'P50 Latency' + } + }, + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'errorCount', + aggregation: MetricAggregationType.Sum, + 'display-name': 'Error Count' + } + }, + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'numCalls', + aggregation: MetricAggregationType.AvgrateSecond, + 'display-name': 'Call Rate/sec' + } + }, + { + type: 'topology-metric-with-category', + specification: { + type: 'metric-aggregation', + metric: 'numCalls', + aggregation: MetricAggregationType.Sum, + 'display-name': 'Call Count' + } + } + ] + } } } ] diff --git a/projects/observability/src/public-api.ts b/projects/observability/src/public-api.ts index 122e27979..7a7908208 100644 --- a/projects/observability/src/public-api.ts +++ b/projects/observability/src/public-api.ts @@ -157,6 +157,10 @@ export * from './shared/components/topology/renderers/tooltip/topology-tooltip-r export * from './shared/components/topology/topology.component'; export * from './shared/components/topology/topology.module'; +// Topology Metric +export * from './shared/dashboard/widgets/topology/metric/edge-metric-category'; +export * from './shared/dashboard/widgets/topology/metric/node-metric-category'; + // API Trace Waterfall Data Source export * from './shared/dashboard/data/graphql/waterfall/api-trace-waterfall-data-source.model';