do not send duplicate chart names (#4508)
Costa Tsaousis committed
Oct 27, 2018 at 23:54 UTC
fdae392242b6edf50500a7027239267b82414050
1 file changed
+14
-1
streaming/rrdpush.c
+14
-1
@@ -149,12 +149,25 @@ static inline void rrdpush_send_chart_definition_nolock(RRDSET *st) {
149
150
rrdset_flag_set(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
151
152
+ // properly set the name for the remote end to parse it
153
+ char *name = "";
154
+ if(unlikely(strcmp(st->id, st->name))) {
155
+ // they differ
156
+ name = strchr(st->name, '.');
157
+ if(name)
158
+ name++;
159
+ else
160
+ name = "";
161
+ }
162
+
163
+ // info("CHART '%s' '%s'", st->id, name);
164
+
165
// send the chart
166
buffer_sprintf(
167
host->rrdpush_sender_buffer
168
, "CHART \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" %ld %d \"%s %s %s %s\" \"%s\" \"%s\"\n"
169
, st->id
157
- , st->name
170
+ , name
171
, st->title
172
, st->units
173
, st->family