VS Code extension that exposes New Relic language model tools in Copilot Chat using NerdGraph only.
NerdGraph Constraints
- Graph API entry:
https://api.newrelic.com/graphql
- Auth header:
API-Key with a User key
- Tool implementation uses NerdGraph exclusively (no REST endpoints)
- Runtime config supports
newrelicTools.nerdGraphEndpoint with default https://api.newrelic.com/graphql
Logs and Traces
queryNewRelicLogs
getNewRelicErrorLogs
searchNewRelicLogs
getNewRelicServiceLogs
getNewRelicTrace
listNewRelicLogPartitions
iterateNewRelicPartitionLogs
getNewRelicServicesByErrorCount
Entities
searchNewRelicEntities
getNewRelicEntityRelationships
Dashboards
listNewRelicDashboards
getNewRelicDashboard
Metrics and Reliability
getNewRelicGoldenMetrics
getNewRelicSLOs
getNewRelicTransactionAnomalies
getNewRelicEntityErrors
Configuration
VS Code Settings
newrelicTools.apiKey
newrelicTools.accountId
newrelicTools.nerdGraphEndpoint (default: https://api.newrelic.com/graphql)
newrelicTools.logPartitions
newrelicTools.serviceField
Create .env from .env.example:
cp .env.example .env
Populate:
NEWRELIC_API_KEY=your-user-api-key
NEWRELIC_ACCOUNT_ID=your-account-id
NEWRELIC_NERDGRAPH_ENDPOINT=https://api.newrelic.com/graphql
LOG_PARTITIONS=Log
SERVICE_FIELD=entity.name
Development
npm install
npm run compile
npm run lint
Integration Tests
All test runners generate reports in test-reports as both timestamped and *-latest files.
npm test # full suite, all language model tools
npm run test:logs
npm run test:entities
npm run test:dashboards
npm run test:metrics
Generates monitored environment metadata and NerdGraph surface discovery data into product-monitor-metadata.
npm run metadata:generate
Outputs:
product-monitor-metadata/latest.json
product-monitor-metadata/README.md
- timestamped
metadata-*.json
Project Layout
src/helpers: helper facade for tool operations
src/services: NerdGraph client and domain services
src/tools: language model tools grouped by category
src/utils: config, formatting, NRQL helpers
tests: split integration suites and metadata crawler
test-reports: generated integration test reports
product-monitor-metadata: generated monitored environment metadata
License
MIT
| |