mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
chore(telemetry): Add various surface detection to determineSurface for logging. (#6074)
Co-authored-by: christine betts <chrstn@uw.edu> Co-authored-by: Jacob Richman <jacob314@gmail.com> Co-authored-by: matt korwel <matt.korwel@gmail.com>
This commit is contained in:
@@ -30,6 +30,7 @@ import {
|
||||
} from '../../utils/user_account.js';
|
||||
import { getInstallationId } from '../../utils/user_id.js';
|
||||
import { FixedDeque } from 'mnemonist';
|
||||
import { DetectedIde, detectIde } from '../../ide/detect-ide.js';
|
||||
|
||||
const start_session_event_name = 'start_session';
|
||||
const new_prompt_event_name = 'new_prompt';
|
||||
@@ -85,12 +86,14 @@ export interface LogRequest {
|
||||
* methods might have in their runtimes.
|
||||
*/
|
||||
function determineSurface(): string {
|
||||
if (process.env.CLOUD_SHELL === 'true') {
|
||||
return 'CLOUD_SHELL';
|
||||
} else if (process.env.MONOSPACE_ENV === 'true') {
|
||||
return 'FIREBASE_STUDIO';
|
||||
if (process.env.SURFACE) {
|
||||
return process.env.SURFACE;
|
||||
} else if (process.env.GITHUB_SHA) {
|
||||
return 'GitHub';
|
||||
} else if (process.env.TERM_PROGRAM === 'vscode') {
|
||||
return detectIde() || DetectedIde.VSCode;
|
||||
} else {
|
||||
return process.env.SURFACE || 'SURFACE_NOT_SET';
|
||||
return 'SURFACE_NOT_SET';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user