AppSignal  Docs

Jump to navigation

AppSignal for Elixir load order

The AppSignal Elixir can be configured in a couple different ways. Through mix configuration or through environment variables.

The configuration is loaded in a four step process. Starting with the package defaults and ending with reading environment variables. The configuration options can be mixed without losing configuration from a different option. Using an initializer, a configuration file and environment variables together will work.

1. Package defaults

The AppSignal package starts with loading its default configuration, setting paths and enabling certain features.

The agent defaults can be found in the package source as Appsignal.Config.default_config.

2. System detected settings

The package detects what kind of system it's running on and configures itself accordingly.

For example, when it's running on Heroku it sets the configuration option :running_in_container to true and :log to "stdout".

3. Mix configuration

The AppSignal package is most commonly configured with configuration in the Mix configuration file.

# config/config.exs
# or config/prod.exs
config :appsignal, :config,
  name: :my_app,
  push_api_key: "your-hex-appsignal-key"

This step will override all given options from the defaults or system detected configuration.

4. Environment variables

Lastly AppSignal will look for its configuration in environment variables. When found these will override all given configuration options from previous steps.

export APPSIGNAL_APP_NAME="my custom app name"
# start your app here

Want to help us improve this documentation page? Create a pull request