Skip to content

Commit

Permalink
chore(scheduled flag changes): add usage events (#19654)
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajmajerik authored Jan 10, 2024
1 parent d36e7ad commit 1113dc3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/src/lib/utils/eventUsageLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,8 @@ export const eventUsageLogic = kea<eventUsageLogicType>([
reportFailedToCreateFeatureFlagWithCohort: (code: string, detail: string) => ({ code, detail }),
reportFeatureFlagCopySuccess: true,
reportFeatureFlagCopyFailure: (error) => ({ error }),
reportFeatureFlagScheduleSuccess: true,
reportFeatureFlagScheduleFailure: (error) => ({ error }),
reportInviteMembersButtonClicked: true,
reportDashboardLoadingTime: (loadingMilliseconds: number, dashboardId: number) => ({
loadingMilliseconds,
Expand Down Expand Up @@ -1063,6 +1065,12 @@ export const eventUsageLogic = kea<eventUsageLogicType>([
reportFeatureFlagCopyFailure: ({ error }) => {
posthog.capture('feature flag copy failure', { error })
},
reportFeatureFlagScheduleSuccess: () => {
posthog.capture('feature flag scheduled')
},
reportFeatureFlagScheduleFailure: ({ error }) => {
posthog.capture('feature flag schedule failure', { error })
},
reportInviteMembersButtonClicked: () => {
posthog.capture('invite members button clicked')
},
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/scenes/feature-flags/featureFlagLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,12 @@ export const featureFlagLogic = kea<featureFlagLogicType>([
filters: NEW_FLAG.filters,
active: NEW_FLAG.active,
})
eventUsageLogic.actions.reportFeatureFlagScheduleSuccess()
}
},
createScheduledChangeFailure: ({ error }) => {
eventUsageLogic.actions.reportFeatureFlagScheduleFailure({ error })
},
deleteScheduledChangeSuccess: ({ scheduledChange }) => {
if (scheduledChange) {
lemonToast.success('Change has been deleted')
Expand Down

0 comments on commit 1113dc3

Please sign in to comment.