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 types from internal monitoring templates and bump to api 7 #39888

Merged
merged 7 commits into from
Mar 11, 2019

Conversation

jakelandis
Copy link
Contributor

@jakelandis jakelandis commented Mar 10, 2019

This commit removes the "doc" type from monitoring internal indexes.
The template still carries the "_doc" type since that is needed for
the internal representation.

This change impacts the following templates:
monitoring-alerts.json
monitoring-beats.json
monitoring-es.json
monitoring-kibana.json
monitoring-logstash.json

As part of the required changes, the system_api_version has been
bumped from "6" to "7" and support for version "2" has been dropped.

A new empty pipeline is now introduced for the version "7", and
the formerly empty "6" pipeline will now remove the type and re-direct
the request to the "7" index.

Additionally, to due to a difference in the internal representation
(which requires the inclusion of "_doc" type) and external representation
(which requires the exclusion of any type) a helper method is introduced
to help convert internal to external representation, and used by the
monitoring HTTP template exporter.

Relates #38637


This replaces #39336 , the "primary change" is still relevant for this PR, but the additional changes on that PR are not relevant to this PR since we decided to go a different way that is more inline with prior upgrades.

The template still carries the "_doc" type since that is needed for
the internal representation.

This change impacts the following templates:
monitoring-alerts.json
monitoring-beats.json
monitoring-es.json
monitoring-kibana.json
monitoring-logstash.json

As part of the required changes, the system_api_version has been
bumped from "6" to "7" and support for version "2" has been dropped.

A new empty pipeline is now introduced for the version "7", and
the formerly empty "6" pipeline will now remove the type and re-direct
the request to the "7" index.

Additionally, to due to a difference in the internal representation
(which requires the inclusion of "_doc" type) and external representation
(which requires the exclusion of any type) a helper method is introduced
to help convert internal to external representation, and used by the
monitoring HTTP template exporter.

Relates elastic#38637
@jakelandis jakelandis changed the title This commit removes the "doc" type from monitoring internal indexes. Remove types from internal monitoring templates and bump to api 7 Mar 10, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features

@jakelandis
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/bwc

@jakelandis
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/bwc

@@ -98,8 +104,18 @@ protected void doPublish(final RestClient client, final ActionListener<Boolean>
*
* @return Never {@code null}.
*/
@SuppressWarnings("unchecked")
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the call that requires suppressing this warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, that was from an earlier attempt and is no longer needed. It is now removed.

@@ -75,7 +76,9 @@ public String getName() {

@Override
public RestChannelConsumer doPrepareRequest(RestRequest request, XPackClient client) throws IOException {
final String defaultType = request.param("type");
if (Strings.isEmpty(request.param("type")) == false) {
logger.error("Custom types for monitoring is not supported");
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we logging instead of failing with an exception? Are we sure that 6.7 never uses the bulk monitoring API with a type in the path? If not I think we should keep support for the defaultType for now and remove it in 8.0. If we are sure that the type is never set via the path, then maybe we should remove the path from the REST handler entirely?

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 am like 99% sure that Kibana/Beats/LS don't send this parameter. I went ahead and moved to an throwing an exception if it is sent.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we instead remove the paths that accept a type in the constructor of RestMonitoringBulkAction?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, yes (sorry a bit slow here). I removed this on 1573aae.

Copy link
Contributor

@jpountz jpountz left a comment

Choose a reason for hiding this comment

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

LGTM

@jakelandis
Copy link
Contributor Author

@jpountz thanks !

@pickypg @ycombinator - I am going to merge this based on Adrien's review, apologies for not providing adequate time for review (trying to meet specific timelines) If you do you review and find issue(s), please ping me directly.

@jakelandis jakelandis merged commit b5cb845 into elastic:master Mar 11, 2019
jakelandis added a commit to jakelandis/elasticsearch that referenced this pull request Mar 11, 2019
…astic#39888)

This commit removes the "doc" type from monitoring internal indexes.
The template still carries the "_doc" type since that is needed for
the internal representation.

This change impacts the following templates:
monitoring-alerts.json
monitoring-beats.json
monitoring-es.json
monitoring-kibana.json
monitoring-logstash.json

As part of the required changes, the system_api_version has been
bumped from "6" to "7" and support for version "2" has been dropped.

A new empty pipeline is now introduced for the version "7", and
the formerly empty "6" pipeline will now remove the type and re-direct
the request to the "7" index.

Additionally, to due to a difference in the internal representation
(which requires the inclusion of "_doc" type) and external representation
(which requires the exclusion of any type) a helper method is introduced
to help convert internal to external representation, and used by the
monitoring HTTP template exporter.

Relates elastic#38637
jakelandis added a commit to jakelandis/elasticsearch that referenced this pull request Mar 11, 2019
…astic#39888)

This commit removes the "doc" type from monitoring internal indexes.
The template still carries the "_doc" type since that is needed for
the internal representation.

This change impacts the following templates:
monitoring-alerts.json
monitoring-beats.json
monitoring-es.json
monitoring-kibana.json
monitoring-logstash.json

As part of the required changes, the system_api_version has been
bumped from "6" to "7" and support for version "2" has been dropped.

A new empty pipeline is now introduced for the version "7", and
the formerly empty "6" pipeline will now remove the type and re-direct
the request to the "7" index.

Additionally, to due to a difference in the internal representation
(which requires the inclusion of "_doc" type) and external representation
(which requires the exclusion of any type) a helper method is introduced
to help convert internal to external representation, and used by the
monitoring HTTP template exporter.

Relates elastic#38637
jakelandis added a commit that referenced this pull request Mar 11, 2019
…9888) (#39927)

This commit removes the "doc" type from monitoring internal indexes.
The template still carries the "_doc" type since that is needed for
the internal representation.

This change impacts the following templates:
monitoring-alerts.json
monitoring-beats.json
monitoring-es.json
monitoring-kibana.json
monitoring-logstash.json

As part of the required changes, the system_api_version has been
bumped from "6" to "7" and support for version "2" has been dropped.

A new empty pipeline is now introduced for the version "7", and
the formerly empty "6" pipeline will now remove the type and re-direct
the request to the "7" index.

Additionally, to due to a difference in the internal representation
(which requires the inclusion of "_doc" type) and external representation
(which requires the exclusion of any type) a helper method is introduced
to help convert internal to external representation, and used by the
monitoring HTTP template exporter.

Relates #38637
robbavey added a commit to robbavey/logstash that referenced this pull request Mar 11, 2019
elastic/elasticsearch#39888 removed the "doc"
 type from internal indices, causing breakage in the x-pack integration
 tests. This commit changes the type to "_doc" for consistency.
jakelandis added a commit that referenced this pull request Mar 11, 2019
…9888) (#39926)

This commit removes the "doc" type from monitoring internal indexes.
The template still carries the "_doc" type since that is needed for
the internal representation.

This change impacts the following templates:
monitoring-alerts.json
monitoring-beats.json
monitoring-es.json
monitoring-kibana.json
monitoring-logstash.json

As part of the required changes, the system_api_version has been
bumped from "6" to "7" and support for version "2" has been dropped.

A new empty pipeline is now introduced for the version "7", and
the formerly empty "6" pipeline will now remove the type and re-direct
the request to the "7" index.

Additionally, to due to a difference in the internal representation
(which requires the inclusion of "_doc" type) and external representation
(which requires the exclusion of any type) a helper method is introduced
to help convert internal to external representation, and used by the
monitoring HTTP template exporter.

Relates #38637
robbavey added a commit to robbavey/logstash that referenced this pull request Mar 11, 2019
This commit fixes x-pack integration tests that were broken by elastic/elasticsearch#39888 removing the "doc"
 type, and using `_doc` in templates.
elasticsearch-bot pushed a commit to elastic/logstash that referenced this pull request Mar 11, 2019
This commit fixes x-pack integration tests that were broken by elastic/elasticsearch#39888 removing the "doc"
 type, and using `_doc` in templates.

Fixes #10533
elasticsearch-bot pushed a commit to elastic/logstash that referenced this pull request Mar 11, 2019
This commit fixes x-pack integration tests that were broken by elastic/elasticsearch#39888 removing the "doc"
 type, and using `_doc` in templates.

Fixes #10533
elasticsearch-bot pushed a commit to elastic/logstash that referenced this pull request Mar 11, 2019
This commit fixes x-pack integration tests that were broken by elastic/elasticsearch#39888 removing the "doc"
 type, and using `_doc` in templates.

Fixes #10533
jakelandis added a commit to jakelandis/elasticsearch that referenced this pull request Mar 13, 2019
org.elasticsearch.xpack.monitoring.action.MonitoringBulkRequestTests#testAddRequestContent
can still randomly use a defaultType for monitoring. The defaultType
support has been removed as of PR elastic#39888. Prior to its's removal it
would default the type if one is not specified. The _type on the monitoring
bulk end point is currently required, though it is not used as the final index type
(which defaultType would have).

Closes elastic#39980
jakelandis added a commit that referenced this pull request Mar 13, 2019
org.elasticsearch.xpack.monitoring.action.MonitoringBulkRequestTests#testAddRequestContent
can still randomly use a defaultType for monitoring. The defaultType
support has been removed as of PR #39888. Prior to its's removal it
would default the type if one is not specified. The _type on the monitoring
bulk end point is currently required, though it is not used as the final index type
(which defaultType would have).

Closes #39980
jakelandis added a commit that referenced this pull request Mar 14, 2019
org.elasticsearch.xpack.monitoring.action.MonitoringBulkRequestTests#testAddRequestContent
can still randomly use a defaultType for monitoring. The defaultType
support has been removed as of PR #39888. Prior to its's removal it
would default the type if one is not specified. The _type on the monitoring
bulk end point is currently required, though it is not used as the final index type
(which defaultType would have).

Closes #39980
jakelandis added a commit that referenced this pull request Mar 14, 2019
org.elasticsearch.xpack.monitoring.action.MonitoringBulkRequestTests#testAddRequestContent
can still randomly use a defaultType for monitoring. The defaultType
support has been removed as of PR #39888. Prior to its's removal it
would default the type if one is not specified. The _type on the monitoring
bulk end point is currently required, though it is not used as the final index type
(which defaultType would have).

Closes #39980
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants