Google Cloud SQL

개요

Google Cloud SQL은 완전관리형 데이터베이스 서비스로, 클라우드에서 SQL 데이터베이스를 쉽게 설정, 유지, 관리 및 운영할 수 있습니다.

Google Cloud SQL 메트릭을 수집하면 다음을 할 수 있습니다.

  • Cloud SQL 데이터베이스의 성능을 시각화합니다.
  • Cloud SQL 데이터베이스의 성능과 애플리케이션의 상관 관계를 파악합니다.

설정

설치

메트릭 수집

아직 설치하지 않았다면 먼저 Google 클라우드 플랫폼 통합을 설정합니다. 그 외 다른 설치가 필요하지 않습니다.

설정

커스텀 Cloud SQL 레이블을 태그로 수집하려면 클라우드 에셋 인벤토리 권한을 활성화합니다.

로그 수집

로그 수집은 이 사이트에서 지원되지 않습니다.

Google Cloud SQL 로그는 Google Cloud Logging으로 수집하여 클라우드 Pub/Sub 토픽을 통해 데이터 플로우 작업으로 전송됩니다. 아직 설정하지 않았다면 Datadog 데이터 플로우 템플릿으로 로깅을 설정하세요.

해당 작업이 완료되면 Google Cloud Logging에서 Google Cloud SQL 로그를 다음 Pub/Sub 주제로 내보냅니다.

  1. Google Cloud Logging 페이지로 이동해 Google Cloud SQL 로그를 필터링하세요.
  2. Create Sink를 클릭하고 그에 따라 싱크 이름을 지정합니다.
  3. “Cloud Pub/Sub"를 대상으로 선택하고 해당 목적으로 생성된 Pub/Sub 주제를 선택합니다. 참고: Pub/Sub 주제는 다른 프로젝트에 있을 수 있습니다.
  4. Create를 클릭하고 확인 메시지가 나타날 때까지 기다립니다.

수집한 데이터

메트릭

gcp.cloudsql.database.auto_failover_request_count
(count)
Delta of number of instance auto-failover requests.
Shown as request
gcp.cloudsql.database.available_for_failover
(gauge)
This is > 0 if the failover operation is available on the instance.
gcp.cloudsql.database.cpu.reserved_cores
(gauge)
Number of cores reserved for the database.
Shown as core
gcp.cloudsql.database.cpu.usage_time
(gauge)
Cumulative CPU usage time
Shown as second
gcp.cloudsql.database.cpu.utilization
(gauge)
Fraction of the reserved CPU that is currently in use.
Shown as fraction
gcp.cloudsql.database.disk.bytes_used
(gauge)
Disk space used.
Shown as byte
gcp.cloudsql.database.disk.quota
(gauge)
Maximum data disk size in bytes.
Shown as byte
gcp.cloudsql.database.disk.read_ops_count
(count)
Disk read IO operations.
Shown as operation
gcp.cloudsql.database.disk.utilization
(gauge)
The fraction of the disk quota that is currently in use.
Shown as fraction
gcp.cloudsql.database.disk.write_ops_count
(count)
Disk write IO operations.
Shown as operation
gcp.cloudsql.database.instance_state
(gauge)
Serving state of the Cloud SQL instance
gcp.cloudsql.database.memory.quota
(gauge)
Maximum RAM in bytes
Shown as byte
gcp.cloudsql.database.memory.total_usage
(gauge)
Total RAM usage in bytes including buffer cache
Shown as byte
gcp.cloudsql.database.memory.usage
(gauge)
RAM usage in bytes
Shown as byte
gcp.cloudsql.database.memory.utilization
(gauge)
Fraction of memory quota currently in use
Shown as fraction
gcp.cloudsql.database.mysql.innodb_buffer_pool_pages_dirty
(gauge)
Number of unflushed pages in the InnoDB buffer pool.
Shown as page
gcp.cloudsql.database.mysql.innodb_buffer_pool_pages_free
(gauge)
Number of unused pages in the InnoDB buffer pool.
Shown as page
gcp.cloudsql.database.mysql.innodb_buffer_pool_pages_total
(gauge)
Total number of pages in the InnoDB buffer pool.
Shown as page
gcp.cloudsql.database.mysql.innodb_data_fsyncs
(count)
InnoDB fsync calls.
Shown as operation
gcp.cloudsql.database.mysql.innodb_os_log_fsyncs
(count)
InnoDB fsync calls to the log file.
Shown as operation
gcp.cloudsql.database.mysql.innodb_pages_read
(count)
InnoDB pages read.
Shown as page
gcp.cloudsql.database.mysql.innodb_pages_written
(count)
InnoDB pages written.
Shown as page
gcp.cloudsql.database.mysql.queries
(count)
Number of query statements executed by the server.
Shown as query
gcp.cloudsql.database.mysql.questions
(count)
Number of question statements executed by the server. Includes only statements sent to the server by clients and not statements executed within stored programs
Shown as question
gcp.cloudsql.database.mysql.received_bytes_count
(count)
Delta count of bytes received by MySQL process.
Shown as byte
gcp.cloudsql.database.mysql.replication.last_io_errno
(gauge)
Error number of most recent error that caused I/O thread to stop
Shown as second
gcp.cloudsql.database.mysql.replication.last_sql_errno
(gauge)
Error number of most recent error that caused SQL thread to stop
Shown as second
gcp.cloudsql.database.mysql.replication.seconds_behind_master
(gauge)
Approximate number of seconds the read replica is behind its' master.
Shown as second
gcp.cloudsql.database.mysql.replication.slave_io_running
(gauge)
Indicates whether the I/O thread for reading the master's binary log is running. Possible values are Yes, No, and Connecting.
gcp.cloudsql.database.mysql.replication.slave_io_running_state
(gauge)
Indicates whether the I/O thread for reading the master's binary log is running. Possible values are Yes, No, and Connecting, values exposed through 'state' field.
gcp.cloudsql.database.mysql.replication.slave_sql_running
(gauge)
Indicates whether the SQL thread for executing events in the relay log is running
gcp.cloudsql.database.mysql.replication.slave_sql_running_state
(gauge)
Indicates whether the SQL thread for executing events in the relay log is running, values exposed through 'state' field
gcp.cloudsql.database.mysql.sent_bytes_count
(count)
Delta count of bytes sent by MySQL process.
Shown as byte
gcp.cloudsql.database.network.connections
(gauge)
Number of connections to the Cloud SQL instance.
Shown as connection
gcp.cloudsql.database.network.received_bytes_count
(count)
Delta count of bytes received through the network.
Shown as byte
gcp.cloudsql.database.network.sent_bytes_count
(count)
Number of bytes sent through the network.
Shown as byte
gcp.cloudsql.database.postgresql.insights.aggregate.execution_time
(gauge)
Accumulated query execution time per user per database
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.aggregate.io_time
(gauge)
Accumulated IO time per user per database
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.aggregate.latencies.avg
(gauge)
Average Query latency distribution per user per database
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.aggregate.latencies.p95
(gauge)
The 95th percentile of the Query latency distribution per user per database
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.aggregate.latencies.p99
(gauge)
The 99th percentile of the Query latency distribution per user per database
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.aggregate.latencies.sumsqdev
(gauge)
Sum of Squared Deviation for the Query latency distribution per user per database
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.aggregate.latencies.samplecount
(gauge)
Sample Counts of the Query latency distribution per user per database
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.aggregate.lock_time
(gauge)
Accumulated lock wait time per user per database
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.aggregate.row_count
(count)
Total number of retrieved or affected rows per database
gcp.cloudsql.database.postgresql.insights.aggregate.shared_blk_access_count
(count)
Shared blocks accessed by statement execution
gcp.cloudsql.database.postgresql.insights.perquery.execution_time
(gauge)
Accumulated execution times per user per database per query.
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.perquery.io_time
(gauge)
Accumulated IO time per user per query
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.perquery.latencies
(gauge)
Query latency distribution per user per query
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.perquery.lock_time
(gauge)
Accumulated lock wait time per user per query
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.perquery.row_count
(count)
Total number of retrived or affected rows per query
gcp.cloudsql.database.postgresql.insights.perquery.shared_blk_access_count
(count)
Shared blocks accessed by statement execution per query
gcp.cloudsql.database.postgresql.insights.pertag.execution_time
(gauge)
Accumulated execution time per user per database per tag
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.pertag.io_time
(gauge)
Accumulated IO write time per user per database per tag
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.pertag.latencies
(gauge)
Query latency distribution per user per database per tag
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.pertag.lock_time
(gauge)
Accumulated lock wait time per user per database per tag
Shown as microsecond
gcp.cloudsql.database.postgresql.insights.pertag.row_count
(count)
Total number of retrieved or affected rows
gcp.cloudsql.database.postgresql.insights.pertag.shared_blk_access_count
(count)
Shared blocks accessed by statement execution
gcp.cloudsql.database.postgresql.backends_in_wait
( gauge)
Number of backends in wait in postgres instance.
Shown as connection
gcp.cloudsql.database.postgresql.num_backends
(gauge)
Number of connections to the Cloud SQL PostgreSQL instance.
Shown as connection
gcp.cloudsql.database.postgresql.num_backends_by_application
(gauge)
Number of connections to the Cloud SQL PostgreSQL instance, grouped by applications.
Shown as connection
gcp.cloudsql.database.postgresql.num_backends_by_state
(gauge)
Number of connections to the Cloud SQL PostgreSQL instance, grouped by its state.
Shown as connection
gcp.cloudsql.database.postgresql.replication.replica_byte_lag
(gauge)
Replication lag in bytes
Shown as byte
gcp.cloudsql.database.postgresql.transaction_count
(count)
Delta count of number of transactions.
Shown as transaction
gcp.cloudsql.database.postgresql.transaction_id_count
(count)
Delta count of transaction ID. The tag 'action' describes the type of action, which is either "assigned" (count of transaction IDs assigned and consumed by the instance) or "frozen" (count of transaction IDs replenished by the VACUUM's freeze operation).
gcp.cloudsql.database.postgresql.oldest_transaction_age
(gauge)
Age of the oldest transaction yet to be vacuumed in the Cloud SQL PostgreSQL instance, measured in number of transactions that have happened since the oldest transaction
Shown as transaction
gcp.cloudsql.database.replication.network_lag
(gauge)
Indicates time taken from primary binary log to IO thread on replica
Shown as second
gcp.cloudsql.database.replication.replica_lag
(gauge)
Number of seconds read replica is behind primary
Shown as second
gcp.cloudsql.database.replication.state
(gauge)
Current serving state of replication
gcp.cloudsql.database.state
(gauge)
Current serving state of Cloud SQL instance
gcp.cloudsql.database.up
(gauge)
Indicates if the server is up or not.
gcp.cloudsql.database.uptime
(gauge)
Number of seconds the instance has been running.
Shown as second

이벤트

Google Cloud SQL 통합은 이벤트를 포함하지 않습니다.

서비스 점검

gcp.cloudsql.database.state Cloud SQL 인스턴스의 현재 서비스 상태입니다.

트러블슈팅

도움이 필요하신가요? Datadog 지원팀에 문의하세요.