Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Tracing the logic of the url-map

Hi All,
I have global LB and use Prometheus to query by it.
When doing simple curl from the server I am getting the output but when Prometheus don't.

The logs are showing that prometheus request directed to the wrong service...
I have no idea what is the difference, the url maps are host based so it is the simplest it got.

Is there any way to trace the logic of the url map to understand what is different between the curl command and the get for the scraping Prometheus does?

Solved Solved
2 2 308
1 ACCEPTED SOLUTION

So the problem was found after sniffing with tcpdump.
Prometheus add to the "Host" http header the port name so it looks like this:
Host: "xxxxx:80"
While curl is more elegant and use the real hostname requested:
Host: "xxxxx"

To solve that I added to the url-map also "xxxxx:80" and now it mach

I would say it is more Prometheus issue but I would expect that the LB we be smarter and parse the port out of the hostmane befor comparing... 🤷‍♂️

View solution in original post

2 REPLIES 2

So the problem was found after sniffing with tcpdump.
Prometheus add to the "Host" http header the port name so it looks like this:
Host: "xxxxx:80"
While curl is more elegant and use the real hostname requested:
Host: "xxxxx"

To solve that I added to the url-map also "xxxxx:80" and now it mach

I would say it is more Prometheus issue but I would expect that the LB we be smarter and parse the port out of the hostmane befor comparing... 🤷‍♂️

BWT, tracing in GCP would help to solve it much faster....