> This page is for version Latest (default).
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/fleet-intel/latest/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/fleet-intel/llms.txt.

# Get aggregated metrics with time series for any aggregation level

GET /v2/metrics

Returns historical chart data for customer, node group, compute zone, or node level. The service selects the appropriate query path for each metric and aggregation level. Aggregation functions are determined by metric configuration in base-config.yaml.

Reference: https://docs.nvidia.com/fleet-intel/api-explorer/v-2-metrics/get-v-2-metrics

## Request

### Query parameters

- `groupBy` (enum, required) — The aggregation level to group metrics by
  - Allowed values: `customer`, `nodegroup`, `computezone`, `node`
- `groupId` (string, optional) — Entity ID for node, nodegroup, or computezone queries.
- `groupName` (string, optional) — Legacy generic entity name. Prefer nodeGroupName for nodegroup and computeZoneName for computezone.
- `nodeGroupName` (string, optional) — The node group name for nodegroup level when computeZoneId or computeZoneName is also provided.
- `computeZoneId` (string, optional) — The compute zone ID disambiguator when querying nodegroup by name.
- `computeZoneName` (string, optional) — The compute zone name for computezone level, or disambiguator with nodeGroupName.
- `metricNames` (list of string, required) — Comma-separated list of metric names to query (e.g., dcgm_fi_dev_gpu_util,cpu_used_percent,memory_used_percent)
- `startTime` (string, optional) — Start time in RFC3339 format (required for absolute mode, e.g., 2024-01-01T00:00:00Z)
- `endTime` (string, optional) — End time in RFC3339 format (required for absolute mode, e.g., 2024-01-01T01:00:00Z)
- `timeMode` (enum, optional) — Time mode for range selection. Defaults to absolute.
  - Allowed values: `absolute`, `relative`
- `window` (string, optional) — Relative duration window (required for relative mode). Uses Go duration syntax — valid units: h, m, s (e.g. 24h, 1h30m, 90m). 'd' is not supported; use hours instead (e.g. 168h for 7 days)
- `step` (string, required) — Query resolution step width in duration format (e.g., 1m, 5m, 1h). Minimum step width is 1 minute.

## Response

### 200

Metrics with time series for the requested aggregation level

- `metrics` (list of models.MetricTimeSeries, optional)
- `step` (string, optional) — Query resolution step width from request
- `timeRange` (models.TimeRange, optional)

## Errors

### 499 Client Closed Request Error

Client Closed Request - request was canceled by the client

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

## Types

### models.MetricTimeSeries

- `unavailable` (models.MetricUnavailable, required) — Unavailable is set for node-level queries when the metric does not apply to the node at all, so the caller can hide the chart rather than draw an empty one. Null whenever the metric does apply, including when it simply has no data in the window. Always null for aggregated levels, where sensor presence is not a single answer across the group.
- `warning` (models.MetricQueryWarning, required) — e.g. omitted invalid metric points; null when no issues
- `aggregation` (enum, optional)
  - Allowed values: `average`, `sum`, `min`, `max`, `none`
- `displayName` (string, optional)
- `emptyStateMessage` (string, optional)
- `falseLabel` (string, optional) — FalseLabel is the human-readable label for value 0 in boolean/count-as-bool metrics. Omitted for non-boolean metrics.
- `name` (string, optional)
- `result` (list of models.MetricSeriesData, optional) — Array of series data (1 for aggregated, multiple for node-level)
- `trueLabel` (string, optional) — TrueLabel is the human-readable label for value 1 in boolean/count-as-bool metrics. Omitted for non-boolean metrics.
- `unit` (enum, optional)
  - Allowed values: `MHz`, `count`, `°C`, `°F`, `celsius`, `watts`, `boolean`, `MB`, `ratio`, `MB/s`, `ber`, `nanoseconds`, `ms`, `seconds`, `s`, `bytes`, `bytes/s`, `millijoules`, `load`, `cores`, `percent`, `rpm`, `volts`

### models.TimeRange

- `end` (datetime, optional)
- `start` (datetime, optional)

### models.KASRequestStatus

RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

- `requestId` (string, optional) — Request ID for tracing
- `statusCode` (string, optional) — Status code from KAS
- `statusDescription` (string, optional) — Status description from KAS

### models.MetricUnavailable

Unavailable is set for node-level queries when the metric does not apply to the node at all, so the caller can hide the chart rather than draw an empty one. Null whenever the metric does apply, including when it simply has no data in the window. Always null for aggregated levels, where sensor presence is not a single answer across the group.

- `code` (string, optional)
- `message` (string, optional)

### models.MetricQueryWarning

e.g. omitted invalid metric points; null when no issues

- `code` (string, optional)
- `message` (string, optional)

### models.MetricSeriesData

- `displayLabel` (string, optional) — DisplayLabel is the preferred label value for UI display (e.g., GPU index for DCGM metrics). Derived from the "gpu" key if present, otherwise falls back to "gpu_uuid". Omitted for aggregated levels where labels are not present.
- `label` (map from string to string, optional) — Label contains identifying information (e.g., GPU UUID) for node-level queries. Omitted for aggregated levels (customer/nodegroup/computezone). Typical keys: "gpu" (GPU index), "uuid" (GPU UUID).
- `values` (string, optional) — Values is a 2D array where each inner array contains [unix_timestamp, metric_value] This follows the Prometheus/Grafana standard format for compatibility The last element in the array represents the most recent/latest value Example: [[1705276800, 0.723], [1705277100, 0.741]] NOTE: swaggertype:"string" is a workaround for swag limitations with nested arrays

## Examples

**Response**

```json
{
  "metrics": [
    {
      "unavailable": {
        "code": "sensorNotPresent",
        "message": "This node does not report the sensors for this metric."
      },
      "warning": {
        "code": "invalidMetricValues",
        "message": "1 data point(s) had invalid values and were omitted."
      },
      "aggregation": "average",
      "displayName": "GPU Utilization",
      "emptyStateMessage": "No error detected",
      "falseLabel": "Down",
      "name": "dcgm_fi_dev_gpu_util",
      "result": [
        {
          "displayLabel": "GPU 0",
          "label": {},
          "values": "[[1705276800, 0.723], [1705277100, 0.741]]"
        }
      ],
      "trueLabel": "Up",
      "unit": "ratio"
    }
  ],
  "step": "5m",
  "timeRange": {
    "end": "2024-01-01T01:00:00Z",
    "start": "2024-01-01T00:00:00Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/v2/metrics"

querystring = {"computeZoneId":"550e8400-e29b-41d4-a716-446655440000","computeZoneName":"training-computezone","groupBy":"nodegroup","groupId":"550e8400-e29b-41d4-a716-446655440000","groupName":"training-nodegroup","metricNames":"[\"dcgm_fi_dev_gpu_util,cpu_used_percent\"]","nodeGroupName":"training-nodegroup","step":"5m","window":"24h"}

response = requests.get(url, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.example.com/v2/metrics?computeZoneId=550e8400-e29b-41d4-a716-446655440000&computeZoneName=training-computezone&groupBy=nodegroup&groupId=550e8400-e29b-41d4-a716-446655440000&groupName=training-nodegroup&metricNames=%5B%22dcgm_fi_dev_gpu_util%2Ccpu_used_percent%22%5D&nodeGroupName=training-nodegroup&step=5m&window=24h';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v2/metrics?computeZoneId=550e8400-e29b-41d4-a716-446655440000&computeZoneName=training-computezone&groupBy=nodegroup&groupId=550e8400-e29b-41d4-a716-446655440000&groupName=training-nodegroup&metricNames=%5B%22dcgm_fi_dev_gpu_util%2Ccpu_used_percent%22%5D&nodeGroupName=training-nodegroup&step=5m&window=24h"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v2/metrics?computeZoneId=550e8400-e29b-41d4-a716-446655440000&computeZoneName=training-computezone&groupBy=nodegroup&groupId=550e8400-e29b-41d4-a716-446655440000&groupName=training-nodegroup&metricNames=%5B%22dcgm_fi_dev_gpu_util%2Ccpu_used_percent%22%5D&nodeGroupName=training-nodegroup&step=5m&window=24h")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.example.com/v2/metrics?computeZoneId=550e8400-e29b-41d4-a716-446655440000&computeZoneName=training-computezone&groupBy=nodegroup&groupId=550e8400-e29b-41d4-a716-446655440000&groupName=training-nodegroup&metricNames=%5B%22dcgm_fi_dev_gpu_util%2Ccpu_used_percent%22%5D&nodeGroupName=training-nodegroup&step=5m&window=24h")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/v2/metrics?computeZoneId=550e8400-e29b-41d4-a716-446655440000&computeZoneName=training-computezone&groupBy=nodegroup&groupId=550e8400-e29b-41d4-a716-446655440000&groupName=training-nodegroup&metricNames=%5B%22dcgm_fi_dev_gpu_util%2Ccpu_used_percent%22%5D&nodeGroupName=training-nodegroup&step=5m&window=24h');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/v2/metrics?computeZoneId=550e8400-e29b-41d4-a716-446655440000&computeZoneName=training-computezone&groupBy=nodegroup&groupId=550e8400-e29b-41d4-a716-446655440000&groupName=training-nodegroup&metricNames=%5B%22dcgm_fi_dev_gpu_util%2Ccpu_used_percent%22%5D&nodeGroupName=training-nodegroup&step=5m&window=24h");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v2/metrics?computeZoneId=550e8400-e29b-41d4-a716-446655440000&computeZoneName=training-computezone&groupBy=nodegroup&groupId=550e8400-e29b-41d4-a716-446655440000&groupName=training-nodegroup&metricNames=%5B%22dcgm_fi_dev_gpu_util%2Ccpu_used_percent%22%5D&nodeGroupName=training-nodegroup&step=5m&window=24h")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```