Skip to content

Configuration

You can set configuration options in config.exs. It looks like this:

config :honeybadger,
api_key: "PROJECT_API_KEY",
environment_name: :prod

If you’d rather read, eg., environment_name from the OS environment, you can do like this:

config :honeybadger,
environment_name: {:system, "HONEYBADGER_ENV"},
revision: {:system, "HEROKU_SLUG_COMMIT"}

NOTE: This works only for the string options, and environment_name.

Here are all of the options you can pass in the keyword list:

NameDescriptionDefault
appName of your app’s OTP Application as an atomMix.Project.config[:app]
api_keyYour application’s Honeybadger API keySystem.get_env("HONEYBADGER_API_KEY"))
environment_name(required) The name of the environment your app is running in.:prod
exclude_errorsFilters out errors from being sent to Honeybadger[]
exclude_envsEnvironments that you want to disable Honeybadger notifications[:dev, :test]
hostnameHostname of the system your application is running on:inet.gethostname
originURL for the Honeybadger API"https://api.honeybadger.io"
project_rootDirectory root for where your application is runningSystem.cwd/0
revisionThe project’s git revisionnil
filterModule implementing Honeybadger.Filter to filter data before sending to Honeybadger.ioHoneybadger.Filter.Default
filter_keysA list of keywords (atoms) to filter. Only valid if filter is Honeybadger.Filter.Default[:password, :credit_card, :__changed__, :flash, :_csrf_token]
filter_argsIf true, will remove function arguments in backtracestrue
filter_disable_urlIf true, will remove the request urlfalse
filter_disable_sessionIf true, will remove the request sessionfalse
filter_disable_paramsIf true, will remove the request paramsfalse
filter_disable_assignsIf true, will remove the live_view event assignsfalse
fingerprint_adapterImplementation of FingerprintAdapter behaviour
notice_filterModule implementing Honeybadger.NoticeFilter. If nil, no filtering is done.Honeybadger.NoticeFilter.Default
sasl_logging_onlyIf true, will notifiy for SASL errors but not Logger callstrue
use_loggerEnable the Honeybadger Logger for handling errors outside of web requeststrue
ignored_domainsAdd domains to ignore Error events in Honeybadger.Logger.[:cowboy]
breadcrumbs_enabledEnable breadcrumb event trackingfalse
ecto_reposModules with implemented Ecto.Repo behaviour for tracking SQL breadcrumb events[]
event_filterModule implementing Honeybadger.EventFilter. If nil, no filtering is done.Honeybadger.EventFilter.Default
insights_enabledEnable sending automatic events to Honeybadger Insightsfalse
insights_configSpecific library Configuration for Honeybadger Insights.%{}
http_adapterModule implementing Honeybadger.HttpAdapter to send data to Honeybadger.ioAny available adapter (Req, hackney)
events_worker_enabledEnable sending events in a separate processtrue
events_max_batch_retriesMaximum number of retries for sending events3
events_batch_sizeMaximum number of events to send in a single batch1000
events_max_queue_sizeMaximum number of events to queue before dropping10000
events_timeoutTimeout in milliseconds for sending events5000
events_throttle_waitTime in milliseconds to wait before retrying a failed batch60000

The HTTP client used to send data to Honeybadger can be customized. We will use either Req or hackney (in that order) by default if they are loaded. If you want to use a different HTTP client, you can set the http_adapter configuration option to any of our pre-built adapter modules.

config :honeybadger,
# Without options
http_adapter: Honeybadger.HTTPAdapter.Hackney
# With options
http_adapter: {Honeybadger.HTTPAdapter.Hackney, [...]}

You can also implement your own HTTP adapter to send data to Honeybadger. The adapter must implement the Honeybadger.HttpAdapter behaviour.