Skip to content

Commit 20c1160

Browse files
committed
Add appsignal and remove sentry
1 parent dc70308 commit 20c1160

7 files changed

Lines changed: 26 additions & 14 deletions

File tree

Capfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,12 @@ install_plugin Capistrano::Puma::Systemd
4545

4646
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
4747
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
48+
49+
require "dotenv"
50+
Dotenv.load
51+
52+
if ENV["APPSIGNAL_PUSH_API_KEY"]
53+
require "appsignal/capistrano"
54+
else
55+
warn "\e[33mWarning: APPSIGNAL_PUSH_API_KEY is not set. Deploy marker will not be sent!\e[0m"
56+
end

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ gem "geocoder", "~> 1.8.0"
2020

2121
gem "redis", "~> 4.7.0"
2222

23+
gem "dotenv-rails"
24+
2325
# Report GC usage data to StatsD with 'barnes' gem so that Heroku can monitor
2426
gem "barnes"
2527

@@ -48,14 +50,14 @@ group :development do
4850
end
4951

5052
group :production do
53+
gem "appsignal"
5154
gem "aws-sdk-s3", require: false
5255
gem 'fog-aws'
5356
# security fix for excon gem, which is a fog-aws dependency
5457
gem 'excon', '>= 0.71.0'
5558
gem 'dalli'
5659
gem 'sendgrid-ruby'
5760
gem 'lograge'
58-
gem 'sentry-raven'
5961
gem 'sidekiq'
6062
gem 'rails_autoscale_agent'
6163
gem 'scout_apm'

Gemfile.lock

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ GEM
8282
public_suffix (>= 2.0.2, < 7.0)
8383
airbrussh (1.5.3)
8484
sshkit (>= 1.6.1, != 1.7.0)
85+
appsignal (4.7.5)
86+
logger
87+
rack (>= 2.0.0)
8588
ast (2.4.3)
8689
aws-eventstream (1.4.0)
8790
aws-partitions (1.1172.0)
@@ -405,6 +408,10 @@ GEM
405408
doorkeeper (5.8.2)
406409
railties (>= 5)
407410
doorkeeper-i18n (4.0.1)
411+
dotenv (3.1.8)
412+
dotenv-rails (3.1.8)
413+
dotenv (= 3.1.8)
414+
railties (>= 6.1)
408415
drb (2.2.3)
409416
dry-auto_inject (1.1.0)
410417
dry-core (~> 1.1)
@@ -932,8 +939,6 @@ GEM
932939
semantic_range (3.1.0)
933940
sendgrid-ruby (6.7.0)
934941
ruby_http_client (~> 3.4)
935-
sentry-raven (3.1.2)
936-
faraday (>= 1.0)
937942
shakapacker (8.3.0)
938943
activesupport (>= 5.2)
939944
package_json
@@ -1051,6 +1056,7 @@ PLATFORMS
10511056
x86_64-linux-musl
10521057

10531058
DEPENDENCIES
1059+
appsignal
10541060
aws-sdk-s3
10551061
barnes
10561062
byebug
@@ -1068,6 +1074,7 @@ DEPENDENCIES
10681074
decidim-core (= 0.31.0.rc2)
10691075
decidim-dev (= 0.31.0.rc2)
10701076
decidim-initiatives (= 0.31.0.rc2)
1077+
dotenv-rails
10711078
excon (>= 0.71.0)
10721079
faker
10731080
fog-aws
@@ -1083,7 +1090,6 @@ DEPENDENCIES
10831090
rspec-rails
10841091
scout_apm
10851092
sendgrid-ruby
1086-
sentry-raven
10871093
sidekiq
10881094
web-console
10891095
whenever

app/controllers/decidim_controller.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,4 @@
22
# entry point, but you can change what controller it inherits from
33
# so you can customize some methods.
44
class DecidimController < ApplicationController
5-
before_action :set_raven_context
6-
7-
private
8-
9-
def set_raven_context
10-
return unless Rails.env.production?
11-
12-
Raven.user_context({id: try(:current_user).try(:id)}.merge(session))
13-
Raven.extra_context(params: params.to_unsafe_h, url: request.url)
14-
end
155
end

config/deploy.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,6 @@
6565

6666
before 'deploy:assets:precompile', 'deploy:decidim_webpacker_install'
6767
end
68+
69+
set :appsignal_config, name: "Metadecidim"
70+
set :appsignal_revision, `git rev-parse --short #{fetch(:branch)}`.strip

config/deploy/production.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
# --------------
4242

4343
set :rails_env, 'production'
44+
set :appsignal_env, :production
4445

4546
set :ssh_options, {
4647
verify_host_key: :never

config/deploy/staging.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
# --------------
4242

4343
set :rails_env, 'production'
44+
set :appsignal_env, :staging
4445

4546
set :ssh_options, {
4647
verify_host_key: :never

0 commit comments

Comments
 (0)