Prometheus logs `Error on ingesting out-of-order samples` with `num_dropped=...`
AdvancedTroubleshootingPrometheus scraping and targets
Answer
Likely causes → An exporter attaches its own timestamps that go backwards, two sources write the same series (duplicate targets or two remote-writers), or a pushed timestamp is older than the TSDB head allows.
Diagnose →
rate(prometheus_target_scrapes_sample_out_of_order_total[5m])
rate(prometheus_tsdb_out_of_order_samples_total[5m])
curl the target and look for explicit timestamps at the end of sample lines.
Fix → Remove explicit timestamps (or set honor_timestamps: false), dedupe targets, and give each writer a unique external label. If legitimate late data exists, enable storage.tsdb.out_of_order_time_window (e.g. 30m).
Prevent → One series, one writer. Alert on the counters above.
More on Prometheus scraping and targets
A target shows `DOWN` on `/targets` with `Get "http://10.0.3.14:9100/metrics": context deadline exceeded`BeginnerTarget is `DOWN` with `server returned HTTP status 401 Unauthorized`BeginnerTarget shows `server returned HTTP status 403 Forbidden` when scraping kubelet / cAdvisorIntermediateTarget is `DOWN` with `connect: connection refused`BeginnerTarget shows `x509: certificate signed by unknown authority`IntermediateTarget shows `x509: certificate is valid for app.svc, not 10.0.4.22`Intermediate