Labels
The AlloyDB Omni Kubernetes operator exposes the following types of labels.
Resource labels
AlloyDB Omni Kubernetes operator exposes the following resource labels that uniquely identify the database container that the metrics belong to. These resource labels match the names of the Kubernetes resource that owns the database container:
| Label key | Label value |
|---|---|
| dbnamespace | Namespace of the dbcluster CR |
| dbcluster | Name of the dbcluster CR |
| dbinstance | Name of the dbinstance CR. Only the dbinstance of ReadPool type is supported. If the database container does not belong to a ReadPool dbinstance, this value is n/a
|
| dbnode | Name of the instance CR. Every instance CR has a one-to-one mapping to a database container. |
System metadata labels
System metadata labels will change dynamically when the roles
of
the DB container changes. For example, When your dbcluster is promoted from
secondary to primary, dbcluster_type will change from Secondary
to Primary
.
| Label key | Label value |
|---|---|
| dbcluster_type | Disaster recovery (DR) role of the dbcluster CR. Can be Primary
or Secondary
|
| dbinstance_type | Type of the dbinstance CR. If the container belongs to a ReadPool dbinstance, this value is ReadPool
, otherwise this value is n/a
|
| dbnode_type | HA role of the dbnode, can be Primary
or Standby
|
Metric labels
The specific labels of each metric are listed in the following tables. For
example, database
means the name of a Postgres database hosted inside the AlloyDB Omni database container.
Metrics
AlloyDB Omni Kubernetes operator exposes the following metrics.
The metrics list mentions only metrics labels. All metrics start with alloydb_omni
.
To learn more about metric types, see Metric types
.
Database container-level metrics
Database container-level metrics are collected per AlloyDB Omni database container. Each database container-level metric has resource and system metadata labels.
MAJOR.MINOR
format, for example, 16.3
- wait_event_name: name of the wait event
- wait_event_type: type of the wait event
- wait_event_name: name of the wait event
- wait_event_type: type of the wait event
- application_name: application_name in the replica's connection string to the primary that matches the name of the replica instance CR.
- client_addr: IP address of the replica pod.
- application_name: application_name in the replica's connection string to the primary. It matches the name of the replica instance CR.
- client_addr: IP address of the replica pod.
1
.- application_name: application_name in the replica's connection string to the primary. It matches the name of the replica instance CR.
- client_addr: IP address of the replica pod.
- state: one of [startup, catchup, streaming, backup, stopping]
- application_name: application_name in the replica's connection string to the primary. It matches the name of the replica instance CR.
- client_addr: IP address of the replica pod.
primarySpec
section of spec
portion of the database cluster manifest file.Database-level metrics
These metrics are collected on a per AlloyDB Omni database container per Postgres database level. You can create multiple Postgres databases in one database container. All these metrics have resource, system metadata, and "database" labels. The database label is the name of the Postgres database that the metric belongs to.
The presence of certain labels and metrics is conditional:
-
The
client_addrmetrics label starting withalloydb_omni_database_postgresql_insightsis present only when you setgoogle_insights.track_client_addresstoonin your database cluster parameters. -
Metrics starting with
alloydb_omni_database_postgresql_insights_pertagare enabled only if the following conditions are met:- You set
google_insights.track_commenttoonin your database cluster parameters. - You add tags to your SQL queries .
- You set
-
user: the user of the database. -
client_addr: the IP address of the database client.
-
user: the user of the database. -
client_addr: the IP address of the database client. -
io_type:readorwrite
-
user: the user of the database. -
client_addr: the IP address of the database client. -
lock_type:lworhworbuffer_pin
-
user: the user of the database. -
client_addr: the IP address of the database client.
-
user: the user of the database. -
client_addr: the IP address of the database client. -
access_type:hitormiss
-
querystring: the normalized query. -
user: the user of the database. -
client_addr: the IP address of the database client. -
query_hash: a unique hash of the query string.
-
querystring: the normalized query. -
user: the user of the database. -
client_addr: the IP address of the database client. -
io_type:readorwrite -
query_hash: a unique hash of the query string.
-
querystring: the normalized query. -
user: the user of the database. -
client_addr: the IP address of the database client. -
lock_type:lworhworbuffer_pin -
query_hash: a unique hash of the query string.
-
querystring: the normalized query. -
user: the user of the database. -
client_addr: the IP address of the database client. -
query_hash: a unique hash of the query string.
-
querystring: the normalized query. -
user: the user of the database. -
client_addr: the IP address of the database client. -
access_type:hitormiss -
query_hash: a unique hash of the query string.
-
user: the user of the database. -
client_addr: the IP address of the database client. -
action: the name of the action. -
application: the name of the application. -
controller: the name of the controller. -
db_driver: the name of the db_driver. -
framework: the name of the framework. -
route: the name of the route. -
tag_hash: a unique hash of the tag string.
-
user: the user of the database. -
client_addr: the IP address of the database client. -
action: the name of the action. -
application: the name of the application. -
controller: the name of the controller. -
db_driver: the name of the db_driver. -
framework: the name of the framework. -
route: the name of the route. -
io_type:readorwrite -
tag_hash: a unique hash of the tag string.
-
user: the user of the database. -
client_addr: the IP address of the database client. -
action: the name of the action. -
application: the name of the application. -
controller: the name of the controller. -
db_driver: the name of the db_driver. -
framework: the name of the framework. -
route: the name of the route. -
lock_type:lworhworbuffer_pin -
tag_hash: a unique hash of the tag string.
-
user: the user of the database. -
client_addr: the IP address of the database client. -
action: the name of the action. -
application: the name of the application. -
controller: the name of the controller. -
db_driver: the name of the db_driver. -
framework: the name of the framework. -
route: the name of the route. -
tag_hash: a unique hash of the tag string.
-
user: the user of the database. -
client_addr: the IP address of the database client. -
action: the name of the action. -
application: the name of the application. -
controller: the name of the controller. -
db_driver: the name of the db_driver. -
framework: the name of the framework. -
route: the name of the route. -
access_type:hitormiss -
tag_hash: a unique hash of the tag string.
Metrics collection metrics
These metrics indicate the status of each metric collection cycle. These metrics have the resource labels mentioned in Labels .
| Name | Description | Unit | Type |
|---|---|---|---|
|
alloydb_omni_monitor_collect_ms
|
Number of milliseconds spent to collect metrics. | ms | gauge |
|
alloydb_omni_monitor_error_count
|
Number of errors encountered while trying to collect metrics this cycle. | gauge | |
|
alloydb_omni_monitor_metric_count
|
Number of metrics collected successfully this cycle. | gauge |
Prometheus metric handler metrics
These metrics are automatically generated by Prometheus for each collection cycle.
| Name | Description | Cause | Type |
|---|---|---|---|
|
promhttp_metric_handler_errors_total
|
Total number of internal errors encountered by the promhttp metric handler. | Cause of the error | counter |
What's next
- To learn how to use metrics for monitoring, see Monitor AlloyDB Omni .

