summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Kobal <vlad@prokk.net>2019-12-24 13:00:02 +0200
committerGitHub <noreply@github.com>2019-12-24 13:00:02 +0200
commit6aac1b76aea6e92b37e20349041c4370d9fc045b (patch)
tree5da798a1382f01017898f2ee18b1195013b9474d
parent51c8239bed1e75988295c4a74100383b59f41608 (diff)
Fix a warning in prometheus remote write backend (#7609)
* Change deprecated method to a new one * Change the minimum required version of protobuf
-rw-r--r--CMakeLists.txt2
-rw-r--r--backends/prometheus/remote_write/remote_write.cc2
-rw-r--r--configure.ac2
3 files changed, 3 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fe221b9b0a..67a4841d69 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -256,7 +256,7 @@ find_library(HAVE_KINESIS aws-cpp-sdk-kinesis)
# -----------------------------------------------------------------------------
# Detect libprotobuf
-pkg_check_modules(PROTOBUF protobuf)
+pkg_check_modules(PROTOBUF protobuf>=3.1)
# later we use:
# ${PROTOBUF_LIBRARIES}
# ${PROTOBUF_CFLAGS_OTHER}
diff --git a/backends/prometheus/remote_write/remote_write.cc b/backends/prometheus/remote_write/remote_write.cc
index 91d4305ba7..aacfb10cf4 100644
--- a/backends/prometheus/remote_write/remote_write.cc
+++ b/backends/prometheus/remote_write/remote_write.cc
@@ -98,7 +98,7 @@ void add_metric(const char *name, const char *chart, const char *family, const c
}
size_t get_write_request_size(){
- size_t size = (size_t)snappy::MaxCompressedLength(write_request->ByteSize());
+ size_t size = (size_t)snappy::MaxCompressedLength(write_request->ByteSizeLong());
return (size < INT_MAX)?size:0;
}
diff --git a/configure.ac b/configure.ac
index ad35aa61cc..00927ba8b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -932,7 +932,7 @@ AM_CONDITIONAL([ENABLE_BACKEND_KINESIS], [test "${enable_backend_kinesis}" = "ye
PKG_CHECK_MODULES(
[PROTOBUF],
- [protobuf >= 3],
+ [protobuf >= 3.1],
[have_libprotobuf=yes],
[have_libprotobuf=no]
)