diff options
author | vkalintiris <vasilis@netdata.cloud> | 2022-05-03 19:02:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-03 19:02:36 +0300 |
commit | ebdd819d6ead44c5bab80c69be4a7d419402fe3c (patch) | |
tree | cb17c37c6febf067928d44203322d28e141a2aba /database/rrddim.c | |
parent | ea451662055227545550d8f09deecb1427b7c672 (diff) |
Remove per chart configuration. (#12728)
After https://github.com/netdata/netdata/pull/12209 per-chart configuration
was used for (a) enabling/disabling a chart, and (b) renaming dimensions.
Regarding the first use case: We already have component-specific
configuration options|flags to finely control how a chart should behave.
Eg. "send charts matching" in streaming, "charts to skip from training"
in ML, etc. If we really need the concept of a disabled chart, we can
add a host-level simple pattern to match these charts.
Regarding the second use case: It's not obvious why we'd need to provide
support for remapping dimension names through a chart-specific configuration
from the core agent. If the need arises, we could add such support at
the right place, ie. a exporter/streaming config section.
This will allow each flag to act indepentendly from each other and
avoid managing flag-state manually at various places, eg:
```
if(unlikely(!rrdset_flag_check(st, RRDSET_FLAG_ENABLED))) {
rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_SEND);
rrdset_flag_set(st, RRDSET_FLAG_UPSTREAM_IGNORE);
} ...
```
Diffstat (limited to 'database/rrddim.c')
-rw-r--r-- | database/rrddim.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/database/rrddim.c b/database/rrddim.c index ebb31996b2..bca86b7373 100644 --- a/database/rrddim.c +++ b/database/rrddim.c @@ -43,9 +43,10 @@ inline int rrddim_set_name(RRDSET *st, RRDDIM *rd, const char *name) { debug(D_RRD_CALLS, "rrddim_set_name() from %s.%s to %s.%s", st->name, rd->name, st->name, name); - char varname[CONFIG_MAX_NAME + 1]; - snprintfz(varname, CONFIG_MAX_NAME, "dim %s name", rd->id); - rd->name = config_set_default(st->config_section, varname, name); + if (rd->name) + freez((void *) rd->name); + + rd->name = strdupz(name); rd->hash_name = simple_hash(rd->name); if (!st->state->is_ar_chart) |