Update dependencies for the pubsub exporting connector (#11872)
Vladimir Kobal committed
Jan 10, 2022 at 15:20 UTC
7d37bcadd0558131e114d0ae4af27661634bac7d
5 files changed
+16
-16
CMakeLists.txt
+1
-1
@@ -288,7 +288,7 @@ pkg_check_modules(GRPC grpc)
288
# -----------------------------------------------------------------------------
289
# Detect libgoogleapis_cpp_pubsub_protos
290
291
-pkg_check_modules(PUBSUB googleapis_cpp_pubsub_protos)
291
+pkg_check_modules(PUBSUB google_cloud_cpp_pubsub_protos)
292
# later we use:
293
# ${PUBSUB_LIBRARIES}
294
# ${PUBSUB_CFLAGS_OTHER}
configure.ac
+8
-6
@@ -1340,12 +1340,14 @@ PKG_CHECK_MODULES(
1340
[have_libgrpc=no]
1341
)
1342
1343
-PKG_CHECK_MODULES(
1344
- [PUBSUB],
1345
- [googleapis_cpp_pubsub_protos],
1346
- [have_pubsub_protos=yes],
1347
- [have_pubsub_protos=no]
1348
-)
1343
+if test "${enable_exporting_pubsub}" != "no"; then
1344
+ PKG_CHECK_MODULES(
1345
+ [PUBSUB],
1346
+ [google_cloud_cpp_pubsub_protos],
1347
+ [have_pubsub_protos=yes],
1348
+ [have_pubsub_protos=no]
1349
+ )
1350
+fi
1351
1352
AC_PATH_PROG([CXX_BINARY], [${CXX}], [no])
1353
AS_IF(
exporting/pubsub/README.md
+1
-8
@@ -10,17 +10,10 @@ sidebar_label: Google Cloud Pub/Sub Service
10
## Prerequisites
11
12
To use the Pub/Sub service for metric collecting and processing, you should first
13
-[install](https://github.com/googleapis/cpp-cmakefiles) Google Cloud Platform C++ Proto Libraries.
13
+[install](https://github.com/googleapis/google-cloud-cpp/) Google Cloud Platform C++ Client Libraries.
14
Pub/Sub support is also dependent on the dependencies of those libraries, like `protobuf`, `protoc`, and `grpc`. Next,
15
Netdata should be re-installed from the source. The installer will detect that the required libraries are now available.
16
17
-> You [cannot compile Netdata](https://github.com/netdata/netdata/issues/10193) with Pub/Sub support enabled using
18
-> `grpc` 1.32 or higher.
19
->
20
-> Some distributions don't have `.cmake` files in packages. To build the C++ Proto Libraries on such distributions we
21
-> advise you to delete `protobuf`, `protoc`, and `grpc` related packages and
22
-> [install](https://github.com/grpc/grpc/blob/master/BUILDING.md) `grpc` with its dependencies from source.
23
-
17
## Configuration
18
19
To enable data sending to the Pub/Sub service, run `./edit-config exporting.conf` in the Netdata configuration directory
exporting/pubsub/pubsub_publish.cc
+1
-1
@@ -194,7 +194,7 @@ int pubsub_get_result(
194
{
195
struct pubsub_specific_data *connector_specific_data = (struct pubsub_specific_data *)pubsub_specific_data_p;
196
std::list<struct response> *responses = (std::list<struct response> *)connector_specific_data->responses;
197
- grpc_impl::CompletionQueue::NextStatus next_status;
197
+ grpc::CompletionQueue::NextStatus next_status;
198
199
*sent_metrics = 0;
200
*sent_bytes = 0;
netdata-installer.sh
+5
@@ -232,6 +232,9 @@ USAGE: ${PROGRAM} [options]
232
--disable-backend-prometheus-remote-write
233
--enable-backend-mongodb Enable MongoDB backend. Default: enable it when libmongoc is available.
234
--disable-backend-mongodb
235
+ --enable-exporting-pubsub Enable Google Cloud PupSub exporting connector. Default: enable it when
236
+ libgoogle_cloud_cpp_pubsub_protos and libraries it depends on are available.
237
+ --disable-exporting-pubsub
238
--enable-lto Enable Link-Time-Optimization. Default: disabled
239
--disable-lto
240
--enable-ml Enable anomaly detection with machine learning. (Default: autodetect)
@@ -325,6 +328,8 @@ while [ -n "${1}" ]; do
328
;;
329
"--enable-backend-mongodb") NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--enable-backend-mongodb/} --enable-backend-mongodb" ;;
330
"--disable-backend-mongodb") NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--disable-backend-mongodb/} --disable-backend-mongodb" ;;
331
+ "--enable-exporting-pubsub") NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--enable-exporting-pubsub/} --enable-exporting-pubsub" ;;
332
+ "--disable-exporting-pubsub") NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--disable-exporting-pubsub/} --disable-exporting-pubsub" ;;
333
"--enable-lto") NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--enable-lto/} --enable-lto" ;;
334
"--enable-ml")
335
NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--enable-ml/} --enable-ml"