-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathpage.tsx
More file actions
34 lines (31 loc) · 761 Bytes
/
page.tsx
File metadata and controls
34 lines (31 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use client';
import * as Sentry from '@sentry/nextjs';
export default function Page() {
const handleClick = async () => {
Sentry.metrics.count('test.page.count', 1, {
attributes: {
page: '/metrics',
'random.attribute': 'Apples',
},
});
Sentry.metrics.distribution('test.page.distribution', 100, {
attributes: {
page: '/metrics',
'random.attribute': 'Manzanas',
},
});
Sentry.metrics.gauge('test.page.gauge', 200, {
attributes: {
page: '/metrics',
'random.attribute': 'Mele',
},
});
await fetch('/metrics/route-handler');
};
return (
<div>
<h1>Metrics page</h1>
<button onClick={handleClick}>Emit</button>
</div>
);
}