});
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);
});
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