Skip to content

Commit b1fae84

Browse files
fix test and bundle
1 parent 6c68f46 commit b1fae84

File tree

4 files changed

+71
-46
lines changed

4 files changed

+71
-46
lines changed

bundle/manifests/flows.netobserv.io_flowcollectors.yaml

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5801,19 +5801,41 @@ spec:
58015801
description: '`Metrics` define the processor configuration regarding
58025802
metrics'
58035803
properties:
5804-
alerts:
5804+
disableAlerts:
58055805
description: |-
5806-
`alerts` is a list of alerts to be created for Prometheus AlertManager, organized by templates and variants [Unsupported (*)].
5807-
This is currently an experimental feature behind a feature gate. To enable, edit `spec.processor.advanced.env` by adding `EXPERIMENTAL_ALERTS_HEALTH` set to `true`.
5806+
`disableAlerts` is a list of alert groups that should be disabled from the default set of alerts.
5807+
Possible values are: `NetObservNoFlows`, `NetObservLokiError`, `PacketDropsByKernel`, `PacketDropsByDevice`, `IPsecErrors`, `NetpolDenied`,
5808+
`LatencyHighTrend`, `DNSErrors`, `ExternalEgressHighTrend`, `ExternalIngressHighTrend`, `CrossAZ`.
58085809
More information on alerts: https://github.com/netobserv/network-observability-operator/blob/main/docs/Alerts.md
5810+
items:
5811+
type: string
5812+
type: array
5813+
healthRules:
5814+
description: |-
5815+
`healthRules` is a list of health monitoring rules to be created, organized by templates, mode (alert or recording-rule), and variants [Unsupported (*)].
5816+
Each rule can be configured independently as either an alert or a recording rule via its `mode` field.
5817+
This is currently an experimental feature behind a feature gate. To enable, edit `spec.processor.advanced.env` by adding `EXPERIMENTAL_ALERTS_HEALTH` set to `true`.
5818+
More information: https://github.com/netobserv/network-observability-operator/blob/main/docs/Alerts.md
58095819
items:
58105820
properties:
5821+
mode:
5822+
default: alert
5823+
description: |-
5824+
Mode defines whether this health rule generates an alert or a recording rule.
5825+
Possible values are `alert` (default) or `recording-rule`.
5826+
- `alert`: Generate Prometheus alerts that fire when thresholds are exceeded.
5827+
- `recording-rule`: Generate Prometheus recording rules that pre-compute health metrics for passive consumption.
5828+
Recording rules avoid alert fatigue and are useful for dashboard-based health monitoring.
5829+
enum:
5830+
- alert
5831+
- recording-rule
5832+
type: string
58115833
template:
58125834
description: |-
5813-
Alert template name.
5835+
Health rule template name.
58145836
Possible values are: `PacketDropsByKernel`, `PacketDropsByDevice`, `IPsecErrors`, `NetpolDenied`,
58155837
`LatencyHighTrend`, `DNSErrors`, `ExternalEgressHighTrend`, `ExternalIngressHighTrend`, `CrossAZ`.
5816-
More information on alerts: https://github.com/netobserv/network-observability-operator/blob/main/docs/Alerts.md
5838+
More information: https://github.com/netobserv/network-observability-operator/blob/main/docs/Alerts.md
58175839
enum:
58185840
- PacketDropsByKernel
58195841
- PacketDropsByDevice
@@ -5846,8 +5868,9 @@ spec:
58465868
type: string
58475869
thresholds:
58485870
description: |-
5849-
Thresholds of the alert per severity.
5850-
They are expressed as a percentage of errors above which the alert is triggered. They must be parsable as floats.
5871+
Thresholds per severity.
5872+
Only used when mode is 'alert'. They are expressed as a percentage of errors above which the alert is triggered. They must be parsable as floats.
5873+
For recording-rule mode, this field is ignored.
58515874
properties:
58525875
critical:
58535876
description: Threshold for severity `critical`.
@@ -5863,34 +5886,24 @@ spec:
58635886
type: string
58645887
type: object
58655888
trendDuration:
5866-
description: For trending alerts, the duration
5889+
description: For trending health rules, the duration
58675890
interval for baseline comparison. For example,
58685891
"2h" means comparing against a 2-hours average.
58695892
Defaults to 2h.
58705893
type: string
58715894
trendOffset:
5872-
description: For trending alerts, the time offset
5873-
for baseline comparison. For example, "1d" means
5874-
comparing against yesterday. Defaults to 1d.
5895+
description: For trending health rules, the time
5896+
offset for baseline comparison. For example,
5897+
"1d" means comparing against yesterday. Defaults
5898+
to 1d.
58755899
type: string
5876-
required:
5877-
- thresholds
58785900
type: object
58795901
type: array
58805902
required:
58815903
- template
58825904
- variants
58835905
type: object
58845906
type: array
5885-
disableAlerts:
5886-
description: |-
5887-
`disableAlerts` is a list of alert groups that should be disabled from the default set of alerts.
5888-
Possible values are: `NetObservNoFlows`, `NetObservLokiError`, `PacketDropsByKernel`, `PacketDropsByDevice`, `IPsecErrors`, `NetpolDenied`,
5889-
`LatencyHighTrend`, `DNSErrors`, `ExternalEgressHighTrend`, `ExternalIngressHighTrend`, `CrossAZ`.
5890-
More information on alerts: https://github.com/netobserv/network-observability-operator/blob/main/docs/Alerts.md
5891-
items:
5892-
type: string
5893-
type: array
58945907
includeList:
58955908
description: |-
58965909
`includeList` is a list of metric names to specify which ones to generate.

bundle/manifests/netobserv-operator.clusterserviceversion.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ metadata:
253253
categories: Monitoring, Networking, Observability
254254
console.openshift.io/plugins: '["netobserv-plugin"]'
255255
containerImage: quay.io/netobserv/network-observability-operator:1.10.0-community
256-
createdAt: "2025-11-25T09:57:07Z"
256+
createdAt: "2025-11-28T14:33:48Z"
257257
description: Network flows collector and monitoring solution
258258
operatorframework.io/initialization-resource: '{"apiVersion":"flows.netobserv.io/v1beta2",
259259
"kind":"FlowCollector","metadata":{"name":"cluster"},"spec": {}}'
@@ -620,10 +620,10 @@ spec:
620620
path: processor.filters
621621
- displayName: Log types
622622
path: processor.logTypes
623-
- displayName: Alerts
624-
path: processor.metrics.alerts
625623
- displayName: Disable alerts
626624
path: processor.metrics.disableAlerts
625+
- displayName: Health rules
626+
path: processor.metrics.healthRules
627627
- displayName: Include list
628628
path: processor.metrics.includeList
629629
- displayName: Port

helm/crds/flows.netobserv.io_flowcollectors.yaml

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5366,19 +5366,41 @@ spec:
53665366
metrics:
53675367
description: '`Metrics` define the processor configuration regarding metrics'
53685368
properties:
5369-
alerts:
5369+
disableAlerts:
53705370
description: |-
5371-
`alerts` is a list of alerts to be created for Prometheus AlertManager, organized by templates and variants [Unsupported (*)].
5372-
This is currently an experimental feature behind a feature gate. To enable, edit `spec.processor.advanced.env` by adding `EXPERIMENTAL_ALERTS_HEALTH` set to `true`.
5371+
`disableAlerts` is a list of alert groups that should be disabled from the default set of alerts.
5372+
Possible values are: `NetObservNoFlows`, `NetObservLokiError`, `PacketDropsByKernel`, `PacketDropsByDevice`, `IPsecErrors`, `NetpolDenied`,
5373+
`LatencyHighTrend`, `DNSErrors`, `ExternalEgressHighTrend`, `ExternalIngressHighTrend`, `CrossAZ`.
53735374
More information on alerts: https://github.com/netobserv/network-observability-operator/blob/main/docs/Alerts.md
5375+
items:
5376+
type: string
5377+
type: array
5378+
healthRules:
5379+
description: |-
5380+
`healthRules` is a list of health monitoring rules to be created, organized by templates, mode (alert or recording-rule), and variants [Unsupported (*)].
5381+
Each rule can be configured independently as either an alert or a recording rule via its `mode` field.
5382+
This is currently an experimental feature behind a feature gate. To enable, edit `spec.processor.advanced.env` by adding `EXPERIMENTAL_ALERTS_HEALTH` set to `true`.
5383+
More information: https://github.com/netobserv/network-observability-operator/blob/main/docs/Alerts.md
53745384
items:
53755385
properties:
5386+
mode:
5387+
default: alert
5388+
description: |-
5389+
Mode defines whether this health rule generates an alert or a recording rule.
5390+
Possible values are `alert` (default) or `recording-rule`.
5391+
- `alert`: Generate Prometheus alerts that fire when thresholds are exceeded.
5392+
- `recording-rule`: Generate Prometheus recording rules that pre-compute health metrics for passive consumption.
5393+
Recording rules avoid alert fatigue and are useful for dashboard-based health monitoring.
5394+
enum:
5395+
- alert
5396+
- recording-rule
5397+
type: string
53765398
template:
53775399
description: |-
5378-
Alert template name.
5400+
Health rule template name.
53795401
Possible values are: `PacketDropsByKernel`, `PacketDropsByDevice`, `IPsecErrors`, `NetpolDenied`,
53805402
`LatencyHighTrend`, `DNSErrors`, `ExternalEgressHighTrend`, `ExternalIngressHighTrend`, `CrossAZ`.
5381-
More information on alerts: https://github.com/netobserv/network-observability-operator/blob/main/docs/Alerts.md
5403+
More information: https://github.com/netobserv/network-observability-operator/blob/main/docs/Alerts.md
53825404
enum:
53835405
- PacketDropsByKernel
53845406
- PacketDropsByDevice
@@ -5410,8 +5432,9 @@ spec:
54105432
type: string
54115433
thresholds:
54125434
description: |-
5413-
Thresholds of the alert per severity.
5414-
They are expressed as a percentage of errors above which the alert is triggered. They must be parsable as floats.
5435+
Thresholds per severity.
5436+
Only used when mode is 'alert'. They are expressed as a percentage of errors above which the alert is triggered. They must be parsable as floats.
5437+
For recording-rule mode, this field is ignored.
54155438
properties:
54165439
critical:
54175440
description: Threshold for severity `critical`. Leave empty to not generate a Critical alert.
@@ -5424,29 +5447,18 @@ spec:
54245447
type: string
54255448
type: object
54265449
trendDuration:
5427-
description: For trending alerts, the duration interval for baseline comparison. For example, "2h" means comparing against a 2-hours average. Defaults to 2h.
5450+
description: For trending health rules, the duration interval for baseline comparison. For example, "2h" means comparing against a 2-hours average. Defaults to 2h.
54285451
type: string
54295452
trendOffset:
5430-
description: For trending alerts, the time offset for baseline comparison. For example, "1d" means comparing against yesterday. Defaults to 1d.
5453+
description: For trending health rules, the time offset for baseline comparison. For example, "1d" means comparing against yesterday. Defaults to 1d.
54315454
type: string
5432-
required:
5433-
- thresholds
54345455
type: object
54355456
type: array
54365457
required:
54375458
- template
54385459
- variants
54395460
type: object
54405461
type: array
5441-
disableAlerts:
5442-
description: |-
5443-
`disableAlerts` is a list of alert groups that should be disabled from the default set of alerts.
5444-
Possible values are: `NetObservNoFlows`, `NetObservLokiError`, `PacketDropsByKernel`, `PacketDropsByDevice`, `IPsecErrors`, `NetpolDenied`,
5445-
`LatencyHighTrend`, `DNSErrors`, `ExternalEgressHighTrend`, `ExternalIngressHighTrend`, `CrossAZ`.
5446-
More information on alerts: https://github.com/netobserv/network-observability-operator/blob/main/docs/Alerts.md
5447-
items:
5448-
type: string
5449-
type: array
54505462
includeList:
54515463
description: |-
54525464
`includeList` is a list of metric names to specify which ones to generate.

internal/pkg/metrics/alerts/builder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
func TestBuildLabelFilter(t *testing.T) {
1111
// Test GroupByNode with source side
1212
rb := &ruleBuilder{
13-
alert: &flowslatest.AlertVariant{
13+
alert: &flowslatest.HealthRuleVariant{
1414
GroupBy: flowslatest.GroupByNode,
1515
},
1616
side: asSource,

0 commit comments

Comments
 (0)