diff options
author | Vladimir Kobal <vlad@prokk.net> | 2019-08-14 11:03:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-14 11:03:40 +0300 |
commit | 6262597923df989d4b9fc216f1645b006059da19 (patch) | |
tree | 8a82c7e0fe4a56120ef29ef96bd40f80685dba1c /CMakeLists.txt | |
parent | f1285715cd6615ac94a3eb691ab346c9ef09ec56 (diff) |
Add MongoDB backend (#6524)
* Add mongodb backend skeleton
* Send data to the backend
* Send metrics as separate JSON documents
* Add a configuration file
* Send all metrics in a batch
* Update the documentation
* Free configuration strings on exit
* Make socket timeout configurable
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 13a9f472c9..8f2ec31698 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,6 +115,7 @@ set(NETDATA_COMMON_INCLUDE_DIRS ${NETDATA_COMMON_INCLUDE_DIRS} ${LIBLZ4_INCLUDE_ #set(NETDATA_COMMON_INCLUDE_DIRS ${NETDATA_COMMON_INCLUDE_DIRS} ${JUDY_INCLUDE_DIRS}) set(NETDATA_COMMON_LIBRARIES ${NETDATA_COMMON_LIBRARIES} "-lJudy") set(CMAKE_REQUIRED_LIBRARIES "Judy") +include(CheckSymbolExists) check_symbol_exists("JudyLLast" "Judy.h" HAVE_JUDY) IF(HAVE_JUDY) message(STATUS "Judy library found") @@ -272,6 +273,15 @@ pkg_check_modules(SNAPPY snappy) # ----------------------------------------------------------------------------- +# Detect libmongoc + +find_package(libmongoc-1.0) +# later we use: +# ${MONGOC_LIBRARIES} +# ${MONGOC_INCLUDE_DIRS} + + +# ----------------------------------------------------------------------------- # netdata files set(LIBNETDATA_FILES @@ -594,6 +604,11 @@ set(PROMETHEUS_REMOTE_WRITE_BACKEND_FILES backends/prometheus/remote_write/remote_write.h ) +set(MONGODB_BACKEND_FILES + backends/mongodb/mongodb.c + backends/mongodb/mongodb.h + ) + set(DAEMON_FILES daemon/common.c daemon/common.h @@ -682,6 +697,19 @@ ELSE() ENDIF() # ----------------------------------------------------------------------------- +# mongodb backend + +IF(libmongoc-1.0_FOUND) + message(STATUS "mongodb backend: enabled") + + list(APPEND NETDATA_FILES ${MONGODB_BACKEND_FILES}) + list(APPEND NETDATA_COMMON_LIBRARIES ${MONGOC_LIBRARIES}) + list(APPEND NETDATA_COMMON_INCLUDE_DIRS ${MONGOC_INCLUDE_DIRS}) +ELSE() + message(STATUS "mongodb backend: disabled (requires mongoc library)") +ENDIF() + +# ----------------------------------------------------------------------------- # netdata set(NETDATA_COMMON_LIBRARIES ${NETDATA_COMMON_LIBRARIES} m ${CMAKE_THREAD_LIBS_INIT}) |