Segmentation allows you to facet on bucket functions to more effectively break out your data in New Relic Insights. You can group your NRQL query on numerical values into buckets that cover a range.
Create segmented NRQL query
To return segmented results, use the
FACET clause to segment a
buckets function in a NRQL query.
SELECT function(attribute) FROM source FACET buckets(attributes)
Segmenting can be used with any attribute that is stored as a numerical value in the New Relic Insights event database.
To create a chart showing total page load times segmented into ranges:
- Create a NRQL statement with a select statement for an attribute; for example,
- Add a
FACETclause that facets on buckets for the same attribute; for example,
This query segments the average durations into 5 buckets, with an upper limit of 10. All values above 10 are grouped in our last bucket, “>=8.0”.
SELECT average(duration) FROM PageView SINCE 1 day ago FACET buckets(duration,10,5)
This query returns the following results in Insights: