mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 11:04:42 -07:00
feat(telemetry): ensure all telemetry includes user email and installation id (#10897)
This commit is contained in:
@@ -4,15 +4,19 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type { LogAttributes } from '@opentelemetry/api-logs';
|
||||
import type { Attributes } from '@opentelemetry/api';
|
||||
import type { Config } from '../config/config.js';
|
||||
import { InstallationManager } from '../utils/installationManager.js';
|
||||
import { UserAccountManager } from '../utils/userAccountManager.js';
|
||||
|
||||
export function getCommonAttributes(config: Config): LogAttributes {
|
||||
const userAccountManager = new UserAccountManager();
|
||||
const userAccountManager = new UserAccountManager();
|
||||
const installationManager = new InstallationManager();
|
||||
|
||||
export function getCommonAttributes(config: Config): Attributes {
|
||||
const email = userAccountManager.getCachedGoogleAccount();
|
||||
return {
|
||||
'session.id': config.getSessionId(),
|
||||
'installation.id': installationManager.getInstallationId(),
|
||||
...(email && { 'user.email': email }),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user