File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
packages/edge/infra/guard/core/src Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -680,6 +680,11 @@ impl ProxyService {
680680 self . handle_http_request ( req, target) . await
681681 } ;
682682
683+ let status = match & res {
684+ Ok ( resp) => resp. status ( ) . as_u16 ( ) . to_string ( ) ,
685+ Err ( _) => "error" . to_string ( ) ,
686+ } ;
687+
683688 // Record metrics
684689 let duration_secs = start_time. elapsed ( ) . as_secs_f64 ( ) ;
685690 metrics:: PROXY_REQUEST_DURATION
@@ -691,16 +696,11 @@ impl ProxyService {
691696 res
692697 } ;
693698
694- let status = match & res {
695- Ok ( resp) => resp. status ( ) . as_u16 ( ) . to_string ( ) ,
696- Err ( err) => {
697- metrics:: PROXY_REQUEST_ERROR
698- . with_label_values ( & [ & err. to_string ( ) ] )
699- . inc ( ) ;
700-
701- "error" . to_string ( )
702- }
703- } ;
699+ if let Err ( err) = & res {
700+ metrics:: PROXY_REQUEST_ERROR
701+ . with_label_values ( & [ & err. to_string ( ) ] )
702+ . inc ( ) ;
703+ }
704704
705705 res
706706 }
You can’t perform that action at this time.
0 commit comments