mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-12 11:00:51 -07:00
feat(plan): create a metric for execution of plans generated in plan mode (#18236)
This commit is contained in:
@@ -55,6 +55,7 @@ import type {
|
||||
HookCallEvent,
|
||||
StartupStatsEvent,
|
||||
LlmLoopCheckEvent,
|
||||
PlanExecutionEvent,
|
||||
} from './types.js';
|
||||
import {
|
||||
recordApiErrorMetrics,
|
||||
@@ -73,6 +74,7 @@ import {
|
||||
recordRecoveryAttemptMetrics,
|
||||
recordLinesChanged,
|
||||
recordHookCallMetrics,
|
||||
recordPlanExecution,
|
||||
} from './metrics.js';
|
||||
import { bufferTelemetryEvent } from './sdk.js';
|
||||
import type { UiEvent } from './uiTelemetry.js';
|
||||
@@ -719,6 +721,20 @@ export function logApprovalModeDuration(
|
||||
});
|
||||
}
|
||||
|
||||
export function logPlanExecution(config: Config, event: PlanExecutionEvent) {
|
||||
ClearcutLogger.getInstance(config)?.logPlanExecutionEvent(event);
|
||||
bufferTelemetryEvent(() => {
|
||||
logs.getLogger(SERVICE_NAME).emit({
|
||||
body: event.toLogBody(),
|
||||
attributes: event.toOpenTelemetryAttributes(config),
|
||||
});
|
||||
|
||||
recordPlanExecution(config, {
|
||||
approval_mode: event.approval_mode,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function logHookCall(config: Config, event: HookCallEvent): void {
|
||||
ClearcutLogger.getInstance(config)?.logHookCallEvent(event);
|
||||
bufferTelemetryEvent(() => {
|
||||
|
||||
Reference in New Issue
Block a user