New Relic · Schema

MetricDataObject

A container for a batch of metrics with optional shared attributes

AnalysisAnalyticsAPMDevOpsInfrastructureMonitoringObservabilityPerformancePlatform

Properties

Name Type Description
common object Shared attributes applied to all metrics in this data object unless overridden at the metric level
metrics array Array of individual metric data points
View JSON Schema on GitHub

JSON Schema

new-relic-metric-metric-data-object-schema.json Raw ↑
{
  "type": "object",
  "description": "A container for a batch of metrics with optional shared attributes",
  "properties": {
    "common": {
      "type": "object",
      "description": "Shared attributes applied to all metrics in this data object unless overridden at the metric level",
      "properties": {
        "timestamp": {
          "type": "integer",
          "description": "Unix timestamp in milliseconds for all metrics in this batch",
          "example": 1718153645993
        },
        "interval.ms": {
          "type": "integer",
          "description": "Default measurement interval in milliseconds for count and summary metrics",
          "example": 100
        },
        "attributes": {
          "type": "object",
          "description": "Key-value pairs applied to all metrics in the batch. Values can be strings, numbers, or booleans.",
          "example": {
            "customAttribute": "example_value"
          }
        }
      }
    },
    "metrics": {
      "type": "array",
      "description": "Array of individual metric data points",
      "example": [
        {
          "name": "example-resource-01",
          "type": "gauge",
          "value": 42.5,
          "timestamp": 1718153645993,
          "interval.ms": 100,
          "attributes": {
            "customAttribute": "example_value"
          }
        }
      ],
      "items": {
        "type": "object",
        "description": "A single metric data point",
        "properties": {
          "name": {
            "type": "string",
            "description": "The metric name (e.g., cpu.usage.percent)",
            "example": "example-resource-01"
          },
          "type": {
            "type": "string",
            "description": "The metric type",
            "example": "gauge",
            "enum": [
              "gauge",
              "count",
              "summary"
            ]
          },
          "value": {
            "type": "object",
            "description": "The metric value. For gauge and count, a number. For summary, an object with count, sum, min, and max fields.",
            "example": 42.5
          },
          "timestamp": {
            "type": "integer",
            "description": "Unix timestamp in milliseconds. Overrides the common timestamp for this metric.",
            "example": 1718153645993
          },
          "interval.ms": {
            "type": "integer",
            "description": "Measurement interval in milliseconds. Required for count and summary types.",
            "example": 100
          },
          "attributes": {
            "type": "object",
            "description": "Additional key-value attributes for this metric point",
            "example": {
              "customAttribute": "example_value"
            }
          }
        },
        "required": [
          "name",
          "type",
          "value"
        ]
      }
    }
  },
  "required": [
    "metrics"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "MetricDataObject"
}