[SDFAB-56] - Add the prometheus rules for tost application
Change-Id: Iaa24c275567bae884432c8cd827139d3b6c5a4f8
diff --git a/apps/tost-telegraf/Chart.yaml b/apps/tost-telegraf/Chart.yaml
index 69db207..c0336a4 100644
--- a/apps/tost-telegraf/Chart.yaml
+++ b/apps/tost-telegraf/Chart.yaml
@@ -18,7 +18,7 @@
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
-version: 0.1.1
+version: 0.1.2
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
diff --git a/apps/tost-telegraf/templates/prometheusrule.yaml b/apps/tost-telegraf/templates/prometheusrule.yaml
new file mode 100644
index 0000000..c4436c2
--- /dev/null
+++ b/apps/tost-telegraf/templates/prometheusrule.yaml
@@ -0,0 +1,32 @@
+# Copyright 2020-present Open Networking Foundation
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+apiVersion: monitoring.coreos.com/v1
+kind: PrometheusRule
+metadata:
+ name: tost-telegraf
+spec:
+ groups:
+ - name: tost.rules
+ rules:
+ - alert: "Topology: Device change"
+ annotations:
+ message: "Number of devices were changed"
+ expr: (onos_telegraf_ready == 1) and (changes(onos_telegraf_devices[5m]) != 0)
+ for: 5m
+ labels:
+ severity: warning
+ - alert: "Topology: Active Links change"
+ annotations:
+ message: "Number of active links were changed"
+ expr: (onos_telegraf_ready == 1) and (changes(onos_telegraf_active_links[5m]) != 0)
+ for: 5m
+ labels:
+ severity: warning
+ - alert: "Topology: Enable Device Ports change"
+ annotations:
+ message: "Number of enable device ports were changed"
+ expr: (onos_telegraf_ready == 1) and (changes(onos_telegraf_enable_device_ports[5m]) != 0)
+ for: 5m
+ labels:
+ severity: warning