spandex-project / spandex

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

Compilation error when dynamically defined span names #135

Closed gerbal closed 2 years ago

gerbal commented 2 years ago

When attempting to update to 3.1.0 I encountered a compilation error with dynamically defined span names. i.e.

def some_function(some, thing) do
    Tracer.span("#{some}.#{thing}") do
      :noop
    end
end

produces a function clause error

== Compilation error in file lib/api.ex ==
** (FunctionClauseError) no function clause matching in MyApp.Tracer.span/3    
    expanding macro: MyApp.Tracer.span/3
    lib/api.ex: MyApp.Api.some_function/2
    (elixir 1.12.3) lib/kernel/parallel_compiler.ex:319: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7