From 289feb9c248bf1d7fb76a974f218cae187990967 Mon Sep 17 00:00:00 2001 From: Derrick Ellerbie Date: Thu, 31 Oct 2024 09:12:38 -0700 Subject: [PATCH] EZR: Add ZSF logging (#19153) --- app/sidekiq/hca/ezr_submission_job.rb | 5 +++++ spec/sidekiq/hca/ezr_submission_job_spec.rb | 3 +++ 2 files changed, 8 insertions(+) diff --git a/app/sidekiq/hca/ezr_submission_job.rb b/app/sidekiq/hca/ezr_submission_job.rb index 70f3957adf2..baacc83e1b7 100644 --- a/app/sidekiq/hca/ezr_submission_job.rb +++ b/app/sidekiq/hca/ezr_submission_job.rb @@ -9,6 +9,10 @@ class EzrSubmissionJob extend SentryLogging VALIDATION_ERROR = HCA::SOAPParser::ValidationError STATSD_KEY_PREFIX = 'api.1010ezr' + DD_ZSF_TAGS = [ + 'service:healthcare-application', + 'function: 10-10EZR async form submission' + ].freeze # 14 retries was decided on because it's the closest to a 24-hour time span based on # Sidekiq's backoff formula: https://github.com/sidekiq/sidekiq/wiki/Error-Handling#automatic-job-retry @@ -56,6 +60,7 @@ def self.send_failure_email(parsed_form) api_key ) StatsD.increment("#{STATSD_KEY_PREFIX}.submission_failure_email_sent") + StatsD.increment('silent_failure_avoided_no_confirmation', tags: DD_ZSF_TAGS) end def perform(encrypted_form, user_uuid) diff --git a/spec/sidekiq/hca/ezr_submission_job_spec.rb b/spec/sidekiq/hca/ezr_submission_job_spec.rb index 2a87cae1e9e..12b884919e3 100644 --- a/spec/sidekiq/hca/ezr_submission_job_spec.rb +++ b/spec/sidekiq/hca/ezr_submission_job_spec.rb @@ -11,6 +11,7 @@ HealthCareApplication::LOCKBOX.encrypt(form.to_json) end let(:ezr_service) { double } + let(:tags) { described_class::DD_ZSF_TAGS } describe 'when retries are exhausted' do before do @@ -71,6 +72,7 @@ ) expect(VANotify::EmailJob).to receive(:perform_async).with(*template_params) expect(StatsD).to receive(:increment).with('api.1010ezr.submission_failure_email_sent') + expect(StatsD).to receive(:increment).with('silent_failure_avoided_no_confirmation', tags:) end pii_log = PersonalInformationLog.last @@ -87,6 +89,7 @@ described_class.within_sidekiq_retries_exhausted_block(msg) do expect(VANotify::EmailJob).not_to receive(:perform_async) expect(StatsD).not_to receive(:increment).with('api.1010ezr.submission_failure_email_sent') + expect(StatsD).not_to receive(:increment).with('silent_failure_avoided_no_confirmation', tags:) end end end