From 956a05c8448cf57048bae9656cf4083c0b68868e 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 --- config/v1alpha1/types_cluster_monitoring.go | 69 +++++++++++++++ ...ig-operator_01_clustermonitorings.crd.yaml | 66 ++++++++++++++ config/v1alpha1/zz_generated.deepcopy.go | 39 +++++++++ .../ClusterMonitoringConfig.yaml | 66 ++++++++++++++ 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 | 66 ++++++++++++++ 9 files changed, 472 insertions(+), 1 deletion(-) diff --git a/config/v1alpha1/types_cluster_monitoring.go b/config/v1alpha1/types_cluster_monitoring.go index d4846fd1cdb..7ebc1230eed 100644 --- a/config/v1alpha1/types_cluster_monitoring.go +++ b/config/v1alpha1/types_cluster_monitoring.go @@ -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"` +} + +// 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 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 bb427426d04..fc339da33bc 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 @@ -2184,6 +2184,72 @@ 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. + 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). + 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. + 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. + maxLength: 1024 + minLength: 1 + type: string + 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 is forbidden when collectionPolicy is not + Collect + 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 diff --git a/config/v1alpha1/zz_generated.deepcopy.go b/config/v1alpha1/zz_generated.deepcopy.go index 12dd0cd3127..b21d4aadc21 100644 --- a/config/v1alpha1/zz_generated.deepcopy.go +++ b/config/v1alpha1/zz_generated.deepcopy.go @@ -1024,6 +1024,7 @@ func (in *NodeExporterCollectorConfig) DeepCopyInto(out *NodeExporterCollectorCo out.Processes = in.Processes in.Systemd.DeepCopyInto(&out.Systemd) out.Softirqs = in.Softirqs + in.Interrupts.DeepCopyInto(&out.Interrupts) return } @@ -1069,6 +1070,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 af278ae490c..cbe669aab0d 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 @@ -2184,6 +2184,72 @@ 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. + 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). + 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. + 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. + maxLength: 1024 + minLength: 1 + type: string + 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 is forbidden when collectionPolicy is not + Collect + 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 diff --git a/config/v1alpha1/zz_generated.model_name.go b/config/v1alpha1/zz_generated.model_name.go index 36a7803bf2f..16de36412b0 100644 --- a/config/v1alpha1/zz_generated.model_name.go +++ b/config/v1alpha1/zz_generated.model_name.go @@ -235,6 +235,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 8f6cda1915a..79e11709369 100644 --- a/config/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/config/v1alpha1/zz_generated.swagger_doc_generated.go @@ -356,6 +356,7 @@ var map_NodeExporterCollectorConfig = map[string]string{ "processes": "processes configures the processes collector, which collects statistics from processes and threads running in the system. processes 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 for process/thread-level insight; can be expensive on busy nodes.", "systemd": "systemd configures the systemd collector, which collects statistics on the systemd daemon and its managed services. systemd 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. Enabling this collector with a long list of selected units may produce metrics with high cardinality. If you enable this collector, closely monitor the prometheus-k8s deployment for excessive memory usage. Enable when you need metrics for specific units; scope units carefully.", "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.", + "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 { @@ -380,6 +381,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). 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.", +} + +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. 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 b6d425dd5c2..0724944ef06 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -560,6 +560,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA configv1alpha1.NodeExporterCollectorConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterCollectorConfig(ref), configv1alpha1.NodeExporterCollectorCpufreqConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterCollectorCpufreqConfig(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), @@ -25234,11 +25236,18 @@ func schema_openshift_api_config_v1alpha1_NodeExporterCollectorConfig(ref common Ref: ref(configv1alpha1.NodeExporterCollectorSoftirqsConfig{}.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.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.NodeExporterCollectorBuddyInfoConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorCpufreqConfig{}.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()}, } } @@ -25286,6 +25295,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). 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.", + 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. 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 0ebc0f67dcf..16945cd9b86 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -13746,6 +13746,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": {}, @@ -13822,6 +13827,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). 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.", + "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. 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 bb427426d04..fc339da33bc 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 @@ -2184,6 +2184,72 @@ 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. + 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). + 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. + 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. + maxLength: 1024 + minLength: 1 + type: string + 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 is forbidden when collectionPolicy is not + Collect + 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