pyrra-dev / pyrra

Making SLOs with Prometheus manageable, accessible, and easy to use for everyone!
https://demo.pyrra.dev
Apache License 2.0
1.16k stars 101 forks source link

Latency format incorrect when using milliseconds #1195

Closed svenmueller closed 4 days ago

svenmueller commented 2 weeks ago

Hi,

When using a latency SLO based on the istio_request_duration_milliseconds_bucket histogram metric, which measures latency in milliseconds, the UI incorrectly assumes the target value is in seconds. This discrepancy leads to inaccurate representations and evaluations of latency SLOs in the interface.

In the example below the target is 100 ms. The UI incorrectly renders the target as 1m 40s (100 s).

Config

apiVersion: pyrra.dev/v1alpha1
kind: ServiceLevelObjective
metadata:
  annotations:
  labels:
    prometheus: k8s
    role: alert-rules
  name: service-latency
  namespace: monitoring
spec:
  alerting: {}
  description: 99.9% of requests in the past 28 days are faster than 100
    ms.
  indicator:
    latency:
      grouping:
      - destination_service_name
      success:
        metric: istio_request_duration_milliseconds_bucket{job="kubernetes-pods",
          le="100"}
      total:
        metric: istio_request_duration_milliseconds_count{job="kubernetes-pods"}
  target: "99.9"
  window: 28d
status:
  type: PrometheusRule

Screenshot: UI "Duration" graph

Bildschirmfoto 2024-06-15 um 14 42 12
metalmatze commented 4 days ago

This seems to be a duplicate of #667. I'm closing this for now. If it's not a duplicate let me know.