11import { Session } from "../session.js" ;
22import { BaseEvent , CommonProperties } from "./types.js" ;
3- import { config } from "../config.js" ;
3+ import { UserConfig } from "../config.js" ;
44import logger , { LogId } from "../logger.js" ;
55import { ApiClient } from "../common/atlas/apiClient.js" ;
66import { MACHINE_METADATA } from "./constants.js" ;
@@ -16,6 +16,7 @@ export class Telemetry {
1616
1717 constructor (
1818 private readonly session : Session ,
19+ private readonly userConfig : UserConfig ,
1920 private readonly eventCache : EventCache = EventCache . getInstance ( )
2021 ) {
2122 this . commonProperties = {
@@ -51,7 +52,7 @@ export class Telemetry {
5152 mcp_client_name : this . session . agentRunner ?. name ,
5253 session_id : this . session . sessionId ,
5354 config_atlas_auth : this . session . apiClient . hasCredentials ( ) ? "true" : "false" ,
54- config_connection_string : config . connectionString ? "true" : "false" ,
55+ config_connection_string : this . userConfig . connectionString ? "true" : "false" ,
5556 } ;
5657 }
5758
@@ -64,7 +65,7 @@ export class Telemetry {
6465 */
6566 public isTelemetryEnabled ( ) : boolean {
6667 // Check if telemetry is explicitly disabled in config
67- if ( config . telemetry === "disabled" ) {
68+ if ( this . userConfig . telemetry === "disabled" ) {
6869 return false ;
6970 }
7071
0 commit comments