diff --git a/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml b/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml index 8385d13faab..bd27fd8dad3 100644 --- a/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml +++ b/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml @@ -1837,6 +1837,8 @@ tests: units: - "kubelet.service" - "crio.service" + softirqs: + collectionPolicy: Collect expected: | apiVersion: config.openshift.io/v1alpha1 kind: ClusterMonitoring @@ -1859,6 +1861,8 @@ tests: units: - "kubelet.service" - "crio.service" + softirqs: + collectionPolicy: Collect - name: Should be able to create NodeExporterConfig with all fields initial: | apiVersion: config.openshift.io/v1alpha1 @@ -2145,6 +2149,59 @@ tests: collectionPolicy: Collect collect: {} expectedError: "spec.nodeExporterConfig.collectors.netClass.collect: Invalid value" + - name: Should accept softirqs collector with Collect + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + softirqs: + collectionPolicy: Collect + expected: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + softirqs: + collectionPolicy: Collect + - name: Should accept softirqs collector with DoNotCollect + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + softirqs: + collectionPolicy: DoNotCollect + expected: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + softirqs: + collectionPolicy: DoNotCollect + - name: Should reject softirqs collector with invalid collectionPolicy + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + softirqs: + collectionPolicy: Invalid + expectedError: 'spec.nodeExporterConfig.collectors.softirqs.collectionPolicy: Unsupported value: "Invalid"' + - name: Should reject softirqs collector with empty collectionPolicy + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + nodeExporterConfig: + collectors: + softirqs: {} + expectedError: 'spec.nodeExporterConfig.collectors.softirqs.collectionPolicy: Required value' - 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 083c2d6b558..4dbfb126812 100644 --- a/config/v1alpha1/types_cluster_monitoring.go +++ b/config/v1alpha1/types_cluster_monitoring.go @@ -456,6 +456,14 @@ type NodeExporterCollectorConfig struct { // Enable when you need metrics for specific units; scope units carefully. // +optional Systemd NodeExporterCollectorSystemdConfig `json:"systemd,omitempty,omitzero"` + // 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. + // +optional + Softirqs NodeExporterCollectorSoftirqsConfig `json:"softirqs,omitempty,omitzero"` } // NodeExporterCollectorCpufreqConfig provides configuration for the cpufreq collector @@ -665,6 +673,20 @@ type NodeExporterCollectorSystemdCollectConfig struct { // +kubebuilder:validation:MaxLength=1024 type NodeExporterSystemdUnit string +// NodeExporterCollectorSoftirqsConfig provides configuration for the softirqs collector +// of the node-exporter agent. The softirqs collector exposes detailed softirq statistics +// from /proc/softirqs. +// It is disabled by default. +type NodeExporterCollectorSoftirqsConfig struct { + // collectionPolicy declares whether the softirqs collector collects metrics. + // This field is required. + // Valid values are "Collect" and "DoNotCollect". + // When set to "Collect", the softirqs collector is active and softirq statistics are collected. + // When set to "DoNotCollect", the softirqs collector is inactive. + // +required + CollectionPolicy NodeExporterCollectorCollectionPolicy `json:"collectionPolicy,omitempty"` +} + // 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 c8458aff90d..6c184ff5b4d 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 @@ -1862,6 +1862,29 @@ spec: required: - collectionPolicy type: object + softirqs: + description: |- + 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. + properties: + collectionPolicy: + description: |- + collectionPolicy declares whether the softirqs collector collects metrics. + This field is required. + Valid values are "Collect" and "DoNotCollect". + When set to "Collect", the softirqs collector is active and softirq statistics are collected. + When set to "DoNotCollect", the softirqs collector is inactive. + enum: + - Collect + - DoNotCollect + type: string + required: + - collectionPolicy + type: object systemd: description: |- systemd configures the systemd collector, which collects statistics on the systemd daemon diff --git a/config/v1alpha1/zz_generated.deepcopy.go b/config/v1alpha1/zz_generated.deepcopy.go index f0f0a86de62..d690c688b2f 100644 --- a/config/v1alpha1/zz_generated.deepcopy.go +++ b/config/v1alpha1/zz_generated.deepcopy.go @@ -950,6 +950,7 @@ func (in *NodeExporterCollectorConfig) DeepCopyInto(out *NodeExporterCollectorCo out.Ksmd = in.Ksmd out.Processes = in.Processes in.Systemd.DeepCopyInto(&out.Systemd) + out.Softirqs = in.Softirqs return } @@ -1092,6 +1093,22 @@ func (in *NodeExporterCollectorProcessesConfig) DeepCopy() *NodeExporterCollecto return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeExporterCollectorSoftirqsConfig) DeepCopyInto(out *NodeExporterCollectorSoftirqsConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeExporterCollectorSoftirqsConfig. +func (in *NodeExporterCollectorSoftirqsConfig) DeepCopy() *NodeExporterCollectorSoftirqsConfig { + if in == nil { + return nil + } + out := new(NodeExporterCollectorSoftirqsConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeExporterCollectorSystemdCollectConfig) DeepCopyInto(out *NodeExporterCollectorSystemdCollectConfig) { *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 c2252fbbb52..407415920fd 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 @@ -1862,6 +1862,29 @@ spec: required: - collectionPolicy type: object + softirqs: + description: |- + 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. + properties: + collectionPolicy: + description: |- + collectionPolicy declares whether the softirqs collector collects metrics. + This field is required. + Valid values are "Collect" and "DoNotCollect". + When set to "Collect", the softirqs collector is active and softirq statistics are collected. + When set to "DoNotCollect", the softirqs collector is inactive. + enum: + - Collect + - DoNotCollect + type: string + required: + - collectionPolicy + type: object systemd: description: |- systemd configures the systemd collector, which collects statistics on the systemd daemon diff --git a/config/v1alpha1/zz_generated.swagger_doc_generated.go b/config/v1alpha1/zz_generated.swagger_doc_generated.go index 45e803f5888..ae91964235b 100644 --- a/config/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/config/v1alpha1/zz_generated.swagger_doc_generated.go @@ -330,6 +330,7 @@ var map_NodeExporterCollectorConfig = map[string]string{ "ksmd": "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.", "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.", } func (NodeExporterCollectorConfig) SwaggerDoc() map[string]string { @@ -409,6 +410,15 @@ func (NodeExporterCollectorProcessesConfig) SwaggerDoc() map[string]string { return map_NodeExporterCollectorProcessesConfig } +var map_NodeExporterCollectorSoftirqsConfig = map[string]string{ + "": "NodeExporterCollectorSoftirqsConfig provides configuration for the softirqs collector of the node-exporter agent. The softirqs collector exposes detailed softirq statistics from /proc/softirqs. It is disabled by default.", + "collectionPolicy": "collectionPolicy declares whether the softirqs collector collects metrics. This field is required. Valid values are \"Collect\" and \"DoNotCollect\". When set to \"Collect\", the softirqs collector is active and softirq statistics are collected. When set to \"DoNotCollect\", the softirqs collector is inactive.", +} + +func (NodeExporterCollectorSoftirqsConfig) SwaggerDoc() map[string]string { + return map_NodeExporterCollectorSoftirqsConfig +} + var map_NodeExporterCollectorSystemdCollectConfig = map[string]string{ "": "NodeExporterCollectorSystemdCollectConfig holds configuration options for the systemd collector when it is actively collecting metrics. At least one field must be specified.", "units": "units is a list of regular expression patterns that match systemd units to be included by the systemd collector. units is optional. By default, the list is empty, so the collector exposes no metrics for systemd units. Each entry is a regular expression pattern and 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.", diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index b7baccfd0d2..26a7d6dcb28 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -499,6 +499,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorNetClassConfig": schema_openshift_api_config_v1alpha1_NodeExporterCollectorNetClassConfig(ref), "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorNetDevConfig": schema_openshift_api_config_v1alpha1_NodeExporterCollectorNetDevConfig(ref), "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorProcessesConfig": schema_openshift_api_config_v1alpha1_NodeExporterCollectorProcessesConfig(ref), + "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorSoftirqsConfig": schema_openshift_api_config_v1alpha1_NodeExporterCollectorSoftirqsConfig(ref), "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorSystemdCollectConfig": schema_openshift_api_config_v1alpha1_NodeExporterCollectorSystemdCollectConfig(ref), "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorSystemdConfig": schema_openshift_api_config_v1alpha1_NodeExporterCollectorSystemdConfig(ref), "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorTcpStatConfig": schema_openshift_api_config_v1alpha1_NodeExporterCollectorTcpStatConfig(ref), @@ -24167,11 +24168,18 @@ func schema_openshift_api_config_v1alpha1_NodeExporterCollectorConfig(ref common Ref: ref("github.com/openshift/api/config/v1alpha1.NodeExporterCollectorSystemdConfig"), }, }, + "softirqs": { + SchemaProps: spec.SchemaProps{ + Description: "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.", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/config/v1alpha1.NodeExporterCollectorSoftirqsConfig"), + }, + }, }, }, }, Dependencies: []string{ - "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorBuddyInfoConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorCpufreqConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorEthtoolConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorKSMDConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorMountStatsConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorNetClassConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorNetDevConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorProcessesConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorSystemdConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorTcpStatConfig"}, + "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorBuddyInfoConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorCpufreqConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorEthtoolConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorKSMDConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorMountStatsConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorNetClassConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorNetDevConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorProcessesConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorSoftirqsConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorSystemdConfig", "github.com/openshift/api/config/v1alpha1.NodeExporterCollectorTcpStatConfig"}, } } @@ -24371,6 +24379,28 @@ func schema_openshift_api_config_v1alpha1_NodeExporterCollectorProcessesConfig(r } } +func schema_openshift_api_config_v1alpha1_NodeExporterCollectorSoftirqsConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeExporterCollectorSoftirqsConfig provides configuration for the softirqs collector of the node-exporter agent. The softirqs collector exposes detailed softirq statistics from /proc/softirqs. It is disabled by default.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "collectionPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "collectionPolicy declares whether the softirqs collector collects metrics. This field is required. Valid values are \"Collect\" and \"DoNotCollect\". When set to \"Collect\", the softirqs collector is active and softirq statistics are collected. When set to \"DoNotCollect\", the softirqs collector is inactive.\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"}, + }, + }, + }, + Required: []string{"collectionPolicy"}, + }, + }, + } +} + func schema_openshift_api_config_v1alpha1_NodeExporterCollectorSystemdCollectConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ 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 c8458aff90d..6c184ff5b4d 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 @@ -1862,6 +1862,29 @@ spec: required: - collectionPolicy type: object + softirqs: + description: |- + 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. + properties: + collectionPolicy: + description: |- + collectionPolicy declares whether the softirqs collector collects metrics. + This field is required. + Valid values are "Collect" and "DoNotCollect". + When set to "Collect", the softirqs collector is active and softirq statistics are collected. + When set to "DoNotCollect", the softirqs collector is inactive. + enum: + - Collect + - DoNotCollect + type: string + required: + - collectionPolicy + type: object systemd: description: |- systemd configures the systemd collector, which collects statistics on the systemd daemon