Ruby and Rails

Install gem install blipit

Add the blipit gem and call init once with your project's public key and project id. Unhandled exceptions are reported on their own.

1Gemfile

ruby
gem "blipit"

2Initialise at startup

Rails: config/initializers/blipit.rb. Scripts and Sinatra: before your code runs. Both values are on the project's Keys page.

ruby
Blipit.init(
  key: "<public key>",
  project: <project id>,
  environment: Rails.env,
  release: ENV["RELEASE"],
)

3Manual capture and login attempts

ruby
Blipit.capture_exception(e)
Blipit.capture_message("cache miss rate above 50%", level: :warning)
Blipit.set_user(id: "42", email: "ana@example.com")
Blipit.capture_security("login_failed", actor: email, ip: request.remote_ip, user_agent: request.user_agent, outcome: "bad_password")

4Check it works

Open Issues in app.blipit.io. The first event appears within a few seconds, grouped into an issue, and the people in charge get an email.

ruby
Blipit.capture_message("Hello from Rails")

Good to know

  • Rails' full integration (controllers, ActiveJob, Sidekiq) comes from the sentry-rails gem; it works unchanged with the DSN https://<public key>@in.blipit.io/<project id>.
  • Pass traces_sample_rate: 0.2 to init and requests show up on the Performance page.

Stuck? Email support@blipit.io. Keys and the exact DSN for each project are under API keys in app.blipit.io.