Re: [prometheus-users] Uptime SLA in percentage for metric

2024-06-24 Thread Ben Kochie
Hopefully https://github.com/prometheus/prometheus/pull/14095 is accepted. It would make these kinds of queries much easier and faster. No subquery required. On Mon, Jun 24, 2024 at 2:50 PM 'Brian Candler' via Prometheus Users < prometheus-users@googlegroups.com> wrote: > A PromQL query like "my

Re: [prometheus-users] Uptime SLA in percentage for metric

2024-06-24 Thread 'Brian Candler' via Prometheus Users
A PromQL query like "mymetric == bool 2" will return 1 when the value is 2, and 0 otherwise. You'll likely need to run this inside a subquery if you're doing time range aggregation over it. But if Grafana is doing the summarization that might not be necessary. On Monday 24 June 2024 at 13:38:

Re: [prometheus-users] Uptime SLA in percentage for metric

2024-06-24 Thread Ben Kochie
IMO you need to fix your service metrics. Prometheus best practice is to follow the pattern of probe_success. Boolean values are far easier to handle. On Mon, Jun 24, 2024 at 2:36 PM Raúl Lopez wrote: > Hello, > I need to know in percentage the time my service has been available in the > last mo

[prometheus-users] Uptime SLA in percentage for metric

2024-06-24 Thread Raúl Lopez
Hello, I need to know in percentage the time my service has been available in the last month, last week, etc (dynamic value). The metric in question can return the values; 0, 1 and 2. 0 -> OK 1 -> Warning 2 -> KO The idea I have is to disregard value 1 and only treat my service as KO when it ha