Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ gem "logstash-event", "~> 1.2", ">= 1.2.02"
gem "logstash-logger", "~> 0.26.1"
gem "mysql2", "~> 0.5.3"
gem "dotenv"
gem "sentry-raven", "~> 3.1", ">= 3.1.2"
# gem "sentry-raven", "~> 3.1", ">= 3.1.2"
gem "sentry-ruby"
gem "sentry-rails"
gem "elasticsearch", "~> 7.17", ">= 7.17.10"
gem "elasticsearch-model", "~> 7.2.1", ">= 7.2.1", require: "elasticsearch/model"
gem "elasticsearch-rails", "~> 7.2.1", ">= 7.2.1"
Expand Down
11 changes: 8 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,12 @@ GEM
rubocop (~> 1.62)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
sentry-raven (3.1.2)
faraday (>= 1.0)
sentry-rails (5.23.0)
railties (>= 5.0)
sentry-ruby (~> 5.23.0)
sentry-ruby (5.23.0)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
shoryuken (4.0.3)
aws-sdk-core (>= 2)
concurrent-ruby
Expand Down Expand Up @@ -385,7 +389,8 @@ DEPENDENCIES
rubocop-rails
rubocop-rspec
rubocop-shopify
sentry-raven (~> 3.1, >= 3.1.2)
sentry-rails
sentry-ruby
shoryuken (~> 4.0)

RUBY VERSION
Expand Down
1 change: 1 addition & 0 deletions app/controllers/events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class EventsController < ApplicationController
def index
Sentry.capture_message("events_controller test message")
render(json: { message: "index" })
end

Expand Down
7 changes: 1 addition & 6 deletions config/initializers/filter_parameter_logging.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
# Use this to limit dissemination of sensitive information.
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
Rails.application.config.filter_parameters += [
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn,
:password, :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn,
]
33 changes: 29 additions & 4 deletions config/initializers/sentry.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
# frozen_string_literal: true

Raven.configure do |config|
config.environments = ["stage", "production"]
Sentry.init do |config|
config.enabled_environments = ["stage", "production"]
config.dsn = ENV["SENTRY_DSN"]
config.release = "events:" + Events::Application::VERSION
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
config.logger = Rails.application.config.lograge.logger
# config.logger = Rails.application.config.lograge.logger
config.send_default_pii = true

filter = ActiveSupport::ParameterFilter.new(Rails.application.config.filter_parameters)

config.before_send = lambda do |event, _hint|
if event.extra
event.extra = filter.filter(event.extra)
end

if event.user
event.user = filter.filter(event.user)
end

if event.contexts
event.contexts = filter.filter(event.contexts)
end

event
end
end
# Raven.configure do |config|
# config.environments = ["stage", "production"]
# config.dsn = ENV["SENTRY_DSN"]
# config.release = "events:" + Events::Application::VERSION
# config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
# config.logger = Rails.application.config.lograge.logger
# end