fix(metrics): Do not convert numerical metrics to strings (#6701)
Co-authored-by: Shnatu <snatu@google.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Bryan Morgan <bryanmorgan@google.com> Co-authored-by: Arya Gummadi <aryagummadi@google.com>
This commit is contained in:
parent
f8f79bf2f7
commit
0242ecd83a
|
@ -385,12 +385,14 @@ export class ClearcutLogger {
|
||||||
{
|
{
|
||||||
gemini_cli_key:
|
gemini_cli_key:
|
||||||
EventMetadataKey.GEMINI_CLI_START_SESSION_MCP_SERVERS_COUNT,
|
EventMetadataKey.GEMINI_CLI_START_SESSION_MCP_SERVERS_COUNT,
|
||||||
value: event.mcp_servers_count ? event.mcp_servers_count : '',
|
value: event.mcp_servers_count
|
||||||
|
? event.mcp_servers_count.toString()
|
||||||
|
: '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
gemini_cli_key:
|
gemini_cli_key:
|
||||||
EventMetadataKey.GEMINI_CLI_START_SESSION_MCP_TOOLS_COUNT,
|
EventMetadataKey.GEMINI_CLI_START_SESSION_MCP_TOOLS_COUNT,
|
||||||
value: event.mcp_tools_count ? event.mcp_tools_count : '',
|
value: event.mcp_tools_count?.toString() ?? '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
gemini_cli_key: EventMetadataKey.GEMINI_CLI_START_SESSION_MCP_TOOLS,
|
gemini_cli_key: EventMetadataKey.GEMINI_CLI_START_SESSION_MCP_TOOLS,
|
||||||
|
|
|
@ -162,7 +162,7 @@ describe('loggers', () => {
|
||||||
file_filtering_respect_git_ignore: true,
|
file_filtering_respect_git_ignore: true,
|
||||||
debug_mode: true,
|
debug_mode: true,
|
||||||
mcp_servers: 'test-server',
|
mcp_servers: 'test-server',
|
||||||
mcp_servers_count: '1',
|
mcp_servers_count: 1,
|
||||||
mcp_tools: undefined,
|
mcp_tools: undefined,
|
||||||
mcp_tools_count: undefined,
|
mcp_tools_count: undefined,
|
||||||
},
|
},
|
||||||
|
|
|
@ -39,8 +39,8 @@ export class StartSessionEvent implements BaseTelemetryEvent {
|
||||||
telemetry_enabled: boolean;
|
telemetry_enabled: boolean;
|
||||||
telemetry_log_user_prompts_enabled: boolean;
|
telemetry_log_user_prompts_enabled: boolean;
|
||||||
file_filtering_respect_git_ignore: boolean;
|
file_filtering_respect_git_ignore: boolean;
|
||||||
mcp_servers_count?: string;
|
mcp_servers_count: number;
|
||||||
mcp_tools_count?: string;
|
mcp_tools_count?: number;
|
||||||
mcp_tools?: string;
|
mcp_tools?: string;
|
||||||
|
|
||||||
constructor(config: Config, toolRegistry?: ToolRegistry) {
|
constructor(config: Config, toolRegistry?: ToolRegistry) {
|
||||||
|
@ -70,14 +70,12 @@ export class StartSessionEvent implements BaseTelemetryEvent {
|
||||||
config.getTelemetryLogPromptsEnabled();
|
config.getTelemetryLogPromptsEnabled();
|
||||||
this.file_filtering_respect_git_ignore =
|
this.file_filtering_respect_git_ignore =
|
||||||
config.getFileFilteringRespectGitIgnore();
|
config.getFileFilteringRespectGitIgnore();
|
||||||
this.mcp_servers_count = mcpServers
|
this.mcp_servers_count = mcpServers ? Object.keys(mcpServers).length : 0;
|
||||||
? Object.keys(mcpServers).length.toString()
|
|
||||||
: '';
|
|
||||||
if (toolRegistry) {
|
if (toolRegistry) {
|
||||||
const mcpTools = toolRegistry
|
const mcpTools = toolRegistry
|
||||||
.getAllTools()
|
.getAllTools()
|
||||||
.filter((tool) => tool instanceof DiscoveredMCPTool);
|
.filter((tool) => tool instanceof DiscoveredMCPTool);
|
||||||
this.mcp_tools_count = mcpTools.length.toString();
|
this.mcp_tools_count = mcpTools.length;
|
||||||
this.mcp_tools = mcpTools
|
this.mcp_tools = mcpTools
|
||||||
.map((tool) => (tool as DiscoveredMCPTool).name)
|
.map((tool) => (tool as DiscoveredMCPTool).name)
|
||||||
.join(',');
|
.join(',');
|
||||||
|
|
Loading…
Reference in New Issue