|
1 | 1 | --- |
2 | | -title: Monitoring with Sentry |
| 2 | +title: Sentry |
3 | 3 | --- |
4 | 4 |
|
5 | | -With automated error reporting, you can not only get alerted when something breaks, but also access the details you need to reproduce the issue. |
| 5 | +[Sentry](https://sentry.io/welcome/) is a developer-first error tracking and performance monitoring platform that helps developers see what actually matters, solve quicker, and learn continuously about their applications. |
6 | 6 |
|
7 | | -## Sentry |
| 7 | +Databend provides integration with both Cloud and self-hosted Sentry solutions. The following tutorial walks you through the integration process. |
8 | 8 |
|
9 | | -Databend provides integration with [Sentry](https://github.com/getsentry/sentry), a developer-first error tracking and performance monitoring platform. |
| 9 | +## Tutorial: Monitor Databend with Sentry |
10 | 10 |
|
11 | | -### Deploy Sentry |
| 11 | +### Step 1. Deploy Sentry |
12 | 12 |
|
13 | | -You can use Sentry as a cloud service by signing up at [sentry.io](https://sentry.io), or you can host it yourself by following the instructions at [Self-Hosted Sentry](https://develop.sentry.dev/self-hosted/). |
| 13 | +To deploy an on-premises Sentry, follow the instructions: https://develop.sentry.dev/self-hosted/ |
14 | 14 |
|
15 | | -<img src="/img/tracing/sentry-hosted.png"/> |
| 15 | +This tutorial uses the Sentry service on the cloud. To sign up an account for Cloud Sentry, go to https://sentry.io |
16 | 16 |
|
17 | | -### Create a Project |
| 17 | +### Step 2. Create a Sentry Project |
18 | 18 |
|
19 | | -To use Sentry with Databend, you need to create a project in Sentry and get its DSN (Data Source Name). The DSN is a unique identifier for your project that tells Sentry where to send your data. In this example, the DSN is `http://[email protected]:9000/5` 。 |
| 19 | +Once you're logged into Sentry, create a Sentry project for the `Rust` platform to start. For how to create a project on Sentry, see https://docs.sentry.io/product/sentry-basics/integrate-frontend/create-new-project/ |
20 | 20 |
|
21 | | -<img src="/img/tracing/sentry-get-dsn.png"/> |
| 21 | + |
22 | 22 |
|
23 | | -### Start Databend |
| 23 | +### Step 3. Set Environment Variables |
24 | 24 |
|
25 | | -You can start Databend with Sentry in two ways: |
| 25 | +1. Get the DSN (Data Source Name) of your project. For what DSN is and where to find it, see https://docs.sentry.io/product/sentry-basics/dsn-explainer/ |
26 | 26 |
|
27 | | -- **Enable Error Tracking Only** |
| 27 | +2. Set environment variables. |
28 | 28 |
|
29 | | - This option will only use the `sentry-log` feature, which will send error logs to Sentry. |
| 29 | + - To enable the error-tracking feature, run the following commands: |
30 | 30 |
|
31 | | - ```bash |
32 | | - export DATABEND_SENTRY_DSN="<your-sentry-dsn>" |
33 | | - ``` |
| 31 | +```bash |
| 32 | +export DATABEND_SENTRY_DSN="<your-DSN>" |
| 33 | +``` |
34 | 34 |
|
35 | | - <img src="/img/tracing/sentry-error.png"/> |
| 35 | + - To enable the performance monitoring feature, run the following commands: |
36 | 36 |
|
37 | | -- **Also Enable Performance Monitoring** |
| 37 | +```bash |
| 38 | +export DATABEND_SENTRY_DSN="<your-DSN>" |
| 39 | +export SENTRY_TRACES_SAMPLE_RATE=1.0 LOG_LEVEL=DEBUG |
| 40 | +``` |
| 41 | +:::tip |
| 42 | +Set `SENTRY_TRACES_SAMPLE_RATE` to a small value in production. |
| 43 | +::: |
38 | 44 |
|
39 | | - Setting `SENTRY_TRACES_SAMPLE_RATE` greater than `0.0` will allow sentry to perform trace sampling, which will help set up performance monitoring. |
| 45 | +### Step 4. Deploy Databend |
40 | 46 |
|
41 | | - ```bash |
42 | | - export DATABEND_SENTRY_DSN="<your-sentry-dsn>" |
43 | | - export SENTRY_TRACES_SAMPLE_RATE=1.0 LOG_LEVEL=DEBUG |
44 | | - ``` |
| 47 | +Follow the [Deployment Guide](https://databend.rs/doc/deploy) to deploy Databend. |
45 | 48 |
|
46 | | - **Note:** Set `SENTRY_TRACES_SAMPLE_RATE` a to lower value in production. |
| 49 | +You're all set now. Check the pages on Sentry for alerts and performce information. |
47 | 50 |
|
48 | | - <img src="/img/tracing/sentry-performance.png"/> |
| 51 | + |
0 commit comments