Skip to content
Snippets Groups Projects
Unverified Commit 128cb36f authored by Dmytro Zaporozhets's avatar Dmytro Zaporozhets
Browse files

Add documentation for integrated error tracking


Describe core concept and how to enable it.

Signed-off-by: default avatarDmytro Zaporozhets <dzaporozhets@gitlab.com>
parent 079122ca
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -108,3 +108,66 @@ clicking the **Resolve** button near the top of the page.
Marking an error as resolved indicates that the error has stopped firing events. If a GitLab issue is linked to the error, then the issue closes.
 
If another event occurs, the error reverts to unresolved.
## Integrated error tracking
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/329596) in GitLab 14.3.
Integrated error tracking is a lightweight alternative to Sentry backend.
You still use Sentry SDK with your application. But you don't need to deploy Sentry
or setup for cloud hosted Sentry. Instead you use GitLab as a backend for it.
Sentry backend automatically assigns a Data Source Name (DSN) for every project you create.
Same with GitLab, you should be able to find a DSN for your project in GitLab error tracking settings.
By using GitLab provided DSN, your application will connect to GitLab to report an error.
All those errors will be stored in GitLab database, and then rendered to you in GitLab UI
the same way like it does for Sentry integration above.
### Feature flag
Integrated error tracking feature is behind a feature flag that is disabled by default.
To enable it:
```ruby
Feature.enable(:integrated_error_tracking)
```
To disable it:
```ruby
Feature.disable(:integrated_error_tracking)
```
### Project settings
The feature should be enabled on the project level. However, there is no UI to enable this feature yet.
You need to use GitLab API to enable it.
#### How to enable
Enable `integrated` error tracking setting for your project.
```shell
curl --request PATCH --header "PRIVATE-TOKEN: <your_access_token>" \
"https://gitlab.example.com/api/v4/projects/PROJECT_ID/error_tracking/settings?active=true&integrated=true"
```
Create a client key (DSN) to use with Sentry SDK in your application. Make sure to save the response as it contains a DSN.
```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
"https://gitlab.example.com/api/v4/projects/PROJECT_ID/error_tracking/client_keys"
```
Take DSN from the previous step and configure your Sentry SDK with it. New errors will be
reported to GitLab collector and will be visible in [GitLab UI](#error-tracking-list).
#### How to disable
Same as enable, but with a `false` value instead.
```shell
curl --request PATCH --header "PRIVATE-TOKEN: <your_access_token>" \
"https://gitlab.example.com/api/v4/projects/PROJECT_ID/error_tracking/settings?active=false&integrated=false"
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment