Skip to content

Instantly share code, notes, and snippets.

@lefthand
Created March 17, 2015 18:03
Show Gist options
  • Save lefthand/6458c229fe7ee657d117 to your computer and use it in GitHub Desktop.
Save lefthand/6458c229fe7ee657d117 to your computer and use it in GitHub Desktop.
Collectd config file for gathering Elasticsearch status using curl_json plugin.
# Inspired by https://gist.github.com/dc2447/6783658
# Added index stats and selected more suitable types.
<Plugin curl_json>
# Gather a few index specific stats
<URL "http://<%= @hostname %>:9200/<%= @index_name %>/_stats">
Instance "<%= @index_name %>"
<Key "_all/total/docs/count">
Type "gauge"
</Key>
<Key "_all/total/store/size_in_bytes">
Type "bytes"
</Key>
</URL>
<URL "http://<%= @hostname %>:9200/_cluster/health">
Instance "elasticsearch"
<Key "number_of_nodes">
Type "gauge"
</Key>
<Key "number_of_data_nodes">
Type "gauge"
</Key>
<Key "active_primary_shards">
Type "gauge"
</Key>
<Key "active_shards">
Type "gauge"
</Key>
<Key "relocating_shards">
Type "gauge"
</Key>
<Key "initializing_shards">
Type "gauge"
</Key>
<Key "unassigned_shards">
Type "gauge"
</Key>
</URL>
<URL "http://<%= @hostname %>:9200/_nodes/<%= @hostname %>/stats?pretty=true&all=true">
Instance "esstats"
<Key "nodes/*/indices/filter_cache/memory_size_in_bytes">
Type "bytes"
</Key>
<Key "nodes/*/indices/filter_cache/evictions">
Type "counter"
</Key>
<Key "nodes/*/indices/id_cache/memory_size_in_bytes">
Type "bytes"
</Key>
<Key "nodes/*/indices/fielddata/memory_size_in_bytes">
Type "bytes"
</Key>
<Key "nodes/*/indices/fielddata/evictions">
Type "counter"
</Key>
<Key "nodes/*/jvm/mem/heap_used_in_bytes">
Type "bytes"
</Key>
<Key "nodes/*/jvm/mem/heap_committed_in_bytes">
Type "bytes"
</Key>
<Key "nodes/*/jvm/mem/threads/count">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/generic/threads">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/generic/queue">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/index/threads">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/index/rejected">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/index/queue">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/get/threads">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/get/queue">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/snapshot/threads">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/merge/threads">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/merge/queue">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/bulk/threads">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/bulk/queue">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/warmer/threads">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/flush/threads">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/flush/queue">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/search/threads">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/search/rejected">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/search/queue">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/percolate/threads">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/management/threads">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/refresh/threads">
Type "counter"
</Key>
<Key "nodes/*/thread_pool/refresh/queue">
Type "counter"
</Key>
<Key "nodes/*/jvm/mem/pools/Code Cache/used_in_bytes">
Type "bytes"
</Key>
<Key "nodes/*/jvm/mem/pools/Par Eden Space/used_in_bytes">
Type "bytes"
</Key>
<Key "nodes/*/jvm/mem/pools/Par Survivor Space/used_in_bytes">
Type "bytes"
</Key>
<Key "nodes/*/jvm/mem/pools/CMS Old Gen/used_in_bytes">
Type "bytes"
</Key>
<Key "nodes/*/jvm/mem/pools/CMS Perm Gen/used_in_bytes">
Type "bytes"
</Key>
</URL>
</Plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment