Skip to content

docs: Clarify fake tenant ID for Ruler local storage in single tenant mode - #24278

Closed
KKamJi98 wants to merge 2 commits into
grafana:mainfrom
KKamJi98:docs/fake-tenant-id-ruler-storage
Closed

KKamJi98 wants to merge 2 commits into
grafana:mainfrom
KKamJi98:docs/fake-tenant-id-ruler-storage

Conversation

@KKamJi98

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

The Ruler storage docs show a local storage layout of /tmp/loki/rules/<tenant id>/, but never explain what <tenant id> is when Loki runs with auth_enabled: false. In that mode the tenant ID defaults to fake (-auth.no-auth-tenant), so rule files must be placed under <directory>/fake/ — a fact users keep rediscovering the hard way (#5459, #4654, #4859).

This PR:

  • Explains that <tenant id> must match the tenant ID the Ruler runs under, and that it defaults to fake in single tenant mode (configurable with -auth.no-auth-tenant).
  • Shows the concrete /tmp/loki/rules/fake/ layout for the existing example.
  • Notes that the local backend reads every non-hidden file in the tenant directory (no glob matching, subdirectories ignored).
  • Clarifies that -ruler.storage.local.directory (rules read from here) is distinct from rule_path (scratch space for temporary rule files).
  • Documents that a missing tenant directory is logged as an error on each Ruler sync (unable to read rule dir ...) until the directory is created.

Docs-only change; no code behavior is modified.

Which issue(s) this PR fixes:
Fixes #5459

Special notes for your reviewer:

  • The fake default is verified against pkg/loki/loki.go (default of the -auth.no-auth-tenant flag) and the local rule store, which reads <directory>/<userID> (pkg/ruler/rulestore/local/local.go, filepath.Join(l.cfg.Directory, userID)).
  • The missing-directory behavior is verified: local.go wraps the os.ReadDir error (unable to read rule dir %s) and the Ruler sync loop logs it at error level (unable to list rules), retrying on every sync.
  • The "all files are read" wording addresses please don't parse dotfiles in loki alerts (ruler) directory #4654 / dot files in rules fake directory are not ignored and cause errors #4859: the local store loads every non-dot file in the tenant directory rather than matching a rule_file glob.

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@KKamJi98
KKamJi98 requested a review from a team as a code owner August 29, 2026 11:29
@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Signed commits report

1 of 2 commits between main and docs/fake-tenant-id-ruler-storage could not be fully verified:

Commit Author Reason Message
0acb74f3 KKamJi unsigned docs: Clarify fake tenant ID for Ruler local storage in single tenant mode

This repository requires all commits to be signed. See GitHub docs on commit signature verification.

@cla-assistant

cla-assistant Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cla-assistant

cla-assistant Bot commented Aug 29, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@KKamJi98 KKamJi98 closed this Aug 30, 2026
@KKamJi98 KKamJi98 reopened this Aug 30, 2026
@KKamJi98

Copy link
Copy Markdown
Contributor Author

Closing in favor of a fresh branch with a signed commit (repository requires verified signatures). Same change will be re-submitted.

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.

Please document "fake" ID for single tenancy Loki instances

1 participant