Skip to content

Commit

Permalink
Stop notifying Rollbar common errors that aren't useful to us
Browse files Browse the repository at this point in the history
    These are generally caused by bots looking for wordpress weaknesses. They're using up our rollbar quota
  • Loading branch information
sourcefilter committed Aug 22, 2024
1 parent 3962be1 commit 60503db
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 0 additions & 2 deletions app/indexers/work_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ def solr_dates
return nil if dates.blank?
valid_dates
rescue ArgumentError => e
# We might want to start reporting metadata errors to Rollbar if we come up with a way to make them searchable and allow them to provide a feedback loop.
# Rollbar.error(e, "Invalid date string encountered in normalized date field: #{date_string}")
Rails.logger.error "event: metadata_error : Invalid date string encountered in normalized date field: #{dates}: #{e}"
nil
end
Expand Down
2 changes: 0 additions & 2 deletions app/indexers/year_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ def self.parse_year(date_string)
# which really shouldn't be in the normalized date field, but we shouldn't
# crash if we encounter it.
rescue ArgumentError => e
# We might want to start reporting metadata errors to Rollbar if we come up with a way to make them searchable and allow them to provide a feedback loop.
# Rollbar.error(e, "Invalid date string encountered in normalized date field: #{date_string}")
Rails.logger.error "event: metadata_error : Invalid date string encountered in normalized date field: #{date_string}: #{e}"
nil
end
Expand Down
1 change: 0 additions & 1 deletion app/jobs/csv_row_import_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def perform(row_id:)
ingest_duration: end_time - start_time,
job_ids_completed: @row.job_ids_completed << job_id)
rescue => e
Rollbar.error(e, csv_import_id: @row.csv_import_id, row_id: @row_id, ark: record.mapper.ark)
end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
@row.update(status: 'error',
ingest_record_end_time: Time.current,
Expand Down
2 changes: 0 additions & 2 deletions app/jobs/delete_all_child_works_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ def perform
record = ChildWork.first
ark = record.ark
Californica::Deleter.new(record: record).delete
Rollbar.info("Deleted ChildWork", ark: ark, duration: ActiveSupport::Duration.build(Time.current - start_time), remaining: ChildWork.count)
end

Rollbar.info("No ChildWorks Remaining", remaining: ChildWork.count)
end
end
9 changes: 9 additions & 0 deletions config/initializers/rollbar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
#
# You can also specify a callable, which will be called with the exception instance.
# config.exception_level_filters.merge!('MyCriticalException' => lambda { |e| 'critical' })
config.exception_level_filters.merge!(
'ActionController::RoutingError' => 'ignore', config.exception_level_filters.merge!(
'ActionController::RoutingError' => 'ignore',
'ActionController::InvalidAuthenticityToken' => 'ignore',
'I18n::InvalidLocale' => 'ignore',
'Blacklight::Exceptions::RecordNotFound' => 'ignore'
)
'Blacklight::Exceptions::RecordNotFound' => 'ignore'
)

# Enable asynchronous reporting (uses girl_friday or Threading if girl_friday
# is not installed)
Expand Down

0 comments on commit 60503db

Please sign in to comment.