Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support patching upstream alert rules #156

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading