mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-12 15:10:59 -07:00
feat(logging): Add model name to content retry events (#9266)
This commit is contained in:
@@ -298,6 +298,7 @@ export class GeminiChat {
|
||||
attempt,
|
||||
(error as InvalidStreamError).type,
|
||||
INVALID_CONTENT_RETRY_OPTIONS.initialDelayMs,
|
||||
model,
|
||||
),
|
||||
);
|
||||
await new Promise((res) =>
|
||||
@@ -321,6 +322,7 @@ export class GeminiChat {
|
||||
new ContentRetryFailureEvent(
|
||||
INVALID_CONTENT_RETRY_OPTIONS.maxAttempts,
|
||||
(lastError as InvalidStreamError).type,
|
||||
model,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -825,6 +825,10 @@ export class ClearcutLogger {
|
||||
gemini_cli_key: EventMetadataKey.GEMINI_CLI_CONTENT_RETRY_DELAY_MS,
|
||||
value: String(event.retry_delay_ms),
|
||||
},
|
||||
{
|
||||
gemini_cli_key: EventMetadataKey.GEMINI_CLI_API_REQUEST_MODEL,
|
||||
value: event.model,
|
||||
},
|
||||
];
|
||||
|
||||
this.enqueueLogEvent(this.createLogEvent(EventNames.CONTENT_RETRY, data));
|
||||
@@ -843,6 +847,10 @@ export class ClearcutLogger {
|
||||
EventMetadataKey.GEMINI_CLI_CONTENT_RETRY_FAILURE_FINAL_ERROR_TYPE,
|
||||
value: event.final_error_type,
|
||||
},
|
||||
{
|
||||
gemini_cli_key: EventMetadataKey.GEMINI_CLI_API_REQUEST_MODEL,
|
||||
value: event.model,
|
||||
},
|
||||
];
|
||||
|
||||
if (event.total_duration_ms) {
|
||||
|
||||
@@ -498,17 +498,20 @@ export class ContentRetryEvent implements BaseTelemetryEvent {
|
||||
attempt_number: number;
|
||||
error_type: string; // e.g., 'EmptyStreamError'
|
||||
retry_delay_ms: number;
|
||||
model: string;
|
||||
|
||||
constructor(
|
||||
attempt_number: number,
|
||||
error_type: string,
|
||||
retry_delay_ms: number,
|
||||
model: string,
|
||||
) {
|
||||
this['event.name'] = 'content_retry';
|
||||
this['event.timestamp'] = new Date().toISOString();
|
||||
this.attempt_number = attempt_number;
|
||||
this.error_type = error_type;
|
||||
this.retry_delay_ms = retry_delay_ms;
|
||||
this.model = model;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -518,10 +521,12 @@ export class ContentRetryFailureEvent implements BaseTelemetryEvent {
|
||||
total_attempts: number;
|
||||
final_error_type: string;
|
||||
total_duration_ms?: number; // Optional: total time spent retrying
|
||||
model: string;
|
||||
|
||||
constructor(
|
||||
total_attempts: number,
|
||||
final_error_type: string,
|
||||
model: string,
|
||||
total_duration_ms?: number,
|
||||
) {
|
||||
this['event.name'] = 'content_retry_failure';
|
||||
@@ -529,6 +534,7 @@ export class ContentRetryFailureEvent implements BaseTelemetryEvent {
|
||||
this.total_attempts = total_attempts;
|
||||
this.final_error_type = final_error_type;
|
||||
this.total_duration_ms = total_duration_ms;
|
||||
this.model = model;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user