Skip to content

feat(slack): Add metrics for slack reinstall nudge outcomes#118564

Merged
alexsohn1126 merged 1 commit into
masterfrom
alexsohn/add-metrics-for-slack-nudge
Jun 26, 2026
Merged

feat(slack): Add metrics for slack reinstall nudge outcomes#118564
alexsohn1126 merged 1 commit into
masterfrom
alexsohn/add-metrics-for-slack-nudge

Conversation

@alexsohn1126

@alexsohn1126 alexsohn1126 commented Jun 26, 2026

Copy link
Copy Markdown
Member

we send "nudges" -- a short CTA after alert messages -- for a subset of alerts sent to Slack channels to either update their slack app installation, or to remind them they can @ mention sentry anywhere to start debugging their system.

Let's add some metrics for this nudge so we know when we send the nudge vs. when we do not.

also see:
#118288

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 26, 2026
@alexsohn1126 alexsohn1126 marked this pull request as ready for review June 26, 2026 15:29
@alexsohn1126 alexsohn1126 requested a review from a team as a code owner June 26, 2026 15:29
Comment on lines 19 to 20

# only 10% of the alerts should have the nudge blocks

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The function returns early when the feature flag is disabled but fails to increment a metric, creating an observability gap in tracking nudge outcomes.
Severity: LOW

Suggested Fix

Increment a new metric before the early return when the feature flag organizations:slack-reinstall-nudge-on-issue-alert is disabled. This will provide visibility into this specific outcome, aligning with the other metric tracking in the function.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/sentry/integrations/slack/utils/nudge.py#L19-L20

Potential issue: The function `should_send_nudge_for_reinstall` returns early if the
feature flag `organizations:slack-reinstall-nudge-on-issue-alert` is disabled, but this
exit path does not increment a metric. Other paths, such as skipping due to a random
check or weekly limit, do have corresponding metrics. This omission creates an
observability gap, making it difficult to distinguish why a nudge was not sent. It
prevents monitoring systems from tracking which organizations have the feature disabled,
which goes against the pull request's stated goal of adding comprehensive metrics for
nudge outcomes.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

not caring about feature flag is okay imo

@alexsohn1126 alexsohn1126 merged commit af32713 into master Jun 26, 2026
69 checks passed
@alexsohn1126 alexsohn1126 deleted the alexsohn/add-metrics-for-slack-nudge branch June 26, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants