Commit Graph

693 Commits

Author SHA1 Message Date
Felix Barnsteiner 75d9bd7790
Rename component templates and pipelines according to the new naming conventions (#99975)
- Creates a new StackTemplateRegistry that uses the new names
- The new registry only respects stack.templates.enabled for index templates
- Renames the old registry to LegacyStackTemplateRegistry
- Component templates are not duplicated but registered under two different names
- Documents the new naming convention
- Index templates are not renamed, at least for now, as there are some challenges with it
  See 7fd0423 for more details.
2023-10-25 11:56:28 +02:00
gchaps cfa11d2df3
[DOCS] Adds enrich policies and data retention for Index Management (#100922)
* [DOCS] Adds enrich policies and data retention for Index Management

* Update docs/reference/indices/index-mgmt.asciidoc

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

* Update docs/reference/indices/index-mgmt.asciidoc

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

* Update docs/reference/indices/index-mgmt.asciidoc

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

* Update docs/reference/indices/index-mgmt.asciidoc

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

* Update docs/reference/indices/index-mgmt.asciidoc

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

* [DOCS] Incorporates review comments

---------

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
2023-10-19 07:24:52 -07: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 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
Yulia Čech d6526f8d4b
[Index Management] Update docs screenshots with for the new index details page (#99973) 2023-09-28 13:41:53 +02:00
David Turner 8b2a9c646b
Add breaking change docs for #92820 (#99849)
In #92820 we adjusted the indices resolve API to use the
`IndexNameExpressionResolver` to align its behaviour with other similar
APIs, but this was a subtle breaking change in its behaviour when there
were no matching indices. This adds a note in the docs to record this
change in behaviour.
2023-09-27 16:00:22 +01:00
Joe Gallo 404aa77849
Fix a typo in the data_stream _stats API documentation (#99438) 2023-09-11 15:13:50 -04:00
Simon Cooper 9538208fb7
Fix shard-stores doc test (#98581)
The replacement wasn't actually doing anything due to different JSON types
2023-08-17 11:38:31 +01:00
amyjtechwriter 7e907f804a
[DOCS]Corrections for index-mgmt page. (#98481)
* Corrections for index-mgmt page.

* Update docs/reference/indices/index-mgmt.asciidoc

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

---------

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
2023-08-15 16:38:04 +01:00
Mary Gouseti e71ea6e6d7
Add data stream lifecycle by default (#97823)
In this PR we enable all new data streams to be managed by the data
stream lifecycle by default. This is implemented by adding an empty
`lifecycle: {}` upon new data stream creation. 

Opting out is represented by a the `enabled` flag:

```
{
  "lifecycle": {
    "enabled": false
  }
}
```

This change has the following implications on when is an index managed
and by which feature:

| Parent data stream lifecycle| ILM| `prefer_ilm`|Managed by|
|----------------------------|----|----------------|-| | default | yes|
true| ILM| | default | yes| false| data stream lifecycle| |default |
no|true/false|data stream lifecycle| |opt-out or
missing|yes|true/false|ILM| |opt-out or missing|no|true/false|unmanaged|

Data streams that have been created before the data stream lifecycle is
enabled will not have the default lifecycle.

Next steps: - We need to document this when the feature will be GA
(https://github.com/elastic/elasticsearch/issues/97973).
2023-08-11 06:28:37 -04:00
Martijn van Groningen 297a0134ce
Add tsdb metrics builtin component template (#97602)
Fleet is currently hard coded to set index.codec to best_compression (deflate compression). This is good for most data streams, except for data streams were tsdb is enabled. Ideally Fleet doesn't need to set this setting at all and Elasticsearch's default would be good. But unfortunately this isn't the case. It default to default (lz4 - optimised for speed), which in would mean much higher disk space usage. Ideally the default would be default when synthetic source is enabled and otherwise best_compression. Changing this now, would mean a breaking change.

Instead Fleet like to depend on Elasticsearch's internal component templates. To at least abstract some of the internal details away. The metrics-settings is ok for non tsdb, but there is no component template for tsdb metrics. This PR adds this.

Relates to elastic/kibana#160288
2023-08-10 16:19:06 +07:00
Mary Gouseti 09d396a91f
Change test tear down to only remove resources created by the test (#98060) 2023-07-31 17:23:37 +03:00
amyjtechwriter a80d9cb289
Index Management now has link to Discover in UI. (#96326)
* Index Management now has link to Discover in UI.

* updating screenshot for data streams section

* Update docs/reference/indices/index-mgmt.asciidoc

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

* Update docs/reference/indices/index-mgmt.asciidoc

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

---------

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
2023-07-24 12:31:15 +01:00
Mary Gouseti a432313ff3
Data stream lifecycle class names (#97381) 2023-07-05 12:28:32 +03:00
Simon Cooper 5d1f616c50
Fix format of DiscoveryNode xcontent index version fields (#97223)
Also changed the value to an int rather than a string to differentiate it from node version
2023-06-29 16:53:38 +01:00
Mary Gouseti 1abd51b167
Start with data stream lifecycle documentation (#95326) 2023-06-28 16:18:05 +03:00
Simon Cooper 3726113f06
Add IndexVersion to cluster state (#96258)
This adds IndexVersion to cluster state, alongside node version. This is needed so IndexVersion can be tracked across the cluster, allowing min/max supported index versions to be determined.
2023-06-27 10:52:00 +01:00
Mary Gouseti c8e676aea8
Rebranding user facing DLM references (#96866)
Part of bigger rebranding effort (#96875)
2023-06-20 14:32:24 +03:00
John Verwolf 5002c5f334
Docs: Improve the Field Usage Stats API Documentation (#96333)
Adds descriptions of the values returned in the response body of the _field_usage_stats API.

Closes #88313
2023-06-01 09:56:47 -07:00
debadair 777598d602
[DOCS] Remove redirect pages (#88738)
* [DOCS] Remove manual redirects

* [DOCS] Removed refs to modules-discovery-hosts-providers

* [DOCS] Fixed broken internal refs

* Fixing bad cross links in ES book, and adding redirects.asciidoc[] back into docs/reference/index.asciidoc.

* Update docs/reference/search/point-in-time-api.asciidoc

Co-authored-by: James Rodewig <james.rodewig@elastic.co>

* Update docs/reference/setup/restart-cluster.asciidoc

Co-authored-by: James Rodewig <james.rodewig@elastic.co>

* Update docs/reference/sql/endpoints/translate.asciidoc

Co-authored-by: James Rodewig <james.rodewig@elastic.co>

* Update docs/reference/snapshot-restore/restore-snapshot.asciidoc

Co-authored-by: James Rodewig <james.rodewig@elastic.co>

* Update repository-azure.asciidoc

* Update node-tool.asciidoc

* Update repository-azure.asciidoc

---------

Co-authored-by: amyjtechwriter <61687663+amyjtechwriter@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Amy Jonsson <amy.jonsson@elastic.co>
Co-authored-by: James Rodewig <james.rodewig@elastic.co>
2023-05-24 12:32:46 +01:00
Martijn van Groningen 49e8ee4269
Remove remaining tsdb tech preview labels (#95563)
Remove tech preview label from a number of tsdb settings and mapping attributes.
2023-04-26 12:11:03 +02:00
Toby Sutor ba9dc81115
[docs] Clarify that index template settings take precedence over comp… (#87374)
* [docs] Clarify that index template settings take precedence over component templates.

[docs] Clarify that index template settings take precedence over component templates.

* Update docs/reference/indices/index-templates.asciidoc

Co-authored-by: Adam Locke <adam.locke@chronosphere.io>

---------

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
Co-authored-by: Adam Locke <adam.locke@chronosphere.io>
2023-04-19 09:18:33 +02:00
Cauê Marcondes 91cd61a454
[Fleet] Support for Profiling symbolization (#95241)
* It adds the profiling index pattern profiling-* to the fleet server service privileges.
* And adds profiling-* to kibana system role privileges.

---------

Co-authored-by: Daniel Mitterdorfer <daniel.mitterdorfer@elastic.co>
2023-04-18 07:12:44 +02:00
Mary Gouseti 1af2f438a3
[DLM] Extend the simulate template API to support include defaults (#94861) 2023-04-04 11:25:35 +02:00
David Turner e377a8601a
Simplify `IndicesShardStoresAction` (#94507)
- No need to use an `AsyncShardFetch` here, there is no caching
- Response may be very large, introduce chunking
- Fan-out may be very large, introduce throttling
- Processing time may be nontrivial, introduce cancellability
- Eliminate many unnecessary intermediate data structures
- Do shard-level response processing more eagerly
- Determine allocation from `RoutingTable` not `RoutingNodes`
- Add tests

Relates #81081
2023-03-27 11:34:07 -04:00
Mary Gouseti fe20d923ae
[DLM] Introduce default rollover cluster setting & expose it via APIs (#94240)
For managing data streams with DLM we chose to have one cluster setting that will determine the rollover conditions for all data streams. This PR introduces this cluster setting, it exposes it via the 3 existing APIs under the flag `include_defaults` and adjusts DLM to use it. The feature remains behind a feature flag.
2023-03-07 16:41:32 +01:00
Steve Gordon a7e65e3b2d
Fix get data stream documentation (#94009)
The documentation specifies the possible values for the status of the response. This endpoint is inconsistent with most others that expose the health status as it returns the values as uppercase strings rather than lowercase. 

This PR fixes the cases in the documentation to align with the actual values returned in the response body.
2023-02-22 13:46:04 +00:00
Nicolas Ruflin 9f4d7fafad
Add `ignore_missing_component_templates` config option (#92436)
This change introduces the configuration option `ignore_missing_component_templates` as discussed in https://github.com/elastic/elasticsearch/issues/92426 The implementation [option 6](https://github.com/elastic/elasticsearch/issues/92426#issuecomment-1372675683) was picked with a slight adjustment meaning no patterns are allowed.

## Implementation

During the creation of an index template, the list of component templates is checked if all component templates exist. This check is extended to skip any component templates which are listed under `ignore_missing_component_templates`. An index template that skips the check for the component template `logs-foo@custom` looks as following:


```
PUT _index_template/logs-foo
{
  "index_patterns": ["logs-foo-*"],
  "data_stream": { },
  "composed_of": ["logs-foo@package", "logs-foo@custom"],
  "ignore_missing_component_templates": ["logs-foo@custom"],
  "priority": 500
}
```

The component template `logs-foo@package` has to exist before creation. It can be created with:

```
PUT _component_template/logs-foo@custom
{
  "template": {
    "mappings": {
      "properties": {
        "host.ip": {
          "type": "ip"
        }
      }
    }
  }
}
```

## Testing

For manual testing, different scenarios can be tested. To simplify testing, the commands from `.http` file are added. Before each test run, a clean cluster is expected.

### New behaviour, missing component template

With the new config option, it must be possible to create an index template with a missing component templates without getting an error:

```
### Add logs-foo@package component template

PUT http://localhost:9200/
    _component_template/logs-foo@package
Authorization: Basic elastic password
Content-Type: application/json

{
  "template": {
    "mappings": {
      "properties": {
        "host.name": {
          "type": "keyword"
        }
      }
    }
  }
}

### Add logs-foo index template

PUT http://localhost:9200/
    _index_template/logs-foo
Authorization: Basic elastic password
Content-Type: application/json

{
  "index_patterns": ["logs-foo-*"],
  "data_stream": { },
  "composed_of": ["logs-foo@package", "logs-foo@custom"],
  "ignore_missing_component_templates": ["logs-foo@custom"],
  "priority": 500
}

### Create data stream

PUT http://localhost:9200/
    _data_stream/logs-foo-bar
Authorization: Basic elastic password
Content-Type: application/json

### Check if mappings exist

GET http://localhost:9200/
    logs-foo-bar
Authorization: Basic elastic password
Content-Type: application/json
```

It is checked if all templates could be created and data stream mappings are correct.

### Old behaviour, with all component templates

In the following, a component template is made optional but it already exists. It is checked, that it will show up in the mappings:

```
### Add logs-foo@package component template

PUT http://localhost:9200/
    _component_template/logs-foo@package
Authorization: Basic elastic password
Content-Type: application/json

{
  "template": {
    "mappings": {
      "properties": {
        "host.name": {
          "type": "keyword"
        }
      }
    }
  }
}

### Add logs-foo@custom component template

PUT http://localhost:9200/
    _component_template/logs-foo@custom
Authorization: Basic elastic password
Content-Type: application/json

{
  "template": {
    "mappings": {
      "properties": {
        "host.ip": {
          "type": "ip"
        }
      }
    }
  }
}

### Add logs-foo index template

PUT http://localhost:9200/
    _index_template/logs-foo
Authorization: Basic elastic password
Content-Type: application/json

{
  "index_patterns": ["logs-foo-*"],
  "data_stream": { },
  "composed_of": ["logs-foo@package", "logs-foo@custom"],
  "ignore_missing_component_templates": ["logs-foo@custom"],
  "priority": 500
}

### Create data stream

PUT http://localhost:9200/
    _data_stream/logs-foo-bar
Authorization: Basic elastic password
Content-Type: application/json

### Check if mappings exist

GET http://localhost:9200/
    logs-foo-bar
Authorization: Basic elastic password
Content-Type: application/json
```

### Check old behaviour

Ensure, that the old behaviour still exists when a component template is used that is not part of `ignore_missing_component_templates`: 

```
### Add logs-foo index template

PUT http://localhost:9200/
    _index_template/logs-foo
Authorization: Basic elastic password
Content-Type: application/json

{
  "index_patterns": ["logs-foo-*"],
  "data_stream": { },
  "composed_of": ["logs-foo@package", "logs-foo@custom"],
  "ignore_missing_component_templates": ["logs-foo@custom"],
  "priority": 500
}
```

Co-authored-by: Lee Hinman <dakrone@users.noreply.github.com>
2023-01-31 08:40:29 -07:00
Ievgen Degtiarenko abbc78dc0f
Add version to discovery node toXContent and toString (#93307) 2023-01-30 10:10:49 +01:00
David Kilfoyle 3f880613f8
[Docs] Remove tech preview notice from downsampling docs (#92913) 2023-01-19 09:05:59 -05:00
Abdon Pijpelink 64ce4d1189
[DOCS] Downsampling code snippet formatting (#92981) 2023-01-17 15:31:25 +01:00
Lee Hinman f04c751997
Mark simulate index API non-experimental in documentation (#92331)
This has been stable for a long time, we just missed removing the experimental[] tag in the docs.
2022-12-13 11:34:32 -07:00
David Turner 671fe3faac
Clarify index recovery docs (#91861)
Mentions that we only report on recoveries for shard copies that
actually exist in the cluster, so you don't see all historical data if,
e.g., the shard copy relocates elsewhere.
2022-11-24 16:21:51 +00:00
Anthony McGlone 47e3b89176
[DOCS] Clarify multi-field addition requires update by query for existing documents (#91541)
* [DOCS] Clarify multi-field addition requires update by query for existing documents

* Update docs/reference/mapping/params/multi-fields.asciidoc

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

* Update docs/reference/indices/put-mapping.asciidoc

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

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
2022-11-18 12:38:04 +01:00
David Kilfoyle cad87c4d5a
[DOCS] Add Downsampling docs (#88571)
This adds documentation for downsampling of time series indices.
2022-10-12 12:10:16 -04:00
Julie Tibshirani 9f0f02d232
Make force merge warning more precise (#90151)
We tell users not to force merge unless their index is read-only. This PR
proposes to soften the warning and make it more precise. This way, more users
can consider force merging for their use case, like those with append-only
indices, or those with a small number of updates that can regularly perform a
force merge.
2022-09-26 12:07:13 -07:00
David Kilfoyle 2a44a8982f
[DOCS] Remove feature flag from TSDS docs (#89673)
* Docs: Remove feature flag and add preview label to TSDS docs

* Fix technical preview tag
2022-08-29 10:33:55 -04:00
Joe Gallo 3bde177fea
Rollover min_* conditions docs and highlight (#89434) 2022-08-17 15:24:18 -04:00
Julie Tibshirani abd561a277
Support kNN vectors in disk usage action (#88785)
This change adds support for kNN vector fields to the `_disk_usage` API. The
strategy:
* Iterate the vector values (using the same strategy as for doc values) to
estimate the vector data size
* Run some random vector searches to estimate the vector index size 

Co-authored-by: Yannick Welsch <yannick@welsch.lu>

Closes #84801
2022-07-26 07:57:47 -07:00
David Kilfoyle 40e9f3097c
[DOCS] Add TSDS docs, take two (#87703)
* Revert "Revert "[DOCS] Add TSDS docs (#86905)" (#87702)"

This reverts commit 0c86d7b9b2.

* First fix to tests

* Add data_stream object to index template

* small rewording

* Add enable data stream object in gradle example setup

* Add bullet about data stream must be enabled in template
2022-06-16 12:44:10 -04:00
David Kilfoyle 0c86d7b9b2
Revert "[DOCS] Add TSDS docs (#86905)" (#87702)
Reverts elastic/elasticsearch#86905
2022-06-15 13:32:12 -04:00
David Kilfoyle d57f4ac2c6
[DOCS] Add TSDS docs (#86905)
* [DOCS] Add TSDB docs

* Update docs/build.gradle

Co-authored-by: Adam Locke <adam.locke@elastic.co>

* Address Nik's comments, part 1

* Address Nik's comments, part deux

* Reword write index

* Add feature flags

* Wrap one more section in feature flag

* Small fixes

* set index.routing_path to optional

* Update storage reduction value

* Update create index template code example

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
Co-authored-by: Adam Locke <adam.locke@elastic.co>
2022-06-15 12:22:07 -04:00
Ryan Ernst dd686ebe6d
Fix expand_wildcards default in docs (#87086)
The get settings api has accepts the expand_wildcards option. The docs
state the default value is `all`, but it is actually now `open` (which
does not include hidden or closed indices by default). This commit
changes the docs to match the existing behavior.
2022-05-24 13:11:35 -07:00
Adam Locke 53b55a711b
Rectified the "Add lifecycle policy" hyperlink. (#86717) (#86735)
"Add" was out of the hyperlink context which I have fixed it.

Earlier line 71 was like : * *Add*  <<set-up-lifecycle-policy,*lifecycle policy*>>

After rectifying line 71 is like : * <<set-up-lifecycle-policy,*Add lifecycle policy*>>

(cherry picked from commit 3b8d51c696)

Co-authored-by: Tapomoy Bhowmik <99604828+TapomoyBhowmik@users.noreply.github.com>
2022-05-12 10:22:40 -04:00
Francisco Fernández Castaño ce9819fa6c
Keep track of desired nodes cluster membership (#84165)
This commit adds tracking for desired nodes cluster membership.

When desired nodes are updated they are matched against the current
cluster members. Additionally when a node joins the cluster the
desired nodes cluster membership is updated.
2022-05-03 14:06:48 +02:00
William Brafford 03985f1953
Provide 'system' attribute when resolving system indices (#85042)
* Resolve indices api: add 'system' attribute
* Update docs/changelog/85042.yaml
* Remove magic strings for attribute values
* Update API docs to provide possible resolved index attributes
2022-03-22 11:40:42 -04:00
Dan Roscigno 37beabcb2e
reorder and merge data management and ILM doc pages (#84679)
* reorder and merge data management and ILM doc pages

* update abbreviated titles
2022-03-07 18:33:28 -05:00
Abele Mălan 9ecb96fcf3
Fix some typos in plugins & reference docs (#84667)
This pull request removes a few instances of duplicate words or
punctuation and erroneous spelling from the docs.
2022-03-07 12:29:58 -05:00
Joe Gallo 119fbcf64e
[DOCS] Fix shrink index API prereqs (#84197) 2022-02-21 16:17:49 -05:00
weizijun 79132ed57b
Add rollover add max_primary_shard_docs condition (#80981)
Add a new rollover condition with the name `max_primary_shard_docs`.
Triggers rollover when the largest primary shard in the index reaches a certain number of documents.
2022-02-08 14:04:04 +01:00