]> arthur.barton.de Git - netdata.git/commitdiff
more information about metrics streaming; setting to cleanup orphan hosts on the...
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 9 Mar 2017 21:12:23 +0000 (23:12 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 9 Mar 2017 21:12:23 +0000 (23:12 +0200)
conf.d/stream.conf
src/rrdpush.c

index 9386f9006b4193d4b68ff935e847ecd77954326b..0ebdccb8aec0a4a34bc60965ccedf4057b23a263 100644 (file)
@@ -7,37 +7,49 @@
 # You can generate API keys, with the linux command: uuidgen
 #
 # -----------------------------------------------------------------------------
 # You can generate API keys, with the linux command: uuidgen
 #
 # -----------------------------------------------------------------------------
-# 1. SLAVE NETDATA - THE ONE THAT WILL BE SENDING METRICS
+# 1. ON SLAVE NETDATA - THE ONE THAT WILL BE SENDING METRICS
 
 [stream]
 
 [stream]
+    # Enable this on slaves, to have them send metrics.
        enabled = no
 
        enabled = no
 
-       # where to send metrics to?
-       # A space separated list of [PROTOCOL:]HOST[%INTERFACE][:PORT] is accepted.
+       # The destination to send metrics to.
+       # A space separated list of:
+       #         [PROTOCOL:]HOST[%INTERFACE][:PORT]
        # The first available will get the metrics.
        # PROTOCOL = tcp or udp (only tcp is supported by masters)
        # HOST = an IPv4, IPv6 IP, or a hostname.
        #        IPv6 IPs should be given with brackets [ip:address]
        # INTERFACE = the network interface to use
        # PORT = the port number or service name (/etc/services)
        # The first available will get the metrics.
        # PROTOCOL = tcp or udp (only tcp is supported by masters)
        # HOST = an IPv4, IPv6 IP, or a hostname.
        #        IPv6 IPs should be given with brackets [ip:address]
        # INTERFACE = the network interface to use
        # PORT = the port number or service name (/etc/services)
-       # This communication is not HTTP (cannot be proxied).
+       # This communication is not HTTP (cannot be proxied by web proxies).
        destination =
 
        # The API_KEY to use (as the sender)
        api key =
 
        destination =
 
        # The API_KEY to use (as the sender)
        api key =
 
-       # other options (uncomment and set)
+    # The timeout to connect and send metrics
+       timeout seconds = 60
 
 
-       # timeout seconds = 60
-       # default port = 19999
-       # buffer size bytes = 1048576
-       # reconnect delay seconds = 5
-       # initial clock resync iterations = 60
-       # free orphan hosts after seconds = 3600
+       # If the destination line above does specify a port, use this
+       default port = 19999
+
+       # The buffer to use for sending metrics.
+       # 1MB by default is good for 2-3 seconds of data, so increase this
+       # if you expect latencies.
+       buffer size bytes = 1048576
+
+       # If the connection fails, or it disconnects,
+       # retry after that many seconds.
+       reconnect delay seconds = 5
+
+       # Attempt to sync the clock the of the master with the clock of the
+       # slave for that many iterations, when starting.
+       initial clock resync iterations = 60
 
 
 # -----------------------------------------------------------------------------
 
 
 # -----------------------------------------------------------------------------
-# 2. MASTER NETDATA - THE ONE THAT WILL BE RECEIVING METRICS
+# 2. ON MASTER NETDATA - THE ONE THAT WILL BE RECEIVING METRICS
 #
 #    You can have one API key per slave, or the same API key for all slaves.
 #
 #
 #    You can have one API key per slave, or the same API key for all slaves.
 #
 
 
 # -----------------------------------------------------------------------------
 
 
 # -----------------------------------------------------------------------------
+# 3. ON MASTER NETDATA - THE ONE THAT WILL BE RECEIVING METRICS
+#
+# THIS IS OPTIONAL - YOU DON'T NEED IT BY DEFAULT
+# It only exists to give you finer control of the master settings for each
+# slave host, when the same API key is used by many netdata slaves / proxies.
+#
 # Each netdata has a unique GUID - generated the first time netdata starts.
 # You can find it at /var/lib/netdata/registry/netdata.public.unique.id
 # Each netdata has a unique GUID - generated the first time netdata starts.
 # You can find it at /var/lib/netdata/registry/netdata.public.unique.id
-# The host sending data will have one. If it is static and you can find it,
+# The host sending data will have one. If the host is not ephemeral,
 # you can give settings for each specific host here.
 
 [MACHINE_GUID]
     # enable this host: yes | no
 # you can give settings for each specific host here.
 
 [MACHINE_GUID]
     # enable this host: yes | no
+    # When disabled, the master will not receive metrics for this host.
     # THIS IS NOT A SECURITY MECHANISM - AN ATTACKER CAN SET ANY OTHER GUID.
     # Use only the API key for security.
     enabled = no
     # THIS IS NOT A SECURITY MECHANISM - AN ATTACKER CAN SET ANY OTHER GUID.
     # Use only the API key for security.
     enabled = no
index f5f54d39a320e8158b2b7df2d4921510a0a6c1bc..5b626410c803433aa0efd3958df1619bf9f84e2b 100644 (file)
@@ -33,7 +33,7 @@ int rrdpush_init() {
     default_rrdpush_enabled     = appconfig_get_boolean(&stream_config, CONFIG_SECTION_STREAM, "enabled", default_rrdpush_enabled);
     default_rrdpush_destination = appconfig_get(&stream_config, CONFIG_SECTION_STREAM, "destination", "");
     default_rrdpush_api_key     = appconfig_get(&stream_config, CONFIG_SECTION_STREAM, "api key", "");
     default_rrdpush_enabled     = appconfig_get_boolean(&stream_config, CONFIG_SECTION_STREAM, "enabled", default_rrdpush_enabled);
     default_rrdpush_destination = appconfig_get(&stream_config, CONFIG_SECTION_STREAM, "destination", "");
     default_rrdpush_api_key     = appconfig_get(&stream_config, CONFIG_SECTION_STREAM, "api key", "");
-    rrdhost_free_orphan_time    = appconfig_get_number(&stream_config, CONFIG_SECTION_STREAM, "free orphan hosts after seconds", rrdhost_free_orphan_time);
+    rrdhost_free_orphan_time    = config_get_number(CONFIG_SECTION_GLOBAL, "cleanup orphan hosts after seconds", rrdhost_free_orphan_time);
 
     if(default_rrdpush_enabled && (!default_rrdpush_destination || !*default_rrdpush_destination || !default_rrdpush_api_key || !*default_rrdpush_api_key)) {
         error("STREAM [send]: cannot enable sending thread - information is missing.");
 
     if(default_rrdpush_enabled && (!default_rrdpush_destination || !*default_rrdpush_destination || !default_rrdpush_api_key || !*default_rrdpush_api_key)) {
         error("STREAM [send]: cannot enable sending thread - information is missing.");