Prevent empty tag names and values for InfluxDB

Change-Id: Ide0a52d63f5e6385997455e81899f76f8b5a0829
Closes-Bug: #1572631
This commit is contained in:
Simon Pasquier 2016-04-21 10:44:26 +02:00
parent a8162054ba
commit 76ff4b7dcd
1 changed files with 4 additions and 1 deletions

View File

@ -169,7 +169,10 @@ function encode_datapoint(name, value, tags)
local tags_array = {}
for k,v in pairs(tags) do
table.insert(tags_array, escape_string(k) .. '=' .. escape_string(v))
if k ~= '' and v ~= '' then
-- empty tag name and value aren't allowed
table.insert(tags_array, escape_string(k) .. '=' .. escape_string(v))
end
end
-- for performance reasons, it is recommended to always send the tags
-- in the same order.