Skip to content

Commit

Permalink
fix issue parsing metric names (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
charless-splunk authored Jun 27, 2018
1 parent 2f404b3 commit e2e44a3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## v1.7.0.sfx1 [2018-06-27]

### Release Notes

- Fix bug in SignalFx Output Plugin that resulted in metrics with "value" field
to be dropped

## v1.7.0.sfx0 [2018-06-22]

### Release Notes
Expand Down
10 changes: 5 additions & 5 deletions plugins/outputs/signalfx/parse/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ func SetPluginDimension(metricName string, metricDims map[string]string) {
}

// GetMetricName combines telegraf fields and tags into a full metric name
func GetMetricName(metric string, field string, dims map[string]string) (name string, isSFX bool) {
func GetMetricName(metric string, field string, dims map[string]string) (string, bool) {
// If sf_metric is provided
if name, isSFX = dims["sf_metric"]; isSFX {
return
if name, isSFX := dims["sf_metric"]; isSFX {
return name, isSFX
}

// Include field when it adds to the metric name
if field != "value" {
name = metric + "." + field
return fmt.Sprintf("%s.%s", metric, field), false
}

return
return metric, false
}

// ExtractProperty of the metric according to the following rules
Expand Down
2 changes: 1 addition & 1 deletion plugins/outputs/signalfx/signalfx.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func (s *SignalFx) GetObjects(metrics []telegraf.Metric, dps chan *datapoint.Dat

// Check if the metric is explicitly excluded
if s.isExcluded(metricName) {
log.Println("D! Outputs [signalfx] excluding the following metric: ", metricName)
log.Println("D! Outputs [signalfx] excluding the following metric: ", metricName, metric)
continue
}

Expand Down

0 comments on commit e2e44a3

Please sign in to comment.