From 02946ec5db0b19b523e5db4003cc71218fe24de1 Mon Sep 17 00:00:00 2001 From: "nedi-app[bot]" Date: Tue, 5 May 2026 07:31:16 +0000 Subject: [PATCH] docs: document comment syntax rules and fix misleading inline comments in health REFERENCE.md The health configuration parser only recognizes '#' as a comment when it is the first non-whitespace character on a line. Inline '#' after a key:value pair becomes part of the value string, causing errors in expression lines or unexpected pattern matching behavior. - Add comment syntax rule to Special Syntax Rules section - Move inline comment in host labels example (line 775) to separate line - Move inline comment in quick-start warn example (line 1524) to separate line --- src/health/REFERENCE.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/health/REFERENCE.md b/src/health/REFERENCE.md index 71bdff7bfe2ba0..d1e29ccae482a6 100644 --- a/src/health/REFERENCE.md +++ b/src/health/REFERENCE.md @@ -346,6 +346,7 @@ For complete details on configuration loading order and precedence rules, see [A - A few lines use space-separated lists to define how the entity behaves. You can use `*` as a wildcard or prefix with `!` for a negative match. Order is important! See our [simple patterns docs](/src/libnetdata/simple_pattern/README.md) for more examples - Lines terminated by a `\` are spliced together with the next line. The backslash is removed, and the following line is joined with the current one. No space is inserted, so you can split a line anywhere, even in the middle of a word. This is handy if your `info` line consists of several sentences +- The `#` character is only recognized as a comment when it is the first non-whitespace character on a line. There is no inline/end-of-line comment support. Any `#` appearing after a key:value pair becomes part of the value string and may cause errors in expression lines (`warn`, `crit`, `calc`) or unexpected behavior in pattern matching (`host labels`, `chart labels`). Place comments on their own separate lines above the configuration line they annotate ### Complete Configuration Reference @@ -772,7 +773,8 @@ host labels: room = server **Pattern Support:** ```text -host labels: installed = 201* # Matches all hosts installed in 2010s +# Matches all hosts installed in 2010s +host labels: installed = 201* ``` **How It Works:** @@ -1521,7 +1523,8 @@ warn: $this > (($status >= $WARNING) ? (75) : (80)) on: system.ram lookup: average -1m percentage of used every: 10s - war: $this > 50 # Low threshold for testing + # Low threshold for testing + war: $this > 50 info: Test alert - safe to ignore ```