mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
chore(core): reassign telemetry keys to avoid server conflict (#18161)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -941,6 +941,38 @@ describe('ClearcutLogger', () => {
|
||||
'Something went wrong',
|
||||
]);
|
||||
});
|
||||
|
||||
it('logs a successful routing event with numerical routing fields', () => {
|
||||
const { logger } = setup();
|
||||
const event = new ModelRoutingEvent(
|
||||
'gemini-pro',
|
||||
'NumericalClassifier (Strict)',
|
||||
123,
|
||||
'[Score: 90 / Threshold: 80] reasoning',
|
||||
false,
|
||||
undefined,
|
||||
true,
|
||||
'80',
|
||||
);
|
||||
|
||||
logger?.logModelRoutingEvent(event);
|
||||
|
||||
const events = getEvents(logger!);
|
||||
expect(events.length).toBe(1);
|
||||
expect(events[0]).toHaveEventName(EventNames.MODEL_ROUTING);
|
||||
expect(events[0]).toHaveMetadataValue([
|
||||
EventMetadataKey.GEMINI_CLI_ROUTING_REASONING,
|
||||
'[Score: 90 / Threshold: 80] reasoning',
|
||||
]);
|
||||
expect(events[0]).toHaveMetadataValue([
|
||||
EventMetadataKey.GEMINI_CLI_ROUTING_NUMERICAL_ENABLED,
|
||||
'true',
|
||||
]);
|
||||
expect(events[0]).toHaveMetadataValue([
|
||||
EventMetadataKey.GEMINI_CLI_ROUTING_CLASSIFIER_THRESHOLD,
|
||||
'80',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('logAgentStartEvent', () => {
|
||||
|
||||
@@ -1234,6 +1234,28 @@ export class ClearcutLogger {
|
||||
});
|
||||
}
|
||||
|
||||
if (event.reasoning && this.config?.getTelemetryLogPromptsEnabled()) {
|
||||
data.push({
|
||||
gemini_cli_key: EventMetadataKey.GEMINI_CLI_ROUTING_REASONING,
|
||||
value: event.reasoning,
|
||||
});
|
||||
}
|
||||
|
||||
if (event.enable_numerical_routing !== undefined) {
|
||||
data.push({
|
||||
gemini_cli_key: EventMetadataKey.GEMINI_CLI_ROUTING_NUMERICAL_ENABLED,
|
||||
value: event.enable_numerical_routing.toString(),
|
||||
});
|
||||
}
|
||||
|
||||
if (event.classifier_threshold) {
|
||||
data.push({
|
||||
gemini_cli_key:
|
||||
EventMetadataKey.GEMINI_CLI_ROUTING_CLASSIFIER_THRESHOLD,
|
||||
value: event.classifier_threshold,
|
||||
});
|
||||
}
|
||||
|
||||
this.enqueueLogEvent(this.createLogEvent(EventNames.MODEL_ROUTING, data));
|
||||
this.flushIfNeeded();
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// Defines valid event metadata keys for Clearcut logging.
|
||||
export enum EventMetadataKey {
|
||||
// Deleted enums: 24
|
||||
// Next ID: 144
|
||||
// Next ID: 148
|
||||
|
||||
GEMINI_CLI_KEY_UNKNOWN = 0,
|
||||
|
||||
@@ -542,4 +542,17 @@ export enum EventMetadataKey {
|
||||
|
||||
// Logs the duration spent in an approval mode in milliseconds.
|
||||
GEMINI_CLI_APPROVAL_MODE_DURATION_MS = 143,
|
||||
|
||||
// ==========================================================================
|
||||
// Model Routing Event Keys (Cont.)
|
||||
// ==========================================================================
|
||||
|
||||
// Logs the reasoning for the routing decision.
|
||||
GEMINI_CLI_ROUTING_REASONING = 145,
|
||||
|
||||
// Logs whether numerical routing was enabled.
|
||||
GEMINI_CLI_ROUTING_NUMERICAL_ENABLED = 146,
|
||||
|
||||
// Logs the classifier threshold used.
|
||||
GEMINI_CLI_ROUTING_CLASSIFIER_THRESHOLD = 147,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user