OCI Database with PostgreSQL Metrics

You can monitor the health, capacity, and performance of databases by using metrics , alarms , and notifications.

This topic describes the metrics emitted by the OCI Database with PostgreSQL service in the oci_postgresql metric namespace.

Resources: OCI_OPTIMIZED_STORAGE.

Tip

You can enable logging for OCI Database with PostgreSQL resources. For more information, see Logging Overview.

Overview

The OCI Database with PostgreSQL service metrics help you measure the performance and health of a database. You can use metrics data to diagnose and troubleshoot issues.

To view a default set of metrics charts in the Console, navigate to the database that you're interested in, and then click Metrics. You also can use the Monitoring service to create custom queries.

Prerequisites

  • IAM policies: To monitor resources, you must be given the required type of access in a policy (IAM)  written by an administrator. Policies are required for using the Console or the REST API with an SDK, CLI, or other tool. The policy must give you access to the monitoring services and the resources being monitored. When you try to perform an action, you might get a message that you don't have permission or are unauthorized. Confirm with your administrator the type of access you've been granted and which compartment  you should work in. For more information on user authorizations for monitoring, see the Authentication and Authorization section for the related service: Monitoring or Notifications.

  • The metrics listed on this page are automatically available for any resources you create. You don't need to enable monitoring on the resource to get these metrics.

Available Metrics

OCI Database with PostgreSQL metrics include the following dimensions:

  • resourceType: The type of resource for which the metrics apply
  • resourceName: The name of the resource for which the metrics apply
  • resourceId: The OCID of the resource for which the metric applies
  • dbInstanceRole: Whether the node is the primary node or a read replica node
  • dbInstanceId: The ID of the node for which the metrics apply
Metric Metric Display Name Unit Description Dimensions
BufferCacheHitRatio Buffer Cache Hit Ratio percentage The percentage of pages found in the buffer cache without reading from disk.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

Connections DB Connections count The number of database connections.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

CpuUtilization CPU Utilization percentage The CPU utilization expressed as a percentage. The utilization percentage is reported with respect to the number of CPUs the database is allowed to use, which is two times the number of OCPUs.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

Deadlocks Deadlocks count The number of locks on a database row where two or more transactions are waiting for another transaction to give up a locked row.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

WriteIops Write IOPS count The number of writes per second.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

ReadIops Read IOPS count The number of reads per second.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

WriteLatency Write Latency ms Write latency in milliseconds.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

ReadLatency Read Latency ms Read latency in milliseconds.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

WriteThroughput Write Kilobytes KB Writes in kilobytes per second.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

ReadThroughput Read Kilobytes KB Reads in kilobytes per second.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

MemoryUtilization Memory Utilization percentage The percentage of total RAM that's in use.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

UsedStorage Used Storage GB The amount of storage used, expressed in GB.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

InactiveReplicationSlots Inactive Replication Slots count Indicates replication slots that are inactive (no subscriber consuming). Helps detect orphaned replication slots that might retain WAL files unnecessarily.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

ActiveSessions Active Sessions count Number of active sessions connected to the database.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

IdleSessions Idle Sessions count Number idle sessions. Can help identify unused connections.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

IdleInTransactions Idle In Transaction count Sessions idle in a transaction, potentially causing locks or holding resources.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

BlockedQueries Number of Blocked Queries count Number of queries waiting because of blocking by other sessions.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

LongRunningQueriesOverFiveMinutes Number of Long-running Queries (Over 5 Minutes) count Queries running longer than 5 minutes, potentially impacting performance.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

AverageReadLatency Average Read Latency ms Shows how long, on average, it takes for the database to fetch data when reading from storage. Reduced latency means faster query responses.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

ReplicationLag Replication Lag MB Replay LSN lag between the primary and replica, indicating how much WAL data is pending to be replayed on the replica.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

WalUsedStorage WAL Storage GB The amount of WAL data storage used.

resourceType

resourceName

resourceId

dbInstanceRole

dbInstanceId

View Default Metric Charts

  1. Open the navigation menu and select Databases. Under PostgreSQL, select Databases.
  2. Select the name of the database for which you want to see metrics.
  3. On the database system's details page, select Metrics.

    The Metrics page displays a default set of charts for the current database. The metrics shown originate from the primary node's read/write endpoint.

For more information about monitoring metrics and using alarms, see Monitoring. For information about notifications for alarms, see Notifications.