Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upScraping in HTTPS return 404 #2126
Comments
This comment has been minimized.
This comment has been minimized.
|
That sounds like an issue with your client application. Can you investigate what the difference between your manual requests and the one Prometheus does is? In general, HTTPS scraping works. |
This comment has been minimized.
This comment has been minimized.
murphysean
commented
Nov 23, 2016
|
Ran into the same problem, my app was a go app. The route was registered as While I wasn't able to monitor the actual call from prometheus, I'm guessing the Host header is missing or not being correctly set. |
This comment has been minimized.
This comment has been minimized.
|
Hi, Thanks for your help. I can't do a analysis because it's HTTPS and tcpdump will not be helpful and I don't have access to the destination server. It's on some cloud paas service. I can ask to the dev if he can change something on the app side but we're using the node.js lib in some other app and it's working. The paas seems to be the problem here. Maybe I can open a ticket with them. Thanks. |
This comment has been minimized.
This comment has been minimized.
murphysean
commented
Nov 23, 2016
•
|
Something else I just found: I think that when I registered the route |
This comment has been minimized.
This comment has been minimized.
|
This appears to be a custom client issue rather than one in Prometheus. |
brian-brazil
closed this
Feb 13, 2017
This comment has been minimized.
This comment has been minimized.
samber
commented
Sep 20, 2017
|
Hi guys, We discovered that this issue is due to our hosting provider. When contacting the exporter, Prometheus put the port into the We will contact them in order to fix this issue. But even if the RFC let you add the port into the |
This comment has been minimized.
This comment has been minimized.
rossigee
commented
Jun 5, 2018
|
I'm now having this issue too. I can confirm using curl that my hosting provider isn't liking the port number being appended to the Host header. Unfortunately, it's unlikely that they will 'fix' this at their end, so I really need to fix Prometheus somehow not to send the port in the first place. |
This comment has been minimized.
This comment has been minimized.
|
@rossigee the |
This comment has been minimized.
This comment has been minimized.
|
Have you looked at scraping the target directly? It's generally best to have as little infrastructure between Prometheus and your target. |
This comment has been minimized.
This comment has been minimized.
rossigee
commented
Jun 5, 2018
|
@simonpasquier - yep, i understand you'd need to add extra code to override net.http behaviour to work around broken proxies which is not ideal - i tried removing the port specifiers from the targets as specified in the prometheus.yml, but net.http seems to add them back again at request time. @brian-brazil - the target is hosted by a third party and is behind their broken proxy - i can't put my monitoring VM any closer to it, or expose it in any other way unfortunately :( |
This comment has been minimized.
This comment has been minimized.
|
If we make our code more complicated to deal with this, it's not unlikely that there is other code out there broken in the opposite way. Have you considered using a forward proxy to tweak the request? |
This comment has been minimized.
This comment has been minimized.
rossigee
commented
Jun 5, 2018
|
@brian-brazil - Forward proxy considered, but it's an https endpoint, so it seems i'd have to do a bunch of request rewriting for the proxy to know where to forward the request to. And, as you say 'It's generally best to have as little infrastructure between Prometheus and your target.' I guess it's more an issue with 'net.http' than it is with Prometheus specifically. Why does it insist on sending the port number when it seems other HTTP clients generally do not. |
This comment has been minimized.
This comment has been minimized.
|
That sounds like something to bring up with Go. |
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
commarla commentedOct 27, 2016
•
edited
What did you do?
My team developed a service using the node.js library to export a /metrics.
I added it in my configuration.
What did you expect to see?
A correct scrape of this endpoint.
The /metrics page is displayed well (with a 200 return code) when I click on it from the targets page in prometheus.
What did you see instead? Under which circumstances?
A 404 Error
server returned HTTP status 404 Not Foundin the targets page.Environment
Linux 3.16.0-4-amd64 x86_64I see nothing revelant in the logfiles.