• /
  • Log in
  • Free account

Metric data structure

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

This document describes the structure of our dimensional metric data, aka the Metric data type. To learn about how to query this type of data, see Query metrics.

Metric types

The metric type determines how the data is aggregated over longer time windows. It also determines which functions you can use to query the data.

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) . . .

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.

Create issueEdit page
Copyright © 2022 New Relic Inc.