always initialize the name of synthetic charts
Costa Tsaousis (ktsaou) committed
Jun 23, 2017 at 01:27 UTC
e6c1c79f03dd88c245c8a88156fb8c1066ee8014
1 file changed
+3
-2
src/statsd.c
+3
-2
@@ -978,6 +978,7 @@ int statsd_readfile(const char *path, const char *filename) {
978
chart = callocz(sizeof(STATSD_APP_CHART), 1);
979
netdata_fix_chart_id(s);
980
chart->id = strdupz(s);
981
+ chart->name = strdupz(s);
982
chart->title = strdupz("Statsd chart");
983
chart->context = strdupz(s);
984
chart->family = strdupz("overview");
@@ -1140,7 +1141,7 @@ int statsd_readfile(const char *path, const char *filename) {
1141
chart->dimensions_count++;
1142
1143
debug(D_STATSD, "Added dimension '%s' to chart '%s' of app '%s', for metric '%s', with type %u, multiplier " COLLECTED_NUMBER_FORMAT ", divisor " COLLECTED_NUMBER_FORMAT,
1143
- dim->name, chart->name, app->name, dim->metric, dim->value_type, dim->multiplier, dim->divisor);
1144
+ dim->name, chart->id, app->name, dim->metric, dim->value_type, dim->multiplier, dim->divisor);
1145
}
1146
else {
1147
error("STATSD: ignoring line %zu ('%s') of file '%s/%s'. Unknown keyword for the [%s] section.", line, name, path, filename, chart->id);
@@ -1610,7 +1611,7 @@ static inline void check_if_metric_is_for_app(STATSD_INDEX *index, STATSD_METRIC
1611
}
1612
else {
1613
if (dim->value_type != STATSD_APP_CHART_DIM_VALUE_TYPE_LAST)
1613
- error("STATSD: unsupported value type for dimension '%s' of chart '%s' of app '%s' on metric '%s'", dim->name, chart->name, app->name, m->name);
1614
+ error("STATSD: unsupported value type for dimension '%s' of chart '%s' of app '%s' on metric '%s'", dim->name, chart->id, app->name, m->name);
1615
1616
dim->value_ptr = &m->last;
1617
dim->algorithm = statsd_algorithm_for_metric(m);