Skip to content

docs: clarify YAML quoting vs matcher token quoting#5264

Open
Cloud-Architect-Emma wants to merge 1 commit into
prometheus:mainfrom
Cloud-Architect-Emma:docs/fix-matcher-quoting-docs
Open

docs: clarify YAML quoting vs matcher token quoting#5264
Cloud-Architect-Emma wants to merge 1 commit into
prometheus:mainfrom
Cloud-Architect-Emma:docs/fix-matcher-quoting-docs

Conversation

@Cloud-Architect-Emma
Copy link
Copy Markdown

@Cloud-Architect-Emma Cloud-Architect-Emma commented May 30, 2026

Fixes #5099

Adds a note under the "UTF-8 matchers" section clarifying the distinction between YAML quoting and matcher token quoting.

Problem: The documentation describes double-quoting of individual matcher tokens (label name, label value) but does not explain that this quoting is handled by Alertmanager's own parser, not by YAML. Users writing env =~ "prod" without surrounding YAML quotes may believe the inner double quotes protect against YAML special characters, which they do not.

Change: Added a blockquote note explaining the three YAML quoting styles (plain, single-quoted, double-quoted) with examples, and explicitly clarifying that inner double quotes on matcher tokens provide no YAML-level protection.

Summary by CodeRabbit

  • Documentation
    • Expanded configuration documentation with detailed clarification on YAML quoting behavior and its relationship to Alertmanager matcher token parsing. Added comprehensive guidance on appropriate use of plain, single-quoted, and double-quoted YAML scalar formats, including important warnings about protecting configuration values against YAML special characters.

Review Change Stack

Fixes prometheus#5099

Add a note under UTF-8 matchers explaining that YAML quoting applies
to the entire matcher string, not individual tokens. Include guidance
on plain-style, single-quoted, and double-quoted YAML matchers.

Co-authored-by: Cloud-Architect-Emma <Cloud-Architect-Emma@users.noreply.github.com>
Signed-off-by: Cloud-Architect-Emma <emmanuela_prince@yahoo.com>
@Cloud-Architect-Emma Cloud-Architect-Emma requested a review from a team as a code owner May 30, 2026 11:27
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: affaa305-aff7-41ed-a921-a2a0ec8ec227

📥 Commits

Reviewing files that changed from the base of the PR and between 45996cb and b827e4f.

📒 Files selected for processing (1)
  • docs/configuration.md

📝 Walkthrough

Walkthrough

Documentation note added to clarify that YAML quoting rules apply to entire matcher strings, not individual tokens. Examples demonstrate plain-style, single-quoted, and double-quoted YAML scalar approaches for matcher entries.

Changes

Matcher YAML Quoting Documentation

Layer / File(s) Summary
YAML quoting vs. matcher token quoting note
docs/configuration.md
Added clarification explaining how YAML quoting applies to the whole matcher string and providing examples for plain, single-quoted, and double-quoted YAML styles, with guidance on when each is appropriate.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: documentation clarification about YAML quoting versus matcher token quoting.
Description check ✅ Passed The description provides clear context about the issue being fixed, the problem identified, and the specific changes made to address it.
Linked Issues check ✅ Passed The PR directly addresses issue #5099 by adding documentation that clarifies YAML quoting styles and explains that inner double quotes on matcher tokens do not provide YAML-level protection.
Out of Scope Changes check ✅ Passed The changes are limited to documentation updates in docs/configuration.md related to the matcher quoting clarification, with no out-of-scope alterations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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.

@Cloud-Architect-Emma
Copy link
Copy Markdown
Author

Hi maintainers, could someone please approve the workflow run so the build and test checks can execute? This is a

documentation-only change adding a note to clarify YAML quoting vs matcher token quoting as reported in #5099. DCO is passing.

Thanks!

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.

AlertManager matcher quoting documentation is confusing

1 participant