The exporter does real work on every scrape
CommonMany exporters compute at scrape time rather than in the background — querying a database, walking a filesystem, calling a cloud API, running SNMP against a device. As the thing being measured grows, so does the work, and the scrape crosses 10 seconds. Timing the endpoint by hand is decisive, because it measures exactly what Prometheus measures.
Confirm
curl -o /dev/null -s -w 'time_total=%{time_total}s size=%{size_download}B\n' http://<target>:<port>/metricstime_total at or above the configured scrape_timeout. Run it a few times — the first may be warm-cache fast
Fix
- Raise
scrape_timeoutfor that job — but note it cannot exceedscrape_interval, so a timeout above the job's interval (1 minute by default) means raising the interval too. - Better, make the exporter stop doing the work inline: cache results and refresh them on a background schedule, so a scrape reads a value rather than computing one.
- Give slow exporters their own scrape config with a longer interval and timeout, instead of lifting the global values for every target.
promtool check config /etc/prometheus/prometheus.yml
Catches the timeout-greater-than-interval rejection before a reload fails.