The alerting rules run on their own schedule, separately from the scraping schedule.
The expression "probe_success == 0" uses the value of that metric in the prometheus TSDB *at the current instant of time*. However, the value of a metric at any given time T is the most recent value *on or before* time T (up to T - 5 minutes). On Friday, 22 July 2022 at 05:01:18 UTC+1 [email protected] wrote: > Hi dears, > > I'm trying to define an alert rule as below, and the scrape and evaluation > interval are 3m. > > > I checked from log, blackbox will send probe every 2-3second, then the > metrics will be generated every 2-3second, and the data will be compare > with the alert rules to dertermine an alert will be triggered or not? > > I have a question if Prometheus compares the Live data from blackbox > probe, or compares the data with Prometheus scrapped in last 3 mins? > > prometheus.yml: |- > global: > scrape_interval: 3m > evaluation_interval: 3m > > - alert: EndpointDown > expr: probe_success == 0 > for: 5s > labels: > severity: critical > annotations: > description: Service {{ $labels.instance }} is unavailable. > value: DOWN ({{ $value }}) > summary: "Endpointdown {{ $labels.instance }} is down." > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/cba9c7ac-e5f6-4b79-bc19-b2c7f344821fn%40googlegroups.com.

