• /
  • EnglishEspañol日本語한국어Português
  • 로그인지금 시작하기

Use arrays for organization

As part of our support for the OpenTelemetry Protocol (OTLP), New Relic can process attributes containing arrays. But what are arrays? Essentially, arrays are data structures containing an ordered collection of values that you can query with NRQL. Typically, arrays display in a format like [1, 2, 3, 4, 5] or ["US", "CA", "UK"].

Currently, we only support simple, single-dimension arrays. You can use simple arrays to store a list of values of the same primitive type; for example, numeric, boolean, or string. To quickly verify that an array contains any data, you can use the JSON chart type to see if the data displays in an array structure.

Supported features

  • The FACET clause supports array attributes.
  • You can run the functions getfield(), length(), and contains() on arrays.
  • You can also use the uniques(), uniqueCount(), and latest() aggregator functions.
  • Arrays can contain up to 64 elements.

Unsupported features

  • Comparison operators such as =, !=, and IN aren't supported with arrays.
  • You can't aggregate arrays with other aggregator functions, such as sum(), min(), max(), etc.
  • Arrays can't contain other arrays, such as ["UK", "US", ["CA", "OR", "ATL"]].
  • Arrays can't contain NULL.

Array functions and examples

Copyright © 2024 New Relic Inc.

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