11/* 
2-   Copyright (c) 2024, Oracle and/or its affiliates. 
2+   Copyright (c) 2024-2025 , Oracle and/or its affiliates. 
33
44  Licensed under the Apache License, Version 2.0 (the "License"); 
55  you may not use this file except in compliance with the License. 
1313  See the License for the specific language governing permissions and 
1414  limitations under the License. 
1515*/ 
16- import  {  RetryConfig ,  TelemetryApi  }  from  "./types" ; 
16+ import  {  RetryConfig ,  TelemetryApi ,   TelemetryConfigMetadata  }  from  "./types" ; 
1717import  *  as  path  from  'path' ; 
1818import  *  as  fs  from  'fs' ; 
1919import  {  LOGGER  }  from  "../logger" ; 
@@ -24,6 +24,7 @@ export class TelemetryConfiguration {
2424  private  static  instance : TelemetryConfiguration ; 
2525  private  retryConfig ! : RetryConfig ; 
2626  private  apiConfig ! : TelemetryApi ; 
27+   private  metadata ! : TelemetryConfigMetadata ; 
2728
2829  public  constructor ( )  { 
2930    this . initialize ( ) ; 
@@ -54,6 +55,11 @@ export class TelemetryConfiguration {
5455        baseEndpoint : config . telemetryApi . baseEndpoint , 
5556        version : config . telemetryApi . version 
5657      } ) ; 
58+ 
59+       this . metadata  =  Object . freeze ( { 
60+         consentSchemaVersion : config . metadata . consentSchemaVersion 
61+       } ) ; 
62+ 
5763    }  catch  ( error : any )  { 
5864      LOGGER . error ( "Error occurred while setting up telemetry config" ) ; 
5965      LOGGER . error ( error . message ) ; 
@@ -68,4 +74,7 @@ export class TelemetryConfiguration {
6874    return  this . apiConfig ; 
6975  } 
7076
77+   public  getTelemetryConfigMetadata ( ) : Readonly < TelemetryConfigMetadata >  { 
78+     return  this . metadata ; 
79+   } 
7180} 
0 commit comments