-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default composable templates for new indexing strategy #57629
Conversation
This commit adds the component and composable templates, as well as ILM policies, for the new default indexing strategy. It installs: - logs-default-mappings (component) - logs-default-settings (component) - logs-default-policy (ilm policy) - logs-default-template (composable template) - metrics-default-mappings (component) - metrics-default-settings (component) - metrics-default-policy (ilm policy) - metrics-default-template (composable template) These templates and policies are managed by a new x-pack module, `stack`, and can be disabled by setting `stack.templates.enabled` to `false`. These ensure that patterns for the `logs-*-*` and `metrics-*-*` indices are set up to create data streams with the proper mappings and settings. This also makes changes to the `IndexTemplateRegistry` to support installing component and composable templates (previously it supported only legacy templates). Resolves elastic#56709
Pinging @elastic/es-core-features (:Core/Features/Indices APIs) |
@gwbrown pinging you also since you were interested in how I changed |
@elasticmachine update branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dakrone Left quite a few comments on the templates. These should not block the PR itself as we can still follow up making adjustments to the templates.
One thing I was wondering about is on what happens if Elasticsearch is updated and all the assets are already there. Will ES update some of them or leave them as is?
x-pack/plugin/core/src/main/resources/logs-default-mappings.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/logs-default-mappings.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/logs-default-mappings.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/logs-default-mappings.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/logs-default-mappings.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/logs-default-mappings.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/logs-default-mappings.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/logs-default-settings.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/logs-default-template.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should discuss the implications of making changes to these Elasticsearch default templates. ECS is not set in stone, there are changes that happen from time to time, e.g. a field gets renamed. How would it play with this approach? If the field gets renamed when Elasticsearch upgrades, then wouldn't it fail existing shippers that send documents with the old field name rather than the new one (since our instructions recommend upgrading Elasticsearch first)?
x-pack/plugin/core/src/main/resources/logs-default-settings.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/logs-default-mappings.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/logs-default-mappings.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/logs-default-mappings.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/logs-default-mappings.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/logs-default-mappings.json
Outdated
Show resolved
Hide resolved
So @ruflin just explained to me how our packages are going to deal with backward compatibility by having ingest pipelines that will reformat documents that use an old format (e.g. think of a renamed field). Should we introduce an index pipeline here too? It would be initially empty, but this might be important to reserve namespace? Or alternatively should we make the mappings minimal so that we could realistically expect to never have to change the default mappings, e.g. only define a |
@elasticmachine update branch |
ES uses the version in the template and the version of the |
I'm not sure we should define the namespace yet, since we don't know whether the pipeline would be generic (both metrics & logs) or specific, so maybe we could leave it until we actually need it?
Interesting thought, I'll add this to the "to discuss" list @ruflin @jpountz thanks for taking a look, I wrote down a bunch of things to be discussed and I'll put together a document and time to discuss them (and incorporate any other feedback in this PR there) |
…7629) This commit adds the component and composable templates, as well as ILM policies, for the new default indexing strategy. It installs: - logs-default-mappings (component) - logs-default-settings (component) - logs-default-policy (ilm policy) - logs-default-template (composable template) - metrics-default-mappings (component) - metrics-default-settings (component) - metrics-default-policy (ilm policy) - metrics-default-template (composable template) These templates and policies are managed by a new x-pack module, `stack`, and can be disabled by setting `stack.templates.enabled` to `false`. These ensure that patterns for the `logs-*-*` and `metrics-*-*` indices are set up to create data streams with the proper mappings and settings. This also makes changes to the `IndexTemplateRegistry` to support installing component and composable templates (previously it supported only legacy templates). Resolves elastic#56709
As the base assets will be shipped by ES directly, the base package is not needed anymore. elastic/elasticsearch#57629 In the future we might reintroduce it to update the installed assets.
@@ -0,0 +1,16 @@ | |||
{ | |||
"index_patterns": ["logs-*-*"], | |||
"priority": 100, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dakrone Why is this set to 100? Shouldn't we set it to 1? @jonathan-buttner FYI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ruflin hah, you already asked that in #57629 (comment) :) We need space in order for templates to be allowed at a lower priority than these built-in ones (for example, someone installing a template for *
at priority 10)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦
As the base assets will be shipped by ES directly, the base package is not needed anymore. elastic/elasticsearch#57629 In the future we might reintroduce it to update the installed assets.
As the base assets will be shipped by ES directly, the base package is not needed anymore. elastic/elasticsearch#57629 In the future we might reintroduce it to update the installed assets. Co-authored-by: Nicolas Ruflin <spam@ruflin.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the very late question -- I was wondering why 'mappings' and 'settings' are pulled out into separate components, as opposed to just being defined on the template itself? Do we anticipate that users will reuse these components in their own templates?
Also is there a reason the settings and mappings live in different components? I would guess that you would reuse both the mappings and settings together.
@jtibshirani I pulled them out to follow the behavior that they were currently in for the ingest manager, maybe @ph or @ruflin can comment about why they were separate? On the other hand, it is nice to be able to substitute your own mappings for logs and still re-use the settings for the bundled templates, for example someone could use: |
@jtibshirani The use case mentioned by @dakrone is exactly why mappings and settings are separate. We expect users to reused the same settings and we also do it by default. The packages we install use the "gobal" settings by default as a component. |
For the Elastic Agent we currently have `logs` and `metrics`, however, synthetic data doesn't belong with those and thus we should have a place for it to live. This would be data reported from heartbeat and under the 'monitoring' category. This commit adds a composable index template for `synthetics-*-*` indices similar to the work in elastic#56709 and elastic#57629. Resolves elastic#61665
* Add "synthetics-*-*" templates for synthetics fleet data For the Elastic Agent we currently have `logs` and `metrics`, however, synthetic data doesn't belong with those and thus we should have a place for it to live. This would be data reported from heartbeat and under the 'monitoring' category. This commit adds a composable index template for `synthetics-*-*` indices similar to the work in #56709 and #57629. Resolves #61665
* Add "synthetics-*-*" templates for synthetics fleet data For the Elastic Agent we currently have `logs` and `metrics`, however, synthetic data doesn't belong with those and thus we should have a place for it to live. This would be data reported from heartbeat and under the 'monitoring' category. This commit adds a composable index template for `synthetics-*-*` indices similar to the work in elastic#56709 and elastic#57629. Resolves elastic#61665
… (#62346) * Add "synthetics-*-*" templates for synthetics fleet data For the Elastic Agent we currently have `logs` and `metrics`, however, synthetic data doesn't belong with those and thus we should have a place for it to live. This would be data reported from heartbeat and under the 'monitoring' category. This commit adds a composable index template for `synthetics-*-*` indices similar to the work in #56709 and #57629. Resolves #61665
This commit adds the component and composable templates, as well as ILM policies, for the new
default indexing strategy. It installs:
These templates and policies are managed by a new x-pack module,
stack
, and can be disabled bysetting
stack.templates.enabled
tofalse
.These ensure that patterns for the
logs-*-*
andmetrics-*-*
indices are set up to create datastreams with the proper mappings and settings.
This also makes changes to the
IndexTemplateRegistry
to support installing component andcomposable templates (previously it supported only legacy templates).
Resolves #56709