summaryrefslogtreecommitdiffstats
path: root/exporting/prometheus
diff options
context:
space:
mode:
authorVladimir Kobal <vlad@prokk.net>2020-12-14 16:25:13 +0200
committerGitHub <noreply@github.com>2020-12-14 16:25:13 +0200
commit81968dea3a411aed2f451a941354283b945a35de (patch)
tree58f9d1331a9bd7df27adc2e04e426220be9c0f07 /exporting/prometheus
parentc3b1528bb91250958c9947a33bb26c3a8e04bd38 (diff)
Fix hostname configuration in the exporting engine (#10361)
Diffstat (limited to 'exporting/prometheus')
-rw-r--r--exporting/prometheus/remote_write/remote_write.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/exporting/prometheus/remote_write/remote_write.c b/exporting/prometheus/remote_write/remote_write.c
index b75f3546e8..bd7ff48f20 100644
--- a/exporting/prometheus/remote_write/remote_write.c
+++ b/exporting/prometheus/remote_write/remote_write.c
@@ -147,7 +147,7 @@ int format_host_prometheus_remote_write(struct instance *instance, RRDHOST *host
char hostname[PROMETHEUS_ELEMENT_MAX + 1];
prometheus_label_copy(
hostname,
- (host == localhost) ? instance->engine->config.hostname : host->hostname,
+ (host == localhost) ? instance->config.hostname : host->hostname,
PROMETHEUS_ELEMENT_MAX);
add_host_info(
@@ -236,7 +236,7 @@ int format_dimension_prometheus_remote_write(struct instance *instance, RRDDIM *
"EXPORTING: not sending dimension '%s' of chart '%s' from host '%s', "
"its last data collection (%lu) is not within our timeframe (%lu to %lu)",
rd->id, rd->rrdset->id,
- (host == localhost) ? instance->engine->config.hostname : host->hostname,
+ (host == localhost) ? instance->config.hostname : host->hostname,
(unsigned long)rd->last_collected_time.tv_sec,
(unsigned long)instance->after,
(unsigned long)instance->before);
@@ -256,7 +256,7 @@ int format_dimension_prometheus_remote_write(struct instance *instance, RRDDIM *
add_metric(
connector_specific_data->write_request,
name, chart, family, dimension,
- (host == localhost) ? instance->engine->config.hostname : host->hostname,
+ (host == localhost) ? instance->config.hostname : host->hostname,
rd->last_collected_value, timeval_msec(&rd->last_collected_time));
} else {
// the dimensions of the chart, do not have the same algorithm, multiplier or divisor
@@ -273,7 +273,7 @@ int format_dimension_prometheus_remote_write(struct instance *instance, RRDDIM *
add_metric(
connector_specific_data->write_request,
name, chart, family, NULL,
- (host == localhost) ? instance->engine->config.hostname : host->hostname,
+ (host == localhost) ? instance->config.hostname : host->hostname,
rd->last_collected_value, timeval_msec(&rd->last_collected_time));
}
} else {
@@ -298,7 +298,7 @@ int format_dimension_prometheus_remote_write(struct instance *instance, RRDDIM *
add_metric(
connector_specific_data->write_request,
name, chart, family, dimension,
- (host == localhost) ? instance->engine->config.hostname : host->hostname,
+ (host == localhost) ? instance->config.hostname : host->hostname,
value, last_t * MSEC_PER_SEC);
}
}