From: Gibheer Date: Wed, 12 Sep 2018 05:34:56 +0000 (+0200) Subject: fix lua for new carbon variables in key X-Git-Tag: auth-4.2.0-alpha1~49^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48341d8fe8e1a71a907da37008de18137e4341d2;p=thirdparty%2Fpdns.git fix lua for new carbon variables in key This commit updates the documentation and adds the namespace and instance variables to the lua system. --- diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index ce7e6dafe4..6b15ae0d5e 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -610,10 +610,16 @@ void setupLuaConfig(bool client) }); g_lua.writeFunction("carbonServer", [](const std::string& address, boost::optional ourName, - boost::optional interval) { + boost::optional interval, boost::optional namespace_name, + boost::optional instance_name) { setLuaSideEffect(); auto ours = g_carbon.getCopy(); - ours.push_back({ComboAddress(address, 2003), ourName ? *ourName : "", interval ? *interval : 30}); + ours.push_back({ + ComboAddress(address, 2003), + namespace_name ? *namespace_name : "dnsdist", + ourName ? *ourName : "", +instance_name ? *instance_name : "main" , + interval ? *interval : 30, }); g_carbon.setState(ours); }); diff --git a/pdns/dnsdistdist/docs/guides/carbon.rst b/pdns/dnsdistdist/docs/guides/carbon.rst index 7e07ee84e9..bac9ffaaed 100644 --- a/pdns/dnsdistdist/docs/guides/carbon.rst +++ b/pdns/dnsdistdist/docs/guides/carbon.rst @@ -6,9 +6,9 @@ Setting up a carbon export To emit metrics to Graphite, or any other software supporting the Carbon protocol, use:: - carbonServer('ip-address-of-carbon-server', 'ourname', 30) + carbonServer('ip-address-of-carbon-server', 'ourname', 30, 'dnsdist', 'main') -Where ``ourname`` can be used to override your hostname, and ``30`` is the reporting interval in seconds. The last two arguments can be omitted. +Where ``ourname`` can be used to override your hostname, and ``30`` is the reporting interval in seconds. ``dnsdist`` and ``main`` are used as namespace and instance variables. For querycount statistics these two variables are currently ignored. The last four arguments can be omitted. The latest version of `PowerDNS Metronome `_ comes with attractive graphs for dnsdist by default. Query counters