AlexanderThaller / prometheus_exporter

Helper libary to export prometheus metrics using tiny_http and rust-prometheus.
MIT License
28 stars 10 forks source link

Error 301: Moved permanently #8

Closed asomers-ax closed 4 years ago

asomers-ax commented 4 years ago

I get this error when I try to run the simple example:

> cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.11s
     Running `target/debug/simple`
[2020-08-27T19:13:58Z INFO  prometheus_exporter] Listening on http://0.0.0.0:9184
> wget http://localhost:9184
--2020-08-27 13:14:15--  http://localhost:9184/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:9184... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: unspecified
ERROR: Redirection (301) without location.

I see this on FreeBSD 12.1-STABLE amd64 with rustc 1.47.0-nightly (2d8a3b918 2020-08-26), and Ubuntu Linux 18.04 with rustc 1.45.0-nightly (f8d394e51 2020-05-05)

asomers-ax commented 4 years ago

I see the error: I tried to fetch / instead of /metrics, because I didn't read the README closely. So it's not a bug. Still, it would be nice if / returned the results, too. Other Prometheus exporters allow that.