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

Setup global context with timeout #209

Open
Pokom opened this issue Jun 24, 2024 · 1 comment
Open

Setup global context with timeout #209

Pokom opened this issue Jun 24, 2024 · 1 comment
Assignees

Comments

@Pokom
Copy link
Contributor

Pokom commented Jun 24, 2024

To safe guard cloudcost-exporter from initiating too many external requests that do not get cancelled, there should be a uniform way of passing a Context that has a CancelFunc defined with a sane default. This should start at exporter.go as a parameter with a 1m default set and then passed to each provider that gets created. The provider can then generate a context with a timeout defined on each Collect call and pass this on to the collectors Collect methods.

To achieve this, the collector interface needs to be refactored to have the Collect method accept a context as well.

@logyball logyball self-assigned this Jun 24, 2024
@Pokom
Copy link
Contributor Author

Pokom commented Jul 30, 2024

@Pokom and @logyball will follow up with a design.

@Pokom Pokom changed the title Create a uniform way of creating a context with timeout Setup global context with timeout Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants