tokio-rs / tracing

Application level tracing for Rust.
https://tracing.rs
MIT License
5.15k stars 673 forks source link

Dynamic control over tracing-flame span name #2934

Open jsouto18 opened 3 months ago

jsouto18 commented 3 months ago

Feature Request

Allow for dynamic control over the written span name.

Crates

tracing-flame

Motivation

Currently tracing span names must be 'static. In the use case of running tracing spans over tests configured dynamically we're limited to the same span name.

Proposal

I believe this can be implemented without breaking changes by:

I see no drawback for this implementation as of now.

I'm also happy to come up with the PR if this is accepted as a useful feature 😁

mladedav commented 2 months ago

To be clear, what you're proposing is to only change the output of tracing-flame span name, right?

So for example fmt would still output the 'static name and the span names may not be the same for tracing-flame output and other outputs if overridden, right?

jsouto18 commented 2 months ago

Correct @mladedav!