Skip to content

Commit 716a276

Browse files
committed
add queue sample panel analytics
1 parent 50159e5 commit 716a276

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

static/app/views/performance/queues/destinationSummary/transactionsTable.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type {CursorHandler} from 'sentry/components/pagination';
1212
import Pagination from 'sentry/components/pagination';
1313
import {t} from 'sentry/locale';
1414
import type {Organization} from 'sentry/types';
15+
import {trackAnalytics} from 'sentry/utils/analytics';
1516
import {browserHistory} from 'sentry/utils/browserHistory';
1617
import type {EventsMetaType} from 'sentry/utils/discover/eventView';
1718
import {FIELD_FORMATTERS, getFieldRenderer} from 'sentry/utils/discover/fieldRenderers';
@@ -21,7 +22,7 @@ import useOrganization from 'sentry/utils/useOrganization';
2122
import {normalizeUrl} from 'sentry/utils/withDomainRequired';
2223
import {useQueuesByTransactionQuery} from 'sentry/views/performance/queues/queries/useQueuesByTransactionQuery';
2324
import {renderHeadCell} from 'sentry/views/starfish/components/tableCells/renderHeadCell';
24-
import type {SpanMetricsResponse} from 'sentry/views/starfish/types';
25+
import {ModuleName, type SpanMetricsResponse} from 'sentry/views/starfish/types';
2526
import {QueryParameterNames} from 'sentry/views/starfish/views/queryParameters';
2627

2728
type Row = Pick<
@@ -190,6 +191,12 @@ function TransactionCell({transaction, op}: {op: string; transaction: string}) {
190191
return (
191192
<NoOverflow>
192193
<Link
194+
onClick={() =>
195+
trackAnalytics('performance_views.sample_spans.opened', {
196+
organization,
197+
source: ModuleName.QUEUE,
198+
})
199+
}
193200
to={normalizeUrl(
194201
`/organizations/${organization.slug}/performance/queues/destination/?${qs.stringify(queryString)}`
195202
)}

static/app/views/performance/queues/messageSamplesPanel.tsx

+15-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {Button} from 'sentry/components/button';
77
import Link from 'sentry/components/links/link';
88
import {t} from 'sentry/locale';
99
import {space} from 'sentry/styles/space';
10+
import {trackAnalytics} from 'sentry/utils/analytics';
1011
import {DurationUnit, SizeUnit} from 'sentry/utils/discover/fields';
1112
import {PageAlertProvider} from 'sentry/utils/performance/contexts/pageAlert';
1213
import {decodeScalar} from 'sentry/utils/queryString';
@@ -33,7 +34,11 @@ import {Subtitle} from 'sentry/views/profiling/landing/styles';
3334
import {computeAxisMax} from 'sentry/views/starfish/components/chart';
3435
import DetailPanel from 'sentry/views/starfish/components/detailPanel';
3536
import {useSpanMetricsSeries} from 'sentry/views/starfish/queries/useDiscoverSeries';
36-
import {SpanIndexedField, type SpanMetricsResponse} from 'sentry/views/starfish/types';
37+
import {
38+
ModuleName,
39+
SpanIndexedField,
40+
type SpanMetricsResponse,
41+
} from 'sentry/views/starfish/types';
3742
import {useSampleScatterPlotSeries} from 'sentry/views/starfish/views/spanSummaryPage/sampleList/durationChart/useSampleScatterPlotSeries';
3843

3944
export function MessageSamplesPanel() {
@@ -254,7 +259,15 @@ export function MessageSamplesPanel() {
254259
</ModuleLayout.Full>
255260

256261
<ModuleLayout.Full>
257-
<Button onClick={() => refetchDurationSpanSamples()}>
262+
<Button
263+
onClick={() => {
264+
trackAnalytics(
265+
'performance_views.sample_spans.try_different_samples_clicked',
266+
{organization, source: ModuleName.QUEUE}
267+
);
268+
refetchDurationSpanSamples();
269+
}}
270+
>
258271
{t('Try Different Samples')}
259272
</Button>
260273
</ModuleLayout.Full>

0 commit comments

Comments
 (0)