Skip to content

feat(releases): Add source attribute to releases.drawer_opened analytics event #91059

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions static/app/components/replays/releaseDropdownFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default function ReleaseDropdownFilter({version}: {version: string}) {
location,
release: version,
projectId: location?.query.project,
source: 'replay-tags',
})
: makeReleasesPathname({
organization,
Expand Down
1 change: 1 addition & 0 deletions static/app/components/version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function Version({
location,
release: version,
projectId: releaseDetailProjectId,
source: 'release-version-link',
})
: {
pathname: makeReleasesPathname({
Expand Down
2 changes: 1 addition & 1 deletion static/app/utils/analytics/releasesAnalyticsEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {ReleaseComparisonChartType} from 'sentry/types/release';
export type ReleasesEventParameters = {
'releases.bubbles_legend': {selected: boolean};
'releases.change_chart_type': {chartType: ReleaseComparisonChartType};
'releases.drawer_opened': {organization: string; release?: boolean};
'releases.drawer_opened': {organization: string; source: string; release?: boolean};
'releases.drawer_view_full_details': {project_id: string};
'releases.quickstart_copied': {project_id: string};
'releases.quickstart_create_integration.success': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,13 @@ export function TimeSeriesWidgetVisualization(props: TimeSeriesWidgetVisualizati
props.releases,
function onReleaseClick(release: Release) {
if (organization.features.includes('release-bubbles-ui')) {
navigate(makeReleaseDrawerPathname({location, release: release.version}));
navigate(
makeReleaseDrawerPathname({
location,
release: release.version,
source: 'time-series-widget',
})
);
return;
}
navigate(
Expand Down
8 changes: 7 additions & 1 deletion static/app/views/issueDetails/streamline/eventGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,13 @@ export function EventGraph({

const handleReleaseLineClick = useCallback(
(release: ReleaseMetaBasic) => {
navigate(makeReleaseDrawerPathname({location, release: release.version}));
navigate(
makeReleaseDrawerPathname({
location,
release: release.version,
source: 'issue-details',
})
);
},
[location, navigate]
);
Expand Down
20 changes: 15 additions & 5 deletions static/app/views/releases/drawer/releasesDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,19 @@ import {RELEASES_DRAWER_FIELD_MAP} from './utils';
* releases list or details.
*/
export function ReleasesDrawer() {
const {rd, rdChart, rdEnd, rdEnv, rdStart, rdProject, rdRelease, rdReleaseProjectId} =
useLocationQuery({
fields: RELEASES_DRAWER_FIELD_MAP,
});
const {
rd,
rdChart,
rdEnd,
rdEnv,
rdSource,
rdStart,
rdProject,
rdRelease,
rdReleaseProjectId,
} = useLocationQuery({
fields: RELEASES_DRAWER_FIELD_MAP,
});
const start = getDateFromTimestamp(rdStart);
const end = getDateFromTimestamp(rdEnd);
const defaultPageFilters = usePageFilters();
Expand Down Expand Up @@ -54,9 +63,10 @@ export function ReleasesDrawer() {
trackAnalytics('releases.drawer_opened', {
release: Boolean(rdRelease),
organization: organization.id,
source: rdChart ?? rdSource ?? 'unknown',
});
}
}, [organization, rd, rdProject, rdRelease]);
}, [organization, rd, rdProject, rdRelease, rdSource, rdChart]);

useEffect(() => {
if (rd === 'show' && !rdRelease && !rdStart && !rdEnd) {
Expand Down
2 changes: 2 additions & 0 deletions static/app/views/releases/drawer/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export enum ReleasesDrawerFields {
RELEASE = 'rdRelease',
RELEASE_PROJECT_ID = 'rdReleaseProjectId',
START = 'rdStart',
SOURCE = 'rdSource',
}

/**
Expand All @@ -34,6 +35,7 @@ export const RELEASES_DRAWER_FIELD_MAP = {
[ReleasesDrawerFields.RELEASE]: decodeScalar,
[ReleasesDrawerFields.RELEASE_PROJECT_ID]: decodeScalar,
[ReleasesDrawerFields.START]: decodeScalar,
[ReleasesDrawerFields.SOURCE]: decodeScalar,
};

const RELEASES_DRAWER_FIELD_KEYS = Object.keys(RELEASES_DRAWER_FIELD_MAP);
Expand Down
3 changes: 3 additions & 0 deletions static/app/views/releases/utils/pathnames.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ export function makeReleaseDrawerPathname({
location,
release,
projectId,
source,
}: {
location: Location;
release: string;
source: string;
projectId?: string | string[] | null;
}) {
return {
Expand All @@ -40,6 +42,7 @@ export function makeReleaseDrawerPathname({
[ReleasesDrawerFields.DRAWER]: 'show',
[ReleasesDrawerFields.RELEASE]: release,
[ReleasesDrawerFields.RELEASE_PROJECT_ID]: projectId,
[ReleasesDrawerFields.SOURCE]: source,
},
};
}
Loading