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.
This commit is contained in:
jerop
2025-06-11 17:47:21 +00:00
committed by Jerop Kipruto
parent 9237e95f11
commit 03bc1f3141
5 changed files with 130 additions and 1 deletions

View File

@@ -291,7 +291,7 @@ These are timestamped records of specific events.
- **Attributes**:
- `model`
- `duration_ms`
- `prompt_token_count`
- `input_token_count`
- `gemini_cli.api_error`: Fired if the API request fails.
@@ -310,6 +310,11 @@ These are timestamped records of specific events.
- `duration_ms`
- `error` (optional)
- `attempt`
- `output_token_count`
- `cached_content_token_count`
- `thoughts_token_count`
- `tool_token_count`
- `response_text` (optional)
### Metrics