> For the complete documentation index, see [llms.txt](https://paperspace.gitbook.io/gradient/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://paperspace.gitbook.io/gradient/data/metrics-overview/quering-metrics.md).

# View & Query Metrics

How to query and view metrics in GUI and CLI

## Notebooks, Experiments & Deployment Metrics

{% tabs %}
{% tab title="Web GUI" %}

### Deployments

{% hint style="warning" %}
Deployment metrics are a Gradient Private Cluster feature. [Contact Sales](https://info.paperspace.com/contact-sales) for inquiries!
{% endhint %}

To view Deployment metrics, navigate to the Metrics tab of the individual deployment.

![](https://3486137344-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-MDRQOga6AlawVWT-ozy%2F-MDR_o8gGSDqpGg1WYqq%2Fimage.png?alt=media\&token=f9ba4c19-7116-42fb-a164-4c47a4d72f85)

### Notebooks

{% hint style="warning" %}
Notebook metrics are a Gradient Private Cluster feature. [Contact Sales](https://info.paperspace.com/contact-sales) for inquiries!
{% endhint %}

To view Notebook metrics, you will see a minimal version in the Notebook header and you can also open a more robust display with detailed information. &#x20;

![Detailed view](https://3486137344-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-MDRQOga6AlawVWT-ozy%2F-MDRazRP8In-2IST3B5U%2Fimage.png?alt=media\&token=2ef8b54b-2a18-4aea-a4fc-dd1d4a8d84c7)

![Collapsed view in Notebook header](https://3486137344-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-MDIOFDjz6ptMEEQodZJ%2F-MDIYVy_2hxA-ugivIY3%2F81246457-8a067200-8fcc-11ea-81c9-94fb4dea1eee.jpg?alt=media\&token=ac1885a0-a65f-4495-9682-1a295fbe803e)

### Workflows

Coming soon!
{% endtab %}

{% tab title="CLI" %}
To query the metrics for a given workload using the CLI, here's an example using Experiments (the Deployments and Notebooks syntax are the same).

```
Usage: gradient experiments metrics [OPTIONS] COMMAND [ARGS]...

  Read experiment metrics

Options:
  --help  Show this message and exit.

Commands:
  get     Get experiment metrics
  stream  Watch live experiment metrics
  
```

### Get a single value for a given metric:

#### **Syntax**

```bash
gradient experiments metrics get --id <experiment id> 
```

#### **Parameters**

```bash
Usage: gradient experiments metrics get [OPTIONS]

  Get experiment metrics. Shows CPU and RAM usage by default

Options:
  --id TEXT                       ID of the experiment  [required]
  --metric [cpuPercentage|memoryUsage|gpuMemoryFree|gpuMemoryUsed|gpuPowerDraw|gpuTemp|gpuUtilization|gpuMemoryUtilization]
                                  One or more metrics that you want to read.
                                  Defaults to cpuPercentage and memoryUsage
  --interval TEXT                 Interval
  --start [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
                                  Timestamp of first time series metric to
                                  collect
  --end [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
                                  Timestamp of last time series metric to
                                  collect
  --apiKey TEXT                   API key to use this time only
  --optionsFile PATH              Path to YAML file with predefined options
  --createOptionsFile PATH        Generate template options file
  --help                          Show this message and exit.
  
```

#### **Example command to get CPU usage in %:**

```bash
gradient experiments metrics get --id <experiment id> --metric cpuPercentage 
```

### Stream metrics:

#### Syntax

```bash
gradient experiments metrics stream --id <experiment id>
```

#### **Parameters**

```bash
Usage: gradient experiments metrics stream [OPTIONS]

  Get experiment metrics. Shows CPU and RAM usage by default

Options:
  --id TEXT                       ID of the experiment  [required]
  --metric [cpuPercentage|memoryUsage|gpuMemoryFree|gpuMemoryUsed|gpuPowerDraw|gpuTemp|gpuUtilization|gpuMemoryUtilization]
                                  One or more metrics that you want to read.
                                  Defaults to cpuPercentage and memoryUsage
  --interval TEXT                 Interval
  --start [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
                                  Timestamp of first time series metric to
                                  collect
  --end [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
                                  Timestamp of last time series metric to
                                  collect
  --apiKey TEXT                   API key to use this time only
  --optionsFile PATH              Path to YAML file with predefined options
  --createOptionsFile PATH        Generate template options file
  --help                          Show this message and exit.
```

{% endtab %}
{% endtabs %}
