API referenceConsole
Cloud provider

Google Cloud

Polylane maps Cloud Run, GKE and Cloud SQL, reads logs, metrics and traces to spot issues, investigates Cloud Monitoring alerts as they fire, and writes the fix.

Connect

Infrastructure Manager deployment, or the Polylane Terraform module.

Connect one Google Cloud project with Infrastructure Manager or with the Polylane Terraform module. Setup uses temporary Google access. Ongoing reads use a separate reader identity with short-lived credentials and no service account key.

  1. Open Settings → Clouds → Connect → Google Cloud, then choose Continue with Google.
  2. Authorize a Google project administrator account, select one project and review the installation. Billing must be enabled on the project.
  3. Leave Investigate alerts on to have Polylane investigate your Cloud Monitoring alerts.
  4. Choose Connect project. Polylane turns on the APIs, prepares the installer and sends the deployment to Infrastructure Manager.
  5. Setup continues in the background. You can close the panel or the browser. Temporary Google access expires within one hour. If setup needs it, choose Authorize again to resume.
  6. After the deployment, Polylane checks the access and registers the project. Then the first inventory sync starts. Registration can finish before resources appear.

Your Google account needs permission to provision resources and to use the installer service account. Workspace members need cloud-account write permission to start a connection, and delete permission to cancel or disconnect one.

The deployment creates these items in the project:

  • An installer service account whose name ends in -im. It keeps its provisioning roles so that you can update or delete the deployment later.
  • A reader service account and a workload identity pool, so that Polylane gets short-lived reader tokens without a key.
  • A Cloud Asset Inventory feed and a log sink, each with a Pub/Sub topic and a push subscription to Polylane.
  • When Investigate alerts is on, a custom role for alert maintenance and a push service account for alerts.

Saved setup: A pending request lasts seven days. If this browser has no saved setup, reopen Google Cloud in the same workspace and sign in as the person who started it. Choose Resume setup for the matching project and deployment. If this browser restores a script-based request, run its prefilled script in Cloud Shell or a terminal signed in with gcloud, then choose Verify and connect.

How it works

Access

The reader identity gets Google tokens that expire after 15 minutes. It reads Cloud Asset Inventory, Logging, Monitoring, Cloud Trace, IAM policies, and the configuration of services such as Compute Engine, Cloud Run, Cloud Functions, Cloud SQL, Spanner, AlloyDB, BigQuery, Memorystore, Cloud DNS, Artifact Registry, Cloud Build, Cloud Deploy and GKE. It cannot read secret payloads, BigQuery table rows, Storage objects or artifact contents. It does not get the installer permissions.

Infrastructure graph

Polylane syncs the project every 15 minutes. It maps Compute Engine, networks and load balancers, Cloud Run, Cloud Functions, GKE clusters and node pools, Pub/Sub, Cloud Scheduler, Cloud Tasks, Workflows, Storage, Cloud SQL, Memorystore, Firestore, BigQuery datasets, Spanner, AlloyDB, Bigtable, Dataflow, Dataproc, IAM, KMS, Secret Manager, Artifact Registry, Cloud Build, Cloud Deploy and Vertex AI. For each GKE cluster, it also maps namespaces, nodes, workloads, pods, services and ingresses.

Between syncs, the asset feed sends resource changes to Polylane. The log sink sends Pub/Sub and Storage admin activity, which starts a direct read of the changed resource.

Metrics, logs and traces

Polylane reads Cloud Monitoring metrics for about 34 resource types and checks production resources for anomalies. Resource pages show logs for Cloud Run, Cloud Functions, Compute Engine, Cloud SQL, Memorystore, Pub/Sub, Storage, Cloud Tasks and GKE workloads. During an investigation, agents query Cloud Logging, Cloud Monitoring and Cloud Trace, and call read-only Google APIs in the connected project.

Alerts

When Investigate alerts is on, Polylane adds its own Pub/Sub notification channel to each of your Cloud Monitoring alert policies. It checks for new policies on each sync. It changes only the channel list. Your conditions, severity, other channels and enabled state stay the same. Polylane creates no alert policies.

Each alert becomes an issue, and a new issue starts an investigation. Repeat notifications for the same Google Monitoring incident go to the same issue. When the incident closes, Polylane adds the recovery to the issue. Each sync also reads open Google alerts, to find closures that Google did not deliver.

GKE and agent writes

Agents read GKE objects, live pod logs and resource usage through the cluster API. To let agents scale, restart or patch GKE workloads, set gke_operations_enabled in the setup module, then turn off Read-only for the account. Each write needs a safety review and your approval before it runs. Background runs stay read-only.

Alert delivery

Notifications carry the Google incident ID, policy and condition, state, timestamps, severity and resource labels.

Google's policy update API replaces the full channel list and has no conditional update. Polylane reads each policy just before it changes the channel list. Tell your administrators to coordinate edits to the channel list of a policy.

Errors with alert setup show on the project settings page. Fix the access or the channel limit, then turn the setting on again or sync the account. For an existing connection without alert access, choose Prepare alert access setup, run the permissions-only script as a project administrator, then turn on the setting.

Turning the setting off removes the channel of this connection from your policies, and deletes its alert topic and push subscription.

Alert permissions

Alert maintenance uses a custom project role with these permissions:

  • Policy maintenance: monitoring.alertPolicies.get, monitoring.alertPolicies.list, monitoring.alertPolicies.update.
  • Incident closure reads: monitoring.alerts.get.
  • Owned channel lifecycle: monitoring.notificationChannels.get, monitoring.notificationChannels.list, monitoring.notificationChannels.create, monitoring.notificationChannels.delete.
  • Delivery topic lifecycle and publisher grant: pubsub.topics.create, pubsub.topics.get, pubsub.topics.delete, pubsub.topics.getIamPolicy, pubsub.topics.setIamPolicy, pubsub.topics.attachSubscription.
  • Push subscription lifecycle: pubsub.subscriptions.create, pubsub.subscriptions.get, pubsub.subscriptions.delete.

IAM cannot limit the policy update permission to the channel list. The Polylane maintenance client applies that limit. The reader also gets roles/iam.serviceAccountUser on the push service account of this connection only. Monitoring's service-PROJECT_NUMBER@gcp-sa-monitoring-notification.iam.gserviceaccount.com gets roles/pubsub.publisher on the alert topic. The reader gets no project IAM administration, role administration or Monitoring Editor role.

The permissions-only script needs iam.roles.get, iam.roles.create or iam.roles.update, resourcemanager.projects.getIamPolicy, resourcemanager.projects.setIamPolicy, iam.serviceAccounts.getIamPolicy and iam.serviceAccounts.setIamPolicy.

See Google's Monitoring permissions, Pub/Sub notification setup and push authentication.

Inventory freshness

Cloud Asset Inventory is eventually consistent and can miss updates. Google syncs some resource types hours apart, so the 15-minute sync does not guarantee 15-minute freshness at the source.

Deletions come from asset deletion events. When a resource is missing from a current snapshot, Polylane checks Google's resource history within its 35-day retention to confirm the deletion. When the history is unknown, expired or unclear, Polylane keeps the resource until it gets more evidence. For Pub/Sub topics and Storage buckets, a not-found answer from the Google API also confirms a deletion. Log investigations always query Google directly. See Google's consistency and freshness guidance.

Troubleshooting

Deployment needs attention: After Google reports a failed deployment, choose Review and retry deployment. Review the project, the existing deployment name and the published blueprint release, then choose Retry deployment. The retry uses the same connection request and Google deployment. Authorize Google again if setup access expired.

Verification needs attention: Make sure that Infrastructure Manager completed the deployment in the correct project. Check the enabled APIs and the granted permissions, then open the saved setup and choose Resume setup. For a restored script request, confirm the project number and choose Verify and connect. A temporary verification error needs no new request.

Update the project setup: Open the project settings in Polylane. The Project setup row shows the version of the service accounts and permissions that Polylane added to the project. Choose Update, authorize a Google Cloud administrator account, review the current and new versions, then choose Update deployment. The update changes the existing deployment, and the project stays connected. An update adds grants that an older setup lacks, such as configuration reads, Cloud Trace reads and GKE object reads.

Trace access: Turn on the Cloud Trace API. The application must send traces to Cloud Trace.

GKE access: Turn on external access through the cluster DNS endpoint. A public IP endpoint also needs network access and the cluster CA. If your endpoint or VPC Service Controls block remote access, connect the Kubernetes agent. Resource usage needs a working metrics API in the cluster.

Disconnecting

Disconnect the project in Polylane to stop credential issuance, processing and schedules. Polylane deletes the alert channel, topic and push subscription of the connection, and removes the project from the infrastructure graph. Google access tokens that Polylane already has expire within 15 minutes. Cancelling a pending request does not delete Google resources.

The other Google resources stay in your project. To remove them, delete the Infrastructure Manager deployment with resource deletion on, or run terraform destroy for the module. This removes the reader and push identities, the workload identity pool and provider, the IAM grants, the topics, the subscriptions, the asset feed and the log sink. Then remove the -im installer service account and its grants. Enabled APIs, Google-managed service agents, and the Infrastructure Manager state and staging buckets stay. Review them separately.

Disconnect

Disconnecting stops every sync and check and deletes the credentials Polylane held. Polylane removes what Google Cloud's API lets it remove. The following stays until you remove it yourself:

  • Customer-managed Infrastructure Manager deployment or Terraform module: IAM, federation, Pub/Sub, asset feed and log sink
Terminal
polylane cloud disconnect <id>

Tools

8

Operations agents can perform in threads.

gcpLogs
Read Google Cloud logs (list log names, query entries)
gcpMetrics
Discover and query Google Cloud Monitoring metrics (list, query)
gcpDashboards
Read Google Cloud Monitoring dashboards (list, get)
gcpAlertPolicies
Read Google Cloud alert policies (list, get)
gcpTraces
Search and read Google Cloud traces (list, get)
gcpApi
Read Google Cloud APIs using the connected project's reader identity
gcpListApiOperations
Discover Google Cloud API read operations and their input fields
gcpGkeKubectl
Read and operate on Kubernetes resources on a GKE cluster, including pod logs, events, metrics, rollouts, scale, restart, patch, apply and delete

Supported resources

74

Resource types that show up in your infrastructure graph.

Google Cloud Project
Google Service Account
Google IAM Role
Icon_24px_Pub-Sub_ColorPub/Sub Topic
Icon_24px_Pub-Sub_ColorPub/Sub Subscription
Icon_24px_CloudStorage_ColorStorage Bucket
Icon_24px_ComputeEngine_ColorCompute Engine Instance
Icon_24px_VirtualPrivateCloud_ColorVPC Network
Icon_24px_VirtualPrivateCloud_ColorVPC Subnet
Icon_24px_PersistentDisk_ColorPersistent Disk
Icon_24px_FirewallRules_ColorFirewall Rule
Icon_24px_CloudRun_ColorCloud Run Service
Icon_24px_K8Engine_ColorGKE Cluster
Icon_24px_SQL_ColorCloud SQL Instance
Icon_24px_Functions_ColorCloud Function
Icon_24px_MemoryStore_ColorMemorystore for Redis Instance
Icon_24px_Firestore_ColorFirestore Database
Icon_24px_Tasks_ColorCloud Tasks Queue
Icon_24px_Scheduler_ColorCloud Scheduler Job
Secret Manager Secret
Artifact Registry Repository
Icon_24px_LoadBalancing_ColorForwarding Rule
Icon_24px_LoadBalancing_ColorTarget HTTP Proxy
Icon_24px_LoadBalancing_ColorTarget HTTPS Proxy
Icon_24px_LoadBalancing_ColorURL Map
Icon_24px_LoadBalancing_ColorBackend Service
Icon_24px_LoadBalancing_ColorBackend Bucket
Icon_24px_LoadBalancing_ColorNetwork Endpoint Group
Icon_24px_LoadBalancing_ColorHealth Check
Icon_24px_CloudArmor_ColorCloud Armor Policy
SSL Certificate
Icon_24px_Router_ColorCloud Router
Icon_24px_ExternalIPAddressesColorIP Address
Icon_24px_ComputeEngine_ColorManaged Instance Group
Icon_24px_ComputeEngine_ColorInstance Group
Icon_24px_ComputeEngine_ColorInstance Template
Icon_24px_DNS_ColorCloud DNS Zone
Icon_24px_VirtualPrivateCloud_ColorServerless VPC Access Connector
API Gateway
API Gateway API
Icon_24px_BigQuery_ColorBigQuery Dataset
Icon_24px_CloudSpanner_ColorSpanner Instance
Icon_24px_CloudSpanner_ColorSpanner Database
AlloyDB Cluster
AlloyDB Instance
Icon_24px_BigTable_ColorBigtable Instance
Icon_24px_BigTable_ColorBigtable Cluster
Icon_24px_Dataflow_ColorDataflow Job
Icon_24px_DataProc_ColorDataproc Cluster
Icon_24px_CloudComposer_ColorComposer Environment
Eventarc Trigger
Workflow
Icon_24px_Filestore_ColorFilestore Instance
Icon_24px_MemoryStore_ColorMemorystore for Memcached Instance
Icon_24px_MemoryStore_ColorMemorystore for Redis Cluster
Icon_24px_MemoryStore_ColorMemorystore Instance
Vertex AI Workbench Instance
Vertex AI Endpoint
Icon_24px_CloudBuild_ColorCloud Build Trigger
Cloud Deploy Pipeline
Cloud Deploy Target
Icon_24px_KeyManageService_ColorCloud KMS Key Ring
Icon_24px_KeyManageService_ColorCloud KMS Key
Icon_24px_CloudRun_ColorCloud Run Job
Workload Identity Pool
Vertex AI Deployment Resource Pool
Icon_24px_CloudBuild_ColorCloud Build Repository
Icon_24px_Routes_ColorVPC Route
Icon_24px_K8Engine_ColorGKE Node Pool
Developer Connect Repository Link
Workload Identity Pool Provider
Icon_24px_Logging_ColorCloud Logging Bucket
Icon_24px_Logging_ColorCloud Logging Sink
Icon_24px_VirtualPrivateCloud_ColorPrivate Service Access Connection