I was helping a customer debug the following error for the prometheus source:
Jul 30 19:51:27.634 ERROR source{name=mystique type=prometheus}: vector::internal_events::prometheus: parsing error error=Malformed
He sent the following response from the configured endpoint that Vector was scraping:
curl -v -XGET http://localhost:9913/metrics
Note: Unnecessary use of -X or --request, GET is already inferred.
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9913 (#0)
> GET /metrics HTTP/1.1
> Host: localhost:9913
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/plain; version=0.0.4; charset=utf-8
< Date: Thu, 30 Jul 2020 20:00:30 GMT
< Transfer-Encoding: chunked
<
# HELP nginx_server_bytes request/response bytes
# TYPE nginx_server_bytes counter
nginx_server_bytes{direction="in",host="*"} 263719
nginx_server_bytes{direction="in",host="_"} 255061
nginx_server_bytes{direction="in",host="nginx-vts-status"} 8658
nginx_server_bytes{direction="out",host="*"} 944199
nginx_server_bytes{direction="out",host="_"} 360775
nginx_server_bytes{direction="out",host="nginx-vts-status"} 583424
# HELP nginx_server_cache cache counter
# TYPE nginx_server_cache counter
nginx_server_cache{host="*",status="bypass"} 0
nginx_server_cache{host="*",status="expired"} 0
nginx_server_cache{host="*",status="hit"} 0
nginx_server_cache{host="*",status="miss"} 0
nginx_server_cache{host="*",status="revalidated"} 0
nginx_server_cache{host="*",status="scarce"} 0
Vector should be able to parse this data. I'd like to add a test specifically for this data set.
I'm not sure how Transfer-Encoding: chunked would affect the source, will investigate this.
We handle Transfer-Encoding: chunked correctly, I'll try adding a test for that in #3289 .