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

Always send _type to Monitoring Bulk API #11217

Merged
merged 1 commit into from
Mar 13, 2019

Conversation

ycombinator
Copy link
Contributor

@ycombinator ycombinator commented Mar 12, 2019

The Monitoring Bulk API (POST _xpack/monitoring/_bulk) does not interpret _type in the bulk metadata the same was as the regular Bulk API (POST _bulk). In the case of the Monitoring Bulk API, _type has a special meaning. It does not correspond to the Elasticsearch document _type but rather a type field within monitoring documents. The _type of those monitoring documents gets automatically set to _doc by the Monitoring Bulk API.

Therefore, the Beats monitoring code should always send _type to the Monitoring Bulk API.

The Monitoring Bulk API (POST _xpack/monitoring/_bulk) does not interpret _type in the bulk metadata the same was as the regular Bulk API (POST _bulk). In the case of the Monitoring Bulk API, _type has a special meaning. It does not correspond to the Elasticsearch document _type but rather a type field within monitoring documents. The _type of those monitoring documents gets automatically set to _doc by the Monitoring Bulk API. Therefore, the Beats monitoring code should always send _type to the Monitoring Bulk API.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/stack-monitoring

@ycombinator ycombinator requested review from jakelandis and a team March 12, 2019 20:48
@ycombinator ycombinator requested a review from a team as a code owner March 12, 2019 20:48
@jakelandis
Copy link

LGTM (I think)

I am not familiar with this code, but as long it continues to send the _type with the bulk request to _xpack/monitoring/_bulk then ✅

The description for the issue is correct such that _xpack/monitoring/_bulk does not behave the same as _bulk and for monitoring data the _type is still needed, but is only used to re-shape the document, not to set the actual index type. Recently ES made a change to ensure that this _type (since it really isn't a normal type ) won't emit a deprecation warning. elastic/elasticsearch#39805

@ycombinator
Copy link
Contributor Author

jenkins, test this

1 similar comment
@ycombinator
Copy link
Contributor Author

jenkins, test this

@ycombinator ycombinator merged commit ac72b5c into elastic:master Mar 13, 2019
ruflin pushed a commit to ruflin/beats that referenced this pull request Mar 13, 2019
The Monitoring Bulk API (`POST _xpack/monitoring/_bulk`) does not interpret `_type` in the bulk metadata the same was as the regular Bulk API (`POST _bulk`). In the case of the Monitoring Bulk API, `_type` has a special meaning. It does not correspond to the Elasticsearch document `_type` but rather a `type` field within monitoring documents. The `_type` of those monitoring documents gets automatically set to `_doc` by the Monitoring Bulk API.

Therefore, the Beats monitoring code should always send `_type` to the Monitoring Bulk API.

(cherry picked from commit ac72b5c)
@ruflin ruflin removed the needs_backport PR is waiting to be backported to other branches. label Mar 13, 2019
ycombinator added a commit to ycombinator/beats that referenced this pull request Mar 13, 2019
The Monitoring Bulk API (`POST _xpack/monitoring/_bulk`) does not interpret `_type` in the bulk metadata the same was as the regular Bulk API (`POST _bulk`). In the case of the Monitoring Bulk API, `_type` has a special meaning. It does not correspond to the Elasticsearch document `_type` but rather a `type` field within monitoring documents. The `_type` of those monitoring documents gets automatically set to `_doc` by the Monitoring Bulk API.

Therefore, the Beats monitoring code should always send `_type` to the Monitoring Bulk API.

(cherry picked from commit ac72b5c)
ycombinator added a commit that referenced this pull request Mar 13, 2019
…11229)

Cherry-pick of PR #11217 to 6.7 branch. Original message: 

The Monitoring Bulk API (`POST _xpack/monitoring/_bulk`) does not interpret `_type` in the bulk metadata the same was as the regular Bulk API (`POST _bulk`). In the case of the Monitoring Bulk API, `_type` has a special meaning. It does not correspond to the Elasticsearch document `_type` but rather a `type` field within monitoring documents. The `_type` of those monitoring documents gets automatically set to `_doc` by the Monitoring Bulk API.

Therefore, the Beats monitoring code should always send `_type` to the Monitoring Bulk API.
ruflin added a commit that referenced this pull request Mar 19, 2019
The Monitoring Bulk API (`POST _xpack/monitoring/_bulk`) does not interpret `_type` in the bulk metadata the same was as the regular Bulk API (`POST _bulk`). In the case of the Monitoring Bulk API, `_type` has a special meaning. It does not correspond to the Elasticsearch document `_type` but rather a `type` field within monitoring documents. The `_type` of those monitoring documents gets automatically set to `_doc` by the Monitoring Bulk API.

Therefore, the Beats monitoring code should always send `_type` to the Monitoring Bulk API.

(cherry picked from commit ac72b5c)
@ycombinator ycombinator added the needs_backport PR is waiting to be backported to other branches. label Apr 3, 2019
@ycombinator ycombinator deleted the fix-mon-type branch December 25, 2019 11:17
@ycombinator ycombinator removed the needs_backport PR is waiting to be backported to other branches. label Jan 15, 2020
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.

5 participants