Seconds to store packets in the :ref:`packet-cache`.
+.. _setting-carbon-namespace:
+
+``carbon-namespace``
+--------------------
+
+- String
+- Default: pdns
+
+Set the namespace or first string of the metric key. Be careful not to include
+any dots in this setting, unless you know what you are doing.
+See :ref:`metricscarbon`
+
.. _setting-carbon-ourname:
``carbon-ourname``
careful not to include any dots in this setting, unless you know what
you are doing. See :ref:`metricscarbon`
+.. _setting-carbon-instance:
+
+``carbon-instance``
+-------------------
+
+- String
+- Default: auth
+
+Set the instance or third string of the metric key. Be careful not to include
+any dots in this setting, unless you know what you are doing.
+See :ref:`metricscarbon`
+
.. _setting-carbon-server:
``carbon-server``
{
extern StatBag S;
+ string namespace_name=arg()["carbon-namespace"];
+ if(namespace_name.empty()) {
+ namespace_name="pdns";
+ }
string hostname=arg()["carbon-ourname"];
if(hostname.empty()) {
char tmp[80];
hostname=tmp;
boost::replace_all(hostname, ".", "_");
}
+ string instance_name=arg()["carbon-instancename"];
+ if(instance_name.empty()) {
+ instance_name="auth";
+ }
vector<string> carbonServers;
stringtok(carbonServers, arg()["carbon-server"], ", ");
ostringstream str;
time_t now=time(0);
for(const string& entry : entries) {
- str<<"pdns."<<hostname<<".auth."<<entry<<' '<<S.read(entry)<<' '<<now<<"\r\n";
+ str<<namespace_name<<'.'<<hostname<<'.'<<instance_name<<'.'<<entry<<' '<<S.read(entry)<<' '<<now<<"\r\n";
}
msg = str.str();
::arg().setSwitch("do-ipv6-additional-processing", "Do AAAA additional processing")="yes";
::arg().setSwitch("query-logging","Hint backends that queries should be logged")="no";
+ ::arg().set("carbon-namespace", "If set overwrites the first part of the carbon string)=");
::arg().set("carbon-ourname", "If set, overrides our reported hostname for carbon stats")="";
+ ::arg().set("carbon-instancename", "If set overwrites the the instance name default)=");
::arg().set("carbon-server", "If set, send metrics in carbon (graphite) format to this server IP address")="";
::arg().set("carbon-interval", "Number of seconds between carbon (graphite) updates")="30";
try
{
string hostname;
+ string instance_name;
+ string namespace_name;
vector<string> carbonServers;
{
Lock l(&g_carbon_config_lock);
stringtok(carbonServers, arg()["carbon-server"], ", ");
+ namespace_name=arg()["carbon-namespace"];
hostname=arg()["carbon-ourname"];
+ instance_name=arg()["carbon-instance"];
}
if(carbonServers.empty())
return;
+ if(namespace_name.empty()) {
+ namespace_name="pdns";
+ }
if(hostname.empty()) {
char tmp[80];
memset(tmp, 0, sizeof(tmp));
hostname=tmp;
boost::replace_all(hostname, ".", "_");
}
+ if(instance_name.empty()) {
+ instance_name="recursor";
+ }
registerAllStats();
string msg;
time_t now=time(0);
for(const all_t::value_type& val : all) {
- str<<"pdns."<<hostname<<".recursor."<<val.first<<' '<<val.second<<' '<<now<<"\r\n";
+ str<<namespace_name<<'.'<<hostname<<'.'<<instance_name<<'.'<<val.first<<' '<<val.second<<' '<<now<<"\r\n";
}
msg = str.str();
}
If sending carbon updates, this is the interval between them in seconds.
See :doc:`metrics`.
+.. _setting-carbon-namespace:
+
+``carbon-namespace``
+--------------------
+- String
+
+Change the namespace or first string of the metric key. The default is pdns.
+
.. _setting-carbon-ourname:
``carbon-ourname``
Be careful not to include any dots in this setting, unless you know what you are doing.
See :ref:`metricscarbon`.
+.. _setting-carbon-instance:
+
+``carbon-instance``
+--------------------
+- String
+
+Change the instance or third string of the metric key. The default is recursor.
+
.. _setting-carbon-server:
``carbon-server``