sentinel-group/sentinel-rust

exporter开启后触发panic

gy0801151351 opened this issue · 1 comments

代码位置: exporter.rs 99行~109行


pub fn add_handled_counter(batch_count: u32, resource: &str, result: TokenResult) {
    HANDLED_COUNTER
        .with_label_values(&[
            &HOST_NAME,
            &PROCESS_NAME,
            &PID_STRING,
            resource,
            &result.to_string(),
        ])
        .inc_by(batch_count as f64);
}

原因: exporter.rs 51行~58行

    static ref HANDLED_COUNTER: CounterVec = CounterVec::new(
        opts!(
            "handled_total",
            "Total handled count"
        ),
        &["host", "process", "pid", "resource","result","block_type"]
    )

Thanks!