> 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/administration/ess-metrics.md).

# ESS Metrics

Enterprise Solid Server (ESS) provides comprehensive metrics for monitoring and observability. This page documents some of the available metrics categories and how to access them.

## Storage Metrics

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 "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 number of "active" Pods (i.e., created Pods that have not been deleted).

{% hint style="warning" %}
Changed in version 3.5.0. Storage Metrics runs as a Kubernetes Deployment, **`ess-storage-metrics`**, instead of a CronJob, and publishes new metrics. The **`com_inrupt_storage_metrics_MetricsCollector`** summary is no longer published; use **`inrupt_storage_pods`** instead.
{% endhint %}

Storage Metrics runs as a single Pod that collects the counts on a fixed period, set by [**`INRUPT_STORAGE_METRICS_COLLECTION_PERIOD`**](https://docs.inrupt.com/ess/services/service-pod-management/service-pod-storage.md#inrupt_storage_metrics_collection_period). To change the period, see [Modify Storage Metrics Collection](https://docs.inrupt.com/ess/installation/customize-configurations/customization-pod-maintenance/modify-storage-metrics.md).

A collection that fails is logged, and the next collection runs as usual. Each count keeps the value from the last successful collection, so if the database is unavailable, the metrics become stale rather than Storage Metrics restarting. Storage Metrics reports itself as not live only if no collection has completed for three collection periods (and at least 5 minutes).

### Observability

Storage Metrics publishes the following Prometheus metrics on its **`management`** port, so a PodMonitor that scrapes the ESS services on that port also scrapes Storage Metrics.

| Metric                                                      | Type      | Description                                                                               |
| ----------------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------- |
| **`inrupt_storage_pods{status="all"}`**                     | Gauge     | Total number of Pods (both "created" and "deleted").                                      |
| **`inrupt_storage_pods{status="created"}`**                 | Gauge     | The number of Pods that have been created and confirmed.                                  |
| **`inrupt_storage_pods{status="deleted"}`**                 | Gauge     | The number of Pods that have been marked as deleted.                                      |
| **`inrupt_storage_pods{status="active"}`**                  | Gauge     | The number of created Pods that have not been marked as deleted.                          |
| **`inrupt_storage_metrics_last_success_timestamp_seconds`** | Gauge     | Unix time of the last successful collection. **`0`** until the first collection succeeds. |
| **`inrupt_storage_metrics_cycle_seconds`**                  | Histogram | Duration of each collection, labeled **`outcome="success"`** or **`outcome="failure"`**.  |

### Alert on Stale Storage Metrics

Because a failed collection does not restart the Pod, use an alert to detect metrics that are no longer being updated. For example, the following Prometheus rule warns when Storage Metrics has not collected the Pod counts for 15 minutes, or when Prometheus cannot scrape its metrics. Change the **`namespace`** to the namespace of your ESS deployment. If you collect less often than every 10 minutes, raise the **`600`** second threshold above your collection period.

```yaml
- alert: ESSStorageMetricsStale
  expr: (time() - max by (namespace) (max_over_time(inrupt_storage_metrics_last_success_timestamp_seconds{namespace="ess"}[1h])) > 600) or (max by (namespace) (up{namespace="ess", service="ess-storage-metrics"}) == 0)
  for: 5m
  labels:
    severity: warning
  annotations:
    summary: "The storage metrics in {{ $labels.namespace }} are out of date"
```

See also [Service Metrics: Prometheus Configuration](https://docs.inrupt.com/ess/administration/service-metrics-prometheus-configuration.md).

## Access Grant Metrics

ESS provides Access Grant Metrics to monitor the state and lifecycle of credentials managed by the system. These metrics enable detailed tracking of Access Requests, Access Grants, and Access Denials.

### Overview

Access Grant Metrics provide granular visibility into credential states across the ESS deployment. The metrics are collected and cached at the application level, providing real-time insights into:

* **Access Requests** - Track requests in various states including pending, granted, denied, canceled, and expired
* **Access Grants** - Monitor active, expired, and revoked grants
* **Access Denials** - Count total denials issued by the system

These metrics support operational monitoring, compliance tracking, and status-based alerting for authorization workflows.

### Observability

{% tabs %}
{% tab title="Prometheus" %}
Access Grant Metrics are exposed as Prometheus metrics with absolute metric names. Each metric type includes labels to differentiate between credential states.

#### Access Request Metrics

All Access Request metrics use the base name **`inrupt_vc_access_request_count`** with a **`status`** label:

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong><code>{status="pending"}</code></strong></td><td>Access requests that do not have a corresponding Access Grant or Access Denial.</td></tr><tr><td><strong><code>{status="denied"}</code></strong></td><td>Access requests with a corresponding Access Denial.</td></tr><tr><td><strong><code>{status="granted"}</code></strong></td><td>Access requests with a corresponding Access Grant.</td></tr><tr><td><strong><code>{status="canceled"}</code></strong></td><td>Access requests that have been revoked/canceled.</td></tr><tr><td><strong><code>{status="expired"}</code></strong></td><td>Access requests that have expired.</td></tr></tbody></table>

#### Access Grant Metrics

All Access Grant metrics use the base name **`inrupt_vc_access_grant_count`** with a **`status`** label:

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong><code>{status="active"}</code></strong></td><td>Access grants that are not expired or revoked.</td></tr><tr><td><strong><code>{status="expired"}</code></strong></td><td>Access grants that have expired.</td></tr><tr><td><strong><code>{status="revoked"}</code></strong></td><td>Access grants that have been revoked.</td></tr></tbody></table>

#### Access Denial Metrics

Access Denial metrics use the metric name **`inrupt_vc_access_denial_count`** and represent the total count of all access denials managed by the service.

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

### Configuration

Access Grant Metrics are automatically collected by the credential service using a caching mechanism to optimize performance. The caching layer minimizes the performance impact on the credential management service, however the cached metrics may not always reflect real-time values with complete accuracy.

For configuration options to customize cache expiration times, see [Access Grant Service: Access Grant Metrics Cache Configuration](https://docs.inrupt.com/ess/services/service-access-grant.md#access-grant-metrics-cache-configuration).
