Report kibana_settings to X-Pack Monitoring (#7664) #7943
Merged
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.
Resolves #7621.
Depends on elastic/kibana#21100.
X-Pack Monitoring of Kibana requires two types of documents in the
.monitoring-kibana-*
indices:kibana_stats
andkibana_settings
. We made Metricbeat'skibana/stats
metricset indexkibana_stats
documents into.monitoring-kibana-*
in #7525. This PR makes the same metricset indexkibana_settings
documents into.monitoring-kibana-*
.To test this PR
The idea is that metricbeat (specifically the kibana/stats metricset with
xpack.enabled: true
) will create exactly the same documents in.monitoring-kibana-*
indices as Kibana's bulk uploader does today.Start up Elasticsearch (with the default Basic license is okay)
Start up Kibana (with the default Basic license is okay), checked out from
master
.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.Let Kibana run for ~20 seconds so a few documents are indexed into
.monitoring-kibana-*
.Stop Kibana
From
.monitoring-kibana-*
, retrieve a document fortype = kibana_settings
Delete the
.monitoring-kibana-*
indices.In
kibana.yml
, setxpack.monitoring.kibana.collection.enabled: false
. This will ensure that Kibana is no longer directly shipping its monitoring metrics to Elasticsearch.Start up Kibana again, this time checked out from [Monitoring] Kibana settings api kibana#21100.
Enable the
kibana
module in metricbeat:./metricbeat modules enable kibana
.In
modules.d/kibana.yml
, add thestats
metricset and setxpack.enabled: true
. Concretely, yourmodules.d/kibana.yml
should look something like this:Additionally, if your Kibana URLs have a basepath prefix, say
foo
, make sure to un-comment thebasepath
setting in thekibana
module YAML file and set it's value to"foo"
.Start metricbeat.
Let metricbeat run for ~20 seconds so a few documents are indexed into
.monitoring-kibana-*
.Stop metricbeat
From
.monitoring-kibana-*
, retrieve a document fortype = kibana_settings
.Using a tool such as http://www.jsondiff.com, compare the documents indexed by Kibana's 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.(cherry picked from commit 2af5ab9)