From 42c32504be6940cdfb810bcf2853f36be6cf6a3d Mon Sep 17 00:00:00 2001 From: Sven Grossmann Date: Wed, 8 Mar 2023 11:39:56 +0100 Subject: [PATCH] Logs: Add millisecond to timestamp in log line (#64372) * add milliseconds to logrow * adjust tests to also have milliseconds --- public/app/features/explore/LogsSample.test.tsx | 4 ++-- public/app/features/logs/components/LogRow.tsx | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/app/features/explore/LogsSample.test.tsx b/public/app/features/explore/LogsSample.test.tsx index fe2e0366ac0..8c76cedcf57 100644 --- a/public/app/features/explore/LogsSample.test.tsx +++ b/public/app/features/explore/LogsSample.test.tsx @@ -81,9 +81,9 @@ describe('LogsSamplePanel', () => { render( ); - expect(screen.getByText('2022-02-22 04:28:11')).toBeInTheDocument(); + expect(screen.getByText('2022-02-22 04:28:11.352')).toBeInTheDocument(); expect(screen.getByText('line1')).toBeInTheDocument(); - expect(screen.getByText('2022-02-22 09:42:50')).toBeInTheDocument(); + expect(screen.getByText('2022-02-22 09:42:50.991')).toBeInTheDocument(); expect(screen.getByText('line2')).toBeInTheDocument(); }); diff --git a/public/app/features/logs/components/LogRow.tsx b/public/app/features/logs/components/LogRow.tsx index 3e87d876f4a..ebeac4c7930 100644 --- a/public/app/features/logs/components/LogRow.tsx +++ b/public/app/features/logs/components/LogRow.tsx @@ -117,6 +117,7 @@ class UnThemedLogRow extends PureComponent { renderTimeStamp(epochMs: number) { return dateTimeFormat(epochMs, { timeZone: this.props.timeZone, + defaultWithMS: true, }); }