✨ Software.com is now Antenna. Read more →
Skip to Content
IntegrationsAIGemini Code Assist

Gemini Code Assist

Connect your Google Cloud project to Antenna to analyze Gemini Code Assist adoption, usage, and its impact on your development workflow.

This integration works by routing Gemini Code Assist usage logs from Google Cloud to Antenna. The setup involves five steps:

  1. Enable Cloud Logging for Gemini Code Assist activity
  2. Add a Cloud Storage bucket as a log destination
  3. Set up a log sink that filters Gemini-specific logs and routes them to the bucket
  4. Create a dedicated service account for Antenna
  5. Grant Antenna access to the service account via an HMAC key

Prerequisites

Before you begin, ensure you have the following:

  • Gemini Code Assist enabled for your Google Cloud project, with licenses assigned to developers.
  • Cloud Logging enabled for Gemini Code Assist metadata. Navigate to the Gemini admin settings  in Google Cloud Console and toggle Logging for Code Assist metadata to ENABLED.
  • A Google Cloud account with permissions to:
    • Administer your project.
    • Create and manage Cloud Logging sinks.
    • Create and manage Cloud Storage buckets.
    • Create service accounts and generate HMAC keys.

Do not enable “Logging for Gemini Code Assist prompts and responses.” This setting includes full code prompts and responses in the logs.

Setup

Create a Cloud Storage bucket

This bucket will act as the destination for your Gemini logs.

  1. Ensure the Cloud Storage API is enabled for your project.
  2. In the Google Cloud console, navigate to Cloud Storage and create a new bucket. Give it a unique and descriptive name (e.g., gemini-code-assist).

Create a service account

Create a dedicated service account that Antenna will use to access the logs.

  1. In the IAM & Admin section, navigate to Service Accounts and create a new account (e.g., Antenna-Analytics).
  2. Grant this service account the Storage Object Viewer role. This ensures it has read-only access to the storage bucket, following the principle of least privilege.

Create a log sink

The log sink filters Gemini-specific logs and routes them to your storage bucket.

  1. Navigate to Logging > Log Router in the Google Cloud console.
  2. Click Create Sink.
  3. Name your sink (e.g., gemini-to-antenna).
  4. Set the Sink Destination to the Cloud Storage bucket you created earlier.
  5. In the “Choose logs to include in sink” section, create an Inclusion Filter. Paste the following filter:
resource.type="cloudaicompanion.googleapis.com/Instance" AND labels.product="code_assist"

Generate an HMAC key

An HMAC key provides secure, interoperable access to your Cloud Storage bucket.

  1. In the Google Cloud console, go to Cloud Storage > Settings.
  2. Select the Interoperability tab.
  3. Find and paste the ID of the Google Cloud Project  that you used to provision Gemini Code Assist licenses (example: software-project-120530353).
  4. Select the service account you created in the previous step.
  5. Click Create Key. A new Access Key and Secret will be generated. Copy both immediately, as the secret will not be shown again.

Connect in Antenna

  1. Navigate to the Connected Apps page in your app.antenna.dev  account.
  2. Click Connect next to Gemini Code Assist.
  3. Paste the Access Key and Secret from the HMAC key you just generated.
  4. Paste your Cloud Storage Bucket Name.
  5. Click Save to complete the connection.

Historical Backfill

If you have existing Gemini Code Assist logs that predate your log sink, you can backfill them into your storage bucket using the gcloud CLI.

Install the gcloud CLI

If you don’t already have it, install the gcloud CLI  and authenticate with your Google Cloud project.

Run the copy command

Copy historical logs from the default log bucket to your Cloud Storage bucket:

gcloud logging copy _Default storage.googleapis.com/gemini-code-assist \ --location=global \ --log-filter='resource.type="cloudaicompanion.googleapis.com/Instance" AND labels.product="code_assist"' \ --project=YOUR_PROJECT_ID

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_ID

Data Collected

Gemini Code Assist metrics data recording is limited to user interactions with Gemini Code Assist within the IDE. This does not include prompts, responses, or any other user interactions — those require a separate log_prompts_and_responses setting to be enabled.

For more details, see the official Google documentation: Log Gemini for Google Cloud activity .

Resources

Last updated on