-
Notifications
You must be signed in to change notification settings - Fork 125
/
sentry.rb
31 lines (28 loc) · 983 Bytes
/
sentry.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# frozen_string_literal: true
# 默认开启 Sentry,如果不想使用设置 ZEALOT_SENTRY_DISABLE=1
if ENV['ZEALOT_SENTRY_DISABLE'].blank?
Rails.configuration.to_prepare do
Raven.configure do |config|
config.silence_ready = true
config.dsn = ENV['ZEALOT_SENTRY_DNS'] || 'https://133aefa9f52448a1a7900ba9d02f93e1@sentry.io/1878137'
config.excluded_exceptions += [
'ActionController::RoutingError',
'ActiveRecord::RecordNotFound',
'ActiveRecord::RecordInvalid',
'ActiveRecord::NoDatabaseError',
'PG::ConnectionBad',
]
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
config.sanitize_fields << 'token'
version = Setting.version
vcs_ref = Setting.vcs_ref
if vcs_ref.present?
config.release = "#{version}-#{vcs_ref}"
config.tags = {
docker: true,
docker_tag: ENV['DOCKER_TAG']
}
end
end
end
end