Skip to content

Commit eacb3b7

Browse files
committed
[FEAT] Add Sentry
1 parent 60dd613 commit eacb3b7

File tree

5 files changed

+34
-1
lines changed

5 files changed

+34
-1
lines changed

.erb-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ linters:
1111
DeprecatedClasses:
1212
enabled: true
1313
ErbSafety:
14-
enabled: true
14+
enabled: false
1515
better_html_config: .better-html.yml
1616
ExtraNewline:
1717
enabled: true

Gemfile

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ gem "octokit", "~> 9.2.0"
1212
gem "omniauth-github", github: "omniauth/omniauth-github", branch: "master"
1313
gem "omniauth-rails_csrf_protection"
1414
gem "propshaft", "~> 1.1.0"
15+
gem "sentry-ruby"
16+
gem "sentry-rails"
17+
gem "stackprof"
1518
gem "solid_cache", "~> 1.0.6"
1619
gem "solid_queue", "~> 1.0.2"
1720
gem "sqlite3", "~> 2.3.0"

Gemfile.lock

+10
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,12 @@ GEM
415415
rexml (~> 3.2, >= 3.2.5)
416416
rubyzip (>= 1.2.2, < 3.0)
417417
websocket (~> 1.0)
418+
sentry-rails (5.21.0)
419+
railties (>= 5.0)
420+
sentry-ruby (~> 5.21.0)
421+
sentry-ruby (5.21.0)
422+
bigdecimal
423+
concurrent-ruby (~> 1.0, >= 1.0.2)
418424
simplecov (0.22.0)
419425
docile (~> 1.1)
420426
simplecov-html (~> 0.11)
@@ -454,6 +460,7 @@ GEM
454460
net-sftp (>= 2.1.2)
455461
net-ssh (>= 2.8.0)
456462
ostruct
463+
stackprof (0.2.26)
457464
stimulus-rails (1.3.4)
458465
railties (>= 6.0.0)
459466
stringio (3.1.1)
@@ -538,11 +545,14 @@ DEPENDENCIES
538545
rails (= 8.0.0)
539546
rubocop-rails-omakase
540547
selenium-webdriver (~> 4.26.0)
548+
sentry-rails
549+
sentry-ruby
541550
simplecov
542551
simplecov-tailwindcss
543552
solid_cache (~> 1.0.6)
544553
solid_queue (~> 1.0.2)
545554
sqlite3 (~> 2.3.0)
555+
stackprof
546556
stimulus-rails
547557
thruster (~> 0.1.9)
548558
turbo-rails (~> 2.0.11)

app/views/layouts/application.html.erb

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<link rel="apple-touch-icon" href="/icon.png">
1616
<%= vite_client_tag %>
1717
<%= vite_javascript_tag "application" %>
18+
<%= Sentry.get_trace_propagation_meta.html_safe %>
1819
</head>
1920
<body>
2021
<% if notice %>

config/initializers/sentry.rb

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# frozen_string_literal: true
2+
3+
Sentry.init do |config|
4+
config.dsn = "https://9a5d6b46b2aceb55085f3813b9862aff@o4508342968975360.ingest.de.sentry.io/4508342982934608"
5+
config.breadcrumbs_logger = [ :active_support_logger, :http_logger ]
6+
7+
# Set traces_sample_rate to 1.0 to capture 100%
8+
# of transactions for tracing.
9+
# We recommend adjusting this value in production.
10+
config.traces_sample_rate = 1.0
11+
# or
12+
config.traces_sampler = lambda do |context|
13+
true
14+
end
15+
# Set profiles_sample_rate to profile 100%
16+
# of sampled transactions.
17+
# We recommend adjusting this value in production.
18+
config.profiles_sample_rate = 0.5
19+
end

0 commit comments

Comments
 (0)