> For the complete documentation index, see [llms.txt](https://docs.inrupt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inrupt.com/ess/installation/customize-configurations/customization-pod-maintenance/modify-storage-metrics.md).

# Modify Storage Metrics Collection

ESS includes a [Storage Metrics](https://docs.inrupt.com/ess/services/service-pod-management/service-pod-storage.md#storage-metrics) feature to gather the following metrics:

* The total number of Pods
* The number of Pods that have been “Created” (where the provision has been confirmed)
* The number of Pods that have been “Deleted”(marked for deletion; i.e., soft-deleted).
* The number of Pods that are “Active” (created and not deleted)

Specifically, Storage Metrics runs as a [Kubernetes Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/), **`ess-storage-metrics`**, with a single Pod that collects the metrics on a fixed period.

You can use Kustomize to modify how often the metrics are collected.

## Example Customizations

{% hint style="warning" %}
**Important**\
Gathering Storage Metrics queries the storage database, which may negatively impact the performance of your system. Collecting less often reduces this impact.
{% endhint %}

The provided overlays are configured to collect the metrics every 2 minutes.

If instead you wish to collect the metrics every 5 minutes:

1. Go to your ESS installation directory:

   ```sh
   cd ${HOME}/ess
   ```
2. Create a **`kustomize-storage-metrics.yaml`** file with the following content:

   ```yaml
   apiVersion: apps/v1
   kind: Deployment
   metadata:
     name: ess-storage-metrics
   spec:
     template:
       spec:
         containers:
         - name: ess-storage-metrics
           env:
           - name: INRUPT_STORAGE_METRICS_COLLECTION_PERIOD
             value: 5m
   ```
3. Modify the **`kustomization.yaml`** (i.e., step 3 of the [Applying Your Customizations](https://docs.inrupt.com/ess/installation.md#applying-your-customizations) procedure) to use **`kustomize-storage-metrics.yaml`** .\
   Specifically, add the highlighted content to the **`kustomization.yaml`** file to the `patches` section:

{% hint style="info" %}
**Tip**

If **`patches`** key does not exist in **`kustomization.yaml`** , add the **`patches`** key as well.
{% endhint %}

```yaml
# kustomization.yaml in your ESS installation directory

# ...  Preceding content omitted for brevity 
# ...

patches:
  - path: kustomize-storage-metrics.yaml
```

4\. Continue with the rest of the [Applying Your Customizations](https://docs.inrupt.com/ess/installation.md#applying-your-customizations) procedure.

{% hint style="info" %}
If you collect less often, also review any alert on stale Storage Metrics, such as the example in [Administration: Storage Metrics](https://docs.inrupt.com/ess/administration/ess-metrics.md#alert-on-stale-storage-metrics), so that it does not fire between collections.
{% endhint %}

See also [Administration: Storage Metrics](https://docs.inrupt.com/ess/administration/ess-metrics.md#storage-metrics)
