How to test prometheus ABI
- hello @PiotrSikora , when I use metric's interface to test prometheus function, I found that the return value of get_metric() is alway 0. And prometheus can not receive the metric counter data normally. The code is shown below.
lazy_static! {
static ref SCP_REQ_METRIC_ID: Mutex
impl HttpContext for Limiter { fn on_http_request_headers(&mut self, _: usize) -> Action { info!("=====on_http_request_headers====="); increment_metric(get_metric_id(), 1).unwrap(); info!("---new metric_id={:?}", get_metric_id()); let get_return_value = get_metric(get_metric_id()).unwrap(); info!("---get_return_value={:?}", get_return_value); ...... ......
- Out put information:
wasm log rate-limit.default rate_limit_handle: =====on_http_request_headers=====
wasm log rate-limit.default rate_limit_handle: ---new metric_id=4
wasm log rate-limit.default rate_limit_handle: ---get metric ok, return_value=0
wasm log rate-limit.default rate_limit_handle: ---get_return_value=0
Originally posted by @czh-123-rust in https://github.com/proxy-wasm/proxy-wasm-rust-sdk/issues/4#issuecomment-676055879