-
Notifications
You must be signed in to change notification settings - Fork 91
✨(ZENKO-5262) Define new alerts and enable monitor for Zenko Operator #2392
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
Open
DarkIsDude
wants to merge
3
commits into
development/2.14
Choose a base branch
from
feature/ZENKO-5262/monitor-operator
base: development/2.14
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| alerts.rendered.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,223 @@ | ||
| evaluation_interval: 1m | ||
| rule_files: | ||
| - alerts.rendered.yaml | ||
|
|
||
| tests: | ||
| # ZenkoOperatorReconcileErrors - no errors | ||
| ################################################################################################## | ||
| - name: No reconcile errors | ||
| interval: 1m | ||
| input_series: | ||
| - series: zenko_operator_reconcile_errors_total{namespace="zenko",job="zenko-operator-metrics",controller="zenko",name="artesca-data"} | ||
| values: 0x10 | ||
| alert_rule_test: | ||
| - alertname: ZenkoOperatorReconcileErrors | ||
| eval_time: 10m | ||
| exp_alerts: [] | ||
|
|
||
| # ZenkoOperatorReconcileErrors - errors trigger alert after for: 2m | ||
| ################################################################################################## | ||
| - name: Reconcile errors trigger alert | ||
| interval: 1m | ||
| input_series: | ||
| - series: zenko_operator_reconcile_errors_total{namespace="zenko",job="zenko-operator-metrics",controller="zenko",name="artesca-data"} | ||
| values: 0+1x20 | ||
| alert_rule_test: | ||
| - alertname: ZenkoOperatorReconcileErrors | ||
| eval_time: 2m | ||
| exp_alerts: [] | ||
| - alertname: ZenkoOperatorReconcileErrors | ||
| eval_time: 4m | ||
| exp_alerts: | ||
| - exp_labels: | ||
| severity: warning | ||
| job: zenko-operator-metrics | ||
| controller: zenko | ||
| namespace: zenko | ||
| name: artesca-data | ||
| exp_annotations: | ||
| summary: 'Zenko operator reconciliation errors detected' | ||
| description: 'The Zenko operator controller zenko is experiencing reconciliation errors for instance zenko/artesca-data.' | ||
|
|
||
| # ZenkoOperatorDeploymentFailed - condition never true | ||
| ################################################################################################## | ||
| - name: No deployment failure | ||
| interval: 1m | ||
| input_series: | ||
| - series: zenko_operator_instance_condition{namespace="zenko",job="zenko-operator-metrics",controller="zenko",name="artesca-data",condition="DeploymentFailure"} | ||
| values: 0x20 | ||
| alert_rule_test: | ||
| - alertname: ZenkoOperatorDeploymentFailed | ||
| eval_time: 20m | ||
| exp_alerts: [] | ||
|
|
||
| # ZenkoOperatorDeploymentFailed - condition fires after for: 5m | ||
| ################################################################################################## | ||
| - name: Deployment failure triggers alert | ||
| interval: 1m | ||
| input_series: | ||
| - series: zenko_operator_instance_condition{namespace="zenko",job="zenko-operator-metrics",controller="zenko",name="artesca-data",condition="DeploymentFailure"} | ||
| values: 0x3 1x20 | ||
| alert_rule_test: | ||
| - alertname: ZenkoOperatorDeploymentFailed | ||
| eval_time: 7m | ||
| exp_alerts: [] | ||
| - alertname: ZenkoOperatorDeploymentFailed | ||
| eval_time: 9m | ||
| exp_alerts: | ||
| - exp_labels: | ||
| severity: warning | ||
| job: zenko-operator-metrics | ||
| controller: zenko | ||
| namespace: zenko | ||
| name: artesca-data | ||
| condition: DeploymentFailure | ||
| exp_annotations: | ||
| summary: 'Zenko operator deployment failure' | ||
| description: 'Zenko instance zenko/artesca-data has a DeploymentFailure condition. The operator is unable to reconcile the instance to the desired state.' | ||
|
|
||
| # ZenkoOperatorSecurityOptionEnabled - skipTLSVerify never enabled | ||
| ################################################################################################## | ||
| - name: No security option enabled | ||
| interval: 1m | ||
| input_series: | ||
| - series: zenko_operator_debug_option{namespace="zenko",job="zenko-operator-metrics",controller="zenko",name="artesca-data",option="skipTLSVerify"} | ||
| values: 0x30 | ||
| alert_rule_test: | ||
| - alertname: ZenkoOperatorSecurityOptionEnabled | ||
| eval_time: 30m | ||
| exp_alerts: [] | ||
|
|
||
| # ZenkoOperatorSecurityOptionEnabled - skipTLSVerify fires after for: 15m | ||
| ################################################################################################## | ||
| - name: skipTLSVerify triggers security alert | ||
| interval: 1m | ||
| input_series: | ||
| - series: zenko_operator_debug_option{namespace="zenko",job="zenko-operator-metrics",controller="zenko",name="artesca-data",option="skipTLSVerify"} | ||
| values: 0x3 1x30 | ||
| alert_rule_test: | ||
| - alertname: ZenkoOperatorSecurityOptionEnabled | ||
| eval_time: 17m | ||
| exp_alerts: [] | ||
| - alertname: ZenkoOperatorSecurityOptionEnabled | ||
| eval_time: 19m | ||
| exp_alerts: | ||
| - exp_labels: | ||
| severity: warning | ||
| job: zenko-operator-metrics | ||
| controller: zenko | ||
| namespace: zenko | ||
| name: artesca-data | ||
| option: skipTLSVerify | ||
| exp_annotations: | ||
| summary: 'Security-bypassing option enabled on Zenko instance' | ||
| description: 'The option skipTLSVerify is enabled on Zenko instance zenko/artesca-data. This option bypasses security controls and must not remain active in production environments.' | ||
|
|
||
| # ZenkoOperatorSecurityOptionEnabled - noImplicitDeny fires after for: 15m | ||
| ################################################################################################## | ||
| - name: noImplicitDeny triggers security alert | ||
| interval: 1m | ||
| input_series: | ||
| - series: zenko_operator_debug_option{namespace="zenko",job="zenko-operator-metrics",controller="zenko",name="artesca-data",option="noImplicitDeny"} | ||
| values: 0x3 1x30 | ||
| alert_rule_test: | ||
| - alertname: ZenkoOperatorSecurityOptionEnabled | ||
| eval_time: 19m | ||
| exp_alerts: | ||
| - exp_labels: | ||
| severity: warning | ||
| job: zenko-operator-metrics | ||
| controller: zenko | ||
| namespace: zenko | ||
| name: artesca-data | ||
| option: noImplicitDeny | ||
| exp_annotations: | ||
| summary: 'Security-bypassing option enabled on Zenko instance' | ||
| description: 'The option noImplicitDeny is enabled on Zenko instance zenko/artesca-data. This option bypasses security controls and must not remain active in production environments.' | ||
|
|
||
| # ZenkoOperatorTestConfigActive - cron override fires after for: 1h | ||
| ################################################################################################## | ||
| - name: Cron override does not fire before 1h | ||
| interval: 1m | ||
| input_series: | ||
| - series: zenko_operator_debug_option{namespace="zenko",job="zenko-operator-metrics",controller="zenko",name="artesca-data",option="lifecycleConductorCronOverride"} | ||
| values: 1x120 | ||
| alert_rule_test: | ||
| - alertname: ZenkoOperatorTestConfigActive | ||
| eval_time: 59m | ||
| exp_alerts: [] | ||
|
|
||
| - name: Cron override triggers test config alert after 1h | ||
| interval: 1m | ||
| input_series: | ||
| - series: zenko_operator_debug_option{namespace="zenko",job="zenko-operator-metrics",controller="zenko",name="artesca-data",option="lifecycleConductorCronOverride"} | ||
| values: 1x120 | ||
| alert_rule_test: | ||
| - alertname: ZenkoOperatorTestConfigActive | ||
| eval_time: 61m | ||
| exp_alerts: | ||
| - exp_labels: | ||
| severity: warning | ||
| job: zenko-operator-metrics | ||
| controller: zenko | ||
| namespace: zenko | ||
| name: artesca-data | ||
| option: lifecycleConductorCronOverride | ||
| exp_annotations: | ||
| summary: 'Test/debug configuration active on Zenko instance' | ||
| description: 'The option lifecycleConductorCronOverride has been active on Zenko instance zenko/artesca-data for more than 1 hour. This option is intended for testing only and should not remain enabled in production.' | ||
|
|
||
| # ZenkoOperatorDRPhaseFailed - Bootstrap:Failed fires after for: 1m | ||
| ################################################################################################## | ||
| - name: DR phase not failed | ||
| interval: 1m | ||
| input_series: | ||
| - series: zenko_operator_instance_phase{namespace="zenko",job="zenko-operator-metrics",controller="drsink",name="artesca-data-dr",phase="Bootstrap:Failed"} | ||
| values: 0x10 | ||
| alert_rule_test: | ||
| - alertname: ZenkoOperatorDRPhaseFailed | ||
| eval_time: 10m | ||
| exp_alerts: [] | ||
|
|
||
| - name: Bootstrap Failed triggers DR phase alert | ||
| interval: 1m | ||
| input_series: | ||
| - series: zenko_operator_instance_phase{namespace="zenko",job="zenko-operator-metrics",controller="drsink",name="artesca-data-dr",phase="Bootstrap:Failed"} | ||
| values: 0x2 1x20 | ||
| alert_rule_test: | ||
| - alertname: ZenkoOperatorDRPhaseFailed | ||
| eval_time: 2m | ||
| exp_alerts: [] | ||
| - alertname: ZenkoOperatorDRPhaseFailed | ||
| eval_time: 4m | ||
| exp_alerts: | ||
| - exp_labels: | ||
| severity: critical | ||
| job: zenko-operator-metrics | ||
| controller: drsink | ||
| namespace: zenko | ||
| name: artesca-data-dr | ||
| phase: Bootstrap:Failed | ||
| exp_annotations: | ||
| summary: 'DR controller entered a failed phase' | ||
| description: 'DR controller drsink for instance zenko/artesca-data-dr is in phase Bootstrap:Failed. Manual intervention is required to recover.' | ||
|
|
||
| - name: Failback Failed triggers DR phase alert | ||
| interval: 1m | ||
| input_series: | ||
| - series: zenko_operator_instance_phase{namespace="zenko",job="zenko-operator-metrics",controller="drsink",name="artesca-data-dr",phase="Failback:Failed"} | ||
| values: 0x2 1x20 | ||
| alert_rule_test: | ||
| - alertname: ZenkoOperatorDRPhaseFailed | ||
| eval_time: 4m | ||
| exp_alerts: | ||
| - exp_labels: | ||
| severity: critical | ||
| job: zenko-operator-metrics | ||
| controller: drsink | ||
| namespace: zenko | ||
| name: artesca-data-dr | ||
| phase: Failback:Failed | ||
| exp_annotations: | ||
| summary: 'DR controller entered a failed phase' | ||
| description: 'DR controller drsink for instance zenko/artesca-data-dr is in phase Failback:Failed. Manual intervention is required to recover.' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| x-inputs: | ||
| - name: namespace | ||
| type: constant | ||
| value: zenko | ||
| - name: job | ||
| type: constant | ||
| value: zenko-operator-metrics | ||
|
|
||
| groups: | ||
| - name: ZenkoOperator | ||
| rules: | ||
|
|
||
| - alert: ZenkoOperatorReconcileErrors | ||
| expr: | | ||
| rate(zenko_operator_reconcile_errors_total{namespace="${namespace}", job="${job}"}[5m]) > 0 | ||
| for: 2m | ||
| labels: | ||
| severity: warning | ||
| annotations: | ||
| summary: 'Zenko operator reconciliation errors detected' | ||
| description: >- | ||
| The Zenko operator controller {{ $labels.controller }} is experiencing reconciliation | ||
| errors for instance {{ $labels.namespace }}/{{ $labels.name }}. | ||
|
|
||
| - alert: ZenkoOperatorDeploymentFailed | ||
| expr: | | ||
| zenko_operator_instance_condition{namespace="${namespace}", job="${job}", condition="DeploymentFailure"} == 1 | ||
| for: 5m | ||
| labels: | ||
| severity: warning | ||
| annotations: | ||
| summary: 'Zenko operator deployment failure' | ||
| description: >- | ||
| Zenko instance {{ $labels.namespace }}/{{ $labels.name }} has a DeploymentFailure condition. | ||
| The operator is unable to reconcile the instance to the desired state. | ||
|
|
||
| - alert: ZenkoOperatorSecurityOptionEnabled | ||
| expr: | | ||
| zenko_operator_debug_option{namespace="${namespace}", job="${job}", option=~"skipTLSVerify|noImplicitDeny"} == 1 | ||
| for: 15m | ||
| labels: | ||
| severity: warning | ||
| annotations: | ||
| summary: 'Security-bypassing option enabled on Zenko instance' | ||
| description: >- | ||
| The option {{ $labels.option }} is enabled on Zenko instance | ||
| {{ $labels.namespace }}/{{ $labels.name }}. This option bypasses security | ||
| controls and must not remain active in production environments. | ||
|
|
||
| - alert: ZenkoOperatorTestConfigActive | ||
| expr: | | ||
| zenko_operator_debug_option{namespace="${namespace}", job="${job}", option=~".*CronOverride|.*Verbose|triggerTransitions.*|triggerExpirations.*"} == 1 | ||
| for: 1h | ||
| labels: | ||
| severity: warning | ||
| annotations: | ||
| summary: 'Test/debug configuration active on Zenko instance' | ||
| description: >- | ||
| The option {{ $labels.option }} has been active on Zenko instance | ||
| {{ $labels.namespace }}/{{ $labels.name }} for more than 1 hour. | ||
| This option is intended for testing only and should not remain enabled in production. | ||
|
|
||
| - alert: ZenkoOperatorDRPhaseFailed | ||
| expr: | | ||
| zenko_operator_instance_phase{namespace="${namespace}", job="${job}", phase=~"Bootstrap:Failed|Failback:Failed"} == 1 | ||
| for: 1m | ||
| labels: | ||
| severity: critical | ||
| annotations: | ||
| summary: 'DR controller entered a failed phase' | ||
| description: >- | ||
| DR controller {{ $labels.controller }} for instance {{ $labels.namespace }}/{{ $labels.name }} | ||
| is in phase {{ $labels.phase }}. Manual intervention is required to recover. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usually we keep the alerts along with the components which "owns" these metrics, to reduce coupling and ensure we rename the metrics and alerts/dashboards at the same time.
That would mean both alerts.yaml and building the Oras image would be in Zenko-operator; and in Zenko we would simply need to change the content of zenkoversion to reference zkop's dashboard image (along with the manifest change to enable scraping)
any reason not to do this for these?