Select a documentation version: <button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">18.4.0</button>

- [Current (18.4.0)](https://docs.cloud.google.com/alloydb/omni/kubernetes/current/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [18.4.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/18.4.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [18.3.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/18.3.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [18.1.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/18.1.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [17.10.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/17.10.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [17.9.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/17.9.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [17.7.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/17.7.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [17.5.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/17.5.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [16.14.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.14.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [16.13.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.13.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [16.11.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.11.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [16.9.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.9.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [16.8.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.8.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [16.3.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/16.3.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [15.18.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.18.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [15.17.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.17.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [15.15.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.15.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [15.13.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.13.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [15.12.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.12.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [15.7.1](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.7.1/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)
- [15.7.0](https://docs.cloud.google.com/alloydb/omni/kubernetes/15.7.0/docs/reference/custom-resource-metrics-kubernetes-operator.md.txt)

<br />

This page describes the custom resource (CR) metrics for the AlloyDB Omni Kubernetes operator. The AlloyDB Omni Kubernetes operator exposes metrics constructed from custom resource manifests in a [Prometheus](https://prometheus.io/) format using [kube-state-metrics](https://kubernetes.io/docs/concepts/cluster-administration/kube-state-metrics/).

<br />

> [!NOTE]
> **Note:** These metrics are only available on AlloyDB Omni Kubernetes operator version 1.3.0 and later.

Metric types follow the definition of Prometheus metrics types. A Prometheus
Info metric is a special kind of Prometheus Gauge metric, which always has a
value of 1 and has multiple labels carrying important information about the
corresponding AlloyDB Omni Kubernetes operator Custom Resource.

To learn how to enable custom resource metrics, see [Monitor AlloyDB Omni Kubernetes operator custom resources](https://docs.cloud.google.com/alloydb/omni/kubernetes/current/docs/monitor-kubernetes-operator-custom-resources.md.txt).

## Custom Resource Definition (CRD) metadata labels

All custom resource metrics have the following labels that mark the group, version, and kind
of the CRD. For more information, see
[Kubernetes API concepts](https://kubernetes.io/docs/reference/using-api/api-concepts/).
Label definitions and naming are listed in the following table:

| **Key** | **Description** | **Example Value** |
|---|---|---|
| ` customresource_group ` | The group of the CRD. | ` alloydbomni.dbadmin.goog ` |
| ` customresource_version ` | The version of the CRD. | ` v1 ` |
| ` customresource_kind ` | The kind of the CRD. | ` DBCluster ` |

## Backup metrics

Backup metrics are exposed from `Backup` resource manifests. All Backup metric names start with `alloydb_omni_backup_`. All Backup metrics have the following labels:

| **Key** | **Value** |
|---|---|
| `backup` | `[metadata, name]` |
| ` backupplan ` | ` [metadata, name] ` |
| ` namespace ` | ` [metadata, namespace] ` |
| ` dbcluster ` | ` [spec, dbclusterRef] ` |

The labels in the following table will have an empty value ---and are
considered equivalent to labels that don't exist based on
[Prometheus metric names and labels](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels)---
if the relevant field isn't present in the Backup manifest.

| **Metric Name** | **Description** | **Label** | **Unit** | **Type** |
|---|---|---|---|---|
| `alloydb_omni_backup_phase` | Current status of the backup (Succeeded, InProgress or Failed) | N/A | 1 | StateSet |
| `alloydb_omni_backup_start_time` | Unix timestamp of the start time of the backup | N/A | sec | Gauge |
| `alloydb_omni_backup_end_time` | Unix timestamp of the end time of the backup | N/A | sec | Gauge |
| `alloydb_omni_backup_duration_seconds` | Duration of the backup operation in seconds | N/A | sec | Gauge |
| `alloydb_omni_backup_backup_size` | Size of the completed backup in bytes | N/A | bytes | Gauge |
| `alloydb_omni_backup_spec_info` | Spec of backup | - `backup_source_role`: `[spec, backupSourceRole]` - `manual`: `[spec, manual]` - `backup_type`: `[spec, physicalBackupSpec, backupType]` | 1 | Info |
| `alloydb_omni_backup_status_info` | Status of backup | - `phase`: `[status, phase]` - `backup_id`: `[status, physicalBackupStatus, backupID]` - `prior_backup`: `[status, physicalBackupStatus, priorBackup]` - `backup_type`: `[status, physicalBackupStatus, backupType]` - `lsn_start`: `[status, physicalBackupStatus, lsn, start]` - `lsn_stop`: `[status, physicalBackupStatus, lsn, stop]` - `wal_start`: `[status, physicalBackupStatus, wal, start]` - `wal_stop`: `[status, physicalBackupStatus, wal, stop]` - `retain_expire_time`: `[status, retainExpire_time]` | 1 | Info |
| `alloydb_omni_backup_critical_incident_info` | Backup critical incidents | - `create_time`: `[status, criticalIncidents, createTime]` - `message`: `[status, criticalIncidents, message]` - `code`: `[status, criticalIncidents, code]` | 1 | Info |
| `alloydb_omni_backup_critical_incident_createtime` | Backup critical incident createTime | - `message`: `[status, criticalIncidents, message]` - `code`: `[status, criticalIncidents, code]` | sec | Gauge |

## BackupPlan metrics

BackupPlan metrics are exposed from `BackupPlan` resource manifests. All `BackupPlan` metric names start with `alloydb_omni_backupplan_`. All `BackupPlan` metrics have the following labels:

| **Key** | **Value** |
|---|---|
| ` backupplan ` | ` [metadata, name] ` |
| ` namespace ` | ` [metadata, namespace] ` |
| ` dbcluster ` | ` [spec, dbclusterRef] ` |

The labels in the following table will have an empty value ---and are
considered equivalent to labels that don't exist based on
[Prometheus metric names and labels](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels)---
if the relevant field isn't present in the BackupPlan manifest.

| **Metric Name** | **Description** | **Label** | **Unit** | **Type** |
|---|---|---|---|---|
| `alloydb_omni_backupplan_phase` | Current status of the backup plan | N/A | 1 | StateSet |
| `alloydb_omni_backupplan_last_backup_time` | Unix timestamp of the last scheduled backup by the plan | N/A | sec | Gauge |
| `alloydb_omni_backupplan_next_backup_time` | Unix timestamp of the next scheduled backup by the plan | N/A | sec | Gauge |
| `alloydb_omni_backupplan_recovery_window_begin` | Unix timestamp of the start time of the recovery | N/A | sec | Gauge |
| `alloydb_omni_backupplan_recovery_window_end` | Unix timestamp of the end time of the recovery | N/A | sec | Gauge |
| `alloydb_omni_backupplan_spec_info` | Spec of backupplan | - `full_schedule`: `[spec, backupSchedules, full]` - `differential_schedule`: `[spec, backupSchedules, differential]` - `incremental_schedule`: `[spec, backupSchedules, incremental]` - `backup_retain_days`: `[spec, backupRetainDays]` - `backup_source_strategy`: `[spec, backupSourceStrategy]` - `paused`: `[spec, paused]` | 1 | Info |
| `alloydb_omni_backupplan_status_info` | Status of backupplan | - `phase`: `[status, phase]` - `last_backup_time`: `[status, lastBackupTime]` - `next_backup_time`: `[status, nextBackupTime]` - `recovery_window_begin`: `[status, recoveryWindow, begin]` - `recovery_window_end`: `[status, recoveryWindow, end]` | 1 | Info |
| `alloydb_omni_backupplan_critical_incident_info` | Backupplan critical incidents | - `create_time`: `[status, criticalIncidents, createTime]` - `message`: `[status, criticalIncidents, message]` - `code`: `[status, criticalIncidents, code]` | 1 | Info |
| `alloydb_omni_backupplan_critical_incident_createtime` | Backupplan critical incident createTime | - `message`: `[status, criticalIncidents, message]` - `code`: `[status, criticalIncidents, code]` | sec | Gauge |

## DBCluster metrics

DBCluster metrics are exposed from `DBCluster` resource manifests. All
DBCluster metric names start with `alloydb_omni_dbcluster_`. All DBCluster
metrics have the following labels:

| **Key** | **Value** |
|---|---|
| ` namespace ` | The namespace that the DBCluster belongs to. |
| ` dbcluster ` | The name of the DBCluster custom resource. |

The labels in the following table will have an empty value ---and are
considered equivalent to labels that don't exist per
[Prometheus metric names and labels](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels)---
if the relevant field isn't present in the DBCluster manifest.

| **Metric Name** | **Description** | **Label** | **Unit** | Type |
|---|---|---|---|---|
| ` alloydb_omni_dbcluster_ha_ready ` | The high availability (HA) readiness of the \`DBCluster\`: `1` if `ha-ready`, otherwise `0.` | `reason`: The reason why this `DBCluster` is (un)ready for HA. | 1 | Gauge |
| ` alloydb_omni_dbcluster_primary_ready ` | The readiness of the `DBCluster` primary node: `1` if ready, otherwise `0.` | `reason`: The reason why this `DBCluster`'s primary node is (un)ready. | 1 | Gauge |
| ` alloydb_omni_dbcluster_status_info ` | The current status of the `DBCluster.` | - `phase`: the phase of the `DBCluster`. <!-- --> - `database_version`: the current running version of the AlloyDB Omni image, for example, 15.7.0. <!-- --> - `controlplane_agents_version`: the current running version of the control plane agents image, for example, 1.3.0. <!-- --> - `read_write_endpoint`: the read-write endpoint of the DBCluster`.` <!-- --> - `read_only_endpoint`: the read-only endpoint of the DBCluster. <!-- --> - `primary_phase`: the phase of the `DBCluster` primary node. <!-- --> - `haready_status`: `HAReady` condition status, `True` or `False.` <!-- --> - `haready_reason`: the reason for the `HAReady` condition. | 1 | Info |
| ` alloydb_omni_dbcluster_spec_info ` | `DBCluster` configuration under the `spec` field of the DBCluster manifest. | - `num_standbys`:the number of standby nodes configured. <!-- --> - database_version: the version of the AlloyDB Omni image configured, for example, 15.7.0. <!-- --> - `controlplane_agents_version`: the version of the control plane agents image configured, for example, 1.3.0. <!-- --> - `is_deleted`: indicates whether this `DBCluster` is marked for deletion, set to `true` or `false.` <!-- --> - `allow_external_incoming_traffic`: indicates whether this `DBCluster` is configured to allow traffic from out of the Kubernetes cluster, `true` or `false`. | 1 | Info |
| ` alloydb_omni_dbcluster_spec_num_standbys ` | The number of standbys defined in the `DBCluster` spec. | N/A | 1 | Gauge |
| ` alloydb_omni_dbcluster_critical_incident_info ` | Critical incident entries under the DBCluster manifest `status.criticalIncidents` section. | - `create_time`: The time when the critical incident occurred. <!-- --> - `message`: The error message of the critical incident. <!-- --> - `code`: The error code of the critical incident. | 1 | Info |
| ` alloydb_omni_dbcluster_critical_incident_create_time ` | The time when the critical incident occurred, expressed in [Unix epoch time](https://en.wikipedia.org/wiki/Unix_time) format. | - `message`: The error message of the critical incident. <!-- --> - `code`: The error code of the critical incident. | sec | Gauge |

## Failover metrics

Failover metrics are metrics exposed from the `Failover` resource manifest. All
failover metric names start with `alloydb_omni_failover_`. All Failover metrics
have the following labels:

| **Key** | **Value** |
|---|---|
| ` namespace ` | The namespace that the `Failover` belongs to. |
| ` failover ` | The name of the `Failover` custom resource. |
| ` dbcluster ` | The name of the DBCluster custom resource that the Failover targets. This value is the same as the `spec.dbclusterRef` field of the `Failover`. |

The labels in the following table will have an empty value ---and are
considered equivalent to labels that don't exist based on
[Prometheus metric names and labels](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels)---
if the relevant field isn't present in the Failover manifest.

| **Metric name** | **Description** | **Label** | **Unit** | Type |
|---|---|---|---|---|
| ` alloydb_omni_failover_start_time ` | The time when this `Failover` started, expressed in [Unix epoch time](https://en.wikipedia.org/wiki/Unix_time) format. | - `state`: the state of the `Failover`. <!-- --> - `phase`: the phase of the `Failover`. | sec | Gauge |
| ` alloydb_omni_failover_end_time ` | The time when the `Failover` finished, expressed in [Unix epoch time](https://en.wikipedia.org/wiki/Unix_time) format | - `state`: the state of the `Failover` <!-- --> - `phase`: the phase of the `Failover` | sec | Gauge |
| ` alloydb_omni_failover_status_info ` | The current status of the `Failover`. | - `start_time`: the time when the `Failover` started. <!-- --> - `end_time`: the time when the `Failover` finished. <!-- --> - `new_primary`: the name of the primary node after the `Failover` finished. <!-- --> - `old_primary`: the name of the primary node before the `Failover` started <!-- --> - `phase`: the phase of the `Failover`. <!-- --> - `state`: the state of the `Failover`. | 1 | Info |

## PgBouncer metrics

PgBouncer metrics are metrics that are exposed from`PgBouncer` resource
manifests. All PgBouncer metric names start with `alloydb_omni_pgbouncer_`. All
PgBouncer metrics have the following labels:

| **Key** | **Value** |
|---|---|
| ` namespace ` | The namespace that the `PgBouncer` belongs to. |
| ` pgbouncer ` | The name of the `PgBouncer` custom resource. |
| ` dbcluster ` | The name of the DBCluster custom resource that this `PgBouncer` targets. This value is the same as the `spec.dbclusterRef` field of the `PgBouncer`. |

The labels in the following table will have an empty value ---and are
considered equivalent to labels that don't exist based on
[Prometheus metric names and labels](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels)---
if the relevant field isn't present in the PgBouncer manifest.

| **Metric Name** | **Description** | **Label** | Unit | Type |
|---|---|---|---|---|
| ` alloydb_omni_pgbouncer_status_info ` | The current status of the PgBouncer. | - `endpoint`: The endpoint exposed by this PgBouncer. You connect to this endpoint to run queries against the DBCluster that this PgBouncer targets. <!-- --> - `phase`: the phase of the PgBouncer | 1 | Info |

## What's next

- [Monitor AlloyDB Omni Kubernetes operator custom resources](https://docs.cloud.google.com/alloydb/omni/kubernetes/current/docs/monitor-kubernetes-operator-custom-resources.md.txt).