skills/new-relic-nerdgraph/SKILL.md
Query New Relic via NerdGraph GraphQL API — run NRQL queries, search entities, and execute cross-account queries. Use when the user needs to fetch, search, or analyze data from New Relic.
npx skillsauth add greentopsecret/agent-skills new-relic-nerdgraphInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Execute queries against the New Relic NerdGraph GraphQL API and return structured JSON results. This skill is a data retrieval tool only — it does not interpret or analyze the results.
Supports three operation types:
Log collection)The NR_API_KEY environment variable must be set (New Relic User API key, starts with NRAK-).
Check if it's set:
echo "${NR_API_KEY:+SET}"
If NOT set, suggest one of these approaches to the user:
The key can be generated at: https://one.newrelic.com/admin-portal/api-keys/home (create a User key).
~/.zshrc or ~/.bashrc:
export NR_API_KEY="NRAK-XXXXXXXXXXXXXXXXXXXX"
.envrc file:
export NR_API_KEY="NRAK-XXXXXXXXXXXXXXXXXXXX"
security add-generic-password -a "$USER" -s NR_API_KEY -w "NRAK-XXXXXXXXXXXXXXXXXXXX"
# Then in ~/.zshrc:
export NR_API_KEY=$(security find-generic-password -a "$USER" -s NR_API_KEY -w)
Do NOT proceed with queries until the key is available. Do NOT hardcode the key in commands.
query subcommand)Required for NRQL queries. Set via:
--account <ID> flagNR_ACCOUNT_ID environment variableIf the user doesn't know their account ID, run the accounts subcommand first to discover it.
Required for the query script (uses native fetch).
The script location depends on how the skill was installed:
~/.copilot/skills/new-relic-nerdgraph/scripts/nerdgraph.mjs~/.claude/skills/new-relic-nerdgraph/scripts/nerdgraph.mjs./.agents/skills/new-relic-nerdgraph/scripts/nerdgraph.mjsDetect the correct path by checking which exists. The script is always at scripts/nerdgraph.mjs relative to this SKILL.md.
query — Run NRQL Queriesnode <script> query "<NRQL_QUERY>" --account <ID> [--limit <N>]
--account <ID> or NR_ACCOUNT_ID env var--limit <N> appends LIMIT N if the query doesn't already have oneFROM clause, FROM Log is appended automaticallyCross-account queries:
node <script> query "<NRQL_QUERY>" --accounts 12345,67890,11111
Use --accounts (plural, comma-separated) to run NRQL across multiple accounts simultaneously. This is useful when data spans dev/staging/prod or separate team accounts.
entities — Search Entitiesnode <script> entities ["<search-query>"] [--type <TYPE>] [--domain <DOMAIN>]
name LIKE 'my-app')--type: filter by entity type (APPLICATION, HOST, MONITOR, etc.)--domain: filter by domain (APM, INFRA, BROWSER, SYNTH, etc.)accounts — List Accountsnode <script> accounts
NR_ACCOUNT_IDThe default collection is Log. These examples use it, but you can query any event type (Transaction, SystemSample, Metric, PageView, SyntheticCheck, etc.).
-- Fetch logs by time range
SELECT * FROM Log
WHERE `level` = 'error'
SINCE 1 hour ago
LIMIT 100
-- Filter by application or host
SELECT * FROM Log
WHERE `application` = '<APP_NAME>'
AND `level` = 'error'
SINCE 1 hour ago
LIMIT 100
-- Search by message content
SELECT * FROM Log
WHERE `message` LIKE '%timeout%'
SINCE 1 hour ago
LIMIT 100
-- Count errors by facet
SELECT count(*) FROM Log
WHERE `level` = 'error'
SINCE 1 day ago
FACET `application`
-- Query transactions (non-Log example)
SELECT average(duration), count(*)
FROM Transaction
WHERE `appName` = '<APP_NAME>'
SINCE 1 hour ago
FACET `name`
-- Infrastructure metrics (non-Log example)
SELECT average(cpuPercent), average(memoryUsedPercent)
FROM SystemSample
SINCE 30 minutes ago
FACET `hostname`
SINCE / UNTIL accept ISO strings ('2026-02-25 07:15:59+01:00') or relative (1 hour ago)`labels.app`LIMIT MAX returns up to 5000 events; default is 100FACET groups results by fieldTIMESERIES returns time-bucketed dataname LIKE 'my-service'
type IN ('APPLICATION')
domain = 'APM' AND reporting = 'true'
tags.environment = 'production'
alertSeverity = 'CRITICAL'
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.
development
End-to-end Parallels smoke, upgrade, and rerun workflow for OpenClaw across macOS, Windows, and Linux guests. Use when Codex needs to run, rerun, debug, or interpret VM-based install, onboarding, gateway smoke tests, latest-release-to-main upgrade checks, fresh snapshot retests, or optional Discord roundtrip verification under Parallels.