File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ use tower::{Layer, Service};
2424use  tracing:: info; 
2525use  tracing_opentelemetry:: OpenTelemetrySpanExt ; 
2626
27+ const  ATTEMPTS :  & str  = "init4.perms.attempts" ; 
28+ const  ATTEMPTS_DESCR :  & str  = "Counts the number of builder permissioning attempts" ; 
29+ 
2730const  MISSING_HEADER :  & str  = "init4.perms.missing_header" ; 
2831const  MISSING_HEADER_DESCR :  & str  =
2932    "Counts the number of requests missing the authentication header" ; 
@@ -36,6 +39,7 @@ const SUCCESS: &str = "init4.perms.success";
3639const  SUCCESS_DESCR :  & str  = "Counts the number of auths allowed due to builder permissioning" ; 
3740
3841static  DESCRIBE :  LazyLock < ( ) >  = LazyLock :: new ( || { 
42+     describe_counter ! ( ATTEMPTS ,  ATTEMPTS_DESCR ) ; 
3943    describe_counter ! ( MISSING_HEADER ,  MISSING_HEADER_DESCR ) ; 
4044    describe_counter ! ( PERMISSION_DENIED ,  PERMISSION_DENIED_DESCR ) ; 
4145    describe_counter ! ( SUCCESS ,  SUCCESS_DESCR ) ; 
@@ -199,6 +203,8 @@ where
199203
200204            let  guard = span. enter ( ) ; 
201205
206+             counter ! ( ATTEMPTS ) . increment ( 1 ) ; 
207+ 
202208            // Check if the sub is in the header. 
203209            let  sub = match  validate_header_sub ( req. headers ( ) . get ( "x-jwt-claim-sub" ) )  { 
204210                Ok ( sub)  => sub, 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments