more information about metrics streaming; setting to cleanup orphan hosts on the master moved to netdata.conf
Costa Tsaousis (ktsaou) committed
Mar 9, 2017 at 23:12 UTC
453c67c303f6aa63853e10593120d7abfe3da322
2 files changed
+33
-14
conf.d/stream.conf
+32
-13
@@ -7,37 +7,49 @@
7
# You can generate API keys, with the linux command: uuidgen
8
#
9
# -----------------------------------------------------------------------------
10
-# 1. SLAVE NETDATA - THE ONE THAT WILL BE SENDING METRICS
10
+# 1. ON SLAVE NETDATA - THE ONE THAT WILL BE SENDING METRICS
11
12
[stream]
13
+ # Enable this on slaves, to have them send metrics.
14
enabled = no
15
15
- # where to send metrics to?
16
- # A space separated list of [PROTOCOL:]HOST[%INTERFACE][:PORT] is accepted.
16
+ # The destination to send metrics to.
17
+ # A space separated list of:
18
+ # [PROTOCOL:]HOST[%INTERFACE][:PORT]
19
# The first available will get the metrics.
20
# PROTOCOL = tcp or udp (only tcp is supported by masters)
21
# HOST = an IPv4, IPv6 IP, or a hostname.
22
# IPv6 IPs should be given with brackets [ip:address]
23
# INTERFACE = the network interface to use
24
# PORT = the port number or service name (/etc/services)
23
- # This communication is not HTTP (cannot be proxied).
25
+ # This communication is not HTTP (cannot be proxied by web proxies).
26
destination =
27
28
# The API_KEY to use (as the sender)
29
api key =
30
29
- # other options (uncomment and set)
31
+ # The timeout to connect and send metrics
32
+ timeout seconds = 60
33
31
- # timeout seconds = 60
32
- # default port = 19999
33
- # buffer size bytes = 1048576
34
- # reconnect delay seconds = 5
35
- # initial clock resync iterations = 60
36
- # free orphan hosts after seconds = 3600
34
+ # If the destination line above does specify a port, use this
35
+ default port = 19999
36
+
37
+ # The buffer to use for sending metrics.
38
+ # 1MB by default is good for 2-3 seconds of data, so increase this
39
+ # if you expect latencies.
40
+ buffer size bytes = 1048576
41
+
42
+ # If the connection fails, or it disconnects,
43
+ # retry after that many seconds.
44
+ reconnect delay seconds = 5
45
+
46
+ # Attempt to sync the clock the of the master with the clock of the
47
+ # slave for that many iterations, when starting.
48
+ initial clock resync iterations = 60
49
50
51
# -----------------------------------------------------------------------------
40
-# 2. MASTER NETDATA - THE ONE THAT WILL BE RECEIVING METRICS
52
+# 2. ON MASTER NETDATA - THE ONE THAT WILL BE RECEIVING METRICS
53
#
54
# You can have one API key per slave, or the same API key for all slaves.
55
#
@@ -95,13 +107,20 @@
107
108
109
# -----------------------------------------------------------------------------
110
+# 3. ON MASTER NETDATA - THE ONE THAT WILL BE RECEIVING METRICS
111
+#
112
+# THIS IS OPTIONAL - YOU DON'T NEED IT BY DEFAULT
113
+# It only exists to give you finer control of the master settings for each
114
+# slave host, when the same API key is used by many netdata slaves / proxies.
115
+#
116
# Each netdata has a unique GUID - generated the first time netdata starts.
117
# You can find it at /var/lib/netdata/registry/netdata.public.unique.id
100
-# The host sending data will have one. If it is static and you can find it,
118
+# The host sending data will have one. If the host is not ephemeral,
119
# you can give settings for each specific host here.
120
121
[MACHINE_GUID]
122
# enable this host: yes | no
123
+ # When disabled, the master will not receive metrics for this host.
124
# THIS IS NOT A SECURITY MECHANISM - AN ATTACKER CAN SET ANY OTHER GUID.
125
# Use only the API key for security.
126
enabled = no
src/rrdpush.c
+1
-1
@@ -33,7 +33,7 @@ int rrdpush_init() {
33
default_rrdpush_enabled = appconfig_get_boolean(&stream_config, CONFIG_SECTION_STREAM, "enabled", default_rrdpush_enabled);
34
default_rrdpush_destination = appconfig_get(&stream_config, CONFIG_SECTION_STREAM, "destination", "");
35
default_rrdpush_api_key = appconfig_get(&stream_config, CONFIG_SECTION_STREAM, "api key", "");
36
- rrdhost_free_orphan_time = appconfig_get_number(&stream_config, CONFIG_SECTION_STREAM, "free orphan hosts after seconds", rrdhost_free_orphan_time);
36
+ rrdhost_free_orphan_time = config_get_number(CONFIG_SECTION_GLOBAL, "cleanup orphan hosts after seconds", rrdhost_free_orphan_time);
37
38
if(default_rrdpush_enabled && (!default_rrdpush_destination || !*default_rrdpush_destination || !default_rrdpush_api_key || !*default_rrdpush_api_key)) {
39
error("STREAM [send]: cannot enable sending thread - information is missing.");