Skip to content
logo
Percona Monitoring and Management
Google Cloud Platform
Initializing search
    percona/pmm-doc
    percona/pmm-doc
    • Welcome
    • Setting up
      • Server
        • Network
        • Docker
        • Podman
        • Helm
        • Virtual Appliance
        • AWS Marketplace
        • Easy-install script
      • Client
        • MySQL
        • MongoDB
        • PostgreSQL
        • ProxySQL
        • Amazon RDS
        • Microsoft Azure
        • Google Cloud Platform
          • MySQL
          • PostgreSQL
          • Cloud SQL Proxy
            • MySQL
            • PostgreSQL
        • Linux
        • External Services
        • HAProxy
        • Remote instances
    • Get started
      • User Interface
      • Percona Alerting
      • Backup and Restore
        • Prepare a storage location
        • MongoDB backups
          • MongoDB backup prerequisites
          • Create MongoDB on-demand and scheduled backups
          • Create MongoDB PITR backups
          • Restore a MongoDB backup
          • MongoDB Backup and Restore support matrix
        • MySQL backups
          • MySQL backup prerequisites
          • Create a MySQL backup
          • Restore a MySQL backup
        • Edit a scheduled backup
        • Delete a backup
      • Roles and permissions
        • Configure access control
        • Labels for access control
        • Create access roles
        • Manage access roles
        • Assign roles to users
        • Use Case
      • Query Analytics
      • Working with Advisors
    • How to
      • Configure
      • Manage users
      • Upgrade
      • Secure
      • Optimize
      • Annotate
      • Share dashboards and panels
      • Extend Metrics
      • Resolve issues
      • Integrate with Percona Platform
        • Check Percona Portal account information
    • Details
      • Architecture
      • UI components
      • PMM components and versions
      • Data handling in PMM
      • Develop Advisor checks
      • PMM Inventory
      • Dashboards
        • Manage dashboards
          • Insight
            • Advanced Data Exploration
            • VictoriaMetrics
            • VictoriaMetrics Agents Overview
          • Environments
            • Environment Summary
          • Kubernetes
            • Kubernetes Pods Status
            • Kubernetes Volumes
          • DBaas
          • OS Dashboards
            • Disk Details
            • Network Details
            • Memory Details
            • Node Temperature Details
            • Nodes Compare
            • Nodes Overview
            • Node Summary
            • NUMA Details
            • Processes Details
          • Prometheus Dashboards
            • Prometheus Exporters Overview
          • MySQL Dashboards
            • MySQL Command/Handler Counters Compare
            • MySQL InnoDB Compression Details
            • MySQL InnoDB Details
            • MySQL MyISAM/Aria Details
            • MySQL MyRocks Details
            • MySQL Instance Summary
            • MySQL Instances Compare
            • MySQL Instances Overview
            • MySQL Wait Event Analyses Details
            • MySQL Performance Schema Details
            • MySQL Query Response Time Details
            • MySQL Replication Summary
            • MySQL Group Replication Summary
            • MySQL Table Details
            • MySQL User Details
            • MySQL TokuDB Details
          • MongoDB Dashboards
            • Experimental MongoDB Collection Details
            • Experimental MongoDB Oplog Details
            • MongoDB Cluster Summary
            • MongoDB Instance Summary
            • MongoDB Instances Overview
            • MongoDB Instances Compare
            • MongoDB ReplSet Summary
            • MongoDB InMemory Details
            • MongoDB MMAPv1 Details
            • MongoDB WiredTiger Details
          • PostgreSQL Dashboards
            • PostgreSQL Instance Summary
            • PostgreSQL Instances Compare
            • Experimental PostgreSQL Vacuum Monitoring
          • ProxySQL Dashboards
          • HA Dashboards
            • PXC/Galera Cluster Summary
            • Experimental PXC/Galera Cluster Summary
            • PXC/Galera Nodes Compare
            • HAProxy Instance Summary
      • Commands
        • pmm-admin - PMM Administration Tool
        • pmm-agent - PMM Client agent
      • API
      • VictoriaMetrics
      • ClickHouse
      • PostgreSQL
      • Glossary
      • Introduction
      • DBaaS architecture
        • Setting up DBaaS
        • Create a Kubernetes Cluster
        • Deleting Kubernetes clusters
        • Activating DBaaS
        • Add a Kubernetes cluster automatically
        • Add a Kubernetes cluster manually
        • Manage allowed component versions
          • OLM installation
          • Operators installation
        • Add a DB Cluster
        • Manage a DB Cluster
        • Delete a DB Cluster
        • Create a database cluster from a template
      • Backup and restore
    • FAQ
    • Release Notes
      • PMM 2.39.0
      • PMM 2.38.1
      • PMM 2.38.0
      • PMM 2.37.1
      • PMM 2.37.0
      • PMM 2.36.0
      • PMM 2.35.0
      • PMM 2.34.0
      • PMM 2.33.0
      • PMM 2.32.0
      • PMM 2.31.0
      • PMM 2.30.0
      • PMM 2.29.1
      • PMM 2.29.0
      • PMM 2.28.0
      • PMM 2.27.0
      • PMM 2.26.0
      • PMM 2.25.0
      • PMM 2.24.0
      • PMM 2.23.0
      • PMM 2.22.0
      • PMM 2.21.0
      • PMM 2.20.0
      • PMM 2.19.0
      • PMM 2.18.0
      • PMM 2.17.0
      • PMM 2.16.0
      • PMM 2.15.1
      • PMM 2.15.0
      • PMM 2.14.0
      • PMM 2.13.0
      • PMM 2.12.0
      • PMM 2.11.1
      • PMM 2.11.0
      • PMM 2.10.1
      • PMM 2.10.0
      • PMM 2.9.1
      • PMM 2.9.0
      • PMM 2.8.0
      • PMM 2.7.0
      • PMM 2.6.1
      • PMM 2.6.0
      • PMM 2.5.0
      • PMM 2.4.0
      • PMM 2.3.0
      • PMM 2.2.2
      • PMM 2.2.1
      • PMM 2.2.0
      • PMM 2.1.0
      • PMM 2.0.1
      • PMM 2.0.0
      • Copyright and licensing information
      • Trademark policy

    • MySQL
    • PostgreSQL
    • Cloud SQL Proxy
      • MySQL
      • PostgreSQL

    Google Cloud Platform¶

    PMM can monitor MySQL or PostgreSQL instances hosted on the Google Cloud Platform.

    The connection can be direct, or indirect using Cloud SQL Proxy.

    MySQL¶

    1. Set up a MySQL instance on Google Cloud.

    2. The database server must be accessible by PMM Client. If PMM Client is not also hosted on GCP, you will need to add a network interface with a public interface.

    3. Configure Performance Schema on the MySQL server. Using the GCP console’s Cloud Shell or your own gcloud installation, run:

      gcloud sql instances patch <instance_name> --database-flags performance_schema=on
      
    4. Log into the PMM user interface.

    5. Select Configuration → PMM Inventory → Add Instance.

    6. Click MySQL Add a remote instance.

    7. Fill in the details for the remote MySQL instance.

      • Ensure Use performance schema is selected.
    8. Click Add service.

    9. Check for values in the MySQL Instance Overview dashboard and in Query Analytics.

    PostgreSQL¶

    1. Set up a PostgreSQL instance on Google Cloud.

    2. The database server must be accessible by PMM Client. If PMM Client is not also hosted on GCP, you will need to add a network interface with a public interface.

    3. Configure pg_stat_statements. Open an interactive SQL session with your GCP PostgreSQL server and run:

      CREATE EXTENSION pg_stat_statements;
      
    4. Log into the PMM user interface.

    5. Select Configuration → PMM Inventory → Add Instance.

    6. Select PostgreSQL Add a remote instance.

    7. Fill in the details for the remote PostgreSQL instance:

      • In Stat tracking options, select PG Stat Statements.
    8. Click Add service.

    9. Check for values in the PostgreSQL Instance Overview dashboard and Query Analytics.

    Cloud SQL Proxy¶

    MySQL¶

    1. Create instance on GCP.

    2. Note connection as <project_id>:<zone>:<db_instance_name>.

    3. Enable Admin API and download the JSON credential file.

    4. Enable Performance Schema.

    5. Run Cloud SQL Proxy (runs on PMM Client node).

      • As a Docker container:

        docker run -d \
        -v ~/path/to/admin-api-file.json:/config \
        -p 127.0.0.1:3306:3306 \
        gcr.io/cloudsql-docker/gce-proxy:1.19.1 \
        /cloud_sql_proxy \
        -instances=example-project-NNNN:us-central1:mysql-for-pmm=tcp:0.0.0.0:3306 \
        -credential_file=/config
        
      • On Linux:

        wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O cloud_sql_proxy
        chmod +x cloud_sql_proxy
        ./cloud_sql_proxy -instances=example-project-NNNN:us-central1:mysql-for-pmm=tcp:3306 \
        -credential_file=/path/to/credential-file.json
        
    6. Add instance.

      pmm-admin add mysql --host=127.0.0.1 --port=3306 \
      --username=root --password=secret \
      --service-name=MySQLGCP --query-source=perfschema
      

    PostgreSQL¶

    1. Create instance on GCP.

    2. Note connection as <project_id>:<zone>:<db_instance_name>.

    3. Enable Admin API and download the JSON credential file.

    4. Run Cloud SQL Proxy.

      ./cloud_sql_proxy -instances=example-project-NNNN:us-central1:pg-for-pmm=tcp:5432 \
      -credential_file=/path/to/credential-file.json
      
    5. Log into PostgreSQL.

    6. Load extension:

      CREATE EXTENSION pg_stat_statements;
      
    7. Add service:

      pmm-admin add postgresql --host=127.0.0.1 --port=5432 \
      --username="postgres" --password=secret --service-name=PGGCP
      

    Contact us

    For free technical help, visit the Percona Community Forum.

    To report bugs or submit feature requests, open a JIRA ticket.

    For paid support and managed or consulting services , contact Percona Sales.


    Last update: 2023-09-27
    Percona LLC, © 2023
    Made with Material for MkDocs

    Cookie consent

    We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better. Read more about Percona Cookie Policy.