diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2022-05-17 17:31:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-17 17:31:19 +0300 |
commit | 0fa55c7dcee497d6cfb725604d03ffc300a97ebd (patch) | |
tree | c904020933789c4692a5c4026e01b015a3e7e8d2 /libnetdata | |
parent | bde07cba29cefda2f701505ae9764aa7f203aea4 (diff) |
feat: move dirs, logs, and env vars config options to separate sections (#12935)
Diffstat (limited to 'libnetdata')
-rw-r--r-- | libnetdata/config/appconfig.c | 32 | ||||
-rw-r--r-- | libnetdata/config/appconfig.h | 33 |
2 files changed, 35 insertions, 30 deletions
diff --git a/libnetdata/config/appconfig.c b/libnetdata/config/appconfig.c index 9d1e153d0a..0272877bf2 100644 --- a/libnetdata/config/appconfig.c +++ b/libnetdata/config/appconfig.c @@ -819,24 +819,26 @@ void appconfig_generate(struct config *root, BUFFER *wb, int only_changed) "#\n" "\n# global netdata configuration\n"); - for(i = 0; i <= 13 ;i++) { + for(i = 0; i <= 15 ;i++) { appconfig_wrlock(root); for(co = root->first_section; co ; co = co->next) { if(!strcmp(co->name, CONFIG_SECTION_GLOBAL)) pri = 0; - else if(!strcmp(co->name, CONFIG_SECTION_HOST_LABEL)) pri = 1; - else if(!strcmp(co->name, CONFIG_SECTION_SQLITE)) pri = 2; - else if(!strcmp(co->name, CONFIG_SECTION_CLOUD)) pri = 3; - else if(!strcmp(co->name, CONFIG_SECTION_ML)) pri = 4; - else if(!strcmp(co->name, CONFIG_SECTION_HEALTH)) pri = 5; - else if(!strcmp(co->name, CONFIG_SECTION_STREAM)) pri = 6; - else if(!strcmp(co->name, CONFIG_SECTION_WEB)) pri = 7; - // by default, new sections will get pri = 8 (set at the end, below) - else if(!strcmp(co->name, CONFIG_SECTION_REGISTRY)) pri = 9; - else if(!strcmp(co->name, CONFIG_SECTION_GLOBAL_STATISTICS)) pri = 10; - else if(!strcmp(co->name, CONFIG_SECTION_STATSD)) pri = 11; - else if(!strcmp(co->name, CONFIG_SECTION_PLUGINS)) pri = 12; - else if(!strncmp(co->name, "plugin:", 7)) pri = 13; // << change the loop too if you change this - else pri = 8; // this is used for any new (currently unknown) sections + else if(!strcmp(co->name, CONFIG_SECTION_DIRECTORIES)) pri = 1; + else if(!strcmp(co->name, CONFIG_SECTION_LOGS)) pri = 2; + else if(!strcmp(co->name, CONFIG_SECTION_ENV_VARS)) pri = 3; + else if(!strcmp(co->name, CONFIG_SECTION_HOST_LABEL)) pri = 4; + else if(!strcmp(co->name, CONFIG_SECTION_SQLITE)) pri = 5; + else if(!strcmp(co->name, CONFIG_SECTION_CLOUD)) pri = 6; + else if(!strcmp(co->name, CONFIG_SECTION_ML)) pri = 7; + else if(!strcmp(co->name, CONFIG_SECTION_HEALTH)) pri = 8; + else if(!strcmp(co->name, CONFIG_SECTION_WEB)) pri = 9; + // by default, new sections will get pri = 10 (set at the end, below) + else if(!strcmp(co->name, CONFIG_SECTION_REGISTRY)) pri = 11; + else if(!strcmp(co->name, CONFIG_SECTION_GLOBAL_STATISTICS)) pri = 12; + else if(!strcmp(co->name, CONFIG_SECTION_PLUGINS)) pri = 13; + else if(!strcmp(co->name, CONFIG_SECTION_STATSD)) pri = 14; + else if(!strncmp(co->name, "plugin:", 7)) pri = 15; // << change the loop too if you change this + else pri = 10; // this is used for any new (currently unknown) sections if(i == pri) { int loaded = 0; diff --git a/libnetdata/config/appconfig.h b/libnetdata/config/appconfig.h index efd787cf8a..f1f61e31d3 100644 --- a/libnetdata/config/appconfig.h +++ b/libnetdata/config/appconfig.h @@ -82,21 +82,24 @@ #define CONFIG_FILENAME "netdata.conf" -#define CONFIG_SECTION_GLOBAL "global" -#define CONFIG_SECTION_SQLITE "sqlite" -#define CONFIG_SECTION_WEB "web" -#define CONFIG_SECTION_STATSD "statsd" -#define CONFIG_SECTION_PLUGINS "plugins" -#define CONFIG_SECTION_CLOUD "cloud" -#define CONFIG_SECTION_REGISTRY "registry" -#define CONFIG_SECTION_HEALTH "health" -#define CONFIG_SECTION_STREAM "stream" -#define CONFIG_SECTION_ML "ml" -#define CONFIG_SECTION_EXPORTING "exporting:global" -#define CONFIG_SECTION_PROMETHEUS "prometheus:exporter" -#define CONFIG_SECTION_HOST_LABEL "host labels" -#define EXPORTING_CONF "exporting.conf" -#define CONFIG_SECTION_GLOBAL_STATISTICS "global statistics" +#define CONFIG_SECTION_GLOBAL "global" +#define CONFIG_SECTION_DIRECTORIES "directories" +#define CONFIG_SECTION_LOGS "logs" +#define CONFIG_SECTION_ENV_VARS "environment variables" +#define CONFIG_SECTION_SQLITE "sqlite" +#define CONFIG_SECTION_WEB "web" +#define CONFIG_SECTION_STATSD "statsd" +#define CONFIG_SECTION_PLUGINS "plugins" +#define CONFIG_SECTION_CLOUD "cloud" +#define CONFIG_SECTION_REGISTRY "registry" +#define CONFIG_SECTION_HEALTH "health" +#define CONFIG_SECTION_STREAM "stream" +#define CONFIG_SECTION_ML "ml" +#define CONFIG_SECTION_EXPORTING "exporting:global" +#define CONFIG_SECTION_PROMETHEUS "prometheus:exporter" +#define CONFIG_SECTION_HOST_LABEL "host labels" +#define EXPORTING_CONF "exporting.conf" +#define CONFIG_SECTION_GLOBAL_STATISTICS "global statistics" // these are used to limit the configuration names and values lengths // they are not enforced by config.c functions (they will strdup() all strings, no matter of their length) |