prometheus-community / prometheus-community/PushProx
Simple test with curl
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 811
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
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:
pushprox-proxy --web.listen-address=":8080" --log.level=debug
pushprox-client --fqdn test.local --proxy-url "http://192.168.1.10:8080/"
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:
curl --proxy http://test.local:8080 http://test.local:9100/metrics
Not sure what am I doing wrong, but all I get is errors so far (strconv.ParseFloat: parsing "": invalid syntax).
Proxy log:
ts=2024-04-17T15:06:15.895Z caller=coordinator.go:115 level=info msg=DoScrape scrape_id=cefb3ed1-3d68-4f78-9ab8-084c469c56a8 url=http://test.local:9100/metrics
ts=2024-04-17T15:06:15.895Z caller=main.go:154 level=info msg="Responded to /poll" url=http://test.local:9100/metrics scrape_id=cefb3ed1-3d68-4f78-9ab8-084c469c56a8
ts=2024-04-17T15:06:15.897Z caller=coordinator.go:136 level=info msg=WaitForScrapeInstruction fqdn=test.local
ts=2024-04-17T15:06:15.898Z caller=main.go:135 level=info msg="Got /push" scrape_id=cefb3ed1-3d68-4f78-9ab8-084c469c56a8
ts=2024-04-17T15:06:15.898Z caller=coordinator.go:168 level=info msg=ScrapeResult scrape_id=cefb3ed1-3d68-4f78-9ab8-084c469c56a8
Client log:
ts=2024-04-17T15:07:43.770Z caller=main.go:206 level=info msg="Got scrape request" scrape_id=ab8c0768-2d88-47e0-a7a6-7fc7d5a43529 url=http://test.local:9100/metrics
ts=2024-04-17T15:07:43.770Z caller=main.go:96 level=error err="strconv.ParseFloat: parsing \"\": invalid syntax"
ts=2024-04-17T15:07:43.772Z caller=main.go:108 level=info msg="Pushed failed scrape response"
Is this something that should work? Or is Prometheus proxy request impossible to simulate with curl?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use the linked end-to-end-test.sh as the starting reference and trace the proxy/client request flow represented by the logged /poll and /push entries. Reproduce the provided node-exporter, proxy, client, and curl commands, then compare the response and failure path. Done means a curl-only test has a clear, reproducible pass/fail result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, shell
- Domain
- networking, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100