Reputation: 614
Here is an example: Scrape interval is set to 30s. Following time series are generated in one scrape cycle by the app:
What time series are scraped in this case? All three of them, or the latest one with the timestamp set as a scrape timestamp?
Upvotes: 3
Views: 3595
Reputation: 1197
It will store the available data at the moment of scrape, with the scrape timestamp. So, it depends when the scrape happen between steps 1-3. It sounds like you mean it applies only after all of them, and so #3 with the timestamp of the scrape time will be stored. If the scrape happened to occur in between steps 1 and 2, for example, the metrics from #1 will be stored.
In general, when the metrics are "exported", they are made available for scraping, they have no timestamp. The client has no "history" notion (only the server does), only the latest is available to be read. It is a vector of key-value mapped to a numeric value (you can see the format if you scrape it yourself, e.g. curl http://localhost:9100/metrics
for typical node_exporter). Periodically the server scrapes the targets and store what is available at that time, with its scrape timestamp.
Upvotes: 4