You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When in you Observability use case you have a set of logical components (bussiness components) that do not have any monitors on themselves but that get impacted when any technical dependencies have issues,
10
+
then you can propagate such health state to them using the `derived-state-monitor` function.
11
+
This function allows you to based on a starting group of components selected by `componentType` to discover and inherit the most critical health state of them at the top most layer,
12
+
the discovery process focuses only on components that do have health state applied by observations (based on metrics for example) and excludes any components that their health state is derived (although keeps traversing across them), for example when you have a logical component depending on other logical component.
13
+
14
+
## Derived Health State Monitor example
15
+
16
+
A Monitor implemented using the `derived-state-monitor` function looks like, this can be implement using the guide at [Add a threshold monitor to components using the CLI](/use/alerting/k8s-add-monitors-cli.md):
17
+
18
+
```
19
+
- _type: "Monitor"
20
+
name: "Aggregated health state of a Deployment, StatefulSet, ReplicaSet and DaemonSet"
21
+
tags:
22
+
- deployments
23
+
- replicasets
24
+
- statefulsets
25
+
- daemonsets
26
+
- derived
27
+
- propagated
28
+
identifier: "urn:custom:monitor:..."
29
+
status: "DISABLED"
30
+
description: "Description"
31
+
function: {{ get "urn:stackpack:common:monitor-function:derived-state-monitor" }}
remediationHint: "Investigate component [{{ causeName }}](/#/components/{{ causeComponentUrnForUrl }}) as is causing the workload to be unhealthy."
36
+
```
37
+
* The function has a single argument `componentTypes` where you can express the different component types as a single string of "," separated values
38
+
* The function offers two values to use in the remediation guide, `causeName` being the component name where the state is propagated from and its `causeComponentUrnForUrl` to be able to create a link
Copy file name to clipboardExpand all lines: use/alerting/kubernetes-monitors.md
+10-13Lines changed: 10 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,22 +144,19 @@ Cluster doesn't have any health itself. But a cluster is build from few componen
144
144
- all nodes
145
145
and then takes the most critical health state.
146
146
147
-
### Aggregated health state of a DaemonSet
147
+
### Derived Workloads health state (Deployment, DaemonSet, ReplicaSet, StatefulSet)
148
148
149
-
The monitor aggregates states of all children Pods and then returns the most critical health state.
149
+
The monitor aggregates states of all children Pod and then returns the most critical health state.
150
+
It uses a monitor function based on traversing component dependencies to find the most critical health state that is based on observations and not on any other derived states.
151
+
For example the health state of a Deployment will be derived from Pods as those health states are based on actual data and will not take into account the derived state that
152
+
a replicaset it depends on might have. Such monitor function helps propagate the health state from technical components into logical components, and it will only apply a derived state if the component does not have already a health state based on observations.
153
+
Therefor is you want to activate this monitor then the `Deployment desired replicas`, `Daemonset desired replicas`, `Replicaset desired replicas` and `Statefulset desired replicas` should be disabled.
154
+
If in your monitoring case you have a use case where you want to get health states to logical components that do not have any monitors on themselves you can implement a monitor such as
155
+
```
156
+
157
+
```
150
158
151
-
### Aggregated health state of a Deployment
152
159
153
-
The monitor aggregates states of all children ReplicaSets and then returns the most critical health state. ReplicaSets have
154
-
the similar Monitor, so eventually this one aggregates health states of all children ReplicaSets and Pods.
155
-
156
-
### Aggregated health state of a ReplicaSet
157
-
158
-
The monitor aggregates states of all children Pods and then returns the most critical health state.
159
-
160
-
### Aggregated health state of a StatefulSet
161
-
162
-
The monitor aggregates states of all children Pods and then returns the most critical health state.
0 commit comments