Skip to content

Commit a738259

Browse files
committed
feat: enable metric health bands
1 parent cda2439 commit a738259

File tree

9 files changed

+167
-6
lines changed

9 files changed

+167
-6
lines changed

projects/observability/src/pages/apis/api-detail/metrics/api-metrics.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ReplayObservable } from '@hypertrace/common';
33
import { NavigableDashboardFilterConfig } from '@hypertrace/distributed-tracing';
44
import { map } from 'rxjs/operators';
55
import { ApiDetailService } from '../api-detail.service';
6-
import { apiMetricsDashboard } from './api-metrics-dashboard';
6+
import { apiMetricsDashboard } from './api-metrics.dashboard';
77

88
@Component({
99
changeDetection: ChangeDetectionStrategy.OnPush,

projects/observability/src/pages/apis/api-detail/metrics/api-metrics-dashboard.ts renamed to projects/observability/src/pages/apis/api-detail/metrics/api-metrics.dashboard.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,22 @@ export const apiMetricsDashboard: DashboardDefaultConfiguration = {
200200
'color-palette': RED_COLOR_PALETTE,
201201
'selectable-interval': true,
202202
'legend-position': LegendPosition.TopLeft,
203+
bands: [
204+
{
205+
type: 'band',
206+
name: 'Average Baseline',
207+
'upper-bound-name': 'Average Upper Bound',
208+
'lower-bound-name': 'Average Lower Bound',
209+
data: {
210+
type: 'entity-metric-timeseries-data-source',
211+
metric: {
212+
type: 'metric-timeseries-band',
213+
metric: 'duration',
214+
aggregation: MetricAggregationType.Average
215+
}
216+
}
217+
}
218+
],
203219
series: [
204220
{
205221
type: 'series',
@@ -321,6 +337,22 @@ export const apiMetricsDashboard: DashboardDefaultConfiguration = {
321337
'legend-position': LegendPosition.None,
322338
'show-summary': true,
323339
title: 'Error Rate',
340+
bands: [
341+
{
342+
type: 'band',
343+
name: 'Baseline',
344+
'upper-bound-name': 'Upper Bound',
345+
'lower-bound-name': 'Lower Bound',
346+
data: {
347+
type: 'entity-metric-timeseries-data-source',
348+
metric: {
349+
type: 'metric-timeseries-band',
350+
metric: 'errorCount',
351+
aggregation: MetricAggregationType.AvgrateSecond
352+
}
353+
}
354+
}
355+
],
324356
series: [
325357
{
326358
type: 'series',

projects/observability/src/pages/apis/api-detail/metrics/api-metrics.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { NgModule } from '@angular/core';
33
import { FilterBarModule, LoadAsyncModule } from '@hypertrace/components';
44
import { NavigableDashboardModule } from '@hypertrace/distributed-tracing';
55
import { ObservabilityDashboardModule } from '../../../../shared/dashboard/observability-dashboard.module';
6-
import { apiMetricsDashboard } from './api-metrics-dashboard';
76
import { ApiMetricsComponent } from './api-metrics.component';
7+
import { apiMetricsDashboard } from './api-metrics.dashboard';
88

99
@NgModule({
1010
imports: [

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

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,22 @@ export const apiOverviewDashboard: DashboardDefaultConfiguration = {
211211
'min-upper-limit': 25
212212
},
213213
'max-series-data-points': 150,
214+
bands: [
215+
{
216+
type: 'band',
217+
name: 'P99 Baseline',
218+
'upper-bound-name': 'P99 Upper Bound',
219+
'lower-bound-name': 'P99 Lower Bound',
220+
data: {
221+
type: 'entity-metric-timeseries-data-source',
222+
metric: {
223+
type: 'metric-timeseries-band',
224+
metric: 'duration',
225+
aggregation: MetricAggregationType.P99
226+
}
227+
}
228+
}
229+
],
214230
series: [
215231
{
216232
type: 'series',
@@ -288,6 +304,22 @@ export const apiOverviewDashboard: DashboardDefaultConfiguration = {
288304
'min-upper-limit': 25
289305
},
290306
'max-series-data-points': 150,
307+
bands: [
308+
{
309+
type: 'band',
310+
name: 'Errors Baseline',
311+
'upper-bound-name': 'Errors Upper Bound',
312+
'lower-bound-name': 'Errors Lower Bound',
313+
data: {
314+
type: 'entity-metric-timeseries-data-source',
315+
metric: {
316+
type: 'metric-timeseries-band',
317+
metric: 'errorCount',
318+
aggregation: MetricAggregationType.Sum
319+
}
320+
}
321+
}
322+
],
291323
series: [
292324
{
293325
type: 'series',
@@ -366,6 +398,22 @@ export const apiOverviewDashboard: DashboardDefaultConfiguration = {
366398
'min-upper-limit': 25
367399
},
368400
'max-series-data-points': 150,
401+
bands: [
402+
{
403+
type: 'band',
404+
name: 'Calls Baseline',
405+
'upper-bound-name': 'Calls Upper Bound',
406+
'lower-bound-name': 'Calls Lower Bound',
407+
data: {
408+
type: 'entity-metric-timeseries-data-source',
409+
metric: {
410+
type: 'metric-timeseries-band',
411+
metric: 'numCalls',
412+
aggregation: MetricAggregationType.Sum
413+
}
414+
}
415+
}
416+
],
369417
series: [
370418
{
371419
type: 'series',

projects/observability/src/pages/apis/service-detail/metrics/service-metrics.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ import { serviceMetricsDashboard } from './service-metrics.dashboard';
1818
})
1919
export class ServiceMetricsComponent {
2020
public readonly filterConfig$: ReplayObservable<NavigableDashboardFilterConfig>;
21-
public constructor(serviceDetailService: ServiceDetailService) {
22-
this.filterConfig$ = serviceDetailService.entityFilter$.pipe(
21+
22+
public constructor(private readonly serviceDetailService: ServiceDetailService) {
23+
this.filterConfig$ = this.serviceDetailService.entityFilter$.pipe(
2324
map(filter => ({
2425
implicitFilters: [filter]
2526
}))

projects/observability/src/pages/apis/service-detail/metrics/service-metrics.dashboard.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,22 @@ export const serviceMetricsDashboard: DashboardDefaultConfiguration = {
200200
'color-palette': RED_COLOR_PALETTE,
201201
'selectable-interval': true,
202202
'legend-position': LegendPosition.TopLeft,
203+
bands: [
204+
{
205+
type: 'band',
206+
name: 'Average Baseline',
207+
'upper-bound-name': 'Average Upper Bound',
208+
'lower-bound-name': 'Average Lower Bound',
209+
data: {
210+
type: 'entity-metric-timeseries-data-source',
211+
metric: {
212+
type: 'metric-timeseries-band',
213+
metric: 'duration',
214+
aggregation: MetricAggregationType.Average
215+
}
216+
}
217+
}
218+
],
203219
series: [
204220
{
205221
type: 'series',
@@ -321,6 +337,22 @@ export const serviceMetricsDashboard: DashboardDefaultConfiguration = {
321337
'legend-position': LegendPosition.None,
322338
'show-summary': true,
323339
title: 'Error Rate',
340+
bands: [
341+
{
342+
type: 'band',
343+
name: 'Baseline',
344+
'upper-bound-name': 'Upper Bound',
345+
'lower-bound-name': 'Lower Bound',
346+
data: {
347+
type: 'entity-metric-timeseries-data-source',
348+
metric: {
349+
type: 'metric-timeseries-band',
350+
metric: 'errorCount',
351+
aggregation: MetricAggregationType.AvgrateSecond
352+
}
353+
}
354+
}
355+
],
324356
series: [
325357
{
326358
type: 'series',

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

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,22 @@ export const serviceOverviewDashboard: DashboardDefaultConfiguration = {
255255
'min-upper-limit': 25
256256
},
257257
'max-series-data-points': 150,
258+
bands: [
259+
{
260+
type: 'band',
261+
name: 'P99 Baseline',
262+
'upper-bound-name': 'P99 Upper Bound',
263+
'lower-bound-name': 'P99 Lower Bound',
264+
data: {
265+
type: 'entity-metric-timeseries-data-source',
266+
metric: {
267+
type: 'metric-timeseries-band',
268+
metric: 'duration',
269+
aggregation: MetricAggregationType.P99
270+
}
271+
}
272+
}
273+
],
258274
series: [
259275
{
260276
type: 'series',
@@ -332,6 +348,22 @@ export const serviceOverviewDashboard: DashboardDefaultConfiguration = {
332348
'min-upper-limit': 25
333349
},
334350
'max-series-data-points': 150,
351+
bands: [
352+
{
353+
type: 'band',
354+
name: 'Errors Baseline',
355+
'upper-bound-name': 'Errors Upper Bound',
356+
'lower-bound-name': 'Errors Lower Bound',
357+
data: {
358+
type: 'entity-metric-timeseries-data-source',
359+
metric: {
360+
type: 'metric-timeseries-band',
361+
metric: 'errorCount',
362+
aggregation: MetricAggregationType.Sum
363+
}
364+
}
365+
}
366+
],
335367
series: [
336368
{
337369
type: 'series',
@@ -410,6 +442,22 @@ export const serviceOverviewDashboard: DashboardDefaultConfiguration = {
410442
'min-upper-limit': 25
411443
},
412444
'max-series-data-points': 150,
445+
bands: [
446+
{
447+
type: 'band',
448+
name: 'Calls Baseline',
449+
'upper-bound-name': 'Calls Upper Bound',
450+
'lower-bound-name': 'Calls Lower Bound',
451+
data: {
452+
type: 'entity-metric-timeseries-data-source',
453+
metric: {
454+
type: 'metric-timeseries-band',
455+
metric: 'numCalls',
456+
aggregation: MetricAggregationType.Sum
457+
}
458+
}
459+
}
460+
],
413461
series: [
414462
{
415463
type: 'series',

projects/observability/src/public-api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export * from './shared/components/topology/topology.module';
146146
export * from './shared/dashboard/data/graphql/waterfall/api-trace-waterfall-data-source.model';
147147

148148
// Dashboards
149-
export * from './pages/apis/api-detail/metrics/api-metrics-dashboard';
149+
export * from './pages/apis/api-detail/metrics/api-metrics.dashboard';
150150
export * from './pages/apis/api-detail/overview/api-overview.dashboard';
151151
export * from './pages/apis/service-detail/metrics/service-metrics.dashboard';
152152
export * from './pages/apis/service-detail/overview/service-overview.dashboard';

projects/observability/src/shared/dashboard/widgets/charts/cartesian-widget/cartesian-widget.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class CartesianWidgetModel<TInterval> {
5252
key: 'show-bands',
5353
type: BOOLEAN_PROPERTY.type
5454
})
55-
public showBands: boolean = true;
55+
public showBands: boolean = false;
5656

5757
@ModelProperty({
5858
key: 'color-palette',

0 commit comments

Comments
 (0)