From 595800ad258d1a962cb1c6d10d623ea0a1d34895 Mon Sep 17 00:00:00 2001 From: Mihai IDU Date: Sun, 26 Jul 2026 13:10:15 +0200 Subject: [PATCH] MON-4608: add interrupts to NodeExporterCollectorConfig CRD types --- .../ClusterMonitoringConfig.yaml | 4 +- config/v1alpha1/types_cluster_monitoring.go | 77 +++++++++++++++- ...ig-operator_01_clustermonitorings.crd.yaml | 80 ++++++++++++++++- config/v1alpha1/zz_generated.deepcopy.go | 39 +++++++++ .../ClusterMonitoringConfig.yaml | 80 ++++++++++++++++- config/v1alpha1/zz_generated.model_name.go | 10 +++ .../zz_generated.swagger_doc_generated.go | 20 +++++ .../generated_openapi/zz_generated.openapi.go | 87 ++++++++++++++++++- openapi/openapi.json | 50 +++++++++++ ...ig-operator_01_clustermonitorings.crd.yaml | 80 ++++++++++++++++- 10 files changed, 510 insertions(+), 17 deletions(-) diff --git a/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml b/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml index 59f2e353175..34c7440ccc9 100644 --- a/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml +++ b/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml @@ -2165,7 +2165,7 @@ tests: collectionPolicy: DoNotCollect collect: statsGatherer: Netlink - expectedError: 'collect is forbidden when collectionPolicy is not Collect' + expectedError: 'collect may be set when collectionPolicy is Collect, and forbidden otherwise' - name: Should accept netClass DoNotCollect without collect initial: | apiVersion: config.openshift.io/v1alpha1 @@ -2195,7 +2195,7 @@ tests: collect: units: - "kubelet.service" - expectedError: 'collect is forbidden when collectionPolicy is not Collect' + expectedError: 'collect may be set when collectionPolicy is Collect, and forbidden otherwise' - name: Should accept systemd DoNotCollect without collect initial: | apiVersion: config.openshift.io/v1alpha1 diff --git a/config/v1alpha1/types_cluster_monitoring.go b/config/v1alpha1/types_cluster_monitoring.go index fa71f3377b1..a7b25837dcf 100644 --- a/config/v1alpha1/types_cluster_monitoring.go +++ b/config/v1alpha1/types_cluster_monitoring.go @@ -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"` +} + +// 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:XValidation:rule="self.matches('^[\\\\x20-\\\\x7E]+$')",message="must contain only printable ASCII characters (no control characters)" +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 diff --git a/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml b/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml index e2200e9054f..dbac6259880 100644 --- a/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml +++ b/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml @@ -2206,6 +2206,78 @@ spec: required: - collectionPolicy type: object + interrupts: + description: |- + 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. + properties: + collect: + description: |- + 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. + minProperties: 1 + properties: + include: + description: |- + 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. + items: + description: |- + 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). + maxLength: 1024 + minLength: 1 + type: string + x-kubernetes-validations: + - message: must contain only printable ASCII characters + (no control characters) + rule: self.matches('^[\\x20-\\x7E]+$') + maxItems: 50 + minItems: 1 + type: array + x-kubernetes-list-type: set + type: object + collectionPolicy: + description: |- + 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. + enum: + - Collect + - DoNotCollect + type: string + required: + - collectionPolicy + type: object + x-kubernetes-validations: + - message: collect may be set when collectionPolicy is Collect, + and forbidden otherwise + rule: 'has(self.collectionPolicy) && self.collectionPolicy + == ''Collect'' ? true : !has(self.collect)' ksmd: description: |- ksmd configures the ksmd collector, which collects statistics from the kernel same-page @@ -2300,8 +2372,8 @@ spec: - collectionPolicy type: object x-kubernetes-validations: - - message: collect is forbidden when collectionPolicy is not - Collect + - message: collect may be set when collectionPolicy is Collect, + and forbidden otherwise rule: 'has(self.collectionPolicy) && self.collectionPolicy == ''Collect'' ? true : !has(self.collect)' netDev: @@ -2432,8 +2504,8 @@ spec: - collectionPolicy type: object x-kubernetes-validations: - - message: collect is forbidden when collectionPolicy is not - Collect + - message: collect may be set when collectionPolicy is Collect, + and forbidden otherwise rule: 'has(self.collectionPolicy) && self.collectionPolicy == ''Collect'' ? true : !has(self.collect)' tcpStat: diff --git a/config/v1alpha1/zz_generated.deepcopy.go b/config/v1alpha1/zz_generated.deepcopy.go index 0815e022602..7b8f10ff9cd 100644 --- a/config/v1alpha1/zz_generated.deepcopy.go +++ b/config/v1alpha1/zz_generated.deepcopy.go @@ -1026,6 +1026,7 @@ func (in *NodeExporterCollectorConfig) DeepCopyInto(out *NodeExporterCollectorCo out.Softirqs = in.Softirqs out.DeviceMapperMultipath = in.DeviceMapperMultipath out.Zoneinfo = in.Zoneinfo + in.Interrupts.DeepCopyInto(&out.Interrupts) return } @@ -1087,6 +1088,44 @@ func (in *NodeExporterCollectorEthtoolConfig) DeepCopy() *NodeExporterCollectorE return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeExporterCollectorInterruptsCollectConfig) DeepCopyInto(out *NodeExporterCollectorInterruptsCollectConfig) { + *out = *in + if in.Include != nil { + in, out := &in.Include, &out.Include + *out = make([]NodeExporterInterruptsIncludePattern, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeExporterCollectorInterruptsCollectConfig. +func (in *NodeExporterCollectorInterruptsCollectConfig) DeepCopy() *NodeExporterCollectorInterruptsCollectConfig { + if in == nil { + return nil + } + out := new(NodeExporterCollectorInterruptsCollectConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeExporterCollectorInterruptsConfig) DeepCopyInto(out *NodeExporterCollectorInterruptsConfig) { + *out = *in + in.Collect.DeepCopyInto(&out.Collect) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeExporterCollectorInterruptsConfig. +func (in *NodeExporterCollectorInterruptsConfig) DeepCopy() *NodeExporterCollectorInterruptsConfig { + if in == nil { + return nil + } + out := new(NodeExporterCollectorInterruptsConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeExporterCollectorKSMDConfig) DeepCopyInto(out *NodeExporterCollectorKSMDConfig) { *out = *in diff --git a/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml b/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml index 2ea0ebcef33..11e487e7cc2 100644 --- a/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml +++ b/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml @@ -2206,6 +2206,78 @@ spec: required: - collectionPolicy type: object + interrupts: + description: |- + 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. + properties: + collect: + description: |- + 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. + minProperties: 1 + properties: + include: + description: |- + 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. + items: + description: |- + 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). + maxLength: 1024 + minLength: 1 + type: string + x-kubernetes-validations: + - message: must contain only printable ASCII characters + (no control characters) + rule: self.matches('^[\\x20-\\x7E]+$') + maxItems: 50 + minItems: 1 + type: array + x-kubernetes-list-type: set + type: object + collectionPolicy: + description: |- + 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. + enum: + - Collect + - DoNotCollect + type: string + required: + - collectionPolicy + type: object + x-kubernetes-validations: + - message: collect may be set when collectionPolicy is Collect, + and forbidden otherwise + rule: 'has(self.collectionPolicy) && self.collectionPolicy + == ''Collect'' ? true : !has(self.collect)' ksmd: description: |- ksmd configures the ksmd collector, which collects statistics from the kernel same-page @@ -2300,8 +2372,8 @@ spec: - collectionPolicy type: object x-kubernetes-validations: - - message: collect is forbidden when collectionPolicy is not - Collect + - message: collect may be set when collectionPolicy is Collect, + and forbidden otherwise rule: 'has(self.collectionPolicy) && self.collectionPolicy == ''Collect'' ? true : !has(self.collect)' netDev: @@ -2432,8 +2504,8 @@ spec: - collectionPolicy type: object x-kubernetes-validations: - - message: collect is forbidden when collectionPolicy is not - Collect + - message: collect may be set when collectionPolicy is Collect, + and forbidden otherwise rule: 'has(self.collectionPolicy) && self.collectionPolicy == ''Collect'' ? true : !has(self.collect)' tcpStat: diff --git a/config/v1alpha1/zz_generated.model_name.go b/config/v1alpha1/zz_generated.model_name.go index 56960781c5a..8e068df67e8 100644 --- a/config/v1alpha1/zz_generated.model_name.go +++ b/config/v1alpha1/zz_generated.model_name.go @@ -240,6 +240,16 @@ func (in NodeExporterCollectorEthtoolConfig) OpenAPIModelName() string { return "com.github.openshift.api.config.v1alpha1.NodeExporterCollectorEthtoolConfig" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeExporterCollectorInterruptsCollectConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1alpha1.NodeExporterCollectorInterruptsCollectConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeExporterCollectorInterruptsConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1alpha1.NodeExporterCollectorInterruptsConfig" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in NodeExporterCollectorKSMDConfig) OpenAPIModelName() string { return "com.github.openshift.api.config.v1alpha1.NodeExporterCollectorKSMDConfig" diff --git a/config/v1alpha1/zz_generated.swagger_doc_generated.go b/config/v1alpha1/zz_generated.swagger_doc_generated.go index 3aa0ebaf1f8..b9201729642 100644 --- a/config/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/config/v1alpha1/zz_generated.swagger_doc_generated.go @@ -358,6 +358,7 @@ var map_NodeExporterCollectorConfig = map[string]string{ "softirqs": "softirqs configures the softirqs collector, which exposes detailed softirq statistics from /proc/softirqs. softirqs 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. Enable when you need visibility into kernel softirq processing across CPUs.", "deviceMapperMultipath": "deviceMapperMultipath configures the dmmultipath collector, which collects statistics about DM-Multipath devices. deviceMapperMultipath 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 enabled.", "zoneinfo": "zoneinfo configures the zoneinfo collector, which exposes per-zone memory page counts, watermarks, and protection thresholds from /proc/zoneinfo. zoneinfo 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 to not collect zoneinfo metrics. Enable when you need visibility into kernel memory zone allocation and pressure.", + "interrupts": "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.", } func (NodeExporterCollectorConfig) SwaggerDoc() map[string]string { @@ -391,6 +392,25 @@ func (NodeExporterCollectorEthtoolConfig) SwaggerDoc() map[string]string { return map_NodeExporterCollectorEthtoolConfig } +var map_NodeExporterCollectorInterruptsCollectConfig = map[string]string{ + "": "NodeExporterCollectorInterruptsCollectConfig holds configuration options for the interrupts collector when it is actively collecting metrics. At least one field must be specified.", + "include": "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.", +} + +func (NodeExporterCollectorInterruptsCollectConfig) SwaggerDoc() map[string]string { + return map_NodeExporterCollectorInterruptsCollectConfig +} + +var map_NodeExporterCollectorInterruptsConfig = map[string]string{ + "": "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.", + "collectionPolicy": "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.", + "collect": "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.", +} + +func (NodeExporterCollectorInterruptsConfig) SwaggerDoc() map[string]string { + return map_NodeExporterCollectorInterruptsConfig +} + var map_NodeExporterCollectorKSMDConfig = map[string]string{ "": "NodeExporterCollectorKSMDConfig provides configuration for the ksmd collector of the node-exporter agent. The ksmd collector collects statistics from the kernel same-page merger daemon. It is disabled by default.", "collectionPolicy": "collectionPolicy declares whether the ksmd collector collects metrics. This field is required. Valid values are \"Collect\" and \"DoNotCollect\". When set to \"Collect\", the ksmd collector is active and kernel same-page merger statistics are collected. When set to \"DoNotCollect\", the ksmd collector is inactive.", diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 20de1043c5c..6f9a2188227 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -561,6 +561,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA configv1alpha1.NodeExporterCollectorCpufreqConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterCollectorCpufreqConfig(ref), configv1alpha1.NodeExporterCollectorDeviceMapperMultipathConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterCollectorDeviceMapperMultipathConfig(ref), configv1alpha1.NodeExporterCollectorEthtoolConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterCollectorEthtoolConfig(ref), + configv1alpha1.NodeExporterCollectorInterruptsCollectConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterCollectorInterruptsCollectConfig(ref), + configv1alpha1.NodeExporterCollectorInterruptsConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterCollectorInterruptsConfig(ref), configv1alpha1.NodeExporterCollectorKSMDConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterCollectorKSMDConfig(ref), configv1alpha1.NodeExporterCollectorMountStatsConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterCollectorMountStatsConfig(ref), configv1alpha1.NodeExporterCollectorNetClassCollectConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterCollectorNetClassCollectConfig(ref), @@ -25265,11 +25267,18 @@ func schema_openshift_api_config_v1alpha1_NodeExporterCollectorConfig(ref common Ref: ref(configv1alpha1.NodeExporterCollectorZoneinfoConfig{}.OpenAPIModelName()), }, }, + "interrupts": { + SchemaProps: spec.SchemaProps{ + Description: "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.", + Default: map[string]interface{}{}, + Ref: ref(configv1alpha1.NodeExporterCollectorInterruptsConfig{}.OpenAPIModelName()), + }, + }, }, }, }, Dependencies: []string{ - configv1alpha1.NodeExporterCollectorBuddyInfoConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorCpufreqConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorDeviceMapperMultipathConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorEthtoolConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorKSMDConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorMountStatsConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorNetClassConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorNetDevConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorProcessesConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorSoftirqsConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorSystemdConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorTcpStatConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorZoneinfoConfig{}.OpenAPIModelName()}, + configv1alpha1.NodeExporterCollectorBuddyInfoConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorCpufreqConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorDeviceMapperMultipathConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorEthtoolConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorInterruptsConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorKSMDConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorMountStatsConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorNetClassConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorNetDevConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorProcessesConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorSoftirqsConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorSystemdConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorTcpStatConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorZoneinfoConfig{}.OpenAPIModelName()}, } } @@ -25339,6 +25348,82 @@ func schema_openshift_api_config_v1alpha1_NodeExporterCollectorEthtoolConfig(ref } } +func schema_openshift_api_config_v1alpha1_NodeExporterCollectorInterruptsCollectConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeExporterCollectorInterruptsCollectConfig holds configuration options for the interrupts collector when it is actively collecting metrics. At least one field must be specified.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "include": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "set", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "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.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func schema_openshift_api_config_v1alpha1_NodeExporterCollectorInterruptsConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "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.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "collectionPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "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.\n\nPossible enum values:\n - `\"Collect\"` means the collector is active and will produce metrics.\n - `\"DoNotCollect\"` means the collector is inactive and will not produce metrics.", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"Collect", "DoNotCollect"}, + }, + }, + "collect": { + SchemaProps: spec.SchemaProps{ + Description: "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.", + Default: map[string]interface{}{}, + Ref: ref(configv1alpha1.NodeExporterCollectorInterruptsCollectConfig{}.OpenAPIModelName()), + }, + }, + }, + Required: []string{"collectionPolicy"}, + }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-unions": []interface{}{ + map[string]interface{}{ + "discriminator": "collectionPolicy", + "fields-to-discriminateBy": map[string]interface{}{ + "collect": "Collect", + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + configv1alpha1.NodeExporterCollectorInterruptsCollectConfig{}.OpenAPIModelName()}, + } +} + func schema_openshift_api_config_v1alpha1_NodeExporterCollectorKSMDConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/openapi/openapi.json b/openapi/openapi.json index c6a8928592f..e6b193f1d8f 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -13762,6 +13762,11 @@ "default": {}, "$ref": "#/definitions/com.github.openshift.api.config.v1alpha1.NodeExporterCollectorEthtoolConfig" }, + "interrupts": { + "description": "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.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.config.v1alpha1.NodeExporterCollectorInterruptsConfig" + }, "ksmd": { "description": "ksmd configures the ksmd collector, which collects statistics from the kernel same-page merger daemon. ksmd 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. Enable on nodes where KSM is in use and you want visibility into merging activity.", "default": {}, @@ -13860,6 +13865,51 @@ } } }, + "com.github.openshift.api.config.v1alpha1.NodeExporterCollectorInterruptsCollectConfig": { + "description": "NodeExporterCollectorInterruptsCollectConfig holds configuration options for the interrupts collector when it is actively collecting metrics. At least one field must be specified.", + "type": "object", + "properties": { + "include": { + "description": "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.", + "type": "array", + "items": { + "type": "string", + "default": "" + }, + "x-kubernetes-list-type": "set" + } + } + }, + "com.github.openshift.api.config.v1alpha1.NodeExporterCollectorInterruptsConfig": { + "description": "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.", + "type": "object", + "required": [ + "collectionPolicy" + ], + "properties": { + "collect": { + "description": "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.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.config.v1alpha1.NodeExporterCollectorInterruptsCollectConfig" + }, + "collectionPolicy": { + "description": "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.\n\nPossible enum values:\n - `\"Collect\"` means the collector is active and will produce metrics.\n - `\"DoNotCollect\"` means the collector is inactive and will not produce metrics.", + "type": "string", + "enum": [ + "Collect", + "DoNotCollect" + ] + } + }, + "x-kubernetes-unions": [ + { + "discriminator": "collectionPolicy", + "fields-to-discriminateBy": { + "collect": "Collect" + } + } + ] + }, "com.github.openshift.api.config.v1alpha1.NodeExporterCollectorKSMDConfig": { "description": "NodeExporterCollectorKSMDConfig provides configuration for the ksmd collector of the node-exporter agent. The ksmd collector collects statistics from the kernel same-page merger daemon. It is disabled by default.", "type": "object", diff --git a/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml b/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml index e2200e9054f..dbac6259880 100644 --- a/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml +++ b/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml @@ -2206,6 +2206,78 @@ spec: required: - collectionPolicy type: object + interrupts: + description: |- + 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. + properties: + collect: + description: |- + 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. + minProperties: 1 + properties: + include: + description: |- + 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. + items: + description: |- + 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). + maxLength: 1024 + minLength: 1 + type: string + x-kubernetes-validations: + - message: must contain only printable ASCII characters + (no control characters) + rule: self.matches('^[\\x20-\\x7E]+$') + maxItems: 50 + minItems: 1 + type: array + x-kubernetes-list-type: set + type: object + collectionPolicy: + description: |- + 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. + enum: + - Collect + - DoNotCollect + type: string + required: + - collectionPolicy + type: object + x-kubernetes-validations: + - message: collect may be set when collectionPolicy is Collect, + and forbidden otherwise + rule: 'has(self.collectionPolicy) && self.collectionPolicy + == ''Collect'' ? true : !has(self.collect)' ksmd: description: |- ksmd configures the ksmd collector, which collects statistics from the kernel same-page @@ -2300,8 +2372,8 @@ spec: - collectionPolicy type: object x-kubernetes-validations: - - message: collect is forbidden when collectionPolicy is not - Collect + - message: collect may be set when collectionPolicy is Collect, + and forbidden otherwise rule: 'has(self.collectionPolicy) && self.collectionPolicy == ''Collect'' ? true : !has(self.collect)' netDev: @@ -2432,8 +2504,8 @@ spec: - collectionPolicy type: object x-kubernetes-validations: - - message: collect is forbidden when collectionPolicy is not - Collect + - message: collect may be set when collectionPolicy is Collect, + and forbidden otherwise rule: 'has(self.collectionPolicy) && self.collectionPolicy == ''Collect'' ? true : !has(self.collect)' tcpStat: