Skip to content

Commit

Permalink
feat: add sentry instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tachyons-gitlab committed May 14, 2024
1 parent 18d2e23 commit e6a6076
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ AWS_S3_ACCESS_KEY_ID=''
AWS_S3_SECRET_ACCESS_KEY=''
ENABLE_OTEL=''
NEW_RELIC_API_KEY=<new-relic-license-key-here>
SENTRY_DSN=''
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,8 @@ gem "opentelemetry-instrumentation-action_pack"
gem "opentelemetry-instrumentation-action_view"

gem "maintenance_tasks", "~> 2.3"


gem "stackprof"
gem "sentry-ruby"
gem "sentry-rails"
20 changes: 11 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ GEM
erubi (~> 1.4)
parser (>= 2.4)
smart_properties
bigdecimal (3.1.8)
bindex (0.8.1)
bootsnap (1.15.0)
msgpack (~> 1.2)
Expand Down Expand Up @@ -268,9 +269,6 @@ GEM
globalid (1.2.1)
activesupport (>= 6.1)
google-protobuf (3.25.3)
google-protobuf (3.25.3-arm64-darwin)
google-protobuf (3.25.3-x86_64-darwin)
google-protobuf (3.25.3-x86_64-linux)
googleapis-common-protos-types (1.6.0)
google-protobuf (~> 3.14)
hairtrigger (0.2.25)
Expand Down Expand Up @@ -418,12 +416,6 @@ GEM
nokogiri (1.16.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.2-x86_64-linux)
racc (~> 1.4)
noticed (1.6.3)
http (>= 4.0.0)
rails (>= 5.2.0)
Expand Down Expand Up @@ -739,6 +731,12 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sentry-rails (5.17.3)
railties (>= 5.0)
sentry-ruby (~> 5.17.3)
sentry-ruby (5.17.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
sexp_processor (4.16.0)
shoulda-matchers (6.1.0)
activesupport (>= 5.2.0)
Expand Down Expand Up @@ -787,6 +785,7 @@ GEM
activesupport (>= 5.2)
sprockets (>= 3.0.0)
ssrf_filter (1.1.2)
stackprof (0.2.26)
steep (1.4.0)
activesupport (>= 5.1)
concurrent-ruby (>= 1.2.2)
Expand Down Expand Up @@ -1004,6 +1003,8 @@ DEPENDENCIES
sassc-rails
select2-rails
selenium-webdriver
sentry-rails
sentry-ruby
shoulda-matchers
sidekiq
simple_discussion!
Expand All @@ -1013,6 +1014,7 @@ DEPENDENCIES
solargraph-rails (~> 0.3.1)
spring
sprockets (~> 4.1)
stackprof
steep
stimulus-rails (~> 1.0)
strong_migrations
Expand Down
18 changes: 18 additions & 0 deletions config/initializers/sentry.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Sentry.init do |config|
config.dsn = 'https://a9660d5d8964d5b348b07b77691d61a7@o4507251968376832.ingest.de.sentry.io/4507251969949776'
config.dsn = ENV['SENTRY_DSN']
config.breadcrumbs_logger = [:active_support_logger, :http_logger]

# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production.
config.traces_sample_rate = 1.0
# or
config.traces_sampler = lambda do |_context|
true
end
# Set profiles_sample_rate to profile 100%
# of sampled transactions.
# We recommend adjusting this value in production.
config.profiles_sample_rate = 1.0
end

0 comments on commit e6a6076

Please sign in to comment.