enhancementgood first issueintegrationnew-featurenew-integration
Métriques du dépôt
- Stars
- (1 930 étoiles)
- Métriques de merge PR
- (Merge moyen 3h 2m) (10 PRs mergées en 30 j)
Description
Description
Add New Relic integration to sync observability data, alerts, incidents, deployments, and application performance metrics into CORE.
Reference Implementations
Existing Integrations (use as templates)
integrations/github/- Developer tooling with event trackingintegrations/linear/- Issue/incident management patternsintegrations/slack/- For reference
Required Files Structure
integrations/new-relic/
├── src/
│ ├── index.ts # Main entry, API spec
│ ├── schedule.ts # Sync logic
│ ├── utils.ts # New Relic API utilities
│ ├── account-create.ts # Auth setup
│ └── create-activity.ts # Activity formatting
├── package.json
├── tsup.config.ts
└── README.md
New Relic API Integration
OAuth Setup
- Use API Key authentication (User Key)
- New Relic provides multiple key types:
- User API Key: Primary key for NerdGraph and REST API access (header:
Api-Key) - License Key: For sending telemetry data (ingest only)
- Browser Key: For browser monitoring
- User API Key: Primary key for NerdGraph and REST API access (header:
- Primary API: NerdGraph (GraphQL) -
https://api.newrelic.com/graphql - Legacy REST API v2:
https://api.newrelic.com/v2/(being deprecated in favor of NerdGraph) - EU datacenter:
https://api.eu.newrelic.com/graphql - Note: REST API Keys are being retired; use User API Keys instead
Key Endpoints
NerdGraph (GraphQL) - Preferred
POST /graphql- Single endpoint for all queries and mutations- Query
actor.account.nrql- Run NRQL queries - Query
actor.entitySearch- Search monitored entities - Query
actor.account.alerts.policiesSearch- List alert policies - Query
actor.account.alerts.nrqlConditionsSearch- List alert conditions - Mutation
alertsNotificationChannelCreate- Create notification channels - Query
actor.account.aiIssues.issues- List AI-detected issues - Mutation
changeTrackingCreateDeployment- Record deployments
- Query
REST API v2 (Legacy)
GET /v2/applications.json- List applicationsGET /v2/applications/{id}.json- Get application detailsGET /v2/applications/{id}/metrics.json- Get application metricsGET /v2/alerts_events.json- List alert eventsGET /v2/alerts_violations.json- List alert violationsGET /v2/deployments.json- List deployments
Events to Track
-
Alerts & Incidents
- Alert conditions triggered
- Incident opened, acknowledged, closed
- Alert policy changes
- Notification channel activity
- AI-powered issue detection
-
Deployments & Changes
- Deployment markers recorded
- Change tracking events
- Application version updates
- Configuration changes
-
Performance & Observability
- Application error rate spikes
- Response time anomalies
- Throughput changes
- SLA/SLO breaches
- Infrastructure alerts
Implementation Tasks
- Set up basic integration structure following
integrations/github/src/index.tspattern - Implement User API Key authentication in
account-create.ts - Create New Relic NerdGraph (GraphQL) utilities in
utils.ts - Implement sync logic in
schedule.tsusing NerdGraph queries - Convert New Relic events to CORE activity format
- Add error handling and rate limiting
- Create integration documentation
- Add to
integrations/README.md
Technical Notes
- NerdGraph (GraphQL) is the preferred API. The REST API v2 is legacy and being gradually replaced.
- NerdGraph uses a single endpoint (
https://api.newrelic.com/graphql) with GraphQL queries/mutations. - Authentication uses the
Api-Keyheader with a User API Key. - NRQL (New Relic Query Language) can be executed via NerdGraph for custom metric queries.
- Rate limits: NerdGraph has a limit of 25 concurrent requests per user. REST API has varying limits per endpoint.
- New Relic has separate US and EU datacenters; the integration must support both regions.
- The NerdGraph API Explorer is available at
https://api.newrelic.com/graphiqlfor testing queries. - Consider using
@newrelic/newrelic-telemetry-sdkfor sending custom events. - REST API Keys are being retired; ensure the integration uses User API Keys.
- Data access control can be managed through NerdGraph for teams and roles.
Resources
- Introduction to New Relic APIs
- NerdGraph API Explorer
- New Relic REST API v2
- New Relic Documentation
- New Relic NRQL Reference
- What's New in New Relic
Labels
enhancement, integration, new-feature