Skip to content

Handle empty result for Prometheus correctly #1

@pixelistik

Description

@pixelistik

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions