Skip to contentSkip to conversation

package/netdata: add prometheus remote write backend support

Buildroot Peter Korsgaard 1 participant 1 message Jan 7, 2022

lore
Share & tools
lore
#0 lore raw

commit: https://git.buildroot.net/buildroot/commit/?id=62c2da0e7a54e96a12190bcaa79e552b497e634b
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

prometheus remote write backend depends on protobuf and snappy and is enabled by default since the addition of the package in commit 1d2bb469078b5818aa2390b9868cd632200f17a2

---
 package/netdata/Config.in  | 19 +++++++++++++++++++
 package/netdata/netdata.mk | 10 ++++++++++
 2 files changed, 29 insertions(+)
package/netdata/Config.in +19 -0
index 88f88cb7ed..34d139125d 100644
@@ -16,6 +16,25 @@ config BR2_PACKAGE_NETDATA
 
 	  https://github.com/netdata/netdata
 
+if BR2_PACKAGE_NETDATA
+
+config BR2_PACKAGE_NETDATA_PROMETHEUS
+	bool "prometheus remote write backend"
+	depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
+	depends on BR2_INSTALL_LIBSTDCPP # protobuf, snappy
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # protobuf
+	select BR2_PACKAGE_PROTOBUF
+	select BR2_PACKAGE_SNAPPY
+	help
+	  Enable prometheus remote write backend
+
+comment "prometheus remote write backend needs a toolchain w/ C++, gcc >= 4.8"
+	depends on !BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+	depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
+
+endif
+
 comment "netdata needs a toolchain w/ NPTL, dynamic library"
 	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_STATIC_LIBS
 	depends on BR2_USE_MMU
package/netdata/netdata.mk +10 -0
index b20d5ea37b..6def59764a 100644
@@ -61,6 +61,16 @@ ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
 NETDATA_CONF_ENV += LIBS=-latomic
 endif
 
+ifeq ($(BR2_PACKAGE_NETDATA_PROMETHEUS),y)
+# Override the result of AC_PATH_PROG([CXX_BINARY], [${CXX}], [no])
+# which fails because CXX is set to the full CXX binary path
+NETDATA_CONF_ENV += ac_cv_path_CXX_BINARY=yes
+NETDATA_CONF_OPTS += --enable-backend-prometheus-remote-write
+NETDATA_DEPENDENCIES += protobuf snappy
+else
+NETDATA_CONF_OPTS += --disable-backend-prometheus-remote-write
+endif
+
 define NETDATA_INSTALL_INIT_SYSV
 	$(INSTALL) -D -m 755 package/netdata/S60netdata \
 		$(TARGET_DIR)/etc/init.d/S60netdata

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot