Class: IncomeAndAssets::Claims::Monitor
- Inherits:
-
Object
- Object
- IncomeAndAssets::Claims::Monitor
- Defined in:
- lib/income_and_assets/claims/monitor.rb
Constant Summary collapse
- CLAIM_STATS_KEY =
statsd key for api
'api.income_and_assets'
Instance Method Summary collapse
-
#track_create_attempt(claim, user_account_uuid) ⇒ Object
log POST processing started.
-
#track_create_error(in_progress_form_id, claim, user_account_uuid, e = nil) ⇒ Object
log POST processing failure.
-
#track_create_success(in_progress_form_id, claim, user_account_uuid) ⇒ Object
log POST processing success.
-
#track_show404(confirmation_number, user_account_uuid, e) ⇒ Object
log GET 404 from controller.
-
#track_show_error(confirmation_number, user_account_uuid, e) ⇒ Object
log GET 500 from controller.
Instance Method Details
#track_create_attempt(claim, user_account_uuid) ⇒ Object
log POST processing started
53 54 55 56 57 58 59 60 |
# File 'lib/income_and_assets/claims/monitor.rb', line 53 def track_create_attempt(claim, user_account_uuid) StatsD.increment("#{CLAIM_STATS_KEY}.attempt") context = { confirmation_number: claim&.confirmation_number, user_account_uuid: } Rails.logger.info('21P-0969 claim creation begun', context) end |
#track_create_error(in_progress_form_id, claim, user_account_uuid, e = nil) ⇒ Object
log POST processing failure
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/income_and_assets/claims/monitor.rb', line 71 def track_create_error(in_progress_form_id, claim, user_account_uuid, e = nil) StatsD.increment("#{CLAIM_STATS_KEY}.failure") context = { confirmation_number: claim&.confirmation_number, user_account_uuid:, in_progress_form_id:, errors: claim&.errors&.errors, message: e&. } Rails.logger.error('21P-0969 claim creation failed', context) end |
#track_create_success(in_progress_form_id, claim, user_account_uuid) ⇒ Object
log POST processing success
91 92 93 94 95 96 97 98 99 100 |
# File 'lib/income_and_assets/claims/monitor.rb', line 91 def track_create_success(in_progress_form_id, claim, user_account_uuid) StatsD.increment("#{CLAIM_STATS_KEY}.success") if claim.form_start_date StatsD.measure('saved_claim.time-to-file', claim.created_at - claim.form_start_date, tags: ["form_id:#{claim.form_id}"]) end Rails.logger.info('21P-0969 claim creation success', { confirmation_number: claim&.confirmation_number, user_account_uuid:, in_progress_form_id: }) end |
#track_show404(confirmation_number, user_account_uuid, e) ⇒ Object
log GET 404 from controller
20 21 22 23 24 25 26 27 |
# File 'lib/income_and_assets/claims/monitor.rb', line 20 def track_show404(confirmation_number, user_account_uuid, e) context = { confirmation_number:, user_account_uuid:, message: e&. } Rails.logger.error('21P-0969 claim not found', context) end |
#track_show_error(confirmation_number, user_account_uuid, e) ⇒ Object
log GET 500 from controller
37 38 39 40 41 42 43 44 |
# File 'lib/income_and_assets/claims/monitor.rb', line 37 def track_show_error(confirmation_number, user_account_uuid, e) context = { confirmation_number:, user_account_uuid:, message: e&. } Rails.logger.error('21P-0969 fetching claim failed', context) end |