Skip to content

#1041 feat(observability): add failure monitoring signals#1640

Open
Jacky-Pham wants to merge 3 commits into
mainfrom
1041-payment-queue-monitoring
Open

#1041 feat(observability): add failure monitoring signals#1640
Jacky-Pham wants to merge 3 commits into
mainfrom
1041-payment-queue-monitoring

Conversation

@Jacky-Pham
Copy link
Copy Markdown
Collaborator

@Jacky-Pham Jacky-Pham commented May 13, 2026

Summary

  • added local failure-monitoring signal commit to the PR branch
  • included the local strata hotel active registration email support commit already added earlier
  • retained the empty tracking commit for the dev pay queue monitoring work configured in GCP
  • keeps docs/runbooks/observability.md out of the PR

Notes

  • f73d482 was already represented in origin/main, so it was not duplicated
  • 8af2fdb was cherry-picked as 35b88a5
  • fde38a0a was cherry-picked and conflict-resolved as 6e69358

Validation

  • python3 -m py_compile queue_services/strr-email/src/strr_email/resources/email_listener.py strr-api/src/strr_api/services/interaction.py strr-api/tests/unit/services/test_interaction_service.py queue_services/strr-email/tests/conftest.py

Refs #1041

@Jacky-Pham Jacky-Pham changed the title #1041 chore(pay): configure queue monitoring #1041 fix(emailer): support strata hotel active registration emails May 13, 2026
@Jacky-Pham Jacky-Pham changed the title #1041 fix(emailer): support strata hotel active registration emails #1041 feat(observability): add failure monitoring signals May 13, 2026
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots

See analysis details on SonarQube Cloud

email_info.interaction_uuid,
email_info.interaction,
err,
)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The recipient list should be split in order to avoid the errors related to typos in email addresses

email_info.registration_number,
email_info.interaction_uuid,
email_info.interaction,
err,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

traceback was added to get the complete stack trace of the error. This helps in debugging

metadata={
"upload_source": "documents",
"document_type": "SUPPORTING_DOCUMENT",
"upload_step": "standalone_supporting_document",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we should add user metadata here as well. Just having these three attributes wont provide much info.

The document type should specify which one from the UI was selected.

idempotency_key: str | None = None,
):
"""Create a queued interaction before publishing the email event."""
# TODO: fix circular import issue
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

TODO left here. if the circular dependency has been resolved then these imports can be moved to the top

interaction = session.get(CustomerInteraction, interaction_id)
if not interaction or not interaction.notify_reference:
return False
return "missing_reference"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

QQ Whats the reason for changing the return type from boolean to random string values?

try:
stale_sent_hours = int(os.getenv("STALE_SENT_HOURS", "24"))
stale_threshold = datetime.now(timezone.utc) - timedelta(hours=stale_sent_hours)
stale_stmt = select(CustomerInteraction.id).where(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

there is another select statement below querying the same table... would it benefit to merge into one query and do comparison in here instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants