Skip to content

Commit e8b9743

Browse files
Sentry: guidelines on how to create performance dashboards and performance alerts (#129)
This PR includes guidelines on how to: - [Setup a Sentry dashboard, to visualise the evolution of a given performance metric over time.](https://github.com/MetaMask/contributor-docs/blob/4878af2b48bc36d4d4aa347b82e2c73855487552/docs/performance-dashboard.md) - [Setup a Sentry alert, to be notified in case a given performance metric regresses over time.](https://github.com/MetaMask/contributor-docs/blob/4878af2b48bc36d4d4aa347b82e2c73855487552/docs/performance-alert.md)
1 parent 90f3b76 commit e8b9743

12 files changed

+200
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ This is a living repository — nothing is set in stone! If you're member of Met
1010
- [Engineering Principles](./docs/engineering-principles.md)
1111
- [JavaScript Guidelines](./docs/javascript.md)
1212
- [Migrations Best Practices](./docs/migrations-guidelines.md)
13+
- [Performance Alert Guidelines](./docs/performance-alert.md)
14+
- [Performance Dashboard Guidelines](./docs/performance-dashboard.md)
1315
- [Performance Tracing Guidelines](./docs/performance-tracing.md)
1416
- [Pull Requests Guide](./docs/pull-requests.md)
1517
- [React Guidelines](./docs/react.md)
34.9 KB
Loading
16.6 KB
Loading
124 KB
Loading
104 KB
Loading
39.9 KB
Loading
63 KB
Loading
22.9 KB
Loading
45.8 KB
Loading

docs/performance-alert.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Performance Alert
2+
3+
## Overview
4+
5+
Performance alerts can be created in Sentry to get notified in case a given performance metric regresses over time.
6+
7+
## Choose the trace you want to monitor
8+
9+
The performance metric needed to monitor the performance of a given user flow can be tracked by adding a performance trace to the codebase (or by using an existing trace if one already exists). More details on performance tracing can be found [here](./performance-tracing.md).
10+
11+
## Create a new alert
12+
13+
Go to [Sentry alerts page](https://metamask.sentry.io/alerts/rules/).
14+
15+
Click on "Create Alert".
16+
17+
Select the `Performance > Transaction duration` as alert type.
18+
19+
![performance-alert-types](./images/performance-alert-types.png)
20+
21+
Click on "Set Conditions".
22+
23+
### 1. Define your metric
24+
25+
Leave this section unchanged, except the `p95` that you can change into `p75`.
26+
27+
![performance-alert-metric](./images/performance-alert-metric.png)
28+
29+
### 2. Filter events
30+
31+
Indicate the name of the project:
32+
33+
- Choose `metamask` project for Extension
34+
- Choose `metamask-mobile` project for Mobile
35+
36+
Indicate the name of the environment: `production`.
37+
38+
For Extension, use the following query format:
39+
40+
```
41+
transaction:"name-of-the-trace"
42+
```
43+
44+
For Mobile, if you want to filter for iOS metrics only, use the following query format:
45+
46+
```
47+
transaction:"name-of-the-trace" release.package:io.metamask.MetaMask
48+
```
49+
50+
For Mobile, if you want to filter for Android metrics only, use the following query format:
51+
52+
```
53+
transaction:"name-of-the-trace" release.package:io.metamask
54+
```
55+
56+
Example filter:
57+
58+
```
59+
transaction:"UI Startup" release.package:io.metamask.MetaMask
60+
```
61+
62+
### 3. Set thresholds
63+
64+
Select the following options:
65+
66+
- Type: `Anomaly`
67+
- Level of responsiveness `Medium`
68+
- Direction of anomaly movement: `Above bounds only`
69+
70+
![performance-alert-thresholds](./images/performance-alert-thresholds.png)
71+
72+
### 4. Set actions
73+
74+
Click on "Add Action".
75+
76+
Select the following options:
77+
78+
- Action type: `Critical Status`
79+
- Channel type: `Slack - Consensys`
80+
- Slack channel name: `#your-slack-channel-name` (Example: #metamask-your-team-name-release-monitoring)
81+
- Slack channel ID: `your-slack-channel-id` (Example: C085BL3Z04J)
82+
83+
![performance-alert-actions](./images/performance-alert-actions.png)
84+
85+
PS: We recommend that you create a Slack channel called #metamask-your-team-name-release-monitoring, specifically for these Sentry alerts.
86+
PSS: Here's an [article](https://zeroheight.com/help/article/retrieving-a-slack-channel-id-from-slack/) explaining how to retrieve the ID of a Slack channel.
87+
88+
### 5. Establish ownership
89+
90+
Choose a self explanatory name for your alert, like: `Anomaly - name-of-the-trace (type-of-application)`.
91+
92+
Example: `Anomaly - UI Startup (iOS)` or `Anomaly - UI Startup (Android)`
93+
94+
Select `#metamask`.
95+
96+
Click on "Save Rule".
97+
98+
That's it. Your performance alert is now configured and will post messages to the Slack channel you chose.
99+
100+
![performance-alert-slack-message](./images/performance-alert-slack-message.png)

0 commit comments

Comments
 (0)