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

Suggestion: Caching of Hetzner API Calls #170

Open
hojerst opened this issue Jun 14, 2024 · 1 comment
Open

Suggestion: Caching of Hetzner API Calls #170

hojerst opened this issue Jun 14, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@hojerst
Copy link

hojerst commented Jun 14, 2024

At least the Storagebox API currently has a rate limit implemented, which leads to 403 Forbidden if the rate limit is actually hit. This leads to null values during metric scrapes. The documentation of hetzner_exporter suggests, that a scrape_limit of 1m should be set, which normally doesn't hit the API rate limit, however you can't always control the number of requests to the metrics endpoint: For example, what happens in a HA scenario where two or more prometheus instances hit the metrics endpoint.

What is your opinion about caching either the API responses or the calculated metrics for a specific amount of time (maybe even configurable via an environment variable?). I know this complicates the code a bit, but it should improve usablity. As I understand, at least some metrics like data usage for storage boxes doesn't even update this often (the homepage suggest this metric is calculated once every 5 min, at least in the webui)

@tboerger
Copy link
Member

This could be potentially useful, but I never thought about how to properly define a caching layer for this information.

@tboerger tboerger added the enhancement New feature or request label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants