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

attributes: make #[instrument] support string literal fields #2924

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

Commits on Apr 2, 2024

  1. attributes: make #[instrument] support string literal fields

    The 'tracing::span!' macro supports passing in field names as string
    literals, which can be used to use an invalid Rust identifier as
    a field name (e.g. "type"). However, the 'instrument!' macro required
    that arguments to 'fields' be period-separated Rust identifiers.
    
    This commit extends the `#[instrument]` macro to support both
    period-separated identifiers and single string-literal fields.
    We preserve the original argument and pass it to the `tracing::span!`
    macro to preserve span/hygiene information.
    svix-aaron1011 committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    3f85f0d View commit details
    Browse the repository at this point in the history