info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
for use in GitLab 15.9, and is planned for removal in GitLab 16.0. We are replacing this feature with functionality in the [GitLab Observability UI](https://gitlab.com/gitlab-org/opstrace/opstrace-ui). Please also reference our direction for [Observability](https://about.gitlab.com/direction/monitor/observability/) and [data visualization](https://about.gitlab.com/direction/monitor/observability/data-visualization/).
Error Tracking allows developers to discover and view errors generated by their application. Because error information is surfaced where the code is being developed, efficiency and awareness are increased.
[Sentry](https://sentry.io/) is an open source error tracking system. GitLab allows administrators to connect Sentry to GitLab so users can view a list of Sentry errors in GitLab.
1. Sign up to Sentry.io or [deploy your own](#deploying-sentry) Sentry instance.
1. [Create](https://docs.sentry.io/product/sentry-basics/guides/integrate-frontend/create-new-project/) a new Sentry project. For each GitLab project that you want to integrate, we recommend that you create a new Sentry project.
1. On the left sidebar, select **Monitor > Error Tracking**.
1. Select **Enable error tracking**.
1. In GitLab, ensure error tracking is active.
1. On the left sidebar, select **Settings > Monitor**.
1. Expand **Error Tracking**.
1. Ensure the **Active** checkbox is selected.
1. In the **Sentry API URL** box, enter your Sentry hostname. For example, enter `https://sentry.example.com`. For the SaaS version of Sentry, the hostname is `https://sentry.io`.
1. In the **Auth Token** box, enter the token you previously generated.
You may also want to enable Sentry's GitLab integration by following the steps in the [Sentry documentation](https://docs.sentry.io/product/integrations/gitlab/)
Here, you can filter errors by title or by status (one of Ignored , Resolved, or Unresolved) and sort in descending order by Frequency, First Seen, or Last Seen. By default, the error list is ordered by Last Seen and filtered to Unresolved errors.
- A link to the GitLab commit if the Sentry [release ID/version](https://docs.sentry.io/product/releases/?platform=javascript#configure-sdk) on the Sentry Issue's first release matches a commit SHA in your GitLab hosted project.
- Other details about the issue, including a full stack trace.
- In [GitLab 12.7 and newer](https://gitlab.com/gitlab-org/gitlab/-/issues/36246), language and urgency are displayed.
By default, a **Create issue** button is displayed:
![Error Details without Issue Link](img/error_details_v12_7.png)
Ignoring an error prevents it from appearing in the [Error Tracking List](#error-tracking-list), and silences notifications that were set up in Sentry.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/329596) in GitLab 14.4.
> - [Disabled](https://gitlab.com/gitlab-org/gitlab/-/issues/353639) in GitLab 14.9 [with a flag](../administration/feature_flags.md) named `integrated_error_tracking`. Disabled by default.
Regardless of the programming language, you need to enable error tracking for your project. This doc assumes you already have a project for which you want to enable error tracking.
1. On the top bar, select **Main menu > Projects** and find your project.
1. On the left sidebar, select **Settings > Monitor**.
1. Expand the **Error Tracking** tab.
1. Under **Enable error tracking**, select the **Active** checkbox.
1. Under **Error tracking backend**, select **GitLab**.
1. Select **Save changes**.
1. Copy the DSN string to use later.
### Listing captured errors
Once your application has emitted errors to the Error Tracking API through the Sentry SDK, they should be available under **Monitor > Error Tracking** tab/section.
For more details, refer to the [GitLab error tracking documentation](https://gitlab.com/help/operations/error_tracking#error-tracking-list).
This process assumes the GDK feature flag `integrated_error_tracking` is enabled. If you are running GDK locally and you do not see the option for error tracking, you can enable it by running the following commands:
```linux
cd <PATH_TO_GDK>
gdk rails console
Feature.enable(:integrated_error_tracking)
```
### Emitting errors
#### Supported Sentry types
According to the [data model](https://develop.sentry.dev/sdk/envelopes/#data-model), the available item types are:
Items of various types can be sent to the error tracking app, using either the Store endpoint, the envelope endpoint, or both. The following table lists all event types available through Sentry SDK. It also explains which endpoint can be used for ingestion and whether it is supported by GitLab Observability Backend.
Event item types can contain various interfaces, such as exception, message, stack trace, and template. You can read more about the core data interfaces in [Sentry documentation](https://develop.sentry.dev/sdk/event-payloads/#core-interfaces).
| Item type | Interface | Can be sent through the Store endpoint | Can be sent through the Envelope endpoint | Supported |
| `transaction` | N/A | **{dotted-circle}** No | **{check-circle}** Yes | **{dotted-circle}** No |
| `attachment` | N/A | **{dotted-circle}** No | **{check-circle}** Yes | **{dotted-circle}** No |
| `session` | N/A | **{dotted-circle}** No | **{check-circle}** Yes | **{dotted-circle}** No |
| `sessions` | N/A | **{dotted-circle}** No | **{check-circle}** Yes | **{dotted-circle}** No |
| `user_report` | N/A | **{dotted-circle}** No | **{check-circle}** Yes | **{dotted-circle}** No |
| `client_report` | N/A | **{dotted-circle}** No | **{check-circle}** Yes | **{dotted-circle}** No |
#### Supported languages
Each language shows a basic example of how to capture exceptions with the respective SDK.
For more in-depth documentation, see [documentation for Sentry SDK](https://docs.sentry.io/). You can also find information for additional programming languages.
Only a subset of languages is supported.
The following table lists them:
| Sentry SDK | Supported? |
| ----------- | ----------- |
| Ruby | Yes |
| Go | Yes |
| JavaScript | Yes |
| Java | Yes |
| Python | Yes |
| PHP | Yes |
| .NET | Not tested |
| Android | Not tested |
| Apple | Not tested |
| Perl | Not tested |
A more up-to-date version of [this matrix can be found in this doc](https://gitlab.com/gitlab-org/opstrace/opstrace/-/issues/1737).
#### Go
1.`chdir` into folder `docs/guides/user/error_tracking_examples/go/`
1. Install the dependencies with the following command:
```shell
go mod tidy
```
1. Run the following command:
```shell
export SENTRY_DSN="<DSNstring>"
go run main.go <DSNstring>
```
After you've run this program, there should be an error visible in the Error tracking tab from `Listing captured errors` section of this document.
#### Ruby
1.`chdir` into folder `docs/guides/user/error_tracking_examples/ruby/`
1. Install the dependencies with the following command:
```shell
gem install bundler
bundle install
```
1. Execute the example with the following command:
```shell
export SENTRY_DSN="<DSNstring>"
ruby app.rb
```
After you've run this program, there should be an error visible in the Error tracking tab from `Listing captured errors` section of this document.
#### PHP
1.`chdir` into folder `docs/guides/user/error_tracking_examples/php/`
1. Build and run the Docker container with the following commands:
```shell
export SENTRY_DSN="<DSNstring>"
docker build -t sentry-php .
docker run -e SENTRY_DSN --rm sentry-php
```
After you've run this program, there should be an error visible in the Error tracking tab from `Listing captured errors` section of this document.
#### Python
1.`chdir` into folder `docs/guides/user/error_tracking_examples/python/`
1. Install the dependencies with the following commands:
```shell
virtualenv env
source env/bin/activate
pip install -r requirements.txt
```
1. Run the following commands:
```shell
export SENTRY_DSN="<DSNstring>"
python send_exception.py
```
After you've run this program, there should be an error visible in the Error tracking tab from `Listing captured errors` section of this document.
#### Java
1.`chdir` into folder `docs/guides/user/error_tracking_examples/python/`
1. Run the following command:
```shell
export SENTRY_DSN="<DSNstring>"
./gradlew run
```
#### Node.js
1.`chdir` into folder `docs/guides/user/error_tracking_examples/nodejs/`
1. Install the dependencies with the following command:
The Sentry DSN (client key) is a secret and it should not be exposed to the public. If it's leaked, you can rotate the Sentry DSN with the following steps:
1. [Create an access token](../user/profile/personal_access_tokens.md#create-a-personal-access-token) by clicking your profile picture in GitLab.com. Then choose Preferences,then Access Token. Make sure you add the API scope.
1. Using the [error tracking API](../api/error_tracking.md), create a new Sentry DSN with the following command: