Before creating a Google Cloud connection, ensure you have completed the following prerequisites.
Without the Dynatrace IAM permissions below, you can't open the New connection wizard or complete the setup.
Create an IAM user with appropriate permissions
CloudsAdmins group (if it doesn't already exist).Data-Acquisition Cloud Integrations AllStandard UserAccount-Wide or Environment-Wide, then select Save.CloudsAdmins group Permissions section shows both policies.CloudsAdmins group.The roles below apply to the principal running setup—yourself in Manual mode, or the principal that executes Terraform in Automated via Terraform mode. They are not granted to the monitoring service account itself. In Automated via Terraform mode, Terraform creates the service account, assigns its viewer roles, and grants the Dynatrace principal impersonation rights for you.
| Task | Required role | Scope |
|---|---|---|
Create service account |
| Service account project |
Enable APIs |
| Service account project |
Grant Dynatrace impersonation rights |
| Service account project |
Store Terraform state (if using GCS) |
| State bucket project |
Grant monitoring access to projects |
| Each monitored project |
Grant monitoring access to folders |
| Each monitored folder |
Grant monitoring access to organization |
| Organization |
If you have roles/owner on the relevant projects, folders, or organization, you already have sufficient permissions.
iam.allowedPolicyMemberDomains organization policy. If enabled, you'll need to add the Dynatrace customer identity to your allowed list before Dynatrace can connect. The Dynatrace identity is C03cngnp6.dtctl). After the wizard creates a connection, you need dtctl to link the service account and enable monitoring.We do not recommned monitoring more than 15,000 resources through a single Google Cloud Service Account.
Do not monitor more than 375 Google Cloud projects via a scoping project as this violates Google Cloud best practices.
Group projects by monitoring requirements under a single service account—one service account can oversee many projects and is managed through a single monitoring configuration—simpler to operate but applies the same metric selection, filters, and enrichment to all projects it covers.
If projects have different monitoring requirements, use separate service accounts so each can be paired with its own monitoring configuration. Prefer more service accounts over fewer for maximum flexibility.
Go to
Settings > Collect and capture > Cloud and virtualization > Google Cloud (Preview).
The connections list displays all configured Google Cloud connections.
| Column | Description |
|---|---|
Name | Connection name |
Status | Health status ( |
Service Account Email | The Google Cloud service account used for this connection |
Monitored Projects | Number of projects being monitored |
Metric Collection Scope | All or Scoping |
Created by | User who created the connection |
Last modified | Date of last configuration change |
Created | Connection creation date |
Enter a friendly connection name that is unique (for example, MyEastProd3Account).
Choose the Deployment method.
| Option | Description |
|---|---|
Automated via Terraform Recommended | Deploy and configure Google Cloud resources automatically using Terraform for consistent, repeatable setups. |
Manual | Set up Google Cloud resources directly through the console, CLI, or your own Infrastructure-as-Code tooling. Use this if you already have existing deployment processes. |
In Monitoring service account:
dynatrace-monitoring).Select Next.
You can modify the observability settings after the connection is created.
| Mode | Includes |
|---|---|
Recommended |
|
Advanced |
|
Log forwarding and asset inventory feed deployment location: Select a single Google Cloud region where forwarding infrastructure will be deployed (for example, us-central1).
Choose whether to collect metrics from all connected projects or only Scoping projects.
| Option | Description |
|---|---|
All | Collect metrics from all projects visible to the connection |
Scoping | Collect metrics only from metric scoping projects |
When choosing Scoping, Dynatrace polls metrics only from scoping projects. Folder and project filters apply.
By default, Dynatrace automatically detects which projects are scoping projects. Detection results are cached, so changes to your Google Cloud monitoring scopes may take some time to reflect in Dynatrace. You can optionally provide an explicit list of scoping project IDs.
When specified, Dynatrace uses your list directly instead of auto-detection, which ensures immediate accuracy and avoids detection overhead in environments with many projects.
Scoping project IDs: Enter the project IDs of your scoping projects (for example, my-scoping-project-1, my-scoping-project-2).
Choose the scope from which asset feed events are ingested: Organization, Folders (default—enter folder IDs), or Projects.
When you select the Advanced configuration mode, the following additional configuration options appear.
Toggle on to restrict topology and metrics polling to specific locations.
The service list shows all supported Google Cloud products. For each service:
Toggle on/off to turn on/off metric collection
Select a Metric collection set
| Mode | Description |
|---|---|
Recommended | Ingest Dynatrace-recommended metrics for this service |
Recommended + custom | Recommended metrics + additional service-related metrics you specify |
Auto-discovery | Ingest all available metrics for this service |
Auto-discovery is not meant for long-term use. Use it to explore what metrics are available, then select only the metrics relevant to your use case. This helps you to keep Dynatrace and Google Cloud costs low.
Available services include: Cloud Storage, Cloud SQL, Cloud Run, Compute Engine, Kubernetes Engine, BigQuery, and others.
See Supported services for the full list.
Use Search services to filter the list.
Use Show all dropdown to filter by enabled/disabled status.
Select Reset to default to restore default selections.
When using Recommended + custom, select Add metric to specify additional metrics:
| Field | Description |
|---|---|
Monitored resource type | The Google Cloud resource type (for example, |
Metric type | The full metric path (for example, |
Metric labels | Labels to include (for example, |
When using Auto-discovery, specify metric prefixes to exclude. Use * as a wildcard (for example, storage.googleapis.com*).
Turn on the toggle to ingest metrics not tied to a specific service or not yet supported by Dynatrace.
Select + Add metric and provide:
Turn on the toggle to monitor projects within specific Google Cloud folders only. All folders are monitored by default. This works similarly to the project filter.
178078973866, 178078973869).Turn on the toggle to monitor only specific projects. All projects are monitored by default unless excluded by a project filter.
google-cloud-project-name-1, google-cloud-project-name-2).Turn on the toggle to filter monitored resources based on their Google Cloud labels or tags. Use this to include or exclude specific resources from monitoring.
Included filters: Only resources matching these filters are monitored.
environment:production).tagKeys/123456789/tagValues/987654321 or project/environment/production).Excluded filters: Resources matching these filters are excluded from monitoring.
environment:development).Use include filters to monitor only specific workloads (for example, production environments). Use exclude filters to skip resources you don't need to monitor (for example, development or test environments).
The unexpected-data tagging feature is not yet available.
Turn on the toggle to tag streamed data (logs, asset inventory events) that doesn't match your filters. Use this to identify mismatches and either drop data in OpenPipeline or adjust your Google Cloud configuration.
Data will be tagged with the attribute: da.unexpected.
Forward selected labels and tags from Google Cloud assets to their associated observability signals.
team).payroll/app).Resulting attribute names:
| Source | Example input | Attribute name |
|---|---|---|
Label |
|
|
Tag |
|
|
Google Cloud label: Use the value of a specific label
Google Cloud tag: Use the value of a specific tag
Custom value (literal): Use a static string value
| Attribute | Description |
|---|---|
Enable security context | Maps to |
Enable cost allocation (Cost center) | Maps to |
Enable cost allocation (Product) | Maps to |
Select Next.
This step differs based on your deployment method.
dtctl, with the following permissions:settings:objects:readsettings:objects:writeextensions:configurations:readextensions:configurations:writelogs_enabled = true in terraform.tfvars), also generate a Log Ingest token with:logs.ingestSelect Download Terraform to download the pre-configured Terraform bundle (a .zip file). The bundle contains:
| File | Description |
|---|---|
| Terraform configuration that creates the monitoring service account, enables required APIs, grants viewer roles, and grants the Dynatrace principal impersonation rights. |
| Wizard-generated variables (such as |
| The file you edit to choose the monitoring scope. |
| Bundled quick-reference. |
When applied, Terraform will:
compute.googleapis.com, cloudresourcemanager.googleapis.com, cloudasset.googleapis.com, and monitoring.googleapis.com on the service account project.roles/viewer on each listed project, roles/resourcemanager.folderViewer on each listed folder, and roles/resourcemanager.organizationViewer on each listed organization.roles/iam.serviceAccountTokenCreator on the new service account (impersonation trust).roles/viewer is a broad predefined role that some organizations restrict. If your organization requires more granular permissions, see the Grant permissions to the service account section in Manual onboarding reference for the exact list of IAM permissions Dynatrace needs to create a custom role.
Make sure your environment is ready:
gcloud auth application-default login.Extract the bundle. Rename terraform.sample.tfvars to terraform.tfvars and fill in the values:
| Variable | Required | Description | Example |
|---|---|---|---|
| Optional | Region for created resources. Defaults to |
|
| Required 1 | Project IDs to grant the service account |
|
| Required 1 | Folder IDs to grant the service account |
|
| Required 1 | Organization IDs to grant the service account |
|
At least one of the three scope lists must be non-empty. Otherwise the service account has no resources to read.
From the bundle directory, run:
terraform initterraform planterraform apply
Alternatively, apply the bundle through Google Cloud Infrastructure Manager or any other Terraform runner.
In Activation, select one of the following:
Terraform has been deployed: You ran Terraform yourself and the wizard is still open. Select this to finalize the connection creation.
It may take up to 5 minutes for the new service account to become available in Google Cloud. If finalization doesn't complete, use the dtctl steps below.
Terraform will be deployed later: Someone else is running Terraform, or you need to close the wizard. Share the downloaded Terraform scripts and this documentation link with the person who has the required Google Cloud permissions. Once Terraform deployment is complete, finalize the connection manually using the dtctl steps below.
After Terraform deployment is complete, authenticate dtctl to your Dynatrace environment. Pick one of the following options.
Recommended Browser-based OAuth login
dtctl auth login \--context my-env \--environment https://<tenant>.apps.dynatrace.com
Platform token (headless/scripted)
Use the settings token you generated earlier (not the log ingest token).
dtctl config set-context my-env \--environment https://<tenant>.apps.dynatrace.com \--token-ref my-tokendtctl config set-credentials my-token --token <settings-token-from-step-above>dtctl config use-context my-env
Link the service account to the connection and enable monitoring:
dtctl enable gcp monitoring \--name "<configuration-name>" \--serviceAccountId "<service-account-email>"
In the Dynatrace UI, this command is displayed with <configuration-name> and <service-account-email> already filled in with the real values for your connection—copy it from the wizard rather than typing it by hand.
Terraform will finalize the connection automatically. For now, proceed with dtctl.
Optional See Manual onboarding reference for step-by-step instructions.
Select Finish to complete the wizard. The connection is created and appears in the connections list.
Once you select Finish, the connection is created in Dynatrace. However, data collection doesn't start until either:
dtctl (if using Automated via Terraform mode)After the Google Cloud side is configured:
Pending to Healthy once Dynatrace successfully authenticates.You can monitor the deployment progress in the connection's Health tab.