Skip to content

Commit 1b35373

Browse files
Add documentation around migration from rollup to downsampling (elastic#107965) (elastic#108124) (elastic#108139)
This change also updated the deprecation warning on all rollup pages from Rollups will be removed in a future version. Use <<downsampling,downsampling>> instead. to Rollups will be removed in a future version. Please <<rollup-migrating-to-downsampling,migrate>> to <<downsampling,downsampling>> instead.. Co-authored-by: Elastic Machine <[email protected]>
1 parent f1ae88c commit 1b35373

9 files changed

+131
-9
lines changed

docs/reference/rollup/api-quickref.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<titleabbrev>API quick reference</titleabbrev>
66
++++
77

8-
deprecated::[8.11.0,"Rollups will be removed in a future version. Use <<downsampling,downsampling>> instead."]
8+
deprecated::[8.11.0,"Rollups will be removed in a future version. Please <<rollup-migrating-to-downsampling,migrate>> to <<downsampling,downsampling>> instead."]
99

1010
Most rollup endpoints have the following base:
1111

docs/reference/rollup/index.asciidoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[[xpack-rollup]]
33
== Rolling up historical data
44

5-
deprecated::[8.11.0,"Rollups will be removed in a future version. Use <<downsampling,downsampling>> instead."]
5+
deprecated::[8.11.0,"Rollups will be removed in a future version. Please <<rollup-migrating-to-downsampling,migrate>> to <<downsampling,downsampling>> instead."]
66

77
Keeping historical data around for analysis is extremely useful but often avoided due to the financial cost of
88
archiving massive amounts of data. Retention periods are thus driven by financial realities rather than by the
@@ -20,6 +20,7 @@ cost of raw data.
2020
* <<rollup-understanding-groups,Understanding rollup grouping>>
2121
* <<rollup-agg-limitations,Rollup aggregation limitations>>
2222
* <<rollup-search-limitations,Rollup search limitations>>
23+
* <<rollup-migrating-to-downsampling,Migrating to downsampling>>
2324

2425

2526
include::overview.asciidoc[]
@@ -28,3 +29,4 @@ include::rollup-getting-started.asciidoc[]
2829
include::understanding-groups.asciidoc[]
2930
include::rollup-agg-limitations.asciidoc[]
3031
include::rollup-search-limitations.asciidoc[]
32+
include::migrating-to-downsampling.asciidoc[]
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
[role="xpack"]
2+
[[rollup-migrating-to-downsampling]]
3+
=== Migrating from {rollup-cap} to downsampling
4+
++++
5+
<titleabbrev>Migrating to downsampling</titleabbrev>
6+
++++
7+
8+
Rollup and downsampling are two different features that allow historical metrics to be rolled up.
9+
From a high level rollup is more flexible compared to downsampling, but downsampling is a more robust and
10+
easier feature to downsample metrics.
11+
12+
The following aspects of downsampling are easier or more robust:
13+
14+
* No need to schedule jobs. Downsampling is integrated with Index Lifecycle Management (ILM) and Data Stream Lifecycle (DSL).
15+
* No separate search API. Downsampled indices can be accessed via the search api and es|ql.
16+
* No separate rollup configuration. Downsampling uses the time series dimension and metric configuration from the mapping.
17+
18+
It isn't possible to migrate all rollup usages to downsampling. The main requirement
19+
is that the data should be stored in Elasticsearch as <<tsds,time series data stream (TSDS)>>.
20+
Rollup usages that basically roll the data up by time and all dimensions can migrate to downsampling.
21+
22+
An example rollup usage that can be migrated to downsampling:
23+
24+
[source,console]
25+
--------------------------------------------------
26+
PUT _rollup/job/sensor
27+
{
28+
"index_pattern": "sensor-*",
29+
"rollup_index": "sensor_rollup",
30+
"cron": "0 0 * * * *", <1>
31+
"page_size": 1000,
32+
"groups": { <2>
33+
"date_histogram": {
34+
"field": "timestamp",
35+
"fixed_interval": "60m" <3>
36+
},
37+
"terms": {
38+
"fields": [ "node" ]
39+
}
40+
},
41+
"metrics": [
42+
{
43+
"field": "temperature",
44+
"metrics": [ "min", "max", "sum" ] <4>
45+
},
46+
{
47+
"field": "voltage",
48+
"metrics": [ "avg" ] <4>
49+
}
50+
]
51+
}
52+
--------------------------------------------------
53+
// TEST[setup:sensor_index]
54+
55+
The equivalent <<tsds,time series data stream (TSDS)>> setup that uses downsampling via DSL:
56+
57+
[source,console]
58+
--------------------------------------------------
59+
PUT _index_template/sensor-template
60+
{
61+
"index_patterns": ["sensor-*"],
62+
"data_stream": { },
63+
"template": {
64+
"lifecycle": {
65+
"downsampling": [
66+
{
67+
"after": "1d", <1>
68+
"fixed_interval": "1h" <3>
69+
}
70+
]
71+
},
72+
"settings": {
73+
"index.mode": "time_series"
74+
},
75+
"mappings": {
76+
"properties": {
77+
"node": {
78+
"type": "keyword",
79+
"time_series_dimension": true <2>
80+
},
81+
"temperature": {
82+
"type": "half_float",
83+
"time_series_metric": "gauge" <4>
84+
},
85+
"voltage": {
86+
"type": "half_float",
87+
"time_series_metric": "gauge" <4>
88+
},
89+
"@timestamp": { <2>
90+
"type": "date"
91+
}
92+
}
93+
}
94+
}
95+
}
96+
--------------------------------------------------
97+
// TEST[continued]
98+
99+
////
100+
[source,console]
101+
----
102+
DELETE _index_template/sensor-template
103+
----
104+
// TEST[continued]
105+
////
106+
107+
The downsample configuration is included in the above template for a <<tsds,time series data stream (TSDS)>>.
108+
Only the `downsampling` part is necessary to enable downsampling, which indicates when to downsample to what fixed interval.
109+
110+
<1> In the rollup job, the `cron` field determines when the rollup documents. In the index template,
111+
the `after` field determines when downsampling will rollup documents (note that this the time after a rollover has been performed).
112+
<2> In the rollup job, the `groups` field determines all dimensions of the group documents are rolled up to. In the index template,
113+
the fields with `time_series_dimension` set `true` and the `@timestamp` field determine the group.
114+
<3> In the rollup job, the `fixed_interval` field determines how timestamps are aggregated as part of the grouping.
115+
In the index template, the `fixed_interval` field has the same purpose. Note that downsampling does not support calendar intervals.
116+
<4> In the rollup job, the `metrics` field define the metrics and how to store these metrics. In the index template,
117+
all fields with a `time_series_metric` are metric fields. If a field has `gauge` as `time_series_metric` attribute
118+
value, then min, max, sum and value counts are stored for this field in the downsampled index. If a field has
119+
`counter` as `time_series_metric` attribute value, then only the last value stored for this field in the downsampled
120+
index.

docs/reference/rollup/overview.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<titleabbrev>Overview</titleabbrev>
66
++++
77

8-
deprecated::[8.11.0,"Rollups will be removed in a future version. Use <<downsampling,downsampling>> instead."]
8+
deprecated::[8.11.0,"Rollups will be removed in a future version. Please <<rollup-migrating-to-downsampling,migrate>> to <<downsampling,downsampling>> instead."]
99

1010
Time-based data (documents that are predominantly identified by their timestamp) often have associated retention policies
1111
to manage data growth. For example, your system may be generating 500 documents every second. That will generate

docs/reference/rollup/rollup-agg-limitations.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[[rollup-agg-limitations]]
33
=== {rollup-cap} aggregation limitations
44

5-
deprecated::[8.11.0,"Rollups will be removed in a future version. Use <<downsampling,downsampling>> instead."]
5+
deprecated::[8.11.0,"Rollups will be removed in a future version. Please <<rollup-migrating-to-downsampling,migrate>> to <<downsampling,downsampling>> instead."]
66

77
There are some limitations to how fields can be rolled up / aggregated. This page highlights the major limitations so that
88
you are aware of them.
@@ -22,4 +22,4 @@ And the following metrics are allowed to be specified for numeric fields:
2222
- Max aggregation
2323
- Sum aggregation
2424
- Average aggregation
25-
- Value Count aggregation
25+
- Value Count aggregation

docs/reference/rollup/rollup-apis.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[[rollup-apis]]
33
== Rollup APIs
44

5-
deprecated::[8.11.0,"Rollups will be removed in a future version. Use <<downsampling,downsampling>> instead."]
5+
deprecated::[8.11.0,"Rollups will be removed in a future version. Please <<rollup-migrating-to-downsampling,migrate>> to <<downsampling,downsampling>> instead."]
66

77
[discrete]
88
[[rollup-jobs-endpoint]]

docs/reference/rollup/rollup-getting-started.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<titleabbrev>Getting started</titleabbrev>
66
++++
77

8-
deprecated::[8.11.0,"Rollups will be removed in a future version. Use <<downsampling,downsampling>> instead."]
8+
deprecated::[8.11.0,"Rollups will be removed in a future version. Please <<rollup-migrating-to-downsampling,migrate>> to <<downsampling,downsampling>> instead."]
99

1010
To use the Rollup feature, you need to create one or more "Rollup Jobs". These jobs run continuously in the background
1111
and rollup the index or indices that you specify, placing the rolled documents in a secondary index (also of your choosing).

docs/reference/rollup/rollup-search-limitations.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[[rollup-search-limitations]]
33
=== {rollup-cap} search limitations
44

5-
deprecated::[8.11.0,"Rollups will be removed in a future version. Use <<downsampling,downsampling>> instead."]
5+
deprecated::[8.11.0,"Rollups will be removed in a future version. Please <<rollup-migrating-to-downsampling,migrate>> to <<downsampling,downsampling>> instead."]
66

77
While we feel the Rollup function is extremely flexible, the nature of summarizing data means there will be some limitations. Once
88
live data is thrown away, you will always lose some flexibility.

docs/reference/rollup/understanding-groups.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[[rollup-understanding-groups]]
33
=== Understanding groups
44

5-
deprecated::[8.11.0,"Rollups will be removed in a future version. Use <<downsampling,downsampling>> instead."]
5+
deprecated::[8.11.0,"Rollups will be removed in a future version. Please <<rollup-migrating-to-downsampling,migrate>> to <<downsampling,downsampling>> instead."]
66

77
To preserve flexibility, Rollup Jobs are defined based on how future queries may need to use the data. Traditionally, systems force
88
the admin to make decisions about what metrics to rollup and on what interval. E.g. The average of `cpu_time` on an hourly basis. This

0 commit comments

Comments
 (0)