diff options
Diffstat (limited to '')
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/collect.go (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/collect.go) | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/collect.go b/src/go/plugin/go.d/modules/elasticsearch/collect.go index eb3ffb351..4f46f1088 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/collect.go +++ b/src/go/plugin/go.d/modules/elasticsearch/collect.go @@ -13,8 +13,8 @@ import ( "strings" "sync" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const ( @@ -158,13 +158,15 @@ func (es *Elasticsearch) scrapeElasticsearch() *esMetrics { } func (es *Elasticsearch) scrapeNodesStats(ms *esMetrics) { - req, _ := web.NewHTTPRequest(es.Request) + var p string if es.ClusterMode { - req.URL.Path = urlPathNodesStats + p = urlPathNodesStats } else { - req.URL.Path = urlPathLocalNodeStats + p = urlPathLocalNodeStats } + req, _ := web.NewHTTPRequestWithPath(es.Request, p) + var stats esNodesStats if err := es.doOKDecode(req, &stats); err != nil { es.Warning(err) @@ -175,8 +177,7 @@ func (es *Elasticsearch) scrapeNodesStats(ms *esMetrics) { } func (es *Elasticsearch) scrapeClusterHealth(ms *esMetrics) { - req, _ := web.NewHTTPRequest(es.Request) - req.URL.Path = urlPathClusterHealth + req, _ := web.NewHTTPRequestWithPath(es.Request, urlPathClusterHealth) var health esClusterHealth if err := es.doOKDecode(req, &health); err != nil { @@ -188,8 +189,7 @@ func (es *Elasticsearch) scrapeClusterHealth(ms *esMetrics) { } func (es *Elasticsearch) scrapeClusterStats(ms *esMetrics) { - req, _ := web.NewHTTPRequest(es.Request) - req.URL.Path = urlPathClusterStats + req, _ := web.NewHTTPRequestWithPath(es.Request, urlPathClusterStats) var stats esClusterStats if err := es.doOKDecode(req, &stats); err != nil { @@ -201,8 +201,7 @@ func (es *Elasticsearch) scrapeClusterStats(ms *esMetrics) { } func (es *Elasticsearch) scrapeLocalIndicesStats(ms *esMetrics) { - req, _ := web.NewHTTPRequest(es.Request) - req.URL.Path = urlPathIndicesStats + req, _ := web.NewHTTPRequestWithPath(es.Request, urlPathIndicesStats) req.URL.RawQuery = "local=true&format=json" var stats []esIndexStats |