@@ -18,7 +18,7 @@ use hyperlight_common::flatbuffer_wrappers::guest_error::ErrorCode;
1818
1919use  crate :: error:: HyperlightError :: { GuestError ,  OutBHandlingError ,  StackOverflow } ; 
2020use  crate :: mem:: shared_mem:: HostSharedMemory ; 
21- use  crate :: metrics:: { CounterMetric ,   EmittableMetric } ; 
21+ use  crate :: metrics:: { METRIC_GUEST_ERROR ,   METRIC_GUEST_ERROR_LABEL_CODE } ; 
2222use  crate :: sandbox:: mem_mgr:: MemMgrWrapper ; 
2323use  crate :: { log_then_return,  Result } ; 
2424/// Check for a guest error and return an `Err` if one was found, 
@@ -29,7 +29,7 @@ pub(crate) fn check_for_guest_error(mgr: &MemMgrWrapper<HostSharedMemory>) -> Re
2929        ErrorCode :: NoError  => Ok ( ( ) ) , 
3030        ErrorCode :: OutbError  => match  mgr. as_ref ( ) . get_host_error ( ) ? { 
3131            Some ( host_err)  => { 
32-                 CounterMetric :: guest_error ( guest_err. code . into ( ) ) . emit ( ) ; 
32+                 metrics :: counter! ( METRIC_GUEST_ERROR ,   METRIC_GUEST_ERROR_LABEL_CODE  =>  ( guest_err. code  as   u64 ) . to_string ( ) ) . increment ( 1 ) ; 
3333
3434                log_then_return ! ( OutBHandlingError ( 
3535                    host_err. source. clone( ) , 
@@ -40,11 +40,11 @@ pub(crate) fn check_for_guest_error(mgr: &MemMgrWrapper<HostSharedMemory>) -> Re
4040            None  => Ok ( ( ) ) , 
4141        } , 
4242        ErrorCode :: StackOverflow  => { 
43-             CounterMetric :: guest_error ( guest_err. code . into ( ) ) . emit ( ) ; 
43+             metrics :: counter! ( METRIC_GUEST_ERROR ,   METRIC_GUEST_ERROR_LABEL_CODE  =>  ( guest_err. code  as   u64 ) . to_string ( ) ) . increment ( 1 ) ; 
4444            log_then_return ! ( StackOverflow ( ) ) ; 
4545        } 
4646        _ => { 
47-             CounterMetric :: guest_error ( guest_err. code . into ( ) ) . emit ( ) ; 
47+             metrics :: counter! ( METRIC_GUEST_ERROR ,   METRIC_GUEST_ERROR_LABEL_CODE  =>  ( guest_err. code  as   u64 ) . to_string ( ) ) . increment ( 1 ) ; 
4848            log_then_return ! ( GuestError ( guest_err. code,  guest_err. message. clone( ) ) ) ; 
4949        } 
5050    } 
0 commit comments