summaryrefslogtreecommitdiffstats
path: root/exporting/prometheus/prometheus.c
diff options
context:
space:
mode:
Diffstat (limited to 'exporting/prometheus/prometheus.c')
-rw-r--r--exporting/prometheus/prometheus.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/exporting/prometheus/prometheus.c b/exporting/prometheus/prometheus.c
index c10d94b90..6759313c3 100644
--- a/exporting/prometheus/prometheus.c
+++ b/exporting/prometheus/prometheus.c
@@ -18,16 +18,16 @@ inline int can_send_rrdset(struct instance *instance, RRDSET *st)
{
RRDHOST *host = st->rrdhost;
- if (unlikely(rrdset_flag_check(st, RRDSET_FLAG_BACKEND_IGNORE)))
+ if (unlikely(rrdset_flag_check(st, RRDSET_FLAG_EXPORTING_IGNORE)))
return 0;
- if (unlikely(!rrdset_flag_check(st, RRDSET_FLAG_BACKEND_SEND))) {
+ if (unlikely(!rrdset_flag_check(st, RRDSET_FLAG_EXPORTING_SEND))) {
// we have not checked this chart
if (simple_pattern_matches(instance->config.charts_pattern, st->id) ||
simple_pattern_matches(instance->config.charts_pattern, st->name))
- rrdset_flag_set(st, RRDSET_FLAG_BACKEND_SEND);
+ rrdset_flag_set(st, RRDSET_FLAG_EXPORTING_SEND);
else {
- rrdset_flag_set(st, RRDSET_FLAG_BACKEND_IGNORE);
+ rrdset_flag_set(st, RRDSET_FLAG_EXPORTING_IGNORE);
debug(
D_BACKEND,
"EXPORTING: not sending chart '%s' of host '%s', because it is disabled for exporting.",
@@ -794,6 +794,9 @@ static inline time_t prometheus_preparation(
time_t now,
PROMETHEUS_OUTPUT_OPTIONS output_options)
{
+#ifndef UNIT_TESTING
+ analytics_log_prometheus();
+#endif
if (!server || !*server)
server = "default";
@@ -855,7 +858,7 @@ void rrd_stats_api_v1_charts_allmetrics_prometheus_single_host(
EXPORTING_OPTIONS exporting_options,
PROMETHEUS_OUTPUT_OPTIONS output_options)
{
- if (unlikely(!prometheus_exporter_instance))
+ if (unlikely(!prometheus_exporter_instance || !prometheus_exporter_instance->config.initialized))
return;
prometheus_exporter_instance->before = now_realtime_sec();
@@ -892,7 +895,7 @@ void rrd_stats_api_v1_charts_allmetrics_prometheus_all_hosts(
EXPORTING_OPTIONS exporting_options,
PROMETHEUS_OUTPUT_OPTIONS output_options)
{
- if (unlikely(!prometheus_exporter_instance))
+ if (unlikely(!prometheus_exporter_instance || !prometheus_exporter_instance->config.initialized))
return;
prometheus_exporter_instance->before = now_realtime_sec();