-
Notifications
You must be signed in to change notification settings - Fork 481
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
Add aichat Amplitude/Statsig analytics #58397
Conversation
@@ -260,6 +260,11 @@ const EVENTS = { | |||
|
|||
// Teacher Homepage | |||
TEACHER_HOMEPAGE_VISITED: 'Teacher Homepage Visited', | |||
|
|||
// Aichat |
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.
@samantha-code - lmk if these are okay. I based constants/descriptions from the spec.
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.
Checked with Sam via Slack and she approved.
apps/src/aichat/constants.ts
Outdated
@@ -2,3 +2,5 @@ import {ModelDescription} from './types'; | |||
import modelsJson from '@cdo/static/aichat/modelDescriptions.json'; | |||
|
|||
export const modelDescriptions: ModelDescription[] = modelsJson; | |||
|
|||
export const ANALYTICS_SAMPLE_RATE = 0.1; |
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.
From spec, we want to consider sampling (1/100 or 1/1000).
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.
Checked with Sam and she said let's hold off on sampling for now. Commit that removes sampling: 342575c
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.
Nice!
This PR adds logging sent to both Amplitude and Statsig for the following aichat events:
I added these events according to both the tech spec and this Slack thread.
For now, we will observe the volume of events before deciding to sample. 342575c
Screencast video showing logging of events in dev console:
analytics-aichat.mp4
Links
jira
Testing story
I tested locally. Screencast video above.
Deployment strategy
Follow-up work
Privacy
Security
Caching
PR Checklist: