mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Introduces telemetry for file create, read, and update operations.
This change adds the `gemini_cli.file.operation.count` metric, recorded by the `read-file`, `read-many-files`, and `write-file` tools.
The metric includes the following attributes:
- `operation` (string: `create`, `read`, `update`): The type of file operation.
- `lines` (optional, Int): Number of lines in the file.
- `mimetype` (optional, string): Mimetype of the file.
- `extension` (optional, string): File extension of the file.
Here is a stacked bar chart of file operations by extension (`js`, `ts`, `md`):

Here is a stacked bar chart of file operations by type (`create`, `read`, `update`):

#750
cc @allenhutchison as discussed
23 lines
965 B
TypeScript
23 lines
965 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
export const SERVICE_NAME = 'gemini-cli';
|
|
|
|
export const EVENT_USER_PROMPT = 'gemini_cli.user_prompt';
|
|
export const EVENT_TOOL_CALL = 'gemini_cli.tool_call';
|
|
export const EVENT_API_REQUEST = 'gemini_cli.api_request';
|
|
export const EVENT_API_ERROR = 'gemini_cli.api_error';
|
|
export const EVENT_API_RESPONSE = 'gemini_cli.api_response';
|
|
export const EVENT_CLI_CONFIG = 'gemini_cli.config';
|
|
|
|
export const METRIC_TOOL_CALL_COUNT = 'gemini_cli.tool.call.count';
|
|
export const METRIC_TOOL_CALL_LATENCY = 'gemini_cli.tool.call.latency';
|
|
export const METRIC_API_REQUEST_COUNT = 'gemini_cli.api.request.count';
|
|
export const METRIC_API_REQUEST_LATENCY = 'gemini_cli.api.request.latency';
|
|
export const METRIC_TOKEN_USAGE = 'gemini_cli.token.usage';
|
|
export const METRIC_SESSION_COUNT = 'gemini_cli.session.count';
|
|
export const METRIC_FILE_OPERATION_COUNT = 'gemini_cli.file.operation.count';
|