Skip to content
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

V1 timestamp #12

Open
andresp opened this issue Jan 18, 2021 · 1 comment
Open

V1 timestamp #12

andresp opened this issue Jan 18, 2021 · 1 comment

Comments

@andresp
Copy link

andresp commented Jan 18, 2021

Should the V1 emitter timestamp be retrieved from record.created, just like it used to be in V0?

This is how it was set for a V0 record and there seems to be no reason why this shouldn't also apply to V1. The divergence makes a migration more difficult due to the inconsistent handling.

Suggestion for change:

ts = rfc3339.format_microsecond(record.created)

Happy to submit a pull request with the change, if contributors and @GreyZmeem agree.

@Lawouach
Copy link

I actually changed that line to:

ts = str(time.time_ns())

v1 expects nanoseconds and that is now a builtin function since Python 3.7

https://docs.python.org/3.7/library/time.html#time.time_ns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants