scoutapp / scout_apm_elixir

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

Load configuration variables from ENV #39

Closed cschneid closed 7 years ago

cschneid commented 7 years ago

Split out the two approaches to ENV vars

In mix, you can set your own ENV var to look up. This matches with how other libraries in the elixir ecosystem do environment variables.

config :scout_apm,
  key: {:system, "APM_API_KEY"}

To match our Ruby agent, and make configuration easier on Heroku and similar platforms, we also have a set of automatically derived configurations. For any config option (key, log_level), upper case it, and prepend "SCOUT_", and that value will be loaded.

SCOUT_LOG_LEVEL SCOUT_KEY SCOUT_MONITOR

cschneid commented 7 years ago

This integrates the code from #37 (supporting {:system, "api_key"} in mix configs), and also adds automatic finding of SCOUT_* environment variables like our Ruby agent does.

Thanks a ton to Michał Młoźniak for pushing the #37 PR.