Skip to content

feat(mimir.rules.kubernetes, loki.rules.kubernetes): Add configurable mimir_namespace_separator and loki_namespace_separator arguments to allow using a URL-safe separator#5961

Open
QuentinBisson wants to merge 11 commits intografana:mainfrom
QuentinBisson:quentin/mimir-loki-namespace-separator

Conversation

@QuentinBisson
Copy link
Copy Markdown
Contributor

@QuentinBisson QuentinBisson commented Apr 1, 2026

Brief description of Pull Request

Fixes #5915

Add mimir_namespace_separator (default "/") and loki_namespace_separator (default "-") arguments so users can replace the hardcoded separator with a URL-safe character (e.g. _) when a reverse proxy decodes %2F before routing to the ruler API.

The managed-namespace check is now separator-agnostic, so rules stored under the old separator are automatically cleaned up on the next reconciliation when the separator changes.

PR Checklist

  • Documentation added
  • Tests updated
  • Config converters updated

… namespace separator

Add mimir_namespace_separator (default "/") and loki_namespace_separator
(default "-") arguments so users can replace the hardcoded separator with
a URL-safe character (e.g. "_") when a reverse proxy sits in front of the
ruler API and does not preserve encoded slashes (%2F).

The isManagedMimirNamespace/isManagedLokiNamespace checks are now
separator-agnostic, matching by prefix+UUID pattern regardless of
separator. This means rules stored under the old separator are still
recognised as managed and automatically garbage-collected on the next
reconciliation cycle when the separator changes — no manual cleanup
required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@QuentinBisson QuentinBisson requested review from a team and clayton-cornell as code owners April 1, 2026 11:43
QuentinBisson and others added 3 commits April 2, 2026 21:33
Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
@QuentinBisson
Copy link
Copy Markdown
Contributor Author

Hey @clayton-cornell I was waiting for you to show up :D

Thank you for reviewing this PR

@clayton-cornell
Copy link
Copy Markdown
Contributor

Haha... happy to review the PRs :-)

Over to @grafana/grafana-alloy-maintainers for the code review

@clayton-cornell clayton-cornell changed the title feat(mimir.rules.kubernetes, loki.rules.kubernetes): add configurable namespace separator feat(mimir.rules.kubernetes, loki.rules.kubernetes): Add configurable namespace separator Apr 2, 2026
@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label Apr 2, 2026
@QuentinBisson QuentinBisson changed the title feat(mimir.rules.kubernetes, loki.rules.kubernetes): Add configurable namespace separator feat(mimir.rules.kubernetes, loki.rules.kubernetes): Add configurable mimir_namespace_separator and loki_namespace_separator arguments to allow using a URL-safe separator Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/docs Docs Squad label across all Grafana Labs repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mimir.rules.kubernetes: namespace separator breaks with proxies that decode %2F

2 participants