Cherry-pick #8336 to 6.x: Adding x-pack monitoring code for elasticsearch/ccr metricset#8422
Merged
ycombinator merged 1 commit intoelastic:6.xfrom Sep 26, 2018
ycombinator:backport_8336_6.x
Merged
Cherry-pick #8336 to 6.x: Adding x-pack monitoring code for elasticsearch/ccr metricset#8422ycombinator merged 1 commit intoelastic:6.xfrom ycombinator:backport_8336_6.x
ycombinator merged 1 commit intoelastic:6.xfrom
ycombinator:backport_8336_6.x
Conversation
This PR teaches the `elasticsearch/ccr` metricset to index documents into `.monitoring-es-6-*` indices when `xpack.enabled: true` is set in `modules.d/elasticsearch.yml`. ### To test this PR The idea is that metricbeat (specifically the elasticsearch/ccr metricset with `xpack.enabled: true`) will create exactly the same documents in `.monitoring-es-*` indices as Elasticsearch's internal collection and reporting does today. 1. Start up Elasticsearch (using the latest build from `master`). 2. Start up Kibana. 3. Start a trial license from the Kibana Management UI. 3. Enable Monitoring in Elasticsearch (via the cluster setting `xpack.monitoring.collection.enabled: true`). You can do this via [Elasticsearch's Cluster Update Settings API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html) or by clicking the "Turn on Monitoring" button in the Monitoring UI in Kibana. 4. Set up CCR with a leader and follower index. 4. Let Elasticsearch run for ~20 seconds so a few documents are indexed into `.monitoring-es-6-*`. 6. From `.monitoring-es-6-*`, retrieve a document for `type = ccr_stats` 8. Turn off Elasticsearch's internal collection via the cluster setting `xpack.monitoring.elasticsearch.collection.enabled: false`. 7. Delete `.monitoring-es-6-*` indices. 10. Enable the `elasticsearch` module in metricbeat: `./metricbeat modules enable elasticsearch`. 11. In `modules.d/elasticsearch.yml`, add the `ccr` metricset and set `xpack.enabled: true`. Concretely, your `modules.d/elasticsearch.yml` should look something like this: ```yaml - module: elasticsearch metricsets: - ccr period: 10s hosts: ["http://localhost:9200"] #username: "user" #password: "secret" xpack.enabled: true ``` 12. Start metricbeat. 13. Let metricbeat run for ~20 seconds so a few documents are indexed into `.monitoring-es-*`. 14. Stop metricbeat 6. From `.monitoring-es-6-*`, retrieve a document for `type = ccr_stats` 16. Using a tool such as http://www.jsondiff.com, compare the documents indexed by Elasticsearch with those indexed by metricbeat. Verify that their structures are identical (same fields, not necessarily same values), except for these known and expected differences: 1. Only Metricbeat-indexed documents are expected to contain the fields `@timestamp`, `beat`, `host`, and `metricset`. These are "standard" fields added by beats and metricbeat and don't have an adverse impact since they are additive. 3. Only Elasticsearch-indexed documents are expected to contain the field `source_node`. This field is used for debugging purposes only and not actually consumed by either the Monitoring UI or Telemetry feature in Kibana. (cherry picked from commit 35068ee)
Contributor
Author
|
jenkins, test this please |
jsoriano
approved these changes
Sep 26, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #8336 to 6.x branch. Original message:
This PR teaches the
elasticsearch/ccrmetricset to index documents into.monitoring-es-6-*indices whenxpack.enabled: trueis set inmodules.d/elasticsearch.yml.To test this PR
The idea is that metricbeat (specifically the elasticsearch/ccr metricset with
xpack.enabled: true) will create exactly the same documents in.monitoring-es-*indices as Elasticsearch's internal collection and reporting does today.Start up Elasticsearch (using the latest build from
master).Start up Kibana.
Start a trial license from the Kibana Management UI.
Enable Monitoring in Elasticsearch (via the cluster setting
xpack.monitoring.collection.enabled: true). You can do this via Elasticsearch's Cluster Update Settings API or by clicking the "Turn on Monitoring" button in the Monitoring UI in Kibana.Set up CCR with a leader and follower index.
Let Elasticsearch run for ~20 seconds so a few documents are indexed into
.monitoring-es-6-*.From
.monitoring-es-6-*, retrieve a document fortype = ccr_statsTurn off Elasticsearch's internal collection via the cluster setting
xpack.monitoring.elasticsearch.collection.enabled: false.Delete
.monitoring-es-6-*indices.Enable the
elasticsearchmodule in metricbeat:./metricbeat modules enable elasticsearch.In
modules.d/elasticsearch.yml, add theccrmetricset and setxpack.enabled: true. Concretely, yourmodules.d/elasticsearch.ymlshould look something like this:Start metricbeat.
Let metricbeat run for ~20 seconds so a few documents are indexed into
.monitoring-es-*.Stop metricbeat
From
.monitoring-es-6-*, retrieve a document fortype = ccr_statsUsing a tool such as http://www.jsondiff.com, compare the documents indexed by Elasticsearch with those indexed by metricbeat. Verify that their structures are identical (same fields, not necessarily same values), except for these known and expected differences:
@timestamp,beat,host, andmetricset. These are "standard" fields added by beats and metricbeat and don't have an adverse impact since they are additive.source_node. This field is used for debugging purposes only and not actually consumed by either the Monitoring UI or Telemetry feature in Kibana.