Skip to content

Commit 767930f

Browse files
authored
fix: waterfall undefined strings (#803)
1 parent 3b90217 commit 767930f

16 files changed

+25
-26
lines changed

projects/components/src/sequence/sequence-chart.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ export class SequenceChartComponent implements OnChanges {
115115
id: segment.id,
116116
start: segment.start - minStart,
117117
end: segment.end - minStart,
118-
label: segment.label,
119118
color: segment.color
120119
}));
121120
}

projects/components/src/sequence/sequence.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export interface SequenceSegment {
55
id: string;
66
start: number;
77
end: number;
8-
label: string;
98
color: string;
109
}
1110

projects/distributed-tracing/src/pages/trace-detail/trace-detail.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ export class TraceDetailService implements OnDestroy {
103103
private buildTimeString(trace: Trace, units: string): string {
104104
return `${new DateFormatter({ mode: DateFormatMode.DateAndTimeWithSeconds }).format(
105105
trace.startTime as number
106-
)} for ${trace.duration as string} ${units}`;
106+
)} for ${trace.duration as string} ${units ?? ''}`.trim();
107107
}
108108

109109
private buildTitleString(trace: Trace): string {
110110
if (trace.spans?.length === 1) {
111111
const entrySpan = trace.spans[0];
112112

113-
return `${entrySpan.serviceName as string} ${entrySpan.displaySpanName as string}`;
113+
return `${entrySpan.serviceName as string} ${(entrySpan.displaySpanName as string) ?? ''}`.trim();
114114
}
115115

116116
return '';

projects/distributed-tracing/src/shared/components/span-detail/span-title.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ export class SpanTitle {
22
public constructor(public serviceName?: string, public protocolName?: string, public apiName?: string) {}
33

44
public toString(): string {
5-
return `${this.serviceName} ${this.protocolName} ${this.apiName}`;
5+
return `${this.serviceName} ${this.protocolName ?? ''} ${this.apiName ?? ''}`.trim();
66
}
77
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ describe('Trace Waterfall data source model', () => {
215215
value: 1,
216216
units: 'ms'
217217
},
218-
name: 'Span Name 1',
218+
apiName: 'Span Name 1',
219219
serviceName: 'Service Name 1',
220220
protocolName: undefined,
221221
spanType: SpanType.Entry,
@@ -231,7 +231,7 @@ describe('Trace Waterfall data source model', () => {
231231
value: 2,
232232
units: 'ms'
233233
},
234-
name: 'Span Name 2',
234+
apiName: 'Span Name 2',
235235
serviceName: 'Service Name 2',
236236
protocolName: undefined,
237237
spanType: SpanType.Exit,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ export class TraceWaterfallDataSourceModel extends GraphQlDataSourceModel<Waterf
9797
value: span.duration as number,
9898
units: duration.units
9999
},
100-
name: span.displaySpanName as string,
101100
serviceName: span.serviceName as string,
102101
protocolName: span.protocolName as string,
102+
apiName: span.displaySpanName as string,
103103
spanType: span.type as SpanType,
104104
tags: span.spanTags as Dictionary<unknown>,
105105
errorCount: span.errorCount as number
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export interface SpanNameCellData {
22
serviceName: string;
3-
protocolName: string;
4-
name: string;
3+
protocolName?: string;
4+
apiName?: string;
55
color?: string;
66
hasError?: boolean;
77
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class SpanNameTableCellParser extends TableCellParserBase<SpanNameCellDat
1111
}
1212

1313
public parseTooltip(cellData: SpanNameCellData): string {
14-
return `${cellData.serviceName} ${cellData.protocolName} ${cellData.name}`;
14+
return `${cellData.serviceName} ${cellData.protocolName ?? ''} ${cellData.apiName ?? ''}`.trim();
1515
}
1616

1717
public parseFilterValue(): undefined {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('Span name table cell renderer component', () => {
88
const spanNameData = {
99
serviceName: 'test-entity',
1010
protocolName: 'test-protocol',
11-
name: 'test-span-name'
11+
apiName: 'test-span-name'
1212
};
1313

1414
const buildComponent = createComponentFactory({
@@ -30,7 +30,7 @@ describe('Span name table cell renderer component', () => {
3030
test('should render span name without color and error icon and build tooltip ', () => {
3131
const spectator = buildComponent();
3232

33-
const tooltip = `${spanNameData.serviceName} ${spanNameData.protocolName} ${spanNameData.name}`;
33+
const tooltip = `${spanNameData.serviceName} ${spanNameData.protocolName} ${spanNameData.apiName}`;
3434

3535
expect(spectator.component.value).toEqual(spanNameData);
3636
expect(spectator.component.tooltip).toEqual(tooltip);
@@ -51,7 +51,7 @@ describe('Span name table cell renderer component', () => {
5151
providers: [tableCellDataProvider(spanNameDataWithColor)]
5252
});
5353

54-
const tooltip = `${spanNameData.serviceName} ${spanNameData.protocolName} ${spanNameData.name}`;
54+
const tooltip = `${spanNameData.serviceName} ${spanNameData.protocolName} ${spanNameData.apiName}`;
5555

5656
expect(spectator.component.value).toEqual(spanNameDataWithColor);
5757
expect(spectator.component.tooltip).toEqual(tooltip);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { WaterfallTableCellType } from './span-name-cell-type';
1919
<span class="text" data-sensitive-pii>{{ this.value.protocolName }}</span>
2020
</div>
2121
<div class="span-name">
22-
<span class="text" data-sensitive-pii>{{ this.value.name }}</span>
22+
<span class="text" data-sensitive-pii>{{ this.value.apiName }}</span>
2323
</div>
2424
<ht-icon
2525
*ngIf="this.value.hasError"

0 commit comments

Comments
 (0)