# Exporting PCD Metrics

## Overview

<code class="expression">space.vars.product\_name</code> exposes infrastructure metrics via <code class="expression">page.vars.metric\_name</code> compatible exporters running on each hypervisor host. If you have an existing observability stack, you can consume these metrics directly without replacing the built-in monitoring setup.

This page explains how the metrics pipeline works and the options available for integrating it into your environment. For the full list of available metrics and their labels, see [pcd-metrics-reference](https://docs.platform9.com/private-cloud-director/monitoring-and-observability/monitoring/pcd-metrics-reference "mention").

### How metrics are collected

Metric collection starts automatically when the hypervisor role is assigned to a host. Each host runs two exporters as system services:

* **node-exporter:** Collects host-level metrics such as CPU, memory, disk, and network usage.
* **libvirt-exporter:** Collects VM-level metrics for each virtual machine running on the host.

Each host operates a <code class="expression">page.vars.metric\_name</code> agent as a systemctl service. This agent gathers metrics locally from the node-exporter and libvirt-exporter, both of which are set up as systemctl services. These collected metrics are then sent remotely to a <code class="expression">page.vars.metric\_name</code> instance running on <code class="expression">space.vars.product\_acronym</code>.

{% hint style="info" %}
All metrics are retained for 15 days.
{% endhint %}

### Options for consuming metrics

There are two ways to export <code class="expression">space.vars.product\_acronym</code> metrics to your own observability stack.

| Option                                                                        | What you get                                                                              | Best for                                        |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------- |
| \[Recommended] Scrape from each host                                          | Full raw metrics from every host                                                          | Integration with your own observability stack   |
| Remote write from <code class="expression">space.vars.product\_acronym</code> | Processed metrics pushed from <code class="expression">space.vars.product\_acronym</code> | Centralised ingestion into an existing endpoint |

#### Option 1: \[Recommended] Scrape directly from each host

Your observability stack scrapes metrics directly from the exporters running on each host.

Add the following endpoints for each host to your scrape configuration:

| Exporter         | Endpoint                 |
| ---------------- | ------------------------ |
| node-exporter    | `<host-ip>:9388/metrics` |
| libvirt-exporter | `<host-ip>:9177/metrics` |

Metrics are exposed in the standard <code class="expression">page.vars.metric\_name</code> format and can be consumed by any compatible scraper.

**Why is this the recommended approach?**

* **Full metric access.** The raw exporters expose the complete set of host and VM metrics. The <code class="expression">page.vars.metric\_name</code> agent applies recording rules before forwarding to <code class="expression">space.vars.product\_acronym</code>, so <code class="expression">space.vars.product\_acronym</code> holds a reduced set. Scraping per-host gives you access to all underlying data.
* **Your stack stays in your network.** Exporters operate within your network, allowing your observability stack to function internally without external endpoints.
* **Independent configuration.** You can define your own labels, filters, and alerting rules without requiring any changes on the <code class="expression">space.vars.product\_acronym</code> side.
* **Less load on** <code class="expression">space.vars.product\_acronym</code>**.** <code class="expression">space.vars.product\_acronym</code> already handles remote writes from every host. Adding additional scrape load against it increases pressure on a shared component.

#### Option 2: Remote write from <code class="expression">space.vars.product\_acronym</code>

<code class="expression">page.vars.metric\_name</code> on <code class="expression">space.vars.product\_acronym</code> holds aggregated, processed metrics for your entire deployment and can be configured to remote-write to your observability stack endpoint.

**Limitations to consider before choosing this option:**

* **Reduced metric set.** The <code class="expression">page.vars.metric\_name</code> agent applies recording rules on each host before remote writing to <code class="expression">space.vars.product\_acronym</code>. Metrics that are aggregated or dropped by those rules are not available at the <code class="expression">space.vars.product\_acronym</code> level. If you need full metric fidelity, scrape from each host instead.
* **Endpoint exposure required.** If <code class="expression">space.vars.product\_acronym</code> is deployed in SaaS mode, <code class="expression">page.vars.metric\_name</code> on <code class="expression">space.vars.product\_acronym</code> is outside your network. Your observability stack endpoint must be reachable from <code class="expression">space.vars.product\_acronym</code>.
* **No UI-based configuration.** Remote write configuration on <code class="expression">space.vars.product\_acronym</code> is not managed through the <code class="expression">space.vars.product\_acronym</code> UI and must be applied manually.

Remote write configuration on <code class="expression">space.vars.product\_acronym</code> must be applied manually and verified after each upgrade. Contact Platform9 support before making changes to <code class="expression">space.vars.product\_acronym</code>-level configuration.

### Next steps

* Review [pcd-metrics-reference](https://docs.platform9.com/private-cloud-director/monitoring-and-observability/monitoring/pcd-metrics-reference "mention") for the complete list of host and VM metrics available from the exporters.
* For the built-in dashboards and Grafana access, see [#accessing-grafana-dashboards](https://docs.platform9.com/private-cloud-director/monitoring-and-observability/monitoring/..#accessing-grafana-dashboards "mention")


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.platform9.com/private-cloud-director/monitoring-and-observability/monitoring/exporting-pcd-metrics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
