Skip to content

[AZINTS-4596] Add user consent flow before logging unexpected script errors to Datadog - #171

Draft
mshvartsberg wants to merge 5 commits into
meggan.shvartsberg/azints-4595/remove-pii-from-errorsfrom
meggan.shvartsberg/azints-4596/consent-flow
Draft

[AZINTS-4596] Add user consent flow before logging unexpected script errors to Datadog#171
mshvartsberg wants to merge 5 commits into
meggan.shvartsberg/azints-4595/remove-pii-from-errorsfrom
meggan.shvartsberg/azints-4596/consent-flow

Conversation

@mshvartsberg

@mshvartsberg mshvartsberg commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Motivation

When the Azure integration quickstart script encounters an unexpected error, we want to log the full traceback to Datadog to aid debugging but only with explicit user consent since the traceback may contain PII.

Changes

  • script_status.py: Added FAILING_AWAITING_USER_DECISION status, USER_DECISION_TIMEOUT_SECONDS constant, and _poll_for_user_decision() method. On unexpected errors, the script now posts failing_awaiting_user_decision, then polls the workflow status endpoint for up to 60s waiting for a user_error_decision step with status finished. If the user approves error log forwarding, the full traceback is sent in the message field via a failed status; if they decline or the poll times out, no traceback is sent (message is None).
    • Also updated USER_ACTIONABLE_ERROR to be defined as "user_actionable_error" instead of "USER_ACTIONABLE_ERROR" to match the status definition in web-ui and dd-source
  • test_script_status.py: Replaced the single test_unexpected_error test with three cases covering consent approved, consent declined, and poll timeout.

Testing

  • Unit tests cover all three consent flow outcomes (approved, declined, timeout)
  • Both end to end flows for configure log forwarding and app registration still work (on a regular flow with no errors).
  • TO-DO: End-to-end test: trigger an unexpected error and verify the consent modal appears and each path (forward logs / file support ticket / click X / timeout) results in the correct final status

mshvartsberg and others added 4 commits April 23, 2026 15:25
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mshvartsberg
mshvartsberg force-pushed the meggan.shvartsberg/azints-4596/consent-flow branch from bb616ac to c70ced8 Compare April 23, 2026 19:26
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.

1 participant