Example Insights queries of distributed trace data

New Relic's distributed tracing feature generates both Spanevents and Transaction events. You can use New Relic Insights to create NRQL queries of this data and create custom Insights dashboards to display your data.

Example Insights queries

Some example Insights NRQL queries:

Datastore time percentile for an app
SELECT percentile(duration, 50, 95) from Span where category = 'datastore' and appName = 'YOUR_APP_NAME' since 4 hours ago TIMESERIES 1 minute
Datastore query time for an app, faceted by host
SELECT average(duration) from Span where appName = 'YOUR_APP_NAME' and category = 'datastore' facet host TIMESERIES 1 minute
Average duration for a method of a service, faceted by host
SELECT average(duration) from Span where appName = 'YOUR_APP_NAME' and name = 'FUNCTION_NAME' facet host TIMESERIES 1 minute
Histogram of external services called by a service, faceted by external URI
SELECT histogram(duration, 10, 60) from Span where category = 'http' and appName = 'YOUR_APP_NAME' facet `http.url` since 4 hours ago
Average duration for external calls across all applications
SELECT average(duration) from Span where category = 'http' since 4 hours ago facet `http.url` timeseries 1 minute

For more help

Recommendations for learning more: