File tree 2 files changed +28
-2
lines changed
static/app/views/performance/cache
2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import {Button} from 'sentry/components/button';
8
8
import Link from 'sentry/components/links/link' ;
9
9
import { t } from 'sentry/locale' ;
10
10
import { space } from 'sentry/styles/space' ;
11
+ import { trackAnalytics } from 'sentry/utils/analytics' ;
11
12
import { DurationUnit , RateUnit , SizeUnit } from 'sentry/utils/discover/fields' ;
12
13
import { PageAlertProvider } from 'sentry/utils/performance/contexts/pageAlert' ;
13
14
import { decodeScalar } from 'sentry/utils/queryString' ;
@@ -34,6 +35,7 @@ import {useTransactions} from 'sentry/views/starfish/queries/useTransactions';
34
35
import {
35
36
MetricsFields ,
36
37
type MetricsQueryFilters ,
38
+ ModuleName ,
37
39
SpanFunction ,
38
40
SpanIndexedField ,
39
41
type SpanIndexedQueryFilters ,
@@ -346,7 +348,17 @@ export function CacheSamplePanel() {
346
348
347
349
< Fragment >
348
350
< ModuleLayout . Full >
349
- < Button onClick = { handleRefetch } > { t ( 'Try Different Samples' ) } </ Button >
351
+ < Button
352
+ onClick = { ( ) => {
353
+ trackAnalytics (
354
+ 'performance_views.sample_spans.try_different_samples_clicked' ,
355
+ { organization, source : ModuleName . CACHE }
356
+ ) ;
357
+ handleRefetch ( ) ;
358
+ } }
359
+ >
360
+ { t ( 'Try Different Samples' ) }
361
+ </ Button >
350
362
</ ModuleLayout . Full >
351
363
</ Fragment >
352
364
</ ModuleLayout . Layout >
Original file line number Diff line number Diff line change 1
1
import * as qs from 'query-string' ;
2
2
3
3
import Link from 'sentry/components/links/link' ;
4
+ import { trackAnalytics } from 'sentry/utils/analytics' ;
4
5
import { useLocation } from 'sentry/utils/useLocation' ;
6
+ import useOrganization from 'sentry/utils/useOrganization' ;
5
7
import { useCacheUrl } from 'sentry/views/performance/cache/utils' ;
6
8
import { OverflowEllipsisTextContainer } from 'sentry/views/starfish/components/textAlign' ;
9
+ import { ModuleName } from 'sentry/views/starfish/types' ;
7
10
8
11
interface Props {
9
12
project ?: string ;
@@ -12,6 +15,7 @@ interface Props {
12
15
}
13
16
14
17
export function TransactionCell ( { project, transaction} : Props ) {
18
+ const organization = useOrganization ( ) ;
15
19
const location = useLocation ( ) ;
16
20
const cacheUrl = useCacheUrl ( ) ;
17
21
@@ -27,7 +31,17 @@ export function TransactionCell({project, transaction}: Props) {
27
31
28
32
return (
29
33
< OverflowEllipsisTextContainer >
30
- < Link to = { `${ cacheUrl } /?${ qs . stringify ( query ) } ` } > { transaction } </ Link >
34
+ < Link
35
+ onClick = { ( ) =>
36
+ trackAnalytics ( 'performance_views.sample_spans.opened' , {
37
+ organization,
38
+ source : ModuleName . CACHE ,
39
+ } )
40
+ }
41
+ to = { `${ cacheUrl } /?${ qs . stringify ( query ) } ` }
42
+ >
43
+ { transaction }
44
+ </ Link >
31
45
</ OverflowEllipsisTextContainer >
32
46
) ;
33
47
}
You can’t perform that action at this time.
0 commit comments