@@ -25,7 +25,7 @@ export class AwsCredentials {
2525 private readonly logger = LoggerFactory . getLogger ( AwsCredentials ) ;
2626
2727 @Telemetry ( )
28- private readonly telemery ! : ScopedTelemetry ;
28+ private readonly telemetry ! : ScopedTelemetry ;
2929
3030 private iamCredentials ?: IamCredentials ;
3131 private readonly encryptionKey ?: Buffer ;
@@ -38,10 +38,10 @@ export class AwsCredentials {
3838 this . encryptionKey = encryptionKey ? Buffer . from ( encryptionKey , 'base64' ) : undefined ;
3939 this . logger . info ( `AWS credentials ${ encryptionKey ? 'encrypted' : 'unencrypted' } ` ) ;
4040
41- this . telemery . registerGaugeProvider ( 'encrypted' , ( ) => ( encryptionKey === undefined ? 0 : 1 ) ) ;
42- this . telemery . registerGaugeProvider ( 'unencrypted' , ( ) => ( encryptionKey === undefined ? 1 : 0 ) ) ;
43- this . telemery . registerGaugeProvider ( 'authenticated' , ( ) => ( this . credentialsAvailable ( ) ? 1 : 0 ) ) ;
44- this . telemery . registerGaugeProvider ( 'unauthenticated' , ( ) => ( this . credentialsAvailable ( ) ? 0 : 1 ) ) ;
41+ this . telemetry . registerGaugeProvider ( 'encrypted' , ( ) => ( encryptionKey === undefined ? 0 : 1 ) ) ;
42+ this . telemetry . registerGaugeProvider ( 'unencrypted' , ( ) => ( encryptionKey === undefined ? 1 : 0 ) ) ;
43+ this . telemetry . registerGaugeProvider ( 'authenticated' , ( ) => ( this . credentialsAvailable ( ) ? 1 : 0 ) ) ;
44+ this . telemetry . registerGaugeProvider ( 'unauthenticated' , ( ) => ( this . credentialsAvailable ( ) ? 0 : 1 ) ) ;
4545 }
4646
4747 credentialsAvailable ( ) {
@@ -60,6 +60,8 @@ export class AwsCredentials {
6060 this . logger . error ( 'Authentication failed: encryption key not configured' ) ;
6161 return false ;
6262 }
63+ this . telemetry . count ( 'update' , 1 ) ;
64+ this . telemetry . count ( 'update.fault' , 0 ) ;
6365
6466 try {
6567 const decrypted = await compactDecrypt ( params . data , this . encryptionKey ) ;
@@ -71,6 +73,7 @@ export class AwsCredentials {
7173 ) ;
7274
7375 const region = getRegion ( validatedCredentials . data . region ) ;
76+ this . telemetry . count ( `update.region.${ region } ` , 1 ) ;
7477
7578 this . iamCredentials = {
7679 ...validatedCredentials . data ,
@@ -80,6 +83,7 @@ export class AwsCredentials {
8083 this . settingsManager . updateProfileSettings ( validatedCredentials . data . profile , region ) ;
8184 return true ;
8285 } catch ( error ) {
86+ this . telemetry . count ( 'update.fault' , 1 ) ;
8387 this . iamCredentials = undefined ;
8488
8589 this . logger . error ( error , `Failed to update IAM credentials` ) ;
0 commit comments