# Storage Metrics

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

* The total number of Pods.
* The number of “created” Pods (i.e., Pods that have been created and confirmed).
* The number of “deleted” Pods (i.e., Pods that have been soft-deleted, i.e., marked as deleted).

The Storage Metrics is run as a [Kubernetes CronJobs](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/). To modify its schedule, see [Modify Storage Metrics Schedule](/ess/2.6/installation/customize-configurations/customization-pod-maintenance/modify-storage-metrics.md) .

## Observability

{% tabs %}
{% tab title="Default Logging" %}
Logging for Pruning jobs share a consistent pattern where the **`messageId`** has the prefix **`STORAGEMETRICS`** or **`STORAGE`** :

```json
{
  "timestamp":<value>,
  "sequence":<value>,
  "loggerClassName":<value>,
  "loggerName":<value>,
  "level":<value>,
  "message": "<STORAGEMETRICS|STORAGE><number>: <description>",
  "threadName":<value>,
  "threadId":<value>,
  "hostName":<value>,
  "processName":<value>,
  "processId":<value>,
  "messageId": "STORAGEMETRICS|STORAGE<number>"
  // additional relevant fields, if any
}
```

For the storage metrics features, the additional fields include:

* an **`mdc`** (managed diagnostic context) field that can be used for correlation;
* various storage metrics.

The following lists the various storage metrics that appear in the **`INFO`** level log messages (listed by the **`messageId`** ):

{% hint style="info" %}
**Note**\
The log messages that include the storage metrics detail use the **`STORAGE`** prefix in the messageIds.
{% endhint %}

* **`STORAGE000128`** (associated with the storage counts)

  | **`resultCount`** | Total number of Pods (both “created” and “deleted”). |
  | ----------------- | ---------------------------------------------------- |
* **`STORAGE000130`** (associated with the “created” storage counts)

  | **`resultCount`** | The number of Pods that have been created and confirmed. |
  | ----------------- | -------------------------------------------------------- |

{% hint style="info" %}
**Tip** For the count of “deleted” Pods (i.e., soft-deleted or marked as deleted), you can subtract from the **`STORAGE000128`** message **`resultCount`** the **`resultCount`** from the the **`STORAGE000130`** message; alternatively, you can set the Log Level to **`DEBUG`** (and return the level to **`INFO`** afterwards).
{% endhint %}
{% endtab %}

{% tab title="Prometheus" %}
Prune emits Prometheus metrics with the following labeled names.

All of the following are prefixed with **`application_com_inrupt_storage_metrics_MetricsCollector_`** .

<table data-header-hidden><thead><tr><th width="254.65625"></th><th></th></tr></thead><tbody><tr><td><strong><code>{metricType=”count”, resourceType=”pod”, resourceStatus=”all”}</code></strong></td><td>Total number of Pods (both “created” and “deleted”).</td></tr><tr><td><strong><code>{metricType=”count”, resourceType=”pod”, resourceStatus=”created”}</code></strong></td><td>The number of Pods that have been created and confirmed.</td></tr><tr><td><strong><code>{metricType=”count”, resourceType=”pod”, resourceStatus=”deleted”}</code></strong></td><td>The number of Pods that have been marked as deleted.</td></tr><tr><td><strong><code>collect</code></strong></td><td>Time taken to run the queries to gather the metrics.</td></tr></tbody></table>

See also [Service Metrics: Prometheus Configuration](/ess/2.6/administration/service-metrics-prometheus-configuration.md) .
{% endtab %}

{% tab title="OpenTelemetry" %}
When OpenTelemetry is configured, the application emits a single span named **`collect`** with the following attributes.

<table data-header-hidden><thead><tr><th width="208.0546875"></th><th></th></tr></thead><tbody><tr><td><strong><code>countPodAll</code></strong></td><td>Total number of Pods (both “created” and “deleted”).</td></tr><tr><td><strong><code>countPodCreated</code></strong></td><td>The number of Pods that have been created and confirmed.</td></tr><tr><td><strong><code>countPodDeleted</code></strong></td><td>The number of Pods that have been marked as deleted.</td></tr><tr><td><strong><code>durationMilliseconds</code></strong></td><td>Time taken to run the queries to gather the metrics.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


---

# 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.inrupt.com/ess/2.6/administration/storage-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.
