Cherry-pick #8336 to 6.x: Adding x-pack monitoring code for elasticsearch/ccr metricset #8422
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.