> ## Documentation Index
> Fetch the complete documentation index at: https://docs.weaveos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini Code Assist

> Connect Gemini Code Assist via BigQuery to track AI-assisted IDE usage

Connect [Gemini Code Assist](https://cloud.google.com/gemini/docs/codeassist/overview) to track your team's AI-assisted IDE usage. Gemini Code Assist is auto-detected from commit metadata by default, so its contributions already show up as [foreground AI](/ai-tools/overview#foreground-vs-background-ai). Connecting this BigQuery integration adds daily, per-user IDE usage metrics by reading the metadata logs your Google Cloud project already exports to BigQuery.

## What's tracked

* **Code suggestions** — Suggestions shown and accepted per user, per day
* **Accepted lines** — Lines of code accepted from suggestions
* **Acceptance rate** — Share of shown suggestions that were accepted
* **Active users** — Which engineers used Gemini Code Assist each day

<Note>
  Weave reads only the IDE metadata logs: suggestion counts, acceptance events, and accepted lines, for both inline suggestions and Gemini Code Assist **chat**. No prompt or response content is read.
</Note>

## Prerequisites

* Gemini Code Assist **Standard** or **Enterprise**
* Google Cloud admin access to the project where Code Assist runs (to enable logging, create the BigQuery sink, and grant IAM)

## Setup

<Steps>
  <Step title="Enable Gemini Code Assist logging">
    In the Google Cloud console, enable logging for **Gemini for Google Cloud** on the project where your engineers use Code Assist. See [Generate Gemini for Google Cloud metrics](https://cloud.google.com/gemini/docs/codeassist/generate-metrics) for the exact steps.
  </Step>

  <Step title="Create a BigQuery dataset">
    Create a BigQuery dataset to receive the exported logs (any region works). We suggest naming it `weave_gemini_observability` so it's easy to recognize later, but any name is fine.
  </Step>

  <Step title="Create a Log Router sink">
    Create a [Log Router sink](https://cloud.google.com/logging/docs/export/configure_export_v2) that routes Gemini Code Assist logs to the dataset you just created:

    1. Set the destination to the BigQuery dataset from step 2
    2. Set the inclusion filter to:

    ```
    resource.type="cloudaicompanion.googleapis.com/Instance" AND labels.product="code_assist"
    ```

    3. Check **Use partitioned tables** when creating the sink

    The metadata table appears in the dataset after the first Code Assist activity following sink creation.
  </Step>

  <Step title="Grant Weave access">
    In Weave, go to **Data** → **Gemini**, select **In the IDE** under **How does your team use Gemini?**, and click **Set up BigQuery export** on the **Gemini Code Assist** card. Copy the **Reader service account** email shown in the configure form. In BigQuery, grant that service account the **BigQuery Data Viewer** role on the dataset you created in step 2. Grant it at the **dataset level**, not the project level.
  </Step>

  <Step title="Configure in Weave">
    Back in the **Gemini Code Assist** configure form, enter:

    * **GCP project ID** — the project where you created the BigQuery dataset
    * **BigQuery dataset ID** — the dataset from step 2
    * **BigQuery table ID** (optional) — leave blank to use the standard metadata-log table Cloud Logging creates from the sink

    Click **Save** — Weave validates access and syncs on a regular schedule. Data appears within a few hours of the first sync.
  </Step>
</Steps>

## Metrics enabled

Once connected, you can track:

* **[AI code LOC](/metrics/ai-code-loc)** — Lines accepted from Gemini Code Assist suggestions
* **[AI output percentage](/metrics/ai-output-percentage)** — Portion of output from Gemini Code Assist
* **[AI efficiency index](/metrics/ai-efficiency-index)** — Impact on productivity

## Sync frequency

Weave polls the BigQuery metadata table on a regular schedule. Expect data to appear within a few hours of the first successful sync, and daily thereafter as new logs land in the table.

## Troubleshooting

<AccordionGroup>
  <Accordion icon="key" title="Validation failing">
    If Weave fails to validate access to your BigQuery dataset:

    1. Confirm the reader service account was granted **BigQuery Data Viewer** on the dataset — IAM grants can take a few minutes to propagate
    2. Check that the sink has produced its metadata table — it only appears in the dataset after the first Code Assist activity following sink creation
    3. Double check the **GCP project ID** and **BigQuery dataset ID** entered in Weave match exactly what you created
  </Accordion>

  <Accordion icon="chart-line" title="No data appearing after setup">
    If no usage data appears in Weave after validation succeeds:

    1. Confirm the Log Router sink's inclusion filter matches exactly (`resource.type="cloudaicompanion.googleapis.com/Instance" AND labels.product="code_assist"`)
    2. Verify your engineers have been active in Gemini Code Assist since the sink was created — logs only exist for activity after sink creation, not retroactively
    3. If you set a custom **BigQuery table ID**, confirm it matches the table the sink actually writes to
    4. Wait a few hours for the first sync to complete
  </Accordion>
</AccordionGroup>

## Data privacy

Weave syncs only IDE usage metadata from the Gemini Code Assist metadata logs:

* Suggestion counts and acceptance rates
* Lines of code accepted
* Active user counts per day

**We never access:**

* Your source code content
* AI prompts or chat conversations
* Gemini's responses
* File names or project structure

## Related integrations

* [Gemini CLI](/ai-tools/gemini-cli) — Google's terminal AI assistant
* [Devin](/ai-tools/devin) — also auto-detected, with an optional direct integration for activity and cost
* [Claude Code](/ai-tools/claude-code) — CLI-based AI assistant


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.