On Thu, Apr 4, 2024 at 7:03 PM Christoph Anton Mitterer <[email protected]> wrote:
> Hey Chris, Brian. > > Thanks for your replies/confirmations. > > > On Sunday, March 24, 2024 at 8:16:14 AM UTC+1 Ben Kochie wrote: > > Yup, this is correct. Prometheus sets the timestamp of the sample at the > start of the scrape. But since it's an ACID compliant database, the data is > not queryable until after it's been fully ingested. > > This is intentional, because the idea is that whatever atomicity is > desired by the target is handled by the target. Any locks taken are done > when the target receives the GET /metrics. The exposition formatting, > compression, and wire transfer time should not impact the "when time when > the sample was gathered". > > > Does make sense, yes... was that documented somewhere? I think it would be > helpful if e.g. the page about the querying basics would tell, these two > properties: > - that data is only returned if it has fully arrived, and thus may not be, > even if the query is after the sample time > - that Prometheus "adjusts" the timestamps within a certain range > Good question, I'm not sure we documented this well. I think it would be nice to add a "TSDB details" page. > > > And yes, the timing is a tiny bit faked. There are some hidden flags that > control this behavior. > > --scrape.adjust-timestamps > --scrape.timestamp-tolerance > > The default allows up to 2ms (+-0.002) of timing jitter to be ignored. > This was added in 2020 due to a regression in the accuracy of the Go > internal timer functions. > > See: https://github.com/prometheus/prometheus/issues/7846 > > > Makes sense, too. And is actually vital for what I do over in > https://groups.google.com/g/prometheus-users/c/BwJNsWi1LhI/m/ik2OiRa2AAAJ > > Just out of curiosity, what happens, if the jitter is more than the > +-0.002? > If the jitter is > 0.002, the real value is stored. > > Thanks, > Chris. > > -- > 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/ce9bc4cb-6c93-4df0-93ed-cc83e1e17f80n%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-users/ce9bc4cb-6c93-4df0-93ed-cc83e1e17f80n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CABbyFmoMHOnD8cx7kssKx8bEKG0%3DGsaqsew3t5JsNAsrfx4caw%40mail.gmail.com.

