google / slo-generator

SLO Generator computes SLIs, SLOs, Error Budgets and Burn Rates from supported backends, then exports an SLO report to supported targets.
Apache License 2.0
489 stars 78 forks source link

Check `float` type hints in Prometheus backend #269

Open lvaylet opened 2 years ago

lvaylet commented 2 years ago

count() and distribution_cut() in slo_generator/backends/prometheus.py return float and Tuple[float, float], respectively, while counts are expected to be int.

Check exactly what is returned by the Prometheus API, for example by setting breakpoints and inspecting values when querying a local containerized Prometheus, and confirm whether (and why) we need to convert the response to float.