Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Installed Airbrake
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrei committed Oct 28, 2016
1 parent d7e48cf commit 289a3d3
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -106,6 +106,8 @@ gem 'actionkit_connector', github: 'SumOfUs/actionkit_connector', branch: 'maste
# JWT
gem 'jwt'

gem 'airbrake'

group :development do
gem 'web-console', '~> 2.0'
gem 'rubocop', require: false
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Expand Up @@ -86,6 +86,9 @@ GEM
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
airbrake (5.6.1)
airbrake-ruby (~> 1.6)
airbrake-ruby (1.6.0)
annotate (2.7.1)
activerecord (>= 3.2, < 6.0)
rake (>= 10.4, < 12.0)
Expand Down Expand Up @@ -525,6 +528,7 @@ DEPENDENCIES
action_parameter
actionkit_connector!
activeadmin!
airbrake
annotate
aws-sdk-rails
aws-sdk-v1
Expand Down
62 changes: 62 additions & 0 deletions config/initializers/airbrake.rb
@@ -0,0 +1,62 @@
# frozen_string_literal: true
# Airbrake is an online tool that provides robust exception tracking in your Rails
# applications. In doing so, it allows you to easily review errors, tie an error
# to an individual piece of code, and trace the cause back to recent
# changes. Airbrake enables for easy categorization, searching, and prioritization
# of exceptions so that when errors occur, your team can quickly determine the
# root cause.
#
# Configuration details:
# https://github.com/airbrake/airbrake-ruby#configuration
Airbrake.configure do |c|
# You must set both project_id & project_key. To find your project_id and
# project_key navigate to your project's General Settings and copy the values
# from the right sidebar.
# https://github.com/airbrake/airbrake-ruby#project_id--project_key

c.project_id = Settings.airbrake_project_id
c.project_key = Settings.airbrake_api_key

# Configures the root directory of your project. Expects a String or a
# Pathname, which represents the path to your project. Providing this option
# helps us to filter out repetitive data from backtrace frames and link to
# GitHub files from our dashboard.
# https://github.com/airbrake/airbrake-ruby#root_directory
c.root_directory = Rails.root

# By default, Airbrake Ruby outputs to STDOUT. In Rails apps it makes sense to
# use the Rails' logger.
# https://github.com/airbrake/airbrake-ruby#logger
c.logger = Rails.logger

# Configures the environment the application is running in. Helps the Airbrake
# dashboard to distinguish between exceptions occurring in different
# environments. By default, it's not set.
# NOTE: This option must be set in order to make the 'ignore_environments'
# option work.
# https://github.com/airbrake/airbrake-ruby#environment
c.environment = Rails.env

# Setting this option allows Airbrake to filter exceptions occurring in
# unwanted environments such as :test. By default, it is equal to an empty
# Array, which means Airbrake Ruby sends exceptions occurring in all
# environments.
# NOTE: This option *does not* work if you don't set the 'environment' option.
# https://github.com/airbrake/airbrake-ruby#ignore_environments
c.ignore_environments = %w(test)

# A list of parameters that should be filtered out of what is sent to
# Airbrake. By default, all "password" attributes will have their contents
# replaced.
# https://github.com/airbrake/airbrake-ruby#blacklist_keys
c.blacklist_keys = [/password/i]

# Alternatively, you can integrate with Rails' filter_parameters.
# Read more: https://goo.gl/gqQ1xS
# c.blacklist_keys = Rails.application.config.filter_parameters
end if Settings.airbrake_project_id.present?

# If Airbrake doesn't send any expected exceptions, we suggest to uncomment the
# line below. It might simplify debugging of background Airbrake workers, which
# can silently die.
# Thread.abort_on_exception = ['test', 'development'].include?(Rails.env)
3 changes: 3 additions & 0 deletions config/settings/production.yml
Expand Up @@ -112,3 +112,6 @@ smtp:

members:
dashboard_url: <%= ENV['MEMBERS_DASHBOARD_URL'] %>

airbrake_api_key: <%= ENV['AIRBRAKE_API_KEY'] %>
airbrake_project_id: <%= ENV['AIRBRAKE_PROJECT_ID'] %>

0 comments on commit 289a3d3

Please sign in to comment.