Nb disability benefits log 526 document polling gauge metrics #19093
+123
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
We are actively ready to create these polling records in prod and running this job but none have been created yet. The only risk is it breaks the job which isn't doing anything now, and we would catch it
Adds metrics for documents processed, marked successful or marked failed whenever the Form526DocumentUploadPollingJob runs.
There are a couple different ways to do this, including incrementing a counter with each success or failure within the update loop, but I think it simplifies it to query the success and failure counts before and after the loop of update batches. And it was kind of tricky to get it working the other way. This approach might be a problem if this job was potentially run in parallel with another instance of the same job but it's not scheduled that way nor intended to be.
Also note this adds a few count queries, but they are outside the loop so they won't scale up with N number of documents, if that makes sense.
I guess one issue I could see with this approach is we could have a hang up or outage on the Lighthouse side, which might mess up the counts but I don't think that would be a big deal?
Disability Benefits Team 2, and yes
Related issue(s)
Testing done
Acceptance criteria