mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-19 17:50:37 -07:00
feat(telemetry): Add extension name to ToolCallEvent telemetry (#12343)
Co-authored-by: Shnatu <snatu@google.com>
This commit is contained in:
@@ -1244,6 +1244,7 @@ describe('loggers', () => {
|
||||
undefined,
|
||||
undefined,
|
||||
'test-extension',
|
||||
'test-extension-id',
|
||||
);
|
||||
|
||||
const call: CompletedToolCall = {
|
||||
@@ -1278,7 +1279,8 @@ describe('loggers', () => {
|
||||
'installation.id': 'test-installation-id',
|
||||
'event.name': EVENT_TOOL_CALL,
|
||||
'event.timestamp': '2025-01-01T00:00:00.000Z',
|
||||
extension_id: 'test-extension',
|
||||
extension_name: 'test-extension',
|
||||
extension_id: 'test-extension-id',
|
||||
function_name: 'mock_mcp_tool',
|
||||
function_args: JSON.stringify(
|
||||
{
|
||||
|
||||
@@ -223,6 +223,7 @@ export class ToolCallEvent implements BaseTelemetryEvent {
|
||||
tool_type: 'native' | 'mcp';
|
||||
content_length?: number;
|
||||
mcp_server_name?: string;
|
||||
extension_name?: string;
|
||||
extension_id?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
metadata?: { [key: string]: any };
|
||||
@@ -269,6 +270,7 @@ export class ToolCallEvent implements BaseTelemetryEvent {
|
||||
) {
|
||||
this.tool_type = 'mcp';
|
||||
this.mcp_server_name = call.tool.serverName;
|
||||
this.extension_name = call.tool.extensionName;
|
||||
this.extension_id = call.tool.extensionId;
|
||||
} else {
|
||||
this.tool_type = 'native';
|
||||
@@ -319,6 +321,7 @@ export class ToolCallEvent implements BaseTelemetryEvent {
|
||||
tool_type: this.tool_type,
|
||||
content_length: this.content_length,
|
||||
mcp_server_name: this.mcp_server_name,
|
||||
extension_name: this.extension_name,
|
||||
extension_id: this.extension_id,
|
||||
metadata: this.metadata,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user