Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collectd input should use "value" as field name #2460

Merged
merged 1 commit into from
Apr 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Bugfixes
- [#2446] (https://github.com/influxdb/influxdb/pull/2446): Correctly count number of queries executed. Thanks @neonstalwart
- [#2452](https://github.com/influxdb/influxdb/issues/2452): Fix panic with shard stats on multiple clusters
- [#2460](https://github.com/influxdb/influxdb/issues/2460): Collectd input should use "value" for fields values. Fixes 2412. Thanks @josh-padnick

## v0.9.0-rc28 [04-27-2015]

Expand Down
2 changes: 1 addition & 1 deletion collectd/collectd.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func Unmarshal(data *gollectd.Packet) []influxdb.Point {
tags := make(map[string]string)
fields := make(map[string]interface{})

fields[name] = data.Values[i].Value
fields["value"] = data.Values[i].Value

if data.Hostname != "" {
tags["host"] = data.Hostname
Expand Down
10 changes: 5 additions & 5 deletions collectd/collectd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func TestUnmarshal_Points(t *testing.T) {
},
},
points: []influxdb.Point{
{Name: "disk_read", Fields: map[string]interface{}{"disk_read": float64(1)}},
{Name: "disk_read", Fields: map[string]interface{}{"value": float64(1)}},
},
},
{
Expand All @@ -230,8 +230,8 @@ func TestUnmarshal_Points(t *testing.T) {
},
},
points: []influxdb.Point{
{Name: "disk_read", Fields: map[string]interface{}{"disk_read": float64(1)}},
{Name: "disk_write", Fields: map[string]interface{}{"disk_write": float64(5)}},
{Name: "disk_read", Fields: map[string]interface{}{"value": float64(1)}},
{Name: "disk_write", Fields: map[string]interface{}{"value": float64(5)}},
},
},
{
Expand All @@ -250,7 +250,7 @@ func TestUnmarshal_Points(t *testing.T) {
{
Name: "disk_read",
Tags: map[string]string{"host": "server01", "instance": "sdk", "type": "disk_octets", "type_instance": "single"},
Fields: map[string]interface{}{"disk_read": float64(1)},
Fields: map[string]interface{}{"value": float64(1)},
},
},
},
Expand All @@ -269,7 +269,7 @@ func TestUnmarshal_Points(t *testing.T) {
t.Errorf("point name mismatch. expected %q, got %q", name, m.Name)
}
// test value
mv := m.Fields[m.Name].(float64)
mv := m.Fields["value"].(float64)
pv := test.packet.Values[i].Value
if mv != pv {
t.Errorf("point value mismatch. expected %v, got %v", pv, mv)
Expand Down