summaryrefslogtreecommitdiffstats
path: root/exporting
diff options
context:
space:
mode:
authorVladimir Kobal <vlad@prokk.net>2021-01-27 15:46:58 +0200
committerGitHub <noreply@github.com>2021-01-27 15:46:58 +0200
commit85bb0bc70bac35665f353811d4a33a8c650dbc22 (patch)
treeb9ee2b1b479b40a70b4cbf66d95fe2cfe81bb048 /exporting
parent16fc7f632bed8030166aba1748d559c5d0859d2a (diff)
Fix prometheus remote write header (#10560)
Diffstat (limited to 'exporting')
-rw-r--r--exporting/prometheus/remote_write/remote_write.c4
-rw-r--r--exporting/tests/test_exporting_engine.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/exporting/prometheus/remote_write/remote_write.c b/exporting/prometheus/remote_write/remote_write.c
index 8f757fc223..30bd05ad74 100644
--- a/exporting/prometheus/remote_write/remote_write.c
+++ b/exporting/prometheus/remote_write/remote_write.c
@@ -25,9 +25,11 @@ void prometheus_remote_write_prepare_header(struct instance *instance)
"POST %s HTTP/1.1\r\n"
"Host: %s\r\n"
"Accept: */*\r\n"
+ "Content-Encoding: snappy\r\n"
+ "Content-Type: application/x-protobuf\r\n"
"X-Prometheus-Remote-Write-Version: 0.1.0\r\n"
"Content-Length: %zu\r\n"
- "Content-Type: application/x-www-form-urlencoded\r\n\r\n",
+ "\r\n",
connector_specific_config->remote_write_path,
instance->config.destination,
buffer_strlen(simple_connector_data->last_buffer->buffer));
diff --git a/exporting/tests/test_exporting_engine.c b/exporting/tests/test_exporting_engine.c
index e91ed2d294..774d1a2659 100644
--- a/exporting/tests/test_exporting_engine.c
+++ b/exporting/tests/test_exporting_engine.c
@@ -1179,9 +1179,11 @@ static void test_prometheus_remote_write_prepare_header(void **state)
"POST /receive HTTP/1.1\r\n"
"Host: localhost\r\n"
"Accept: */*\r\n"
+ "Content-Encoding: snappy\r\n"
+ "Content-Type: application/x-protobuf\r\n"
"X-Prometheus-Remote-Write-Version: 0.1.0\r\n"
"Content-Length: 11\r\n"
- "Content-Type: application/x-www-form-urlencoded\r\n\r\n");
+ "\r\n");
free(connector_specific_config->remote_write_path);