summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorVladimir Kobal <vlad@prokk.net>2020-03-12 13:28:43 +0200
committerGitHub <noreply@github.com>2020-03-12 13:28:43 +0200
commitbc0ca9b1b3cbdd6d1a76d2150080dff79e116e24 (patch)
tree2d2c59e6f32e831612a257c73e81bfdf5f65c361 /CMakeLists.txt
parentbec7b83e19944a7e844c6c7777f92ccba6d504e3 (diff)
Add a Prometheus Remote Write connector to the exporting engine (#8292)
* Copy files from the Prometheus remote write backend * Update the documentation * Rename backend -> exporting * Add the connector to the Netdata build * Separate files for the remote write connector * Add an initializer and formatters * Read a connector specific configuration option * Add a separate function for header sending * Use labels instead of tags * Separate write request for every instance * Add unit tests
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt25
1 files changed, 23 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 67a24b9176..55ddfaaf76 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -634,6 +634,8 @@ set(EXPORTING_ENGINE_FILES
exporting/json/json.h
exporting/opentsdb/opentsdb.c
exporting/opentsdb/opentsdb.h
+ exporting/prometheus/prometheus.c
+ exporting/prometheus/prometheus.h
exporting/read_config.c
exporting/init_connectors.c
exporting/process_data.c
@@ -642,6 +644,13 @@ set(EXPORTING_ENGINE_FILES
exporting/send_internal_metrics.c
)
+set(PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES
+ exporting/prometheus/remote_write/remote_write.c
+ exporting/prometheus/remote_write/remote_write.h
+ exporting/prometheus/remote_write/remote_write_request.cc
+ exporting/prometheus/remote_write/remote_write_request.h
+ )
+
set(KINESIS_EXPORTING_FILES
exporting/aws_kinesis/aws_kinesis.c
exporting/aws_kinesis/aws_kinesis.h
@@ -753,9 +762,9 @@ IF(ENABLE_BACKEND_PROMETHEUS_REMOTE_WRITE)
message(STATUS "prometheus remote write backend: enabled")
find_package(Protobuf REQUIRED)
- protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS backends/prometheus/remote_write/remote_write.proto)
+ protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS exporting/prometheus/remote_write/remote_write.proto)
- list(APPEND NETDATA_FILES ${PROMETHEUS_REMOTE_WRITE_BACKEND_FILES} ${PROTO_SRCS} ${PROTO_HDRS})
+ list(APPEND NETDATA_FILES ${PROMETHEUS_REMOTE_WRITE_BACKEND_FILES} ${PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES} ${PROTO_SRCS} ${PROTO_HDRS})
list(APPEND NETDATA_COMMON_LIBRARIES ${PROTOBUF_LIBRARIES} ${SNAPPY_LIBRARIES})
list(APPEND NETDATA_COMMON_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIRS} ${SNAPPY_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
list(APPEND NETDATA_COMMON_CFLAGS ${PROTOBUF_CFLAGS_OTHER} ${SNAPPY_CFLAGS_OTHER})
@@ -1021,6 +1030,17 @@ if(BUILD_TESTING)
)
set(TEST_NAME exporting_engine)
set(KINESIS_LINK_OPTIONS)
+ set(PROMETHEUS_REMOTE_WRITE_LINK_OPTIONS)
+if(ENABLE_BACKEND_PROMETHEUS_REMOTE_WRITE)
+ list(APPEND EXPORTING_ENGINE_FILES ${PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES} ${PROTO_SRCS} ${PROTO_HDRS})
+ list(
+ APPEND PROMETHEUS_REMOTE_WRITE_LINK_OPTIONS
+ -Wl,--wrap=init_write_request
+ -Wl,--wrap=add_host_info
+ -Wl,--wrap=add_label
+ -Wl,--wrap=add_metric
+ )
+endif()
if(ENABLE_BACKEND_KINESIS)
list(APPEND EXPORTING_ENGINE_FILES ${KINESIS_EXPORTING_FILES})
list(
@@ -1062,6 +1082,7 @@ endif()
-Wl,--wrap=send
-Wl,--wrap=connect_to_one_of
${KINESIS_LINK_OPTIONS}
+ ${PROMETHEUS_REMOTE_WRITE_LINK_OPTIONS}
)
target_link_libraries(${TEST_NAME}_testdriver libnetdata ${NETDATA_COMMON_LIBRARIES} ${CMOCKA_LIBRARIES})
add_test(NAME test_${TEST_NAME} COMMAND ${TEST_NAME}_testdriver)