-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AppSignal active configuration detection #86
Comments
I'm +1 on keeping the configuration the same in the Ruby and Elixir integrations, but I think I prefer having the :active option set to true by default. That way, we can turn Appsignal off for certain environments if needed, instead of explicitly turning it on. Why did we chose to do it the other way around for the Ruby version, @thijsc? If we'd follow the Ruby way here (not activating the extension by default and having the user do so explicitly), we need to think of a good upgrade path for existing Elixir integration users. |
I don't really get what the issue is. In Ruby active will be set to true automatically if there is a push key. You can disable it manually later on if you like. What would the backwards incompatibility be, people currently already need a key anyway? |
Discussed with @tombruijn, this is indeed different from the Ruby version. I think we should keep the behaviour the same as in Ruby, otherwise providing support on this will be very confusing. |
I'll change it then to match the Ruby gem setup. A guide will be in order for everyone that upgrades |
Don't activate AppSignal always, when the push_api_key is in any config type (system, app, env), but only activate AppSignal by default when the push_api_key is found in the system environment variable APPSIGNAL_PUSH_API_KEY. This change makes the activation behavior the same for Elixir as for our Ruby gem (https://github.com/appsignal/appsignal-ruby), which is more flexible. As discussed in #86 What this change means in practice. Before: ``` config :appsignal, :config, name: :my_app, push_api_key: "your-hex-appsignal-key" ``` This would make AppSignal active _always_, as long as the push_api_key was set. The only exception was when `active` was explicitly set to `false`. After this change you need to explicitly set `active: true` to activate AppSignal. ``` // config/config.exs config :appsignal, :config, name: :my_app, active: true, push_api_key: "your-hex-appsignal-key" ``` Or as is probably be more common, activation per environment: ``` // config/config.exs config :appsignal, :config, name: :my_app, push_api_key: "your-hex-appsignal-key" ``` ``` // config/prod.exs config :appsignal, :config, active: true ``` The exception to this rule is the APPSIGNAL_PUSH_API_KEY environment variable. When this environment variable is found in the system environment AppSignal also becomes active: `active: true`. Unless explicitly set to `active: false` in the application config or in the environment `APPSIGNAL_ACTIVE=false`.
Don't activate AppSignal always, when the push_api_key is in any config type (system, app, env), but only activate AppSignal by default when the push_api_key is found in the system environment variable APPSIGNAL_PUSH_API_KEY. This change makes the activation behavior the same for Elixir as for our Ruby gem (https://github.com/appsignal/appsignal-ruby), which is more flexible. As discussed in #86 What this change means in practice. Before: ``` config :appsignal, :config, name: :my_app, push_api_key: "your-hex-appsignal-key" ``` This would make AppSignal active _always_, as long as the push_api_key was set. The only exception was when `active` was explicitly set to `false`. After this change you need to explicitly set `active: true` to activate AppSignal. ``` // config/config.exs config :appsignal, :config, name: :my_app, active: true, push_api_key: "your-hex-appsignal-key" ``` Or as is probably be more common, activation per environment: ``` // config/config.exs config :appsignal, :config, name: :my_app, push_api_key: "your-hex-appsignal-key" ``` ``` // config/prod.exs config :appsignal, :config, active: true ``` The exception to this rule is the APPSIGNAL_PUSH_API_KEY environment variable. When this environment variable is found in the system environment AppSignal also becomes active: `active: true`. Unless explicitly set to `active: false` in the application config or in the environment `APPSIGNAL_ACTIVE=false`.
I found a difference in configuration between the AppSignal for Elixir package and the AppSignal for Ruby gem.
Related issue: #49
Ruby
In the Ruby gem we automatically set
active
totrue
once we detect theAPPSIGNAL_PUSH_API_KEY
in the environment.This is the exception to the configuration order which allows us to install the Heroku add-on without setting the
APPSIGNAL_ACTIVE
environment key there. (It's too late to change that now.)https://github.com/appsignal/appsignal-ruby/blob/0e97b6f9180c4504e4361021fafa6ec7da3e6d42/lib/appsignal/config.rb#L154-L155
Elixir
In the Elixir package we automatically set
active
totrue
if thepush_api_key
configuration option is set in any of the configuration stages (app_config
andenv_config
) even whenactive
is not explicitly set totrue
.appsignal-elixir/lib/appsignal/config.ex
Line 37 in f7fd3f7
Suggested change
We should try to keep the two packages' configuration behave the same way.
We should add the
APPSIGNAL_PUSH_API_KEY
active
detection to theload_from_system
function in the Elixir package. This require users to configureactive
per environment.@jeffkreeftmeijer @arjan WDYT?
@thijsc We've discussed this behavior before for the Ruby gem, do you agree it should behave the same here?
Sidenote: Can't we detect theSee #91.env
fromMix.env
? So it's not necessary to set?The text was updated successfully, but these errors were encountered: