-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Adjust time resolution to microseconds #15239
Conversation
Please squash the commits, and could you build & run etcd and paste a couple of the log message? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ahrtr - Just want to double check the full e2e suite passes in case there are any tests that also need fixing etc. Happy to help with backporting, what process does the Edit: Looks like one test needed to be updated to reflect the format correction, have fixed that. |
release-3.5 and 3.4 have very big different code structure, you'd better to backport the change manually. |
3.5 Backport raised #15240 It looks like 3.4 didn't have any of the zap logger content, only 3.5 did so I'm not sure we need to take it back that far? |
3.4: Line 46 in b4e3ed7
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't make a breaking change
Historic capnslog timestamps are in microsecond resolution. We need to match that when we migrate to the zap logger. Signed-off-by: James Blair <mail@jamesblair.net>
I would vote for For v3.4 & v3.5 we should have this flag driven to avoid a breaking change. So most likely flag in v3.6 as well |
@ptabor Don't disagree, but we can make it a feature request handled in separate issue/PR? |
I'm lost. Why would we go over 2 changes of the same exact logic instead of deciding what's the expected end state ? |
2006-01-02T15:04:05.999999999Z07:00. @serathius Are you saying change:
is backward compatible and can be backported - as it stays within ISO 8601 standard:
After checking RFC3339 seems more restricted subset of ISO8601 If so - seems acceptable. For v3.4 sounds a little brave. |
It's interesting that the old code using ISO8601TimeEncoder was writing: that's I assume the biggest risk to backward compatibility |
Does it mean that ISO8601TimeEncoder isn't compliant with standard? Probably we should raise an issue to zap? |
Based on https://en.wikipedia.org/wiki/UTC_offset, all the following formats are valid,
So |
@jmhbnz Please move forward per the discussion above.
|
Let's wait until there is a clear agreement on the topic. Can we first summarize, what are the options, what issues we see in zap that should be reported and what is the preferred solution so everyone can agree on?
Yes, as 4.2.2.4 section of ISO 8601 standard states about decimal fraction:
|
For me the concern is the colon in timezone. For 3.4, 3.5 we should be using For 3.6 I don't have strong opinion, but leaning towards the more standard (RFC3339NanoTimeEncoder): |
ok, makes sense. Let's report lack of colon to zap people and see what they have to say about this. |
Reading through https://www.loc.gov/standards/datetime/iso-tc154-wg5_n0038_iso_wd_8601-1_2016-02-16.pdf looks like zap made a strange choice to combine extended format (includes semicolon) and basic format (minimal representation without separators).
|
Let's merge it for clear backport. @jmhbnz please send a separate PR that will change format for v3.6 to |
Historic capnslog timestamps are in microsecond resolution. We need to match that when we migrate to the zap logger.
The standard zap time encoder options are listed here: https://github.com/uber-go/zap/blob/077b03eb1c5f4ed0703209766e4c897bb88ae6fb/zapcore/encoder.go#L171
Unfortunately none of these completely matched both the precision and format of the historic capnslog format so I've added a custom encoder function that matches exactly.
Here is a comparison:
Fixes #15236.
Edit: Here is a sample of the new log output: