Page Summary
-
Gemini Code Assist Standard and Enterprise logging in Google Cloud is limited to user interactions within the IDE and requires VS Code telemetry to be enabled.
-
Before configuring logging, verify that your Google Cloud project is attached to a billing account and ensure you have the necessary IAM permissions, such as the
roles/cloudaicompanion.settingsAdminrole. -
You can configure Gemini Code Assist logging through either the Google API Console or an API to collect prompts, responses, and metadata, which is stored in Cloud Logging.
-
Enabling logging involves selecting options in the Google API Console settings or using API calls to create and bind logging settings with
log_prompts_and_responsesandlog_metadatafields set to true. -
Logging can be disabled via the Google API Console by turning off the metadata logging option or by using an API call to update the logging settings with
log_prompts_and_responsesandlog_metadatafields set to false.
This document describes how to configure Gemini Code Assist Standard and Enterprise logging for a project by using the Google Cloud console or an API.
Limitations
Gemini Standard and Enterprise in Google Cloud log data recording is limited to user interactions with Gemini Code Assist within an IDE.
By default, Gemini for Google Cloud logs are collected on a per-project basis. For instructions on how to configure a centralized project to collect logs from multiple projects, see Set up multi-project logging.
Gemini Code Assist on GitHub doesn't support logging with Cloud Logging.
Before you begin
Verify that your Google Cloud project is attached to a billing account.
Verify IAM permissions
To configure Gemini Code Assist Standard and Enterprise logging
you can
grant the
Gemini for Google Cloud Settings Admin (roles/cloudaicompanion.settingsAdmin) Identity and Access Management predefined role, which includes all required
permissions needed to work with all Gemini for Google Cloud
administrator settings.
Alternatively, you can update any custom IAM roles. You must have specific IAM permissions, which are detailed in the following sections.
Configure Gemini Code Assist logging
The following sections provide steps required to enable the collection and storage of Gemini Code Assist Standard and Enterprise activity in Cloud Logging, including:
Gemini Code Assist Standard and Enterprise prompts and response logs, such as user input, contextual information, and responses.
Gemini Code Assist Standard and Enterprise metadata logs, such as telemetry metadata and lines of code accepted by the user.
For more details on both types of logs, see View Gemini logs.
Enable logging for Gemini Code Assist in a project
Select one of the following options:
Console
Verify that you have enabled the Cloud Logging API in the project.
Verify that you have the following IAM permissions on the project that owns the subscription:
instance.queryEffectiveSettinginstance.queryEffectiveSettingBindingsloggingSettings.createloggingSettings.listloggingSettings.updateloggingSettings.getcloudaicompanion.instances.loggingSettings.usecloudaicompanion.instances.queryEffectiveSettingsettingBindings.loggingSettingsListsettingBindings.loggingSettingsGetsettingBindings.loggingSettingsUpdatesettingBindings.loggingSettingsCreatecloudaicompanion.settingBindings.loggingSettingsUsecloudaicompanion.instances.queryEffectiveSettingBindings
In the Google Cloud console, go to the Admin for Gemini page.
The Gemini for Google Cloud page loads.
Click Settings in the left navigation menu.
The Settings page loads.
(Optional) Click Logging for Code Assist metadata to record the metadata generated by users of Gemini Code Assist Standard and Enterprise in the project.
(Optional) Click Logging for Code Assist prompts and responses to record the prompts and responses generated by users of Gemini Code Assist Standard and Enterprise in the project.
Click Save Changes.
API
To enable logging for Gemini Code Assist Standard and
Enterprise, use the loggingSettings resource to define the logging
settings you want, and use the loggingSettings.settingBindings resource to
bind the settings to a project:
Verify that you have enabled the Cloud Logging API in the project.
Verify that you have the following IAM permissions on the project that owns the subscription:
instance.queryEffectiveSettinginstance.queryEffectiveSettingBindingsloggingSettings.createloggingSettings.listloggingSettings.updateloggingSettings.getcloudaicompanion.instances.loggingSettings.usecloudaicompanion.instances.queryEffectiveSettingsettingBindings.loggingSettingsListsettingBindings.loggingSettingsGetsettingBindings.loggingSettingsUpdatesettingBindings.loggingSettingsCreatecloudaicompanion.settingBindings.loggingSettingsUsecloudaicompanion.instances.queryEffectiveSettingBindings
Create the setting and a setting-specific value:
Obtain the token:
TOKEN=$(gcloud auth print-access-token)
Enable Gemini Code Assist Standard and Enterprise logs. Users logs and metadata logs are enabled with the
log_prompts_and_responsesandlog_metadatafields, respectively. If you don't want to enable one of the fields, exclude it from the request.Run the following command to create the setting:
curl -X POST \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ -d '{ "log_prompts_and_responses": true, "log_metadata": true, } ' \ "https://cloudaicompanion.googleapis.com/v1/projects/CONTAINER_PROJECT_NAME/locations/global/loggingSettings?logging_setting_id=LOGS_SETTING_ID"Replace the following:
CONTAINER_PROJECT_NAME: Enter the project ID of the project where the binding resource is stored. This is the parent project of the binding.LOGS_SETTING_ID: Enter a unique setting name, such asgcalm.
If the command succeeds, it returns a response body that shows the
log_prompts_and_responsesandlog_metadataset totrue:{ "name": "projects/CONTAINER_PROJECT_NAME/locations/global/loggingSettings/LOGS_SETTING_ID", "createTime": "2025-01-23T15:22:49.717166932Z", "updateTime": "2025-01-23T15:22:49.717166932Z", "log_prompts_and_responses": true, "log_metadata": true }Run the following command to create the Gemini Code Assist Standard and Enterprise logs setting binding:
curl -X POST \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ -d '{ "target": "projects/TARGET_PROJECT_NAME" }' \ "https://cloudaicompanion.googleapis.com/v1/projects/CONTAINER_PROJECT_NAME/locations/global/loggingSettings/LOGS_SETTING_ID/settingBindings?setting_binding_id=LOGS_BINDING_ID"
Replace the following:
TARGET_PROJECT_NAME: Enter the target project to which the binding should be bound. This is often the same as the container project. However, you can bind a setting to multiple projects so that the setting resource doesn't have to be duplicated.LOGS_BINDING_ID: Use the same LOGS_SETTING_ID when you created the setting, but append it withb1. For example, usegcalmb1.
If the command succeeds, it returns the operation metadata in the following format:
{ "name": "projects/<var>CONTAINER_PROJECT_NAME</var>/locations/global/operations/operation-1737646069712-62c6140bb04bb-49261230-43701daf", "metadata": { "@type": "type.googleapis.com/google.cloud.cloudaicompanion.v1.OperationMetadata", "createTime": "2025-01-23T15:27:50.076075570Z", "target": "projects/<var>TARGET_PROJECT_NAME</var>/locations/global/loggingSettings/<var>LOGS_SETTING_ID</var>/settingBindings/<var>LOGS_BINDING_ID</var>", "verb": "create", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
Disable logging for Gemini Code Assist in a project
Select one of the following options:
Console
Verify that you have the following IAM permissions on the project that owns the subscription:
instance.queryEffectiveSettinginstance.queryEffectiveSettingBindingsloggingSettings.deleteloggingSettings.listloggingSettings.updateloggingSettings.getcloudaicompanion.instances.loggingSettings.usecloudaicompanion.instances.queryEffectiveSettingsettingBindings.loggingSettingsListsettingBindings.loggingSettingsGetsettingBindings.loggingSettingsUpdatesettingBindings.loggingSettingsDeletecloudaicompanion.settingBindings.loggingSettingsUsecloudaicompanion.instances.queryEffectiveSettingBindings
In the Google Cloud console, go to the Admin for Gemini page.
The Gemini for Google Cloud page loads.
Click Settings in the left navigation menu.
The Settings page loads.
Click Logging for Code Assist metadata to turn off recording the metadata from the usage of Gemini Code Assist Standard and Enterprise in the project.
Click Save Changes.
API
To disable logging for Gemini Code Assist Standard and
Enterprise, use the loggingSetting method.
Verify that you have the following IAM permissions on the project that owns the subscription:
instance.queryEffectiveSettinginstance.queryEffectiveSettingBindingsloggingSettings.createloggingSettings.listloggingSettings.updateloggingSettings.getcloudaicompanion.instances.loggingSettings.usecloudaicompanion.instances.queryEffectiveSettingsettingBindings.loggingSettingsListsettingBindings.loggingSettingsGetsettingBindings.loggingSettingsUpdatesettingBindings.loggingSettingsCreateserviceusage.services.enable
Create the setting and a setting-specific value:
Obtain the token:
TOKEN=$(gcloud auth print-access-token)
Run the following command to disable the Gemini Code Assist Standard and Enterprise logs settings:
curl -X POST \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ -d '{ "log_prompts_and_responses": false, "log_metadata": false, } ' \ "https://cloudaicompanion.googleapis.com/v1/projects/CONTAINER_PROJECT_NAME/locations/global/loggingSettings?logging_metadata_id=LOGS_SETTING_ID"Replace the following:
CONTAINER_PROJECT_NAME: Enter the parent project ID.LOGS_SETTING_ID: Enter the existing setting name, such asgcalm.If the command succeeds, it returns a response body that shows the
log_prompts_and_responsesandlog_metadataset tofalse:{ "name": "projects/CONTAINER_PROJECT_NAME/locations/global/loggingSettings/LOGS_SETTING_ID", "createTime": "2025-01-23T15:22:49.717166932Z", "updateTime": "2025-01-23T15:22:49.717166932Z", "log_prompts_and_responses": false, "log_metadata": false }
Set up multi-project logging
You can use logs from Gemini Code Assist to create metrics and dashboards for monitoring per-project usage. If your organization has multiple projects, you can configure a centralized logging project to collect logs from multiple projects and generate dashboards across those projects.
Create a centralized logging project
This project will serve as a hub for logs from your other projects.
In the Google Cloud console, go to the Project creation page.
In the New Project window, enter values for the following fields:
- Project name: a name for your centralized logging project.
- Billing account: select a billing account.
- Organization: select your organization. A centralized project can only collect logs from projects in the same organization.
- Location: select a location.
Click Create.
Configure log sinks
To direct logs to the centralized project, configure log sinks in each of the individual projects that you want to collect logs from.
To configure log sinks for each project, do the following:
- In the Google Cloud console, switch to a project that you want to collect logs from.
Go to the Log Router page:
Click Create sink.
For Sink details, enter a name and description for the sink, and then click Next.
For Sink destination, do the following:
- In the Select sink service menu, select Logging bucket.
- In the Log bucket menu, select Use log bucket in another project.
In the Sink destination field, enter the following:
logging.googleapis.com/projects/CENTRALIZED_PROJECT_ID/locations/global/buckets/_DefaultReplace
CENTRALIZED_PROJECT_IDwith the project ID of the centralized logging project that you created.Click Next.
For Choose logs to include in sink, build an inclusion filter by entering the following in the Inclusion filter field:
resource.type="cloudaicompanion.googleapis.com/Instance"Click Next.
For Choose logs to filter out of sink, leave the exclusion filter blank and click Create sink.
After the sink is created, in Log Router page, find the sink that you created.
In the Writer Identity column, copy the full service account email address.
Configure access
To grant access for your sink to write logs to the centralized project, do the following:
- In the Google Cloud console, switch to the centralized project that you created.
Go to the IAM page:
Click Grant access.
In the New principals field, paste the service account email address that you copied in the preceding section.
Click Add another role.
Search for and select the Logs Bucket Writer role (
roles/logging.bucketWriter).Click Save.
Create a dashboard in centralized project
After you configure your centralized project to receive logs, you can create a dashboard to view metrics from multiple projects:
In the Google Cloud console, go to Monitoring > Dashboards:
Click Create dashboard.
In the toolbar, click Settings, and then select JSON > JSON Editor.
In JSON Editor, paste the following code:
{ "displayName": "Multi-Project Gemini Code Assist Overview from Metadata Logs", "dashboardFilters": [], "labels": {}, "mosaicLayout": { "columns": 48, "tiles": [ { "height": 16, "width": 24, "widget": { "title": "Active Users by Day", "id": "", "xyChart": { "chartOptions": { "displayHorizontal": false, "mode": "COLOR", "showLegend": false }, "dataSets": [ { "breakdowns": [], "dimensions": [ { "column": "event_date", "columnType": "DATE", "maxBinCount": 0, "sortColumn": "event_date", "sortOrder": "SORT_ORDER_ASCENDING", "timeBinSize": "0s", "xMax": 0, "xMin": 0 } ], "legendTemplate": "", "measures": [ { "aggregationFunction": { "parameters": [], "type": "average" }, "column": "DAU" } ], "plotType": "LINE", "targetAxis": "Y1", "timeSeriesQuery": { "opsAnalyticsQuery": { "queryExecutionRules": { "useReservedSlots": false }, "queryHandle": "", "savedQueryId": "", "sql": "SELECT\n COUNT (DISTINCT JSON_VALUE(labels, '$.user_id')) as DAU, CAST(timestamp AS DATE) AS event_date\nFROM\n `CENTRALIZED_PROJECT_ID.global._Default._Default`\nWHERE\n JSON_VALUE(labels, '$.user_id') is not NULL\n AND (\n JSON_VALUE(json_payload, '$.chatExposure.originalRequestId') is not NULL\n OR JSON_VALUE(json_payload, '$.codeAcceptance.originalRequestId') is not NULL\n OR JSON_VALUE(json_payload, '$.codeExposure.originalRequestId') is not NULL\n )\n AND resource.type = \"cloudaicompanion.googleapis.com/Instance\"\n AND (JSON_VALUE(resource.labels, '$.resource_container') in ('SOURCE_PROJECT_ID_1', 'SOURCE_PROJECT_ID_2') or JSON_VALUE(resource.labels, '$.project_id') in ('SOURCE_PROJECT_ID_1', 'SOURCE_PROJECT_ID_2'))\nGROUP BY\nevent_date\nORDER BY\nevent_date\n" }, "outputFullDuration": false, "unitOverride": "" } } ], "thresholds": [], "yAxis": { "label": "", "scale": "LINEAR" } } } }, { "xPos": 24, "height": 16, "width": 24, "widget": { "title": "Acceptance Rate by Day", "id": "", "xyChart": { "chartOptions": { "displayHorizontal": false, "mode": "COLOR", "showLegend": false }, "dataSets": [ { "breakdowns": [], "dimensions": [ { "column": "exposures_date", "columnType": "DATE", "maxBinCount": 0, "sortColumn": "exposures_date", "sortOrder": "SORT_ORDER_ASCENDING", "timeBinSize": "0s", "xMax": 0, "xMin": 0 } ], "legendTemplate": "", "measures": [ { "aggregationFunction": { "parameters": [], "type": "average" }, "column": "acceptance_rate" } ], "plotType": "LINE", "targetAxis": "Y1", "timeSeriesQuery": { "opsAnalyticsQuery": { "queryExecutionRules": { "useReservedSlots": false }, "queryHandle": "", "savedQueryId": "", "sql": "SELECT\nexposures_date,\nacceptances_count / exposures_count as acceptance_rate\nFROM\n(\nSELECT\nCOUNT (DISTINCT JSON_VALUE(json_payload, '$.codeAcceptance.originalRequestId')) as acceptances_count, CAST(timestamp AS DATE) AS acceptances_date\nFROM\n`CENTRALIZED_PROJECT_ID.global._Default._Default`\nWHERE\nJSON_VALUE(json_payload, '$.codeAcceptance.originalRequestId') is not NULL\nAND resource.type = \"cloudaicompanion.googleapis.com/Instance\"\nAND (JSON_VALUE(resource.labels, '$.resource_container') in ('SOURCE_PROJECT_ID_1', 'SOURCE_PROJECT_ID_2') or JSON_VALUE(resource.labels, '$.project_id') in ('SOURCE_PROJECT_ID_1', 'SOURCE_PROJECT_ID_2'))\nGROUP BY\nacceptances_date\n) as acceptances\nJOIN\n(\nSELECT\nCOUNT (DISTINCT JSON_VALUE(json_payload, '$.codeExposure.originalRequestId')) as exposures_count, CAST(timestamp AS DATE) AS exposures_date\nFROM\n`CENTRALIZED_PROJECT_ID.global._Default._Default`\nWHERE\nJSON_VALUE(json_payload, '$.codeExposure.originalRequestId') is not NULL\nAND resource.type = \"cloudaicompanion.googleapis.com/Instance\"\nAND (JSON_VALUE(resource.labels, '$.resource_container') in ('SOURCE_PROJECT_ID_1', 'SOURCE_PROJECT_ID_2') or JSON_VALUE(resource.labels, '$.project_id') in ('SOURCE_PROJECT_ID_1', 'SOURCE_PROJECT_ID_2'))\nGROUP BY\nexposures_date\n) as exposures\nON\nexposures.exposures_date = acceptances.acceptances_date\nORDER BY\nexposures_date ASC" }, "outputFullDuration": false, "unitOverride": "" } } ], "thresholds": [], "yAxis": { "label": "", "scale": "LINEAR" } } } }, { "yPos": 16, "height": 16, "width": 24, "widget": { "title": "Code Suggestions by Day", "id": "", "xyChart": { "chartOptions": { "displayHorizontal": false, "mode": "COLOR", "showLegend": false }, "dataSets": [ { "breakdowns": [], "dimensions": [ { "column": "exposures_date", "columnType": "DATE", "maxBinCount": 0, "sortColumn": "exposures_date", "sortOrder": "SORT_ORDER_ASCENDING", "timeBinSize": "0s", "xMax": 0, "xMin": 0 } ], "legendTemplate": "", "measures": [ { "aggregationFunction": { "parameters": [], "type": "average" }, "column": "exposures_count" } ], "plotType": "STACKED_BAR", "targetAxis": "Y1", "timeSeriesQuery": { "opsAnalyticsQuery": { "queryExecutionRules": { "useReservedSlots": false }, "queryHandle": "", "savedQueryId": "", "sql": "SELECT\n COUNT (DISTINCT JSON_VALUE(json_payload, '$.codeExposure.originalRequestId')) as exposures_count, CAST(timestamp AS DATE) AS exposures_date\nFROM\n `CENTRALIZED_PROJECT_ID.global._Default._Default`\nWHERE\n JSON_VALUE(json_payload, '$.codeExposure.originalRequestId') is not NULL\n AND resource.type = \"cloudaicompanion.googleapis.com/Instance\"\n AND (JSON_VALUE(resource.labels, '$.resource_container') in ('SOURCE_PROJECT_ID_1', 'SOURCE_PROJECT_ID_2') or JSON_VALUE(resource.labels, '$.project_id') in ('SOURCE_PROJECT_ID_1', 'SOURCE_PROJECT_ID_2'))\nGROUP BY\n exposures_date\nORDER BY\n exposures_date" }, "outputFullDuration": false, "unitOverride": "" } } ], "thresholds": [], "yAxis": { "label": "", "scale": "LINEAR" } } } }, { "yPos": 16, "xPos": 24, "height": 16, "width": 24, "widget": { "title": "Code Acceptances by Day", "id": "", "xyChart": { "chartOptions": { "displayHorizontal": false, "mode": "COLOR", "showLegend": false }, "dataSets": [ { "breakdowns": [], "dimensions": [ { "column": "acceptances_date", "columnType": "DATE", "maxBinCount": 0, "sortColumn": "acceptances_date", "sortOrder": "SORT_ORDER_ASCENDING", "timeBinSize": "0s", "xMax": 0, "xMin": 0 } ], "legendTemplate": "", "measures": [ { "aggregationFunction": { "parameters": [], "type": "average" }, "column": "acceptances_count" } ], "plotType": "STACKED_BAR", "targetAxis": "Y1", "timeSeriesQuery": { "opsAnalyticsQuery": { "queryExecutionRules": { "useReservedSlots": false }, "queryHandle": "", "savedQueryId": "", "sql": "SELECT\n COUNT (DISTINCT JSON_VALUE(json_payload, '$.codeAcceptance.originalRequestId')) as acceptances_count, CAST(timestamp AS DATE) AS acceptances_date\nFROM\n `CENTRALIZED_PROJECT_ID.global._Default._Default`\nWHERE\n JSON_VALUE(json_payload, '$.codeAcceptance.originalRequestId') is not NULL\n AND resource.type = \"cloudaicompanion.googleapis.com/Instance\"\n AND (JSON_VALUE(resource.labels, '$.resource_container') in ('SOURCE_PROJECT_ID_1', 'SOURCE_PROJECT_ID_2') or JSON_VALUE(resource.labels, '$.project_id') in ('SOURCE_PROJECT_ID_1', 'SOURCE_PROJECT_ID_2'))\nGROUP BY\n acceptances_date\nORDER BY\n acceptances_date\n" }, "outputFullDuration": false, "unitOverride": "" } } ], "thresholds": [], "yAxis": { "label": "", "scale": "LINEAR" } } } }, { "yPos": 32, "height": 16, "width": 24, "widget": { "title": "Lines of Code Accepted by Day", "id": "", "xyChart": { "chartOptions": { "displayHorizontal": false, "mode": "COLOR", "showLegend": false }, "dataSets": [ { "breakdowns": [], "dimensions": [ { "column": "line_count_day", "columnType": "DATE", "maxBinCount": 0, "sortColumn": "line_count_day", "sortOrder": "SORT_ORDER_ASCENDING", "timeBinSize": "0s", "xMax": 0, "xMin": 0 } ], "legendTemplate": "", "measures": [ { "aggregationFunction": { "parameters": [], "type": "average" }, "column": "lines_count" } ], "plotType": "STACKED_BAR", "targetAxis": "Y1", "timeSeriesQuery": { "opsAnalyticsQuery": { "queryExecutionRules": { "useReservedSlots": false }, "queryHandle": "", "savedQueryId": "", "sql": "SELECT\n SUM(lines) as lines_count,\n CAST(max_timestamp AS DATE) AS line_count_day\nFROM\n(\n SELECT\n JSON_VALUE(json_payload, '$.codeAcceptance.originalRequestId') as request_id,\n MAX(CAST(JSON_VALUE(json_payload, '$.codeAcceptance.linesCount') AS INT)) as lines,\n MAX(timestamp) as max_timestamp\n FROM\n `CENTRALIZED_PROJECT_ID.global._Default._Default`\n WHERE\n JSON_VALUE(json_payload, '$.codeAcceptance.originalRequestId') is not NULL\n AND resource.type = \"cloudaicompanion.googleapis.com/Instance\"\n AND (JSON_VALUE(resource.labels, '$.resource_container') in ('SOURCE_PROJECT_ID_1', 'SOURCE_PROJECT_ID_2') or JSON_VALUE(resource.labels, '$.project_id') in ('SOURCE_PROJECT_ID_1', 'SOURCE_PROJECT_ID_2'))\n GROUP BY\n request_id\n )\nGROUP BY\n line_count_day\nORDER BY\n line_count_day" }, "outputFullDuration": false, "unitOverride": "" } } ], "thresholds": [], "yAxis": { "label": "", "scale": "LINEAR" } } } }, { "yPos": 32, "xPos": 24, "height": 16, "width": 24, "widget": { "title": "Chat Exposures by Day", "id": "", "xyChart": { "chartOptions": { "displayHorizontal": false, "mode": "COLOR", "showLegend": false }, "dataSets": [ { "breakdowns": [], "dimensions": [ { "column": "chat_exposures_date", "columnType": "DATE", "maxBinCount": 0, "sortColumn": "chat_exposures_date", "sortOrder": "SORT_ORDER_ASCENDING", "timeBinSize": "0s", "xMax": 0, "xMin": 0 } ], "legendTemplate": "", "measures": [ { "aggregationFunction": { "parameters": [], "type": "average" }, "column": "chat_exposures_count" } ], "plotType": "STACKED_BAR", "targetAxis": "Y1", "timeSeriesQuery": { "opsAnalyticsQuery": { "queryExecutionRules": { "useReservedSlots": false }, "queryHandle": "", "savedQueryId": "", "sql": "SELECT\n COUNT (DISTINCT JSON_VALUE(json_payload, '$.chatExposure.originalRequestId')) as chat_exposures_count, CAST(timestamp AS DATE) AS chat_exposures_date\nFROM\n `CENTRALIZED_PROJECT_ID.global._Default._Default`\nWHERE\n JSON_VALUE(json_payload, '$.chatExposure.originalRequestId') is not NULL\n AND resource.type = \"cloudaicompanion.googleapis.com/Instance\"\n AND (JSON_VALUE(resource.labels, '$.resource_container') in ('SOURCE_PROJECT_ID_1', 'SOURCE_PROJECT_ID_2') or JSON_VALUE(resource.labels, '$.project_id') in ('SOURCE_PROJECT_ID_1', 'SOURCE_PROJECT_ID_2'))\nGROUP BY\n chat_exposures_date\nORDER BY\n chat_exposures_date" }, "outputFullDuration": false, "unitOverride": "" } } ], "thresholds": [], "yAxis": { "label": "", "scale": "LINEAR" } } } } ] } }Replace the following:
CENTRALIZED_PROJECT_ID: The project ID of the centralized logging project that you created.SOURCE_PROJECT_ID_1andSOURCE_PROJECT_ID_2: The project IDs of the projects that you want to collect logs from. If you want to collect logs from more than two projects, then you can add more project IDs to theinclauses of the query.
Disable multi-project logging
If you configured Gemini Code Assist logging for multiple projects, you can disable it by deleting the log sinks that route logs to the centralized project. To stop sending logs from an individual project to the centralized project, delete the log sink that you created in that project:
- In the Google Cloud console, switch to a project that you want to stop collecting logs from.
Go to the Log Router page:
Identify the sink that routes logs to your centralized project.
In the row for that sink, click More actions, and then select Delete sink.
In the dialog that appears, click Delete.
Repeat these steps for each project that you want to stop sending logs to the centralized project.