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: add parameter to allow return expired cache in case of errors #146

Merged

Conversation

fgouteroux
Copy link
Contributor

@fgouteroux fgouteroux commented Jul 19, 2024

Hi @ricoberger,

I would like to add this feature with the parameter useExpiredCacheOnError, in some case it help when we have a script execution doing some flip/flap caused by a timeout.

With theses parameters:

useExpiredCacheOnError: true
cacheDuration: 5m

It produces the following metrics:

# TYPE script_use_cache gauge
script_use_cache{script="get_objecstorage_tenant_usage"} 1
# HELP script_use_expired_cache Script re-use expired cache (0 = no, 1 = yes).
# TYPE script_use_expired_cache gauge
script_use_expired_cache{script="get_objecstorage_tenant_usage"} 1

I added the metric script_use_cache as it could be interesting to know if metrics are coming from cache or not.

Let me know what do you think about that.

@ricoberger ricoberger added the changelog: added A new feature was added label Jul 20, 2024
@ricoberger
Copy link
Owner

Hi @fgouteroux thanks for your contribution 🙂

@ricoberger ricoberger merged commit 247ba66 into ricoberger:main Jul 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: added A new feature was added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants