> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AppSignal Elixir configuration

Configuration. Important, because without it the AppSignal Elixir package won't
know which application it's instrumenting or in which environment.

On this topic we'll explain how to configure AppSignal, what can be configured
in the Elixir package and what the minimal configuration needed is.

## Minimal required configuration

The minimal required configuration needed by AppSignal for Elixir are the
following items. If they are not present, AppSignal will not send any data to
AppSignal.com.

* A valid [Push API Key](/appsignal/terminology#push-api-key)
* The application's OTP app name
* An application name
* An application environment (`dev` / `prod` / `test`)
* The application environment to be set to `active: true`

<CodeGroup>
  ```elixir Elixir theme={null}
  # Example minimal config file
  # config/config.exs
  config :appsignal, :config,
    otp_app: :appsignal_phoenix_example,
    name: "AppsignalPhoenixExample",
    push_api_key: "your-push-api-key",
    env: Mix.env,
    active: true
  ```
</CodeGroup>

Alternatively, you can configure the agent using system environment variables.
AppSignal will automatically become active if the `APPSIGNAL_PUSH_API_KEY`
environment variable is set.

<CodeGroup>
  ```elixir Elixir theme={null}
  export APPSIGNAL_OTP_APP="appsignal_phoenix_example"
  export APPSIGNAL_PUSH_API_KEY="your-push-api-key"
  export APPSIGNAL_APP_NAME="AppsignalPhoenixExample"
  export APPSIGNAL_APP_ENV="prod"
  ```
</CodeGroup>

## Configuration options

Read about all the configuration options on the [options
page](/elixir/configuration/options).

## Application environments

An application can have multiple environments such as "development"/"dev",
"test", "staging" and "production".

To separate the errors and performance issues that occur in the "development"
environment and those in "production", it's possible to set the environment in
which the application is running with the `env` configuration option.

A typical environment configuration file would contain the following.

<CodeGroup>
  ```elixir Elixir theme={null}
  # config/prod.exs
  config :appsignal, :config,
    active: true,
    env: :prod
  ```
</CodeGroup>

The above configuration file example is also what is generated by the AppSignal
installer per environment.

If you activate AppSignal per environment, using `active: true` in the
`config/{env}.exs` file, the `active` option is not required in the main
`config/config.exs` file.

### Disable AppSignal for tests

If you put your entire AppSignal configuration in the `config/config.exs`
instead of `config/prod.exs` (e.g. for having AppSignal enabled during
development), make sure to put `active: false` in your test configuration
unless you want to submit all your test results.

<CodeGroup>
  ```elixir Elixir theme={null}
  # config/test.exs
  config :appsignal, :config,
    active: false
  ```
</CodeGroup>

## Example configuration

<CodeGroup>
  ```elixir Elixir theme={null}
  # config/config.exs
  config :appsignal, :config,
    otp_app: :appsignal_phoenix_example,
    name: "AppsignalPhoenixExample",
    push_api_key: "your-push-api-key",
    env: Mix.env,
  ```
</CodeGroup>

<CodeGroup>
  ```elixir Elixir theme={null}
  # config/test.exs
  config :appsignal, :config,
    active: false
  ```
</CodeGroup>
