summaryrefslogtreecommitdiffstats
path: root/exporting
diff options
context:
space:
mode:
authorVladimir Kobal <vlad@prokk.net>2020-12-07 16:45:19 +0200
committerGitHub <noreply@github.com>2020-12-07 16:45:19 +0200
commit6d91cedecd5ee3f58e5fe8af48ea5eac33abb967 (patch)
tree6b0d6d0a1680195f705199d26ac9de866cbbc911 /exporting
parent7a416ecdcba6c1f4dda389731404afa7cc62a3f3 (diff)
Fix exporting config (#10323)
Diffstat (limited to 'exporting')
-rw-r--r--exporting/read_config.c5
-rw-r--r--exporting/tests/test_exporting_engine.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/exporting/read_config.c b/exporting/read_config.c
index 2b6cec6a9a..51cb2fdfdb 100644
--- a/exporting/read_config.c
+++ b/exporting/read_config.c
@@ -238,7 +238,8 @@ struct engine *read_exporting_config()
prometheus_exporter_instance->config.update_every =
prometheus_config_get_number(EXPORTING_UPDATE_EVERY_OPTION_NAME, EXPORTING_UPDATE_EVERY_DEFAULT);
- if (prometheus_config_get_boolean("send names instead of ids", CONFIG_BOOLEAN_YES))
+ if (prometheus_config_get_boolean(
+ "send names instead of ids", global_backend_options & EXPORTING_OPTION_SEND_NAMES))
prometheus_exporter_instance->config.options |= EXPORTING_OPTION_SEND_NAMES;
else
prometheus_exporter_instance->config.options &= ~EXPORTING_OPTION_SEND_NAMES;
@@ -257,6 +258,8 @@ struct engine *read_exporting_config()
simple_pattern_create(prometheus_config_get("send charts matching", "*"), NULL, SIMPLE_PATTERN_EXACT);
prometheus_exporter_instance->config.hosts_pattern = simple_pattern_create(
prometheus_config_get("send hosts matching", "localhost *"), NULL, SIMPLE_PATTERN_EXACT);
+
+ prometheus_exporter_instance->config.prefix = prometheus_config_get("prefix", global_backend_prefix);
}
// TODO: change BACKEND to EXPORTING
diff --git a/exporting/tests/test_exporting_engine.c b/exporting/tests/test_exporting_engine.c
index d90b4e352f..f76784f4c4 100644
--- a/exporting/tests/test_exporting_engine.c
+++ b/exporting/tests/test_exporting_engine.c
@@ -14,6 +14,9 @@ char *netdata_configured_hostname = "test_host";
char log_line[MAX_LOG_LINE + 1];
+BACKEND_OPTIONS global_backend_options = 0;
+const char *global_backend_prefix = "netdata";
+
void init_connectors_in_tests(struct engine *engine)
{
expect_function_call(__wrap_now_realtime_sec);