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

Cherry-pick #8192 to 6.x: Get rid of errors generated by xpack code for elasticsearch/shard metricset #8285

Merged
merged 1 commit into from
Sep 13, 2018
Merged

Conversation

ycombinator
Copy link
Contributor

Cherry-pick of PR #8192 to 6.x branch. Original message:

I was testing the elasticsearch/shard metricset with xpack.enabled: true on master and ran into a few errors:

3 errors: wrong format in `relocating_node`: expected string, found <nil>; wrong format in `node`: expected string, found <nil>; key `number` not found"

Investigating a bit I found that:

  1. node and relocating_node can sometimes be returned as null in the GET _cluster/state/version,master_node,nodes,routing_table Elasticsearch API response used by this metricset, and
  2. the number field has been renamed in the Elasticserach API response to shard now. I can't find when it was number but it is definitely shard now.

This PR updates the code to get rid of these errors.

It also un-hardcodes the name of the monitoring index set in data_xpack.go.

Testing this PR

  1. Enable the elasticsearch metricset:

    metricbeat modules enable elasticsearch
    
  2. Edit modules.d/elasticsearch.yml and set metricsets: [ "shard" ] and xpack.enabled: true.

  3. Run metricbeat:

    metricbeat -e
    
  4. Check in Elasticsearch that you don't have any documents in metricbeat-* for the elasticsearch module (since we are using xpack.enabled: true).

    GET metricbeat-*/_search?q=metricset.module:elasticsearch
    
  5. Check in Elasticsearch that you have documents in .monitoring-es-6-mb-* with type:shard

    GET .monitoring-es-6-mb-2*/_search?q=type:shards
    

…etricset (#8192)

* Refactoring: Extract passthruFields function for broader use

* Passthru fields that could sometimes by null

* Do not report errors in xpack path as they will go into metricbeat index

* Un-hardcode index name

* More fixes

* Regenerating data.json

* Fixing order

* Renaming data JSON file to include version

* Renaming data.700.json back to data.json

* Adding unit test fixture for 7.0.0
@ycombinator
Copy link
Contributor Author

Only CI failure is this unrelated flaky test: #8208. So I'm merging this PR now...

@ycombinator ycombinator merged commit e6220c2 into elastic:6.x Sep 13, 2018
@ycombinator ycombinator deleted the backport_8192_6.x branch September 26, 2018 14:12
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.

2 participants