diff --git a/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml b/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml index 59f2e353175..5e8162cb2ee 100644 --- a/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml +++ b/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml @@ -2037,6 +2037,11 @@ tests: collectionPolicy: Collect buddyInfo: collectionPolicy: DoNotCollect + interrupts: + collectionPolicy: Collect + collect: + include: + - "LOC.*" maxProcs: 4 ignoredNetworkDevices: - "^veth.*$" @@ -2055,6 +2060,11 @@ tests: collectionPolicy: Collect buddyInfo: collectionPolicy: DoNotCollect + interrupts: + collectionPolicy: Collect + collect: + include: + - "LOC.*" maxProcs: 4 ignoredNetworkDevices: - "^veth.*$" @@ -2165,7 +2175,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 +2205,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 @@ -2288,6 +2298,137 @@ tests: collectors: softirqs: {} expectedError: 'spec.nodeExporterConfig.collectors.softirqs.collectionPolicy: Required value' + - name: Should reject interrupts Collect without collect field + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + interrupts: + collectionPolicy: Collect + expectedError: 'collect is required when collectionPolicy is Collect, and forbidden otherwise' + - name: Should accept interrupts collector with DoNotCollect + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + interrupts: + collectionPolicy: DoNotCollect + expected: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + interrupts: + collectionPolicy: DoNotCollect + - name: Should reject interrupts collector with invalid collectionPolicy + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + interrupts: + collectionPolicy: Invalid + expectedError: 'spec.nodeExporterConfig.collectors.interrupts.collectionPolicy: Unsupported value: "Invalid"' + - name: Should reject interrupts collector with empty collectionPolicy + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + interrupts: {} + expectedError: 'spec.nodeExporterConfig.collectors.interrupts.collectionPolicy: Required value' + - name: Should accept interrupts Collect with include list + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + interrupts: + collectionPolicy: Collect + collect: + include: + - "LOC.*" + - "NMI.*" + expected: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + interrupts: + collectionPolicy: Collect + collect: + include: + - "LOC.*" + - "NMI.*" + - name: Should accept interrupts Collect with wildcard include + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + interrupts: + collectionPolicy: Collect + collect: + include: + - ".*" + expected: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + interrupts: + collectionPolicy: Collect + collect: + include: + - ".*" + - name: Should reject interrupts with collect set when collector is DoNotCollect + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + interrupts: + collectionPolicy: DoNotCollect + collect: + include: + - "LOC.*" + expectedError: 'collect is required when collectionPolicy is Collect, and forbidden otherwise' + - name: Should reject interrupts collect with empty object + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + interrupts: + collectionPolicy: Collect + collect: {} + expectedError: 'spec.nodeExporterConfig.collectors.interrupts.collect.include: Required value' + - name: Should reject interrupts include with control characters + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + interrupts: + collectionPolicy: Collect + collect: + include: + - "LOC\ttab" + expectedError: 'must contain only printable ASCII characters (no control characters)' - name: Should reject NodeExporterConfig with zero request initial: | apiVersion: config.openshift.io/v1alpha1 diff --git a/config/v1alpha1/types_cluster_monitoring.go b/config/v1alpha1/types_cluster_monitoring.go index 7692fe21b4f..802b10c9680 100644 --- a/config/v1alpha1/types_cluster_monitoring.go +++ b/config/v1alpha1/types_cluster_monitoring.go @@ -488,6 +488,16 @@ type NodeExporterCollectorConfig struct { // which is subject to change over time. The current default is enabled. // +optional NVMExpressSubsystem NodeExporterCollectorNVMExpressSubsystemConfig `json:"nvmExpressSubsystem,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, the collect field with at least one include + // pattern is required to explicitly select which interrupt lines are collected. + // +optional + Interrupts NodeExporterCollectorInterruptsConfig `json:"interrupts,omitempty,omitzero"` } // NodeExporterCollectorCpufreqConfig provides configuration for the cpufreq collector @@ -548,7 +558,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. @@ -649,7 +659,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. @@ -753,6 +763,71 @@ type NodeExporterCollectorNVMExpressSubsystemConfig 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, the collect field with at least one include +// pattern is required to explicitly select which interrupt lines are collected. +// When collectionPolicy is Collect, the collect field must be set with at least one include pattern. +// When collectionPolicy is DoNotCollect, the collect field must not be set. +// +kubebuilder:validation:XValidation:rule="has(self.collectionPolicy) && self.collectionPolicy == 'Collect' ? has(self.collect) : !has(self.collect)",message="collect is required 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 the collect field must be set + // with at least one include pattern to select which interrupt lines 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 required when collectionPolicy is Collect and must contain at least one include pattern + // to explicitly select which interrupt lines are collected. + // To collect all interrupt lines, use the pattern ".*". + // collect must not be set when collectionPolicy is DoNotCollect. + // 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. + // This field is required. + // 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). + // To collect all interrupt lines, use the pattern ".*". + // 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 + // +required + 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 3c84f99841d..015219b9266 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,82 @@ 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, the collect field with at least one include + pattern is required to explicitly select 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 required when collectionPolicy is Collect and must contain at least one include pattern + to explicitly select which interrupt lines are collected. + To collect all interrupt lines, use the pattern ".*". + collect must not be set when collectionPolicy is DoNotCollect. + 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. + This field is required. + 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). + To collect all interrupt lines, use the pattern ".*". + 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 + required: + - include + 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 the collect field must be set + with at least one include pattern to select which interrupt lines 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 required when collectionPolicy is Collect, + and forbidden otherwise + rule: 'has(self.collectionPolicy) && self.collectionPolicy + == ''Collect'' ? has(self.collect) : !has(self.collect)' ksmd: description: |- ksmd configures the ksmd collector, which collects statistics from the kernel same-page @@ -2300,8 +2376,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: @@ -2454,8 +2530,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 660e2931a7b..598f38fc5de 100644 --- a/config/v1alpha1/zz_generated.deepcopy.go +++ b/config/v1alpha1/zz_generated.deepcopy.go @@ -1027,6 +1027,7 @@ func (in *NodeExporterCollectorConfig) DeepCopyInto(out *NodeExporterCollectorCo out.DeviceMapperMultipath = in.DeviceMapperMultipath out.Zoneinfo = in.Zoneinfo out.NVMExpressSubsystem = in.NVMExpressSubsystem + in.Interrupts.DeepCopyInto(&out.Interrupts) return } @@ -1088,6 +1089,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 9090d95b678..ade2c735266 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,82 @@ 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, the collect field with at least one include + pattern is required to explicitly select 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 required when collectionPolicy is Collect and must contain at least one include pattern + to explicitly select which interrupt lines are collected. + To collect all interrupt lines, use the pattern ".*". + collect must not be set when collectionPolicy is DoNotCollect. + 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. + This field is required. + 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). + To collect all interrupt lines, use the pattern ".*". + 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 + required: + - include + 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 the collect field must be set + with at least one include pattern to select which interrupt lines 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 required when collectionPolicy is Collect, + and forbidden otherwise + rule: 'has(self.collectionPolicy) && self.collectionPolicy + == ''Collect'' ? has(self.collect) : !has(self.collect)' ksmd: description: |- ksmd configures the ksmd collector, which collects statistics from the kernel same-page @@ -2300,8 +2376,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: @@ -2454,8 +2530,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 e7e61f44504..8159016737c 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 2c20659cac1..bc6fde277bc 100644 --- a/config/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/config/v1alpha1/zz_generated.swagger_doc_generated.go @@ -359,6 +359,7 @@ var map_NodeExporterCollectorConfig = map[string]string{ "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.", "nvmExpressSubsystem": "nvmExpressSubsystem configures the nvmesubsystem collector, which collects statistics about NVM Express (NVMe) subsystem devices. nvmExpressSubsystem 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.", + "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, the collect field with at least one include pattern is required to explicitly select which interrupt lines are collected.", } func (NodeExporterCollectorConfig) SwaggerDoc() map[string]string { @@ -392,6 +393,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. This field is required. 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). To collect all interrupt lines, use the pattern \".*\". 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, the collect field with at least one include pattern is required to explicitly select which interrupt lines are collected. When collectionPolicy is Collect, the collect field must be set with at least one include pattern. 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 the collect field must be set with at least one include pattern to select which interrupt lines 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 required when collectionPolicy is Collect and must contain at least one include pattern to explicitly select which interrupt lines are collected. To collect all interrupt lines, use the pattern \".*\". collect must not be set when collectionPolicy is DoNotCollect. 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 fbb8d32f7e7..76704f215b4 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.NodeExporterCollectorNVMExpressSubsystemConfig{}.OpenAPIModelName(): schema_openshift_api_config_v1alpha1_NodeExporterCollectorNVMExpressSubsystemConfig(ref), @@ -25278,11 +25280,18 @@ func schema_openshift_api_config_v1alpha1_NodeExporterCollectorConfig(ref common Ref: ref(configv1alpha1.NodeExporterCollectorNVMExpressSubsystemConfig{}.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, the collect field with at least one include pattern is required to explicitly select 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.NodeExporterCollectorNVMExpressSubsystemConfig{}.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.NodeExporterCollectorNVMExpressSubsystemConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorNetClassConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorNetDevConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorProcessesConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorSoftirqsConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorSystemdConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorTcpStatConfig{}.OpenAPIModelName(), configv1alpha1.NodeExporterCollectorZoneinfoConfig{}.OpenAPIModelName()}, } } @@ -25352,6 +25361,83 @@ 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. This field is required. 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). To collect all interrupt lines, use the pattern \".*\". 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: "", + }, + }, + }, + }, + }, + }, + Required: []string{"include"}, + }, + }, + } +} + +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, the collect field with at least one include pattern is required to explicitly select which interrupt lines are collected. When collectionPolicy is Collect, the collect field must be set with at least one include pattern. 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 the collect field must be set with at least one include pattern to select which interrupt lines 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 required when collectionPolicy is Collect and must contain at least one include pattern to explicitly select which interrupt lines are collected. To collect all interrupt lines, use the pattern \".*\". collect must not be set when collectionPolicy is DoNotCollect. 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 2c13f336217..7fc82adefbb 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, the collect field with at least one include pattern is required to explicitly select 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": {}, @@ -13865,6 +13870,54 @@ } } }, + "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", + "required": [ + "include" + ], + "properties": { + "include": { + "description": "include is a list of regular expression patterns that select which interrupt lines to collect. This field is required. 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). To collect all interrupt lines, use the pattern \".*\". 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, the collect field with at least one include pattern is required to explicitly select which interrupt lines are collected. When collectionPolicy is Collect, the collect field must be set with at least one include pattern. 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 required when collectionPolicy is Collect and must contain at least one include pattern to explicitly select which interrupt lines are collected. To collect all interrupt lines, use the pattern \".*\". collect must not be set when collectionPolicy is DoNotCollect. 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 the collect field must be set with at least one include pattern to select which interrupt lines 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 3c84f99841d..015219b9266 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,82 @@ 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, the collect field with at least one include + pattern is required to explicitly select 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 required when collectionPolicy is Collect and must contain at least one include pattern + to explicitly select which interrupt lines are collected. + To collect all interrupt lines, use the pattern ".*". + collect must not be set when collectionPolicy is DoNotCollect. + 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. + This field is required. + 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). + To collect all interrupt lines, use the pattern ".*". + 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 + required: + - include + 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 the collect field must be set + with at least one include pattern to select which interrupt lines 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 required when collectionPolicy is Collect, + and forbidden otherwise + rule: 'has(self.collectionPolicy) && self.collectionPolicy + == ''Collect'' ? has(self.collect) : !has(self.collect)' ksmd: description: |- ksmd configures the ksmd collector, which collects statistics from the kernel same-page @@ -2300,8 +2376,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: @@ -2454,8 +2530,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: