From 8552615871fcd40773be1487ff7a12f267c56913 Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Thu, 5 Feb 2026 15:17:18 +0200 Subject: [PATCH 01/28] docs: Add comprehensive Badges documentation Add documentation for the Badges feature (/api/v1/badge.svg) that allows generating SVG badges displaying real-time metrics and alert status. This addresses unresponded user queries about badges functionality. Source code verified at src/web/api/v1/api_v1_badge/web_buffer_svg.c --- docs/dashboards-and-charts/badges.md | 319 +++++++++++++++++++++++++++ 1 file changed, 319 insertions(+) create mode 100644 docs/dashboards-and-charts/badges.md diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md new file mode 100644 index 00000000000000..356136200a0e97 --- /dev/null +++ b/docs/dashboards-and-charts/badges.md @@ -0,0 +1,319 @@ +# Badges + +Netdata can generate SVG badges that display real-time metric values or alert statuses. These badges can be embedded in external dashboards, documentation, GitHub READMEs, or any web page that supports images. + +## Overview + +Badges provide a simple way to share Netdata metrics and alert states externally. Each badge is an SVG image that updates dynamically and can display: + +- Current metric values from any chart +- Alert states (warning, critical, clear) +- Custom labels and units +- Color-coded states based on thresholds + +## Accessing Badges + +Badges are available through the Netdata Agent API at: + +``` +http://YOUR_NETDATA_HOST:19999/api/v1/badge.svg?chart=CHART_ID&options=OPTIONS +``` + +### Authentication and Access Control + +By default, badges can be accessed from any source. To restrict access: + +1. Edit `netdata.conf`: + +```ini +[web] + allow badges from = 10.* 192.168.* YOUR_IP +``` + +2. Restart Netdata: + +```bash +sudo systemctl restart netdata +``` + +## Query Parameters + +### Required Parameters + +| Parameter | Description | Example | +| --------- | ----------------------- | ---------------------------------- | +| `chart` | The chart ID to display | `system.cpu`, `netdata.server_cpu` | + +### Optional Parameters + +| Parameter | Description | Default | Example | +| -------------------- | -------------------------------------------- | -------------------- | ------------------------------ | +| `alarm` | Display alert status instead of metric value | - | `system.cpu.10min_cpu_usage` | +| `dimension` or `dim` | Specific dimension(s) to display | All dimensions | `user`, `system` | +| `after` | Time range start (negative seconds) | `-3600` (1 hour ago) | `-600` (10 min ago) | +| `before` | Time range end (negative seconds) | `0` (now) | `0` | +| `points` | Number of data points to aggregate | `1` | `60` | +| `group` | Aggregation method | `average` | `average`, `sum`, `max`, `min` | +| `label` | Left-side label text | Chart name | `CPU Usage` | +| `units` | Unit suffix to display | Auto-detected | `%`, `MB`, `requests/s` | +| `multiply` | Multiply value by this factor | `1` | `100` (for percentages) | +| `divide` | Divide value by this factor | `1` | `1024` (bytes to KB) | +| `precision` | Decimal places | Auto | `2` | +| `scale` | Badge scale percentage | `100` | `150` | +| `refresh` | Auto-refresh interval in seconds | `0` (no refresh) | `auto`, `5` | +| `label_color` | Left side background color | `grey` | `blue`, `red`, `#007ec6` | +| `value_color` | Right side background color | Based on value | `green`, `yellow`, `#4c1` | +| `text_color_lbl` | Left text color | `white` | `black`, `#fff` | +| `text_color_val` | Right text color | `white` | `black`, `#fff` | +| `fixed_width_lbl` | Fixed width for label (pixels) | Auto | `100` | +| `fixed_width_val` | Fixed width for value (pixels) | Auto | `80` | + +## Usage Examples + +### Basic Metric Badge + +Display current CPU usage: + +```markdown +![CPU Usage](http://localhost:19999/api/v1/badge.svg?chart=system.cpu&dimension=user) +``` + +### Alert Status Badge + +Display alert state: + +```markdown +![CPU Alert](http://localhost:19999/api/v1/badge.svg?chart=system.cpu&alarm=system.cpu.10min_cpu_usage) +``` + +### Custom Label and Units + +```markdown +![Memory](http://localhost:19999/api/v1/badge.svg?chart=mem.available&label=RAM&units=GB÷=1073741824&precision=2) +``` + +### Aggregated Values + +Show average network traffic over 5 minutes: + +```markdown +![Network](http://localhost:19999/api/v1/badge.svg?chart=system.net&dimension=received&after=-300&group=average&label=Net+In) +``` + +### Color-Coded Badges + +Static colors: + +```markdown +![Status](http://localhost:19999/api/v1/badge.svg?chart=system.load&label=Load&value_color=blue) +``` + +Conditional colors based on value: + +```markdown +![Disk](http://localhost:19999/api/v1/badge.svg?chart=disk_space._&label=Root&units=%&value_color=green>80:yellow>90:red) +``` + +## Color Options + +### Predefined Colors + +| Color | Hex Code | +| ------------------------- | --------- | +| `brightgreen` | `#4c1` | +| `green` | `#97CA00` | +| `yellowgreen` | `#a4a61d` | +| `yellow` | `#dfb317` | +| `orange` | `#fe7d37` | +| `red` | `#e05d44` | +| `blue` | `#007ec6` | +| `grey` / `gray` | `#555` | +| `lightgrey` / `lightgray` | `#9f9f9f` | + +### Custom Colors + +Use any hex color code (without the `#`): + +``` +value_color=FF5733 +``` + +### Conditional Colors + +Set colors based on value thresholds: + +``` +value_color=green>80:yellow>90:red +``` + +This means: + +- Green if value ≤ 80 +- Yellow if value > 80 and ≤ 90 +- Red if value > 90 + +Supported operators: + +- `>` greater than +- `<` less than +- `=` equal to +- `>=` greater than or equal +- `<=` less than or equal + +## Grouping Methods + +When aggregating multiple data points: + +| Method | Description | +| ----------------- | ------------------------------ | +| `average` | Arithmetic mean of values | +| `sum` | Sum of all values | +| `max` | Maximum value | +| `min` | Minimum value | +| `median` | Median value | +| `stddev` | Standard deviation | +| `incremental-sum` | Incremental sum (for counters) | + +## Alert Badges + +When using the `alarm` parameter, badges display alert states: + +- **CLEAR** - Green badge, alert is not triggered +- **WARNING** - Yellow badge, warning threshold exceeded +- **CRITICAL** - Red badge, critical threshold exceeded +- **UNDEFINED** - Grey badge, alert cannot be evaluated + +Example: + +```markdown +![CPU Alert](http://localhost:19999/api/v1/badge.svg?chart=system.cpu&alarm=system.cpu.10min_cpu_usage&label=CPU+Alert) +``` + +## Refresh Behavior + +Badges can auto-refresh to show real-time data: + +- `refresh=auto` - Automatically calculates refresh based on chart update frequency +- `refresh=5` - Refresh every 5 seconds +- `refresh=0` or omitted - No auto-refresh (static badge) + +**Note:** Auto-refresh works through HTTP cache headers. Some platforms (like GitHub) cache images aggressively and may not show real-time updates. + +## Common Use Cases + +### GitHub README + +Add to your repository README: + +```markdown +## Server Status + +![CPU](https://your-netdata.com/api/v1/badge.svg?chart=system.cpu&dimension=user&label=CPU) +![RAM](https://your-netdata.com/api/v1/badge.svg?chart=mem.available&units=GB÷=1073741824&precision=1&label=RAM) +![Disk](https://your-netdata.com/api/v1/badge.svg?chart=disk_space._&units=%&label=Disk) +``` + +### External Dashboard + +Create a simple status dashboard: + +```html +
+ CPU + RAM + Load +
+``` + +### Slack/Discord Integration + +Share metric badges in chat: + +``` +Current server status: +http://netdata.local:19999/api/v1/badge.svg?chart=system.cpu&dimension=user&value_color=green<50:yellow<80:red&label=CPU +``` + +## Troubleshooting + +### Badge shows "chart not found" + +- Verify the chart ID exists: Check the Netdata dashboard URL for the correct chart ID +- Chart IDs are case-sensitive +- Use `system.cpu` format, not `system.cpu.user` + +### Badge shows empty value + +- Check that the `dimension` parameter matches an actual dimension name +- Verify the time range (`after`/`before`) contains data +- Some charts may have no data for the requested time period + +### Access denied / Cannot view badge + +- Check `allow badges from` in `netdata.conf` +- Ensure the requesting IP is allowed +- Check firewall rules on the Netdata host + +### Colors not working + +- Use predefined color names or 6-character hex codes (without `#`) +- For conditional colors, ensure the format is correct: `color>threshold` + +### Badge not updating + +- Add `refresh=auto` or a specific interval +- Some platforms cache images; try adding a cache-busting parameter: + ``` + http://netdata.local:19999/api/v1/badge.svg?chart=system.cpu&refresh=5&t=123456 + ``` + +## Advanced Configuration + +### Multiple Dimensions + +Aggregate multiple dimensions: + +``` +chart=system.cpu&dimension=user&dimension=system&group=average +``` + +### Calculated Values + +Show bandwidth in Mbps: + +``` +chart=system.net&multiply=8÷=1000000&units=Mbps&precision=2 +``` + +### Complex Conditional Colors + +Multiple thresholds: + +``` +value_color=brightgreen<50:green<70:yellowgreen<80:yellow<90:orange<95:red +``` + +## Security Considerations + +1. **Access Control**: Always configure `allow badges from` to restrict access +2. **Sensitive Data**: Avoid exposing sensitive metrics through badges +3. **Public Exposure**: If exposing badges publicly, consider: + - Using a reverse proxy with authentication + - Limiting available charts via ACLs + - Monitoring badge access logs + +## Related Documentation + +- [Web Dashboard](/docs/dashboards-and-charts/README.md) +- [Alert Configuration](/docs/alerts-and-notifications/README.md) +- [API Reference](/docs/developer-and-contributor-corner/rest-api/README.md) +- [Access Control](/docs/netdata-agent/securing-netdata-agents.md) From 0f16ca736833fb402688bf920eaf922e3cb80387 Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Thu, 5 Feb 2026 15:20:09 +0200 Subject: [PATCH 02/28] docs: Register Badges documentation in map.csv Add badges.md to Dashboards and Charts section for proper learn.netdata.cloud rendering. Placement rationale: Badges are a visualization/output feature for embedding SVG images in dashboards and external sites, not a developer API. --- docs/.map/map.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/.map/map.csv b/docs/.map/map.csv index 60fa1e629bbd01..e385aeeb3d7b2a 100644 --- a/docs/.map/map.csv +++ b/docs/.map/map.csv @@ -217,6 +217,7 @@ https://github.com/netdata/netdata/edit/master/docs/dashboards-and-charts/netdat https://github.com/netdata/netdata/edit/master/docs/dashboards-and-charts/expanded-chart-analysis.md,Expanded Chart Analysis,Published,Dashboards and Charts,, https://github.com/netdata/netdata/edit/master/docs/NIDL-Framework.md,NIDL Framework,Published,Dashboards and Charts,, https://github.com/netdata/netdata/edit/master/docs/dashboards-and-charts/node-filter.md,Node Filter,Published,Dashboards and Charts,, +https://github.com/netdata/netdata/edit/master/docs/dashboards-and-charts/badges.md,Badges,Published,Dashboards and Charts,badges,svg,embed,images,shields,Generate dynamic SVG badges for metrics and alerts to embed in dashboards, GitHub READMEs, or external sites., https://github.com/netdata/netdata/edit/master/docs/dashboards-and-charts/visualization-date-and-time-controls.md,Time Controls,Published,Dashboards and Charts,, ,,,,, ,,,,, From d8f3deaa15225e9ba4fd4322c5a5e91cb632d00d Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Thu, 5 Feb 2026 15:23:55 +0200 Subject: [PATCH 03/28] docs: Fix Badges documentation to align with source code Corrected discrepancies discovered during source code review: 1. Fixed conditional color operators: is equality (not inequality), is the inequality operator 2. Corrected default value: (chart-dependent) instead of 3. Added missing parameters: and 4. Corrected default from 'Auto' to '-1 (auto)' 5. Updated examples to use correct conditional color syntax Source: src/web/api/v1/api_v1_badge/web_buffer_svg.c --- docs/dashboards-and-charts/badges.md | 61 +++++++++++++++------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index 356136200a0e97..16947731888b1a 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -46,27 +46,29 @@ sudo systemctl restart netdata ### Optional Parameters -| Parameter | Description | Default | Example | -| -------------------- | -------------------------------------------- | -------------------- | ------------------------------ | -| `alarm` | Display alert status instead of metric value | - | `system.cpu.10min_cpu_usage` | -| `dimension` or `dim` | Specific dimension(s) to display | All dimensions | `user`, `system` | -| `after` | Time range start (negative seconds) | `-3600` (1 hour ago) | `-600` (10 min ago) | -| `before` | Time range end (negative seconds) | `0` (now) | `0` | -| `points` | Number of data points to aggregate | `1` | `60` | -| `group` | Aggregation method | `average` | `average`, `sum`, `max`, `min` | -| `label` | Left-side label text | Chart name | `CPU Usage` | -| `units` | Unit suffix to display | Auto-detected | `%`, `MB`, `requests/s` | -| `multiply` | Multiply value by this factor | `1` | `100` (for percentages) | -| `divide` | Divide value by this factor | `1` | `1024` (bytes to KB) | -| `precision` | Decimal places | Auto | `2` | -| `scale` | Badge scale percentage | `100` | `150` | -| `refresh` | Auto-refresh interval in seconds | `0` (no refresh) | `auto`, `5` | -| `label_color` | Left side background color | `grey` | `blue`, `red`, `#007ec6` | -| `value_color` | Right side background color | Based on value | `green`, `yellow`, `#4c1` | -| `text_color_lbl` | Left text color | `white` | `black`, `#fff` | -| `text_color_val` | Right text color | `white` | `black`, `#fff` | -| `fixed_width_lbl` | Fixed width for label (pixels) | Auto | `100` | -| `fixed_width_val` | Fixed width for value (pixels) | Auto | `80` | +| Parameter | Description | Default | Example | +| -------------------- | -------------------------------------------- | --------------------------------- | ------------------------------ | +| `alarm` | Display alert status instead of metric value | - | `system.cpu.10min_cpu_usage` | +| `dimension` or `dim` | Specific dimension(s) to display | All dimensions | `user`, `system` | +| `after` | Time range start (negative seconds) | `-UPDATE_EVERY` (chart-dependent) | `-600` (10 min ago) | +| `before` | Time range end (negative seconds) | `0` (now) | `0` | +| `points` | Number of data points to aggregate | `1` | `60` | +| `group` | Aggregation method | `average` | `average`, `sum`, `max`, `min` | +| `group_options` | Additional grouping options | - | `percentage` | +| `options` | Query options (percentage, abs, etc.) | - | `percentage` | +| `label` | Left-side label text | Chart name | `CPU Usage` | +| `units` | Unit suffix to display | Auto-detected | `%`, `MB`, `requests/s` | +| `multiply` | Multiply value by this factor | `1` | `100` (for percentages) | +| `divide` | Divide value by this factor | `1` | `1024` (bytes to KB) | +| `precision` | Decimal places (-1 for auto) | `-1` (auto) | `2` | +| `scale` | Badge scale percentage | `100` | `150` | +| `refresh` | Auto-refresh interval in seconds | `0` (no refresh) | `auto`, `5` | +| `label_color` | Left side background color | `grey` | `blue`, `red`, `#007ec6` | +| `value_color` | Right side background color | Based on value | `green`, `yellow`, `#4c1` | +| `text_color_lbl` | Left text color | `white` | `black`, `#fff` | +| `text_color_val` | Right text color | `white` | `black`, `#fff` | +| `fixed_width_lbl` | Fixed width for label (pixels) | Auto | `100` | +| `fixed_width_val` | Fixed width for value (pixels) | Auto | `80` | ## Usage Examples @@ -111,7 +113,7 @@ Static colors: Conditional colors based on value: ```markdown -![Disk](http://localhost:19999/api/v1/badge.svg?chart=disk_space._&label=Root&units=%&value_color=green>80:yellow>90:red) +![Disk](http://localhost:19999/api/v1/badge.svg?chart=disk_space._&label=Root&units=%&value_color=green<80:yellow<90:red) ``` ## Color Options @@ -143,22 +145,23 @@ value_color=FF5733 Set colors based on value thresholds: ``` -value_color=green>80:yellow>90:red +value_color=green<80:yellow<90:red ``` This means: -- Green if value ≤ 80 -- Yellow if value > 80 and ≤ 90 -- Red if value > 90 +- Green if value < 80 +- Yellow if value ≥ 80 and < 90 +- Red if value ≥ 90 Supported operators: -- `>` greater than +- `:` or `=` equality (first match wins) +- `!` inequality - `<` less than -- `=` equal to -- `>=` greater than or equal +- `>` greater than - `<=` less than or equal +- `>=` greater than or equal ## Grouping Methods From 5de916d74ea9fa249dc75fc4fdc0ad3e92b2b356 Mon Sep 17 00:00:00 2001 From: Kanela Date: Thu, 5 Feb 2026 15:25:31 +0200 Subject: [PATCH 04/28] Apply suggestion from @cubic-dev-ai[bot] Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> --- docs/.map/map.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/.map/map.csv b/docs/.map/map.csv index e385aeeb3d7b2a..ee00ce79d9a33c 100644 --- a/docs/.map/map.csv +++ b/docs/.map/map.csv @@ -217,7 +217,7 @@ https://github.com/netdata/netdata/edit/master/docs/dashboards-and-charts/netdat https://github.com/netdata/netdata/edit/master/docs/dashboards-and-charts/expanded-chart-analysis.md,Expanded Chart Analysis,Published,Dashboards and Charts,, https://github.com/netdata/netdata/edit/master/docs/NIDL-Framework.md,NIDL Framework,Published,Dashboards and Charts,, https://github.com/netdata/netdata/edit/master/docs/dashboards-and-charts/node-filter.md,Node Filter,Published,Dashboards and Charts,, -https://github.com/netdata/netdata/edit/master/docs/dashboards-and-charts/badges.md,Badges,Published,Dashboards and Charts,badges,svg,embed,images,shields,Generate dynamic SVG badges for metrics and alerts to embed in dashboards, GitHub READMEs, or external sites., +https://github.com/netdata/netdata/edit/master/docs/dashboards-and-charts/badges.md,Badges,Published,Dashboards and Charts,"badges,svg,embed,images,shields","Generate dynamic SVG badges for metrics and alerts to embed in dashboards, GitHub READMEs, or external sites." https://github.com/netdata/netdata/edit/master/docs/dashboards-and-charts/visualization-date-and-time-controls.md,Time Controls,Published,Dashboards and Charts,, ,,,,, ,,,,, From b346c31a7f71372c5f30e396375f2d5ec126efca Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Thu, 5 Feb 2026 16:01:35 +0200 Subject: [PATCH 05/28] docs: Align Badges documentation with source code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cross-verified against src/web/api/v1/api_v1_badge/web_buffer_svg.c and src/web/api/queries/query.h: 1. Expanded grouping methods table to include: trimmed-mean, percentile, ses, des, cv, countif, extremes (source has ~50 methods) 2. Added UNINITIALIZED alert status (handled at line 1084-1085) 3. Fixed troubleshooting typo: color>threshold → colorthreshold` +- For conditional colors, ensure the format is correct: `color Date: Thu, 5 Feb 2026 16:09:06 +0200 Subject: [PATCH 06/28] docs: Thorough source code verification of Badges documentation Cross-verified against: - src/web/api/v1/api_v1_badge/web_buffer_svg.c (main implementation) - src/web/api/queries/query.h (grouping methods) - src/daemon/config/netdata-conf-web.c (access control) Corrections made: 1. Text color defaults: Changed from 'white' to 'grey' (fallback) - source uses 'fff' (white) only when explicitly passed, defaults to '555' (grey) 2. Empty value troubleshooting: Clarified that '-' appears when data is too old (staleness check) rather than just "no data" 3. Added Special Units Formats section documenting: seconds/minutes/hours (with _ago variants), on/off, up/down, ok/error, ok/failed, percentage, empty/null - all from badge_units_formatters array 4. Confirmed access control: 'allow badges from' in [web] section with default '*' (verified in netdata-conf-web.c:86-87) All claims now align with source of truth. --- docs/dashboards-and-charts/badges.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index 80edbfec690fcf..a3fc99e95adb19 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -65,8 +65,8 @@ sudo systemctl restart netdata | `refresh` | Auto-refresh interval in seconds | `0` (no refresh) | `auto`, `5` | | `label_color` | Left side background color | `grey` | `blue`, `red`, `#007ec6` | | `value_color` | Right side background color | Based on value | `green`, `yellow`, `#4c1` | -| `text_color_lbl` | Left text color | `white` | `black`, `#fff` | -| `text_color_val` | Right text color | `white` | `black`, `#fff` | +| `text_color_lbl` | Left text color | `grey` (fallback) | `black`, `#fff` | +| `text_color_val` | Right text color | `grey` (fallback) | `black`, `#fff` | | `fixed_width_lbl` | Fixed width for label (pixels) | Auto | `100` | | `fixed_width_val` | Fixed width for value (pixels) | Auto | `80` | @@ -132,6 +132,22 @@ Conditional colors based on value: | `grey` / `gray` | `#555` | | `lightgrey` / `lightgray` | `#9f9f9f` | +### Special Units Formats + +When using the `units` parameter, these special formats are recognized: + +| Units Value | Display Format | +| -------------------------------------- | ------------------------- | +| `seconds` / `seconds ago` | Formatted time (HH:MM:SS) | +| `minutes` / `minutes ago` | Formatted time (Xd HH:MM) | +| `hours` / `hours ago` | Formatted time (Xd XXh) | +| `on/off` / `on-off` / `onoff` | "on" or "off" | +| `up/down` / `up-down` / `updown` | "up" or "down" | +| `ok/error` / `ok-error` / `okerror` | "ok" or "error" | +| `ok/failed` / `ok-failed` / `okfailed` | "ok" or "failed" | +| `percentage` / `percent` / `pcent` | Adds `%` suffix | +| `empty` / `null` | Hides units entirely | + ### Custom Colors Use any hex color code (without the `#`): @@ -267,8 +283,8 @@ http://netdata.local:19999/api/v1/badge.svg?chart=system.cpu&dimension=user&valu ### Badge shows empty value - Check that the `dimension` parameter matches an actual dimension name -- Verify the time range (`after`/`before`) contains data -- Some charts may have no data for the requested time period +- Verify the time range (`after`/`before`) contains recent data +- Badge shows "-" when data is too old (staleness check) or unavailable ### Access denied / Cannot view badge From a63114b766a67b7b409d6ebecaf2a14123ea83a2 Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Thu, 5 Feb 2026 16:12:51 +0200 Subject: [PATCH 07/28] docs: Add color swatches to Badges color options table Visual color indicators (spheres) added next to each predefined color for easier identification when choosing badge colors. --- docs/dashboards-and-charts/badges.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index a3fc99e95adb19..6a65022cb6c567 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -120,17 +120,17 @@ Conditional colors based on value: ### Predefined Colors -| Color | Hex Code | -| ------------------------- | --------- | -| `brightgreen` | `#4c1` | -| `green` | `#97CA00` | -| `yellowgreen` | `#a4a61d` | -| `yellow` | `#dfb317` | -| `orange` | `#fe7d37` | -| `red` | `#e05d44` | -| `blue` | `#007ec6` | -| `grey` / `gray` | `#555` | -| `lightgrey` / `lightgray` | `#9f9f9f` | +| Color | Hex Code | +| --------------------------------------------------------------------------------------------------------------------------------- | --------- | +| `brightgreen` | `#4c1` | +| `green` | `#97CA00` | +| `yellowgreen` | `#a4a61d` | +| `yellow` | `#dfb317` | +| `orange` | `#fe7d37` | +| `red` | `#e05d44` | +| `blue` | `#007ec6` | +| `grey` / `gray` | `#555` | +| `lightgrey` / `lightgray` | `#9f9f9f` | ### Special Units Formats From 38096a208fdf646060b70e00f19ebb194630e7ab Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Thu, 5 Feb 2026 16:31:17 +0200 Subject: [PATCH 08/28] docs: Use Unicode color indicators for Badges color table Replaced non-rendering HTML spans with Unicode emoji circles that render reliably in markdown tables. --- docs/dashboards-and-charts/badges.md | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index 6a65022cb6c567..f08a6f92d3efc4 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -120,17 +120,19 @@ Conditional colors based on value: ### Predefined Colors -| Color | Hex Code | -| --------------------------------------------------------------------------------------------------------------------------------- | --------- | -| `brightgreen` | `#4c1` | -| `green` | `#97CA00` | -| `yellowgreen` | `#a4a61d` | -| `yellow` | `#dfb317` | -| `orange` | `#fe7d37` | -| `red` | `#e05d44` | -| `blue` | `#007ec6` | -| `grey` / `gray` | `#555` | -| `lightgrey` / `lightgray` | `#9f9f9f` | +| Color | Hex Code | Sample | +| ------------------------- | --------- | ------ | +| `brightgreen` | `#4c1` | 🟢 | +| `green` | `#97CA00` | 🟢 | +| `yellowgreen` | `#a4a61d` | 🟡 | +| `yellow` | `#dfb317` | 🟡 | +| `orange` | `#fe7d37` | 🟠 | +| `red` | `#e05d44` | 🔴 | +| `blue` | `#007ec6` | 🔵 | +| `grey` / `gray` | `#555` | ⬜ | +| `lightgrey` / `lightgray` | `#9f9f9f` | ⬜ | + +**Color guide:** 🟢 green tones | 🟡 yellow/olive | 🟠 orange | 🔴 red | 🔵 blue | ⬜ greys ### Special Units Formats From 37015b8e239388d3a6fb706d203518fe85ae8ef7 Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Thu, 5 Feb 2026 16:34:09 +0200 Subject: [PATCH 09/28] docs: Differentiate brightgreen from green in color table Added asterisk marker to green sample and clarified in legend that brightgreen is richer while green is lighter/yellowish. --- docs/dashboards-and-charts/badges.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index f08a6f92d3efc4..da3bff138a7815 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -123,7 +123,7 @@ Conditional colors based on value: | Color | Hex Code | Sample | | ------------------------- | --------- | ------ | | `brightgreen` | `#4c1` | 🟢 | -| `green` | `#97CA00` | 🟢 | +| `green` | `#97CA00` | 🟢\* | | `yellowgreen` | `#a4a61d` | 🟡 | | `yellow` | `#dfb317` | 🟡 | | `orange` | `#fe7d37` | 🟠 | @@ -132,7 +132,7 @@ Conditional colors based on value: | `grey` / `gray` | `#555` | ⬜ | | `lightgrey` / `lightgray` | `#9f9f9f` | ⬜ | -**Color guide:** 🟢 green tones | 🟡 yellow/olive | 🟠 orange | 🔴 red | 🔵 blue | ⬜ greys +**Color guide:** 🟢 rich green | 🟢\* lighter/yellowish green | 🟡 yellow/olive | 🟠 orange | 🔴 red | 🔵 blue | ⬜ greys ### Special Units Formats From 9e535494dea4fbfe6660b7d0809f7f6da7600b5b Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Thu, 5 Feb 2026 16:37:50 +0200 Subject: [PATCH 10/28] docs: Use colored hex code boxes for visual color reference Replaced emoji samples with actual colored boxes showing each hex code, providing true visual representation of each badge color. --- docs/dashboards-and-charts/badges.md | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index da3bff138a7815..5ef805ffd95631 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -120,19 +120,17 @@ Conditional colors based on value: ### Predefined Colors -| Color | Hex Code | Sample | -| ------------------------- | --------- | ------ | -| `brightgreen` | `#4c1` | 🟢 | -| `green` | `#97CA00` | 🟢\* | -| `yellowgreen` | `#a4a61d` | 🟡 | -| `yellow` | `#dfb317` | 🟡 | -| `orange` | `#fe7d37` | 🟠 | -| `red` | `#e05d44` | 🔴 | -| `blue` | `#007ec6` | 🔵 | -| `grey` / `gray` | `#555` | ⬜ | -| `lightgrey` / `lightgray` | `#9f9f9f` | ⬜ | - -**Color guide:** 🟢 rich green | 🟢\* lighter/yellowish green | 🟡 yellow/olive | 🟠 orange | 🔴 red | 🔵 blue | ⬜ greys +| Color | Hex Code | Visual | +| ------------------------- | --------- | ---------------------------------------------------------------------------------------------- | +| `brightgreen` | `#4c1` | #4c1 | +| `green` | `#97CA00` | #97CA00 | +| `yellowgreen` | `#a4a61d` | #a4a61d | +| `yellow` | `#dfb317` | #dfb317 | +| `orange` | `#fe7d37` | #fe7d37 | +| `red` | `#e05d44` | #e05d44 | +| `blue` | `#007ec6` | #007ec6 | +| `grey` / `gray` | `#555` | #555 | +| `lightgrey` / `lightgray` | `#9f9f9f` | #9f9f9f | ### Special Units Formats From 45578746a10417ffefc5c24207c648c2a804fcbe Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Thu, 5 Feb 2026 16:40:41 +0200 Subject: [PATCH 11/28] docs: Remove Visual column from color table (HTML not rendering) --- docs/dashboards-and-charts/badges.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index 5ef805ffd95631..a3fc99e95adb19 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -120,17 +120,17 @@ Conditional colors based on value: ### Predefined Colors -| Color | Hex Code | Visual | -| ------------------------- | --------- | ---------------------------------------------------------------------------------------------- | -| `brightgreen` | `#4c1` | #4c1 | -| `green` | `#97CA00` | #97CA00 | -| `yellowgreen` | `#a4a61d` | #a4a61d | -| `yellow` | `#dfb317` | #dfb317 | -| `orange` | `#fe7d37` | #fe7d37 | -| `red` | `#e05d44` | #e05d44 | -| `blue` | `#007ec6` | #007ec6 | -| `grey` / `gray` | `#555` | #555 | -| `lightgrey` / `lightgray` | `#9f9f9f` | #9f9f9f | +| Color | Hex Code | +| ------------------------- | --------- | +| `brightgreen` | `#4c1` | +| `green` | `#97CA00` | +| `yellowgreen` | `#a4a61d` | +| `yellow` | `#dfb317` | +| `orange` | `#fe7d37` | +| `red` | `#e05d44` | +| `blue` | `#007ec6` | +| `grey` / `gray` | `#555` | +| `lightgrey` / `lightgray` | `#9f9f9f` | ### Special Units Formats From 4b78a5a46f50f102f2043ed45fdce4c2886ed297 Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Thu, 5 Feb 2026 17:25:27 +0200 Subject: [PATCH 12/28] docs: Fix badges documentation inaccuracies - Fix WARNING alert color from yellow to orange (matches source code) - Add REMOVED alert status (grey, occurs during shutdown/disconnect) - Fix broken documentation links to correct paths --- docs/dashboards-and-charts/badges.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index a3fc99e95adb19..d6e31de72c97df 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -200,17 +200,18 @@ When aggregating multiple data points, the `group` parameter determines how valu | `countif` | Count values matching condition | | `extremes` | Min/max for mixed sign values | -Common methods: `average`, `sum`, `min`, `max`, `median`. See [Query Reference](/docs/developer-and-contributor-corner/rest-api/Queries/README.md) for all options. +Common methods: `average`, `sum`, `min`, `max`, `median`. See [Query Reference](/src/web/api/queries/README.md) for all options. ## Alert Badges When using the `alarm` parameter, badges display alert states: - **CLEAR** - Green badge, alert is not triggered -- **WARNING** - Yellow badge, warning threshold exceeded +- **WARNING** - Orange badge, warning threshold exceeded - **CRITICAL** - Red badge, critical threshold exceeded - **UNDEFINED** - Grey badge, alert cannot be evaluated - **UNINITIALIZED** - Black badge, alert has not been initialized +- **REMOVED** - Grey badge, alert has been removed (shutdown, disconnect) Example: @@ -343,6 +344,6 @@ value_color=brightgreen<50:green<70:yellowgreen<80:yellow<90:orange<95:red ## Related Documentation - [Web Dashboard](/docs/dashboards-and-charts/README.md) -- [Alert Configuration](/docs/alerts-and-notifications/README.md) -- [API Reference](/docs/developer-and-contributor-corner/rest-api/README.md) +- [Alert Configuration](/src/health/README.md) +- [API Reference](/src/web/api/README.md) - [Access Control](/docs/netdata-agent/securing-netdata-agents.md) From facf4f4d3ff6874ddd7fccf2ab46795edece8a89 Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Thu, 5 Feb 2026 17:33:29 +0200 Subject: [PATCH 13/28] docs: Add missing content from source README to badges.md - Add URL escaping table - Add performance section (2000 badges/sec, ~0.5ms per badge) - Add JavaScript auto-refresh methods - Add GitHub limitations section - Add query options details (display_absolute, min2max, unaligned) - Add note about escaping slashes in units --- docs/dashboards-and-charts/badges.md | 87 +++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 2 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index d6e31de72c97df..4f1e83ec79eccb 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -47,7 +47,7 @@ sudo systemctl restart netdata ### Optional Parameters | Parameter | Description | Default | Example | -| -------------------- | -------------------------------------------- | --------------------------------- | ------------------------------ | +| -------------------- | -------------------------------------------- | --------------------------------- | ------------------------------ | --------- | | `alarm` | Display alert status instead of metric value | - | `system.cpu.10min_cpu_usage` | | `dimension` or `dim` | Specific dimension(s) to display | All dimensions | `user`, `system` | | `after` | Time range start (negative seconds) | `-UPDATE_EVERY` (chart-dependent) | `-600` (10 min ago) | @@ -55,7 +55,7 @@ sudo systemctl restart netdata | `points` | Number of data points to aggregate | `1` | `60` | | `group` | Aggregation method | `average` | `average`, `sum`, `max`, `min` | | `group_options` | Additional grouping options | - | `percentage` | -| `options` | Query options (percentage, abs, etc.) | - | `percentage` | +| `options` | Query options (percentage, abs, etc.) | - | `percentage | absolute` | | `label` | Left-side label text | Chart name | `CPU Usage` | | `units` | Unit suffix to display | Auto-detected | `%`, `MB`, `requests/s` | | `multiply` | Multiply value by this factor | `1` | `100` (for percentages) | @@ -148,6 +148,8 @@ When using the `units` parameter, these special formats are recognized: | `percentage` / `percent` / `pcent` | Adds `%` suffix | | `empty` / `null` | Hides units entirely | +To display a literal `/` in units, escape it with `\` (e.g., `units=requests\/s`). + ### Custom Colors Use any hex color code (without the `#`): @@ -202,6 +204,18 @@ When aggregating multiple data points, the `group` parameter determines how valu Common methods: `average`, `sum`, `min`, `max`, `median`. See [Query Reference](/src/web/api/queries/README.md) for all options. +### Query Options + +The `options` parameter accepts pipe-delimited values: + +| Option | Description | +| ------------------ | ---------------------------------------------------------- | +| `percentage` | Calculate value as percentage of dimension total | +| `absolute` / `abs` | Convert all values to positive before summing | +| `display_absolute` | Use signed value for color, display absolute | +| `min2max` | For multiple dimensions, return `max - min` instead of sum | +| `unaligned` | Skip time alignment for aggregated data | + ## Alert Badges When using the `alarm` parameter, badges display alert states: @@ -341,6 +355,75 @@ value_color=brightgreen<50:green<70:yellowgreen<80:yellow<90:orange<95:red - Limiting available charts via ACLs - Monitoring badge access logs +## URL Escaping + +When embedding badges in HTML, certain characters must be escaped: + +| Character | Description | Escape Sequence | +| --------- | ---------------------------- | --------------- | +| Space | Spaces in labels/units | `%20` | +| `#` | Hash for colors | `%23` | +| `%` | Percent in units | `%25` | +| `<` | Less than | `%3C` | +| `>` | Greater than | `%3E` | +| `\` | Backslash (for `/` in units) | `%5C` | +| `\|` | Pipe (delimit parameters) | `%7C` | + +Example with escaped spaces: + +```markdown +![CPU](http://localhost:19999/api/v1/badge.svg?chart=system.cpu&label=CPU%20Usage) +``` + +## Performance + +Netdata can generate approximately **2,000 badges per second per CPU core**, with each badge taking about 0.5ms to generate on modern hardware. + +For badges calculating aggregates over long durations (days or more), response times will increase. Check `access.log` for timing information. Consider caching such badges or using a cron job to periodically save them. + +## Auto-Refresh with JavaScript + +For pages without HTTP refresh header support, use JavaScript to auto-refresh badges: + +```html + + +``` + +Alternatively, include the Netdata refresh script: + +```html + +``` + +## GitHub Limitations + +GitHub fetches images through a proxy and rewrites URLs, preventing auto-refresh. Badges in GitHub READMEs are static. To refresh manually, run this in the browser console: + +```javascript +document.querySelectorAll("img").forEach(function (img) { + if (img.src.includes("badge.svg")) { + img.src = + img.src.replace(/\?cacheBuster=\d*/, "") + + "?cacheBuster=" + + new Date().getTime(); + } +}); +``` + ## Related Documentation - [Web Dashboard](/docs/dashboards-and-charts/README.md) From d281ae9bd96ef4c65765f17e01bf04f19ed9207f Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Thu, 5 Feb 2026 17:36:50 +0200 Subject: [PATCH 14/28] docs: Convert troubleshooting to clickdown format Convert troubleshooting section to use
/ accordion format for better UX --- docs/dashboards-and-charts/badges.md | 50 ++++++++++++++++------------ 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index 4f1e83ec79eccb..410244081f370a 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -289,36 +289,44 @@ http://netdata.local:19999/api/v1/badge.svg?chart=system.cpu&dimension=user&valu ## Troubleshooting -### Badge shows "chart not found" +
+Badge shows "chart not found" -- Verify the chart ID exists: Check the Netdata dashboard URL for the correct chart ID -- Chart IDs are case-sensitive -- Use `system.cpu` format, not `system.cpu.user` +Verify the chart ID exists: Check the Netdata dashboard URL for the correct chart ID. Chart IDs are case-sensitive. Use `system.cpu` format, not `system.cpu.user`. -### Badge shows empty value +
-- Check that the `dimension` parameter matches an actual dimension name -- Verify the time range (`after`/`before`) contains recent data -- Badge shows "-" when data is too old (staleness check) or unavailable +
+Badge shows empty value ("-") -### Access denied / Cannot view badge +Check that the `dimension` parameter matches an actual dimension name. Verify the time range (`after`/`before`) contains recent data. The badge shows "-" when data is too old (staleness check) or unavailable. -- Check `allow badges from` in `netdata.conf` -- Ensure the requesting IP is allowed -- Check firewall rules on the Netdata host +
-### Colors not working +
+Access denied / Cannot view badge -- Use predefined color names or 6-character hex codes (without `#`) -- For conditional colors, ensure the format is correct: `color -- Add `refresh=auto` or a specific interval -- Some platforms cache images; try adding a cache-busting parameter: - ``` - http://netdata.local:19999/api/v1/badge.svg?chart=system.cpu&refresh=5&t=123456 - ``` +
+Colors not working + +Use predefined color names or 6-character hex codes (without `#`). For conditional colors, ensure the format is correct: `color + +
+Badge not updating + +Add `refresh=auto` or a specific interval. Some platforms cache images; try adding a cache-busting parameter: + +``` +http://netdata.local:19999/api/v1/badge.svg?chart=system.cpu&refresh=5&t=123456 +``` + +
## Advanced Configuration From 1d47cc58dcc1f877e567f9b5b9b6c3df9089b6c3 Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Thu, 5 Feb 2026 17:42:07 +0200 Subject: [PATCH 15/28] docs: Fix table formatting issues in badges.md - Remove extra column separator from table header - Escape pipe character in options example --- docs/dashboards-and-charts/badges.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index 410244081f370a..f651ce1fe97fa1 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -47,7 +47,7 @@ sudo systemctl restart netdata ### Optional Parameters | Parameter | Description | Default | Example | -| -------------------- | -------------------------------------------- | --------------------------------- | ------------------------------ | --------- | +| -------------------- | -------------------------------------------- | --------------------------------- | ------------------------------ | | `alarm` | Display alert status instead of metric value | - | `system.cpu.10min_cpu_usage` | | `dimension` or `dim` | Specific dimension(s) to display | All dimensions | `user`, `system` | | `after` | Time range start (negative seconds) | `-UPDATE_EVERY` (chart-dependent) | `-600` (10 min ago) | @@ -55,7 +55,7 @@ sudo systemctl restart netdata | `points` | Number of data points to aggregate | `1` | `60` | | `group` | Aggregation method | `average` | `average`, `sum`, `max`, `min` | | `group_options` | Additional grouping options | - | `percentage` | -| `options` | Query options (percentage, abs, etc.) | - | `percentage | absolute` | +| `options` | Query options (percentage, abs, etc.) | - | `percentage \| absolute` | | `label` | Left-side label text | Chart name | `CPU Usage` | | `units` | Unit suffix to display | Auto-detected | `%`, `MB`, `requests/s` | | `multiply` | Multiply value by this factor | `1` | `100` (for percentages) | From 6f50ce0cf38141b662b10d6aea7ba07c4ed5fa83 Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Thu, 5 Feb 2026 17:55:09 +0200 Subject: [PATCH 16/28] docs: Fix text color default in badges.md Text color defaults are 'fff' (white), not 'grey' --- docs/dashboards-and-charts/badges.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index f651ce1fe97fa1..c949c4a86a5fd3 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -65,8 +65,8 @@ sudo systemctl restart netdata | `refresh` | Auto-refresh interval in seconds | `0` (no refresh) | `auto`, `5` | | `label_color` | Left side background color | `grey` | `blue`, `red`, `#007ec6` | | `value_color` | Right side background color | Based on value | `green`, `yellow`, `#4c1` | -| `text_color_lbl` | Left text color | `grey` (fallback) | `black`, `#fff` | -| `text_color_val` | Right text color | `grey` (fallback) | `black`, `#fff` | +| `text_color_lbl` | Left text color | `fff` (white) | `black`, `#fff` | +| `text_color_val` | Right text color | `fff` (white) | `black`, `#fff` | | `fixed_width_lbl` | Fixed width for label (pixels) | Auto | `100` | | `fixed_width_val` | Fixed width for value (pixels) | Auto | `80` | From 5993874bd7e572b705332af2bca8bdcd7133a7d0 Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Thu, 5 Feb 2026 18:07:34 +0200 Subject: [PATCH 17/28] docs: Replace color table with visual badge diagram in badges.md Replace static color table with inline badge images showing actual colors for better visual reference --- docs/dashboards-and-charts/badges.md | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index c949c4a86a5fd3..1f200b8a726b49 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -120,17 +120,19 @@ Conditional colors based on value: ### Predefined Colors -| Color | Hex Code | -| ------------------------- | --------- | -| `brightgreen` | `#4c1` | -| `green` | `#97CA00` | -| `yellowgreen` | `#a4a61d` | -| `yellow` | `#dfb317` | -| `orange` | `#fe7d37` | -| `red` | `#e05d44` | -| `blue` | `#007ec6` | -| `grey` / `gray` | `#555` | -| `lightgrey` / `lightgray` | `#9f9f9f` | +Use these color names in `label_color`, `value_color`, `text_color_lbl`, or `text_color_val`: + +[![brightgreen](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=brightgreen&units=)] +[![green](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=green&units=)] +[![yellowgreen](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=yellowgreen&units=)] +[![yellow](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=yellow&units=)] +[![orange](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=orange&units=)] +[![red](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=red&units=)] +[![blue](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=blue&units=)] +[![grey](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=grey&units=)] +[![lightgrey](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=lightgrey&units=)] + +Hex codes: `brightgreen:#4c1` · `green:#97CA00` · `yellowgreen:#a4a61d` · `yellow:#dfb317` · `orange:#fe7d37` · `red:#e05d44` · `blue:#007ec6` · `grey:#555` · `lightgrey:#9f9f9f` ### Special Units Formats From aa8118dafee96b0a38e385c552cd21e5e51e4727 Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Fri, 6 Feb 2026 10:58:00 +0200 Subject: [PATCH 18/28] docs: Fix markdown link syntax for color badge examples Remove square brackets from image links to fix invalid markdown syntax. Use plain image syntax ![]() for standalone images --- docs/dashboards-and-charts/badges.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index 1f200b8a726b49..03547b400a4632 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -122,15 +122,15 @@ Conditional colors based on value: Use these color names in `label_color`, `value_color`, `text_color_lbl`, or `text_color_val`: -[![brightgreen](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=brightgreen&units=)] -[![green](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=green&units=)] -[![yellowgreen](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=yellowgreen&units=)] -[![yellow](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=yellow&units=)] -[![orange](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=orange&units=)] -[![red](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=red&units=)] -[![blue](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=blue&units=)] -[![grey](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=grey&units=)] -[![lightgrey](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=lightgrey&units=)] +![brightgreen](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=brightgreen&units=) +![green](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=green&units=) +![yellowgreen](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=yellowgreen&units=) +![yellow](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=yellow&units=) +![orange](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=orange&units=) +![red](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=red&units=) +![blue](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=blue&units=) +![grey](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=grey&units=) +![lightgrey](https://registry.my-netdata.io/api/v1/badge.svg?chart=system.cpu&label=test&value_color=lightgrey&units=) Hex codes: `brightgreen:#4c1` · `green:#97CA00` · `yellowgreen:#a4a61d` · `yellow:#dfb317` · `orange:#fe7d37` · `red:#e05d44` · `blue:#007ec6` · `grey:#555` · `lightgrey:#9f9f9f` From d43796c224547ca574ef1ce52530c57d9bc3f7e2 Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Fri, 6 Feb 2026 11:50:55 +0200 Subject: [PATCH 19/28] docs: Fix URL encoding in network badge example URL-encode the label parameter: Net%20In instead of Net+In (plus sign breaks URLs) --- docs/dashboards-and-charts/badges.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index 03547b400a4632..7fb4499924639c 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -99,7 +99,7 @@ Display alert state: Show average network traffic over 5 minutes: ```markdown -![Network](http://localhost:19999/api/v1/badge.svg?chart=system.net&dimension=received&after=-300&group=average&label=Net+In) +![Network](http://localhost:19999/api/v1/badge.svg?chart=system.net&dimension=received&after=-300&group=average&label=Net%20In) ``` ### Color-Coded Badges From 34c44ae82babf25d4648b789077c48c20d9a03e6 Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Fri, 6 Feb 2026 17:16:47 +0200 Subject: [PATCH 20/28] docs: Address Copilot review comments - Change chart=system.ram to mem.available for universal availability - Clarify that allow badges from parameter goes under [web] section in netdata.conf --- docs/dashboards-and-charts/badges.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index 7fb4499924639c..fd47a016bcced4 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -30,6 +30,8 @@ By default, badges can be accessed from any source. To restrict access: allow badges from = 10.* 192.168.* YOUR_IP ``` +The `allow badges from` parameter goes under the `[web]` section in `netdata.conf`. + 2. Restart Netdata: ```bash @@ -270,7 +272,7 @@ Create a simple status dashboard: alt="CPU" /> RAM Date: Fri, 6 Feb 2026 17:35:13 +0200 Subject: [PATCH 21/28] docs: Address ilyam review comments - Clarify "current CPU usage" as real-time from user dimension - Remove divide parameter from Memory example (use precision instead) - Change system.load to system.cpu for Status badge example - Fix Network label (NetTraffic instead of Net In) - Update CPU Alert example to use plausible alarm name (system.cpu_usage) - Add note about alarm names being configuration-dependent Reported issues and fixes: 1. Current vs dimension clarification 2. Memory divide parameter removed 3. system.load replaced with system.cpu 4. Network label fixed 5. Alert name updated to realistic example --- docs/dashboards-and-charts/badges.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index fd47a016bcced4..ea49af9d4f4928 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -76,7 +76,7 @@ sudo systemctl restart netdata ### Basic Metric Badge -Display current CPU usage: +Display current CPU usage from the `user` dimension: ```markdown ![CPU Usage](http://localhost:19999/api/v1/badge.svg?chart=system.cpu&dimension=user) @@ -84,16 +84,16 @@ Display current CPU usage: ### Alert Status Badge -Display alert state: +Display alert state (replace with actual alarm name from your configuration): ```markdown -![CPU Alert](http://localhost:19999/api/v1/badge.svg?chart=system.cpu&alarm=system.cpu.10min_cpu_usage) +![CPU Alert](http://localhost:19999/api/v1/badge.svg?chart=system.cpu&alarm=system.cpu_usage&label=CPU+Alert) ``` ### Custom Label and Units ```markdown -![Memory](http://localhost:19999/api/v1/badge.svg?chart=mem.available&label=RAM&units=GB÷=1073741824&precision=2) +![Memory](http://localhost:19999/api/v1/badge.svg?chart=mem.available&label=RAM&precision=1) ``` ### Aggregated Values @@ -101,7 +101,7 @@ Display alert state: Show average network traffic over 5 minutes: ```markdown -![Network](http://localhost:19999/api/v1/badge.svg?chart=system.net&dimension=received&after=-300&group=average&label=Net%20In) +![Network](http://localhost:19999/api/v1/badge.svg?chart=system.net&dimension=received&after=-300&group=average&label=NetTraffic) ``` ### Color-Coded Badges @@ -109,7 +109,7 @@ Show average network traffic over 5 minutes: Static colors: ```markdown -![Status](http://localhost:19999/api/v1/badge.svg?chart=system.load&label=Load&value_color=blue) +![Status](http://localhost:19999/api/v1/badge.svg?chart=system.cpu&label=Load&value_color=blue) ``` Conditional colors based on value: From fc7431a08e5917fc000de250b74164f3706c144b Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Fri, 6 Feb 2026 17:40:37 +0200 Subject: [PATCH 22/28] docs: Address all ilyam review comments Changes: - Clarify Basic Metric Badge to explain single vs aggregated dimensions - Clarify Memory badge behavior (total without dimensions) - Explain system.load multi-dimension behavior - Improve Alert Status Badge section with better description - Add comprehensive "Notes on Chart and Alert Behavior" section - Fix all issues raised by ilyam about chart/dimension/alarm behavior --- docs/dashboards-and-charts/badges.md | 40 +++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index ea49af9d4f4928..af739f4054414d 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -76,26 +76,44 @@ sudo systemctl restart netdata ### Basic Metric Badge -Display current CPU usage from the `user` dimension: +Display CPU usage from the `user` dimension: ```markdown ![CPU Usage](http://localhost:19999/api/v1/badge.svg?chart=system.cpu&dimension=user) ``` +To display aggregated CPU (all dimensions combined): + +```markdown +![CPU Usage](http://localhost:19999/api/v1/badge.svg?chart=system.cpu) +``` + ### Alert Status Badge -Display alert state (replace with actual alarm name from your configuration): +The badge displays the alert status text (like "OK", "WARNING", "CRITICAL") with the configured color. The alarm name must match your Netdata health configuration. + +Example: ```markdown ![CPU Alert](http://localhost:19999/api/v1/badge.svg?chart=system.cpu&alarm=system.cpu_usage&label=CPU+Alert) ``` +**Note:** Alarm names vary by Netdata configuration. Check your health configuration (`/etc/netdata/health.d/*.conf`) for the exact alarm name to use. + ### Custom Label and Units +Display available memory in GB with one decimal place: + ```markdown ![Memory](http://localhost:19999/api/v1/badge.svg?chart=mem.available&label=RAM&precision=1) ``` +**Note:** The `mem.available` chart shows total available memory when no dimension is specified. To display specific memory components, check if your Netdata configuration provides dimensions like `free` or `used`: + +```markdown +![Memory Free](http://localhost:19999/api/v1/badge.svg?chart=mem.available&dimension=free&label=RAM+Free&precision=1) +``` + ### Aggregated Values Show average network traffic over 5 minutes: @@ -108,8 +126,16 @@ Show average network traffic over 5 minutes: Static colors: +Display system load average (all 3 dimensions): + ```markdown -![Status](http://localhost:19999/api/v1/badge.svg?chart=system.cpu&label=Load&value_color=blue) +![Status](http://localhost:19999/api/v1/badge.svg?chart=system.load&label=Load) +``` + +**Note:** This example shows all dimensions combined. To display specific load dimensions, use the `dimension` parameter: + +```markdown +![Status](http://localhost:19999/api/v1/badge.svg?chart=system.load&dimension=load1&label=Load+1) ``` Conditional colors based on value: @@ -436,6 +462,14 @@ document.querySelectorAll("img").forEach(function (img) { }); ``` +## Notes on Chart and Alert Behavior + +- **Chart availability varies**: Not all charts are available on all Netdata installations. Use the dashboard to verify chart IDs before using them in badges. +- **Dimension behavior**: When no dimension is specified, charts may show aggregated values (sum, average, or total) depending on the chart type. Specify individual dimensions for more granular control. +- **Alarm names are configuration-dependent**: The exact alarm names depend on your Netdata health configuration files in `/etc/netdata/health.d/`. Check your configuration to find the correct alarm name. +- **Memory charts**: The `mem.available` chart shows total available memory without dimensions. Check if your configuration provides `free` or `used` dimensions for specific memory components. +- **System load**: The `system.load` chart has multiple dimensions (load1, load5, load15). Without specifying a dimension, badges show the sum of all load averages. Use specific dimensions for individual load metrics. + ## Related Documentation - [Web Dashboard](/docs/dashboards-and-charts/README.md) From 1b5d1074d0979abb6cf01ad2330857d44200ce67 Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Fri, 6 Feb 2026 19:03:17 +0200 Subject: [PATCH 23/28] docs: Fix badges documentation based on live testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix divide parameter example (1024 for MiB→MB, not bytes→GiB) - Fix options parameter example to use %7C URL encoding - Add <> as inequality operator alongside ! - Document system.ram chart for memory dimensions - Document missing chart parameter behavior (HTTP 400) - Document invalid chart behavior (placeholder badge) - Expand troubleshooting section with resolution steps --- docs/dashboards-and-charts/badges.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index af739f4054414d..a0d8fe07b13aa6 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -57,11 +57,11 @@ sudo systemctl restart netdata | `points` | Number of data points to aggregate | `1` | `60` | | `group` | Aggregation method | `average` | `average`, `sum`, `max`, `min` | | `group_options` | Additional grouping options | - | `percentage` | -| `options` | Query options (percentage, abs, etc.) | - | `percentage \| absolute` | +| `options` | Query options (percentage, abs, etc.) | - | `percentage%7Cabsolute` | | `label` | Left-side label text | Chart name | `CPU Usage` | | `units` | Unit suffix to display | Auto-detected | `%`, `MB`, `requests/s` | | `multiply` | Multiply value by this factor | `1` | `100` (for percentages) | -| `divide` | Divide value by this factor | `1` | `1024` (bytes to KB) | +| `divide` | Divide value by this factor | `1` | `1024` (MiB to MB) | | `precision` | Decimal places (-1 for auto) | `-1` (auto) | `2` | | `scale` | Badge scale percentage | `100` | `150` | | `refresh` | Auto-refresh interval in seconds | `0` (no refresh) | `auto`, `5` | @@ -205,7 +205,7 @@ This means: Supported operators: - `:` or `=` equality (first match wins) -- `!` inequality +- `!` or `<>` inequality - `<` less than - `>` greater than - `<=` less than or equal @@ -283,7 +283,7 @@ Add to your repository README: ## Server Status ![CPU](https://your-netdata.com/api/v1/badge.svg?chart=system.cpu&dimension=user&label=CPU) -![RAM](https://your-netdata.com/api/v1/badge.svg?chart=mem.available&units=GB÷=1073741824&precision=1&label=RAM) +![RAM](https://your-netdata.com/api/v1/badge.svg?chart=mem.available&units=GB÷=1024&precision=1&label=RAM) ![Disk](https://your-netdata.com/api/v1/badge.svg?chart=disk_space._&units=%&label=Disk) ``` @@ -322,7 +322,14 @@ http://netdata.local:19999/api/v1/badge.svg?chart=system.cpu&dimension=user&valu
Badge shows "chart not found" -Verify the chart ID exists: Check the Netdata dashboard URL for the correct chart ID. Chart IDs are case-sensitive. Use `system.cpu` format, not `system.cpu.user`. +When requesting a non-existent chart, the API returns a placeholder badge displaying "chart not found" on the left side and "-" for the value. This is expected behavior—not an HTTP error. + +To resolve: + +1. Verify the chart ID exists in your Netdata dashboard +2. Chart IDs are case-sensitive—use `system.cpu`, not `system.cpu.user` +3. Check the dashboard URL for the correct chart ID format +4. List available charts: `http://YOUR_HOST:19999/api/v1/charts`
@@ -465,9 +472,11 @@ document.querySelectorAll("img").forEach(function (img) { ## Notes on Chart and Alert Behavior - **Chart availability varies**: Not all charts are available on all Netdata installations. Use the dashboard to verify chart IDs before using them in badges. +- **Missing chart parameter**: Omitting the `chart` parameter returns HTTP 400 (Bad Request)—badges require a valid chart ID. +- **Invalid chart ID**: Requesting a non-existent chart returns a placeholder badge with "chart not found" label and "-" value—this graceful degradation keeps badges visible. - **Dimension behavior**: When no dimension is specified, charts may show aggregated values (sum, average, or total) depending on the chart type. Specify individual dimensions for more granular control. - **Alarm names are configuration-dependent**: The exact alarm names depend on your Netdata health configuration files in `/etc/netdata/health.d/`. Check your configuration to find the correct alarm name. -- **Memory charts**: The `mem.available` chart shows total available memory without dimensions. Check if your configuration provides `free` or `used` dimensions for specific memory components. +- **Memory charts**: The `mem.available` chart shows total available memory without dimensions. The `system.ram` chart provides `free` and `used` dimensions for specific memory components. - **System load**: The `system.load` chart has multiple dimensions (load1, load5, load15). Without specifying a dimension, badges show the sum of all load averages. Use specific dimensions for individual load metrics. ## Related Documentation From 75670fa89e3adfc73436dc7a1ac721d2f42ef774 Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Fri, 6 Feb 2026 19:10:22 +0200 Subject: [PATCH 24/28] docs: Fix system.load badge to use specific dimension Fixes ilyam8 review comment - system.load has 3 dimensions (load1, load5, load15) and showing all 3 summed doesn't make sense. Changed to dimension=load1 for 1-min load. --- docs/dashboards-and-charts/badges.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index a0d8fe07b13aa6..b2e4550d901fba 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -302,8 +302,8 @@ Create a simple status dashboard: alt="RAM" /> Load ``` From d5b9c35cb11dbd0bee21c3bb500aa1113e5da39a Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Fri, 6 Feb 2026 19:12:55 +0200 Subject: [PATCH 25/28] docs: Fix alarm parameter description Clarifies that alarm badges show BOTH status AND value, not 'instead of'. Updates Alert Badges section to reflect this behavior. --- docs/dashboards-and-charts/badges.md | 52 ++++++++++++++-------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index b2e4550d901fba..7fc30fbc8094e7 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -48,29 +48,29 @@ sudo systemctl restart netdata ### Optional Parameters -| Parameter | Description | Default | Example | -| -------------------- | -------------------------------------------- | --------------------------------- | ------------------------------ | -| `alarm` | Display alert status instead of metric value | - | `system.cpu.10min_cpu_usage` | -| `dimension` or `dim` | Specific dimension(s) to display | All dimensions | `user`, `system` | -| `after` | Time range start (negative seconds) | `-UPDATE_EVERY` (chart-dependent) | `-600` (10 min ago) | -| `before` | Time range end (negative seconds) | `0` (now) | `0` | -| `points` | Number of data points to aggregate | `1` | `60` | -| `group` | Aggregation method | `average` | `average`, `sum`, `max`, `min` | -| `group_options` | Additional grouping options | - | `percentage` | -| `options` | Query options (percentage, abs, etc.) | - | `percentage%7Cabsolute` | -| `label` | Left-side label text | Chart name | `CPU Usage` | -| `units` | Unit suffix to display | Auto-detected | `%`, `MB`, `requests/s` | -| `multiply` | Multiply value by this factor | `1` | `100` (for percentages) | -| `divide` | Divide value by this factor | `1` | `1024` (MiB to MB) | -| `precision` | Decimal places (-1 for auto) | `-1` (auto) | `2` | -| `scale` | Badge scale percentage | `100` | `150` | -| `refresh` | Auto-refresh interval in seconds | `0` (no refresh) | `auto`, `5` | -| `label_color` | Left side background color | `grey` | `blue`, `red`, `#007ec6` | -| `value_color` | Right side background color | Based on value | `green`, `yellow`, `#4c1` | -| `text_color_lbl` | Left text color | `fff` (white) | `black`, `#fff` | -| `text_color_val` | Right text color | `fff` (white) | `black`, `#fff` | -| `fixed_width_lbl` | Fixed width for label (pixels) | Auto | `100` | -| `fixed_width_val` | Fixed width for value (pixels) | Auto | `80` | +| Parameter | Description | Default | Example | +| -------------------- | ------------------------------------------- | --------------------------------- | ------------------------------ | +| `alarm` | Display alert status (shows status + value) | - | `system.cpu.10min_cpu_usage` | +| `dimension` or `dim` | Specific dimension(s) to display | All dimensions | `user`, `system` | +| `after` | Time range start (negative seconds) | `-UPDATE_EVERY` (chart-dependent) | `-600` (10 min ago) | +| `before` | Time range end (negative seconds) | `0` (now) | `0` | +| `points` | Number of data points to aggregate | `1` | `60` | +| `group` | Aggregation method | `average` | `average`, `sum`, `max`, `min` | +| `group_options` | Additional grouping options | - | `percentage` | +| `options` | Query options (percentage, abs, etc.) | - | `percentage%7Cabsolute` | +| `label` | Left-side label text | Chart name | `CPU Usage` | +| `units` | Unit suffix to display | Auto-detected | `%`, `MB`, `requests/s` | +| `multiply` | Multiply value by this factor | `1` | `100` (for percentages) | +| `divide` | Divide value by this factor | `1` | `1024` (MiB to MB) | +| `precision` | Decimal places (-1 for auto) | `-1` (auto) | `2` | +| `scale` | Badge scale percentage | `100` | `150` | +| `refresh` | Auto-refresh interval in seconds | `0` (no refresh) | `auto`, `5` | +| `label_color` | Left side background color | `grey` | `blue`, `red`, `#007ec6` | +| `value_color` | Right side background color | Based on value | `green`, `yellow`, `#4c1` | +| `text_color_lbl` | Left text color | `fff` (white) | `black`, `#fff` | +| `text_color_val` | Right text color | `fff` (white) | `black`, `#fff` | +| `fixed_width_lbl` | Fixed width for label (pixels) | Auto | `100` | +| `fixed_width_val` | Fixed width for value (pixels) | Auto | `80` | ## Usage Examples @@ -248,7 +248,7 @@ The `options` parameter accepts pipe-delimited values: ## Alert Badges -When using the `alarm` parameter, badges display alert states: +When using the `alarm` parameter, badges display the alert status along with the current metric value. The badge color reflects the alert state: - **CLEAR** - Green badge, alert is not triggered - **WARNING** - Orange badge, warning threshold exceeded @@ -302,8 +302,8 @@ Create a simple status dashboard: alt="RAM" /> Load 1m ``` From 1c2fb14eb17f7ad863b12ce47d76b5f4d5c395ab Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Fri, 6 Feb 2026 19:15:29 +0200 Subject: [PATCH 26/28] docs: Fix remaining system.load examples to use dimension Fixes lint warnings - all system.load examples now specify dimension=load1 --- docs/dashboards-and-charts/badges.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index 7fc30fbc8094e7..9027ca24255838 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -302,7 +302,7 @@ Create a simple status dashboard: alt="RAM" /> Load From 12f35688772c1be42ecf7f5c96bf986818c5226a Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Wed, 11 Feb 2026 12:46:35 +0200 Subject: [PATCH 27/28] docs: Add missing content from source README - Add character escaping table - Add embed/iframe refresh example - Add refresh parameter usage example --- docs/dashboards-and-charts/badges.md | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index 9027ca24255838..8b6429c8e9b1e9 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -426,6 +426,24 @@ Netdata can generate approximately **2,000 badges per second per CPU core**, wit For badges calculating aggregates over long durations (days or more), response times will increase. Check `access.log` for timing information. Consider caching such badges or using a cron job to periodically save them. +## Auto-Refresh + +For pages that support HTTP refresh headers, use `refresh=auto` or `refresh=SECONDS`: + +```markdown +![CPU](http://YOUR_NETDATA:19999/api/v1/badge.svg?chart=system.cpu&refresh=auto) +``` + +For `embed` or `iframe` elements that don't support HTTP refresh headers, use JavaScript: + +```html + +``` + ## Auto-Refresh with JavaScript For pages without HTTP refresh header support, use JavaScript to auto-refresh badges: @@ -454,6 +472,20 @@ Alternatively, include the Netdata refresh script: ``` +## Character Escaping + +When embedding badges in HTML, special characters must be URL-encoded: + +| Character | Name | Escape Sequence | +| :-------: | :----------------------: | :-------------: | +| (space) | Space (in labels/units) | `%20` | +| `#` | Hash (for colors) | `%23` | +| `%` | Percent (in units) | `%25` | +| `<` | Less than | `%3C` | +| `>` | Greater than | `%3E` | +| `\` | Backslash (for `/`) | `%5C` | +| `\|` | Pipe (delimiting params) | `%7C` | + ## GitHub Limitations GitHub fetches images through a proxy and rewrites URLs, preventing auto-refresh. Badges in GitHub READMEs are static. To refresh manually, run this in the browser console: From 43672ef2abe0f1bf9059e37121b309678d82f832 Mon Sep 17 00:00:00 2001 From: kanelatechnical Date: Wed, 11 Feb 2026 12:51:52 +0200 Subject: [PATCH 28/28] docs: Fix remaining badges documentation issues - Fix CLEAR alert color: brightgreen instead of green - Remove misleading mem.available dimension example (doesn't have dimensions) - Use placeholder alarm name instead of potentially non-existent example - Remove ini code fence (netdata.conf is not INI format) --- docs/dashboards-and-charts/badges.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/dashboards-and-charts/badges.md b/docs/dashboards-and-charts/badges.md index 8b6429c8e9b1e9..cab879b2cee02d 100644 --- a/docs/dashboards-and-charts/badges.md +++ b/docs/dashboards-and-charts/badges.md @@ -25,7 +25,7 @@ By default, badges can be accessed from any source. To restrict access: 1. Edit `netdata.conf`: -```ini +``` [web] allow badges from = 10.* 192.168.* YOUR_IP ``` @@ -108,11 +108,7 @@ Display available memory in GB with one decimal place: ![Memory](http://localhost:19999/api/v1/badge.svg?chart=mem.available&label=RAM&precision=1) ``` -**Note:** The `mem.available` chart shows total available memory when no dimension is specified. To display specific memory components, check if your Netdata configuration provides dimensions like `free` or `used`: - -```markdown -![Memory Free](http://localhost:19999/api/v1/badge.svg?chart=mem.available&dimension=free&label=RAM+Free&precision=1) -``` +**Note:** The `mem.available` chart shows total available memory and does not have dimensions. To display specific memory components like `free` or `used`, use the `system.ram` chart: ### Aggregated Values @@ -250,17 +246,17 @@ The `options` parameter accepts pipe-delimited values: When using the `alarm` parameter, badges display the alert status along with the current metric value. The badge color reflects the alert state: -- **CLEAR** - Green badge, alert is not triggered +- **CLEAR** - Bright green badge, alert is not triggered - **WARNING** - Orange badge, warning threshold exceeded - **CRITICAL** - Red badge, critical threshold exceeded - **UNDEFINED** - Grey badge, alert cannot be evaluated - **UNINITIALIZED** - Black badge, alert has not been initialized - **REMOVED** - Grey badge, alert has been removed (shutdown, disconnect) -Example: +Example (replace `YOUR_ALARM_NAME` with your actual alarm name): ```markdown -![CPU Alert](http://localhost:19999/api/v1/badge.svg?chart=system.cpu&alarm=system.cpu.10min_cpu_usage&label=CPU+Alert) +![CPU Alert](http://localhost:19999/api/v1/badge.svg?chart=system.cpu&alarm=YOUR_ALARM_NAME&label=CPU+Alert) ``` ## Refresh Behavior