Fix HTTP header for the remote write exporting connector (#9775)
Vladimir Kobal committed
Aug 18, 2020 at 16:16 UTC
7d8dac14809f1eee5b16bd971953aa1a7501ff54
3 files changed
+3
-3
backends/backends.c
+1
-1
@@ -1073,7 +1073,7 @@ void *backends_main(void *ptr) {
1073
"Content-Length: %zu\r\n"
1074
"Content-Type: application/x-www-form-urlencoded\r\n\r\n",
1075
remote_write_path,
1076
- hostname,
1076
+ destination,
1077
data_size
1078
);
1079
exporting/prometheus/remote_write/remote_write.c
+1
-1
@@ -39,7 +39,7 @@ int prometheus_remote_write_send_header(int *sock, struct instance *instance)
39
"Content-Length: %zu\r\n"
40
"Content-Type: application/x-www-form-urlencoded\r\n\r\n",
41
connector_specific_config->remote_write_path,
42
- instance->engine->config.hostname,
42
+ instance->config.destination,
43
buffer_strlen((BUFFER *)instance->buffer));
44
45
size_t header_len = buffer_strlen(header);
exporting/tests/test_exporting_engine.c
+1
-1
@@ -1192,7 +1192,7 @@ static void test_prometheus_remote_write_send_header(void **state)
1192
expect_string(
1193
__wrap_send, buf,
1194
"POST /receive HTTP/1.1\r\n"
1195
- "Host: test-host\r\n"
1195
+ "Host: localhost\r\n"
1196
"Accept: */*\r\n"
1197
"X-Prometheus-Remote-Write-Version: 0.1.0\r\n"
1198
"Content-Length: 11\r\n"