scoutapp / scout_apm_elixir

ScoutAPM Elixir Agent. Supports Phoenix and other frameworks.
https://scoutapm.com
Other
36 stars 20 forks source link

Support Multiple Repos in Ecto 3 #81

Closed cschneid closed 5 years ago

cschneid commented 5 years ago

When you attach Scout instruments to multiple repos, calls beyond the first will return {:error, :already_exists}.

This is due to the handler id needing to be unique across the entire running system, but only having a single hard-coded value in the Scout call. We should create the string based on the repo module name instead.

The actual value is never referenced, so there are no restrictions on what we choose. I'd prefer to stick to something that's meaningful if introspected though (not just a uuid or equivalently random string).

See-also: https://hexdocs.pm/telemetry/telemetry.html#attach-4