Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ gem "minitest-rails", "~> 8.0.0"
gem "pg", "~> 1.1"
gem "propshaft"
gem "puma", ">= 5.0"
gem "sentry-ruby"
gem "sentry-rails"
gem "solid_cable"
gem "solid_cache"
Expand All @@ -35,6 +36,7 @@ end

group :development do
gem "web-console"
gem "dotenv-rails"
end

group :test do
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ GEM
responders
warden (~> 1.2.3)
dotenv (3.1.8)
dotenv-rails (3.1.8)
dotenv (= 3.1.8)
railties (>= 6.1)
drb (2.2.3)
dry-cli (1.2.0)
ed25519 (1.4.0)
Expand Down Expand Up @@ -419,6 +422,7 @@ DEPENDENCIES
capybara
debug
devise (~> 4.9)
dotenv-rails
httparty (~> 0.23.1)
jbuilder
json_schemer (~> 2.4)
Expand All @@ -436,6 +440,7 @@ DEPENDENCIES
rubocop-rails-omakase
selenium-webdriver
sentry-rails
sentry-ruby
solid_cable
solid_cache
solid_queue
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,31 @@ or run the following command to deploy to google cloud
Add environment variables to google cloud `add-update-env-gcloud.sh` and run the following command to add environment variables to google cloud
`sh add-update-env-gcloud.sh`

### Sentry Configuration

This project includes Sentry integration for error monitoring and performance tracking. To enable Sentry:

1. **Create a Sentry project:**
- Go to [Sentry.io](https://sentry.io) and create a new project
- Select "Ruby" as the platform
- Copy the DSN from your project settings

2. **Set the environment variable:**
- Add `SENTRY_DSN` to your environment variables with the DSN from your Sentry project
- For local development, add it to your `.env` file:
```bash
SENTRY_DSN=https://your-dsn@sentry.io/project-id
```
- For production, add it to your Google Cloud environment variables

3. **Sentry features enabled:**
- Automatic error tracking and reporting
- Performance monitoring
- Request headers and IP data collection (for debugging)
- Active Support and HTTP logger breadcrumbs

The Sentry integration will only be active when the `SENTRY_DSN` environment variable is present and configured.

### Technology Stack

![PostgreSQL 17](https://img.shields.io/badge/PostgreSQL-17-336791?logo=postgresql&logoColor=white)
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<%= vite_stylesheet_tag "application" %>
<%= vite_typescript_tag "application" %>
<%= yield :head %>
<%= Sentry.get_trace_propagation_meta.html_safe if ENV['SENTRY_DSN'].present? %>
</head>

<body>
Expand Down
10 changes: 10 additions & 0 deletions config/initializers/sentry.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if ENV["SENTRY_DSN"].present?
Sentry.init do |config|
config.dsn = ENV["SENTRY_DSN"]
config.breadcrumbs_logger = %i[active_support_logger http_logger]

# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/ruby/data-management/data-collected/ for more info
config.send_default_pii = true
end
end