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

# New Relic

Monitor Spice Cloud with New Relic

Spice Cloud can be monitored with [New Relic](https://newrelic.com/) two ways: pushing metrics directly to New Relic's hosted OTLP intake, or scraping the [metrics endpoint](https://github.com/spicehq/docs/tree/trunk/cloud/api/metrics.md) with the New Relic infrastructure agent.

The OTLP path is covered first because it needs no agent, and the New Relic license key can be held as a project [secret](/docs/portal/apps/secrets.md) rather than configured on a host.

## OpenTelemetry OTLP export

Add an `otel_exporter` block to the project's [spicepod](/docs/portal/app-spicepod/spicepod-configuration.md):

```yaml
runtime:
  telemetry:
    otel_exporter:
      endpoint: https://otlp.nr-data.net/v1/metrics
      headers:
        api-key: ${secrets:NEW_RELIC_LICENSE_KEY}
```

Pick the endpoint matching the account's region:

| Region       | OTLP/HTTP endpoint                         |
| ------------ | ------------------------------------------ |
| US (default) | `https://otlp.nr-data.net/v1/metrics`      |
| EU           | `https://otlp.eu01.nr-data.net/v1/metrics` |
| FedRAMP      | `https://gov-otlp.nr-data.net/v1/metrics`  |

The header name is `api-key`, lowercase. Use a New Relic [license key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#license-key) — either the account ingest license key or an ingest-specific key. Store it as a project [secret](/docs/portal/apps/secrets.md) and reference it with `${secrets:NAME}`.

Metrics appear in New Relic's Metrics Explorer within a minute or two of the first push.

{% hint style="info" %}
Spice exports with `delta` temporality by default, which is what New Relic expects. See [OpenTelemetry](/docs/monitoring/monitoring/opentelemetry.md#temporality) if a different setting is needed.
{% endhint %}

### Namespacing and attributes

`metric_prefix` avoids collisions with other services reporting into the same New Relic account, and `properties` become resource attributes that New Relic exposes as queryable dimensions:

```yaml
runtime:
  telemetry:
    metric_prefix: 'spiceai.'
    properties:
      environment: prod
      region: us-west-2
      team: data-platform
    otel_exporter:
      endpoint: https://otlp.nr-data.net/v1/metrics
      push_interval: '30s'
      headers:
        api-key: ${secrets:NEW_RELIC_LICENSE_KEY}
```

Those attributes are then available in NRQL through `WHERE` and `FACET`:

```sql
SELECT average(spiceai.query_duration_ms) FROM Metric WHERE environment = 'prod' FACET region SINCE 1 hour ago
```

{% hint style="warning" %}
When `metric_prefix` is combined with the `metrics` whitelist, the whitelist entries must include the prefix — the filter runs after the prefix is applied.
{% endhint %}

## Prometheus scrape

The New Relic infrastructure agent can scrape the metrics endpoint instead, which suits an estate already collecting Prometheus targets through New Relic.

```bash
curl "https://<project-cname>.spiceai.io/v1/metrics" \
  -H "X-API-Key: <API_KEY>"
```

Point a Prometheus scrape target at that URL, passing the [project API key](/docs/portal/apps/api-keys.md) as the `X-API-Key` header. See New Relic's [Prometheus integrations overview](https://docs.newrelic.com/docs/infrastructure/prometheus-integrations/get-started/send-prometheus-metric-data-new-relic/) for agent configuration.

Metrics collected this way are cumulative, since the scrape endpoint always exposes cumulative values.

## Related

* [OpenTelemetry](/docs/monitoring/monitoring/opentelemetry.md) — full `runtime.telemetry` reference
* [Metrics API](https://github.com/spicehq/docs/tree/trunk/cloud/api/metrics.md) — endpoint reference and the full metric list
* [Grafana & Prometheus](/docs/monitoring/monitoring/grafana.md) and [Datadog](/docs/monitoring/monitoring/datadog.md) — other monitoring integrations


---

# 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 dynamically by asking a question.

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

```
GET https://docs.spice.ai/docs/monitoring/monitoring/new-relic.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
