Google Antigravity
Connect your Google Cloud project to Antenna to analyze Google Antigravity adoption, token usage, and estimated cost across the Antigravity app, CLI, and IDE.
This integration reads the usage metadata that Gemini Enterprise logs to your own Google Cloud project. You route those logs to a Cloud Storage bucket, and Antenna reads them with a read-only key. The setup involves six steps:
- Turn on metadata logging for AI developer tools
- Create a Cloud Storage bucket
- Create a dedicated service account for Antenna
- Set up a log sink that routes the Antigravity metadata logs to the bucket
- Generate an HMAC key for the service account
- Connect the bucket in Antenna
Antigravity usage appears in Antenna once ingestion is released. Until then, logs collect in your bucket, and Antenna imports them after you connect.
Prerequisites
Before you begin, ensure you have the following:
- A Gemini Enterprise subscription (Standard, Plus, or pay-as-you-go) with AI developer tools turned on and licenses assigned to developers. Antigravity usage on personal Google accounts or Google AI Pro and Ultra plans isn’t logged to your project.
- Metadata logging turned on. In the Google Cloud console, navigate to Gemini Enterprise > Settings > AI developer tools > Compliance and turn on Metadata logging. See Configure compliance settings .
- A Google Cloud account with permissions to:
- Administer the project that holds your Gemini Enterprise licenses.
- Create and manage Cloud Logging sinks.
- Create and manage Cloud Storage buckets.
- Create service accounts and generate HMAC keys.
Keep Prompts and responses logging turned off. When it’s on, Google adds response text to the same log entries that Antenna reads, and a log sink can’t remove it.
Setup
Create a Cloud Storage bucket
This bucket is the destination for your Antigravity logs. Use a new bucket, even if you already connected Gemini Code Assist, so that each source only has access to its own logs.
- Ensure the Cloud Storage API is enabled for your project.
- In the Google Cloud console, navigate to Cloud Storage and create a new bucket. Give it a unique and descriptive name (e.g.,
antigravity-logs).
Create a service account
Create a dedicated service account that Antenna uses to read the logs.
- In the IAM & Admin section, navigate to Service Accounts and create a new account (e.g.,
antenna-antigravity). - On the bucket you created, grant this service account the
Storage Object Viewerrole. This gives it read-only access to that bucket only.
Create a log sink
The log sink routes only the two Antigravity metadata logs to your bucket.
- Navigate to Logging > Log Router in the Google Cloud console of the project that holds your Gemini Enterprise licenses.
- Click Create Sink.
- Name your sink (e.g.,
antigravity-to-antenna). - Set the Sink Destination to the Cloud Storage bucket you created earlier.
- In the “Choose logs to include in sink” section, create an inclusion filter. Paste the following filter, replacing
YOUR_PROJECT_IDwith your project ID:
logName=("projects/YOUR_PROJECT_ID/logs/businessaicode.googleapis.com%2Finference_response"
OR "projects/YOUR_PROJECT_ID/logs/businessaicode.googleapis.com%2Fclient_telemetry")Google writes log files to the bucket in hourly batches. The first files can take a few hours to appear.
If your licenses are in more than one Google Cloud project, create a sink in each project, with each sink pointing to the same bucket. For a sink in a different project from the bucket, grant the sink’s writer identity (shown in the sink’s details) the Storage Object Creator role on the bucket.
Generate an HMAC key
An HMAC key provides secure, interoperable access to your Cloud Storage bucket.
- In the Google Cloud console, go to Cloud Storage > Settings.
- Select the Interoperability tab.
- Find and paste the ID of the Google Cloud project that holds your Gemini Enterprise licenses (example:
example-project-123456). - Select the service account you created earlier.
- Click Create Key. A new Access Key and Secret are generated. Copy both immediately, as the secret isn’t shown again.
Connect in Antenna
- Navigate to Settings > Sources > Add source in your app.antenna.dev account.
- Click Connect next to Google Antigravity.
- Enter your Google Cloud Project ID.
- Paste the Access Key and Secret from the HMAC key you just generated.
- Paste your Cloud Storage Bucket Name.
- Click Connect to complete the connection.
Historical Backfill
Google only logs Antigravity usage after Metadata logging is turned on. To include logs from before you created the sink, copy them from your project’s default log bucket to your Cloud Storage bucket with the gcloud CLI. The default log bucket keeps logs for 30 days unless you’ve changed its retention.
If Prompts and responses logging was ever turned on, older entries contain response text. Add AND timestamp>="YYYY-MM-DDTHH:MM:SSZ" to the filter, using the time you turned it off, so the backfill only copies metadata-only entries.
Install the gcloud CLI
If you don’t already have it, install the gcloud CLI and authenticate as a user with the Logs Configuration Writer role (roles/logging.configWriter) in your Google Cloud project. See Copy log entries for the permissions the copy needs.
Run the copy command
Copy historical logs from the default log bucket to your Cloud Storage bucket, replacing YOUR_BUCKET_NAME with the bucket you created:
gcloud logging copy _Default storage.googleapis.com/YOUR_BUCKET_NAME \
--location=global \
--log-filter='logName=("projects/YOUR_PROJECT_ID/logs/businessaicode.googleapis.com%2Finference_response" OR "projects/YOUR_PROJECT_ID/logs/businessaicode.googleapis.com%2Fclient_telemetry")' \
--project=YOUR_PROJECT_IDIf your _Default log bucket isn’t in the global location, replace global with its location in both commands.
Monitor the operation
Use the operation ID returned in the output to check the status:
gcloud logging operations describe OPERATION_ID \
--location=global \
--project=YOUR_PROJECT_IDData Collected
Antenna reads two metadata logs. Neither contains prompts, responses, or code while Prompts and responses logging is turned off.
| Log | What Antenna uses |
|---|---|
inference_response | One entry per model call: user email, model, model provider, client (app, CLI, or IDE), session, and token counts (input, cached, output, thinking, and total) |
client_telemetry | Tool calls, accepted permission prompts, and whether a turn came from the user or the agent |
From these, Antenna reports active users, sessions, prompts, model calls, tool calls, tokens by model, and estimated cost. Cost is estimated from model list prices, because the logs don’t include billing amounts.
Usage made through Antigravity Enterprise Gateway, or by users who sign in with a service account, may not be attributed to individual users.
For more details, see the official Google documentation: Track token usage .
Resources
- Google Docs: AI developer tools metrics
- Google Docs: Route logs to supported destinations
- Antigravity Docs: Antigravity for Enterprise