Skip to content

Change deprecation indexing to use a custom template #64417

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

Merged

Conversation

pugnascotia
Copy link
Contributor

The implementation for indexing deprecation logs to a data stream (#58924) relied on the Stack template for logs-*-*. This meant that if the user disabled the stack templates, the templates would also be unavailable for the deprecation logs.

Change the implementation so that:

  • There is a separate template for deprecation logging
  • The data stream is marked as hidden
  • The data stream name is prefixed with a period (.)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Logging)

@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Oct 30, 2020
Copy link
Contributor

@pgomulka pgomulka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks good from logging config/infra side.
It would be great if someone could also review data stream configuration

}
],
"date_detection": false,
"properties": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we create more fields from our logs. Do we have to define them in the mappings too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dynamic_templates part should take care of those.


@Override
protected boolean requiresMasterNode() {
return true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be overridden to true, since in a rolling environment a 7.11 node could start logging deprecation messages that are indexed prior to the master node being upgraded (meaning that the templates would not be in place), so the messages could end up not being indexed correctly

@pugnascotia pugnascotia requested a review from dakrone November 2, 2020 09:49
Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general this change looks good to me, however, I am concerned that this is a breaking change since we're changing the name of the deprecation index, I don't want users who was built tooling on the index name to have that tooling broken when switching minor releases.

Is it possible to keep the original name and make the . prefix change only for 8.0?

@@ -0,0 +1,17 @@
{
"index_patterns": [".logs-deprecation-elasticsearch"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change now, since deprecation logging went into effect in 7.10, and we're changing the index name, are we sure we're okay with the breaking change in a minor release? I'm not sure we should?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I yanked it from 7.10 so it hasn't been released yet. This will be the first release in 7.11.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I was going based on the PRs but didn't realize it had been pulled, LGTM then.

@pugnascotia pugnascotia merged commit 39a8643 into elastic:master Nov 2, 2020
@pugnascotia pugnascotia deleted the deprecation-indexing-custom-template branch November 2, 2020 16:38
pugnascotia added a commit to pugnascotia/elasticsearch that referenced this pull request Nov 5, 2020
The implementation for indexing deprecation logs to a data stream
(elastic#58924) relied on the Stack template for `logs-*-*`. This meant
that if the user disabled the stack templates, the templates would
also be unavailable for the deprecation logs.

Change the implementation so that:

* There is a separate template for deprecation logging
* The data stream is marked as hidden * The data stream name is
  prefixed with a period (`.`)
pugnascotia added a commit that referenced this pull request Nov 6, 2020
Backport of #64417. 

The implementation for indexing deprecation logs to a data stream (#58924)
relied on the Stack template for `logs-*-*`. This meant that if the user
disabled the stack templates, the templates would also be unavailable for
the deprecation logs.

Change the implementation so that:

* There is a separate template for deprecation logging
* The data stream is marked as hidden
* The data stream name is prefixed with a period (`.`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Logging Log management and logging utilities >enhancement >non-issue Team:Core/Infra Meta label for core/infra team v7.11.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants