Skip to content

Commit

Permalink
Convert empty string into quotes when sending it to InfluxDB (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
awegrzyn authored Jul 20, 2021
1 parent c0b6e00 commit b18e9ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif()

# Define project
project(Monitoring
VERSION 3.8.6
VERSION 3.8.7
DESCRIPTION "O2 Monitoring library"
LANGUAGES CXX
)
Expand Down
3 changes: 3 additions & 0 deletions src/Backends/InfluxDB.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ void InfluxDB::escape(std::string& escaped)
boost::replace_all(escaped, ",", "\\,");
boost::replace_all(escaped, "=", "\\=");
boost::replace_all(escaped, " ", "\\ ");
if (escaped.empty()) {
escaped = R"("")";
}
}

void InfluxDB::send(std::vector<Metric>&& metrics)
Expand Down

0 comments on commit b18e9ca

Please sign in to comment.