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
This commit is contained in:
Jerop Kipruto
2025-06-12 19:36:51 -04:00
committed by GitHub
parent dc378e8d60
commit 3c3da655b0
6 changed files with 294 additions and 209 deletions

View File

@@ -296,8 +296,8 @@ These are timestamped records of specific events.
- **Attributes**:
- `model`
- `duration_ms`
- `input_token_count`
- `request_text` (optional)
- `gemini_cli.api_error`: Fired if the API request fails.
@@ -307,7 +307,6 @@ These are timestamped records of specific events.
- `error_type`
- `status_code`
- `duration_ms`
- `attempt`
- `gemini_cli.api_response`: Fired upon receiving a response from the Gemini API.
- **Attributes**:
@@ -315,7 +314,7 @@ These are timestamped records of specific events.
- `status_code`
- `duration_ms`
- `error` (optional)
- `attempt`
- `input_token_count`
- `output_token_count`
- `cached_content_token_count`
- `thoughts_token_count`