Commit graph

186 commits

Author SHA1 Message Date
Mary Gouseti
91f4023e27
Expose global retention settings via data stream lifecycle API (#112210)
In this PR we expose the global retention via the `GET
_data_stream/{target}/_lifecycle` API.

Since the global retention is a main feature of the data stream
lifecycle we chose to expose it by default.

```
GET /_data_stream/my-data-stream/_lifecycle
{
 "global_retention": {
      "default_retention": "7d",
      "max_retention": "365d"
  }, 
  "data_streams": [...]
}
```
2024-09-02 18:40:08 +10:00
Mary Gouseti
bed6e18fa3
Exclude internal data streams from global retention (#112100)
With #111972 we enable users to set up global retention for data streams that are managed by the data stream lifecycle. This will allow users of elasticsearch to have a more control over their data retention, and consequently better resource management of their clusters.

However, there is a small number of data streams that are necessary for the good operation of elasticsearch and should not follow user defined retention to avoid surprises.

For this reason, we put forth the following definition of internal data streams.

A data stream is internal if it's either a system index (system flag is true) or if its name starts with a dot.

This PR adds the `isInternalDataStream` param in the effective retention calculation making explicit that this is also used to determine the effective retention.
2024-08-28 11:28:35 +03:00
Mary Gouseti
ed60470518
Display effective retention in the relevant data stream APIs (#112019) 2024-08-22 17:42:49 +03:00
Stef Nestor
c1019d4c5d
(Doc+) Link API doc to parent object - part1 (#111951)
* (Doc+) Link API to parent Doc part1

---------

Co-authored-by: shainaraskas <shaina.raskas@elastic.co>
Co-authored-by: shainaraskas <58563081+shainaraskas@users.noreply.github.com>
2024-08-20 14:58:18 -06:00
Felix Barnsteiner
3090438037
Add support for boolean dimensions (#111457)
Closes #111338
2024-07-31 23:00:32 +10:00
Salvatore Campagna
0f584176ca
Rename logs index mode to logsdb (#111054) 2024-07-19 13:38:58 +02:00
Martijn van Groningen
22005952c6
Adding minimal docs around using index mode logs. (#110932)
This adds minimal docs  around how to the new logs index mode for data
streams (most common use case). This is minimal because logs index mode
is still in tech preview. Minimal docs should allow any interested users
to experiment with the new logs index mode.
2024-07-18 03:52:58 +10:00
Liam Thompson
cadb3f9325
Remove typo put-lifecycle.asciidoc (#110875) (#110918) 2024-07-17 08:12:52 +01:00
Oleksandr Kolomiiets
276ae121c2
Reflect latest changes in synthetic source documentation (#109501) 2024-07-04 09:48:04 -07:00
Oleksandr Kolomiiets
b68e7d76c9
Remove obsolete sentence from TSDS docs (#110162) 2024-06-26 08:21:52 -07:00
Kostas Krikellas
3afd53e26a
Remove average from downsampling statistics in documentation (#110189) 2024-06-26 17:23:06 +03:00
Martijn van Groningen
851e955181
Remove obsolete information about tsdb dimensions limit. (#110047) 2024-06-25 11:41:25 +02:00
Martijn van Groningen
1b0e800f5b
Add a note about enabling time series index mode via a component template (#110050)
Closes #109149
2024-06-25 17:22:31 +10:00
Niels Bauman
ba91bfdc94
Lazily create the failure store (#109289)
Rather than initializing the failure store right away when a new
data stream is created, we leave it empty and mark it for lazy
rollover. This results in the failure store only being initialized
(i.e. an index created) when a failure has actually occurred.

The exception to the rule is when a failure occurs while the data
stream is being auto-created. In that case, we do want to initialize
the failure store right away.
2024-06-19 13:18:47 +02:00
Karen Metts
f4d87e0f25
[DOCS] Add note that Logstash sets up data streams (#109502) 2024-06-10 12:24:23 -04:00
Oleksandr Kolomiiets
eedc2b9354
Fix typo in TSDB documentation (#109504) 2024-06-10 06:24:05 -07:00
Martijn van Groningen
29ccca3ddf
Adjust index.mapping.dimension_fields.limit index setting default in docs. (#109091) 2024-05-31 10:52:31 +02:00
Nick Tindall
3ecdd77e97
[DOCS] Align docs to implementation for timeout parameters (#108593)
* [DOCS] Fix documentation for timeout-related parameters

Closes #108224
2024-05-16 13:05:39 +10:00
Niels Bauman
920290a37b
Extract DataStreamIndices from DataStream class (#107562)
We were seeing more and more common fields between "regular" backing indices and failure store indices (i.e. `indices`, `rolloverOnWrite`, `autoShardingEvent`). To avoid having to duplicate these fields (and possibly any future fields), we extract a class that contains these fields.
2024-05-14 11:14:13 +02:00
Martijn van Groningen
924ae5f2f7
Simplify tsds getting started (#108090)
* By only using index templates.
* Removing the usage and mentioning of index.routing_path index setting.
2024-05-01 08:33:38 -04:00
Oleksandr Kolomiiets
a037e33659
Add documentation for configuring downsampling using DSL (#108043) 2024-04-30 09:23:39 -07:00
Lee Hinman
87928b2303
GA data stream lifecycles in documentation (#107582)
This commit removes the warning about techincal preview for the data stream lifecycle documentation pages.
2024-04-18 09:09:44 -06:00
Mary Gouseti
732c7c4c30
[DSL] Remove REST APIs for global retention (#107565) 2024-04-17 21:36:26 +03:00
Liam Thompson
33a71e3289
[DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413)
* Remove `es-test-dir` book-scoped variable

* Remove `plugins-examples-dir` book-scoped variable

* Remove `:dependencies-dir:` and `:xes-repo-dir:` book-scoped variables

- In `index.asciidoc`, two variables (`:dependencies-dir:` and `:xes-repo-dir:`) were removed.
- In `sql/index.asciidoc`, the `:sql-tests:` path was updated to fuller path
- In `esql/index.asciidoc`, the `:esql-tests:` path was updated idem

* Replace `es-repo-dir` with `es-ref-dir`

* Move `:include-xpack: true` to few files that use it, remove from index.asciidoc
2024-04-17 14:37:07 +02:00
Lee Hinman
91bdfb84a0
Clarify data stream recommendations and best practices (#107233)
* Clarify data stream recommendations and best practices

Our documentation around data streams versus aliases could be interpreted in a way where someone doing *any* updates thinks they need to use an alias with indices instead of a data stream. This commit enhances the documentation around these areas to determine the correct abstraction in a more concrete way. It also tries to clarify that data streams still allow updates to the backing indices, and that a difference is last-write-wins versus first-write-wins.
2024-04-08 13:41:53 -06:00
Mary Gouseti
2122da31cd
[DSL] Introduce data stream global retention - Part 3 (#105682)
In this PR we introduce the API that will expose the global retention configuration and will allow users to take advantage of it.

These APIs are protected by the dedicated introduced privileges:

`manage_data_stream_global_retention` or higher, which allows all operations on the global retention configuration
`monitor_data_stream_retention` or higher, which allows the retrieval of the global retention configuration.

This PR is the final PR that makes the global retention available for our users.
2024-03-28 10:40:33 +02:00
Mary Gouseti
2988799079
[DSL Global Retention] Use data stream global retention metadata (#106221) 2024-03-20 20:27:08 +02:00
Joe Gallo
38168407ef
Docs typo fix (#105835) (#106002)
Co-authored-by: MikhailBerezhanov <35196259+MikhailBerezhanov@users.noreply.github.com>
2024-03-06 07:45:13 -05:00
Kostas Krikellas
c4c2ce83cb
Downsampling supports date_histogram with tz (#103511)
* Downsampling supports date_histogram with tz

This comes with caveats, for downsampled indexes at intervals more than
15 minutes. For instance,
 - 1-hour downsampling will produce inaccurate
results for 1-hour histograms on timezones shifted by XX:30
 - 1-day downsampling will produce inaccurate daily
histograms for not-UTC timezones as it tracks days at UTC.

Related to #101309

* Update docs/changelog/103511.yaml

* test daylight savings

* update documentation

* Offset time buckets over downsampled data with TZ

* Update docs/changelog/103511.yaml

* check for TSDS

* fixme for transport version

* add interval to index metadata

* add transport version

* bump up transport version

* address feedbcak

* spotless fix
2024-01-16 10:27:33 +02:00
Martijn van Groningen
4b8d99252d
Update documentation around index.look_ahead_time setting. (#103975)
Adjusted the default after #103898
2024-01-10 09:48:17 +01:00
Mary Gouseti
046cdeae23
Introduce lazy rollover for mapping updates in data streams (#103309)
In this PR we implement the idea to introduce a flag, that a data stream needs to be rolloved over before the next document is indexed.
2024-01-08 15:07:16 +02:00
Martijn van Groningen
842303cd7f
Lower the look_ahead_time setting's maximum value. (#103434)
Initially the index.look_head_time was both used to define the index.time_series.start_time and index.time_series.end_time.

The former is now controlled by index.look_back_time and the maximum value of 7 days for index.look_ahead_time is too generous. As it also delays data being indexed to new index after rollover by up to 7 days.

This PR changes the index.look_ahead_time setting's maximum allowed value from 7 days to 2 hours, which is equal to the index.look_ahead_time setting's default. A look ahead time of 2 hours is high enough to accept data that is ahead of the current time, but avoids configuring the index.look_ahead_time setting to a too high value that causes rolled over indices to not receive writes for a very long period.

This is a breaking change, but configuring the index.look_ahead_time setting to a higher value than 2 hours will not fail. Instead 2 hours will be used a look ahead time.
2023-12-20 09:00:04 +01:00
Martijn van Groningen
c7021050f1
Slightly simplify setup tsds section (#103475)
* By not encouraging to use index.look_ahead index setting. The default should would well out of the box and changing this setting can cause tsds to not work correctly.
* Not mentioning the index.codec setting. This is a low level setting has no real benefit in case of tsds. And setting it to best compression can hurt performance without any real benefit.
2023-12-18 11:39:10 +01:00
Andrei Dan
17811280c2
[DOCS] DSL downsampling docs (#103148) 2023-12-08 06:52:18 -05:00
Andrei Dan
2212df73e8
[DOCS] migrate ILM to DSL headings and TLDR (#102068)
This adds some headings and a TL;DR section to the migration to DSL
tutorial.
2023-11-23 06:37:16 -05:00
Mary Gouseti
5a3409b7c5
ES-6566: [DSL] Introduce new endpoint to expose data stream lifecycle stats (#101845) 2023-11-20 10:38:41 +02:00
James Baiera
6fa7f60073
Add ability to create a data stream failure store (#99134)
Adds the ability to configure a data stream to create a new kind of backing index called a failure store which will eventually be used to store error information when ingest pipelines fail to ingest a document or when a document fails to be parsed correctly by the configured mapping on the data stream.
2023-11-15 15:32:51 -05:00
Andrei Dan
6054a5eb18
[DOCS] Fix typo (#101791) 2023-11-13 06:07:03 -05:00
Andrei Dan
7b436bae2c
[DOCS] DSL: More visible tech preview tags (#101313) 2023-10-26 12:06:15 +01:00
Andrei Dan
74ea04fb2d
[DOCS] document tail merging and create tutorial for migrating to DSL (#101117)
This documents tail merging, the enabled flag, and
adds a tutorial to migrate a data stream from ILM to DSL.
2023-10-25 11:12:36 +01:00
Martijn van Groningen
311185311f
Remove index.codec setting from setting up tsdb docs. (#101276)
This is not needed for tsdb, because of synthetic source and slows down indexing / refreshes.
2023-10-25 08:21:18 +02:00
Andrei Dan
632c97b234
Document ILM waits for tsds end_time to lapse in some actions (#100204) 2023-10-04 07:55:58 -04:00
Andrei Dan
839afdc331
Promote the Data stream lifecycle feature to Technical Preview (#100187)
This releases the Data stream lifecycle feature as a
Technical Preview feature.

Data stream lifecycle, albeit in technical preview, will allow data streams
to take advantage of a native simplified and resilient lifecycle implementation.
2023-10-03 17:12:35 +01:00
Andrei Dan
1369ff2b78
Remove managing ds by default for now (#100149)
This removes the DSL functionality that would automatically
configure the lifecycle to all new data streams in preparation
for marking Data stream lifecycle as ready for Technical Preview.
2023-10-02 20:28:31 +01:00
Andrei Dan
f202ad02fe
GET _data_stream displays both ILM and DSL information (#99947)
This add support to the `GET _data_stream` API for displaying the value
of the `index.lifecycle.prefer_ilm` setting both at the backing index
level and at the top level (top level meaning, similarly to the existing
`ilm_policy` field, the value in the index template that's backing the
data stream), an `ilm_policy` field for each backing index displaying
the actual ILM policy configured for the index itself, a `managed_by`
field for each backing index indicating who manages this index (the
possible values are: `Index Lifecycle Management`, `Data stream
lifecycle`, and `Unmanaged`).

This also adds a top level field to indicate which system would manage
the next generation index for this data stream based on the current
configuration. This field is called `next_generation_managed_by` and the
same values as the indices level `managed_by` field has are available.

An example output for a data stream that has 2 backing indices managed
by ILM and the write index by DSL:

```
{
	"data_streams": [{
		"name": "datastream-psnyudmbitp",
		"timestamp_field": {
			"name": "@timestamp"
		},
		"indices": [{
			"index_name": ".ds-datastream-psnyudmbitp-2023.09.27-000001",
			"index_uuid": "kyw0WEXvS8-ahchYS10NRQ",
                        "prefer_ilm": true,
			"ilm_policy": "policy-uVBEI",
			"managed_by": "Index Lifecycle Management"
		}, {
			"index_name": ".ds-datastream-psnyudmbitp-2023.09.27-000002",
			"index_uuid": "pDLdc4DERwO54GRzDr4krw",
			"prefer_ilm": true,
			"ilm_policy": "policy-uVBEI",
			"managed_by": "Index Lifecycle Management"
		}, {
			"index_name": ".ds-datastream-psnyudmbitp-2023.09.27-000003",
			"index_uuid": "gYZirLKcS3mlc1c3oHRpYw",
			"prefer_ilm": false,
			"ilm_policy": "policy-uVBEI",
                        "managed_by": "Data stream lifecycle"
		}],
		"generation": 3,
		"status": "YELLOW",
		"template": "indextemplate-obcvkbjqand",
		"lifecycle": {
			"enabled": true,
			"data_retention": "90d"
		},
		"ilm_policy": "policy-uVBEI",
                "next_generation_managed_by": "Data stream lifecycle",
		"prefer_ilm": false,
		"hidden": false,
		"system": false,
		"allow_custom_routing": false,
		"replicated": false
	}]
}
```
2023-09-28 13:48:17 -04:00
James Rodewig
ed8ea1f206
[main] [DOCS] Time series indices support non-metric/dimension fields (#99709) (#99811)
Co-authored-by: James Rodewig <james.rodewig@elastic.co>
Co-authored-by: Gilad Gal <gilad.gal@elastic.co>
2023-09-22 09:11:29 -04:00
Kostas Krikellas
b1da97af17
Document how to reindex a TSDS (#99476)
* Document how to reindex a TSDS

Time-series data streams require updating start and end times in the
destination index template, to avoid errors during copying of older
docs.

* Update docs/changelog/99476.yaml

* Spotless fix.

* Refresh indexes in unittest.

* Fix typo.

* Delete docs/changelog/99476.yaml

* Fix page link name.

* Update docs/reference/data-streams/tsds-reindex.asciidoc

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>

* Update docs/reference/data-streams/tsds-reindex.asciidoc

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>

* Update docs/reference/data-streams/tsds-reindex.asciidoc

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>

* Update docs/reference/data-streams/tsds-reindex.asciidoc

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>

* Update docs/reference/data-streams/tsds-reindex.asciidoc

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>

* Update docs/reference/data-streams/tsds-reindex.asciidoc

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>

* Update docs/reference/data-streams/tsds-reindex.asciidoc

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>

* Update docs/reference/data-streams/tsds-reindex.asciidoc

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>

* Update docs/reference/data-streams/tsds-reindex.asciidoc

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>

* Update docs/reference/data-streams/tsds-reindex.asciidoc

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>

---------

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
2023-09-13 18:28:03 +03:00
James Rodewig
255c9a7f95
[DOCS] Move x-pack docs to docs/reference dir (#99209)
**Problem:**
For historical reasons, source files for the Elasticsearch Guide's security, watcher, and Logstash API docs are housed in the `x-pack/docs` directory. This can confuse new contributors who expect Elasticsearch Guide docs to be located in `docs/reference`. 

**Solution:**
- Move the security, watcher, and Logstash API doc source files to the `docs/reference` directory
- Update doc snippet tests to use security

Rel: https://github.com/elastic/platform-docs-team/issues/208
2023-09-12 14:53:41 -04:00
Martijn van Groningen
3e3ee42589
Add index.look_back_time setting for tsdb data streams (#98518)
This change adds a `index.look_back_time` index setting that sets the `index.time_series.start_time` setting for the first backing index when a data stream is created.

This allows accepting data that is older for initial indexing without changing the `index.look_ahead_time` setting. This setting also controls the `index.time_series.end_time` setting and would affect rollovers as well.

The default for the `index.look_back_time` is `2h`, which means documents with `@timestamp` up to 2 hours after creation of the data stream are allowed to be indexed. This is the same as is without this change, because `index.look_ahead_time` is used to set `index.time_series.start_time` of the first backing index.

Closes #98463
2023-09-08 11:11:43 +02:00
Mary Gouseti
b9b818e28e
Allow explain data stream lifecycle to accept a data stream. (#98811)
Currently the `GET target/_lifecycle/explain` API only works for
indices. In this PR we extend this behaviour to allow the target to be a
data stream so we can get the overview lifecycle status for all the
backing indices of a data stream.
2023-08-24 06:29:09 -04:00