• Log inStart now

Metric data structure

The New Relic platform reports four main telemetry data types: metrics, events, logs, and traces.

This doc will help you understand some details about the structure of our Metric data type. This data type is also referred to as "dimensional metrics." For a high level explanation of this data type, see Metric data type. And for how to query this type of data, see Query metrics.

Better understanding the details of the Metric structure will help you understand what you see in New Relic, and help you create custom queries and charts of your data. The more you use advanced New Relic features, like reporting custom metrics and creating custom charts, the more this knowledge will come in handy.

Metric types

The metric type determines how the data is aggregated over longer time windows and determines what fields and functions are available to analyze and query.

Metric types

Description

Available query functions

count

Measures the number of occurrences of an event. The count should be reset to 0 every time the metric is reported. Examples include cache hits per reporting interval and the number of threads created per reporting interval.

You must specify a value for interval.ms when reporting the count metric type using the Metric API.

The value must be a positive double.

Generally, you want to take the rate of the sum:

From Metric select rate(sum(myMetric), 1 minute) . . .

cumulativeCount

Equivalent to the count type described above, but in addition this gives access to cumulative metric fields. This feature is currently in preview. For more on this, see Cumulative metrics.

Important

The cumulative value can make this slightly larger than a typical count, and therefore can add to data ingest.

distribution

Tracks the statistical distribution on a numeric attribute. This metric is re-aggregatable. For example, 1-minute data points from 60 minutes can be aggregated into a 1-hour data point, without degradation on accuracy.

This type:

  • Supports statistical functions like percentile and histogram, and all functions supported by the summary type.
  • Uses the same algorithm as the percentile function.
  • percentile
  • histogram
  • min
  • max
  • sum
  • count
  • average

gauge

Represents a value that can increase or decrease with time. Examples of gauges include the temperature, CPU usage, and memory.

For example, there is always a temperature, but you are periodically taking the temperature and reporting it.

The value must fit into the range of a Java double.

  • latest
  • min
  • max
  • sum
  • count
  • average

summary

Used to report pre-aggregated data, or information on aggregated discrete events. A summary includes a count, sum value, min value, and max value. The count value must be positive. Examples include transaction count/durations and queue count/ durations.

You must specify a value for interval.ms when reporting the summary metric type using the Metric API.

  • min
  • max
  • sum
  • count
  • average

uniqueCount

Tracks the number of unique values on a string or numeric attribute. This metric is re-aggregatable. For example, 1-minute data points from 60 minutes can be aggregated into a 1-hour data point, without degradation on accuracy.

This type is generated only via the event-to-metrics service.

Copyright © 2023 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.