Skip to content

Commit

Permalink
Bumped plugin version and changed node to use their name rather than …
Browse files Browse the repository at this point in the history
…their host/ip (#42)
  • Loading branch information
Corbin Phelps authored Feb 4, 2019
1 parent 91b409c commit 6d7f444
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 3.0.0 - 2019-02-04
### Changed
- Updated definition version
- Changed nodes to use their name rather than their host as displayName

## 2.0.0 - 2019-01-09
### Changed
- Updated some metric names and fixed some descriptions in the spec.csv
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch-definition.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: com.newrelic.elasticsearch
description: Reports status and metrics for elasticsearch service
protocol_version: 1
protocol_version: 2
os: linux

commands:
Expand Down
2 changes: 1 addition & 1 deletion src/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type argumentList struct {

const (
integrationName = "com.newrelic.elasticsearch"
integrationVersion = "2.0.0"
integrationVersion = "3.0.0"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion src/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func parseLocalNode(nodeStats *LocalNodeResponse) (string, *LocalNode, error) {
nodes := nodeStats.Nodes
if len(nodes) == 1 {
for k := range nodes {
return *nodes[k].Host, nodes[k], nil
return *nodes[k].Name, nodes[k], nil
}
}
return "", nil, errors.New("could not identify local node")
Expand Down
1 change: 1 addition & 0 deletions src/inventory_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type LocalNodeResponse struct {

// LocalNode is the node API object
type LocalNode struct {
Name *string `json:"name"`
Host *string `json:"host"`
Process *LocalNodeProcess `json:"process"`
Ingest *LocalNodeIngest `json:"ingest"`
Expand Down
2 changes: 1 addition & 1 deletion src/inventory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func TestGetLocalNode(t *testing.T) {
fakeClient.On("Request", "/_nodes/_local").Return(mockedReturnVal, nil).Once()

resultName, resultStats, _ := getLocalNode(&fakeClient)
assert.Equal(t, "10.77.10.83", resultName)
assert.Equal(t, "es6c-dev-m1.bluemedora.localnet", resultName)

actualString, _ := json.Marshal(resultStats)
writeGoldenFile(t, goldenPath, actualString)
Expand Down
2 changes: 1 addition & 1 deletion src/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func populateNodesMetrics(i *integration.Integration, client Client, clusterName
// setNodesMetricsResponse calls setMetricsResponse for each node in the response
func setNodesMetricsResponse(integration *integration.Integration, resp *NodeResponse, clusterName *string) {
for node := range resp.Nodes {
err := setMetricsResponse(integration, resp.Nodes[node], *resp.Nodes[node].Host, "node", clusterName)
err := setMetricsResponse(integration, resp.Nodes[node], *resp.Nodes[node].Name, "node", clusterName)
if err != nil {
log.Error("There was an error setting metrics for node metrics on %s: %v", node, err)
}
Expand Down
2 changes: 1 addition & 1 deletion src/testdata/good-inventory.json.golden

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/testdata/good-nodes-local.json.golden
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"host":"10.77.10.83","process":{"refresh_interval_in_millis":1000,"id":15171,"mlockall":false},"ingest":{"processors":[{"type":"append"},{"type":"convert"},{"type":"date"},{"type":"date_index_name"},{"type":"dot_expander"},{"type":"fail"},{"type":"foreach"},{"type":"grok"},{"type":"gsub"},{"type":"join"},{"type":"json"},{"type":"kv"},{"type":"lowercase"},{"type":"remove"},{"type":"rename"},{"type":"script"},{"type":"set"},{"type":"set_security_user"},{"type":"sort"},{"type":"split"},{"type":"trim"},{"type":"uppercase"},{"type":"urldecode"}]},"plugins":[{"name":"analysis-icu","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"The ICU Analysis plugin integrates Lucene ICU module into elasticsearch, adding ICU relates analysis components.","classname":"org.elasticsearch.plugin.analysis.icu.AnalysisICUPlugin"}],"modules":[{"name":"aggs-matrix-stats","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Adds aggregations whose input are a list of numeric fields and output includes a matrix.","classname":"org.elasticsearch.search.aggregations.matrix.MatrixAggregationPlugin"},{"name":"analysis-common","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Adds \"built in\" analyzers to Elasticsearch.","classname":"org.elasticsearch.analysis.common.CommonAnalysisPlugin"},{"name":"ingest-common","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Module for ingest processors that do not require additional security permissions or have large dependencies and resources","classname":"org.elasticsearch.ingest.common.IngestCommonPlugin"},{"name":"lang-expression","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Lucene expressions integration for Elasticsearch","classname":"org.elasticsearch.script.expression.ExpressionPlugin"},{"name":"lang-mustache","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Mustache scripting integration for Elasticsearch","classname":"org.elasticsearch.script.mustache.MustachePlugin"},{"name":"lang-painless","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"An easy, safe and fast scripting language for Elasticsearch","classname":"org.elasticsearch.painless.PainlessPlugin"},{"name":"mapper-extras","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Adds advanced field mappers","classname":"org.elasticsearch.index.mapper.MapperExtrasPlugin"},{"name":"parent-join","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"This module adds the support parent-child queries and aggregations","classname":"org.elasticsearch.join.ParentJoinPlugin"},{"name":"percolator","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Percolator module adds capability to index queries and query these queries by specifying documents","classname":"org.elasticsearch.percolator.PercolatorPlugin"},{"name":"rank-eval","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"The Rank Eval module adds APIs to evaluate ranking quality.","classname":"org.elasticsearch.index.rankeval.RankEvalPlugin"},{"name":"reindex","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"The Reindex module adds APIs to reindex from one index to another or update documents in place.","classname":"org.elasticsearch.index.reindex.ReindexPlugin"},{"name":"repository-url","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Module for URL repository","classname":"org.elasticsearch.plugin.repository.url.URLRepositoryPlugin"},{"name":"transport-netty4","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Netty 4 based transport implementation","classname":"org.elasticsearch.transport.Netty4Plugin"},{"name":"tribe","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Tribe module","classname":"org.elasticsearch.tribe.TribePlugin"},{"name":"x-pack-core","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Core","classname":"org.elasticsearch.xpack.core.XPackPlugin"},{"name":"x-pack-deprecation","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Deprecation","classname":"org.elasticsearch.xpack.deprecation.Deprecation"},{"name":"x-pack-graph","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Graph","classname":"org.elasticsearch.xpack.graph.Graph"},{"name":"x-pack-logstash","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Logstash","classname":"org.elasticsearch.xpack.logstash.Logstash"},{"name":"x-pack-ml","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Machine Learning","classname":"org.elasticsearch.xpack.ml.MachineLearning"},{"name":"x-pack-monitoring","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Monitoring","classname":"org.elasticsearch.xpack.monitoring.Monitoring"},{"name":"x-pack-rollup","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Rollup","classname":"org.elasticsearch.xpack.rollup.Rollup"},{"name":"x-pack-security","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Security","classname":"org.elasticsearch.xpack.security.Security"},{"name":"x-pack-sql","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"The Elasticsearch plugin that powers SQL for Elasticsearch","classname":"org.elasticsearch.xpack.sql.plugin.SqlPlugin"},{"name":"x-pack-upgrade","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Upgrade","classname":"org.elasticsearch.xpack.upgrade.Upgrade"},{"name":"x-pack-watcher","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Watcher","classname":"org.elasticsearch.xpack.watcher.Watcher"}]}
{"name":"es6c-dev-m1.bluemedora.localnet","host":"10.77.10.83","process":{"refresh_interval_in_millis":1000,"id":15171,"mlockall":false},"ingest":{"processors":[{"type":"append"},{"type":"convert"},{"type":"date"},{"type":"date_index_name"},{"type":"dot_expander"},{"type":"fail"},{"type":"foreach"},{"type":"grok"},{"type":"gsub"},{"type":"join"},{"type":"json"},{"type":"kv"},{"type":"lowercase"},{"type":"remove"},{"type":"rename"},{"type":"script"},{"type":"set"},{"type":"set_security_user"},{"type":"sort"},{"type":"split"},{"type":"trim"},{"type":"uppercase"},{"type":"urldecode"}]},"plugins":[{"name":"analysis-icu","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"The ICU Analysis plugin integrates Lucene ICU module into elasticsearch, adding ICU relates analysis components.","classname":"org.elasticsearch.plugin.analysis.icu.AnalysisICUPlugin"}],"modules":[{"name":"aggs-matrix-stats","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Adds aggregations whose input are a list of numeric fields and output includes a matrix.","classname":"org.elasticsearch.search.aggregations.matrix.MatrixAggregationPlugin"},{"name":"analysis-common","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Adds \"built in\" analyzers to Elasticsearch.","classname":"org.elasticsearch.analysis.common.CommonAnalysisPlugin"},{"name":"ingest-common","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Module for ingest processors that do not require additional security permissions or have large dependencies and resources","classname":"org.elasticsearch.ingest.common.IngestCommonPlugin"},{"name":"lang-expression","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Lucene expressions integration for Elasticsearch","classname":"org.elasticsearch.script.expression.ExpressionPlugin"},{"name":"lang-mustache","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Mustache scripting integration for Elasticsearch","classname":"org.elasticsearch.script.mustache.MustachePlugin"},{"name":"lang-painless","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"An easy, safe and fast scripting language for Elasticsearch","classname":"org.elasticsearch.painless.PainlessPlugin"},{"name":"mapper-extras","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Adds advanced field mappers","classname":"org.elasticsearch.index.mapper.MapperExtrasPlugin"},{"name":"parent-join","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"This module adds the support parent-child queries and aggregations","classname":"org.elasticsearch.join.ParentJoinPlugin"},{"name":"percolator","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Percolator module adds capability to index queries and query these queries by specifying documents","classname":"org.elasticsearch.percolator.PercolatorPlugin"},{"name":"rank-eval","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"The Rank Eval module adds APIs to evaluate ranking quality.","classname":"org.elasticsearch.index.rankeval.RankEvalPlugin"},{"name":"reindex","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"The Reindex module adds APIs to reindex from one index to another or update documents in place.","classname":"org.elasticsearch.index.reindex.ReindexPlugin"},{"name":"repository-url","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Module for URL repository","classname":"org.elasticsearch.plugin.repository.url.URLRepositoryPlugin"},{"name":"transport-netty4","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Netty 4 based transport implementation","classname":"org.elasticsearch.transport.Netty4Plugin"},{"name":"tribe","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Tribe module","classname":"org.elasticsearch.tribe.TribePlugin"},{"name":"x-pack-core","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Core","classname":"org.elasticsearch.xpack.core.XPackPlugin"},{"name":"x-pack-deprecation","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Deprecation","classname":"org.elasticsearch.xpack.deprecation.Deprecation"},{"name":"x-pack-graph","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Graph","classname":"org.elasticsearch.xpack.graph.Graph"},{"name":"x-pack-logstash","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Logstash","classname":"org.elasticsearch.xpack.logstash.Logstash"},{"name":"x-pack-ml","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Machine Learning","classname":"org.elasticsearch.xpack.ml.MachineLearning"},{"name":"x-pack-monitoring","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Monitoring","classname":"org.elasticsearch.xpack.monitoring.Monitoring"},{"name":"x-pack-rollup","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Rollup","classname":"org.elasticsearch.xpack.rollup.Rollup"},{"name":"x-pack-security","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Security","classname":"org.elasticsearch.xpack.security.Security"},{"name":"x-pack-sql","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"The Elasticsearch plugin that powers SQL for Elasticsearch","classname":"org.elasticsearch.xpack.sql.plugin.SqlPlugin"},{"name":"x-pack-upgrade","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Upgrade","classname":"org.elasticsearch.xpack.upgrade.Upgrade"},{"name":"x-pack-watcher","version":"6.3.2","elasticsearch_version":"6.3.2","java_version":"1.8","description":"Elasticsearch Expanded Pack Plugin - Watcher","classname":"org.elasticsearch.xpack.watcher.Watcher"}]}
Loading

0 comments on commit 6d7f444

Please sign in to comment.