collectd: add write_prometheus plugin support
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Thu, 22 Dec 2016 01:59:21 +0000 (22:59 -0300)
committerPeter Korsgaard <peter@korsgaard.com>
Fri, 23 Dec 2016 21:46:04 +0000 (22:46 +0100)
Add explicit support for the write_prometheus plugin, it requires the
libmicrohttpd and protobuf-c libraries.

[Peter: add note about where dependencies come from]
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/collectd/Config.in
package/collectd/collectd.mk

index 02c02b7f36f31bf51d75807291b9e5aa4c398234..ab49b71e02d26d86c75171692c89e0cb6b792c36 100644 (file)
@@ -572,6 +572,20 @@ config BR2_PACKAGE_COLLECTD_WRITELOG
        help
          Writes data to the log.
 
+config BR2_PACKAGE_COLLECTD_WRITEPROMETHEUS
+       bool "write_prometheus"
+       depends on BR2_INSTALL_LIBSTDCPP # protobuf-c
+       depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" # protobuf-c
+       select BR2_PACKAGE_LIBMICROHTTPD
+       select BR2_PACKAGE_PROTOBUF_C
+       help
+         Publishes values using an embedded HTTP server, in a format
+         compatible with Prometheus' collectd_exporter.
+
+comment "write_prometheus needs a toolchain w/ C++"
+       depends on !BR2_INSTALL_LIBSTDCPP
+       depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+
 config BR2_PACKAGE_COLLECTD_WRITESENSU
        bool "write_sensu"
        help
index 520ce1c77c15364fb5aac6a271f9e80f3b833484..50a2e53efaa0b53dc45f7156cf2e9a4429d0f9c1 100644 (file)
@@ -119,6 +119,7 @@ COLLECTD_CONF_OPTS += \
        $(if $(BR2_PACKAGE_COLLECTD_WIRELESS),--enable-wireless,--disable-wireless) \
        $(if $(BR2_PACKAGE_COLLECTD_WRITEHTTP),--enable-write_http,--disable-write_http) \
        $(if $(BR2_PACKAGE_COLLECTD_WRITELOG),--enable-write_log,--disable-write_log) \
+       $(if $(BR2_PACKAGE_COLLECTD_WRITEPROMETHEUS),--enable-write_prometheus,--disable-write_prometheus) \
        $(if $(BR2_PACKAGE_COLLECTD_WRITESENSU),--enable-write_sensu,--disable-write_sensu) \
        $(if $(BR2_PACKAGE_COLLECTD_WRITETSDB),--enable-write_tsdb,--disable-write_tsdb) \
        $(if $(BR2_PACKAGE_COLLECTD_ZOOKEEPER),--enable-zookeeper,--disable-zookeeper)
@@ -150,7 +151,8 @@ COLLECTD_DEPENDENCIES = \
        $(if $(BR2_PACKAGE_COLLECTD_SENSORS),lm-sensors) \
        $(if $(BR2_PACKAGE_COLLECTD_SMART),libatasmart) \
        $(if $(BR2_PACKAGE_COLLECTD_SNMP),netsnmp) \
-       $(if $(BR2_PACKAGE_COLLECTD_WRITEHTTP),libcurl)
+       $(if $(BR2_PACKAGE_COLLECTD_WRITEHTTP),libcurl) \
+       $(if $(BR2_PACKAGE_COLLECTD_WRITEPROMETHEUS),libmicrohttpd protobuf-c)
 
 # include/library fixups
 ifeq ($(BR2_PACKAGE_LIBCURL),y)