summaryrefslogtreecommitdiffstats
path: root/streaming
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@tsaousis.gr>2018-10-27 23:54:25 +0300
committerGitHub <noreply@github.com>2018-10-27 23:54:25 +0300
commitfdae392242b6edf50500a7027239267b82414050 (patch)
tree1ce19f8c2413d706d9b77fd82e06a16072caa94f /streaming
parent4014937a77230ab99c5c8148c13b404c02330387 (diff)
do not send duplicate chart names (#4508)
Diffstat (limited to 'streaming')
-rw-r--r--streaming/rrdpush.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/streaming/rrdpush.c b/streaming/rrdpush.c
index 1b48ad9a1f..df1a2177f8 100644
--- a/streaming/rrdpush.c
+++ b/streaming/rrdpush.c
@@ -149,12 +149,25 @@ static inline void rrdpush_send_chart_definition_nolock(RRDSET *st) {
rrdset_flag_set(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
+ // properly set the name for the remote end to parse it
+ char *name = "";
+ if(unlikely(strcmp(st->id, st->name))) {
+ // they differ
+ name = strchr(st->name, '.');
+ if(name)
+ name++;
+ else
+ name = "";
+ }
+
+ // info("CHART '%s' '%s'", st->id, name);
+
// send the chart
buffer_sprintf(
host->rrdpush_sender_buffer
, "CHART \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" %ld %d \"%s %s %s %s\" \"%s\" \"%s\"\n"
, st->id
- , st->name
+ , name
, st->title
, st->units
, st->family