-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat(preprod): Add analytics for status check rule CRUD #109116
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ import PanelBody from 'sentry/components/panels/panelBody'; | |
| import PanelHeader from 'sentry/components/panels/panelHeader'; | ||
| import {IconAdd} from 'sentry/icons'; | ||
| import {t} from 'sentry/locale'; | ||
| import {trackAnalytics} from 'sentry/utils/analytics'; | ||
| import {browserHistory} from 'sentry/utils/browserHistory'; | ||
| import {useLocation} from 'sentry/utils/useLocation'; | ||
| import useOrganization from 'sentry/utils/useOrganization'; | ||
|
|
@@ -45,6 +46,10 @@ export function StatusCheckRules() { | |
| const handleAddRule = () => { | ||
| const newRule = createEmptyRule(); | ||
| addRule(newRule); | ||
| trackAnalytics('preprod.settings.status_check_rule_created', { | ||
| organization, | ||
| project_slug: project.slug, | ||
| }); | ||
| setNewRuleId(newRule.id); | ||
| updateExpandedInUrl([...expandedRuleIds, newRule.id]); | ||
| }; | ||
|
|
@@ -117,11 +122,23 @@ export function StatusCheckRules() { | |
| } | ||
| onSave={updated => { | ||
| updateRule(rule.id, updated); | ||
| trackAnalytics('preprod.settings.status_check_rule_updated', { | ||
| organization, | ||
| project_slug: project.slug, | ||
| metric: updated.metric, | ||
| measurement: updated.measurement, | ||
| artifact_type: updated.artifactType ?? 'all_artifacts', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent artifact_type default in analytics fallbackLow Severity The fallback value for |
||
| value: updated.value, | ||
| }); | ||
| if (rule.id === newRuleId) { | ||
| setNewRuleId(null); | ||
| } | ||
| }} | ||
| onDelete={() => { | ||
| trackAnalytics('preprod.settings.status_check_rule_deleted', { | ||
| organization, | ||
| project_slug: project.slug, | ||
| }); | ||
| deleteRule(rule.id); | ||
| if (rule.id === newRuleId) { | ||
| setNewRuleId(null); | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Analytics track failed operations as successes
High Severity
Analytics events for rule create, update, and delete fire before their async operations complete. When
addRule,updateRule, ordeleteRulefail due to network errors or validation issues, the analytics still record successful operations, inflating metrics and misrepresenting actual adoption/usage. The tracking calls happen synchronously while the underlyingsaveRulesmutation inuseStatusCheckRulesis asynchronous.Additional Locations (2)
static/app/views/settings/project/preprod/statusCheckRules.tsx#L124-L132static/app/views/settings/project/preprod/statusCheckRules.tsx#L137-L141