@@ -45,6 +45,7 @@ Environment variables can override these settings.
4545| ` logPrompts ` | ` GEMINI_TELEMETRY_LOG_PROMPTS ` | Include prompts in telemetry logs | ` true ` /` false ` | ` true ` |
4646| ` useCollector ` | ` GEMINI_TELEMETRY_USE_COLLECTOR ` | Use external OTLP collector (advanced) | ` true ` /` false ` | ` false ` |
4747| ` useCliAuth ` | ` GEMINI_TELEMETRY_USE_CLI_AUTH ` | Use CLI credentials for telemetry (GCP target only) | ` true ` /` false ` | ` false ` |
48+ | - | ` GEMINI_CLI_SURFACE ` | Optional custom label for traffic reporting | string | - |
4849
4950** Note on boolean environment variables:** For boolean settings like ` enabled ` ,
5051setting the environment variable to ` true ` or ` 1 ` enables the feature.
@@ -216,6 +217,50 @@ recommend using file-based output for local development.
216217For advanced local telemetry setups (such as Jaeger or Genkit), see the
217218[Local development guide](../local-development.md#viewing-traces).
218219
220+ # # Client identification
221+
222+ Gemini CLI includes identifiers in its ` User-Agent` header to help you
223+ differentiate and report on API traffic from different environments (for
224+ example, identifying calls from Gemini Code Assist versus a standard terminal).
225+
226+ # ## Automatic identification
227+
228+ Most integrated environments are identified automatically without additional
229+ configuration. The identifier is included as a prefix to the ` User-Agent` and as
230+ a " surface" tag in the parenthetical metadata.
231+
232+ | Environment | User-Agent Prefix | Surface Tag |
233+ | :---------------------------------- | :--------------------------- | :---------- |
234+ | ** Gemini Code Assist (Agent Mode)** | ` GeminiCLI-a2a-server` | ` vscode` |
235+ | ** Zed (via ACP)** | ` GeminiCLI-acp-zed` | ` zed` |
236+ | ** XCode (via ACP)** | ` GeminiCLI-acp-xcode` | ` xcode` |
237+ | ** IntelliJ IDEA (via ACP)** | ` GeminiCLI-acp-intellijidea` | ` jetbrains` |
238+ | ** Standard Terminal** | ` GeminiCLI` | ` terminal` |
239+
240+ ** Example User-Agent:**
241+ ` GeminiCLI-a2a-server/0.34.0/gemini-pro (linux; x64; vscode)`
242+
243+ # ## Custom identification
244+
245+ You can provide a custom identifier for your own scripts or automation by
246+ setting the ` GEMINI_CLI_SURFACE` environment variable. This is useful for
247+ tracking specific internal tools or distribution channels in your GCP logs.
248+
249+ ** macOS/Linux**
250+
251+ ` ` ` bash
252+ export GEMINI_CLI_SURFACE=" my-custom-tool"
253+ ` ` `
254+
255+ ** Windows (PowerShell)**
256+
257+ ` ` ` powershell
258+ $env :GEMINI_CLI_SURFACE=" my-custom-tool"
259+ ` ` `
260+
261+ When set, the value appears at the end of the ` User-Agent` parenthetical:
262+ ` GeminiCLI/0.34.0/gemini-pro (linux; x64; my-custom-tool)`
263+
219264# # Logs, metrics, and traces
220265
221266This section describes the structure of logs, metrics, and traces generated by
0 commit comments