Skip to content

Commit

Permalink
Add request details to Sentry context
Browse files Browse the repository at this point in the history
  • Loading branch information
Nitemaeric committed Dec 13, 2024
1 parent 9e1b7c1 commit 23d8cd5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/controllers/find/results_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

module Find
class ResultsController < ApplicationController
before_action :set_sentry_context
before_action :render_feedback_component

def index
Expand All @@ -23,5 +24,12 @@ def index
def track_search_results(number_of_results:, course_codes:)
Find::ResultsTracking.new(request:).track_search_results(number_of_results:, course_codes:)
end

def set_sentry_context
Sentry.set_context('Request Headers', {
Referer: request.headers['Referer']
})
Sentry.set_context('Query Parameters', request.query_parameters)
end
end
end

0 comments on commit 23d8cd5

Please sign in to comment.