Independent Study Spring 2019/Errbit: Difference between revisions
No edit summary |
No edit summary |
||
Line 10: | Line 10: | ||
*Errbit is Airbrake API compliant | *Errbit is Airbrake API compliant | ||
*Store unresolved errors indefinitely without any extra cost. | *Store unresolved errors indefinitely without any extra cost. | ||
==Components== | |||
*Errbit | |||
*Expertiza | |||
*MongoDB | |||
==The Steps taken for the setup== | ==The Steps taken for the setup== | ||
Line 36: | Line 41: | ||
'''Deploy Errbit on Heroku''' | '''Deploy Errbit on Heroku''' | ||
*Created a new empty application on Heroku | *Created a new empty application on Heroku and named it errbit-expertiza2019 | ||
*The app will have an associated empty git repository https://git.heroku.com/errbit-expertiza2019.git | *The app will have an associated empty git repository https://git.heroku.com/errbit-expertiza2019.git | ||
Line 52: | Line 57: | ||
heroku addons:add cron:daily | heroku addons:add cron:daily | ||
Run the following | Run the following to deploy. | ||
git add . | git add . | ||
git commit -m “new creds” | git commit -m “new creds” | ||
Line 59: | Line 64: | ||
'''Configure Expertiza to point to our deployed Errbit application | '''Configure Expertiza to point to our deployed Errbit application | ||
*Create a new app on Errbit | *Create a new app on Errbit named Expertiza | ||
*Copy its configuration and place it in the expertiza/config/initializers/airbrake.rb file. | *Copy its configuration and place it in the expertiza/config/initializers/airbrake.rb file. | ||
Line 70: | Line 75: | ||
config.ignore_environments = %w(test) | config.ignore_environments = %w(test) | ||
end | end | ||
On starting the server, the errors would now be caught by Errbit. | |||
'''Set up Cron job to regularly pull changes from upstream/master into the forked repository and deploy on Heroku.''' | '''Set up Cron job to regularly pull changes from upstream/master into the forked repository and deploy on Heroku.''' | ||
*Add the original GitHub repository as a "remote" called upstream to [https://github.com/errbit/errbit Errbit] | *Add the original GitHub repository as a "remote" called upstream to [https://github.com/errbit/errbit Errbit] | ||
*Add the empty Git repository made during app creation on Heroku as a "remote" called "production". | *Add the empty Git repository made during app creation on Heroku as a "remote" called "production". | ||
Line 86: | Line 94: | ||
*To deploy using these tasks, run: | *To deploy using these tasks, run: | ||
rake deploy:production DEPLOY_BRANCH=production | rake deploy:production DEPLOY_BRANCH=production | ||
You could access the app using: | |||
https://errbit-expertiza2019.herokuapp.com/ | |||
UserName: expertiza-support@lists.ncsu.edu | |||
Password: errbit |
Revision as of 14:16, 8 May 2019
Set up an open-source error monitoring tool instead of Airbrake
Useful links
Purpose
Errbit has been set-up, replacing the already existing Airbrake API to serve several purposes like :
- Errbit is a much more powerful monitoring tool
- Errbit is Airbrake API compliant
- Store unresolved errors indefinitely without any extra cost.
Components
- Errbit
- Expertiza
- MongoDB
The Steps taken for the setup
There were several steps taken to set-up Errbit for Expertiza and schedule it to automatically pull changed from its forked branch and deploy:
Setup Heroku
- Made an account with Email: expertiza-support@lists.ncsu.edu and Password: expertiza2019@
Setup Errbit
- Fork Errbit from https://github.com/errbit/errbit and follow the steps mentioned on README.md
- When we run "rake db:seed" it will create an admin user with a random password. We can see these login credential in the console log. But instead, we can provide this username and password explicitly by just making some changes in errbit/db/seed.rb file. Eg:
def admin_email return 'expertiza-support@lists.ncsu.edu' if heroku_pr_review_app? "expertiza-support@lists.ncsu.edu" end def admin_pass return 'errbit' if heroku_pr_review_app? @admin_pass ||= "errbit" end
- Seed the DB (NOTE: No bootstrap task is used on Heroku!).
heroku run rake db:seed
Deploy Errbit on Heroku
- Created a new empty application on Heroku and named it errbit-expertiza2019
- The app will have an associated empty git repository https://git.heroku.com/errbit-expertiza2019.git
Took the following steps in the /errbit repository on local machine:
- Login to Heroku using Herkou CLI from your console
heroku login
- Added remote
heroku git:remote -a errbit-expertiza2019
- As errbit needs MongoDB database backend so need to install MongoDB addon in Heroku. We can use heroku command to create an addon.
heroku addons:add mongolab:sandbox
heroku config:add HEROKU=true
To periodically clear resolved errors to free up space, With the cron add-on:Install the heroku cron addon, to clear resolved errors daily:
heroku addons:add cron:daily
Run the following to deploy.
git add . git commit -m “new creds” git push heroku master
Configure Expertiza to point to our deployed Errbit application
- Create a new app on Errbit named Expertiza
- Copy its configuration and place it in the expertiza/config/initializers/airbrake.rb file.
Airbrake.configure do |config| config.host = 'https://errbit-expertiza2019.herokuapp.com' config.project_id = 1 # required, but any positive integer works config.project_key = '64ed97f0c8e628acefb3a7f63308a11c' # Uncomment for Rails apps config.environment = Rails.env config.ignore_environments = %w(test) end
On starting the server, the errors would now be caught by Errbit.
Set up Cron job to regularly pull changes from upstream/master into the forked repository and deploy on Heroku.
- Add the original GitHub repository as a "remote" called upstream to Errbit
- Add the empty Git repository made during app creation on Heroku as a "remote" called "production".
In the .git/config, add:
[remote "upstream"]¬ url = https://github.com/errbit/errbit.git¬ fetch = +refs/heads/*:refs/remotes/upstream/*¬ [remote "production"]¬ url = https://git.heroku.com/errbit-expertiza2019.git¬ fetch = +refs/heads/*:refs/remotes/heroku/*¬
- Setup tasks to fetch from upstream and rebase and then push to Heroku.
- Task to migrate the database into production
- To deploy using these tasks, run:
rake deploy:production DEPLOY_BRANCH=production
You could access the app using:
https://errbit-expertiza2019.herokuapp.com/ UserName: expertiza-support@lists.ncsu.edu Password: errbit