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

Attach span to error reporting span #220

Merged
merged 2 commits into from
May 21, 2022

Conversation

nlordell
Copy link
Contributor

I noticed when debugging settlement failures that we weren't logging with the auction span when reporting errors (i.e. simulating on the original block and generating a Tenderly link with the failed simulation).

This is because we offload the simulation and reporting to a separate Tokio-rs task so that we can already start the next auction without delaying for informative error reporting (which is, IMO a very good thing). However, this makes it hard to tie the simulation errors with what auction it belongs to without looking at surrounding logs.

Luckily it is very easy to so - Span::current() allows us to instrument a separate task using the span of the currently executing task.

Additionally, I promoted the auction span to be at the INFO level. This makes it so filtering logs like solver=info still includes the span information (i.e. if we only show info logs, we still want to include the auction{id=...} with the logs).

Test Plan

CI. Also, run locally in DryRun mode with an invalid solver so that simulations always fail, and see that we now include auction{id=...} span in the log message:

...
2022-05-21T07:16:45.331Z  WARN auction{id=0}: solver::driver: 1Inch settlement simulation failed at submission and block 14815938:
...

@nlordell nlordell requested a review from a team as a code owner May 21, 2022 07:21
@nlordell nlordell merged commit 6bfc021 into main May 21, 2022
@nlordell nlordell deleted the report-settlement-error-instrument branch May 21, 2022 11:43
@github-actions github-actions bot locked and limited conversation to collaborators May 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants