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

Log timestamps in RFC3339Milli #537

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

alextes
Copy link
Contributor

@alextes alextes commented Oct 5, 2023

📝 Summary

  • Changes the timestamp format to human-readable RFC3339.
  • Increases the precision to nanosecond from second.

⛱ Motivation and Context

Current log precision is on the second level. On a high volume relay bids are in the hundreds per second, meaning logs, in the thousands, will share the same timestamp and lose their ordering. This would return ordering, and as a bonus make timestamps human-readable.

📚 References


✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy
  • I have seen and agree to CONTRIBUTING.md

@codecov-commenter
Copy link

codecov-commenter commented Oct 5, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (c52858a) 33.26% compared to head (6523b33) 33.35%.
Report is 10 commits behind head on main.

Files Patch % Lines
common/logging.go 0.00% 5 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #537      +/-   ##
==========================================
+ Coverage   33.26%   33.35%   +0.09%     
==========================================
  Files          24       24              
  Lines        5090     5315     +225     
==========================================
+ Hits         1693     1773      +80     
- Misses       3178     3318     +140     
- Partials      219      224       +5     
Flag Coverage Δ
unittests 33.35% <0.00%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JustinDrake
Copy link

Side note: this was discussed at the end of MEV Boost call 6.

@metachris
Copy link
Collaborator

In mev-boost we're using this with millisecond precision: https://github.com/flashbots/mev-boost/blob/develop-deneb/cli/main.go#L223-L234 + https://github.com/flashbots/mev-boost/blob/develop-deneb/config/vars.go#L14

Any reason for nanoseconds over millis?

@metachris metachris closed this Jan 19, 2024
@metachris metachris reopened this Jan 19, 2024
@metachris
Copy link
Collaborator

(sorry accidentally clicked on close)

@metachris
Copy link
Collaborator

@alextes do you want to rebase and update / engage in the comments?

@alextes
Copy link
Contributor Author

alextes commented Feb 19, 2025

i just didn't see any RFC3339Milli in time and thought it'd be nice to use a standard format. otherwise i'd have gone with that probably.
options are: https://pkg.go.dev/time#pkg-constants

@alextes alextes force-pushed the patch-1 branch 2 times, most recently from d63a389 to 095f817 Compare February 20, 2025 09:09
- Changes the timestamp format to human-readable RFC3339.
- Increases the precision to millisecond from second.
@alextes alextes changed the title Draft: log timestamps in RFC3339Nano Log timestamps in RFC3339Milli Feb 20, 2025
@alextes
Copy link
Contributor Author

alextes commented Feb 20, 2025

i see now i completely read over your suggestion to use a custom RFC3339Milli format like done in mev-boost if we don't care about nano precision 🙈 .

great suggestion, updated the PR.

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

Successfully merging this pull request may close these issues.

4 participants