Skip to content

chore: post-#62 cache log placement and docstring#63

Merged
Odrec merged 1 commit into
mainfrom
chore/post-62-cache-cleanup
May 8, 2026
Merged

chore: post-#62 cache log placement and docstring#63
Odrec merged 1 commit into
mainfrom
chore/post-62-cache-cleanup

Conversation

@Odrec
Copy link
Copy Markdown
Collaborator

@Odrec Odrec commented May 8, 2026

Summary

Two small follow-ups to #62.

  • Move the "Cache configuration" log block out of _collect_loop. It was placed after the while 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.
  • Update the 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.

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.
@Odrec Odrec merged commit 0e12973 into main May 8, 2026
24 of 36 checks passed
@Odrec Odrec deleted the chore/post-62-cache-cleanup branch May 8, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant