diff mbox series

[1/1] package/netdata: add prometheus remote write backend support

Message ID 20211105173048.2483666-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [1/1] package/netdata: add prometheus remote write backend support | expand

Commit Message

Fabrice Fontaine Nov. 5, 2021, 5:30 p.m. UTC
prometheus remote write backend depends on protobuf and snappy and is
enabled by default since the addition of the package in commit
1d2bb469078b5818aa2390b9868cd632200f17a2

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/netdata/Config.in  | 19 +++++++++++++++++++
 package/netdata/netdata.mk | 10 ++++++++++
 2 files changed, 29 insertions(+)

Comments

Peter Korsgaard Jan. 7, 2022, 10:10 p.m. UTC | #1
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

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

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
 > ---
 >  package/netdata/Config.in  | 19 +++++++++++++++++++
 >  package/netdata/netdata.mk | 10 ++++++++++
 >  2 files changed, 29 insertions(+)

 > diff --git a/package/netdata/Config.in b/package/netdata/Config.in
 > index 88f88cb7ed..34d139125d 100644
 > --- a/package/netdata/Config.in
 > +++ b/package/netdata/Config.in
 > @@ -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
 > diff --git a/package/netdata/netdata.mk b/package/netdata/netdata.mk
 > index 34365cbf56..ac717d56b0 100644
 > --- a/package/netdata/netdata.mk
 > +++ b/package/netdata/netdata.mk
 > @@ -60,6 +60,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

The issue is both the path issue and also the fact that the compiler
may not be in the path. I guess they have used this odd check as you
cannot do a conditional AC_PROG_CXX.

Committed, thanks.
diff mbox series

Patch

diff --git a/package/netdata/Config.in b/package/netdata/Config.in
index 88f88cb7ed..34d139125d 100644
--- a/package/netdata/Config.in
+++ b/package/netdata/Config.in
@@ -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
diff --git a/package/netdata/netdata.mk b/package/netdata/netdata.mk
index 34365cbf56..ac717d56b0 100644
--- a/package/netdata/netdata.mk
+++ b/package/netdata/netdata.mk
@@ -60,6 +60,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