Skip to content
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

Remove support for time-based interval index patterns with migration #35262

Merged
merged 10 commits into from May 2, 2019

Conversation

lukasolson
Copy link
Member

@lukasolson lukasolson commented Apr 17, 2019

This is an intermediary step for 7.x to work towards #35173 without breaking existing users with time-based interval index patterns.

With this PR, when you load a time-based interval index pattern, you'll get a warning message:

image

The warning message explains that you are now querying the index, as converted to wildcards (which may include additional indices than the original index pattern). It also has a link to the index pattern in advanced settings, where you can actually easily migrate the index pattern:

image

@lukasolson lukasolson added Feature:Data Views Data Views code and UI - index patterns before 8.0 :AppArch v7.2.0 v7.0.1 labels Apr 17, 2019
@lukasolson lukasolson self-assigned this Apr 17, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch

@elasticmachine
Copy link
Contributor

💔 Build Failed

@AlonaNadler
Copy link

image

Based on the message, I understand that the users don't have to click on the migrate they can continue with the way their current index set up interval-based, is that true?
If the users don't migrate, do Kibana query logstash-* or still query based in the interval?
If the users don't migrate do they get the error message each time? does the notification show up in every application?

I suggest we have a link in the message to the 7.0 breaking changes

@gchaps can you review the text in the notification and the index pattern page?

@gchaps
Copy link
Contributor

gchaps commented Apr 17, 2019

Here are some suggestions.

Warning 1

Support for time intervals was removed

You are querying all indices that match logstash-*. For more information, view the index pattern in management.

Note: Can you add a space after the last sentence and the index pattern name?

Warning 2

Support for time-based index patterns was removed

These index patterns will not work in the next major version of Kibana. By clicking the Migrate button, you can migrate your index pattern to a wildcard pattern.

Migrate

Page text

This page lists every field in the index and its mapping type. To change a field type, use the Elasticsearch Mapping API.

@lukasolson
Copy link
Member Author

Based on the message, I understand that the users don't have to click on the migrate they can continue with the way their current index set up interval-based, is that true?
If the users don't migrate, do Kibana query logstash-* or still query based in the interval?
If the users don't migrate do they get the error message each time? does the notification show up in every application?

That's correct, Kibana will query the wildcard pattern instead of the interval-based pattern, so in your example it would be logstash-*. Yes, they can continue without migrating, and yes, they will get the error each time they load Kibana and the index pattern is loaded.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@lukasolson lukasolson removed the v7.0.1 label Apr 23, 2019
@lukasolson lukasolson force-pushed the removeIntervalIndexPatterns7.x branch from 7e1d940 to a65217c Compare April 23, 2019 22:20
Copy link
Contributor

@Bargs Bargs left a comment

Choose a reason for hiding this comment

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

This may be a pre-existing issue, but one thing I noticed is if I import an old interval based pattern via the management UI the interval name gets removed but the title is not migrated, so you end up with a pattern that does not work, but you also get no warnings (because the condition to show the warnings is based on whether the intervalName attribute exists).

Otherwise this LGTM. I did a fairly brief review of the code but nothing popped out at me. I tested the functionality with an old interval based pattern and everything I tried worked as expected.

this.title, this.getInterval(), start, stop, sortDirection
);
}
getIndex() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add some tests for this method? This regex magic is complicated enough I just want to make sure it handles every edge case we might expect.

Copy link
Member Author

Choose a reason for hiding this comment

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

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

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

Code LGTM - tested & everything seems to work as intended. Added two minor UX notes on the toast.

const warningText = i18n.translate('common.ui.indexPattern.warningText', {
defaultMessage: 'Instead of querying indices only matching the pattern {title}, you are now querying all indices ' +
'matching {index}. This index pattern should be migrated to a wildcard-based index pattern. To do so, edit the ' +
'index pattern in Management.',
Copy link
Member

Choose a reason for hiding this comment

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

UX nit: This message is hard to read before the notification disappears. I wonder if we could wordsmith it to make things shorter, e.g.

Support for time interval index patterns removed

Currently querying all indices matching {index}.
{title} should be migrated to a wildcard-based index pattern.

Edit >

<EuiFlexItem grow={false}>
<EuiButton size="s" href={kbnUrl.getRouteHref(indexPattern, 'edit')}>
Edit index pattern
</EuiButton>
Copy link
Member

Choose a reason for hiding this comment

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

UX nit: Maybe this is something to add later, but I wonder if we should be integrating with feature controls here. That way we could hide the edit button if we know a user doesn't have access to management, rather than allowing them to click a button that will lead straight to an error page.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@lukasolson lukasolson changed the base branch from master to 7.x May 1, 2019 19:45
@lukasolson lukasolson changed the base branch from 7.x to master May 1, 2019 19:45
@lukasolson lukasolson force-pushed the removeIntervalIndexPatterns7.x branch from cf4f550 to 82f085f Compare May 1, 2019 19:54
@lukasolson lukasolson requested review from a team as code owners May 1, 2019 19:54
@lukasolson lukasolson requested a review from a team May 1, 2019 19:54
@lukasolson lukasolson changed the base branch from master to 7.x May 1, 2019 19:54
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

}).then(({ attributes: { title, intervalName } }) => {
this.title = title;
this.intervalName = intervalName;
}).then(() => this);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's a 'nip' from my side but I don't understand why we need it .then(() => this);
We can just return this from the previous then.

It may look a little worse, but we are not planning an additional Microtask.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that's totally true. I think I was just following the same style as above, but it could definitely be changed.

@lukasolson lukasolson merged commit 5c4ae11 into elastic:7.x May 2, 2019
lukeelmers added a commit to lukeelmers/kibana that referenced this pull request Aug 1, 2019
lukeelmers added a commit to lukeelmers/kibana that referenced this pull request Aug 2, 2019
lukeelmers added a commit to lukeelmers/kibana that referenced this pull request Aug 2, 2019
lukeelmers added a commit to lukeelmers/kibana that referenced this pull request Aug 20, 2019
@lukasolson lukasolson deleted the removeIntervalIndexPatterns7.x branch December 2, 2019 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Data Views Data Views code and UI - index patterns before 8.0 release_note:breaking v7.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants