-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore!: Remove debug and winston in favor of pino (#10355)
First steps for logging cleanup. Removes all traces of `debug` and `winston` in favor of `pino`. Fixes #10118 ## Breaking changes - `DEBUG` variable is no longer used. Instead, overloads `LOG_LEVEL` by allowing a list of modules to have non-default log levels. For example, `LOG_LEVEL="info; verbose: aztec:sequencer, aztec:archiver; debug: aztec:kv-store"` sets `info` as the default log level, `verbose` for the sequencer and archiver, and `debug` for the kv-store. Match is by prefix. ## Levels Defines the following logging levels, all of them standard in pino, except for `verbose` which we already used extensively before: - fatal: Use when an error has brought down the system. - error: Use for errors in general. - warn: Use for when we stray from the happy path. - info: Use for providing an operator with info on what the system is doing. - verbose: Use for when we need additional insight on what a subsystem is doing. - debug: Use for when we need debugging info to troubleshoot an issue on a specific component. - trace: Use for when we want to denial-of-service any recipient of the logs. Fixes #10116 ## Filtering Removes usage of the `DEBUG` env var for log filtering. Instead, overloads `LOG_LEVEL` by allowing a list of modules to have non-default log levels. For example, `LOG_LEVEL="info; verbose: aztec:sequencer, aztec:archiver; debug: aztec:kv-store"` sets `info` as the default log level, `verbose` for the sequencer and archiver, and `debug` for the kv-store. Match is by prefix. Fixes #10119 ## OTEL integration Vendors the OTEL pino stream from `openetelemetry/instrumentation-pino` and configures it as an additional transport if the `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` env var is set. Using the instrumentation-pino directly would have required buying in fully into the opentelemetry node sdk, which we preferred to avoid so we have more fine-grained control, and it also pollutes the main worker thread. Instead, we vendor the stream code and initialize it within a transport, which runs it on a worker thread. As for log correlation, instead of having `instrumentation-pino` monkey-patch pino, we wrap the call to the logger to manually inject the trace and span id, which ensures that tempo can load the relevant logs for a trace in loki. https://github.com/user-attachments/assets/9421a22f-4c5a-49f7-80da-ab3e14d323ba Fixes #10121 Fixes #10123 ## Pretty logs Pino logs to json by default, but if `LOG_JSON` is not set, we programmatically set up `pino-pretty` for console logging. Looks like this: ![image](https://github.com/user-attachments/assets/3d547a25-b5a7-49b8-b4a3-9be00e1fa268) Fixes #10126 ## DEBUG settings Given we no longer use `DEBUG`, we remove this variable from most scripts. Since we were using modules to silence some noisy namespaces, we tweak those calls to be passed as `trace` instead, so we can enable debug without fear of being bombarded. For reference, the default `DEBUG` string used in scripts was: ``` aztec:*,-aztec:avm_simulator*,-aztec:libp2p_service*,-aztec:circuits:artifact_hash,-json-rpc*,-aztec:world-state:database,-aztec:l2_block_stream* ``` --------- Co-authored-by: Mitch <[email protected]>
- Loading branch information
1 parent
5299481
commit c246aba
Showing
84 changed files
with
1,092 additions
and
978 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.