Class: IncomeAndAssets::Submissions::Monitor

Inherits:
Object
  • Object
show all
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

Instance Method Details

#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

Parameters:

See Also:

  • IncomeAndAssetsIntakeJob
[View source] [View on GitHub]

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, , e)
  Rails.logger.error('Lighthouse::IncomeAndAssetsIntakeJob cleanup failed',
                     {
                       error: e&.message,
                       claim_id: claim&.id,
                       benefits_intake_uuid: lighthouse_service&.uuid,
                       confirmation_number: claim&.confirmation_number,
                       user_account_uuid:
                     })
end

#track_submission_attempted(claim, lighthouse_service, user_account_uuid, payload) ⇒ Object

log Sidkiq job Lighthouse submission attempted

Parameters:

See Also:

  • IncomeAndAssetsIntakeJob
[View source] [View on GitHub]

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, , 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

#track_submission_begun(claim, lighthouse_service, user_account_uuid) ⇒ Object

log Sidkiq job started

Parameters:

See Also:

  • IncomeAndAssetsIntakeJob
[View source] [View on GitHub]

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, )
  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

#track_submission_exhaustion(msg, claim = nil) ⇒ Object

log Sidkiq job exhaustion, complete failure after all retries

Parameters:

See Also:

  • IncomeAndAssetsIntakeJob
[View source] [View on GitHub]

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

#track_submission_retry(claim, lighthouse_service, user_account_uuid, e) ⇒ Object

log Sidkiq job failed, automatic retry

Parameters:

See Also:

  • IncomeAndAssetsIntakeJob
[View source] [View on GitHub]

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, , 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&.message
                    })
end

#track_submission_success(claim, lighthouse_service, user_account_uuid) ⇒ Object

log Sidkiq job completed

Parameters:

See Also:

  • IncomeAndAssetsIntakeJob
[View source] [View on GitHub]

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, )
  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