AppSignal v1.0.0 Appsignal.Config

Summary

Functions

Returns whether the AppSignal agent is configured to start on application launch

Initializes the AppSignal config. Looks at the config default, the Elixir-provided configuration and the various APPSIGNAL_* OS environment variables. Returns whether or not the configuration is valid

Write the currently known AppSignal configuration to the system environment. Must be run before starting the AppSignal agent otherwise it won’t know the correct configuration

Functions

active?()
active? :: boolean

Returns whether the AppSignal agent is configured to start on application launch.

get_system_env()
initialize()
initialize :: :ok | {:error, :invalid_config}

Initializes the AppSignal config. Looks at the config default, the Elixir-provided configuration and the various APPSIGNAL_* OS environment variables. Returns whether or not the configuration is valid.

write_to_environment()

Write the currently known AppSignal configuration to the system environment. Must be run before starting the AppSignal agent otherwise it won’t know the correct configuration.

Example

case {Appsignal.Config.initialize, Appsignal.Config.active?} do
  {:ok, true} ->
    Appsignal.Config.write_to_environment
    Appsignal.Nif.start
  {:ok, false} ->
    # AppSignal not active
  {{:error, :invalid_config}, _} ->
    # AppSignal has invalid config
end