Skip to content

Commit ef4495e

Browse files
authored
Merge branch 'main' into update-order-by
2 parents 161737e + 35b7136 commit ef4495e

16 files changed

+107
-17
lines changed

projects/distributed-tracing/src/shared/dashboard/data/graphql/waterfall/trace-waterfall-data-source.model.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ describe('Trace Waterfall data source model', () => {
9292
}),
9393
expect.objectContaining({
9494
name: 'traceId'
95+
}),
96+
expect.objectContaining({
97+
name: 'errorCount'
9598
})
9699
]
97100
}
@@ -149,6 +152,9 @@ describe('Trace Waterfall data source model', () => {
149152
}),
150153
expect.objectContaining({
151154
name: 'traceId'
155+
}),
156+
expect.objectContaining({
157+
name: 'errorCount'
152158
})
153159
]
154160
}

projects/distributed-tracing/src/shared/dashboard/data/graphql/waterfall/trace-waterfall-data-source.model.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ export class TraceWaterfallDataSourceModel extends GraphQlDataSourceModel<Waterf
5656
this.specificationBuilder.attributeSpecificationForKey('spanTags'),
5757
this.specificationBuilder.attributeSpecificationForKey('startTime'),
5858
this.specificationBuilder.attributeSpecificationForKey('type'),
59-
this.specificationBuilder.attributeSpecificationForKey('traceId')
59+
this.specificationBuilder.attributeSpecificationForKey('traceId'),
60+
this.specificationBuilder.attributeSpecificationForKey('errorCount')
6061
];
6162

6263
public getData(): Observable<WaterfallData[]> {
@@ -100,7 +101,8 @@ export class TraceWaterfallDataSourceModel extends GraphQlDataSourceModel<Waterf
100101
serviceName: span.serviceName as string,
101102
protocolName: span.protocolName as string,
102103
spanType: span.type as SpanType,
103-
tags: span.spanTags as Dictionary<unknown>
104+
tags: span.spanTags as Dictionary<unknown>,
105+
errorCount: span.errorCount as number
104106
}));
105107
}
106108
}

projects/distributed-tracing/src/shared/dashboard/widgets/waterfall/waterfall/span-name/span-name-cell-data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ export interface SpanNameCellData {
33
protocolName: string;
44
name: string;
55
color?: string;
6+
hasError?: boolean;
67
}

projects/distributed-tracing/src/shared/dashboard/widgets/waterfall/waterfall/span-name/span-name-table-cell-renderer.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
.span-title {
99
display: grid;
10-
grid-template-columns: 3px min-content min-content auto;
10+
grid-template-columns: 3px min-content min-content min-content auto;
1111
grid-template-rows: 1fr;
1212
column-gap: 4px;
1313

projects/distributed-tracing/src/shared/dashboard/widgets/waterfall/waterfall/span-name/span-name-table-cell-renderer.component.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('Span name table cell renderer component', () => {
2727
shallow: true
2828
});
2929

30-
test('should render span name without color and build tooltip ', () => {
30+
test('should render span name without color and error icon and build tooltip ', () => {
3131
const spectator = buildComponent();
3232

3333
const tooltip = `${spanNameData.serviceName} ${spanNameData.protocolName} ${spanNameData.name}`;
@@ -38,12 +38,14 @@ describe('Span name table cell renderer component', () => {
3838
expect(spectator.query('.protocol-name')).toHaveText('test-protocol');
3939
expect(spectator.query('.span-name')).toHaveText('test-span-name');
4040
expect(spectator.query('.color-bar')).not.toExist();
41+
expect(spectator.query('.error-icon')).not.toExist();
4142
});
4243

43-
test('should render span name with color and build tooltip ', () => {
44+
test('should render span name with color and error icon and build tooltip ', () => {
4445
const spanNameDataWithColor = {
4546
...spanNameData,
46-
color: 'blue'
47+
color: 'blue',
48+
hasError: true
4749
};
4850
const spectator = buildComponent({
4951
providers: [tableCellDataProvider(spanNameDataWithColor)]
@@ -57,5 +59,6 @@ describe('Span name table cell renderer component', () => {
5759
expect(spectator.query('.protocol-name')).toHaveText('test-protocol');
5860
expect(spectator.query('.span-name')).toHaveText('test-span-name');
5961
expect(spectator.query('.color-bar')).toExist();
62+
expect(spectator.query('.error-icon')).toExist();
6063
});
6164
});

projects/distributed-tracing/src/shared/dashboard/widgets/waterfall/waterfall/span-name/span-name-table-cell-renderer.component.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { ChangeDetectionStrategy, Component } from '@angular/core';
2-
import { TableCellAlignmentType, TableCellRenderer, TableCellRendererBase } from '@hypertrace/components';
2+
import { IconType } from '@hypertrace/assets-library';
3+
import { Color } from '@hypertrace/common';
4+
import { IconSize, TableCellAlignmentType, TableCellRenderer, TableCellRendererBase } from '@hypertrace/components';
35
import { SpanNameCellData } from './span-name-cell-data';
46
import { WaterfallTableCellType } from './span-name-cell-type';
57

@@ -19,6 +21,13 @@ import { WaterfallTableCellType } from './span-name-cell-type';
1921
<div class="span-name">
2022
<span class="text" data-sensitive-pii>{{ this.value.name }}</span>
2123
</div>
24+
<ht-icon
25+
*ngIf="this.value.hasError"
26+
class="error-icon"
27+
icon="${IconType.Error}"
28+
size="${IconSize.Medium}"
29+
color="${Color.Red5}"
30+
></ht-icon>
2231
</div>
2332
`
2433
})

projects/distributed-tracing/src/shared/dashboard/widgets/waterfall/waterfall/waterfall-chart.component.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ describe('Waterfall Chart component', () => {
3030
requestBody: 'Request Body',
3131
responseHeaders: {},
3232
responseBody: 'Response Body',
33-
tags: {}
33+
tags: {},
34+
errorCount: 0
3435
},
3536
{
3637
id: 'second-id',
@@ -50,7 +51,8 @@ describe('Waterfall Chart component', () => {
5051
requestBody: '',
5152
responseHeaders: {},
5253
responseBody: '',
53-
tags: {}
54+
tags: {},
55+
errorCount: 0
5456
},
5557
{
5658
id: 'third-id',
@@ -70,7 +72,8 @@ describe('Waterfall Chart component', () => {
7072
requestBody: '',
7173
responseHeaders: {},
7274
responseBody: '',
73-
tags: {}
75+
tags: {},
76+
errorCount: 0
7477
}
7578
];
7679

projects/distributed-tracing/src/shared/dashboard/widgets/waterfall/waterfall/waterfall-chart.module.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { CommonModule } from '@angular/common';
22
import { NgModule } from '@angular/core';
3-
import { SequenceChartModule, TableModule, TooltipModule } from '@hypertrace/components';
3+
import { IconModule, SequenceChartModule, TableModule, TooltipModule } from '@hypertrace/components';
44
import { SpanNameTableCellParser } from './span-name/span-name-table-cell-parser';
55
import { SpanNameTableCellRendererComponent } from './span-name/span-name-table-cell-renderer.component';
66
import { WaterfallChartComponent } from './waterfall-chart.component';
@@ -12,7 +12,8 @@ import { WaterfallChartComponent } from './waterfall-chart.component';
1212
CommonModule,
1313
TableModule.withCellParsers([SpanNameTableCellParser]),
1414
TableModule.withCellRenderers([SpanNameTableCellRendererComponent]),
15-
TooltipModule
15+
TooltipModule,
16+
IconModule
1617
],
1718
exports: [WaterfallChartComponent]
1819
})

projects/distributed-tracing/src/shared/dashboard/widgets/waterfall/waterfall/waterfall-chart.service.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ export class WaterfallChartService {
4141
$$spanName: {
4242
name: datum.name,
4343
serviceName: datum.serviceName,
44-
protocolName: datum.protocolName
44+
protocolName: datum.protocolName,
45+
hasError: datum.errorCount > 0
4546
},
4647
$$iconType: this.iconLookupService.forSpanType(datum.spanType)!,
4748
getChildren: () => of([]),
@@ -82,7 +83,6 @@ export class WaterfallChartService {
8283
// Do DFS
8384
while (sequenceNodes.length !== 0) {
8485
const node = sequenceNodes.shift()!;
85-
8686
if (node.$$state.expanded) {
8787
segments.push({
8888
id: node.id,
@@ -123,7 +123,10 @@ export class WaterfallChartService {
123123
const node = nodes.shift()!;
124124
let color;
125125

126-
if (colorMap.has(node.serviceName)) {
126+
if (node.$$spanName.hasError) {
127+
// If span contains an error
128+
color = Color.Red5;
129+
} else if (colorMap.has(node.serviceName)) {
127130
// ServiceName seen before. Use existing service color
128131
color = colorMap.get(node.serviceName)!;
129132
} else {

projects/distributed-tracing/src/shared/dashboard/widgets/waterfall/waterfall/waterfall-chart.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export interface WaterfallData {
2222
responseHeaders?: Dictionary<unknown>;
2323
responseBody?: string;
2424
tags: Dictionary<unknown>;
25+
errorCount: number;
2526
}
2627

2728
export interface WaterfallDataNode extends WaterfallData, Omit<StatefulPrefetchedTreeTableRow, '$$state'> {

0 commit comments

Comments
 (0)