chore: post-#62 cache log placement and docstring#63
Merged
Conversation
Two small follow-ups to the cold-cache fix in #62: - Move the "Cache configuration" logger.info block out of _collect_loop. It sat after the `while not self._stop_collection.is_set()` loop, so it only printed during shutdown — which made the cache config invisible at startup. Moved to __init__ alongside the existing "Metric groups configuration" block so both configs log together when the collector is constructed. - Update the collect() docstring to reflect the three-way behavior introduced by #62: cache-warm serves cached, cache-cold yields nothing, cache-disabled collects fresh.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small follow-ups to #62.
_collect_loop. It was placed after thewhile not self._stop_collection.is_set()loop, so it only fired during shutdown — meaning operators never saw the cache config at startup. Moved to the end of__init__next to the existing "Metric groups configuration" block, so both configs log together at construction time.collect()docstring. The old one ("If caching is enabled, serve from cache. Otherwise, collect fresh metrics.") missed the new third path introduced by fix: prevent blocking scrapes while cache is cold #62: cache-enabled-but-warming returns empty. Docstring now describes all three behaviors.No behavior change beyond log timing.