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

Fix interpolated string span and trace names #136

Merged

Conversation

gerbal
Copy link
Contributor

@gerbal gerbal commented Jan 6, 2022

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
Copy link
Member

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 🚀

@GregMefford GregMefford merged commit 537e060 into spandex-project:master Sep 7, 2022
@gerbal gerbal deleted the fix/interpolated-string-span-names branch October 27, 2022 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compilation error when dynamically defined span names
2 participants