Class: IncomeAndAssets::Submissions::Monitor
- Inherits:
-
Object
- Object
- IncomeAndAssets::Submissions::Monitor
- Defined in:
- lib/income_and_assets/submissions/monitor.rb
Constant Summary collapse
- SUBMISSION_STATS_KEY =
statsd key for sidekiq
'worker.lighthouse.income_and_assets_intake_job'
Instance Method Summary collapse
-
#track_file_cleanup_error(claim, lighthouse_service, user_account_uuid, e) ⇒ Object
log Sidkiq job cleanup error occurred, this can occur post success or failure.
-
#track_submission_attempted(claim, lighthouse_service, user_account_uuid, payload) ⇒ Object
log Sidkiq job Lighthouse submission attempted.
-
#track_submission_begun(claim, lighthouse_service, user_account_uuid) ⇒ Object
log Sidkiq job started.
-
#track_submission_exhaustion(msg, claim = nil) ⇒ Object
log Sidkiq job exhaustion, complete failure after all retries.
-
#track_submission_retry(claim, lighthouse_service, user_account_uuid, e) ⇒ Object
log Sidkiq job failed, automatic retry.
-
#track_submission_success(claim, lighthouse_service, user_account_uuid) ⇒ Object
log Sidkiq job completed.
Instance Method Details
permalink #track_file_cleanup_error(claim, lighthouse_service, user_account_uuid, e) ⇒ Object
log Sidkiq job cleanup error occurred, this can occur post success or failure
116 117 118 119 120 121 122 123 124 125 |
# File 'lib/income_and_assets/submissions/monitor.rb', line 116 def track_file_cleanup_error(claim, lighthouse_service, user_account_uuid, e) Rails.logger.error('Lighthouse::IncomeAndAssetsIntakeJob cleanup failed', { error: e&., claim_id: claim&.id, benefits_intake_uuid: lighthouse_service&.uuid, confirmation_number: claim&.confirmation_number, user_account_uuid: }) end |
permalink #track_submission_attempted(claim, lighthouse_service, user_account_uuid, payload) ⇒ Object
log Sidkiq job Lighthouse submission attempted
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/income_and_assets/submissions/monitor.rb', line 40 def track_submission_attempted(claim, lighthouse_service, user_account_uuid, payload) StatsD.increment("#{SUBMISSION_STATS_KEY}.attempt") Rails.logger.info('Lighthouse::IncomeAndAssetsIntakeJob submission to LH attempted', { claim_id: claim&.id, benefits_intake_uuid: lighthouse_service&.uuid, confirmation_number: claim&.confirmation_number, user_account_uuid:, file: payload[:file], attachments: payload[:attachments] }) end |
permalink #track_submission_begun(claim, lighthouse_service, user_account_uuid) ⇒ Object
log Sidkiq job started
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/income_and_assets/submissions/monitor.rb', line 20 def track_submission_begun(claim, lighthouse_service, user_account_uuid) StatsD.increment("#{SUBMISSION_STATS_KEY}.begun") Rails.logger.info('Lighthouse::IncomeAndAssetsIntakeJob submission to LH begun', { claim_id: claim&.id, benefits_intake_uuid: lighthouse_service&.uuid, confirmation_number: claim&.confirmation_number, user_account_uuid: }) end |
permalink #track_submission_exhaustion(msg, claim = nil) ⇒ Object
log Sidkiq job exhaustion, complete failure after all retries
97 98 99 100 101 102 103 104 105 |
# File 'lib/income_and_assets/submissions/monitor.rb', line 97 def track_submission_exhaustion(msg, claim = nil) StatsD.increment("#{SUBMISSION_STATS_KEY}.exhausted") Rails.logger.error('Lighthouse::IncomeAndAssetsIntakeJob submission to LH exhausted!', { claim_id: msg['args'].first, confirmation_number: claim&.confirmation_number, message: msg, user_account_uuid: msg['args'].length <= 1 ? nil : msg['args'][1] }) end |
permalink #track_submission_retry(claim, lighthouse_service, user_account_uuid, e) ⇒ Object
log Sidkiq job failed, automatic retry
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/income_and_assets/submissions/monitor.rb', line 79 def track_submission_retry(claim, lighthouse_service, user_account_uuid, e) StatsD.increment("#{SUBMISSION_STATS_KEY}.failure") Rails.logger.warn('Lighthouse::IncomeAndAssetsIntakeJob submission to LH failed, retrying', { claim_id: claim&.id, benefits_intake_uuid: lighthouse_service&.uuid, confirmation_number: claim&.confirmation_number, user_account_uuid:, message: e&. }) end |
permalink #track_submission_success(claim, lighthouse_service, user_account_uuid) ⇒ Object
log Sidkiq job completed
60 61 62 63 64 65 66 67 68 |
# File 'lib/income_and_assets/submissions/monitor.rb', line 60 def track_submission_success(claim, lighthouse_service, user_account_uuid) StatsD.increment("#{SUBMISSION_STATS_KEY}.success") Rails.logger.info('Lighthouse::IncomeAndAssetsIntakeJob submission to LH succeeded', { claim_id: claim&.id, benefits_intake_uuid: lighthouse_service&.uuid, confirmation_number: claim&.confirmation_number, user_account_uuid: }) end |