项目作者: jamiealquiza

项目描述 :
ElasticSearch cluster metrics -> Graphite
高级语言: Go
项目地址: git://github.com/jamiealquiza/es-stats.git
创建时间: 2015-03-02T18:05:31Z
项目社区:https://github.com/jamiealquiza/es-stats

开源协议:

下载


es-stats

Reads key cluster metrics from ElasticSearch and writes to Graphite. Make pretty graphs:
ScreenShot

This is intended for high-level, general cluster data. More granular data is better fetched on a per-node basis using other tools.

Installation

es-stats has no external dependencies (you’re welcome). Assuming Go is installed (built/tested with 1.4.x):

  • go get github.com/jamiealquiza/es-stats
  • go build github.com/jamiealquiza/es-stats

Binary will be found at: $GOPATH/bin/es-stats

Starter Grafana template: https://gist.github.com/jamiealquiza/298575115337fdf03ca5

Usage

Flags:

  1. ./es-stats -h
  2. Usage of ./es-stats:
  3. -graphite-ip="": Destination Graphite IP address
  4. -graphite-port="2003": Destination Graphite plaintext port
  5. -interval=30: Metrics polling interval
  6. -ip="127.0.0.1": ElasticSearch IP address
  7. -metrics-prefix="elasticsearch": Top-level Graphite namespace prefix (defaults to hostname)
  8. -port="9200": ElasticSearch port
  9. -require-master=false: Only poll if node is an elected master

Running:

  1. % ./es-stats -ip="192.168.100.204" -interval=5 -graphite-ip="192.168.100.175" -graphite-port="2013"
  2. 2015/03/04 15:27:56 Connected to ElasticSearch: http://192.168.100.204:9200
  3. 2015/03/04 15:27:56 Connected to Graphite: 192.168.100.175 port 2013
  4. 2015/03/04 15:28:01 Metrics received
  5. 2015/03/04 15:28:01 Metrics flushed to Graphite
  6. 2015/03/04 15:28:06 Metrics received
  7. 2015/03/04 15:28:06 Metrics flushed to Graphite
  8. 2015/03/04 15:28:11 Metrics received
  9. 2015/03/04 15:28:11 Metrics flushed to Graphite
  10. 2015/03/04 15:28:16 Metrics received
  11. 2015/03/04 15:28:16 Metrics flushed to Graphite

Get metrics:
ScreenShot