Download packages/core/src/telemetry/telemetryAttributes.ts from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/core/src/telemetry/telemetryAttributes.ts
- Command line
-
hf download hf://SaylorTwift/gemini-cli/packages/core/src/telemetry/telemetryAttributes.ts
-
curl -L -o telemetryAttributes.ts https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/core/src/telemetry/telemetryAttributes.ts
1.07 kB
| /** | |
| * @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(); | |
| const experiments = config.getExperiments(); | |
| const authType = config.getContentGeneratorConfig()?.authType; | |
| return { | |
| 'session.id': config.getSessionId(), | |
| 'installation.id': installationManager.getInstallationId(), | |
| interactive: config.isInteractive(), | |
| ...(email && { 'user.email': email }), | |
| ...(authType && { auth_type: authType }), | |
| ...(experiments && | |
| experiments.experimentIds.length > 0 && { | |
| 'experiments.ids': experiments.experimentIds, | |
| }), | |
| }; | |
| } | |