diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2015-12-14 19:37:20 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2015-12-17 19:25:48 +0300 |
commit | d67e2045a02d105bfbc7abf1805fe477eb9155ca (patch) | |
tree | cb071d61f409169b7014e27a73e29279d6a72e1e /app/workers | |
parent | 5142c61707cc4169a3f8d9e378aacb8f88760db5 (diff) |
Drop empty tag values from metrics
InfluxDB throws an error when trying to store a list of tags where one
or more have an empty value.
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/metrics_worker.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/workers/metrics_worker.rb b/app/workers/metrics_worker.rb index 90a65579382..b15dc819c5c 100644 --- a/app/workers/metrics_worker.rb +++ b/app/workers/metrics_worker.rb @@ -16,7 +16,11 @@ class MetricsWorker new_hash = hash.symbolize_keys new_hash[:tags].each do |key, value| - new_hash[:tags][key] = escape_value(value) + if value.blank? + new_hash[:tags].delete(key) + else + new_hash[:tags][key] = escape_value(value) + end end new_hash |