Closed jstr closed 5 years ago
@jstr - thank you for the report. The transaction
and timing
"functions" are actually macros, so will require some sort of "import" to work.
Instead of import
, which brings names into the module's namespace, can you try require ScoutApm.Tracing
, which shouldn't affect namespace, but does enable macros from the Tracing package. After that you should be able to refer to them by their full name ScoutApm.Tracing.transaction(....) do ... end
In addition, you can scope import
and require
calls inside individual functions, which may be another way to minimize name leakage.
Thanks @cschneid, this what I ended up doing. I do think the documentation could be clearer about usage in this respect.
Closing this issue as I've added a note about collisions and a link to the Elixir documentation on it. Thanks for opening the issue 🙂
The recent releases of
scout_apm
deprecate theuse
method and require the use ofimport ScoutApm.Tracing
.This poses challenges for interoperability with some other packages, e.g. https://github.com/Nebo15/sage, and also unnecessary pollutes the function space by importing
transaction
, etc.Ideally
scout_apm
should be useable withoutimport
ing its functions and creating potential conflicts.