GCP Cloud SQL
Collect GCP Cloud SQL metrics
Configuration¶
Install Func¶
It is recommended to activate the Guance Integration - Extensions - DataFlux Func (Automata): all prerequisites are automatically installed. Please proceed with the script installation.
For self-deployment of Func, refer to Self-deploy Func
Install Script¶
-
Log in to the Func console, click [Script Market], enter the Guance script market, and search for
integration_gcp_cloudsql. -
Click [Install], then enter the corresponding parameters: account file name, Target Principal, account name.
-
Click [Deploy Startup Script]. The system will automatically create a
Startupscript set and configure the corresponding startup scripts. -
After activation, you can see the corresponding automatic trigger configuration in "Management / Automatic Trigger Configuration". Click [Execute] to immediately run it once without waiting for the scheduled time. Wait a moment, then you can check the execution task records and corresponding logs.
Verification¶
- In "Management / Automatic Trigger Configuration", confirm whether the corresponding task has the automatic trigger configuration. You can also check the corresponding task records and logs for any exceptions.
- In Guance, check "Infrastructure / Custom" to see if asset information exists.
- In Guance, check "Metrics" to see if there is corresponding monitoring data.
Metrics¶
GCP Cloud SQL metrics are under the gcp_cloudsql Measurement. Below are the metric descriptions.
GCP MySQL Metrics¶
| Metric | Original Metric | Description | Unit |
|---|---|---|---|
| database_cpu_reserved_cores | database/cpu/reserved_cores |
CPU reserved cores | Count |
| database_cpu_usage_time | database/cpu/usage_time |
CPU usage time | s |
| database_cpu_utilization | database/cpu/utilization |
CPU usage | % |
| database_disk_bytes_used_by_data_type | database/disk/bytes_used_by_data_type |
Bytes used | Bytes |
| database_disk_bytes_used | database/disk/bytes_used |
Bytes used | Bytes |
| database_disk_quota | database/disk/quota |
Disk quota | Bytes |
| database_disk_read_bytes_count | database/disk/read_bytes_count |
Disk read bytes | Bytes |
| database_disk_read_ops_count | database/disk/read_ops_count |
Disk read IO | Count |
| database_disk_write_ops_count | database/disk/write_ops_count |
Disk write IO | Count |
| database_disk_utilization | database/disk/utilization |
Disk utilization | % |
| database_disk_write_bytes_count | database/disk/write_bytes_count |
Disk write bytes | Bytes |
| database_instance_state | database/instance_state |
Instance state | Numeric |
| database_memory_components | database/memory/components |
Memory components | % |
| database_memory_quota | database/memory/quota |
Memory quota | Bytes |
| database_memory_total_usage | database/memory/total_usage |
Total memory usage | % |
| database_memory_usage | database/memory/usage |
Memory usage | Bytes |
| database_memory_utilization | database/memory/utilization |
Memory utilization | % |
| database_mysql_aborted_clients_count | database/mysql/aborted_clients_count |
MySQL aborted clients | Count |
| database_mysql_aborted_connects_count | database/mysql/aborted_connects_count |
MySQL aborted connections | Count |
| database_mysql_connections_count | database/mysql/connections_count |
MySQL connections | Count |
| database_mysql_ddl_operations_count | database/mysql/ddl_operations_count |
MySQL DDL operations | Count |
| database_mysql_dml_operations_count | database/mysql/dml_operations_count |
MySQL DML operations | Count |
| database_mysql_handler_operations_count | database/mysql/handler_operations_count |
MySQL handler operations | Count |
| database_mysql_innodb_active_transactions | database/mysql/innodb/active_transactions |
InnoDB active transactions | Count |
| database_mysql_innodb_active_trx_longest_time | database/mysql/innodb/active_trx_longest_time |
InnoDB longest active transaction time | Count |
| database_mysql_innodb_active_trx_rows_locked | database/mysql/innodb/active_trx_rows_locked |
InnoDB active transaction locked rows | Count |
| database_mysql_innodb_active_trx_rows_modified | database/mysql/innodb/active_trx_rows_modified |
InnoDB active transaction modified rows | Count |
| database_mysql_innodb_active_trx_total_time | database/mysql/innodb/active_trx_total_time |
InnoDB active transaction total time | s |
| database_mysql_innodb_adaptive_hash_operation_count | database/mysql/innodb/adaptive_hash_operation_count |
Innodb AHI operations | Count |
| database_mysql_innodb_ahi_search_count | database/mysql/innodb/ahi_search_count |
AHI or Btree searches | Count |
| database_mysql_innodb_buffer_flush_sync_waits_count | database/mysql/innodb/buffer_flush_sync_waits_count |
Innodb sync flush wait time | s |
| database_mysql_innodb_buffer_pool_pages | database/mysql/innodb/buffer_pool_pages |
InnoDB buffer pool pages | Count |
| database_mysql_innodb_buffer_pool_read_requests_count | database/mysql/innodb/buffer_pool_read_requests_count |
Innodb buffer pool read requests | Count |
| database_mysql_innodb_buffer_pool_reads_count | database/mysql/innodb/buffer_pool_reads_count |
Innodb buffer pool reads | Count |
| database_mysql_innodb_buffer_pool_write_requests_count | database/mysql/innodb/buffer_pool_write_requests_count |
InnoDB buffer pool write requests | Count |
| database_mysql_innodb_data_cache_cache_hit_count | database/mysql/innodb/data_cache/cache_hit_count |
MySQL data cache hits | Count |
| database_mysql_innodb_data_cache_cache_miss_count | database/mysql/innodb/data_cache/cache_miss_count |
MySQL data cache misses | Count |
| database_mysql_innodb_data_cache_pages | database/mysql/innodb/data_cache/pages |
Innodb pages in data cache | Count |
| database_mysql_innodb_data_fsyncs | database/mysql/innodb/data_pending_fsyncs |
InnoDB data pending fsyncs | Count |
| database_mysql_innodb_deadlocks_count | database/mysql/innodb/deadlocks_count |
InnoDB deadlocks | Count |
| database_mysql_innodb_dictionary_memory | database/mysql/innodb/dictionary_memory |
MySQL InnoDB dictionary cache | Bytes |
| database_mysql_innodb_history_list_length | database/mysql/innodb/history_list_length |
MySQL InnoDB dictionary cache | Bytes |
| database_mysql_innodb_ibuf_merge_operation_count | database/mysql/innodb/ibuf_merge_operation_count |
InnoDB merge records (by operation) | Count |
| database_mysql_innodb_ibuf_merges_count | database/mysql/innodb/ibuf_merges_count |
InnoDB change buffer merges | Count |
| database/mysql/innodb/innodb_log_waits_count | database/mysql/innodb/innodb_log_waits_count |
Transaction waits for Innodb log buffer flush | Count |
| database_mysql_innodb_lock_timeout_count | database/mysql/innodb/lock_timeout_count |
Innodb row lock wait timeouts | Count |
| database_mysql_innodb_lsn | database/mysql/innodb/lsn |
MySQL InnoDB dictionary cache | Bytes |
| database_mysql_innodb_operation_disk_io_count | database/mysql/innodb/operation_disk_io_count |
Disk IO performed by InnoDB | Count |
| database_mysql_innodb_os_log_fsyncs | database/mysql/innodb/os_log_fsyncs_count |
Innodb OS log fsyncs count | Count |
| database_mysql_innodb_os_log_pending_fsyncs | database/mysql/innodb/os_log_pending_fsyncs |
InnoDB OS log pending fsyncs | Count |
| database_mysql_innodb_os_log_pending_writes | database/mysql/innodb/os_log_pending_writes |
InnoDB OS log pending writes | Count |
| database_mysql_innodb_pages_read | database/mysql/innodb_pages_read |
Innodb pages read | Bytes |
| database_mysql_max_connections | database/mysql/max_connections |
MySQL max connections | Count |
| database_mysql_open_tables | database/mysql/open_tables |
MySQL open tables | Count |
| database_mysql_threads | database/mysql/threads |
MySQL threads | Count |
| database_network_connections | database/network/connections |
Cloud SQL connections | Count |
| database_network_received_bytes_count | database/mysql/open_tables |
MySQL open tables | Count |
| database_network_sent_bytes_count | database/network/received_bytes_count |
Bytes received | Bytes |
GCP PostgreSQL Metrics¶
| Metric | Original Metric | Description | Unit |
|---|---|---|---|
| database_postgresql_backends_in_wait | database/postgresql/backends_in_wait |
PostgreSQL backends waiting | Count |
| database_postgresql_blocks_read_count | database/postgresql/blocks_read_count |
Disk blocks read | Count |
| database_postgresql_checkpoint_count | database/postgresql/checkpoint_count |
CPU reserved cores | Count |
| database_postgresql_data_cache_hit_count | database/postgresql/data_cache/hit_count |
PostgreSQL data cache hits | Count |
| database_postgresql_data_cache_hit_ratio | database/postgresql/data_cache/hit_ratio |
PostgreSQL data cache hit ratio | % |
| database_postgresql_data_cache_miss_count | database/postgresql/data_cache/miss_count |
Cache misses | Count |
| database_postgresql_deadlock_count | database/postgresql/deadlock_count |
Deadlocks | Count |
| database_postgresql_insights_aggregate_execution_time | database/postgresql/insights/aggregate/execution_time |
Execution time | us |
| database_postgresql_insights_aggregate_io_time | database/postgresql/insights/aggregate/io_time |
IO time | us |
| database_postgresql_insights_aggregate_latencies | database/postgresql/insights/aggregate/latencies |
Latency | us |
| database_postgresql_insights_aggregate_lock_time | database/postgresql/insights/aggregate/lock_time |
Aggregate lock time | us |
| database_postgresql_insights_aggregate_shared_blk_access_count | database/postgresql/insights/aggregate/shared_blk_access_count |
Shared block cache access | Count |
| database_postgresql_insights_perquery_execution_time | database/postgresql/insights/perquery/execution_time |
Execution time per query | us |
| database_postgresql_insights_perquery_io_time | database/postgresql/insights/perquery/io_time |
IO time per query execution | us |
| database_postgresql_insights_perquery_latencies | database/postgresql/insights/perquery/latencies |
Latency per query | us |
| database_postgresql_insights_perquery_lock_time | database/postgresql/insights/perquery/lock_time |
Lock time per query | us |
| database_postgresql_insights_perquery_row_count | database/postgresql/insights/perquery/row_count |
Rows affected per query | Count |
| database_postgresql_insights_perquery_shared_blk_access_count | database/postgresql/insights/perquery/shared_blk_access_count |
Shared block cache access per query | Count |
| database_postgresql_insights_pertag_execution_time | database/postgresql/insights/pertag/execution_time |
Execution time per tag | us |
| database_postgresql_insights_pertag_io_time | database/postgresql/insights/pertag/io_time |
IO time per tag | Count |
| database_postgresql_insights_pertag_latencies | database/postgresql/insights/pertag/latencies |
Latency per tag | us |
| database_postgresql_insights_pertag_lock_time | database/postgresql/insights/pertag/lock_time |
Lock time per tag | us |
| database_postgresql_insights_pertag_row_count | database/postgresql/insights/pertag/row_count |
Rows affected per tag | Count |
| database_postgresql_insights_pertag_shared_blk_access_count | database/postgresql/backends_in_wait |
Shared block cache accessed per tag | Count |
| database_postgresql_new_connection_count | database/postgresql/new_connection_count |
PostgreSQL new connections | Count |
| database_postgresql_num_backends | database/postgresql/num_backends |
PostgreSQL connections | Count |
| database_postgresql_num_backends_by_state | database/postgresql/num_backends_by_state |
PostgreSQL connections by state | Count |
| database_postgresql_replication_replica_byte_lag | database/postgresql/backends_in_wait |
Bytes lagged | B |
| database_postgresql_statements_executed_count | database/postgresql/statements_executed_count |
Statements executed | Count |
| database_postgresql_temp_bytes_written_count | database/postgresql/temp_bytes_written_count |
Data written to temp files (bytes) | B |
| database_postgresql_temp_files_written_count | database/postgresql/temp_files_written_count |
Temp files used for writes | Count |
| database_postgresql_transaction_count | database/postgresql/transaction_count |
Number of transactions | Count |
| database_postgresql_transaction_id_utilization | database/postgresql/transaction_id_utilization |
Transaction ID utilization | % |
| database_postgresql_tuple_size | database/postgresql/tuple_size |
Number of tuples (rows) in database | Count |
| database_postgresql_tuples_fetched_count | database/postgresql/tuples_fetched_count |
Tuples fetched | Count |
| database_postgresql_tuples_processed_count | database/postgresql/tuples_processed_count |
Rows processed | % |
| database_postgresql_tuples_returned_count | database/postgresql/tuples_returned_count |
Tuples returned | % |
| database_postgresql_vacuum_oldest_transaction_age | database/postgresql/vacuum/oldest_transaction_age |
Age of oldest transaction | s |
| database_postgresql_write_ahead_log_flushed_bytes_count | database/postgresql/write_ahead_log/flushed_bytes_count |
PostgreSQL WAL flushed bytes | B |
| database_postgresql_write_ahead_log_written_bytes_count | database/postgresql/write_ahead_log/written_bytes_count |
PostgreSQL WAL written bytes | B |
| database_replication_log_archive_failure_count | database/replication/log_archive_failure_count |
Log archive failures | B |
| database_replication_log_archive_success_count | database/replication/log_archive_success_count |
Number of logs successfully archived | Count |
GCP SQLServer Metrics¶
| Metric | Original Metric | Description | Unit |
|---|---|---|---|
| database_sqlserver_audits_size | database/sqlserver/audits_size |
Size of stored audit files | Bytes |
| database_sqlserver_audits_upload_count | database/sqlserver/audits_upload_count |
Total audits successfully uploaded | Count |
| database_sqlserver_connections_connection_reset_count | database/sqlserver/connections/connection_reset_count |
Connection resets | Count |
| database_sqlserver_connections_login_attempt_count | database/sqlserver/connections/login_attempt_count |
Login attempts | Count |
| database_sqlserver_connections_processes_blocked | database/sqlserver/connections/processes_blocked |
Blocked processes | Count |
| database_sqlserver_data_cache_hit_count | database/sqlserver/data_cache/hit_count |
SQL Server data cache hits | Count |
| database_sqlserver_data_cache_hit_ratio | database/sqlserver/data_cache/hit_ratio |
SQL Server data cache hit ratio | % |
| database_sqlserver_data_cache_miss_count | database/sqlserver/data_cache/miss_count |
SQL Server data cache misses | Count |
| database_sqlserver_databases | database/sqlserver/databases |
SQL Server databases | Count |
| database_sqlserver_memory_buffer_cache_hit_ratio | database/sqlserver/memory/buffer_cache_hit_ratio |
Buffer cache hit ratio | % |
| database_sqlserver_memory_free_list_stall_count | database/sqlserver/memory/free_list_stall_count |
Free list stalls | Count |
| database_sqlserver_memory_lazy_write_count | database/sqlserver/memory/lazy_write_count |
Lazy writes | Count |
| database_sqlserver_memory_memory_grants_pending | database/sqlserver/memory/memory_grants_pending |
Pending memory grants | Count |
| database_sqlserver_memory_page_life_expectancy | database/sqlserver/memory/page_life_expectancy |
Page life expectancy | s |
| database_sqlserver_replication_bytes_sent_to_replica_count | database/sqlserver/replication/bytes_sent_to_replica_count |
Bytes sent to replica | Bytes |
| database_sqlserver_replication_log_apply_pending_queue | database/sqlserver/replication/log_apply_pending_queue |
Log apply pending queue | Count |
| database_sqlserver_replication_log_bytes_received_count | database/sqlserver/replication/log_bytes_received_count |
Log bytes received | Bytes |
| database_sqlserver_replication_recovery_queue | database/sqlserver/replication/recovery_queue |
Recovery queue | Count |
| database_sqlserver_replication_redone_bytes_count | database/sqlserver/replication/redone_bytes_count |
Bytes redone | Bytes |
| database_sqlserver_replication_resent_message_count | database/sqlserver/replication/resent_message_count |
Messages resent | Count |
| database_sqlserver_schedulers_active_workers | database/sqlserver/schedulers/active_workers |
Active workers per scheduler | Count |
| database_sqlserver_schedulers_by_status | database/sqlserver/schedulers/by_status |
Number of schedulers | Count |
| database_sqlserver_schedulers_current_tasks | database/sqlserver/schedulers/current_tasks |
Current tasks per scheduler | Count |
| database_sqlserver_schedulers_current_workers | database/sqlserver/schedulers/current_workers |
Number of workers per scheduler | Count |
| database_sqlserver_schedulers_pending_disk_io | database/sqlserver/schedulers/pending_disk_io |
Pending I/O operations per scheduler | Count |
| database/sqlserver/schedulers/runnable_tasks | database/sqlserver/schedulers/runnable_taskss |
Number of workers with assigned tasks per scheduler | Count |
| database_sqlserver_schedulers_work_queue | database/sqlserver/schedulers/work_queue |
Pending tasks per scheduler | Count |
| database_sqlserver_server_principals | database/sqlserver/server_principals |
Server principals | Count |
| database_sqlserver_sql_agent_jobs | database/sqlserver/sql_agent/jobs |
SQL Server agent jobs | Count |
| database_sqlserver_transactions_batch_request_count | database/sqlserver/transactions/batch_request_count |
Batch requests | Count |
| database_sqlserver_transactions_deadlock_count | database/sqlserver/transactions/deadlock_count |
Deadlocks | Count |
| database_sqlserver_transactions_forwarded_record_count | database/sqlserver/transactions/forwarded_record_count |
Forwarded records | Count |
| database_sqlserver_transactions_full_scan_count | database/sqlserver/transactions/full_scan_count |
Full scans | Count |
| database_sqlserver_transactions_lock_wait_count | database/sqlserver/transactions/lock_wait_count |
Lock waits | Count |
| database_sqlserver_transactions_lock_wait_time | database/sqlserver/transactions/lock_wait_time |
Lock wait time | ms |
| database_sqlserver_transactions_log_bytes_flushed_count | database/sqlserver/transactions/log_bytes_flushed_count |
Log bytes flushed | Bytes |
| database_sqlserver_transactions_page_split_count | database/sqlserver/transactions/page_split_count |
Page splits | Count |
| database_sqlserver_transactions_probe_scan_count | database/sqlserver/transactions/probe_scan_count |
Probe scans | Count |
| database_sqlserver_transactions_sql_compilation_count | database/sqlserver/transactions/sql_compilation_count |
SQL compilations | Count |
| database_sqlserver_transactions_sql_recompilation_count | database/sqlserver/transactions/sql_recompilation_count |
SQL recompilations | Count |
| database_sqlserver_transactions_transaction_count | database/sqlserver/transactions/transaction_count |
Transactions started | Count |
| database_sqlserver_xevents_size | database/sqlserver/xevents_size |
Size of stored XEvents files | Bytes |
| database_sqlserver_xevents_upload_count | database/sqlserver/xevents_upload_count |
Total XEvents successfully uploaded | Count |
| database_state | database/state |
State | - |