-
Notifications
You must be signed in to change notification settings - Fork 796
MON-4608: add interrupts to NodeExporterCollectorConfig CRD types #2955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -466,6 +466,16 @@ type NodeExporterCollectorConfig struct { | |
| // Enable when you need visibility into kernel softirq processing across CPUs. | ||
| // +optional | ||
| Softirqs NodeExporterCollectorSoftirqsConfig `json:"softirqs,omitempty,omitzero"` | ||
| // interrupts configures the interrupts collector, which exposes interrupt counts | ||
| // from /proc/interrupts. | ||
| // interrupts is optional. | ||
| // When omitted, this means no opinion and the platform is left to choose a reasonable default, | ||
| // which is subject to change over time. The current default is disabled. | ||
| // The interrupts collector can produce a large number of metrics depending on the hardware | ||
| // and interrupt sources present. When enabled, use the collect.include list to filter | ||
| // which interrupt lines are collected. | ||
| // +optional | ||
| Interrupts NodeExporterCollectorInterruptsConfig `json:"interrupts,omitempty,omitzero"` | ||
| } | ||
|
|
||
| // NodeExporterCollectorCpufreqConfig provides configuration for the cpufreq collector | ||
|
|
@@ -689,6 +699,65 @@ type NodeExporterCollectorSoftirqsConfig struct { | |
| CollectionPolicy NodeExporterCollectorCollectionPolicy `json:"collectionPolicy,omitempty"` | ||
| } | ||
|
|
||
| // NodeExporterCollectorInterruptsConfig provides configuration for the interrupts collector | ||
| // of the node-exporter agent. The interrupts collector exposes interrupt counts | ||
| // from /proc/interrupts. | ||
| // It is disabled by default. | ||
| // The interrupts collector can produce a large number of metrics depending on the hardware | ||
| // and interrupt sources present. When enabled, use the collect.include list to filter | ||
| // which interrupt lines are collected. | ||
| // When collectionPolicy is DoNotCollect, the collect field must not be set. | ||
| // +kubebuilder:validation:XValidation:rule="has(self.collectionPolicy) && self.collectionPolicy == 'Collect' ? true : !has(self.collect)",message="collect is forbidden when collectionPolicy is not Collect" | ||
| // +union | ||
| type NodeExporterCollectorInterruptsConfig struct { | ||
| // collectionPolicy declares whether the interrupts collector collects metrics. | ||
| // This field is required. | ||
| // Valid values are "Collect" and "DoNotCollect". | ||
| // When set to "Collect", the interrupts collector is active and interrupt statistics are collected. | ||
| // When set to "DoNotCollect", the interrupts collector is inactive and the collect field must not be set. | ||
| // +unionDiscriminator | ||
| // +required | ||
| CollectionPolicy NodeExporterCollectorCollectionPolicy `json:"collectionPolicy,omitempty"` | ||
| // collect contains configuration options that apply only when the interrupts collector is actively collecting metrics | ||
| // (i.e. when collectionPolicy is Collect). | ||
| // collect is optional and may be omitted even when collectionPolicy is Collect. | ||
| // collect may only be set when collectionPolicy is Collect. | ||
| // When set, at least one field must be specified within collect. | ||
| // +unionMember | ||
| // +optional | ||
| Collect NodeExporterCollectorInterruptsCollectConfig `json:"collect,omitzero,omitempty"` | ||
| } | ||
|
|
||
| // NodeExporterCollectorInterruptsCollectConfig holds configuration options for the interrupts collector | ||
| // when it is actively collecting metrics. At least one field must be specified. | ||
| // +kubebuilder:validation:MinProperties=1 | ||
| type NodeExporterCollectorInterruptsCollectConfig struct { | ||
| // include is a list of regular expression patterns that select which interrupt lines to collect. | ||
| // include is optional. | ||
| // Each line in /proc/interrupts is matched against the same string node-exporter uses: | ||
| // the IRQ name, info, and devices fields joined with ";", for example "LOC;77;IO-APIC 2-edge ...". | ||
| // Patterns are combined with OR into a single expression anchored on both ends, | ||
| // so each pattern must match the entire string (use ".*" where needed). | ||
| // An empty list or omitting include collects all interrupt lines. | ||
| // Each entry must be at least 1 character and at most 1024 characters. | ||
| // Maximum length for this list is 50. | ||
| // Minimum length for this list is 1. | ||
| // Entries in this list must be unique. | ||
| // +kubebuilder:validation:MaxItems=50 | ||
| // +kubebuilder:validation:MinItems=1 | ||
| // +listType=set | ||
| // +optional | ||
| Include []NodeExporterInterruptsIncludePattern `json:"include,omitempty"` | ||
|
Comment on lines
+741
to
+750
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Allow the documented empty Line 741 says an empty list collects all interrupt lines, but
📍 Affects 2 files
🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| // NodeExporterInterruptsIncludePattern is a string that is interpreted as a Go regular expression | ||
| // pattern by the controller to match interrupt line names. | ||
| // Invalid regular expressions will cause a controller-level error at runtime. | ||
| // Must be at least 1 character and at most 1024 characters. | ||
| // +kubebuilder:validation:MinLength=1 | ||
| // +kubebuilder:validation:MaxLength=1024 | ||
| type NodeExporterInterruptsIncludePattern string | ||
|
|
||
| // MonitoringPluginConfig provides configuration options for the monitoring plugin | ||
| // that runs as a dynamic plugin of the OpenShift web console. | ||
| // The monitoring plugin provides the monitoring UI in the OpenShift web console | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. collect omits omit behavior
📜 Skill insight✧ QualityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools