Skip to main content
Version: Next

New Relic

Spice can be monitored with New Relic using either the Spice Metrics Endpoint (Prometheus scrape via the New Relic infrastructure agent) or the OpenTelemetry Metrics Exporter (push directly to New Relic's OTLP intake).

For agent-based collection, see the New Relic Prometheus integrations overview. The walkthrough below covers the agentless OTLP path, which is recommended for serverless and ephemeral deployments and for environments where the New Relic license key is managed through Spice's secret stores.

OpenTelemetry OTLP Export

New Relic accepts OpenTelemetry metrics on a hosted OTLP endpoint. Spice pushes directly to it without requiring an OpenTelemetry collector or the New Relic agent.

Minimal Configuration

Pick the endpoint that matches your account region (see New Relic OTLP endpoint configuration) and store the New Relic license key in a secret:

runtime:
telemetry:
otel_exporter:
endpoint: https://otlp.nr-data.net/v1/metrics
headers:
api-key: ${secrets:new_relic_license_key}
RegionOTLP/HTTP endpoint
US (default)https://otlp.nr-data.net/v1/metrics
EUhttps://otlp.eu01.nr-data.net/v1/metrics
FedRAMPhttps://gov-otlp.nr-data.net/v1/metrics

The header name is api-key (lowercase). Use a New Relic license key — either the account's ingest license key or an ingest-specific key.

Metrics begin appearing in New Relic's Metrics Explorer within a minute or two.

Namespace Spice Metrics with a Prefix

Use runtime.telemetry.metric_prefix to prepend a string to every exported metric name. This avoids collisions with metrics from other services in the same New Relic account:

runtime:
telemetry:
metric_prefix: 'spiceai.'

The runtime metric query_duration_ms is then exported as spiceai.query_duration_ms.

Combining metric_prefix with metric filtering

If you also set runtime.telemetry.otel_exporter.metrics to whitelist specific metrics, the entries must include the prefix. The filter runs after the prefix is applied, so e.g. query_duration_ms will not match when metric_prefix: 'spiceai.' is set — use spiceai.query_duration_ms instead.

Add Custom Attributes via Resource Attributes

Attach custom key/value pairs to every metric using runtime.telemetry.properties. Spice sends these as OpenTelemetry resource attributes, which New Relic surfaces as queryable dimensions on each metric:

runtime:
telemetry:
properties:
environment: prod
region: us-west-2
team: data-platform

These attributes are available in NRQL via the WHERE and FACET clauses, e.g.:

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

Full Example

A complete runtime.telemetry block combining metric prefixing, custom attributes, and New Relic OTLP export:

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}

With this configuration, every Spice metric (e.g. spiceai.query_duration_ms, spiceai.query_executions) arrives in New Relic with environment, region, and team available as dimensions for use in NRQL queries, dashboards, and alerts.

For general OTLP exporter options (push interval, metric filtering, gRPC vs HTTP), see OpenTelemetry Metrics Exporter.