# BugSnag

{% hint style="info" %}
Cortex connects to many third-party vendors whose system interfaces frequently change. As a result, integration behavior or configuration steps may shift without notice. If you encounter unexpected issues, check with your system administrator or refer to the vendor's documentation for the most current information. Additionally, integration sync times vary and are subject to scheduling overrides and timing variance.
{% endhint %}

[BugSnag](https://www.bugsnag.com/) is an application stability monitoring platform that provides error tracking and analytics.

Integrating BugSnag with Cortex allows you to:

* [View errors on entity pages](#viewing-bugsnag-errors-on-an-entity) in Cortex, giving you insight into your entity's operational maturity
* Create [Scorecards](#scorecards-and-cql) that include rules related to BugSnag errors

## How to configure BugSnag with Cortex

### Prerequisites

Before getting started:

* Create a [BugSnag auth token](https://bugsnagapiv2.docs.apiary.io/#introduction/authentication) in your [BugSnag account's settings page](https://app.bugsnag.com/settings/my-account) under "My account."
* You must have the `Configure integrations` permission in Cortex.

{% hint style="warning" %}
If you're using a self-hosted instance of BugSnag, you'll need to verify that your Cortex instance is able to reach the BugSnag instance.\
\
We route our requests through a static IP address. Reach out to support at <help@cortex.io> to receive details about our static IP. If you're unable to directly allowlist our static IP, you can route requests through a secondary proxy in your network that has this IP allowlisted and have that proxy route traffic to your BugSnag instance.
{% endhint %}

### Configure the integration in Cortex

1. In Cortex, navigate to the [BugSnag settings page](https://app.getcortexapp.com/admin/integrations/bugsnag).
   * Click **Integrations** from the main nav. Search for and select **BugSnag**.
2. Click **Add configuration**.
3. Configure the integration form:
   * **Auth token**: Enter the auth token you generated in BugSnag.
   * **Organization slug**: Enter your BugSnag organization slug.
     * You can find this in your BugSnag URL, e.g., `https://app.bugsnag.com/organizations/{SLUG}/stability-center`.
   * **Host**: If using a custom BugSnag instance, enter the URL here *without* the API path (e.g., `bugsnag.getcortexapp.com`).
4. Click **Save**.

After saving your configuration, you are redirected to the BugSnag integration settings page in Cortex. In the upper right corner of the page, click **Test configuration** to ensure BugSnag was configured properly.

To modify the integration configuration, see [Modifying an existing integration configuration](/ingesting-data-into-cortex/integrations.md#modifying-an-existing-integration-configuration).

## How to connect Cortex entities to BugSnag projects

### Discovery

By default, Cortex will use the [Cortex tag](/ingesting-data-into-cortex/entities-overview/entities.md#cortex-tag) (e.g. `my-entity`) as the "best guess" for BugSnag projects. For example, if your Cortex tag is `my-entity`, then the corresponding project in BugSnag should also be `my-entity`.

If your BugSnag projects don’t cleanly match the [Cortex tag](/ingesting-data-into-cortex/entities-overview/entities.md#cortex-tag), you can override this in the Cortex entity descriptor.

### Editing the entity descriptor

You can define projects under the `x-cortex-bugsnag` block:

```yaml
x-cortex-bugsnag:
  project: my-project
```

| Field     | Description                    | Required |
| --------- | ------------------------------ | :------: |
| `project` | Project key defined in BugSnag |   **✓**  |

## Using the BugSnag integration

### Viewing BugSnag errors on an entity

Error data will appear on an [entity's details page](/ingesting-data-into-cortex/entities-overview/entities/details.md). You can find the total number of detected errors and a full list on the **Error tracking** page in the entity's side panel. Error data is fetched live.

Each error in the list will display with an `Error`, `Info`, or `Warning` tag based on the [severity](https://docs.bugsnag.com/product/severity-indicator/#severity) applied to a given error in BugSnag.

### Scorecards and CQL

With the BugSnag integration, you can create Scorecard rules and write CQL queries based on BugSnag projects and issues.

See more examples in the [CQL Explorer](https://app.getcortexapp.com/admin/cql-explorer) in Cortex.

<details>

<summary>Check if BugSnag is set</summary>

Check if an entity has a registered BugSnag project.

**Definition:** `bugsnag (==/!=) null`

**Example**

This expression can be used to write a Scorecard rule to make sure each entity has a registered BugSnag project:

```
bugsnag != null
```

This is also a good way to double-check that the integration is synced and reporting frequently.

</details>

<details>

<summary>Number of issues</summary>

Count all unresolved issues in BugSnag or counts number of issues for a given query. By default, will count all unresolved issues.

**Definition:** `bugsnag.numOfIssues(query: Text | Null)`

**Example**

For a Scorecard focused on operational maturity, you can pull in error data from BugSnag to make sure your entities have no or few errors.

```
bugsnag.numOfIssues() < 2
```

To set a more specific standard, you can also create a rule based on a [filter](https://docs.bugsnag.com/product/custom-filters/).

```
bugsnag.numOfIssues("filters[error.status][][type]=example")
```

</details>

### View integration logs <a href="#still-need-help" id="still-need-help"></a>

## Still need help?[​](https://docs.cortex.io/docs/reference/integrations/aws#still-need-help) <a href="#still-need-help" id="still-need-help"></a>

The following options are available to get assistance from the Cortex Customer Engineering team:

* **Email**: <help@cortex.io>, or open a support ticket in the in app Resource Center
* **Slack**: Users with a connected Slack channel will have a workflow added to their account. From here, you can either @CortexTechnicalSupport or add a `:ticket:` reaction to a question in Slack, and the team will respond directly.

Don’t have a Slack channel? Talk with your Customer Success Manager.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cortex.io/ingesting-data-into-cortex/integrations/bugsnag.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
