Skip to content

Commit

Permalink
Support patching upstream alert rules (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
DebakelOrakel authored Nov 14, 2024
1 parent 5cd1b28 commit 85f5517
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
14 changes: 9 additions & 5 deletions class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ parameters:
channel: 'stable-${openshift4_logging:version}'
alerts: 'release-${openshift4_logging:version}'

ignore_alerts:
- ElasticsearchHighFileDescriptorUsage
- ElasticsearchOperatorCSVNotSuccessful
- FluentdQueueLengthIncreasing

components:
lokistack:
enabled: true
Expand Down Expand Up @@ -109,6 +104,15 @@ parameters:
schedule: '*/10 * * * *'
sleep_time: 2m

ignore_alerts:
- ElasticsearchHighFileDescriptorUsage
- ElasticsearchOperatorCSVNotSuccessful
- FluentdQueueLengthIncreasing

patch_alerts:
FluentdQueueLengthIncreasing:
for: '12h'

openshift4_elasticsearch_operator:
targetNamespaces:
- ${openshift4_logging:namespace}
Expand Down
6 changes: 1 addition & 5 deletions component/alertrules.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ local ignore_alerts = std.set(
// Provide partial objects for alert rules that need to be tuned compared to
// upstream. The keys in this object correspond to the `alert` field of the
// rule for which the patch is intended.
local patch_alerts = {
FluentdQueueLengthIncreasing: {
'for': '12h',
},
};
local patch_alerts = params.patch_alerts;

local loadFile(file) =
local fpath = 'openshift4-logging/component/extracted_alerts/%s/%s' % [ params.alerts, file ];
Expand Down
16 changes: 16 additions & 0 deletions docs/modules/ROOT/pages/references/parameters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,22 @@ This parameter can be used to disable alerts provided by openshift cluster-loggi
The component supports removing entries in this parameter by providing the entry prefixed with `~`.


== `patch_alerts`

[horizontal]
type:: dictionary
default::
+
[source,yaml]
----
patch_alerts:
FluentdQueueLengthIncreasing:
for: '12h'
----

The parameter patch_alerts allows users to customize upstream alerts.


== `components.elasticsearch`

[horizontal]
Expand Down

0 comments on commit 85f5517

Please sign in to comment.