Use when the user asks about New Relic data — application performance, errors, alerts, deployments, infrastructure, logs, NRQL queries, dashboards, or production incidents. Calls New Relic APIs directly via curl. Triggers on keywords like "new relic", "nrql", "apm", "alert violations", "error rate", "throughput", "transactions", "deployment markers".
How this skill is triggered — by the user, by Claude, or both
Slash command
/newrelic-observability:newrelic-opsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Call New Relic NerdGraph (GraphQL) and REST v2 APIs directly via `curl`. No MCP server or Python dependencies needed.
Call New Relic NerdGraph (GraphQL) and REST v2 APIs directly via curl. No MCP server or Python dependencies needed.
Two environment variables must be set:
NEW_RELIC_API_KEY — User API key (starts with NRAK-)NEW_RELIC_ACCOUNT_ID — Numeric account IDBefore the first API call in a session, verify they exist:
test -n "$NEW_RELIC_API_KEY" && test -n "$NEW_RELIC_ACCOUNT_ID" && echo "OK" || echo "MISSING: set NEW_RELIC_API_KEY and NEW_RELIC_ACCOUNT_ID"
If missing, ask the user to set them. Do NOT proceed without them.
| API | Endpoint | Auth Header |
|---|---|---|
| NerdGraph (GraphQL) US | https://api.newrelic.com/graphql | API-Key: $NEW_RELIC_API_KEY |
| NerdGraph (GraphQL) EU | https://api.eu.newrelic.com/graphql | API-Key: $NEW_RELIC_API_KEY |
| REST v2 US | https://api.newrelic.com/v2/ | Api-Key: $NEW_RELIC_API_KEY |
Default to US endpoints. If the user mentions EU region, switch to EU endpoints.
curl -s -X POST https://api.newrelic.com/graphql \
-H 'Content-Type: application/json' \
-H "API-Key: $NEW_RELIC_API_KEY" \
-d "{\"query\": \"{ actor { account(id: $NEW_RELIC_ACCOUNT_ID) { nrql(query: \\\"SELECT count(*) FROM Transaction SINCE 1 HOUR AGO\\\") { results } } } }\"}" \
| python3 -m json.tool
Replace the NRQL inside \\\"...\\\" with the user's query.
Common NRQL event types:
| Event Type | Data |
|---|---|
Transaction | APM request data (duration, status, name) |
TransactionError | Errors with stack traces |
Log | Log entries |
SystemSample | Host CPU/memory/disk |
Metric | Dimensional metrics |
SyntheticCheck | Synthetic monitor results |
NrAiIncident | Alert incidents |
Deployment | Change tracking events |
NRQL essentials:
SINCE 1 hour ago, SINCE 1 day agoFACET for grouping: FACET appName, FACET hostTIMESERIES for trends over timeLIMIT to control result size (default 10)WHERE error IS TRUE to filter errorsCOMPARE WITH 1 hour ago to compare periodscurl -s -X POST https://api.newrelic.com/graphql \
-H 'Content-Type: application/json' \
-H "API-Key: $NEW_RELIC_API_KEY" \
-d '{"query": "{ actor { entitySearch(queryBuilder: {domain: APM, type: APPLICATION}) { results { entities { name entityType guid accountId alertSeverity reporting } nextCursor } } } }"}' \
| python3 -m json.tool
Domain/Type combinations:
| Domain | Type | What |
|---|---|---|
APM | APPLICATION | APM applications |
INFRA | HOST | Infrastructure hosts |
BROWSER | APPLICATION | Browser apps |
MOBILE | APPLICATION | Mobile apps |
VIZ | DASHBOARD | Dashboards |
SYNTH | MONITOR | Synthetic monitors |
Search by name (freeform):
curl -s -X POST https://api.newrelic.com/graphql \
-H 'Content-Type: application/json' \
-H "API-Key: $NEW_RELIC_API_KEY" \
-d "{\"query\": \"{ actor { entitySearch(query: \\\"name LIKE 'SERVICE_NAME' AND domain = 'APM'\\\") { count results { entities { name guid entityType alertSeverity } } } } }\"}" \
| python3 -m json.tool
curl -s -X POST https://api.newrelic.com/graphql \
-H 'Content-Type: application/json' \
-H "API-Key: $NEW_RELIC_API_KEY" \
-d '{"query": "{ actor { entity(guid: \"ENTITY_GUID_HERE\") { name entityType alertSeverity ... on ApmApplicationEntityOutline { apmSummary { errorRate apdexScore webResponseTimeAverage responseTimeAverage throughput hostCount instanceCount } } } } }"}' \
| python3 -m json.tool
Via REST v2 (simpler):
curl -s -X GET 'https://api.newrelic.com/v2/alerts_violations.json?only_open=true' \
-H "Api-Key: $NEW_RELIC_API_KEY" \
| python3 -m json.tool
Via NRQL (more flexible):
curl -s -X POST https://api.newrelic.com/graphql \
-H 'Content-Type: application/json' \
-H "API-Key: $NEW_RELIC_API_KEY" \
-d "{\"query\": \"{ actor { account(id: $NEW_RELIC_ACCOUNT_ID) { nrql(query: \\\"SELECT * FROM NrAiIncident WHERE event = 'open' SINCE 1 day ago LIMIT 50\\\") { results } } } }\"}" \
| python3 -m json.tool
curl -s -X POST https://api.newrelic.com/graphql \
-H 'Content-Type: application/json' \
-H "API-Key: $NEW_RELIC_API_KEY" \
-d "{\"query\": \"{ actor { account(id: $NEW_RELIC_ACCOUNT_ID) { nrql(query: \\\"SELECT * FROM TransactionError SINCE 1 hour ago LIMIT 20\\\") { results } } } }\"}" \
| python3 -m json.tool
Useful error queries:
SELECT rate(count(*), 1 minute) FROM TransactionError FACET appName SINCE 30 minutes agoSELECT count(*) FROM TransactionError FACET error.message SINCE 1 hour agoSELECT rate(count(*), 1 minute) FROM TransactionError TIMESERIES SINCE 1 hour agocurl -s -X GET "https://api.newrelic.com/v2/applications/APP_ID/deployments.json" \
-H "Api-Key: $NEW_RELIC_API_KEY" \
| python3 -m json.tool
To get APP_ID, first list entities (operation 2) with domain APM.
curl -s -X POST https://api.newrelic.com/graphql \
-H 'Content-Type: application/json' \
-H "API-Key: $NEW_RELIC_API_KEY" \
-d '{"query": "mutation { changeTrackingCreateDeployment(deployment: { version: \"VERSION\", entityGuid: \"ENTITY_GUID\", description: \"DESCRIPTION\", user: \"USER\" }) { deploymentId entityGuid } }"}' \
| python3 -m json.tool
First find the dashboard GUID (operation 2 with domain VIZ), then:
curl -s -X POST https://api.newrelic.com/graphql \
-H 'Content-Type: application/json' \
-H "API-Key: $NEW_RELIC_API_KEY" \
-d '{"query": "{ actor { entity(guid: \"DASHBOARD_GUID\") { ... on DashboardEntity { name description pages { name widgets { title rawConfiguration } } } } } }"}' \
| python3 -m json.tool
curl -s -X GET 'https://api.newrelic.com/v2/applications.json' \
-H "Api-Key: $NEW_RELIC_API_KEY" \
| python3 -m json.tool
curl -s -X POST https://api.newrelic.com/graphql \
-H 'Content-Type: application/json' \
-H "API-Key: $NEW_RELIC_API_KEY" \
-d "{\"query\": \"{ actor { account(id: $NEW_RELIC_ACCOUNT_ID) { nrql(query: \\\"SELECT average(cpuPercent), average(memoryUsedPercent), average(diskUsedPercent) FROM SystemSample FACET hostname SINCE 1 hour ago\\\") { results } } } }\"}" \
| python3 -m json.tool
curl -s -X GET 'https://api.newrelic.com/v2/alerts_policies.json' \
-H "Api-Key: $NEW_RELIC_API_KEY" \
| python3 -m json.tool
curl -s -X POST https://api.newrelic.com/graphql \
-H 'Content-Type: application/json' \
-H "API-Key: $NEW_RELIC_API_KEY" \
-d "{\"query\": \"{ actor { account(id: $NEW_RELIC_ACCOUNT_ID) { nrql(query: \\\"SELECT * FROM Log WHERE level = 'ERROR' SINCE 1 hour ago LIMIT 50\\\") { results } } } }\"}" \
| python3 -m json.tool
SELECT average(duration) FROM Transaction FACET name ORDER BY average(duration) DESC LIMIT 10 SINCE 1 hour agoSELECT percentile(duration, 95) FROM Transaction FACET name SINCE 1 hour agoSELECT rate(count(*), 1 minute) FROM Transaction TIMESERIES SINCE 1 hour agoSELECT average(duration) FROM Transaction SINCE 1 hour ago COMPARE WITH 1 day agoSELECT rate(count(*), 1 minute) FROM TransactionError TIMESERIES SINCE 1 hour agoSELECT count(*) FROM TransactionError FACET error.message LIMIT 20 SINCE 1 hour agoSELECT count(*) FROM TransactionError FACET request.uri SINCE 1 hour agoSELECT percentage(count(*), WHERE error IS TRUE) FROM Transaction FACET name SINCE 1 hour ago| python3 -m json.tool for readable formatting| python3 -c "import sys,json; d=json.load(sys.stdin); print(json.dumps(d.get('data',{}).get('actor',{}).get('account',{}).get('nrql',{}).get('results',[]), indent=2))"
| Error | Cause | Fix |
|---|---|---|
| 401 Unauthorized | Invalid or expired API key | Check NEW_RELIC_API_KEY |
| 403 Forbidden | Key lacks permissions | User needs admin or appropriate role |
| GraphQL errors in response | Bad NRQL or invalid account ID | Check errors field, fix query syntax |
| Empty results | No data in time range | Widen time range with SINCE |
| Connection refused | Network issue | Check connectivity to api.newrelic.com |
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Searches MemPalace before answering questions about past work, people, projects, or prior decisions. Returns verbatim stored content instead of guessing from model memory.
npx claudepluginhub ivlad003/plugins --plugin newrelic-observability