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

Sidecar: use prometheus metrics for min timestamp #7820

Conversation

MichaHoffmann
Copy link
Contributor

This PR makes sidecar read "minT" from prometheus metrics instead of the shipper. This has the benefit that it also works for sidecar deployments that do not upload blocks, so that they can be pruned by time range too.

@MichaHoffmann MichaHoffmann force-pushed the mhoffmann/use-prometheus-tsdb-lowest-timestamp-for-mintime-in-sidecar branch from 51c58f7 to 6cff6e2 Compare October 13, 2024 16:56
Copy link
Contributor

@pedro-stanaka pedro-stanaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG - some typos though.

pkg/promclient/promclient.go Show resolved Hide resolved
Copy link
Member

@GiedriusS GiedriusS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not http://localhost:9090/api/v1/status/tsdb? Should be much faster than gathering all metrics and then parsing them not to mention the overhead of the PromQL engine.

@MichaHoffmann
Copy link
Contributor Author

Why not http://localhost:9090/api/v1/status/tsdb? Should be much faster than gathering all metrics and then parsing them not to mention the overhead of the PromQL engine

It doesn't have this data for whole tsdb. Only for head

cmd/thanos/sidecar.go Outdated Show resolved Hide resolved
Read "minT" from prometheus metrics so that we also set it for sidecars
that are not uploading blocks.

Signed-off-by: Michael Hoffmann <[email protected]>
@MichaHoffmann MichaHoffmann force-pushed the mhoffmann/use-prometheus-tsdb-lowest-timestamp-for-mintime-in-sidecar branch from 6cff6e2 to c4d1de9 Compare October 16, 2024 16:30
@GiedriusS GiedriusS merged commit 761487c into main Nov 6, 2024
22 checks passed
@GiedriusS GiedriusS deleted the mhoffmann/use-prometheus-tsdb-lowest-timestamp-for-mintime-in-sidecar branch November 6, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants