# Rollbar

{% 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 %}

[Rollbar](https://rollbar.com/) is an error tracking tool that helps developers discover and resolve crashes and errors.

Integrating Rollbar with Cortex allows you to:

* [View errors on entity pages in Cortex](#viewing-rollbar-errors-on-an-entity), giving you insight into your entity's operational maturity
* Create [Scorecards](#scorecards-and-cql) that include rules relating to error data from Rollbar, motivating team members to improve their code quality

## How to configure Rollbar with Cortex

### Prerequisites

Before getting started:

* Create a [Rollbar access token](https://explorer.docs.rollbar.com/#section/Authentication/Account-Access-Tokens).
  * The token requires `read` permissions at minimum. This allows Cortex to automatically look up project tokens for each Rollbar project and attempt to reuse them to access project details.
  * Granting the token `read` and `write` permissions enables Cortex to automatically create an access token if none exists for a given project.

### Configure the integration in Cortex

1. In Cortex, navigate to the [Rollbar settings page](https://app.getcortexapp.com/admin/integrations/rollbar):
   1. Click **Integrations** from the main nav. Search for and select **Rollbar**.
2. Click **Add configuration**.
3. Configure the integration form:
   * **Account access token**: Enter the access token you generated in Rollbar.
   * **Account name**: Enter your Rollbar account name, found in your Rollbar settings.
     * The name also appears in the URL for your Rollbar instance, e.g.,
4. Click **Save**.

After saving your configuration, you are redirected to the Rollbar integration settings page in Cortex. In the upper right corner of the page, click **Test configuration** to ensure Rollbar 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 Rollbar 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 Rollbar projects. For example, if your Cortex tag is `my-entity`, then the corresponding project in Rollbar should also be `my-entity`.

If your Rollbar projects don’t cleanly match the Cortex tag, you can override this in the Cortex entity descriptor.

### Editing the entity descriptor

You can define projects under the `x-cortex-rollbar` block in an [entity's YAML](/ingesting-data-into-cortex/entities-overview/entities.md#defining-entities-via-yaml-file):

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

| Field     | Description                        | Required |
| --------- | ---------------------------------- | :------: |
| `project` | Project name as defined in Rollbar |   **✓**  |

## Using the Rollbar integration

### Viewing Rollbar errors on an entity

Error data from Rollbar will appear on an [entity's details page](/ingesting-data-into-cortex/entities-overview/entities/details.md). In an entity's sidebar, click **Error tracking** to view detected issues for each Rollbar project. At the top of the page, see the associated project tag and the project framework.

Under **Items**, see a list of detected errors and their statuses. Next to the error name, you can also see badges for `# seen` and the type of event: `error`, `warning`, or `info`.

### Scorecards and CQL

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

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

<details>

<summary>Check if Rollbar project is set</summary>

Check if entity has a registered Rollbar project.

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

**Example**

You can define a rule in an operational readiness Scorecard to make sure each entity has a registered Rollbar project.

```
rollbar != null
```

This is also a good way to confirm the integration is synced and reporting frequently.

You could also query for entities that don't have a registered Rollbar project to quickly identify those that need to be updated:

```
rollbar == null
```

</details>

<details>

<summary>RQL query</summary>

Evaluate an [RQL](https://docs.rollbar.com/docs/rql) query for the Rollbar project.

If the entity does not have a Rollbar project set, the rule will fail. An empty result set will result in null.

**Definition:** `rollbar.rql(<query>)`

**Example**

An operational maturity Scorecard, you can use this expression to make sure entities have fewer than 100 open errors.

```
rollbar.rql("SELECT count(*) FROM item_occurrence WHERE status = 1") < 100
```

Or you can set a rule that gauges errors over time:

```
rollbar.rql("SELECT count(*) / 30 FROM item_occurrence WHERE timestamp > unix_timestamp() - 60 * 60 * 24 * 30") < 5
```

This rule checks that entities have fewer than 5 new errors per day on average over the last 30 days.

</details>

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

{% hint style="info" %}
This feature is available in Cortex cloud.
{% endhint %}

While viewing an integration's settings page, click the **Logs** tab to view error logs from the last 7 days. You can filter the logs list by configuration and by operation (for example, you could filter to view errors surfaced only via Scorecards).

<div align="left" data-with-frame="true"><figure><img src="/files/x8JmoPqXZTJ7YHeFJpOA" alt="The &#x27;Logs&#x27; tab on an integration&#x27;s settings page shows error information over the past 7 days."><figcaption></figcaption></figure></div>

Click into a row to get more information, including time stamp, status code, full error, and request path.

## 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/rollbar.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.
