Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrape: configurable startTimeMargin #4759

Open
thomschke opened this Issue Oct 18, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@thomschke
Copy link

thomschke commented Oct 18, 2018

Proposal

Use case. Why is this important?

Sometimes I'm using Prom/Grafana to persist/visualize historical timeseries data
with the help of a stateful metric-exporter that provide data step-by-step (include timestamp)

For this use case I have to increase "maxAheadTime"
but in the moment it's a fixed value of 10s.

const maxAheadTime = 10 * time.Minute

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Oct 18, 2018

maxAheadTime is from now, not the TSDB's last ingested timestamp. It only prevents you ingesting data from the future, as a safeguard.

@thomschke thomschke changed the title scrape: configurable maxAheadTime scrape: configurable startTimeMargin Oct 19, 2018

@thomschke

This comment has been minimized.

Copy link
Author

thomschke commented Oct 19, 2018

Sure, the lower bound of TSDB (startTimeMargin) is the problem - sorry :-)

startTimeMargin := int64(2 * time.Duration(cfg.tsdb.MinBlockDuration).Seconds() * 1000)
localStorage.Set(db, startTimeMargin)

startTime = time.Now().Unix() * 1000

@thomschke

This comment has been minimized.

Copy link
Author

thomschke commented Oct 19, 2018

A workaround is by increasing storage.tsdb.min-block-duration (but this has sideeffects)
(see coreos/prometheus-operator#1375)

@thomschke

This comment has been minimized.

Copy link
Author

thomschke commented Oct 30, 2018

Hi @brian-brazil, can you explain a little bit the drawbacks of increasing storage.tsdb.min-block-duration in production?

a.Flag("storage.tsdb.min-block-duration", "Minimum duration of a data block before being persisted. For use in testing.").
Hidden().Default("2h").SetValue(&cfg.tsdb.MinBlockDuration)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.