-
Notifications
You must be signed in to change notification settings - Fork 819
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 |
|---|---|---|
|
|
@@ -481,6 +481,16 @@ type NodeExporterCollectorConfig struct { | |
| // Enable when you need visibility into kernel memory zone allocation and pressure. | ||
| // +optional | ||
| Zoneinfo NodeExporterCollectorZoneinfoConfig `json:"zoneinfo,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 | ||
|
|
@@ -541,7 +551,7 @@ type NodeExporterCollectorNetDevConfig struct { | |
| // such as network speed, MTU, and carrier status. | ||
| // It is enabled by default. | ||
| // 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" | ||
| // +kubebuilder:validation:XValidation:rule="has(self.collectionPolicy) && self.collectionPolicy == 'Collect' ? true : !has(self.collect)",message="collect may be set when collectionPolicy is Collect, and forbidden otherwise" | ||
| // +union | ||
| type NodeExporterCollectorNetClassConfig struct { | ||
| // collectionPolicy declares whether the netclass collector collects metrics. | ||
|
|
@@ -642,7 +652,7 @@ type NodeExporterCollectorProcessesConfig struct { | |
| // cardinality. If you enable this collector, closely monitor the prometheus-k8s deployment | ||
| // for excessive memory usage. | ||
| // 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" | ||
| // +kubebuilder:validation:XValidation:rule="has(self.collectionPolicy) && self.collectionPolicy == 'Collect' ? true : !has(self.collect)",message="collect may be set when collectionPolicy is Collect, and forbidden otherwise" | ||
| // +union | ||
| type NodeExporterCollectorSystemdConfig struct { | ||
| // collectionPolicy declares whether the systemd collector collects metrics. | ||
|
|
@@ -732,6 +742,69 @@ type NodeExporterCollectorZoneinfoConfig 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 may be set when collectionPolicy is Collect, and forbidden otherwise" | ||
| // +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. | ||
| // When omitted and collectionPolicy is Collect, all interrupt lines are collected without filtering. | ||
| // 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"` | ||
|
qodo-for-rh-openshift[bot] marked this conversation as resolved.
|
||
| } | ||
|
|
||
| // 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). | ||
| // 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"` | ||
| } | ||
|
|
||
| // 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. | ||
| // Must contain only printable ASCII characters (no control characters). | ||
| // +kubebuilder:validation:MinLength=1 | ||
| // +kubebuilder:validation:MaxLength=1024 | ||
| // +kubebuilder:validation:Pattern=`^[\x20-\x7E]+$` | ||
|
Contributor
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. Something I had missed but the linter caught - this should be a CEL validation as it allows us to return a more user-friendly error message as opposed to returning the raw regular expression used for validation. Please do this. |
||
| type NodeExporterInterruptsIncludePattern string | ||
|
everettraven marked this conversation as resolved.
|
||
|
|
||
| // 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.
Uh oh!
There was an error while loading. Please reload this page.