AppSignal  Docs

Visit AppSignal.com
Jump to navigation

Integrating AppSignal in Elixir

It's possible that AppSignal does not provide automatic integration for your framework of choice, or maybe you're using your own application setup.

When AppSignal does not support something out-of-the-box it's still possible to instrument applications. AppSignal needs to be configured and started once at the beginning of a process. It can be configured through Mix configuration or by using environment variables.

Installation

Make sure the AppSignal for Elixir package is installed in your application using Mix.

Add it as a dependency to your application and add it as a sub application of your application.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# mix.exs
# Note: Module setup and other functions of the mix.exs file removed
# The contents of the application and deps function may differ in your
# application.

# ...

  def application do
    [
      mod: {MyAwesomeApp, []},
      applications: [:appsignal, ...]
    ]
  end

# ...

  defp deps do
    [
      # ...
      {:appsignal, "~> 1.0"}
    ]
  end

# ...

See our installation guide for the full guide.

Configuration

The AppSignal for Elixir package needs to be configured before it can send data to AppSignal.com. There are two methods of configuration. Using the mix configuration and using environment variables.

See the configuration pages for the full configuration guide.

Starting AppSignal

In order for AppSignal to instrument your application the AppSignal process must be started in the Erlang BEAM VM. Make sure to put this line in a location that is always run in your application.

1
{:ok, _} = Application.ensure_all_started(:appsignal)

Note: This is not required for frameworks that AppSignal integrates with, such as Phoenix, but it is for pure Elixir applications and code outside these integrations, such as independent tasks or background jobs.

Add custom instrumentation

Continue with our guide to add custom instrumentation to your application.

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