summaryrefslogtreecommitdiff
path: root/packages/core/src/telemetry/loggers.test.ts
diff options
context:
space:
mode:
authoruttamkanodia14 <[email protected]>2025-07-11 22:17:46 +0530
committerGitHub <[email protected]>2025-07-11 16:47:46 +0000
commit93284281de4a1593de802f3823707b9c1a43171e (patch)
tree51a88d91fe132cc5607e2f5cbb7aa21701418508 /packages/core/src/telemetry/loggers.test.ts
parented00612cf7107452d1e52044feda4305b410b81b (diff)
Logs the auth type in the user prompts, api responses and errors (#3795)
Diffstat (limited to 'packages/core/src/telemetry/loggers.test.ts')
-rw-r--r--packages/core/src/telemetry/loggers.test.ts16
1 files changed, 14 insertions, 2 deletions
diff --git a/packages/core/src/telemetry/loggers.test.ts b/packages/core/src/telemetry/loggers.test.ts
index e7dd721f..13617946 100644
--- a/packages/core/src/telemetry/loggers.test.ts
+++ b/packages/core/src/telemetry/loggers.test.ts
@@ -127,7 +127,12 @@ describe('loggers', () => {
} as unknown as Config;
it('should log a user prompt', () => {
- const event = new UserPromptEvent(11, 'prompt-id-8', 'test-prompt');
+ const event = new UserPromptEvent(
+ 11,
+ 'prompt-id-8',
+ AuthType.USE_VERTEX_AI,
+ 'test-prompt',
+ );
logUserPrompt(mockConfig, event);
@@ -151,7 +156,11 @@ describe('loggers', () => {
getTargetDir: () => 'target-dir',
getUsageStatisticsEnabled: () => true,
} as unknown as Config;
- const event = new UserPromptEvent(11, 'test-prompt');
+ const event = new UserPromptEvent(
+ 11,
+ 'test-prompt',
+ AuthType.CLOUD_SHELL,
+ );
logUserPrompt(mockConfig, event);
@@ -202,6 +211,7 @@ describe('loggers', () => {
'test-model',
100,
'prompt-id-1',
+ AuthType.LOGIN_WITH_GOOGLE,
usageData,
'test-response',
);
@@ -226,6 +236,7 @@ describe('loggers', () => {
total_token_count: 0,
response_text: 'test-response',
prompt_id: 'prompt-id-1',
+ auth_type: 'oauth-personal',
},
});
@@ -263,6 +274,7 @@ describe('loggers', () => {
'test-model',
100,
'prompt-id-1',
+ AuthType.USE_GEMINI,
usageData,
'test-response',
'test-error',