pagespeed_exporter icon indicating copy to clipboard operation
pagespeed_exporter copied to clipboard

return cached result for a page scrape

Open cuotos opened this issue 4 years ago • 1 comments

I know returning a cached copy of prom metrics from an app isn't best practice, but for things like this exporter, I am happy to get a report of the page performance once and hour (or even less), but prometheus will drop the metrics after 5 mins, so the graph will just be a broken line for 5 mins at a time.

It would be a nice feature if the PagespeedExporter could just return a cached copy of the results, until such time those results are considered out of date (1h, 1d etc), prometheus can then scrape the exporter regularly (30s) without creating addition requests to the pagespeed apis

The "lifetime" of the data could be passed as a query param.

cuotos avatar Mar 23 '20 15:03 cuotos

@cuotos I agree with that statement, I'm wondering why Brian Brazil had a different intake and, I refactored it to be generated on demand.

Perhaps I could add a parameter, as you've noted so that the graph looks way nicer.

smartinov avatar Apr 05 '20 11:04 smartinov