Skip to content

Commit b45756d

Browse files
fix: addressing review comments
1 parent 129b6a4 commit b45756d

File tree

6 files changed

+17
-39
lines changed

6 files changed

+17
-39
lines changed

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,12 @@ describe('Trace Waterfall data source model', () => {
9898
})
9999
],
100100
logEventProperties: [
101-
expect.objectContaining({
102-
name: 'traceId'
103-
}),
104101
expect.objectContaining({
105102
name: 'attributes'
106103
}),
107104
expect.objectContaining({
108105
name: 'timestamp'
109106
}),
110-
expect.objectContaining({
111-
name: 'spanId'
112-
}),
113107
expect.objectContaining({
114108
name: 'summary'
115109
})
@@ -175,18 +169,12 @@ describe('Trace Waterfall data source model', () => {
175169
})
176170
],
177171
logEventProperties: [
178-
expect.objectContaining({
179-
name: 'traceId'
180-
}),
181172
expect.objectContaining({
182173
name: 'attributes'
183174
}),
184175
expect.objectContaining({
185176
name: 'timestamp'
186177
}),
187-
expect.objectContaining({
188-
name: 'spanId'
189-
}),
190178
expect.objectContaining({
191179
name: 'summary'
192180
})

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,8 @@ export class TraceWaterfallDataSourceModel extends GraphQlDataSourceModel<Waterf
6161
];
6262

6363
protected readonly logEventSpecifications: Specification[] = [
64-
this.specificationBuilder.attributeSpecificationForKey('traceId'),
6564
this.specificationBuilder.attributeSpecificationForKey('attributes'),
6665
this.specificationBuilder.attributeSpecificationForKey('timestamp'),
67-
this.specificationBuilder.attributeSpecificationForKey('spanId'),
6866
this.specificationBuilder.attributeSpecificationForKey('summary')
6967
];
7068

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
@@ -31,7 +31,8 @@ describe('Waterfall Chart component', () => {
3131
responseHeaders: {},
3232
responseBody: 'Response Body',
3333
tags: {},
34-
errorCount: 0
34+
errorCount: 0,
35+
logEvents: []
3536
},
3637
{
3738
id: 'second-id',
@@ -52,7 +53,8 @@ describe('Waterfall Chart component', () => {
5253
responseHeaders: {},
5354
responseBody: '',
5455
tags: {},
55-
errorCount: 0
56+
errorCount: 0,
57+
logEvents: []
5658
},
5759
{
5860
id: 'third-id',
@@ -73,7 +75,8 @@ describe('Waterfall Chart component', () => {
7375
responseHeaders: {},
7476
responseBody: '',
7577
tags: {},
76-
errorCount: 0
78+
errorCount: 0,
79+
logEvents: []
7780
}
7881
];
7982

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface WaterfallData {
2323
responseBody?: string;
2424
tags: Dictionary<unknown>;
2525
errorCount: number;
26-
logEvents?: LogEvent[];
26+
logEvents: LogEvent[];
2727
}
2828

2929
export interface WaterfallDataNode extends WaterfallData, Omit<StatefulPrefetchedTreeTableRow, '$$state'> {
@@ -40,9 +40,6 @@ export interface WaterfallChartState {
4040
}
4141

4242
export interface LogEvent {
43-
[key: string]: unknown;
44-
traceId: string;
45-
spanId: string;
4643
attributes: Dictionary<unknown>;
4744
timestamp: string;
4845
summary: string;

projects/observability/src/shared/dashboard/data/graphql/waterfall/api-trace-waterfall-data-source.model.test.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,12 @@ describe('Api Trace Waterfall data source model', () => {
104104
})
105105
],
106106
logEventProperties: [
107-
expect.objectContaining({
108-
name: 'traceId'
109-
}),
110107
expect.objectContaining({
111108
name: 'attributes'
112109
}),
113110
expect.objectContaining({
114111
name: 'timestamp'
115112
}),
116-
expect.objectContaining({
117-
name: 'spanId'
118-
}),
119113
expect.objectContaining({
120114
name: 'summary'
121115
})
@@ -182,18 +176,12 @@ describe('Api Trace Waterfall data source model', () => {
182176
})
183177
],
184178
logEventProperties: [
185-
expect.objectContaining({
186-
name: 'traceId'
187-
}),
188179
expect.objectContaining({
189180
name: 'attributes'
190181
}),
191182
expect.objectContaining({
192183
name: 'timestamp'
193184
}),
194-
expect.objectContaining({
195-
name: 'spanId'
196-
}),
197185
expect.objectContaining({
198186
name: 'summary'
199187
})
@@ -229,7 +217,8 @@ describe('Api Trace Waterfall data source model', () => {
229217
displaySpanName: 'Span Name 1',
230218
protocolName: 'Protocol Name 1',
231219
type: SpanType.Entry,
232-
spanTags: {}
220+
spanTags: {},
221+
logEvents: []
233222
},
234223
{
235224
[spanIdKey]: 'second-id',
@@ -241,7 +230,8 @@ describe('Api Trace Waterfall data source model', () => {
241230
displaySpanName: 'Span Name 2',
242231
protocolName: 'Protocol Name 2',
243232
type: SpanType.Exit,
244-
spanTags: {}
233+
spanTags: {},
234+
logEvents: []
245235
}
246236
]
247237
})
@@ -261,7 +251,8 @@ describe('Api Trace Waterfall data source model', () => {
261251
apiName: 'Span Name 1',
262252
protocolName: 'Protocol Name 1',
263253
spanType: SpanType.Entry,
264-
tags: {}
254+
tags: {},
255+
logEvents: []
265256
},
266257
{
267258
id: 'second-id',
@@ -277,7 +268,8 @@ describe('Api Trace Waterfall data source model', () => {
277268
apiName: 'Span Name 2',
278269
protocolName: 'Protocol Name 2',
279270
spanType: SpanType.Exit,
280-
tags: {}
271+
tags: {},
272+
logEvents: []
281273
}
282274
]
283275
});

projects/observability/src/shared/dashboard/data/graphql/waterfall/api-trace-waterfall-data-source.model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class ApiTraceWaterfallDataSourceModel extends GraphQlDataSourceModel<Wat
6767
}
6868

6969
private getLogEventAttributes(): string[] {
70-
return ['traceId', 'attributes', 'timestamp', 'spanId', 'summary'];
70+
return ['attributes', 'timestamp', 'summary'];
7171
}
7272

7373
private getTraceData(): Observable<Trace | undefined> {
@@ -117,7 +117,7 @@ export class ApiTraceWaterfallDataSourceModel extends GraphQlDataSourceModel<Wat
117117
spanType: span.type as SpanType,
118118
tags: span.spanTags as Dictionary<unknown>,
119119
errorCount: span.errorCount as number,
120-
logEvents: ((span.logEvents as Dictionary<LogEvent[]>) ?? {}).results
120+
logEvents: ((span.logEvents as Dictionary<LogEvent[]>) ?? {}).results ?? []
121121
};
122122
}
123123
}

0 commit comments

Comments
 (0)