tikv / rust-prometheus

Prometheus instrumentation library for Rust applications
Apache License 2.0
1.07k stars 182 forks source link

Why process collector doesn't work in Windows 10? #455

Closed rts-gordon closed 2 years ago

rts-gordon commented 2 years ago

Hi there, Why process collector doesn't work in Windows 10? Could you please to have a look at this, many thanks.

Describe the bug process collector did not work in Windows 10

System information CPU architecture: x86_64 Operation System: Windows 10 Rustup toolchain : nightly-2022-04-07-x86_64-unknown-linux-gnu Rustc 1.62.0-nightly (8f36334ca 2022-04-06)

To Reproduce Steps to reproduce the behavior:

git clone https://github.com/tikv/rust-prometheus.git cd rust-prometheus edit file: examples/example_process_collector.rs, and remove such code:

#[cfg(all(feature = "process", target_os = "linux"))]

and

#[cfg(any(not(feature = "process"), not(target_os = "linux")))]
fn main() {
    println!(
        r#"Please enable feature "process", try:
    cargo run --features="process" --example example_process_collector"#
    );
}

cargo run --features="process" --example example_process_collector

but there are no metrics data print out.

rts-gordon commented 2 years ago

Found some comments in process_collector.rs

 This module only supports **Linux** platform.