pytelegraf icon indicating copy to clipboard operation
pytelegraf copied to clipboard

Line protocol implementation includes empty tags, which Telegraf can't parse

Open martinraag opened this issue 7 years ago • 0 comments

The line protocol doesn't purge None or empty string values from tags. This causes Telegraf to fail parsing the message.

For example, for the following code:

from telegraf.client import TelegrafClient

client = TelegrafClient('localhost', 8094)
tags = {'foo': ''}
client.metric('metric', 1, tags=tags)

Running Telegraf version 1.8.0, the following error message is displayed:

2018-10-02T19:33:37Z E! Error in plugin [inputs.socket_listener]: unable to parse incoming packet: metric parse error: expected tag at offset 11: "metric,foo= value=1i\n"

martinraag avatar Oct 02 '18 19:10 martinraag