measurement name should have prefix before ShouldPass check

This commit is contained in:
鲁晓敏 2015-11-12 16:52:30 +08:00 committed by Cameron Sparr
parent 3012928452
commit e619845ffe
1 changed files with 4 additions and 4 deletions

View File

@ -92,6 +92,10 @@ func (ac *accumulator) AddFields(
timestamp = time.Now() timestamp = time.Now()
} }
if ac.prefix != "" {
measurement = ac.prefix + measurement
}
if ac.plugin != nil { if ac.plugin != nil {
if !ac.plugin.ShouldPass(measurement, tags) { if !ac.plugin.ShouldPass(measurement, tags) {
return return
@ -104,10 +108,6 @@ func (ac *accumulator) AddFields(
} }
} }
if ac.prefix != "" {
measurement = ac.prefix + measurement
}
pt, err := client.NewPoint(measurement, tags, fields, timestamp) pt, err := client.NewPoint(measurement, tags, fields, timestamp)
if err != nil { if err != nil {
log.Printf("Error adding point [%s]: %s\n", measurement, err.Error()) log.Printf("Error adding point [%s]: %s\n", measurement, err.Error())