# Sinatra Error and Performance Monitoring

> Find bugs & optimize the performance of your Sinatra app with performance monitoring. Get started with Sinatra error monitoring for free here.

**URL:** https://sentry.io/for/sinatra/

---

**Documentation:** [https://docs.sentry.io/platforms/ruby/guides/rack/](https://docs.sentry.io/platforms/ruby/guides/rack/)

## Install

Add the [Sentry Ruby SDK](https://github.com/getsentry/sentry-ruby) to your Gemfile:

```ruby
gem "sentry-ruby"
```

Initialize the SDK before requiring Sinatra, then add the Rack middleware:

```ruby
require 'sentry-ruby'

Sentry.init do |config|
  config.dsn = 'https://<key>@sentry.io/<project>'
  config.breadcrumbs_logger = [:sentry_logger, :http_logger]

  # Set traces_sample_rate to 1.0 to capture 100%
  # of transactions for tracing.
  # We recommend adjusting this value in production.
  config.traces_sample_rate = 1.0
end

require 'sinatra'
use Sentry::Rack::CaptureExceptions
```

See the [Sinatra docs](https://docs.sentry.io/platforms/ruby/guides/rack/) for full setup options.

## Features

### Sinatra Performance Monitoring

Quickly identify Sinatra [performance](/product/tracing/) issues and view the full end-to-end distributed trace to see the exact, poor-performing API call and surface any related errors.

### Sinatra Monitoring with Complete Stack Traces

Take advantage of built-in integrations with Rails, Sidekiq, DelayedJob, and more of your favorite RubyGems. Events are sent asynchronously by a background worker, so reporting never blocks your requests. Filter and group Sinatra exceptions intuitively to eliminate noise.

### Fill In The Blanks About Sinatra Errors

Expose important events that led to each Sinatra exception: a string to label where the event took place, message, timestamp. Learn in which version a bug first appeared, merge duplicates, and know if things regress in a future release.

---

*Source: [sentry.io/for/sinatra/](https://sentry.io/for/sinatra/)*
