npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rawdash/connector-new-relic

v0.29.2

Published

Rawdash connector for New Relic — NRQL alert conditions, incidents, and user-declared NRQL metric queries via NerdGraph.

Readme

@rawdash/connector-new-relic

npm version license

Sync NRQL alert conditions, AI incidents, and user-declared NRQL metric queries from a New Relic account via NerdGraph.

Install

npm install @rawdash/connector-new-relic

Authentication

A New Relic User API key plus the numeric account ID are required. The key is stored as a secret and used to authenticate every NerdGraph GraphQL request.

  1. Open New Relic -> API keys and create a User key. Ingest-keys are not accepted by NerdGraph.
  2. Find the numeric account ID under New Relic -> Administration -> Access management. The User key must have access to that account.
  3. Store the User key as a secret and reference it from the connector config as apiKey: secret("NEWRELIC_USER_KEY").
  4. Set accountId to the numeric account ID, and optionally region: "EU" if the data lives on the EU host (api.eu.newrelic.com); defaults to US (api.newrelic.com).

Configuration

| Field | Type | Required | Description | | ------------------------ | ------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | apiKey | secret | Yes | New Relic User API key. Create at New Relic -> API keys (User key type, ingest-keys do not work for NerdGraph). | | accountId | number | Yes | New Relic account ID the User API key has access to. Find it under New Relic -> Administration -> Access management. | | region | US | EU | No | New Relic data region. Defaults to US (api.newrelic.com); set to EU to use api.eu.newrelic.com. | | nrqlQueries | array | No | User-declared NRQL queries. Each entry produces newrelic_nrql_metric samples named <name> from the NerdGraph NRQL API. | | resources | array | No | Which New Relic resources to sync. Omit to sync all of them. | | incidentsLookbackHours | number | No | Window of NrAiIncident rows to pull on each sync, in hours. Defaults to 168 (7 days). Ignored when since is set by the host. | | metricsLookbackHours | number | No | Window of NRQL metric samples to pull on each sync, in hours. Defaults to 24. Each user query gets SINCE <lookback> hours ago appended unless the query already declares its own SINCE clause. |

Resources

  • newrelic_alert_condition (entity) - NRQL alert conditions with name, enabled state, policy id, type, and the underlying NRQL query string.
    • Endpoint: GraphQL query: actor.account.alerts.nrqlConditionsSearch { nrqlConditions { ... } }
  • newrelic_alert_violation (event) - AI alert violation events. Each row from the NrAiIncident event type becomes one event with openedAt / closedAt and the underlying condition / policy metadata.
    • Endpoint: GraphQL nrql() against SELECT ... FROM NrAiIncident WHERE openedAt > ...
    • Append-only across syncs; the connector filters NrAiIncident by openedAt against options.since (or the configured lookback) to avoid re-emitting old incidents.
  • newrelic_nrql_metric (metric) - User-declared NRQL metric samples, stored as newrelic_nrql_metric.<query name>. Each NRQL result row is mapped to a single sample using the first numeric, non-timestamp/facet field as the value.
    • Endpoint: GraphQL nrql() against the user-declared NRQL query
    • Dimensions: queryName, query, facets

Example

import {
  defineConfig,
  defineDashboard,
  defineMetric,
  secret,
} from '@rawdash/core';

const newRelic = {
  name: 'newrelic',
  connectorId: 'new-relic',
  config: {
    apiKey: secret('NEWRELIC_USER_KEY'),
    accountId: 1234567,
    region: 'US' as const,
    nrqlQueries: [
      {
        name: 'error_rate',
        query:
          'SELECT percentage(count(*), WHERE error IS true) FROM Transaction TIMESERIES 5 minutes',
      },
    ],
  },
};

export default defineConfig({
  connectors: [newRelic],
  dashboards: {
    observability: defineDashboard({
      widgets: {
        open_violations: {
          kind: 'stat',
          title: 'Open Alert Violations',
          metric: defineMetric({
            connector: newRelic,
            shape: 'event',
            name: 'newrelic_alert_violation',
            fn: 'count',
            filter: [{ field: 'state', op: 'eq', value: 'CREATED' }],
          }),
        },
      },
    }),
  },
});

Rate limits

NerdGraph enforces per-account NRQL quotas; this connector retries on 429s through the standard HTTP retry policy.

Limitations

  • APM-trace deep inspection is out of scope (not dashboard-shaped).
  • NRQL queries are single-shot per sync (NRQL does not support cursor pagination); large queries should narrow their SINCE window or use LIMIT MAX.
  • Incidents are pulled via NRQL on the NrAiIncident event type, which depends on Applied Intelligence being enabled on the account.
  • Only NRQL-based alert conditions are synced; legacy V1 condition types are not exposed.

Links

License

Apache-2.0