Open matuskosut opened 5 months ago
It should work like a charm just add the header "X-Prometheus-Scrape-Timeout-Seconds"
curl -v --proxy http://test.local:8080 \
-H "X-Prometheus-Scrape-Timeout-Seconds: 5" \
http://test.local:9100/
I had always considered it a bug that the proxy requires this header (there is no default and no test cases if the header is not set), but we get used to it!
I had always considered it a bug that the proxy requires this header (there is no default and no test cases if the header is not set), but we get used to it!
In fact, after digging a little deeper into the scenario, it is not directly the pushprox_proxy which responds with the error message but the node_exporter: the node_exporter also expects the "X-Prometheus-Scrape-Timeout-Seconds" header and as it is not present and the case is obviously not foreseen, this triggers an error. The absence is foreseen in the pushprox and a value is set (--scrape.default-timeout=15s) Maybe a fix should be to force the header with the default value when it is not provided by the original query. I will try to make a PR with that solution.
@peekjef72 that quick fix would probably be quite an improvement here.
What is most confusing is that calling curl http://0.0.0.0:9100/metrics
responds with metrics without any issue, so one is not expecting that header to be required.
Hi,
is it possible to do end to end testing purely with curl? (Similar to this setup https://github.com/prometheus-community/PushProx/blob/master/end-to-end-test.sh)
For testing I run node-exporter, proxy and client on the same machine:
prometheus node exporter running on
192.168.1.10:9100
I assume that if this is supposed to work I need to use proxy parameter in some way. I tried to run it like this:
Not sure what am I doing wrong, but all I get is errors so far (
strconv.ParseFloat: parsing "": invalid syntax
).Proxy log:
Client log:
Is this something that should work? Or is Prometheus proxy request impossible to simulate with curl?