import { type EditOutcome, type EditSource } from './genAiAttributes'; import type { IOTelService } from './otelService'; /** * Pre-configured OTel GenAI metric instruments. * All methods are static to avoid per-call allocations (aligned with gemini-cli pattern). */ export declare class GenAiMetrics { static recordOperationDuration(otel: IOTelService, durationSec: number, attrs: { operationName: string; providerName: string; requestModel: string; responseModel?: string; serverAddress?: string; serverPort?: number; errorType?: string; }): void; static recordTokenUsage(otel: IOTelService, tokenCount: number, tokenType: 'input' | 'output', attrs: { operationName: string; providerName: string; requestModel: string; responseModel?: string; serverAddress?: string; }): void; static recordToolCallCount(otel: IOTelService, toolName: string, success: boolean): void; static recordToolCallDuration(otel: IOTelService, toolName: string, durationMs: number): void; static recordAgentDuration(otel: IOTelService, agentName: string, durationSec: number): void; static recordAgentTurnCount(otel: IOTelService, agentName: string, turnCount: number): void; static recordTimeToFirstToken(otel: IOTelService, model: string, ttftSec: number): void; /** * GenAI-convention time-to-first-chunk histogram (seconds). Emitted for streaming * responses alongside the legacy `copilot_chat.time_to_first_token` metric. */ static recordTimeToFirstChunk(otel: IOTelService, ttfcSec: number, attrs: { operationName: string; providerName: string; requestModel: string; responseModel?: string; }): void; /** * GenAI-convention inter-chunk latency histogram (seconds). Recorded once per * streamed output chunk after the first, measuring the gap since the prior chunk. */ static recordTimePerOutputChunk(otel: IOTelService, interChunkSec: number, attrs: { operationName: string; providerName: string; requestModel: string; responseModel?: string; }): void; static incrementSessionCount(otel: IOTelService): void; /** Accept/reject counter for inline chat and chat editing edits */ static recordEditAcceptance(otel: IOTelService, source: EditSource, outcome: EditOutcome, languageId?: string): void; /** File-level chat editing session outcome (accepted/rejected/saved) */ static recordChatEditOutcome(otel: IOTelService, source: EditSource, outcome: EditOutcome, languageId?: string, hasRemainingEdits?: boolean): void; /** 4-gram text similarity survival score */ static recordEditSurvivalFourGram(otel: IOTelService, source: EditSource, score: number, timeDelayMs: number): void; /** No-revert survival score */ static recordEditSurvivalNoRevert(otel: IOTelService, source: EditSource, score: number, timeDelayMs: number): void; /** Lines of code added/removed by accepted agent edits */ static incrementLinesOfCode(otel: IOTelService, type: 'added' | 'removed', languageId: string | undefined, count: number): void; static incrementUserActionCount(otel: IOTelService, action: string): void; static incrementUserFeedbackCount(otel: IOTelService, rating: string): void; static incrementAgentEditResponseCount(otel: IOTelService, outcome: string): void; static incrementAgentSummarizationCount(otel: IOTelService, outcome: string): void; static incrementPullRequestCount(otel: IOTelService): void; static incrementCloudSessionCount(otel: IOTelService, partnerAgent: string): void; /** * Records a cloud task operation outcome and, when provided, its duration. */ static recordCloudOperation(otel: IOTelService, operation: string, success: boolean, durationMs?: number): void; static incrementCloudError(otel: IOTelService, operation: string, errorType: string): void; } //# sourceMappingURL=genAiMetrics.d.ts.map