Azure PostgreSQL
Collect Azure PostgreSQL Metrics
Configuration¶
Install Func¶
It is recommended to enable TrueWatch integration - extension - DataFlux Func (Automata): all prerequisites are automatically installed, please proceed with the script installation.
If deploying Func manually, refer to Manual Func Deployment
Install Script¶
Note: Please prepare the required Azure application registration information in advance and assign the
Monitoring Readerrole to the application registration.
-
Log in to the Func console, click on 【Script Market】, enter the TrueWatch Script Market, and search for
integration_azure_postgresql_flexible_server -
Click 【Install】, then input the corresponding parameters:
Azure Tenant ID,Azure Client ID,Azure Client Secret Value,Subscriptions. -
Click 【Deploy Startup Script】, the system will automatically create the
Startupscript set and configure the corresponding startup scripts. -
After enabling, you can see the corresponding automatic trigger configuration in 「Manage / Automatic Trigger Configuration」. Click 【Execute】 to immediately execute once without waiting for the scheduled time. Wait a moment, and you can view the execution task records and corresponding logs.
Verification¶
- In "Manage / Automatic Trigger Configuration", confirm whether the corresponding task has the corresponding automatic trigger configuration, and check the corresponding task records and logs for any exceptions.
- In TrueWatch, 「Infrastructure - Resource Catalog」, check if there is asset information.
- In TrueWatch, check if there are corresponding monitoring data in "Metrics".
Metrics¶
Collect Azure PostgreSQL Metrics, more metrics can be collected through configuration Microsoft.DBforPostgreSQL/flexibleServers Supported Metrics
| Metric Name | Description | Unit |
|---|---|---|
all_connections_closed_per_second_maximum |
Number of connections closed per second on cache hit (instance-based) | count |
all_connections_created_per_second_maximum |
Number of connections created per second on cache hit (instance-based) | count |
allcache_read_maximum |
Cache read (instance-based) | bytes/s |
allcache_write_maximum |
Cache write (instance-based) | bytes/s |
allcachehits_total |
Number of cache hits (instance-based) | count |
allcachemisses_total |
Number of cache misses (instance-based) | count |
allconnectedclients_maximum |
Number of connected clients | count |
allevictedkeys_total |
Number of evicted keys (instance-based) | count |
allexpiredkeys_total |
Number of expired keys (instance-based) | count |
allgetcommands_total |
Number of gets (instance-based) | count |
alloperations_per_second_maximum |
Number of operations per second (instance-based) | count |
allpercentprocessortime_maximum |
CPU (instance-based) | % |
allserver_load_maximum |
Server load (instance-based) | % |
allsetcommands_total |
Number of sets (instance-based) | count |
alltotalcommandsprocessed_total |
Total number of operations (instance-based) | count |
alltotalkeys_maximum |
Total number of keys (instance-based) | count |
allusedmemory_maximum |
Used memory (instance-based) | bytes |
allusedmemory_rss_maximum |
Used memory RSS (instance-based) | bytes |
allusedmemorypercentage_maximum |
Percentage of used memory (instance-based) | % |
cache_read_maximum |
Cache read volume | bytes/s |
cache_write_maximum |
Cache write volume | bytes/s |
cachehits_total |
Number of cache hits | count |
cachemisses_total |
Number of cache misses | bytes |
cachemissrate_total |
Cache miss rate | bytes |
connected_clients_using_aadtoken_maximum |
Number of connected clients using Microsoft Entra token (instance-based) | count |
connectedclients_maximum |
Number of connected clients | count |
errors_maximum |
Number of errors | count |
evictedkeys_total |
Number of evicted keys | count |
expiredkeys_total |
Number of expired keys | count |
getcommands_total |
Number of gets | count |
latency_p_99_maximum |
99th percentile latency | ms |
operations_per_second_maximum |
Number of operations per second | count |
percent_processor_time_maximum |
CPU | % |
server_load_maximum |
Server load | - |
setcommands_total |
Number of sets | count |
totalcommandsprocessed_total |
Total number of operations | count |
usedmemory_rss_maximum |
Used memory RSS | bytes |
usedmemorypercentage_maximum |
Percentage of used memory | % |
maximum_used_transaction_ids_average |
The maximum number of transactions ID has been used. | count |
analyze_count_user_tables_maximum |
The number of times ANALYZE has been manually executed on the user table in the database. | count |
autoanalyze_count_user_tables_maximum |
The number of times ANALYZE is executed on the user table in the database by the autovacuum daemon. | count |
autovacuum_count_user_tables_maximum |
The number of times VACUUM is executed on the user table in the database by the autovacuum daemon. | count |
blks_hit_total |
The number of hits where the required disk block is already in the buffer cache and no disk read is required. | count |
blks_read_total |
The number of disk blocks read by the database. | count |
bloat_percent_maximum |
Estimated bloat percentage for user tables in the database, in preview. | % |
client_connections_active_maximum |
Number of client connections associated with PostgreSQL connections. | count |
client_connections_total_maximum |
Total number of client connections established to PgBouncer, including active, pending, and authenticated connections; in preview. | count |
client_connections_waiting_maximum |
Number of client connections waiting to be serviced by available PostgreSQL connections. | count |
connections_failed_total |
The number of failed connections. | count |
cpu_limit_maximum |
Logical vCore number for server configuration, in preview stage. | count |
deadlocks_total |
The number of deadlocks detected by the database. | count |
logical_replication_delay_in_bytes_maximum |
Maximum replication latency among all logical replication slots, in bytes. | B |
logical_replication_slot_sync_status_total |
Synchronization status of logical replication slots in a high availability environment. | count |
longest_query_time_sec_maximum |
The length of time that the current longest running query has been executed. | s |
longest_transaction_time_sec_maximum |
The duration of the longest-lasting transaction, including idle transactions. | s |
n_dead_tup_user_tables_maximum |
The estimated number of dead tuple rows for the user table in the database. | count |
n_live_tup_user_tables_maximum |
The estimated number of surviving rows for the user table in the database. | count |
n_mod_since_analyze_user_tables_maximum |
The estimated number of rows modified by the user table since the last ANALYZE. | count |
num_pools_maximum |
Total number of connection pools. | count |
numbackends_maximum |
The number of backend processes connected to the database. | count |
oldest_backend_time_sec_maximum |
The length of time that the earliest started backend process has existed, regardless of its current state. | s |
oldest_backend_xmin_maximum |
The earliest xmin transaction ID value. | count |
oldest_backend_xmin_age_maximum |
The age of the earliest xmin, which is the number of transactions that have passed since that xmin. | count |
physical_replication_delay_in_bytes_maximum |
Maximum replication latency among all asynchronous physical replication slots, in bytes. | B |
physical_replication_delay_in_seconds_maximum |
Replication latency for read replicas. | s |
postmaster_process_cpu_usage_percent_average |
Postmaster The CPU usage percentage of the Postmaster process; does not apply to Burstable SKU. | % |
server_connections_active_maximum |
Number of PostgreSQL server connections in use by clients. | count |
server_connections_idle_maximum |
Number of PostgreSQL server connections that are idle and available for new clients. | count |
sessions_by_state_maximum |
Number of sessions by backend process status. | count |
sessions_by_wait_event_type_maximum |
Number of sessions by backend process wait event type. | count |
tables_analyzed_user_tables_maximum |
Number of user tables in the database that have executed ANALYZE. | count |
tables_autoanalyzed_user_tables_maximum |
The number of user tables in the database that have been executed ANALYZE by the autovacuum daemon. | count |
tables_autovacuumed_user_tables_maximum |
The number of user tables in the database that have been executed VACUUM by the autovacuum daemon. | count |
tables_counter_user_tables_maximum |
The number of user tables in the database. | count |
tables_vacuumed_user_tables_maximum |
Number of user tables in the database that have executed VACUUM. | count |
tcp_connection_backlog_maximum |
Number of TCP connections waiting to be processed by the server; applicable to 8 vCore and above specifications. | count |
temp_bytes_total |
The total amount of data written to temporary files by database queries. | B |
temp_files_total |
Number of temporary files created by database queries. | count |
total_pooled_connections_maximum |
The current total number of pooled connections. | count |
tps_minimum |
Number of transactions performed per second, in preview phase. | count |
tup_deleted_total |
Database query deletes the number of rows. | count |
tup_fetched_total |
The number of rows extracted by the database query. | count |
tup_inserted_total |
Database query inserts the number of rows. | count |
tup_returned_total |
The number of rows returned by the database query. | count |
tup_updated_total |
The number of rows updated by the database query. | count |
vacuum_count_user_tables_maximum |
The number of times VACUUM has been manually executed on the user table in the database, excluding VACUUM FULL. | count |
xact_commit_total |
The number of committed transactions in the database. | count |
xact_rollback_total |
The number of transactions in the database that have been rolled back. | count |
xact_total_total |
The total number of transactions performed by the database. | count |