OpenTSDB filter types for HTTP AND telnet

This commit is contained in:
Cameron Sparr 2017-01-13 11:35:36 +00:00
parent e812a2efc6
commit 95bad9e55b
No known key found for this signature in database
GPG Key ID: 19E67263DCB25D0F
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())