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

feat: cache last scrape results #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eli-jordan
Copy link

@eli-jordan eli-jordan commented Mar 11, 2020

When having the exporter look at a metric over a large interval, it can take quite some time to fetch all the metrics from StackDriver, due to the large number of data points that need to be fetched. In our particular use case, the fetching takes 3-4mins. With such a long fetch time, its practically not possible to have prometheus not either timeout when scraping or have many time series go stale resulting in instant queries returning no results.

To address this, this PR adds a cache that hold the result of the most recent collection from StackDriver, and this is used to server the metrics endpoint. A new collection will be scheduled and cached once the active one completes.

@eli-jordan eli-jordan force-pushed the feature/cache-stackdriver-scrape-results branch from dea3b3b to cb9576c Compare March 11, 2020 15:24
@SuperQ
Copy link
Contributor

SuperQ commented May 1, 2020

This is an interesting idea. I'm thinking about implementing better options to reduce scrape time. For example, taking a metric filter as URL param.

This would allow you to fetch subsets of metrics while not having to run multiple copies of the exporter. Would this help reduce your scrape times?

@SuperQ
Copy link
Contributor

SuperQ commented Jun 28, 2020

We've implemented selective scrape params. So this should be less necessary. This change also needs a rebase.

@SuperQ
Copy link
Contributor

SuperQ commented May 27, 2023

Maybe @fbs is interested in this.

@fbs
Copy link
Contributor

fbs commented May 27, 2023

yes, ill give this a go :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants