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 upscrape target not honoring https scheme #5108
Comments
This comment has been minimized.
This comment has been minimized.
|
Hmm, this is strange. Can you share a screenshot of the Service Discovery page with all targets as well as the Targets page? |
simonpasquier
added
the
component/scraping
label
Jan 18, 2019
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
While I think there is still a problem, I believe that I have resolved the immediate issue. The
So this explains why if I have a scrape config with
I don't get the malformed 301 and all of a sudden I have a working endpoint. I guess this just turns into a "please generate greater debug logging" request. |
This comment has been minimized.
This comment has been minimized.
|
Interesting finding! |
This comment has been minimized.
This comment has been minimized.
travisgroth
commented
Jan 22, 2019
|
Possible suggestion - disable redirect following or error on 301/302 unless explicitly requested via configuration; like curl. I'm not sure how easy this is to achieve in the http client, but that would make corner cases like this fairly obvious. |
This comment has been minimized.
This comment has been minimized.
|
It's easy to disable it, but it'd count as a breaking change (even though this is something to avoid). |
This comment has been minimized.
This comment has been minimized.
|
I agree to put this on the list for Prometheus 3.0. |
This comment has been minimized.
This comment has been minimized.
|
Hmm, could we handle the redirect better? There's basically the same issue over in the blackbox exporter too. |
This comment has been minimized.
This comment has been minimized.
|
What do you mean? A HTTPS target that redirects to HTTP might be valid. |
This comment has been minimized.
This comment has been minimized.
|
It'd valid, but inefficient. We should scrape the required target directly. |


ev1lm0nk3y commentedJan 17, 2019
Bug Report
What did you do?
Attempt to scrape a Kubernetes API endpoint using scheme
httpsand abearer_token.What did you expect to see?
A successful scrape over https, like
https://<api_endpoint_ip_address>:443/..., nothttp://<api_endpoint_ip_address>:443/...What did you see instead? Under which circumstances?
A scrape error for the
airflow-metricstarget, while thefederated_prometheustarget has no problems.curl commands to validate the issue
Works:
Doesn't Work:
Environment
System information:
for local testing
Darwin 17.7.0 x86_64usually I'm running prometheus in a GKE cluster running node and master versions 1.11.5
Scrape Target GKE master version:
airflow cluster: 1.9.7
federated GKE cluster: 1.11.5
Prometheus version:
v2.4.0 on the GKE cluster
v2.6.1 locally
Prometheus configuration file:
This is a sample configuration that I'm running locally that shows the 2 different scrape targets with similar configurations. The same error is seen both locally and in GKE.