feat: add custom tracing macro to use reports#1500
Draft
Conversation
1fb5db1 to
baf9b38
Compare
Contributor
Author
|
Open questions: Do we want to prefix the function |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref #1406
Adds a
miden-node-tracingcrate and the inner proc macro impl crate.The nameinstrument_with_err_reportis suboptimal, open to suggestions or if we want to replacetracing::instrumentcompletely and enhance ourinstrument_with..to also handlyanyhowerrors?Problem: High cardinality key-spaces slow the backend down
account_idvsaccount.idmake ita) very hard to find what you need in the honeycomb UI
b) create two different time series which means a cardinality bump
Trimmed UI
tracing::instrumentis rather verbose with its key-value style attributes, we only ever use a subset, i.e. we never re-parent spans, but only useparent = Noneto define a new root span.Impl
The allowlist controls field keys only — the names on the left-hand side of
key = valuepairs inside a span or event. It has nothing to do with function names, component names, or span names.Concretely:
rpc:,store:,"block-producer":) — becomes the tracingtargettracing::instrument, or overridden vianame = "...". Not touched by this macro at allaccount.id,block.number,nullifier.id) — the only thing checked against the accountlist.Details
The PR takes
tracing::instrumentandtracing::logand wraps them with a custom front-end. If a user provides an unknown key which does not exist verbatim in theallowlist.txt, we do error out and yield a small number of possible alternatives based on some character distance.See full examples in
crates/tracing/tests/ui/pass/instrument.rs