mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-15 08:31:14 -07:00
23 lines
737 B
TypeScript
23 lines
737 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
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';
|
|
|
|
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 }),
|
|
};
|
|
}
|