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

[API-43666] 526 v2 - Multiple alerts per transaction id #20671

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

Conversation

tycol7
Copy link
Contributor

@tycol7 tycol7 commented Feb 6, 2025

Summary

When querying errored claims in the last hour, select on distinct transaction_id, preventing duplicate errors within the last hour.

Related issue(s)

API-43666

Testing done

  • New code is covered by unit tests

Screenshots

N/A

What areas of the site does it impact?

Claims API hourly unsuccessful submission Slack notifications.

Acceptance criteria

  • I 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

N/A

@tycol7 tycol7 added the claimsApi modules/claims_api label Feb 6, 2025
@tycol7 tycol7 force-pushed the push-zmmwyzmpmpql branch from b03653e to c84e912 Compare February 6, 2025 23:56
@tycol7 tycol7 marked this pull request as ready for review February 6, 2025 23:57
@tycol7 tycol7 requested a review from a team as a code owner February 6, 2025 23:57
@tycol7 tycol7 changed the title [API-43666] select hourly unique claims on transaction id [API-43666] 526 v2 - Multiple alerts per transaction id Feb 6, 2025
@@ -92,6 +92,7 @@ def unique_errors_by_transaction_id
last_hour = ClaimsApi::AutoEstablishedClaim
.where(created_at: 1.hour.ago..Time.zone.now,
status: 'errored', cid: '0oagdm49ygCSJTp8X297')
last_hour = last_hour.select('DISTINCT ON(transaction_id) *') if last_hour.count.positive?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This select will fail if there are no errored claims.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does something change if the select DISTINCT ON is moved to the previous query?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
claimsApi modules/claims_api test-passing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants