OpenTSDB filter types for HTTP AND telnet

This commit is contained in:
Cameron Sparr 2017-01-13 11:35:36 +00:00
parent eb67b17c28
commit 9b0e1e9c49
1 changed files with 9 additions and 0 deletions

View File

@ -157,6 +157,15 @@ func (o *OpenTSDB) WriteTelnet(metrics []telegraf.Metric, u *url.URL) error {
tags := ToLineFormat(cleanTags(m.Tags()))
for fieldName, value := range m.Fields() {
switch value.(type) {
case int64:
case uint64:
case float64:
default:
log.Printf("D! OpenTSDB does not support metric value: [%s] of type [%T].\n", value, value)
continue
}
metricValue, buildError := buildValue(value)
if buildError != nil {
log.Printf("E! OpenTSDB: %s\n", buildError.Error())