Skip to content

Commit 9baf2e6

Browse files
committed
add rate aggregation
1 parent 28c0656 commit 9baf2e6

File tree

4 files changed

+37
-90
lines changed

4 files changed

+37
-90
lines changed

raw-migrated-files/docs-content/serverless/observability-rateAggregation.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

raw-migrated-files/observability-docs/observability/rate-aggregation.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

raw-migrated-files/toc.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,8 @@ toc:
238238
- file: docs-content/serverless/observability-infrastructure-monitoring.md
239239
- file: docs-content/serverless/observability-log-monitoring.md
240240
- file: docs-content/serverless/observability-monitor-datasets.md
241-
- file: docs-content/serverless/observability-monitor-status-alert.md
242241
- file: docs-content/serverless/observability-parse-log-data.md
243242
- file: docs-content/serverless/observability-plaintext-application-logs.md
244-
- file: docs-content/serverless/observability-rateAggregation.md
245243
- file: docs-content/serverless/observability-send-application-logs.md
246244
- file: docs-content/serverless/observability-slos.md
247245
- file: docs-content/serverless/observability-stream-log-files.md
@@ -502,7 +500,6 @@ toc:
502500
- file: observability-docs/observability/monitor-status-alert.md
503501
- file: observability-docs/observability/obs-ai-assistant.md
504502
- file: observability-docs/observability/observability-get-started.md
505-
- file: observability-docs/observability/rate-aggregation.md
506503
- file: observability-docs/observability/slo.md
507504
- file: observability-docs/observability/triage-slo-burn-rate-breaches.md
508505
- file: observability-docs/observability/triage-threshold-breaches.md

solutions/observability/incident-management/rate-aggregation.md

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,43 @@ mapped_urls:
44
- https://www.elastic.co/guide/en/serverless/current/observability-rateAggregation.html
55
---
66

7-
# Rate aggregation
7+
# Rate aggregation [rate-aggregation]
88

9-
% 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.
1010

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).
1212

13-
% - [ ] ./raw-migrated-files/observability-docs/observability/rate-aggregation.md
14-
% - [ ] ./raw-migrated-files/docs-content/serverless/observability-rateAggregation.md
13+
14+
## 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:
17+
18+
`(max_value_in_current_bucket - max_value_in_previous_bucket)/interval_in_seconds`
19+
20+
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:
35+
36+
`(max_value_in_current_bucket - max_value_in_previous_bucket)/interval_in_seconds`, where:
37+
38+
* `max_value_in_current_bucket` [now-1m → now]: 1
39+
* `max_value_in_previous_bucket` [now-2m → now-1m]: 0
40+
* `interval_in_seconds`: 60
41+
42+
The rate calculation would be: `(1 - 0) / 60 = 0.0166666666667`
43+
44+
If you want to alert when the rate of restarts is above 1 within a 1-minute window, you would set the threshold above `0.0166666666667`.
45+
46+
The calculation you need to use depends on the interval that’s selected.

0 commit comments

Comments
 (0)