Skip to content

Fixes #39292 - Add cache HIT/MISS logging for Candlepin proxy caches#11727

Draft
pablomh wants to merge 1 commit into
Katello:masterfrom
pablomh:registration/cache-hit-miss-logging
Draft

Fixes #39292 - Add cache HIT/MISS logging for Candlepin proxy caches#11727
pablomh wants to merge 1 commit into
Katello:masterfrom
pablomh:registration/cache-hit-miss-logging

Conversation

@pablomh

@pablomh pablomh commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Emit debug-level log lines via the :registration named logger for each cached Candlepin endpoint, enabling operators to verify cache effectiveness in production.

Log output (at debug level)

[registration] compliance cache=MISS uuid=abc123
[registration] compliance cache=HIT uuid=abc123
[registration] rhsm_status cache=MISS
[registration] rhsm_status cache=HIT

At the default info level, no additional log lines appear.

Dependencies

This is a draft PR that requires these PRs to merge first:

  • Foreman #10946:registration named logger (Redmine #39290)
  • Katello #11696 — Cache Candlepin status (Redmine #39204)

Will rebase onto master once dependencies are merged.

How to test

  1. Enable debug logging in settings.yaml: :logging: :loggers: :registration: :level: debug
  2. Register a host
  3. Check production.log for cache=HIT and cache=MISS lines

@coderabbitai

coderabbitai Bot commented May 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1dd44660-4a16-4b52-936d-98dfebd3610d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jturel

jturel commented May 8, 2026

Copy link
Copy Markdown
Member

The HTTP requests (iirc) are all logged when the application is in debug mode so it's already easy to infer if there was a cache miss (http request logged) or a hit (no http request logged).

@pablomh

pablomh commented May 9, 2026

Copy link
Copy Markdown
Contributor Author

The HIT/MISS logging uses the dedicated :registration logger from foreman#10946, which can be toggled independently without enabling debug for the entire application:

:logging:
  :loggers:
    :registration:
      :level: debug

So operators get cache observability by setting one logger to debug, not by running the whole application in debug mode.

@jturel

jturel commented May 9, 2026

Copy link
Copy Markdown
Member

Pausing my review here until #11692 reaches a resolution

@jturel

jturel commented May 27, 2026

Copy link
Copy Markdown
Member
  • Needs rebase
  • Compliance logging can be removed since we went a different route
  • Recommend logging only cache misses since they're the exception and to keep log signal strength high

Emit debug-level log lines via the :registration named logger
(Foreman #39290) for each cached Candlepin endpoint:

- compliance cache: "compliance cache=HIT/MISS uuid=<uuid>"
- candlepin status cache: "rhsm_status cache=HIT/MISS"

At the default info level, no additional log lines appear.
Enable with :registration logger at debug level.

Depends on:
- Foreman #39290 (:registration named logger)
- Katello #39195 (compliance cache)
- Katello #39204 (candlepin status cache)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pablomh
pablomh force-pushed the registration/cache-hit-miss-logging branch from c97d170 to 7695247 Compare May 27, 2026 18:09
@pablomh

pablomh commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

I'll leave it in draft mode until theforeman/foreman#10946 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants