mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-30 06:54:15 -07:00
feat(telemetry): add Clearcut instrumentation for AI credits billing events (#22153)
This commit is contained in:
@@ -85,6 +85,12 @@ import { uiTelemetryService, type UiEvent } from './uiTelemetry.js';
|
||||
import { ClearcutLogger } from './clearcut-logger/clearcut-logger.js';
|
||||
import { debugLogger } from '../utils/debugLogger.js';
|
||||
import type { BillingTelemetryEvent } from './billingEvents.js';
|
||||
import {
|
||||
CreditsUsedEvent,
|
||||
OverageOptionSelectedEvent,
|
||||
EmptyWalletMenuShownEvent,
|
||||
CreditPurchaseClickEvent,
|
||||
} from './billingEvents.js';
|
||||
|
||||
export function logCliConfiguration(
|
||||
config: Config,
|
||||
@@ -877,4 +883,17 @@ export function logBillingEvent(
|
||||
};
|
||||
logger.emit(logRecord);
|
||||
});
|
||||
|
||||
const cc = ClearcutLogger.getInstance(config);
|
||||
if (cc) {
|
||||
if (event instanceof CreditsUsedEvent) {
|
||||
cc.logCreditsUsedEvent(event);
|
||||
} else if (event instanceof OverageOptionSelectedEvent) {
|
||||
cc.logOverageOptionSelectedEvent(event);
|
||||
} else if (event instanceof EmptyWalletMenuShownEvent) {
|
||||
cc.logEmptyWalletMenuShownEvent(event);
|
||||
} else if (event instanceof CreditPurchaseClickEvent) {
|
||||
cc.logCreditPurchaseClickEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user