Data collection: Metric timeslice and event data

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:

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:

APM Browser Infrastructure Mobile Plugins Servers Synthetics
Metrics fa-check fa-check fa-check fa-check fa-check
Events fa-check fa-check fa-check fa-check fa-check

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
Metrics fa-check fa-check fa-check fa-check
Events fa-check fa-check fa-check

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
Metrics fa-check fa-check
Events fa-check fa-check fa-check
* 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

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.

crop-metric-timeslice-and-event-charts.png
rpm.newrelic.com/apm > (select an app) > Overview: The Web transactions response time chart (left) uses metric timeslice data. The Web transactions histogram chart (right) uses event data.

For more help

Recommendations for learning more: