From 6aac1b76aea6e92b37e20349041c4370d9fc045b Mon Sep 17 00:00:00 2001 From: Vladimir Kobal Date: Tue, 24 Dec 2019 13:00:02 +0200 Subject: Fix a warning in prometheus remote write backend (#7609) * Change deprecated method to a new one * Change the minimum required version of protobuf --- CMakeLists.txt | 2 +- backends/prometheus/remote_write/remote_write.cc | 2 +- configure.ac | 2 +- 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] ) -- cgit v1.2.3