Skip to content

Commit d2653b6

Browse files
committed
update image and query info
1 parent f1bfde3 commit d2653b6

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed
12.2 KB
Loading

articles/azure-arc/kubernetes/monitor-gitops-flux-2.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ For example, in the **Flux Configuration Compliance Status** table, you can sele
7171

7272
After you've imported the dashboard as described in the previous section, you can set up alerts. These alerts notify you when Flux extensions or Flux configurations experience failures.
7373

74-
The steps below create an alert that detects a failure in extension provisioning or extension upgrade. The query below is one example that you can edit as needed. You can also create queries to detect failures in compliance state.
74+
Follow the steps below to create an alert. Example queries are provided to detect extension provisioning or extension upgrade failures, or to detect compliance state failures.
7575

7676
1. In the left navigation menu of the dashboard, select **Alerting**.
7777
1. Select **Alert rules**.
@@ -82,7 +82,7 @@ The steps below create an alert that detects a failure in extension provisioning
8282
1. Select a data source. The same data source used for the dashboard may be used here.
8383
1. For **Service**, select **Azure Resource Graph**.
8484
1. Select the subscriptions from the dropdown list.
85-
1. Enter this query:
85+
1. Enter the query you want to use. For example, for extension provisioning or upgrade failures, you can enter this query:
8686

8787
```kusto
8888
kubernetesconfigurationresources
@@ -92,10 +92,42 @@ The steps below create an alert that detects a failure in extension provisioning
9292
| summarize count() by provisioningState
9393
```
9494
95+
Or for compliance state failures, you can enter this query:
96+
97+
```kusto
98+
kubernetesconfigurationresources
99+
| where type == "microsoft.kubernetesconfiguration/fluxconfigurations"
100+
| extend complianceState=tostring(properties.complianceState)
101+
| where complianceState == "Non-Compliant"
102+
| summarize count() by complianceState
103+
```
104+
95105
1. For **Threshold box**, select **A** for input type and set the threshold to **0** to receive alerts even if just one extension fails on the cluster. Mark this as the **Alert condition**.
96106
107+
1. Specify the alert evaluation interval:
108+
109+
1. For **Condition**, select the query or expression to trigger the alert rule.
110+
1. For **Evaluate every**, enter the evaluation frequency. The value must be a multiple of 10 seconds.
111+
1. For **Evaluate for**, enter the duration for which the condition must be true before the alert is created.
112+
1. In **Configure no data and error handling**, choose the desired behavior when the alert rule returns no data or returns an error.
113+
1. To check the results from running the query, select **Preview**.
114+
97115
:::image type="content" source="media/monitor-gitops-flux2/application-dashboard-set-alerts.png" alt-text="Screenshot showing the alert creation process." lightbox="media/monitor-gitops-flux2/application-dashboard-set-alerts.png":::
98116
117+
1. Add the storage location, rule group, and any additional metadata that you want to associate with the rule.
118+
119+
1. For **Folder**, select the folder where the rule should be stored.
120+
1. For **Group**, specify a pre-defined group.
121+
1. Add a description and summary to customize alert messages.
122+
1. Add Runbook URL, panel, dashboard, and alert IDs.
123+
124+
1. If desired, add any custom labels, and then select **Save**.
125+
126+
Add custom labels selecting existing key-value pairs from the drop down, or add new labels by entering the new key or value .
127+
Click Save to save the rule or Save and exit to save the rule and go back to the Alerting page.
128+
129+
Next, create a for the rule.
130+
99131
## Monitor resource consumption and reconciliations
100132
101133
Follow these steps to import dashboards that let you monitor Flux resource consumption, reconciliations, API requests, and reconciler status.

0 commit comments

Comments
 (0)