This document describes how to configure the observability settings for your Gemini Enterprise app using the Google Cloud console. After you enable the settings, you can view the following data from your interactions with the assistant in your Gemini Enterprise web app:
- View metrics in Metrics Explorer.
- View traces and spans in Trace Explorer.
Key concepts
This section introduces key concepts related to observability in Gemini Enterprise.
| Concept | Description |
|---|---|
| Trace |
A trace is a collection of spans that represents a single request or
transaction as it flows through different services and components.
For example, a trace represents the entire lifecycle of a request. This includes a user asking a question from the Gemini Enterprise assistant, the Gemini Enterprise assistant responding, and any subsequent actions triggered by the answer, such as sending an email. |
| Span | A span is a single, timed unit of work within a trace. It represents a specific operation, such as a function call, an API request, or a database query. Each span includes details like its start and end times, a unique ID, and its relationship to other spans. These relationships together form a trace. |
| Span logs | Span logs are timestamped, free-form messages or events associated with a specific span. They provide detailed, contextual information about a span's execution, helping users debug issues and understand the flow of a request. |
| Metrics | Metrics are numerical measurements that systems collect over time. These measurements represent the performance, resource utilization, or behavior of a system. Engineers use metrics to monitor system health, identify trends, and trigger alerts. |
| Usage audit logs | Usage audit logs are records of administrative activities and accesses within your Google Cloud resources. They provide detailed information about who performed what action, when, and from where. These logs are essential for security auditing, compliance, and understanding how your resources are being used. |
| Gemini Enterprise connector error logs | Gemini Enterprise connector error logs capture errors and failures encountered when integrating Gemini Enterprise with third-party data sources like Jira and Microsoft OneDrive. These logs include connection problems, data transformation issues, and API errors. |
Before you begin
Make sure you have the following:
The Discovery Engine Admin role.
An existing Gemini Enterprise web app. For information about creating a new app, see Create an app.
Turn on observability settings
To turn on observability for your Gemini Enterprise app, you can use either the Google Cloud console or the REST API.
Console
To turn on the observability settings using the Google Cloud console, follow these steps:
In the Google Cloud console, go to the Gemini Enterprise page.
Click the name of the app that you want to configure.
Click Configurations and then click the Observability tab.
You can turn on or turn off the following settings:
Observability setting Description Enable instrumentation of OpenTelemetry traces and logs When enabled, you can view traces, spans, span logs, and metrics associated with your logs in Cloud Logging. Enable logging of prompt inputs and response outputs When enabled, Cloud Logging logs the full content of user prompts and responses. This includes sensitive data or Personally Identifiable Information (PII). To enable this setting, you must first enable Enable instrumentation of OpenTelemetry traces and logs.
REST
To configure observability settings using the REST API, see the following sections:
Turn on observability when creating an app
To create a new app with observability turned on, run the following command:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-H "X-Goog-User-Project: PROJECT_ID" \
"https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/LOCATION/collections/default_collection/engines?engineId=APP_ID" \
-d '{
"name": "projects/PROJECT_ID/locations/LOCATION/collections/default_collection/engines/APP_ID",
"displayName": "APP_DISPLAY_NAME",
"solutionType": "SOLUTION_TYPE_SEARCH",
"searchEngineConfig": {
"searchTier": "SEARCH_TIER_ENTERPRISE",
"searchAddOns": ["SEARCH_ADD_ON_LLM"],
"requiredSubscriptionTier": "SUBSCRIPTION_TIER_SEARCH_AND_ASSISTANT"
},
"industryVertical": "GENERIC",
"appType": "APP_TYPE_INTRANET",
"observabilityConfig": {
"observabilityEnabled": true,
"sensitiveLoggingEnabled": true
}
}'
Replace the following:
ENDPOINT_LOCATION: the multi-region for your API request. Specify one of the following values:usfor the US multi-regioneufor the EU multi-regionglobalfor the Global location
PROJECT_ID: the ID of your project.LOCATION: the multi-region of your data store:global,us, oreuAPP_ID: the ID of the app that you want to create.APP_DISPLAY_NAME: the display name of the app that you want to create.
Turn on observability for an existing app
To turn on observability on an existing app, run the following command:
curl -X PATCH -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-H "X-Goog-User-Project: PROJECT_ID" \
"https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/LOCATION/collections/default_collection/engines/APP_ID?updateMask=observabilityConfig" \
-d '{
"observabilityConfig": {
"observabilityEnabled": true,
"sensitiveLoggingEnabled": true
}
}'
Replace the following:
ENDPOINT_LOCATION: the multi-region for your API request. Specify one of the following values:usfor the US multi-regioneufor the EU multi-regionglobalfor the Global location
PROJECT_ID: the ID of your project.LOCATION: the multi-region of your data store:global,us, oreuAPP_ID: the ID of the app.
Turn off observability settings
To turn off the observability settings for your Gemini Enterprise app, you can use either the Google Cloud console or the REST API.
Console
To turn off the observability settings using the Google Cloud console, follow these steps:
In the Google Cloud console, go to the Gemini Enterprise page.
Click the name of the app that you want to turn off the obesrabality settings.
Click Configurations and then click the Observability tab.
You can turn off the following settings:
Observability setting Description Enable instrumentation of OpenTelemetry traces and logs When turned off, this setting stops the collection of traces, spans, span logs, and metrics. It also turns off the Enable logging of prompt inputs and response outputs setting, which means no logs are sent to Cloud Logging. Enable logging of prompt inputs and response outputs When turned off, Cloud Logging does not log prompt inputs and response outputs.
REST
To turn off observability settings using the REST API, run the following command:
curl -X PATCH -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-H "X-Goog-User-Project: PROJECT_ID" \
"https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/LOCATION/collections/default_collection/engines/APP_ID?updateMask=observabilityConfig" \
-d '{
"observabilityConfig": {
"observabilityEnabled": false,
"sensitiveLoggingEnabled": false
}
}'
Replace the following:
ENDPOINT_LOCATION: the multi-region for your API request. Specify one of the following values:usfor the US multi-regioneufor the EU multi-regionglobalfor the Global location
PROJECT_ID: the ID of your project.LOCATION: the multi-region of your data store:global,us, oreuAPP_ID: the ID of the app.
What's next
- To learn more about how to access the Gemini Enterprise logs, see Access usage audit logs.
- To learn more about how to access the Gemini Enterprise trace and span data, see Access traces and spans in Trace Explorer.
- To learn more about how to access the Gemini Enterprise metrics, see Access metrics in Metrics Explorer.