support filtering of charts during streaming; fixes #4223 (#4361)
Costa Tsaousis committed
Oct 12, 2018 at 12:22 UTC
7f5e6c594fa6c1f0aa4e8e5c97a9bb84206071d6
8 files changed
+110
-47
conf.d/stream.conf
+22
-10
@@ -39,17 +39,25 @@
39
# If the destination line above does not specify a port, use this
40
default port = 19999
41
42
+ # filter the charts to be streamed
43
+ # netdata SIMPLE PATTERN:
44
+ # - space separated list of patterns (use \ to include spaces in patterns)
45
+ # - use * as wildcard, any number of times within each pattern
46
+ # - prefix a pattern with ! for a negative match (ie not stream the charts it matches)
47
+ # - the order of patterns is important (left to right)
48
+ # To send all except a few, use: !this !that * (ie append a wildcard pattern)
49
+ send charts matching = *
50
+
51
# The buffer to use for sending metrics.
43
- # 1MB is good for 10-20 seconds of data, so increase this
44
- # if you expect latencies.
52
+ # 1MB is good for 10-20 seconds of data, so increase this if you expect latencies.
53
+ # The buffer is flushed on reconnects (this will not prevent gaps at the charts).
54
buffer size bytes = 1048576
55
56
# If the connection fails, or it disconnects,
57
# retry after that many seconds.
58
reconnect delay seconds = 5
59
51
- # Attempt to sync the clock the of the master with the clock of the
52
- # slave for that many iterations, when starting.
60
+ # Sync the clock of the charts for that many iterations, when starting.
61
initial clock resync iterations = 60
62
63
@@ -62,8 +70,9 @@
70
# netdata searches for options in this order:
71
#
72
# a) master netdata settings (netdata.conf)
65
-# b) [API_KEY] section (below, settings for the API key)
66
-# c) [MACHINE_GUID] section (below, settings for each machine)
73
+# b) [stream] section (above)
74
+# c) [API_KEY] section (below, settings for the API key)
75
+# d) [MACHINE_GUID] section (below, settings for each machine)
76
#
77
# You can combine the above (the more specific setting will be used).
78
@@ -95,7 +104,7 @@
104
# If you don't set it here, the memory mode of netdata.conf will be used.
105
# Valid modes:
106
# save save on exit, load on start
98
- # map like swap (continuously syncing to disks)
107
+ # map like swap (continuously syncing to disks - you need SSD)
108
# ram keep it in RAM, don't touch the disk
109
# none no database at all (use this on headless proxies)
110
default memory mode = ram
@@ -106,7 +115,7 @@
115
# no do not enable alarms
116
# auto enable alarms, only when the sending netdata is connected
117
# You can also set it per host, below.
109
- # The default is the same as to netdata.conf
118
+ # The default is taken from [health].enabled of netdata.conf
119
health enabled by default = auto
120
121
# postpone alarms for a short period after the sender is connected
@@ -120,15 +129,16 @@
129
multiple connections = allow
130
131
# need to route metrics differently? set these.
123
- # the defaults are the ones at the [stream] section
132
+ # the defaults are the ones at the [stream] section (above)
133
#default proxy enabled = yes | no
134
#default proxy destination = IP:PORT IP:PORT ...
135
#default proxy api key = API_KEY
136
+ #default proxy send charts matching = *
137
138
139
# -----------------------------------------------------------------------------
140
# 3. PER SENDING HOST SETTINGS, ON MASTER NETDATA
131
-# THIS IS OPTIONAL - YOU DON'T NEED IT
141
+# THIS IS OPTIONAL - YOU DON'T HAVE TO CONFIGURE IT
142
143
# This section exists to give you finer control of the master settings for each
144
# slave host, when the same API key is used by many netdata slaves / proxies.
@@ -174,6 +184,8 @@
184
multiple connections = allow
185
186
# need to route metrics differently?
187
+ # the defaults are the ones at the [API KEY] section
188
#proxy enabled = yes | no
189
#proxy destination = IP:PORT IP:PORT ...
190
#proxy api key = API_KEY
191
+ #proxy send charts matching = *
src/database/rrd.h
+19
-14
@@ -240,19 +240,21 @@ struct rrddim {
240
// and may lead to missing information.
241
242
typedef enum rrdset_flags {
243
- RRDSET_FLAG_ENABLED = 1 << 0, // enables or disables a chart
244
- RRDSET_FLAG_DETAIL = 1 << 1, // if set, the data set should be considered as a detail of another
243
+ RRDSET_FLAG_ENABLED = 1 << 0, // enables or disables a chart
244
+ RRDSET_FLAG_DETAIL = 1 << 1, // if set, the data set should be considered as a detail of another
245
// (the master data set should be the one that has the same family and is not detail)
246
- RRDSET_FLAG_DEBUG = 1 << 2, // enables or disables debugging for a chart
247
- RRDSET_FLAG_OBSOLETE = 1 << 3, // this is marked by the collector/module as obsolete
248
- RRDSET_FLAG_BACKEND_SEND = 1 << 4, // if set, this chart should be sent to backends
249
- RRDSET_FLAG_BACKEND_IGNORE = 1 << 5, // if set, this chart should not be sent to backends
250
- RRDSET_FLAG_EXPOSED_UPSTREAM = 1 << 6, // if set, we have sent this chart to netdata master (streaming)
251
- RRDSET_FLAG_STORE_FIRST = 1 << 7, // if set, do not eliminate the first collection during interpolation
252
- RRDSET_FLAG_HETEROGENEOUS = 1 << 8, // if set, the chart is not homogeneous (dimensions in it have multiple algorithms, multipliers or dividers)
253
- RRDSET_FLAG_HOMEGENEOUS_CHECK= 1 << 9, // if set, the chart should be checked to determine if the dimensions as homogeneous
254
- RRDSET_FLAG_HIDDEN = 1 << 10, // if set, do not show this chart on the dashboard, but use it for backends
255
- RRDSET_FLAG_SYNC_CLOCK = 1 << 11, // if set, microseconds on next data collection will be ignored (the chart will be synced to now)
246
+ RRDSET_FLAG_DEBUG = 1 << 2, // enables or disables debugging for a chart
247
+ RRDSET_FLAG_OBSOLETE = 1 << 3, // this is marked by the collector/module as obsolete
248
+ RRDSET_FLAG_BACKEND_SEND = 1 << 4, // if set, this chart should be sent to backends
249
+ RRDSET_FLAG_BACKEND_IGNORE = 1 << 5, // if set, this chart should not be sent to backends
250
+ RRDSET_FLAG_UPSTREAM_SEND = 1 << 6, // if set, this chart should be sent upstream (streaming)
251
+ RRDSET_FLAG_UPSTREAM_IGNORE = 1 << 7, // if set, this chart should not be sent upstream (streaming)
252
+ RRDSET_FLAG_UPSTREAM_EXPOSED = 1 << 8, // if set, we have sent this chart definition to netdata master (streaming)
253
+ RRDSET_FLAG_STORE_FIRST = 1 << 9, // if set, do not eliminate the first collection during interpolation
254
+ RRDSET_FLAG_HETEROGENEOUS = 1 << 10, // if set, the chart is not homogeneous (dimensions in it have multiple algorithms, multipliers or dividers)
255
+ RRDSET_FLAG_HOMEGENEOUS_CHECK = 1 << 11, // if set, the chart should be checked to determine if the dimensions as homogeneous
256
+ RRDSET_FLAG_HIDDEN = 1 << 12, // if set, do not show this chart on the dashboard, but use it for backends
257
+ RRDSET_FLAG_SYNC_CLOCK = 1 << 13, // if set, microseconds on next data collection will be ignored (the chart will be synced to now)
258
} RRDSET_FLAGS;
259
260
#ifdef HAVE_C___ATOMIC
@@ -302,7 +304,7 @@ struct rrdset {
304
long current_entry; // the entry that is currently being updated
305
// it goes around in a round-robin fashion
306
305
- uint32_t flags; // configuration flags
307
+ RRDSET_FLAGS flags; // configuration flags
308
309
int gap_when_lost_iterations_above; // after how many lost iterations a gap should be stored
310
// netdata will interpolate values for gaps lower than this
@@ -501,7 +503,7 @@ struct rrdhost {
503
const char *tags; // tags for this host
504
const char *timezone; // the timezone of the host
505
504
- uint32_t flags; // flags about this RRDHOST
506
+ RRDHOST_FLAGS flags; // flags about this RRDHOST
507
508
int rrd_update_every; // the update frequency of the host
509
long rrd_history_entries; // the number of history entries for the host's charts
@@ -531,6 +533,8 @@ struct rrdhost {
533
volatile unsigned int rrdpush_sender_error_shown:1; // 1 when we have logged a communication error
534
volatile unsigned int rrdpush_sender_join:1; // 1 when we have to join the sending thread
535
536
+ SIMPLE_PATTERN *rrdpush_send_charts_matching; // pattern to match the charts to be sent
537
+
538
// metrics may be collected asynchronously
539
// these synchronize all the threads willing the write to our sending buffer
540
netdata_mutex_t rrdpush_sender_buffer_mutex; // exclusive access to rrdpush_sender_buffer
@@ -646,6 +650,7 @@ extern RRDHOST *rrdhost_find_or_create(
650
, unsigned int rrdpush_enabled
651
, char *rrdpush_destination
652
, char *rrdpush_api_key
653
+ , char *rrdpush_send_charts_matching
654
);
655
656
#if defined(NETDATA_INTERNAL_CHECKS) && defined(NETDATA_VERIFY_LOCKS)
src/database/rrddim.c
+5
-5
@@ -49,7 +49,7 @@ inline int rrddim_set_name(RRDSET *st, RRDDIM *rd, const char *name) {
49
rd->hash_name = simple_hash(rd->name);
50
rrddimvar_rename_all(rd);
51
rd->exposed = 0;
52
- rrdset_flag_clear(st, RRDSET_FLAG_EXPOSED_UPSTREAM);
52
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
53
return 1;
54
}
55
@@ -61,7 +61,7 @@ inline int rrddim_set_algorithm(RRDSET *st, RRDDIM *rd, RRD_ALGORITHM algorithm)
61
rd->algorithm = algorithm;
62
rd->exposed = 0;
63
rrdset_flag_set(st, RRDSET_FLAG_HOMEGENEOUS_CHECK);
64
- rrdset_flag_clear(st, RRDSET_FLAG_EXPOSED_UPSTREAM);
64
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
65
return 1;
66
}
67
@@ -73,7 +73,7 @@ inline int rrddim_set_multiplier(RRDSET *st, RRDDIM *rd, collected_number multip
73
rd->multiplier = multiplier;
74
rd->exposed = 0;
75
rrdset_flag_set(st, RRDSET_FLAG_HOMEGENEOUS_CHECK);
76
- rrdset_flag_clear(st, RRDSET_FLAG_EXPOSED_UPSTREAM);
76
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
77
return 1;
78
}
79
@@ -85,7 +85,7 @@ inline int rrddim_set_divisor(RRDSET *st, RRDDIM *rd, collected_number divisor)
85
rd->divisor = divisor;
86
rd->exposed = 0;
87
rrdset_flag_set(st, RRDSET_FLAG_HOMEGENEOUS_CHECK);
88
- rrdset_flag_clear(st, RRDSET_FLAG_EXPOSED_UPSTREAM);
88
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
89
return 1;
90
}
91
@@ -96,7 +96,7 @@ RRDDIM *rrddim_add_custom(RRDSET *st, const char *id, const char *name, collecte
96
rrdset_wrlock(st);
97
98
rrdset_flag_set(st, RRDSET_FLAG_SYNC_CLOCK);
99
- rrdset_flag_clear(st, RRDSET_FLAG_EXPOSED_UPSTREAM);
99
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
100
101
RRDDIM *rd = rrddim_find(st, id);
102
if(unlikely(rd)) {
src/database/rrdhost.c
+6
@@ -122,6 +122,7 @@ RRDHOST *rrdhost_create(const char *hostname,
122
unsigned int rrdpush_enabled,
123
char *rrdpush_destination,
124
char *rrdpush_api_key,
125
+ char *rrdpush_send_charts_matching,
126
int is_localhost
127
) {
128
debug(D_RRDHOST, "Host '%s': adding with guid '%s'", hostname, guid);
@@ -137,6 +138,7 @@ RRDHOST *rrdhost_create(const char *hostname,
138
host->rrdpush_send_enabled = (rrdpush_enabled && rrdpush_destination && *rrdpush_destination && rrdpush_api_key && *rrdpush_api_key) ? 1 : 0;
139
host->rrdpush_send_destination = (host->rrdpush_send_enabled)?strdupz(rrdpush_destination):NULL;
140
host->rrdpush_send_api_key = (host->rrdpush_send_enabled)?strdupz(rrdpush_api_key):NULL;
141
+ host->rrdpush_send_charts_matching = simple_pattern_create(rrdpush_send_charts_matching, NULL, SIMPLE_PATTERN_EXACT);
142
143
host->rrdpush_sender_pipe[0] = -1;
144
host->rrdpush_sender_pipe[1] = -1;
@@ -329,6 +331,7 @@ RRDHOST *rrdhost_find_or_create(
331
, unsigned int rrdpush_enabled
332
, char *rrdpush_destination
333
, char *rrdpush_api_key
334
+ , char *rrdpush_send_charts_matching
335
) {
336
debug(D_RRDHOST, "Searching for host '%s' with guid '%s'", hostname, guid);
337
@@ -351,6 +354,7 @@ RRDHOST *rrdhost_find_or_create(
354
, rrdpush_enabled
355
, rrdpush_destination
356
, rrdpush_api_key
357
+ , rrdpush_send_charts_matching
358
, 0
359
);
360
}
@@ -463,6 +467,7 @@ void rrd_init(char *hostname) {
467
, default_rrdpush_enabled
468
, default_rrdpush_destination
469
, default_rrdpush_api_key
470
+ , default_rrdpush_send_charts_matching
471
, 1
472
);
473
rrd_unlock();
@@ -576,6 +581,7 @@ void rrdhost_free(RRDHOST *host) {
581
freez(host->health_log_filename);
582
freez(host->hostname);
583
freez(host->registry_hostname);
584
+ simple_pattern_free(host->rrdpush_send_charts_matching);
585
rrdhost_unlock(host);
586
netdata_rwlock_destroy(&host->health_log.alarm_log_rwlock);
587
netdata_rwlock_destroy(&host->rrdhost_rwlock);
src/database/rrdset.c
+16
-9
@@ -174,27 +174,30 @@ int rrdset_set_name(RRDSET *st, const char *name) {
174
if(unlikely(rrdset_index_add_name(host, st) != st))
175
error("RRDSET: INTERNAL ERROR: attempted to index duplicate chart name '%s'", st->name);
176
177
+ rrdset_flag_clear(st, RRDSET_FLAG_BACKEND_SEND);
178
+ rrdset_flag_clear(st, RRDSET_FLAG_BACKEND_IGNORE);
179
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_SEND);
180
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_IGNORE);
181
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
182
+
183
return 1;
184
}
185
186
inline void rrdset_is_obsolete(RRDSET *st) {
181
- RRDHOST *host = st->rrdhost;
182
-
187
if(unlikely(!(rrdset_flag_check(st, RRDSET_FLAG_OBSOLETE)))) {
188
rrdset_flag_set(st, RRDSET_FLAG_OBSOLETE);
185
- rrdset_flag_clear(st, RRDSET_FLAG_EXPOSED_UPSTREAM);
189
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
190
191
// the chart will not get more updates (data collection)
192
// so, we have to push its definition now
189
- if(unlikely(host->rrdpush_send_enabled))
190
- rrdset_push_chart_definition(st);
193
+ rrdset_push_chart_definition_now(st);
194
}
195
}
196
197
inline void rrdset_isnot_obsolete(RRDSET *st) {
198
if(unlikely((rrdset_flag_check(st, RRDSET_FLAG_OBSOLETE)))) {
199
rrdset_flag_clear(st, RRDSET_FLAG_OBSOLETE);
197
- rrdset_flag_clear(st, RRDSET_FLAG_EXPOSED_UPSTREAM);
200
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
201
202
// the chart will be pushed upstream automatically
203
// due to data collection
@@ -480,7 +483,7 @@ RRDSET *rrdset_create_custom(
483
RRDSET *st = rrdset_find_on_create(host, fullid);
484
if(st) {
485
rrdset_flag_set(st, RRDSET_FLAG_SYNC_CLOCK);
483
- rrdset_flag_clear(st, RRDSET_FLAG_EXPOSED_UPSTREAM);
486
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
487
return st;
488
}
489
@@ -490,7 +493,7 @@ RRDSET *rrdset_create_custom(
493
if(st) {
494
rrdhost_unlock(host);
495
rrdset_flag_set(st, RRDSET_FLAG_SYNC_CLOCK);
493
- rrdset_flag_clear(st, RRDSET_FLAG_EXPOSED_UPSTREAM);
496
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
497
return st;
498
}
499
@@ -652,7 +655,11 @@ RRDSET *rrdset_create_custom(
655
rrdset_flag_clear(st, RRDSET_FLAG_DETAIL);
656
rrdset_flag_clear(st, RRDSET_FLAG_DEBUG);
657
rrdset_flag_clear(st, RRDSET_FLAG_OBSOLETE);
655
- rrdset_flag_clear(st, RRDSET_FLAG_EXPOSED_UPSTREAM);
658
+ rrdset_flag_clear(st, RRDSET_FLAG_BACKEND_SEND);
659
+ rrdset_flag_clear(st, RRDSET_FLAG_BACKEND_IGNORE);
660
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_SEND);
661
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_IGNORE);
662
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
663
rrdset_flag_set(st, RRDSET_FLAG_SYNC_CLOCK);
664
665
// if(!strcmp(st->id, "disk_util.dm-0")) {
src/database/rrdsetvar.c
+1
-1
@@ -183,7 +183,7 @@ void rrdsetvar_custom_chart_variable_set(RRDSETVAR *rs, calculated_number value)
183
*v = value;
184
185
// mark the chart to be sent upstream
186
- rrdset_flag_clear(rs->rrdset, RRDSET_FLAG_EXPOSED_UPSTREAM);
186
+ rrdset_flag_clear(rs->rrdset, RRDSET_FLAG_UPSTREAM_EXPOSED);
187
}
188
}
189
}
src/streaming/rrdpush.c
+39
-7
@@ -35,11 +35,13 @@ typedef enum {
35
unsigned int default_rrdpush_enabled = 0;
36
char *default_rrdpush_destination = NULL;
37
char *default_rrdpush_api_key = NULL;
38
+char *default_rrdpush_send_charts_matching = NULL;
39
40
int rrdpush_init() {
41
default_rrdpush_enabled = (unsigned int)appconfig_get_boolean(&stream_config, CONFIG_SECTION_STREAM, "enabled", default_rrdpush_enabled);
42
default_rrdpush_destination = appconfig_get(&stream_config, CONFIG_SECTION_STREAM, "destination", "");
43
default_rrdpush_api_key = appconfig_get(&stream_config, CONFIG_SECTION_STREAM, "api key", "");
44
+ default_rrdpush_send_charts_matching = appconfig_get(&stream_config, CONFIG_SECTION_STREAM, "send charts matching", "*");
45
rrdhost_free_orphan_time = config_get_number(CONFIG_SECTION_GLOBAL, "cleanup orphan hosts after seconds", rrdhost_free_orphan_time);
46
47
if(default_rrdpush_enabled && (!default_rrdpush_destination || !*default_rrdpush_destination || !default_rrdpush_api_key || !*default_rrdpush_api_key)) {
@@ -69,11 +71,33 @@ unsigned int remote_clock_resync_iterations = 60;
71
#define rrdpush_buffer_lock(host) netdata_mutex_lock(&((host)->rrdpush_sender_buffer_mutex))
72
#define rrdpush_buffer_unlock(host) netdata_mutex_unlock(&((host)->rrdpush_sender_buffer_mutex))
73
74
+static inline int should_send_chart_matching(RRDSET *st) {
75
+ if(unlikely(!rrdset_flag_check(st, RRDSET_FLAG_ENABLED))) {
76
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_SEND);
77
+ rrdset_flag_set(st, RRDSET_FLAG_UPSTREAM_IGNORE);
78
+ }
79
+ else if(!rrdset_flag_check(st, RRDSET_FLAG_UPSTREAM_SEND|RRDSET_FLAG_UPSTREAM_IGNORE)) {
80
+ RRDHOST *host = st->rrdhost;
81
+
82
+ if(simple_pattern_matches(host->rrdpush_send_charts_matching, st->id) ||
83
+ simple_pattern_matches(host->rrdpush_send_charts_matching, st->name)) {
84
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_IGNORE);
85
+ rrdset_flag_set(st, RRDSET_FLAG_UPSTREAM_SEND);
86
+ }
87
+ else {
88
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_SEND);
89
+ rrdset_flag_set(st, RRDSET_FLAG_UPSTREAM_IGNORE);
90
+ }
91
+ }
92
+
93
+ return(rrdset_flag_check(st, RRDSET_FLAG_UPSTREAM_SEND));
94
+}
95
+
96
// checks if the current chart definition has been sent
97
static inline int need_to_send_chart_definition(RRDSET *st) {
98
rrdset_check_rdlock(st);
99
76
- if(unlikely(!(rrdset_flag_check(st, RRDSET_FLAG_EXPOSED_UPSTREAM))))
100
+ if(unlikely(!(rrdset_flag_check(st, RRDSET_FLAG_UPSTREAM_EXPOSED))))
101
return 1;
102
103
RRDDIM *rd;
@@ -93,7 +117,7 @@ static inline int need_to_send_chart_definition(RRDSET *st) {
117
static inline void rrdpush_send_chart_definition_nolock(RRDSET *st) {
118
RRDHOST *host = st->rrdhost;
119
96
- rrdset_flag_set(st, RRDSET_FLAG_EXPOSED_UPSTREAM);
120
+ rrdset_flag_set(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
121
122
// send the chart
123
buffer_sprintf(
@@ -171,9 +195,12 @@ static inline void rrdpush_send_chart_metrics_nolock(RRDSET *st) {
195
196
static void rrdpush_sender_thread_spawn(RRDHOST *host);
197
174
-void rrdset_push_chart_definition(RRDSET *st) {
198
+void rrdset_push_chart_definition_now(RRDSET *st) {
199
RRDHOST *host = st->rrdhost;
200
201
+ if(unlikely(!host->rrdpush_send_enabled || !should_send_chart_matching(st)))
202
+ return;
203
+
204
rrdset_rdlock(st);
205
rrdpush_buffer_lock(host);
206
rrdpush_send_chart_definition_nolock(st);
@@ -182,11 +209,11 @@ void rrdset_push_chart_definition(RRDSET *st) {
209
}
210
211
void rrdset_done_push(RRDSET *st) {
185
- RRDHOST *host = st->rrdhost;
186
-
187
- if(unlikely(!rrdset_flag_check(st, RRDSET_FLAG_ENABLED)))
212
+ if(unlikely(!should_send_chart_matching(st)))
213
return;
214
215
+ RRDHOST *host = st->rrdhost;
216
+
217
rrdpush_buffer_lock(host);
218
219
if(unlikely(host->rrdpush_send_enabled && !host->rrdpush_sender_spawn))
@@ -269,7 +296,7 @@ static void rrdpush_sender_thread_reset_all_charts(RRDHOST *host) {
296
297
RRDSET *st;
298
rrdset_foreach_read(st, host) {
272
- rrdset_flag_clear(st, RRDSET_FLAG_EXPOSED_UPSTREAM);
299
+ rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
300
301
st->upstream_resync_time = 0;
302
@@ -750,6 +777,7 @@ static int rrdpush_receive(int fd
777
int rrdpush_enabled = default_rrdpush_enabled;
778
char *rrdpush_destination = default_rrdpush_destination;
779
char *rrdpush_api_key = default_rrdpush_api_key;
780
+ char *rrdpush_send_charts_matching = default_rrdpush_send_charts_matching;
781
time_t alarms_delay = 60;
782
RRDPUSH_MULTIPLE_CONNECTIONS_STRATEGY rrdpush_multiple_connections_strategy = RRDPUSH_MULTIPLE_CONNECTIONS_ALLOW;
783
@@ -781,6 +809,9 @@ static int rrdpush_receive(int fd
809
rrdpush_multiple_connections_strategy = get_multiple_connections_strategy(&stream_config, key, "multiple connections", rrdpush_multiple_connections_strategy);
810
rrdpush_multiple_connections_strategy = get_multiple_connections_strategy(&stream_config, machine_guid, "multiple connections", rrdpush_multiple_connections_strategy);
811
812
+ rrdpush_send_charts_matching = appconfig_get(&stream_config, key, "default proxy send charts matching", rrdpush_send_charts_matching);
813
+ rrdpush_send_charts_matching = appconfig_get(&stream_config, machine_guid, "proxy send charts matching", rrdpush_send_charts_matching);
814
+
815
tags = appconfig_set_default(&stream_config, machine_guid, "host tags", (tags)?tags:"");
816
if(tags && !*tags) tags = NULL;
817
@@ -803,6 +834,7 @@ static int rrdpush_receive(int fd
834
, (unsigned int)(rrdpush_enabled && rrdpush_destination && *rrdpush_destination && rrdpush_api_key && *rrdpush_api_key)
835
, rrdpush_destination
836
, rrdpush_api_key
837
+ , rrdpush_send_charts_matching
838
);
839
840
if(!host) {
src/streaming/rrdpush.h
+2
-1
@@ -9,11 +9,12 @@
9
extern unsigned int default_rrdpush_enabled;
10
extern char *default_rrdpush_destination;
11
extern char *default_rrdpush_api_key;
12
+extern char *default_rrdpush_send_charts_matching;
13
extern unsigned int remote_clock_resync_iterations;
14
15
extern int rrdpush_init();
16
extern void rrdset_done_push(RRDSET *st);
16
-extern void rrdset_push_chart_definition(RRDSET *st);
17
+extern void rrdset_push_chart_definition_now(RRDSET *st);
18
extern void *rrdpush_sender_thread(void *ptr);
19
20
extern int rrdpush_receiver_thread_spawn(RRDHOST *host, struct web_client *w, char *url);