]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
fix lua for new carbon variables in key
authorGibheer <gibheer+git@zero-knowledge.org>
Wed, 12 Sep 2018 05:34:56 +0000 (07:34 +0200)
committerGibheer <gibheer+git@zero-knowledge.org>
Thu, 20 Sep 2018 09:42:45 +0000 (11:42 +0200)
This commit updates the documentation and adds the namespace and
instance variables to the lua system.

pdns/dnsdist-lua.cc
pdns/dnsdistdist/docs/guides/carbon.rst

index ce7e6dafe434f5d4c0a9e50f30784d9f4c26bcce..6b15ae0d5ede757479188f38c0c6a1bb7275a7cf 100644 (file)
@@ -610,10 +610,16 @@ void setupLuaConfig(bool client)
     });
 
   g_lua.writeFunction("carbonServer", [](const std::string& address, boost::optional<string> ourName,
-                                        boost::optional<unsigned int> interval) {
+                                        boost::optional<unsigned int> interval, boost::optional<string> namespace_name,
+           boost::optional<string> 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);
                      });
 
index 7e07ee84e914f8c5e3ff889419e64e3b63630e9b..bac9ffaaed2f44e73f58929fc5e3d44955f6b228 100644 (file)
@@ -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 <https://github.com/ahupowerdns/metronome>`_ comes with attractive graphs for dnsdist by default.
 
 Query counters