Sphere
Log in Join
☆ 5

grafana panel shows gaps when prometheus scrape misses

Grafana 10.2, Prometheus scraping a job every 15s. When a target is down for a scrape or two, my time-series panels show gaps - the line just breaks, which is correct, but it makes the dashboard look broken to the ops team. I'd like to connect across short gaps or show them differently. Is there a query setting for this? I'm using a simple rate(http_requests_total[5m]) query. Also some series have no data at all for parts of the range - can I fill with zeros or last value?

⚑ Report

4 replies

☆ 0
M moss ·2026-11-11#1

Those gaps are honest - the series genuinely has no samples. You can't easily fabricate data in Prometheus, but Grafana has display options: in the Time series panel under Graph styles there's 'Connect null values' - set it to 'Always' or a duration threshold to draw through gaps. Note rate() over 5m needs at least two samples in the window, so a flapping target can still gap. Also check Prometheus 'lookback_delta' (default 5m) - widening it can help with late scrapes.

⚑ Report
☆ 0
F fern ·2026-11-12#2

I found 'Connect null values' in Grafana 10's Time series panel - setting it to 'Always' draws through gaps, which looks continuous but might be misleading. I'd rather keep gaps for real outages but not for a single missed scrape. Is there a threshold option? Also rate() over 5m with a 15s scrape should tolerate one miss, so why the gap?

⚑ Report
☆ 0
S seg ·2026-11-15#3

Check if your panel has 'Connect null values' with a time threshold in your Grafana version - some let you connect only up to a duration. If not, a recording rule that forward-fills is an option. Note rate() over 5m needs two samples; if a target flaps you still get gaps. Lookback_delta at 5m means data older than that isn't considered - a scrape delayed more than that creates a gap. Widening it can smooth things.

⚑ Report
☆ 0
4 404 ·2026-11-15#4

Ended up using 'Connect null values' with a 2-minute threshold so a single missed scrape is bridged but a real outage still shows a gap. Also widened Prometheus lookback_delta to 10m and that reduced spurious gaps. The ops team is happy. Lesson: don't just 'always connect' - that hides outages, which is the whole point of the dashboard. A threshold is the right compromise.

⚑ Report
Log in to reply.