sentry-ruby-setup

sentry-ruby-setup

Setup Sentry in Ruby apps. Use when asked to add Sentry to Ruby, install sentry-ruby gem, or configure error monitoring for Ruby applications or Rails.

4estrelas
0forks
Atualizado 1/23/2026
SKILL.md
readonlyread-only
name
sentry-ruby-setup
description

Setup Sentry in Ruby apps. Use when asked to add Sentry to Ruby, install sentry-ruby gem, or configure error monitoring for Ruby applications or Rails.

Sentry Ruby Setup

Install and configure Sentry in Ruby projects.

Invoke This Skill When

  • User asks to "add Sentry to Ruby" or "install Sentry" in a Ruby app
  • User wants error monitoring, logging, or tracing in Ruby
  • User mentions "sentry-ruby" gem or Ruby on Rails

Requirements

  • Ruby 2.4+ or recent JRuby versions

Install

Add to Gemfile:

gem "sentry-ruby"

# For profiling, also add:
gem "stackprof"

Then run:

bundle install

Configure

Initialize as early as possible:

require "sentry-ruby"

Sentry.init do |config|
  config.dsn = "YOUR_SENTRY_DSN"
  config.send_default_pii = true
  
  # Breadcrumbs from logs
  config.breadcrumbs_logger = [:sentry_logger, :http_logger]
  
  # Tracing
  config.traces_sample_rate = 1.0
  
  # Profiling (requires stackprof gem)
  config.profiles_sample_rate = 1.0
  
  # Logs
  config.enable_logs = true
end

Rails Integration

For Rails, add to config/initializers/sentry.rb:

Sentry.init do |config|
  config.dsn = ENV["SENTRY_DSN"]
  config.send_default_pii = true
  config.breadcrumbs_logger = [:active_support_logger, :http_logger]
  config.traces_sample_rate = 1.0
  config.profiles_sample_rate = 1.0
  config.enable_logs = true
end

Rails-specific Gems

# Gemfile
gem "sentry-ruby"
gem "sentry-rails"  # Rails integration
gem "sentry-sidekiq"  # If using Sidekiq
gem "sentry-delayed_job"  # If using Delayed Job
gem "sentry-resque"  # If using Resque

Configuration Options

Option Description Default
dsn Sentry DSN Required
send_default_pii Include user data false
traces_sample_rate % of transactions traced 0
profiles_sample_rate % of traces profiled 0
enable_logs Send logs to Sentry false
environment Environment name Auto-detected
release Release version Auto-detected

Breadcrumb Loggers

Logger Description
:sentry_logger Sentry's own logger
:http_logger HTTP request breadcrumbs
:active_support_logger Rails ActiveSupport (Rails only)

Environment Variables

SENTRY_DSN=https://xxx@o123.ingest.sentry.io/456
SENTRY_AUTH_TOKEN=sntrys_xxx
SENTRY_ORG=my-org
SENTRY_PROJECT=my-project

Verification

# Capture test message
Sentry.capture_message("Test message from Ruby")

# Or trigger intentional error
1 / 0

Troubleshooting

Issue Solution
Errors not appearing Ensure Sentry.init called early, check DSN
No traces Set traces_sample_rate > 0
No profiles Add stackprof gem, set profiles_sample_rate
Rails errors missing Use sentry-rails gem instead of sentry-ruby

You Might Also Like

Related Skills

create-pr

create-pr

170Kdev-devops

Creates GitHub pull requests with properly formatted titles that pass the check-pr-title CI validation. Use when creating PRs, submitting changes for review, or when the user says /pr or asks to create a pull request.

n8n-io avatarn8n-io
Obter

Guide for performing Chromium version upgrades in the Electron project. Use when working on the roller/chromium/main branch to fix patch conflicts during `e sync --3`. Covers the patch application workflow, conflict resolution, analyzing upstream Chromium changes, and proper commit formatting for patch fixes.

electron avatarelectron
Obter
pr-creator

pr-creator

92Kdev-devops

Use this skill when asked to create a pull request (PR). It ensures all PRs follow the repository's established templates and standards.

google-gemini avatargoogle-gemini
Obter
clawdhub

clawdhub

87Kdev-devops

Use the ClawdHub CLI to search, install, update, and publish agent skills from clawdhub.com. Use when you need to fetch new skills on the fly, sync installed skills to latest or a specific version, or publish new/updated skill folders with the npm-installed clawdhub CLI.

moltbot avatarmoltbot
Obter
tmux

tmux

87Kdev-devops

Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.

moltbot avatarmoltbot
Obter
create-pull-request

create-pull-request

57Kdev-devops

Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, and PR creation using the gh CLI tool.

cline avatarcline
Obter