-
Notifications
You must be signed in to change notification settings - Fork 254
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
cmd/observe: add a new flag to allow specifying different time formats for timestamps #509
Conversation
Test failures are legit https://github.com/cilium/hubble/pull/509/checks?check_run_id=2086620687 e.g.
|
Personally, I'm not too surprised that the default human readable format cannot be parsed back to a Overall I feel we loose human readability for a use-case that would be better served using another output format, but I don't feel too strongly either way. |
What about adding a new flag to specify the time format? We could keep the existing one but it would allow using different ones. |
looks good to me overall. a few comments/suggestions.
|
The standard library only defines RFC3339 (with second precision) and RFC3339Nano (with nanosecond precision). Introduce 2 variants for millisecond and microsecond precision. Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
Namely, add support for RFC3339Nano, RFC3339Milli, RFC3339Micro and RFC1123Z. Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
The default behavior is unchanged as time.StampMilli is used by default. Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
d60232e
to
18a7aef
Compare
@michi-covalent I've completely reword the PR to add a |
This PR adds a new option to the observe command (
--time-format
) to allow specifying a different time format for timestamps. The default is unchanged and remainstime.StampMilli
. The following formats are supported:In addition, new formats are supported for the
--since
and--until
flags, namelyRFC3339
andRFC3339[milli|micro|nano]
andRFC1123Z
.