pixelistik/request_log_analyzer

Handle empty result for Prometheus correctly

pixelistik opened this issue · 1 comments

Steps to reproduce

Run with a time filter that returns no requests

 cargo run -- -t 1 --prometheus-listen localhost:9898 src/test/random.log

Query the Prometheus endpoint

curl localhost:9898

Result

Panic! Due to an unwrap()...

Expected

Send count=0 and NaN for all other metrics. https://prometheus.io/docs/practices/instrumentation/#avoid-missing-metrics

Panic has been fixed with abe1fe9