New Relic products collect two main types of data: metric timeslice data and event data. The New Relic user interface displays whichever data type is most useful for your task. However, the data type can matter when you are sending custom data to New Relic, or when you want to extract data from New Relic via an API.
This document explains which tasks each data type is most suitable for, how to report custom data for each data type, and how to retrieve that data via the New Relic UI or APIs.
Overview: Metric timeslice data and event data
Metric timeslice data is generally used for timeseries performance data. New Relic agents can collect thousands of metric timeslices per minute across a variety of performance metrics. For example, measuring error rate, bandwidth usage, or garbage collection time.
Event data is useful when you need to filter data based on arbitrary characteristics (such as with NRQL, error analytics, or histograms). New Relic agents collect numerous events with detailed attributes attached to each event. For example, individual browser page loads, Synthetics monitor runs, or shopping cart checkout transactions.
View or customize your data
These tables describe which products collect which data, where you can access that data via the New Relic user interface or APIs, and how you can customize each data type with your own data:
Data type by product
This table describes which New Relic products report which data types. Use this table together with Access your data via UI or API to determine how to extract data from New Relic:
Access your data via UI or API
The user interface for each New Relic product presents the appropriate data type. This table describes how you can view data of each type with various advanced New Relic features:
|User Interface||REST API||Query API||Metric Explorer||Event Explorer||Legacy Dashboards|
How to customize each data type
You can send custom data to New Relic in a variety of ways:
|Custom Attributes||Custom Events||Custom Instrumentation *||Custom Metrics|
|Usage||Add metadata to existing events||Create event data||Improve your app's instrumentation||Create metric timeslice data|
|* Custom instrumentation that creates a new transaction collects both metric and event data. Custom instrumentation for already instrumented transactions collects only metric timeslice data.|
Metric timeslice data
A metric timeslice is a statistical measure that consists of three parts: A metric name, associated numeric values, and a segment of time (a "timeslice") associated with those data points. For example, the APM metric for time spent in a particular transaction is named
WebTransaction/URI/foo, and might have a response time of
0.793 for the one minute timeslice from 10:20 A.M. to 10:21 A.M.
Over time, New Relic aggregates metric timeslice data based on a retention schedule. In general, metric timeslice data is retained longer than event data. Metric timeslice data is best-suited for performance data, since it has longer retention periods but is limited to a name and its associated numeric values.
Metric timeslice data is used throughout the New Relic UI, and can be explored with the Insights Metric Explorer and queried with the REST API. You can also send arbitrary metrics to New Relic with custom metrics, or collect more detailed performance metrics from your application with custom instrumentation.
Event data is a record of a single event at a particular moment in time. An event consists of core attributes such as a timestamp and an event type, and can be annotated with many additional attributes to provide more context. For example, New Relic Browser captures detailed events from each page view in an end user browser such as the city, device type, rendering time, page URL, and many more. Event data is not aggregrated over time.
Because each event is a separate record, you can query event data with specific questions such as "How many users in Chicago experienced a load time of greater than 1 second yesterday?" In general, event data has shorter retention periods than metric timeslice data, but you can extend event data retention with Insights Pro.
Event data is used in the New Relic UI for filtered pages like error analytics, and can be explored with the Insights Event Explorer and queried with the Query API. You can create your own custom events via the Insights API (with an Insights subscription), or via the APM, Browser, or iOS and Android agents. Or, add metadata to existing events with custom attributes. New Relic also collects event data from new transactions instrumented with custom instrumentation (but not when adding detail to an already instrumented transaction).
Data types and the New Relic UI
The New Relic user interface uses both timeslice data and event data to generate charts. For example, the Web transactions response time chart uses metric timeslice data to graph response time over time. However, since creating a histogram requires grouping individual requests rather than minutely timeslices, the Web transactions histogram chart uses event data.