tikv / rust-prometheus

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

Duplicate metrics #481

Closed vivienbcr closed 1 year ago

vivienbcr commented 1 year ago

Describe the bug I register int counter vec "http_request_code" and my counter appears twice

To Reproduce https://github.com/vivienbcr/bug-free-octo-giggle/blob/main/src/main.rs

# HELP http_request_code_200 http request returns code 200
# TYPE http_request_code_200 counter
http_request_code_200{http_ver="HTTP/1.1",method="GET",url="https://www.boredapi.com/api/activity"} 3
# HELP http_request_code_200 http request returns code 200
# TYPE http_request_code_200 counter
http_request_code_200{http_ver="HTTP/1.1",method="GET",url="https://www.boredapi.com/api/activity"} 3
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
....

Expected behavior Counter should be not duplicated.

System information

Additional context maybe i missed something Edit : indeed