spandex-project / spandex

A platform agnostic tracing library
MIT License
333 stars 53 forks source link

Fix interpolated string span and trace names #136

Closed gerbal closed 2 years ago

gerbal commented 2 years ago

This PR fixes #135 where runtime interpolated strings cannot be passed as arguments to the Tracer.span and Tracer.trace macros.

I have moved the guard clauses to Spandex.start_trace/2 and Spandex.start_span/2 and added guard clauses to the disabled failure case. This ensures the FunctionClauseError is raised if the macro invocation is ever reached in tests. Though, of course, this isn't as effective at preventing bad arguments as a compile time warning.

GregMefford commented 2 years ago

Sorry it took so long to get to this, but thanks a lot of taking the time to submit it! ❤️ I agree that this is a great improvement to the problem you identified in #135 🚀