mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 18:44:30 -07:00
19 lines
559 B
TypeScript
19 lines
559 B
TypeScript
|
|
/**
|
||
|
|
* @license
|
||
|
|
* Copyright 2025 Google LLC
|
||
|
|
* SPDX-License-Identifier: Apache-2.0
|
||
|
|
*/
|
||
|
|
|
||
|
|
import type { LogAttributes } from '@opentelemetry/api-logs';
|
||
|
|
import type { Config } from '../config/config.js';
|
||
|
|
import { UserAccountManager } from '../utils/userAccountManager.js';
|
||
|
|
|
||
|
|
export function getCommonAttributes(config: Config): LogAttributes {
|
||
|
|
const userAccountManager = new UserAccountManager();
|
||
|
|
const email = userAccountManager.getCachedGoogleAccount();
|
||
|
|
return {
|
||
|
|
'session.id': config.getSessionId(),
|
||
|
|
...(email && { 'user.email': email }),
|
||
|
|
};
|
||
|
|
}
|