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
% What needs to be done: Align serverless/stateful
9
+
You can use a rate aggregation to analyze the rate at which a specific field changes over time. This type of aggregation is useful when you want to analyze fields like counters.
10
10
11
-
% Use migrated content from existing pages that map to this page:
11
+
For example, imagine you have a counter field called restarts that increments each time a service restarts. You can use rate aggregation to get an alert if the service restarts more than X times within a specific time window (for example, per day).
## How rates are calculated [how-rates-are-calculated]
15
+
16
+
Rates used in alerting rules are calculated by comparing the maximum value of the field in the previous bucket to the maximum value of the field in the current bucket and then dividing the result by the number of seconds in the selected interval. For example, if the value of the restarts increases, the rate would be calculated as:
In this example, let’s assume you have one document per bucket with the following data:
21
+
22
+
```json
23
+
{
24
+
"timestamp": 0000,
25
+
"restarts": 0
26
+
}
27
+
28
+
{
29
+
"timestamp": 60000,
30
+
"restarts": 1
31
+
}
32
+
```
33
+
34
+
Let’s assume the timestamp is a UNIX timestamp in milliseconds, and we started counting on Thursday, January 1, 1970 12:00:00 AM. In that case, the rate will be calculated as follows:
0 commit comments