Skip to content

fix: log records bug fixes #958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export class SequenceBarRendererService {
? scaledEnd - this.markerWidth - 2
: marker.markerTime
});
markerTime = scaledNormalizedMarkers[index].markerTime;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we not need normalized markers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just the terminology I have used,
No other significance of it than grouping the scaled markers
If you could suggest the better naming for this?

markerTime = marker.markerTime;
} else {
scaledNormalizedMarkers[index] = {
...scaledNormalizedMarkers[index],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class LogEventsTableComponent implements OnChanges {
title: 'Timestamp',
display: CoreTableCellRendererType.RelativeTimestamp,
visible: true,
width: '150px',
width: '120px',
sortable: false,
filterable: false
},
Expand All @@ -136,7 +136,15 @@ export class LogEventsTableComponent implements OnChanges {
title: 'Span',
display: WaterfallTableCellType.SpanName,
visible: true,
width: '30%',
width: '20%',
sortable: false,
filterable: false
},
{
id: 'spanId',
title: 'Span Id',
visible: true,
width: '15%',
sortable: false,
filterable: false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class WaterfallChartComponent implements OnChanges {

let markerData: MarkerTooltipData = {
relativeTimes: [],
summary: spanWaterfallData.logEvents[0].summary
summary: spanWaterfallData.logEvents.find(logEvent => logEvent.timestamp === marker.timestamps[0])?.summary ?? ''
};
spanWaterfallData.logEvents.forEach((logEvent: LogEvent) => {
if (marker.timestamps.includes(logEvent.timestamp)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface WaterfallChartState {

export interface LogEvent {
spanStartTime?: number;
spanId: string;
attributes: Dictionary<unknown>;
timestamp: string;
summary: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ describe('Log Events Service', () => {
{
timestamp: 'time',
attributes: {},
summary: 'summary'
summary: 'summary',
spanId: 'test-id'
}
]
};
Expand All @@ -74,7 +75,8 @@ describe('Log Events Service', () => {
timestamp: 'time',
attributes: {},
summary: 'summary',
spanStartTime: 1608151401295
spanStartTime: 1608151401295,
spanId: 'test-id'
}
];
expect(spectator.service.getLogEventsWithSpanStartTime(logEvents, 1608151401295)).toMatchObject(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
export class LogEventsService {
private readonly specificationBuilder: SpecificationBuilder = new SpecificationBuilder();
private readonly dateCoercer: DateCoercer = new DateCoercer();
private readonly logEventProperties: string[] = ['attributes', 'timestamp', 'summary'];
private readonly logEventProperties: string[] = ['attributes', 'timestamp', 'summary', 'spanId'];
private readonly spanPropertiesForTrace: string[] = ['startTime', 'serviceName', 'displaySpanName', 'protocolName'];
private readonly spanPropertiesForApiTrace: string[] = [
'startTime',
Expand Down