feat: Add data for enrollment alerts#9003
Merged
yashikakhurana merged 15 commits intomainfrom Mar 20, 2026
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
mikewilli
previously requested changes
Mar 17, 2026
Contributor
mikewilli
left a comment
There was a problem hiding this comment.
Overall seems like the right shape, but the unenrollment reasons query doesn't seem to work, and I left a couple other smaller suggestions.
sql/moz-fx-data-experiments/monitoring/experiment_enrollment_alert_data_v1/query.py
Outdated
Show resolved
Hide resolved
sql/moz-fx-data-experiments/monitoring/experiment_enrollment_alert_data_v1/query.py
Show resolved
Hide resolved
sql/moz-fx-data-experiments/monitoring/experiment_enrollment_alert_data_v1/query.py
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
Updated {
"v1": {
"test-experiment-001": {
"total_enrollments": 15000,
"total_unenrollments": 1200,
"branches": {
"control": {
"enrollments": 7500,
"unenrollments": 580
},
"treatment-a": {
"enrollments": 7500,
"unenrollments": 620
}
},
"unenrollment_reasons": {},
"reasons_by_branch": {
"control": {
"targeting-mismatch": {
"1pct_count": 85
},
"studies-opt-out": {
"1pct_count": 42
},
"unknown": {
"1pct_count": 15
}
},
"treatment-a": {
"studies-opt-out": {
"1pct_count": 98
},
"targeting-mismatch": {
"1pct_count": 72
},
"user-request": {
"1pct_count": 28
}
}
}
},
"onboarding-experiment-v2": {
"total_enrollments": 25000,
"total_unenrollments": 3500,
"branches": {
"control": {
"enrollments": 12500,
"unenrollments": 1750
},
"treatment": {
"enrollments": 12500,
"unenrollments": 1750
}
},
"unenrollment_reasons": {},
"reasons_by_branch": {
"control": {
"targeting-mismatch": {
"1pct_count": 245
},
"studies-opt-out": {
"1pct_count": 180
},
"user-request": {
"1pct_count": 92
}
},
"treatment": {
"studies-opt-out": {
"1pct_count": 210
},
"targeting-mismatch": {
"1pct_count": 265
},
"user-request": {
"1pct_count": 85
}
}
}
}
}
}
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
mikewilli
approved these changes
Mar 20, 2026
Contributor
mikewilli
left a comment
There was a problem hiding this comment.
Couple comments but looks good. I think it makes sense to get this out so downstream work is unblocked, and we can always iterate if needed.
| # Upload to GCS | ||
| storage_client = storage.Client(args.project) | ||
| bucket = storage_client.bucket("mozanalysis") | ||
| json_str = json.dumps(versioned_data, indent=2) |
Contributor
There was a problem hiding this comment.
Do we need to format this with indentations? I assume this is meant to be read by a machine.
Contributor
Author
There was a problem hiding this comment.
that's correct, just my brain always in the habit to indent
Comment on lines
+159
to
+161
| bucket.blob(latest_path).upload_from_string( | ||
| json_str, content_type="application/json" | ||
| ) |
Contributor
There was a problem hiding this comment.
Small suggestion: I think you can copy instead of uploading again, which I'd expect to be more efficient:
bucket.copy_blob(dated_path, bucket, latest_path)
sql/moz-fx-data-experiments/monitoring/experiment_enrollment_alert_data_v1/metadata.yaml
Outdated
Show resolved
Hide resolved
…lert_data_v1/metadata.yaml Co-authored-by: Mike Williams <102263964+mikewilli@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Integration report for "feat: Add data for enrollment alerts"
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a new daily data export for the Experimenter alerting system. It creates the
experiment_enrollment_alert_data_v1table in themoz-fx-data-experiments.monitoringdataset to export per-experiment enrollment/unenrollment counts by branch and unenrollment reason breakdown.The data is exported as JSON to GCS (
gs://mozanalysis/enrollment_alerts/) for the Experimenter alerting system to consume. Raw counts only; Experimenter handles threshold computations.Example:
{ "v1": { "experiment_slug": { "total_enrollments": 1000, "total_unenrollments": 50, "branches": { "control": { "enrollments": 500, "unenrollments": 25 }, "treatment": { "enrollments": 500, "unenrollments": 25 } }, "unenrollment_reasons": { "not_interested": 15, "technical_issue": 8, "other": 27 } }, "another_experiment": { "total_enrollments": 2000, "total_unenrollments": 100, "branches": {...}, "unenrollment_reasons": {...} } } }Related Tickets & Documents
Reviewer, please follow this checklist