Commit Graph

25 Commits

Author SHA1 Message Date
Anas H. Sulaiman 34e0d9c0b6
cleanup unused `allowBuildArtifacts` (#1010) 2025-06-13 12:00:38 -04:00
Jerop Kipruto 95e4a60a83
Telemetry: Auto-export to GCP if GOOGLE_CLOUD_PROJECT is set (#1003)
This change simplifies telemetry setup for users who want to integrate with GCP, as they no longer need to configure a local collector or an explicit endpoint if their project is already set up in the environment.

This change updates the telemetry system to automatically export traces, logs, and metrics to Google Cloud Platform (GCP) if the `GOOGLE_CLOUD_PROJECT` environment variable is set and no explicit `telemetryOtlpEndpoint` is configured by the user.

Key changes:
-   The default `telemetryOtlpEndpoint` in `Config` is now an empty string.
-   The `initializeTelemetry` SDK logic now prioritizes:
    -  User-defined `telemetryOtlpEndpoint`.
    -  `GOOGLE_CLOUD_PROJECT` for direct GCP export.
    -  Console exporters as a fallback.
-   If an invalid `telemetryOtlpEndpoint` is provided, it falls back to console exporters with a warning.

#750
2025-06-13 03:51:41 -04:00
Jerop Kipruto b20c8389f3
Handle telemetry in non-interactive mode (#1002)
Changes:
- Ensure proper shutdown in non-interactive mode
- Ensures the initial user prompt is logged in non-interactive mode
- Improve telemetry for streaming - handle chunks and input token count is now alongside other token counts in response

To test:
- Follow instructions in https://github.com/google-gemini/gemini-cli/blob/main/docs/core/telemetry.md#google-cloud
- Run CLI in non-interactive mode and observe logs/metrics in GCP Logs Explorer and Metrics Explorer

#750
2025-06-13 03:44:17 -04:00
Jerop Kipruto 3c3da655b0
Refactor OTEL logging for API calls (#991)
Refactor OpenTelemetry logging for API requests, responses, and errors. Moved logging responsibility from GeminiClient to GeminiChat for more detailed logging.

#750
2025-06-12 16:36:51 -07:00
Jerop Kipruto 6723c72fa5
telemetry: include user decisions in tool call logs (#966)
Add the user's decision (accept, reject, modify) to tool call telemetry to better understand user intent. The decision provides crucial context to the `success` metric, as a user can reject a call that would have succeeded or accept one that fails. 

Also prettify the arguments json.

Example: 
![image](https://github.com/user-attachments/assets/251cb9fc-ceaa-4cdd-929c-8de47031aca8)

#750
2025-06-12 20:48:10 +00:00
Jerop Kipruto 89f682f081
Telemetry: Improve clarity of user prompt event (#967) 2025-06-11 21:43:00 -04:00
jerop c0580eaf4b feat(telemetry): expand cli configuration event
Adds the following attributes to the  event:
- embedding_model
- api_key_enabled
- code_assist_enabled
- debug_mode
- mcp_servers

This additional data will provide more insight into user configurations.
2025-06-11 16:22:35 -04:00
jerop 03bc1f3141 feat(telemetry): Update API response in telemetry
Adds the text content of the API response to the  telemetry event. This provides more context for debugging and analysis without logging the entire, potentially large, response object.

- Adds an optional  field to the  type.
- Updates  to include the  field in the logged attributes.
- Modifies the  to extract the response text using  and pass it to the logger.
- Adds a new test file for the telemetry loggers, including tests for the  function to verify the new functionality.
2025-06-11 14:18:16 -04:00
jerop d96af8bacd refactor(telemetry): pass config object to telemetry functions
This commit refactors the telemetry system to pass a  object to various logging and metrics functions. This change centralizes configuration management within the telemetry system, making it more modular and easier to maintain.

The  constructor and various tool execution functions have been updated to accept the  object, which is then passed down to the telemetry functions. This eliminates the need to pass individual configuration values, such as , through multiple layers of the application.
2025-06-11 13:24:41 -04:00
jerop 7ba2b13870 update token usage with types 2025-06-11 10:38:07 -04:00
jerop 3f5ac384cc update from metrics and logs prefix from gemini_code to gemini_cli 2025-06-11 01:28:26 -04:00
jerop b92fa78a1e docs(telemetry): Refine OTEL Collector setup instructions
Standardizes on the  distribution for local and Google Cloud setups.

Restructures the guide to present Docker and standalone binary as clear, parallel options and makes the Google Cloud command more robust.
2025-06-10 20:04:05 -04:00
jerop 916cfee08d update documentation for otel 2025-06-10 18:14:04 -04:00
jerop f0f7a30d9f docs(telemetry): improve telemetry documentation
This commit enhances the telemetry documentation with several key improvements for clarity and usability.

- Adds a prominent note clarifying that telemetry is currently incompatible with sandbox mode.
- Updates the example JSON configuration to explicitly include sandbox: false to prevent user confusion.
- Introduces a new Configurations section with instructions to create the  directory.
- Adds a new step for setting necessary environment variables for the Google Cloud setup.
- Makes the  command for Google Cloud more portable by using the  environment variable instead of a hardcoded path.
- Re-numbers the steps in the Google Cloud setup guide to maintain a logical flow.
2025-06-10 16:51:46 -04:00
anj-s 83660ec016
Fix null pointer for traces field and use the batch processor (#884) 2025-06-10 09:24:27 -07:00
Olcan 87474e52d7
rename shell tool more intuitively as run_shell_command (from historical name of execute_bash_command inherited from terminal tool) (#869) 2025-06-09 08:57:30 -07:00
N. Taylor Mullen d62dad5575
Revert "Add batch editing capabilities to Edit Tool (#648)" (#857) 2025-06-08 23:20:43 +00:00
cperry-goog 63757d6a7a
docs: update and reorganize documentation (#806) 2025-06-07 10:47:30 -07:00
Keith Ballinger 0c86874677
Add batch editing capabilities to Edit Tool (#648)
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
2025-06-06 22:54:37 -07:00
Jerop Kipruto 2ebf2fbc82
OpenTelemetry Integration & Telemetry Control Flag (#762) 2025-06-05 13:04:25 -07:00
Eddie Santos e02868bb1a
Bump default model to `gemini-2.5-pro-preview-06-05` (#765) 2025-06-05 11:52:36 -07:00
Riccardo Carlesso 13b55c6e68
Docs: Update architecture diagram with Google colors (for future aricles) (#718) 2025-06-04 12:33:07 -07:00
Keith Ballinger a14aada945
Fix broken documentation links after server->core folder rename (#740) 2025-06-04 10:02:07 -07:00
Olcan e190249732
link tool discovery/call docs from core configuration doc (#720) 2025-06-03 10:22:43 -07:00
Tommaso Sciortino 21fba832d1
Rename server->core (#638) 2025-05-30 18:25:47 -07:00