-
Notifications
You must be signed in to change notification settings - Fork 462
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
More precise timestamps in structured log view of dashboard #3127
Comments
@JamesNK what's your take on this scenario? |
Aspire 8.0.0-preview.4.24156.9 already attempted to display milliseconds in the timestamp column: aspire/src/Aspire.Dashboard/Components/Pages/StructuredLogs.razor Lines 85 to 87 in 692dc41
I think that did not work because it searched for the seconds field using the regular expression aspire/src/Aspire.Dashboard/Utils/FormatHelpers.cs Lines 17 to 18 in 692dc41
and CultureInfo.CurrentCulture.DateTimeFormat.LongTimePattern actually was "H.mm.ss", which does not include a colon, so FormatHelpers did not know where they should insert the milliseconds. Now on the "main" branch, FormatHelpers are still using colons in the regular expression: aspire/src/Aspire.Dashboard/Utils/FormatHelpers.cs Lines 29 to 30 in e24eb81
Because of that, I suspect it still does not work. |
What culture are you using? Can you show a screenshot of what you see? |
The culture is "fi-FI". |
I wonder if the regexp could be just |
"da-DK" doesn't use colons in LongTimePattern either: "HH.mm.ss" |
Thanks, that's a bug. Fix looks pretty simple: #3215 |
We should file an issue with the docs repo too, as this approach came from there. |
The wrong regex was in https://github.com/dotnet/samples/blob/b6f2197113dfd947171bf99e79cb24b303b75b2d/samples/snippets/csharp/VS_Snippets_CLR/Formatting.HowTo.Millisecond/cs/Millisecond.cs#L31 already seven years ago. |
I filed the docs issue at dotnet/docs#40356. The French (Canada) culture "fr-CA" has LongTimePattern = |
|
Apart from the time separator problem, I'd suggest injecting a backslash
|
In Aspire 8.0.0-preview.4.24156.9, the "Timestamp" column of the "Structured logs" page of the dashboard shows only one-second precision, e.g. "19.01.29". I'd like to see timestamps with more precision, like "19.08.17,7547722". That would let me see how much time passed between consecutive log entries, even if they occurred during the same second. In OpenTelemetry Protocol, LogRecord appears to support nanosecond precision.
I found a related issue #115 but that one seems to concern how the Dashboard configures the console loggers of other processes, rather than how it displays the timestamps it has received over OTLP.
The text was updated successfully, but these errors were encountered: