mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
44 lines
1.8 KiB
Plaintext
44 lines
1.8 KiB
Plaintext
// Module included in the following assemblies:
|
|
// * network_observability/metrics-alerts-dashboards.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="network-observability-netobserv-dashboard-high-traffic-alert_{context}"]
|
|
= Creating alerts
|
|
|
|
[role="_abstract"]
|
|
Create custom `AlertingRule` resources based on `Netobserv` dashboard metrics to define conditions that trigger alerts in the {product-title} console.
|
|
|
|
.Prerequisites
|
|
|
|
* You have access to the cluster as a user with the cluster-admin role or with view permissions for all projects.
|
|
* You have the Network Observability Operator installed.
|
|
|
|
.Procedure
|
|
|
|
. Create a YAML file by clicking the import icon, *+*.
|
|
. Add an alerting rule configuration to the YAML file. In the YAML sample that follows, an alert is created for when the cluster ingress traffic reaches a given threshold of 10 MBps per destination workload.
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: monitoring.openshift.io/v1
|
|
kind: AlertingRule
|
|
metadata:
|
|
name: netobserv-alerts
|
|
namespace: openshift-monitoring
|
|
spec:
|
|
groups:
|
|
- name: NetObservAlerts
|
|
rules:
|
|
- alert: NetObservIncomingBandwidth
|
|
annotations:
|
|
message: |-
|
|
{{ $labels.job }}: incoming traffic exceeding 10 MBps for 30s on {{ $labels.DstK8S_OwnerType }} {{ $labels.DstK8S_OwnerName }} ({{ $labels.DstK8S_Namespace }}).
|
|
summary: "High incoming traffic."
|
|
expr: sum(rate(netobserv_workload_ingress_bytes_total {SrcK8S_Namespace="openshift-ingress"}[1m])) by (job, DstK8S_Namespace, DstK8S_OwnerName, DstK8S_OwnerType) > 10000000 <1>
|
|
for: 30s
|
|
labels:
|
|
severity: warning
|
|
----
|
|
<1> The `netobserv_workload_ingress_bytes_total` metric is enabled by default in `spec.processor.metrics.includeList`.
|
|
|
|
. Click *Create* to apply the configuration file to the cluster. |