> For the complete documentation index, see [llms.txt](https://docs.slingdata.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.slingdata.io/connections/api-connections/new-relic.md).

# New Relic

Connect & Ingest data from New Relic

New Relic is a comprehensive observability platform for monitoring applications, infrastructure, and digital experiences. The Sling New Relic connector extracts data from the New Relic REST API v2, supporting applications, hosts, deployments, key transactions, browser applications, alert policies, alert conditions, NRQL conditions, alert incidents, and notification channels.

{% hint style="success" %}
**CLI Pro Required**: APIs require a [CLI Pro token](/sling-cli/cli-pro.md) or [Platform Plan](/sling-platform/platform.md).
{% endhint %}

## Setup

The following credentials and inputs are accepted:

**Secrets:**

* `api_key` **(required)** -> Your New Relic User API key (starts with `NRAK-`)
* `region` (optional) -> Your New Relic region domain (default: `newrelic.com`). Use `eu.newrelic.com` for the EU data center.

### Getting Your API Key

1. Log in to [New Relic](https://one.newrelic.com/)
2. Click your user menu (bottom-left) and select **API keys**, or navigate directly to [API Keys](https://one.newrelic.com/api-keys)
3. Click **Create a key**
4. Select **User** as the key type
5. Give it a name and click **Create a key**
6. Copy the key immediately — it starts with `NRAK-` and won't be shown again in full

{% hint style="warning" %}
**Important:** You need a **User key** (not a License or Browser key). User keys start with `NRAK-` and are required for REST API v2 access.
{% endhint %}

### Using `sling conns`

{% code overflow="wrap" %}

```bash
sling conns set NEW_RELIC type=api spec=new-relic secrets='{ api_key: "${NEW_RELIC_API_KEY}" }'
```

{% endcode %}

### Environment Variable

See [here](https://docs.slingdata.io/connections/api-connections/pages/eAdVs2BHCgdr6RS8GoJC#dot-env-file-.env.sling) to learn more about the `.env.sling` file.

{% code overflow="wrap" %}

```bash
export NEW_RELIC='{ type: api, spec: new-relic, secrets: { api_key: "your_api_key" } }'
```

{% endcode %}

### Sling Env File YAML

See [here](https://docs.slingdata.io/connections/api-connections/pages/eAdVs2BHCgdr6RS8GoJC#sling-env-file-env.yaml) to learn more about the sling `env.yaml` file.

```yaml
connections:
  NEW_RELIC:
    type: api
    spec: new-relic
    secrets:
      api_key: ${NEW_RELIC_API_KEY}
```

**For EU data center:**

```yaml
connections:
  NEW_RELIC:
    type: api
    spec: new-relic
    secrets:
      api_key: ${NEW_RELIC_API_KEY}
      region: ${NEW_RELIC_REGION}
```

## Replication

Here's an example replication configuration to sync New Relic data to a PostgreSQL database:

```yaml
source: NEW_RELIC
target: MY_POSTGRES

defaults:
  mode: full-refresh
  object: new_relic.{stream_name}

streams:
  # sync all endpoints
  '*':
```

## Endpoints

### APM & Applications

| Endpoint                  | Description                                                                  | Incremental |
| ------------------------- | ---------------------------------------------------------------------------- | ----------- |
| `applications`            | APM application summaries with health status, response times, and throughput | No          |
| `application_hosts`       | Hosts associated with each APM application                                   | No          |
| `application_deployments` | Deployment records for each APM application                                  | No          |
| `key_transactions`        | Key transactions across applications                                         | No          |
| `browser_applications`    | Browser monitoring applications                                              | No          |
| `mobile_applications`     | Mobile monitoring applications                                               | No          |

### Alerts

| Endpoint                 | Description                                                     | Incremental |
| ------------------------ | --------------------------------------------------------------- | ----------- |
| `alerts_policies`        | Alert policies and their incident preferences                   | No          |
| `alerts_conditions`      | Alert conditions for each policy (APM, browser, mobile metrics) | No          |
| `alerts_nrql_conditions` | NRQL-based alert conditions for each policy                     | No          |
| `alerts_incidents`       | Alert incidents (open and closed)                               | No          |
| `alerts_channels`        | Notification channels configured for alerting                   | No          |

To discover available endpoints:

```bash
sling conns discover NEW_RELIC
```

## Parent-Child Endpoints

Some endpoints retrieve data per parent resource:

* **`application_hosts`** and **`application_deployments`** iterate over all applications found by the `applications` endpoint. Each record includes an `application_id` field linking back to the parent application.
* **`alerts_conditions`** and **`alerts_nrql_conditions`** iterate over all policies found by the `alerts_policies` endpoint. Each record includes a `policy_id` field linking back to the parent policy.

If the parent endpoint returns no records (e.g., no APM applications are reporting), the child endpoints will also return no records.

## Regional Data Centers

New Relic operates in two regions. Set the `region` secret to use a different data center:

| Region       | Region Value      |
| ------------ | ----------------- |
| US (default) | `newrelic.com`    |
| EU           | `eu.newrelic.com` |

## Rate Limiting

The New Relic REST API v2 allows 1,000 requests per minute per API key. The connector automatically:

* Uses conservative rate limiting (10 requests/second)
* Retries with exponential backoff on 429 (rate limit) responses
* Retries on 5xx server errors with linear backoff

If you are facing issues connecting, please reach out to us at <support@slingdata.io>, on [discord](https://discord.gg/q5xtaSNDvp) or open a Github Issue [here](https://github.com/slingdata-io/sling-cli/issues).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.slingdata.io/connections/api-connections/new-relic.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
