Skip to content

Commit daf8464

Browse files
authored
chore(toolbar): Include email of users in amplitude dogfooding events (#75192)
1 parent 74bca92 commit daf8464

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

static/app/utils/useDevToolbar.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ import * as Sentry from '@sentry/react';
44
import DevToolbar from 'sentry/components/devtoolbar';
55
import {rawTrackAnalyticsEvent} from 'sentry/utils/analytics';
66
import useOrganization from 'sentry/utils/useOrganization';
7+
import {useUser} from 'sentry/utils/useUser';
78

89
export default function useDevToolbar({enabled}: {enabled: boolean}) {
910
const organization = useOrganization();
11+
const {email} = useUser();
12+
1013
useEffect(() => {
1114
if (enabled) {
1215
// TODO: this is insufficient and doesn't take into account control/silo endpoints
@@ -30,13 +33,13 @@ export default function useDevToolbar({enabled}: {enabled: boolean}) {
3033
`https://github.com/search?q=repo%3Agetsentry%2Fsentry-options-automator+OR+repo%3Agetsentry%2Fsentry+${flag}&type=code`,
3134

3235
trackAnalytics: (props: {eventKey: string; eventName: string}) =>
33-
rawTrackAnalyticsEvent({...props, organization}),
36+
rawTrackAnalyticsEvent({...props, email, organization}),
3437
});
3538

3639
return () => {
3740
promise.then(cleanup => cleanup());
3841
};
3942
}
4043
return () => {};
41-
}, [enabled, organization]);
44+
}, [email, enabled, organization]);
4245
}

0 commit comments

Comments
 (0)