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

Traverse the Elasticsearch JSON tree to automatically include any numeric values #269

Merged
merged 3 commits into from
Jul 6, 2016

Conversation

regiswilson
Copy link
Contributor

There are a number of metrics that are not exported by the current code. Also, metrics are renamed and slightly differ against the elastic search values. This code traverses the output of /_nodes/_local/stats and pulls every numeric metric out without changes.

Plus, less code is better code. :)

One serious caveat: the metrics names will be different so this is a breaking change.

@regiswilson regiswilson changed the title Traverse the JSON tree to automatically include any numeric values Traverse the Elasticsearch JSON tree to automatically include any numeric values Feb 9, 2016
@johann8384
Copy link
Member

Can you attach a list of the new metrics and tags?

@regiswilson
Copy link
Contributor Author

esmaster.txt
esclient.txt

Here are two files showing example output, one for an elasticsearch client node and an elasticsearch master node.

@johann8384
Copy link
Member

I like this collector, let me think about a way to have it alongside the previous one and issue deprecation warnings.

@regiswilson
Copy link
Contributor Author

We use this in production against 1.7.1 and also tested in dev agaist 2.2.0. It fails against AWS es 1.5.1 but only because Amazon denies requests to /_cluster. It's possible to write some testing for those responses and handle them gracefully at some point.

@johann8384 johann8384 added this to the 1.3.0 milestone Feb 11, 2016
@johann8384 johann8384 modified the milestones: 1.3.1, 1.3.0 Feb 16, 2016
@regiswilson
Copy link
Contributor Author

Pardon the jamming, we've open-sourced some more fixes to allow threading for multiple hosts (we monitor up to 10 nodes with one collector, bringing run time from 3s to .5s). We also include byindex stats for bytes and docs (per index) from the master.

Attached is a revised copy of the master's metric outputs. Client/data nodes are unchanged.
esmaster.txt

@johann8384
Copy link
Member

Would it be possible to get the plugin names here? I would be concerned that plugin 0 wasn't the same plugin across multiple instances.

elasticsearch.cluster.nodes.plugins.0.site 1455667836 1 node=esmasterlogs1 cluster=eslogs
elasticsearch.cluster.nodes.plugins.0.jvm 1455667836 1 node=esmasterlogs1 cluster=eslogs
elasticsearch.cluster.nodes.plugins.1.site 1455667836 0 node=esmasterlogs1 cluster=eslogs
elasticsearch.cluster.nodes.plugins.1.jvm 1455667836 1 node=esmasterlogs1 cluster=eslogs
elasticsearch.cluster.nodes.plugins.2.site 1455667836 0 node=esmasterlogs1 cluster=eslogs
elasticsearch.cluster.nodes.plugins.2.jvm 1455667836 1 node=esmasterlogs1 cluster=eslogs
elasticsearch.cluster.nodes.plugins.3.site 1455667836 0 node=esmasterlogs1 cluster=eslogs
elasticsearch.cluster.nodes.plugins.3.jvm 1455667836 1 node=esmasterlogs1 cluster=eslogs
elasticsearch.cluster.nodes.plugins.4.site 1455667836 1 node=esmasterlogs1 cluster=eslogs
elasticsearch.cluster.nodes.plugins.4.jvm 1455667836 0 node=esmasterlogs1 cluster=eslogs

@regiswilson
Copy link
Contributor Author

This was introduced in
https://github.com/OpenTSDB/tcollector/pull/269/files#diff-319e32e98481f63c8ce941c4ee06c749R127

I think it is a minor cosmetic issue since these are plugin booleans. I think there are several scenarios:

  1. Ignore it
  2. Drop booleans
  3. Add a blacklist facility to not descend certain nodes like "plugins" and "vendor"
  4. Try to add the peer non-numeric nodes as tags for the numeric values that we found (may add a lot of even more unnecessary information and pollute the tags)

Option 1 has the least risks and easiest to implement
Option 2 is tempting but not sure what we'd miss (values like "is_master")
Option 3 potentially introduces differences when ES data structures are updated/modified
Option 4 sounds too convoluted and the combined worst of all scenarios

I'll mull over options 2 or 3 to see if this is easy.

@regiswilson
Copy link
Contributor Author

Here's the json that causes it. Not a lot of good metrics in there. Interesting data but not metrics.

{"plugins":[{"name":"marvel","version":"1.3.1","description":"Elasticsearch Management & Monitoring","url":"/_plugin/marvel/","jvm":true,"site":true},{"name":"watcher","version":"1.0.1","description":"Elasticsearch Watcher","jvm":true,"site":false},{"name":"license","version":"1.0.0","description":"Internal Elasticsearch Licensing Plugin","jvm":true,"site":false},{"name":"watcher","version":"1.0.0","description":"Elasticsearch Watcher","jvm":true,"site":false},{"name":"head","version":"NA","description":"No description found.","url":"/_plugin/head/","jvm":false,"site":true}]}

@regiswilson
Copy link
Contributor Author

Updated to remove bool metrics.

@johann8384 johann8384 modified the milestones: 1.3.1, 1.3.2 Mar 16, 2016
@johann8384 johann8384 merged commit b874ace into OpenTSDB:master Jul 6, 2016
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