chore(sentry): read sentry release information from version file
This commit is contained in:
parent
326787bbf1
commit
e1a25ee0e5
4 changed files with 19 additions and 3 deletions
|
@ -1,8 +1,21 @@
|
|||
class SentryRelease
|
||||
@@current = nil
|
||||
|
||||
def self.current
|
||||
@@current ||= begin
|
||||
version = Rails.root.join('version')
|
||||
version.readable? ? version.read.strip : ''
|
||||
end
|
||||
@@current.presence
|
||||
end
|
||||
end
|
||||
|
||||
Sentry.init do |config|
|
||||
secrets = Rails.application.secrets.sentry
|
||||
|
||||
config.dsn = secrets[:enabled] ? secrets[:rails_client_key] : nil
|
||||
config.send_default_pii = false
|
||||
config.release = SentryRelease.current
|
||||
config.environment = secrets[:environment] || Rails.env
|
||||
config.enabled_environments = ['production', secrets[:environment].presence].compact
|
||||
config.breadcrumbs_logger = [:active_support_logger]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue