-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separate application tracer registration from user named tracers
Because `persistent_term:put` slows down as the number of terms grows a project with thousands of modules can cause startup to timeout as it sets a term for every module in it. This patch replaces that term for each module with a single term containing a map of `module => tracer`. Users must be able to register named tracers at runtime and we want to not trigger a global GC by updating the tracer map used for module to tracer mapping. So any user registered tracer will have its own `persistent_term`. The macro for looking up a tracer used in macros like `?with_span` now looks up the tracer by looking up the module in the "application tracers" (the persistent term containing the map). While a user looking up a named tracer will do so with the function `opentelemetry:get_tracer/1` which looks directly for a term with that name. This means a user could register a tracer with the same name as a module. Whether this is good or bad or needs a check to guard against is not covered by this PR.
- Loading branch information
Tristan Sloughter
committed
Oct 8, 2021
1 parent
a7ddda6
commit a24a60d
Showing
11 changed files
with
115 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.