Skip to content

Commit

Permalink
Renamed Influx meausrement for Consul input plugin to "consul_health_…
Browse files Browse the repository at this point in the history
…checks"
  • Loading branch information
harnash committed May 31, 2016
1 parent 7d3d2f7 commit d1c6609
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugins/inputs/consul/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (c *Consul) GatherHealthCheck(acc telegraf.Accumulator, checks []*api.Healt
}
}

acc.AddFields("consul", record, tags)
acc.AddFields("consul_health_checks", record, tags)
}
}

Expand Down
8 changes: 4 additions & 4 deletions plugins/inputs/consul/consul_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestBasicConfig(t *testing.T) {
consul.setDefaults()
consul.GatherHealthCheck(&acc, sampleChecks)

acc.AssertContainsTaggedFields(t, "consul", expectedFields, expectedTags)
acc.AssertContainsTaggedFields(t, "consul_health_checks", expectedFields, expectedTags)
}

func TestAllFields(t *testing.T) {
Expand All @@ -64,7 +64,7 @@ func TestAllFields(t *testing.T) {
consul.Fields = []string{"check_id", "check_name", "service_id", "status", "output", "notes"}
consul.GatherHealthCheck(&acc, sampleChecks)

acc.AssertContainsTaggedFields(t, "consul", expectedFields, expectedTags)
acc.AssertContainsTaggedFields(t, "consul_health_checks", expectedFields, expectedTags)
}

func TestCustomFields(t *testing.T) {
Expand All @@ -85,7 +85,7 @@ func TestCustomFields(t *testing.T) {
consul.Fields = []string{"check_id", "check_name"}
consul.GatherHealthCheck(&acc, sampleChecks)

acc.AssertContainsTaggedFields(t, "consul", expectedFields, expectedTags)
acc.AssertContainsTaggedFields(t, "consul_health_checks", expectedFields, expectedTags)
}

func TestSetupTags(t *testing.T) {
Expand All @@ -109,5 +109,5 @@ func TestSetupTags(t *testing.T) {
consul.Tags = []string{"service_id"}
consul.GatherHealthCheck(&acc, sampleChecks)

acc.AssertContainsTaggedFields(t, "consul", expectedFields, expectedTags)
acc.AssertContainsTaggedFields(t, "consul_health_checks", expectedFields, expectedTags)
}

0 comments on commit d1c6609

Please sign in to comment.