Description
When a metric monitor is created in superuser mode on behalf of an organization, the Created By field in the monitor Details panel shows "Deactivated user" instead of an accurate label.
Root Cause
The DetectorExtraDetails.CreatedBy component calls useUserFromId, which fetches the creator via /organizations/{org}/users/{userId}/. This endpoint only returns users who are members of the org. A superuser acting on behalf of an org is not an org member, so the request returns 404 → isError = true → the component renders t('Deactivated user').
The 404 path is intentionally handled as "Deactivated user" (extraDetails.tsx line 76–78), but it conflates two distinct cases:
- User account is genuinely deactivated or deleted
- User exists and is active, but is not a member of this org (e.g. a superuser)
Relevant files:
static/app/views/detectors/components/details/common/extraDetails.tsx
static/app/utils/useUserFromId.tsx
src/sentry/incidents/logic.py — user_id=user.id stored on AlertRuleActivity.CREATED
Impact
Org admins see "Deactivated user" on monitors created on their behalf via superuser, with no indication that the creator was Sentry staff. The label is factually incorrect and likely to cause confusion or false concern about user account health.
Expected Behavior
When /organizations/{org}/users/{userId}/ returns 404, the component should distinguish between a truly deactivated user and a user who simply isn't an org member (e.g. show "Sentry", consistent with the existing null createdBy path, or "Sentry staff").
Description
When a metric monitor is created in superuser mode on behalf of an organization, the Created By field in the monitor Details panel shows "Deactivated user" instead of an accurate label.
Root Cause
The
DetectorExtraDetails.CreatedBycomponent callsuseUserFromId, which fetches the creator via/organizations/{org}/users/{userId}/. This endpoint only returns users who are members of the org. A superuser acting on behalf of an org is not an org member, so the request returns 404 →isError = true→ the component renderst('Deactivated user').The 404 path is intentionally handled as "Deactivated user" (
extraDetails.tsxline 76–78), but it conflates two distinct cases:Relevant files:
static/app/views/detectors/components/details/common/extraDetails.tsxstatic/app/utils/useUserFromId.tsxsrc/sentry/incidents/logic.py—user_id=user.idstored onAlertRuleActivity.CREATEDImpact
Org admins see "Deactivated user" on monitors created on their behalf via superuser, with no indication that the creator was Sentry staff. The label is factually incorrect and likely to cause confusion or false concern about user account health.
Expected Behavior
When
/organizations/{org}/users/{userId}/returns 404, the component should distinguish between a truly deactivated user and a user who simply isn't an org member (e.g. show "Sentry", consistent with the existingnullcreatedBy path, or "Sentry staff").