After setting up change tracking and viewing your changes in the New Relic UI, you can create custom queries to analyze change patterns, build dashboards, and set up automated reporting. This page shows you how to query change tracking data using NRQL and NerdGraph.
New Relic provides both NRQL and NerdGraph as to query change tracking data, each suited for different use cases.
Use NRQL for change tracking
Use NRQL to:
- Create dashboards: Build custom charts and visualizations for ongoing monitoring.
- Analyze time-series data: Correlate changes with performance metrics over time.
- Set up alerts: Create alert conditions based on change patterns.
- Perform statistical analysis: Calculate averages, percentages, and trends.
The following data sources are available for NRQL queries:
ChangeTrackingEvent: Events created using the newchangeTrackingCreateEventmutation.Deployment: Legacy deployment events created usingchangeTrackingCreateDeploymentas well as our legacy REST APIs.
Dica
If you want to query your deployments for both change tracking events and legacy deployments, you can use following NRQL query patterns:
FROM ChangeTrackingEvent, Deployment SELECT eventType(), deploymentId or changeTrackingId AS 'id', *WHERE (eventType() = 'Deployment' OR (eventType() = 'ChangeTrackingEvent' AND category = 'Deployment'))AND entity.name = '<your_service_name>'NRQL query examples
Use these examples in the query builder or when creating dashboards and alerts.
Dica
For complete attribute definitions, see our data dictionary.
Use NerdGraph for change tracking
Use NerdGraph when you want to:
- Programmatic access: Integrate change data into external tools and workflows.
- Cross-account queries: Retrieve data from multiple New Relic accounts.
- Real-time applications: Build applications that need live change data.
- Bulk data export: Extract large datasets for analysis in external systems.
The NerdGraph API offers several advantages for querying change tracking data:
- Access to related entity information
- Advanced filtering capabilities
- Cross-account data aggregation
- Real-time API responses
NerdGraph query examples
Use these examples in the NerdGraph explorer or in your applications.
NerdGraph optimization tips
- Request only needed fields: Specify only the fields you actually need
- Use appropriate filters: Apply filters server-side rather than client-side
- Batch related queries: Combine related queries in a single request
- Implement pagination: Use limit and cursor-based pagination for large datasets
Data retention and limits
Understanding data constraints helps you plan your analysis approach:
Data type | Retention |
|---|---|
Change events | 13-month retention period |
Chart markers | Up to 5,000 events per chart |
Change tracking tables | 1,000 events loaded by default |
Custom trend boards | Maximum of 3 per change |
Comparison views | Up to 5 stacked change comparisons |