tracing icon indicating copy to clipboard operation
tracing copied to clipboard

attributes: allow expression span names

Open couchand opened this issue 3 years ago • 3 comments

Motivation

Being able to use a static str reference rather than a string literal is helpful for certain deployments.

Solution

Parse the name argument of the instrument macro as an expression, not just a string literal.

couchand avatar Nov 04 '21 02:11 couchand

Ping @hawkw @davidbarsky, is this a change you would be open to?

couchand avatar Nov 30 '21 07:11 couchand

I think we'll need to get some input from @hawkw on this one before we move further.

bryangarza avatar May 09 '22 19:05 bryangarza

I'm somewhat surprised this works; I thought tracing's macros that instrument expands to required a literal and not a static reference. But, if this actually generates code that compiles, I'm happy to merge it.

hawkw avatar May 09 '22 21:05 hawkw

@bryangarza apologies about the delay, I've rebased this and #1705.

~I have to say I'm a bit confused about the CI failure, it's complaining about a test that looks to my eyes just the same as the test above, and I can't reproduce the build failure locally.~ (edit: nevermind, found it)

couchand avatar Feb 28 '23 17:02 couchand

No worries, thanks for getting back to it!

bryangarza avatar Feb 28 '23 17:02 bryangarza