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 upPrometheus not scraping all subdomains correctly? #4646
Comments
This comment has been minimized.
This comment has been minimized.
|
Prometheus doesn't do anything fancy with respect to DNS lookups. You can have a look at the targets page in the UI to get more information. Also running the server with |
simonpasquier
added
kind/more-info-needed
component/scraping
labels
Sep 21, 2018
This comment has been minimized.
This comment has been minimized.
|
@simonpasquier: Log file This is all I see with --log.level=debug Gui shows the target as UP. Last scrape: 6.498s ago. |
This comment has been minimized.
This comment has been minimized.
|
What does |
This comment has been minimized.
This comment has been minimized.
|
` scrape_samples_post_metric_relabeling{instance="in.game-program.com:443",job="job2"} 0 scrape_samples_scraped{instance="api.example2.com:443",job="job2"} 0 up{instance="api.example2.com:443",job="job2"} 1 ` |
This comment has been minimized.
This comment has been minimized.
|
hmm, why is it that the instance label has changed for |
This comment has been minimized.
This comment has been minimized.
|
Yes this is it: `
|
This comment has been minimized.
This comment has been minimized.
|
Really Prometheus doesn't have special requirements on DNS names. If |
This comment has been minimized.
This comment has been minimized.
|
But if i point my browser to the same url, or curl the url, I can download the scrape contents fine. I put them in Job3 and they work. Can I somehow enable more logging by editing the source code and trying that? |
This comment has been minimized.
This comment has been minimized.
|
Yes additional logs is your best bet. You can look here: Line 782 in b75ec7e |
augmenter
referenced this issue
Sep 26, 2018
Closed
Prom using up all available socket connections after a few days #4659
This comment has been minimized.
This comment has been minimized.
|
I don't know how to build Prometheus on Go. However I tried the proomtool to check the metrics. And it gives the following output: However the same test fails on a working endpoint that is being scrapped fine, so maybe its a proom tool bug... ` |
This comment has been minimized.
This comment has been minimized.
|
The |
This comment has been minimized.
This comment has been minimized.
|
Ok, until I removed the trailing \r I was recieving errors like "error while linting: text format parsing error in line 1731: invalid metric name", and "api_response_average counter metrics should have "_total" suffix". When I fixed those, the promtool stop returning errors. However the scraping still does not work. When I curl the metric output to a txt file, the contents are visible.
Odd thing about all this is, that the working domain had the same wrong line ending and some wrong types, and it could still be scraped. |
This comment has been minimized.
This comment has been minimized.
|
Very weird... Would you be able to run the same configuration on a Linux box so that we can ensure whether it is a platform issue or a more general one? |
This comment has been minimized.
This comment has been minimized.
|
Tried running it in Docker for Mac, same result. Retried on windows again with 2.4.2 after fixing scraping errors from promtool, still no scraping is being done. Ran promtool on both 2.3.2 and 2.4.2 gave no errors. |
augmenter commentedSep 21, 2018
Prometheus 2.3.2 (tried 2.4.2 which did not scrape any of the below).
I have 3 identical jobs, all connecting to a working product but a different instance.
See configuration below to see Job settings.
Job1 and Job2 both return the same headers on request, and both are HTTPS with a valid certificate. This cant be a format issue in the metric, as job3 is verbatim txt copy of job2, and it works?
Prometheus seems to not scrape subdomains unless they are www. ?
This my only reasoning that I was able to do.
When changing Job1 from www. to bo. subdomain, it stops scraping as well.
Proposal
This should just work.
System information:
Windows 10
Prometheus version:
prometheus, version 2.3.2 (branch: HEAD, revision: 71af5e2)
build user: root@5258e0bd9cc1
build date: 20180712-14:13:08
go version: go1.10.3
Prometheus configuration file: