request_log_analyzer
request_log_analyzer copied to clipboard
Handle empty result for Prometheus correctly
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 abe1fe9012c080a7d51a2387602434cdcd25addf