diff options
author | Vladimir Kobal <vlad@prokk.net> | 2021-04-21 10:50:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-21 10:50:06 +0300 |
commit | 157fb5860a61c4472c2bc3ba11f2dd8712d9c845 (patch) | |
tree | b3ad0d016f1765dc9b00fffb055d06aebb6c0c4a /exporting/prometheus | |
parent | 9d481060489110db52dcd0f8d7e22196c70742c0 (diff) |
Backend chart filtering backward compatibility fix (#11002)
Diffstat (limited to 'exporting/prometheus')
-rw-r--r-- | exporting/prometheus/prometheus.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/exporting/prometheus/prometheus.c b/exporting/prometheus/prometheus.c index c10d94b90a..4222dce568 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.", @@ -855,7 +855,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 +892,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(); |