Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging for submit 0781 job exhaustion #19433

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ajones446
Copy link
Contributor

@ajones446 ajones446 commented Nov 12, 2024

This PR adds logging for when the submit0781 job exhausts, in order to be consistent with how we log exhaustion for the BDD instructions and Veteran Upload jobs.

This change is part of a larger effort to gradually migrate to using the Lighthouse API instead of EVSS. All the migration behavior is behind flippers.

Summary

  • *This work is behind a feature toggle (flipper): YES
  • (Summarize the changes that have been made to the platform)
  • (If bug, how to reproduce)
  • (What is the solution, why is this the solution?)
  • (Which team do you work for, does your team own the maintenance of this component?) DBEX Team 2 (Carbs)
  • (If introducing a flipper, what is the success criteria being targeted?)

Related issue(s)

Testing done

  • New code is covered by unit tests
  • Describe what the old behavior was prior to the change
    The job exhausted but did not log to Datadog
  • Describe the steps required to verify your changes are working as expected. Exclusively stating 'Specs run' is NOT acceptable as appropriate testing
    This will be monitored in Datadog
  • If this work is behind a flipper:
    • Tests need to be written for both the flipper on and flipper off scenarios. Docs.
    • What is the testing plan for rolling out the feature?
      The 0781 LH migration is being rolled out incrementally based on a percentage of production users, starting at 1%. All 0781 upload attempts will be logged and monitored.

Screenshots

Note: Optional

What areas of the site does it impact?

(Describe what parts of the site are impacted andifcode touched other areas)

Acceptance criteria

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No error nor warning in the console.
  • Events are being sent to the appropriate logging solution
  • Documentation has been updated (link to documentation)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Feature/bug has a monitor built into Datadog (if applicable)
  • If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected
  • I added a screenshot of the developed feature

Requested Feedback

(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?

@ajones446 ajones446 self-assigned this Nov 12, 2024
@va-vfs-bot va-vfs-bot temporarily deployed to dbex-add-0781-provider-exaustion-logging/main/main November 12, 2024 23:30 Inactive
Copy link
Contributor

@NB28VT NB28VT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small style comments but they aren't important feel free to merge

{
'jid' => form526_job_status.job_id,
'error_class' => 'Broken Job Error',
'error_message' => 'Your Job Broke',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol


context 'for a Lighthouse upload' do
it 'logs the job failure' do
Flipper.enable(:disability_compensation_upload_0781_to_lighthouse)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally optional style not but I like these in a before block under the context block, as it sets up all the tests for this context and if we add more it will make that easier. Super nitpicky though

Flipper.enable(:disability_compensation_use_api_provider_for_0781_uploads)
end

let(:sidekiq_job_exhaustion_errors) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also a nit, this is more like sidekiq_job_exhaustion_arguments or something like that hmm I don't have a better name but since it has the job id and job args its more like metadata

if Flipper.enabled?(:disability_compensation_use_api_provider_for_0781_uploads)
submission = Form526Submission.find(form526_submission_id)

provider = api_upload_provider(submission, FORM_ID_0781)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bahhh that's right we don't know which form actually failed here (0781 or 0781a) but since we're logging the same metric regardless and logging the actual error below it doesn't matter, so I think this is totally fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that was my thinking as well. If we need to dig into the error more, we can find the form type on the submission.

@ajones446 ajones446 marked this pull request as ready for review November 13, 2024 23:15
@ajones446 ajones446 requested review from a team as code owners November 13, 2024 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants