1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/network-observability-includelist-example.adoc

42 lines
1.7 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
You can create custom alerting rules for the Netobserv dashboard metrics to trigger alerts when some defined conditions are met.
.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.