-
Notifications
You must be signed in to change notification settings - Fork 528
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 ILM support to APM Server #2099
Conversation
6c2fa40
to
a1f443d
Compare
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'm still working through the code but some immediate feedback on general functionality:
apm-server setup --ilm-policy
requiresapm-server.ilm.enabled=true
be set to get ilm templates which I wouldn't expect since--ilm-policy
implies that.apm-server setup --ilm-policy
installs index templates, not sure if that's expected to only create the policies.- the ilm index templates created seem to bump the
mapping.total_fields.limit
to 10k (from 2k), though this doesn't seem to be applied to the resulting index on master - still unclear what's happening, but if we could avoid this altogether, we should. Same issue but apparent no-impact forquery.default_field
. More concretely, after startingapm-server -e -E apm-server.ilm.enabled=true
:
note that order: 1
, mapping.total_fields.limit
and query.default_field
are set.
GET _template/apm-8.0.0-span-ilm
{
"apm-8.0.0-span-ilm" : {
"order" : 1,
"index_patterns" : [
"apm-8.0.0-span-*"
],
"settings" : {
"index" : {
"lifecycle" : {
"name" : "apm-8.0.0-span",
"rollover_alias" : "apm-8.0.0-span"
},
"mapping" : {
"total_fields" : {
"limit" : "10000"
}
},
"refresh_interval" : "5s",
"number_of_routing_shards" : "30",
"query" : {
"default_field" : [
"fields.*"
]
}
}
},
...
default template is set as expected
GET _template/apm-8.0.0
{
"apm-8.0.0" : {
"order" : 0,
"index_patterns" : [
"apm*"
],
"settings" : {
"index" : {
"codec" : "best_compression",
"mapping" : {
"total_fields" : {
"limit" : "2000"
}
},
"refresh_interval" : "5s",
"number_of_routing_shards" : "30",
"number_of_shards" : "1",
"query" : {
"default_field" : [
"message",
...
the actual template used is fine
GET apm-8.0.0-span/_settings
{
"apm-8.0.0-span-000001" : {
"settings" : {
"index" : {
"codec" : "best_compression",
"mapping" : {
"total_fields" : {
"limit" : "2000"
}
},
"refresh_interval" : "5s",
"number_of_shards" : "1",
"provided_name" : "<apm-8.0.0-span-000001>",
"query" : {
"default_field" : [
"message",
...
Creating another index does what I expected/feared:
PUT apm-8.0.0-span-foo
GET apm-8.0.0-span-foo/_settings
{
"apm-8.0.0-span-foo" : {
"settings" : {
"index" : {
"lifecycle" : {
"name" : "apm-8.0.0-span",
"rollover_alias" : "apm-8.0.0-span"
},
"codec" : "best_compression",
"mapping" : {
"total_fields" : {
"limit" : "10000"
}
},
"refresh_interval" : "5s",
"number_of_shards" : "1",
"provided_name" : "apm-8.0.0-span-foo",
"query" : {
"default_field" : [
"fields.*"
]
},
...
What am I missing here, is there some ordering issue?
Closing for now, as some more changes will come through libbeat changes. Reopen once the issues regarding |
ILM can be setup by using the `setup --index-management` or the `run` cmd. The templates and ilm policies can be exported using the `export` cmd. fixes elastic#1290
jenkins, test this please |
@elastic/apm-server is adding the ILM related behaviour and is ready for review now. |
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.
This is amazing work 🎉 - all of my previous concerns have been addressed and nothing new has come up, I think it's ready to 🚢
Thanks @graphaelli! I had one more change - removed the |
This PR adds ILM support to the APM Server, see #1290 (comment).
It introduces an
apm-server.ilm.enabled
setting, that is set tofalse
by default, so that no breaking change is introduced.The command
apm-server setup --template
gets deprecated with this PR, in favor ofapm-server setup --index-management
.When
apm-server setup
, orapm-server setup --index-management
is run, one apm template gets created defining all of the fields, dynamic mappings, etc. Additionally one minimal template per event type is created, that only holds information aboutindex lifecycle management
. When ILM is disabled, no ilm policy and write alias is set, when ILM is enabled, the default ILM policy and write alias is linked in the specific templates, and the policies and write aliases are created. The templates per event only match against the specific event index.Note that the order of setting up policies, templates and write aliases is important. The templates need to be created before write aliases are created, as this creates an index, and templates will not be applied after index creation.
The current implementation does not support any configuration options for ILM (policies, pattern, etc). As soon as ILM is enabled, configured
output.elasticsearch.index
andoutput.elasticsearch.indices
settings, as well assetup.template.name
,setup.template.pattern
settings are ignored.The general logic for the
setup
commands are inherited from libbeat.setup.template.enabled
andapm-server.ilm.enabled
configs are respected when running thesetup
command. This is important, as otherwise a distinction whether or not ILM should be set up could not be made.Since this PR depends on unmerged changes inlibbeat
, it first pulls in the current libbeat master and then adds the changes from the open libbeat PR.TODO:
vendor
folder.apm-server.ilm.enabled
settings