Skip to content

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

Merged
JStickler merged 2 commits into
grafana:mainfrom
KKamJi98:docs/fake-tenant-id-ruler-storage-signed
Sep 8, 2026
Merged

JStickler merged 2 commits into
grafana:mainfrom
KKamJi98:docs/fake-tenant-id-ruler-storage-signed

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. Re-submission of #24278 with an SSH-signed commit (branch protection requires verified signatures).

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 30, 2026 14:30
@github-actions

github-actions Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Signed commits report

All 2 commits between main and docs/fake-tenant-id-ruler-storage-signed have verified signatures. ✅

@JStickler JStickler added type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories backport release-3.7.x labels Sep 8, 2026

@JStickler JStickler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[docs team] LGTM, thanks for taking the time to update the docs.

@JStickler
JStickler merged commit 3af2471 into grafana:main Sep 8, 2026
93 checks passed
@JStickler JStickler mentioned this pull request Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release-3.7.x type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please document "fake" ID for single tenancy Loki instances

2 participants