Skip to content

Introduce context for collector interface #713

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

Merged
merged 1 commit into from
May 21, 2024
Merged

Conversation

mikkeloscar
Copy link
Contributor

Many of the collectors are internally calling functions/methods which expect a context. In those cases we usually pass context.TODO() because there is no context passed from the caller.

Introduce context to the methods NewCollector and GetMetrics such that it's easier to use a passed context. For now we still pass context.TODO() from the caller, but eventually we can use a context with timeout where it makes sense.

Signed-off-by: Mikkel Oscar Lyderik Larsen <[email protected]>
@mikkeloscar mikkeloscar added the minor Minor changes, e.g. low risk config updates, changes that do not introduce a new API call. label May 21, 2024
@mikkeloscar
Copy link
Contributor Author

👍

1 similar comment
@katyanna
Copy link
Member

👍

@katyanna katyanna merged commit f406e86 into master May 21, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Minor changes, e.g. low risk config updates, changes that do not introduce a new API call.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants