Overview
This guide explains how to connect GCP to Antimetal for traces, logs, and metrics, and add optional permissions for cost optimization.Set up in Antimetal
Go to the GCP integration setup in the Antimetal dashboard.
Prerequisites
- A GCP account with permissions to create service accounts
- Access to IAM & Admin settings
- Admin access to the projects you want to monitor
Setup
- GCP Console
- Terraform / IaC
1
Create the service account
- Go to Google Cloud Console
- Navigate to the project where you do your monitoring/observability work
- Go to IAM & Admin > Service Accounts
- Click + CREATE SERVICE ACCOUNT
- Fill in the details:
- Name:
antimetal-monitoring - ID:
antimetal-monitoring - Description:
Service account for Antimetal monitoring integration
- Name:
- Click CREATE AND CONTINUE
- Copy the created service account email address
2
Grant permissions to each project
For each project you want to monitor (including the one where you created the service account):
- Navigate to the target project
- Go to IAM & Admin > IAM
- Click + GRANT ACCESS
- In New principals, enter the service account email:
- Assign these roles:
Monitoring Viewer(roles/monitoring.viewer)Logs Viewer(roles/logging.viewer)Cloud Trace User(roles/cloudtrace.user)Error Reporting Viewer(roles/errorreporting.viewer)Cloud Asset Viewer(roles/cloudasset.viewer)
- Click Save
- Repeat for all projects you want to monitor
3
Generate the JSON key
- Go to IAM & Admin > Service Accounts
- Click on your
antimetal-monitoringservice account - Go to the Keys tab
- Click ADD KEY > Create new key with JSON format
Configure the Antimetal integration
- Navigate to the Antimetal GCP integration page
- Upload or paste the contents of the downloaded JSON key file
- Specify the project IDs you granted permissions to
Required permissions summary
The service account will have these read-only permissions across your specified projects:Cost optimization permissions (Beta)
These permissions help Antimetal identify unused or oversized infrastructure, assess existing commitments, and estimate potential savings using your resource usage and pricing. To let Antimetal assess your GCP resources for cost-saving opportunities, add the permissions below to the service account created above or already connected to Antimetal. Reuse its existing JSON key and keep its current permissions.Project access
This role provides read-only access. It does not permit changing or deleting infrastructure. Open IAM & Admin > IAM in each relevant project. Find the existing service-account email and click Edit principal, or select Grant access if it is not listed. Add the role below:
Include projects that purchased resource-based commitments, even if they are outside the workload projects.
Billing account access
Billing account access adds the commitment and pricing information that project access alone cannot provide:- Existing API-visible supported spend-based and flexible commitment orders: the amount purchased, commitment term, and expiry. This helps estimate future commitment costs and account for commitments you already own where coverage is available.
- Resource-based committed use discount (CUD) recommendations and insights: Google’s assessment of additional commitment opportunities across the billing account.
- Customer-specific prices: discover available SKUs and their current account-specific rates to estimate savings using your pricing rather than public list prices.
1
Create the custom role
Using an account with permission to create organization-level custom roles, open IAM & Admin > Roles and select the organization that owns the billing account. Create a custom role named Antimetal Cost Viewer with these permissions:
Create the role at organization scope, not project scope. Project-defined custom roles cannot be assigned to billing accounts. Google’s custom-role instructions
2
Assign the roles
For each billing account, open Billing, select the account, and go to Account management. Add the existing service-account email as a principal and assign the applicable roles below. If it is already listed, edit its access without removing existing roles.
What billing data is accessible
What billing data is accessible
Order access covers the billing account and can include other Marketplace purchases, not only CUDs. Account-price reads expose customer pricing through Google’s Preview Pricing API.
Check API access
Check API access
In APIs & Services > Library, check that the following APIs are enabled. Enable only those that are missing.
- Recommender API (
recommender.googleapis.com) for recommendations and insights - Cloud Commerce Consumer Procurement API (
cloudcommerceconsumerprocurement.googleapis.com) for existing commitment orders - Cloud Billing API (
cloudbilling.googleapis.com) for pricing