Skip to content

Commit b5d0429

Browse files
committed
MON-4558: enable zoneinfo node-exporter collector via config
Add optional nodeExporter.collectors.zoneinfo toggle (disabled by default). Wire --collector.zoneinfo/--no-collector.zoneinfo in updateNodeExporterArgs, extend unit/e2e tests, and add zoneinfo to telemeter collector success matcher. Update jsonnet/versions.yaml to match upstream component versions. CRD merge (config_merge.go) will be added once openshift/api#2948 merges and the vendor is updated with the NodeExporterCollectorZoneinfoConfig type.
1 parent de0f2b9 commit b5d0429

12 files changed

Lines changed: 89 additions & 4 deletions

Documentation/api.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Configuring Cluster Monitoring is optional. If the config does not exist or is e
3838
* [NodeExporterCollectorSoftirqsConfig](#nodeexportercollectorsoftirqsconfig)
3939
* [NodeExporterCollectorSystemdConfig](#nodeexportercollectorsystemdconfig)
4040
* [NodeExporterCollectorTcpStatConfig](#nodeexportercollectortcpstatconfig)
41+
* [NodeExporterCollectorZoneinfoConfig](#nodeexportercollectorzoneinfoconfig)
4142
* [NodeExporterConfig](#nodeexporterconfig)
4243
* [OpenShiftStateMetricsConfig](#openshiftstatemetricsconfig)
4344
* [PrometheusK8sConfig](#prometheusk8sconfig)
@@ -256,6 +257,7 @@ The `NodeExporterCollectorConfig` resource defines settings for individual colle
256257
| processes | [NodeExporterCollectorProcessesConfig](#nodeexportercollectorprocessesconfig) | Defines the configuration of the `processes` collector, which collects statistics from processes and threads running in the system. Disabled by default. |
257258
| systemd | [NodeExporterCollectorSystemdConfig](#nodeexportercollectorsystemdconfig) | Defines the configuration of the `systemd` collector, which collects statistics on the systemd daemon and its managed services. Disabled by default. |
258259
| softirqs | [NodeExporterCollectorSoftirqsConfig](#nodeexportercollectorsoftirqsconfig) | Defines the configuration of the `softirqs` collector, which exposes detailed softirq metrics from `/proc/softirqs`. Disabled by default. |
260+
| zoneinfo | [NodeExporterCollectorZoneinfoConfig](#nodeexportercollectorzoneinfoconfig) | Defines the configuration of the `zoneinfo` collector, which exposes detailed memory zone statistics from `/proc/zoneinfo`. Disabled by default. |
259261

260262
[Back to TOC](#table-of-contents)
261263

@@ -411,6 +413,21 @@ The `NodeExporterCollectorTcpStatConfig` resource works as an on/off switch for
411413

412414
[Back to TOC](#table-of-contents)
413415

416+
## NodeExporterCollectorZoneinfoConfig
417+
418+
#### Description
419+
420+
The `NodeExporterCollectorZoneinfoConfig` resource works as an on/off switch for the `zoneinfo` collector of the `node-exporter` agent. The `zoneinfo` collector exposes per-zone memory page counts, watermarks, and protection thresholds from `/proc/zoneinfo`. By default, the `zoneinfo` collector is disabled.
421+
422+
423+
<em>appears in: [NodeExporterCollectorConfig](#nodeexportercollectorconfig)</em>
424+
425+
| Property | Type | Description |
426+
| -------- | ---- | ----------- |
427+
| enabled | bool | A Boolean flag that enables or disables the `zoneinfo` collector. |
428+
429+
[Back to TOC](#table-of-contents)
430+
414431
## NodeExporterConfig
415432

416433
#### Description

Documentation/data-collection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ data:
670670
# owners: (@openshift/openshift-team-monitoring)
671671
#
672672
# collector:node_scrape_collector_success:avg reports the average success of optional node_exporter's collectors running in the cluster.
673-
- '{__name__="collector:node_scrape_collector_success:avg",collector=~"ethtool|cpufreq|tcpstat|netdev|netclass|buddyinfo|mountstats|ksmd|processes|systemd|softirqs"}'
673+
- '{__name__="collector:node_scrape_collector_success:avg",collector=~"ethtool|cpufreq|tcpstat|netdev|netclass|buddyinfo|mountstats|ksmd|processes|systemd|softirqs|zoneinfo"}'
674674
#
675675
# owners: (@openshift/openshift-team-monitoring)
676676
#

Documentation/openshiftdocs/index.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ The configuration file itself is always defined under the `config.yaml` key in t
5858
* link:modules/nodeexportercollectorsoftirqsconfig.adoc[NodeExporterCollectorSoftirqsConfig]
5959
* link:modules/nodeexportercollectorsystemdconfig.adoc[NodeExporterCollectorSystemdConfig]
6060
* link:modules/nodeexportercollectortcpstatconfig.adoc[NodeExporterCollectorTcpStatConfig]
61+
* link:modules/nodeexportercollectorzoneinfoconfig.adoc[NodeExporterCollectorZoneinfoConfig]
6162
* link:modules/nodeexporterconfig.adoc[NodeExporterConfig]
6263
* link:modules/openshiftstatemetricsconfig.adoc[OpenShiftStateMetricsConfig]
6364
* link:modules/prometheusk8sconfig.adoc[PrometheusK8sConfig]

Documentation/openshiftdocs/modules/nodeexportercollectorconfig.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Appears in: link:nodeexporterconfig.adoc[NodeExporterConfig]
4040

4141
|softirqs|link:nodeexportercollectorsoftirqsconfig.adoc[NodeExporterCollectorSoftirqsConfig]|Defines the configuration of the `softirqs` collector, which exposes detailed softirq metrics from `/proc/softirqs`. Disabled by default.
4242

43+
|zoneinfo|link:nodeexportercollectorzoneinfoconfig.adoc[NodeExporterCollectorZoneinfoConfig]|Defines the configuration of the `zoneinfo` collector, which exposes detailed memory zone statistics from `/proc/zoneinfo`. Disabled by default.
44+
4345
|===
4446

4547
link:../index.adoc[Back to TOC]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// DO NOT EDIT THE CONTENT IN THIS FILE. It is automatically generated from the
2+
// source code for the Cluster Monitoring Operator. Any changes made to this
3+
// file will be overwritten when the content is re-generated. If you wish to
4+
// make edits, read the docgen utility instructions in the source code for the
5+
// CMO.
6+
:_content-type: ASSEMBLY
7+
8+
== NodeExporterCollectorZoneinfoConfig
9+
10+
=== Description
11+
12+
The `NodeExporterCollectorZoneinfoConfig` resource works as an on/off switch for the `zoneinfo` collector of the `node-exporter` agent. The `zoneinfo` collector exposes per-zone memory page counts, watermarks, and protection thresholds from `/proc/zoneinfo`. By default, the `zoneinfo` collector is disabled.
13+
14+
15+
16+
Appears in: link:nodeexportercollectorconfig.adoc[NodeExporterCollectorConfig]
17+
18+
[options="header"]
19+
|===
20+
| Property | Type | Description
21+
|enabled|bool|A Boolean flag that enables or disables the `zoneinfo` collector.
22+
23+
|===
24+
25+
link:../index.adoc[Back to TOC]

Documentation/sample-metrics.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

Documentation/telemetry/telemeter_query

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

manifests/0000_50_cluster-monitoring-operator_04-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ data:
662662
# owners: (@openshift/openshift-team-monitoring)
663663
#
664664
# collector:node_scrape_collector_success:avg reports the average success of optional node_exporter's collectors running in the cluster.
665-
- '{__name__="collector:node_scrape_collector_success:avg",collector=~"ethtool|cpufreq|tcpstat|netdev|netclass|buddyinfo|mountstats|ksmd|processes|systemd|softirqs"}'
665+
- '{__name__="collector:node_scrape_collector_success:avg",collector=~"ethtool|cpufreq|tcpstat|netdev|netclass|buddyinfo|mountstats|ksmd|processes|systemd|softirqs|zoneinfo"}'
666666
#
667667
# owners: (@openshift/openshift-team-monitoring)
668668
#

pkg/manifests/manifests.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,12 @@ func (f *Factory) updateNodeExporterArgs(args []string) ([]string, error) {
976976
args = setArg(args, "--no-collector.softirqs", "")
977977
}
978978

979+
if f.config.ClusterMonitoringConfiguration.NodeExporterConfig.Collectors.Zoneinfo.Enabled {
980+
args = setArg(args, "--collector.zoneinfo", "")
981+
} else {
982+
args = setArg(args, "--no-collector.zoneinfo", "")
983+
}
984+
979985
if f.config.ClusterMonitoringConfiguration.NodeExporterConfig.Collectors.BuddyInfo.Enabled {
980986
args = setArg(args, "--collector.buddyinfo", "")
981987
} else {

pkg/manifests/manifests_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3412,6 +3412,7 @@ func TestNodeExporterCollectorSettings(t *testing.T) {
34123412
"--no-collector.tcpstat",
34133413
"--no-collector.ethtool",
34143414
"--no-collector.softirqs",
3415+
"--no-collector.zoneinfo",
34153416
"--collector.netdev",
34163417
"--collector.netclass",
34173418
"--collector.netclass.netlink",
@@ -3426,6 +3427,7 @@ func TestNodeExporterCollectorSettings(t *testing.T) {
34263427
"--collector.tcpstat",
34273428
"--collector.ethtool",
34283429
"--collector.softirqs",
3430+
"--collector.zoneinfo",
34293431
"--no-collector.netdev",
34303432
"--no-collector.netclass",
34313433
"--collector.buddyinfo",
@@ -3490,6 +3492,17 @@ nodeExporter:
34903492
argsPresent: []string{"--collector.softirqs"},
34913493
argsAbsent: []string{"--no-collector.softirqs"},
34923494
},
3495+
{
3496+
name: "enable zoneinfo collector",
3497+
config: `
3498+
nodeExporter:
3499+
collectors:
3500+
zoneinfo:
3501+
enabled: true
3502+
`,
3503+
argsPresent: []string{"--collector.zoneinfo"},
3504+
argsAbsent: []string{"--no-collector.zoneinfo"},
3505+
},
34933506
{
34943507
name: "disable netdev collector",
34953508
config: `

0 commit comments

Comments
 (0)