Remove that it only reads indices stats.
This commit is contained in:
parent
f76f99e789
commit
0f6664b260
|
@ -50,7 +50,7 @@ Telegraf currently has support for collecting metrics from:
|
||||||
* Prometheus (client libraries and exporters)
|
* Prometheus (client libraries and exporters)
|
||||||
* PostgreSQL
|
* PostgreSQL
|
||||||
* Redis
|
* Redis
|
||||||
* Elasticsearch (indices stats)
|
* Elasticsearch
|
||||||
* RethinkDB
|
* RethinkDB
|
||||||
* Kafka
|
* Kafka
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"github.com/influxdb/telegraf/plugins"
|
"github.com/influxdb/telegraf/plugins"
|
||||||
)
|
)
|
||||||
|
|
||||||
const indicesStatsPath = "/_nodes/stats"
|
const statsPath = "/_nodes/stats"
|
||||||
const indicesStatsPathLocal = "/_nodes/_local/stats"
|
const statsPathLocal = "/_nodes/_local/stats"
|
||||||
|
|
||||||
type node struct {
|
type node struct {
|
||||||
Host string `json:"host"`
|
Host string `json:"host"`
|
||||||
|
@ -56,7 +56,7 @@ func (e *Elasticsearch) SampleConfig() string {
|
||||||
|
|
||||||
// Description returns the plugin description.
|
// Description returns the plugin description.
|
||||||
func (e *Elasticsearch) Description() string {
|
func (e *Elasticsearch) Description() string {
|
||||||
return "Read indices stats from one or more Elasticsearch servers or clusters"
|
return "Read stats from one or more Elasticsearch servers or clusters"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gather reads the stats from Elasticsearch and writes it to the
|
// Gather reads the stats from Elasticsearch and writes it to the
|
||||||
|
@ -65,9 +65,9 @@ func (e *Elasticsearch) Gather(acc plugins.Accumulator) error {
|
||||||
for _, serv := range e.Servers {
|
for _, serv := range e.Servers {
|
||||||
var url string
|
var url string
|
||||||
if e.Local {
|
if e.Local {
|
||||||
url = serv + indicesStatsPathLocal
|
url = serv + statsPathLocal
|
||||||
} else {
|
} else {
|
||||||
url = serv + indicesStatsPath
|
url = serv + statsPath
|
||||||
}
|
}
|
||||||
if err := e.gatherUrl(url, acc); err != nil {
|
if err := e.gatherUrl(url, acc); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue