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 upCORS consistent behavior #2834
Comments
This comment has been minimized.
This comment has been minimized.
|
@freignat91 Can you explain your use case for wanting CORS headers on the |
brian-brazil
added
component/ui
priority/Pmaybe
labels
Jul 14, 2017
This comment has been minimized.
This comment has been minimized.
|
The use case is: |
This comment has been minimized.
This comment has been minimized.
|
@freignat91 Hmm, I'm having trouble understanding some of that, sorry.
So yeah, that part should be fine, since the normal Prometheus API already sets CORS headers.
What do you mean with "sources" and "parameters"? Do you mean "metrics" and "labels"? I'm still trying to figure out for which purpose you are querying /metrics directly from JS instead of doing everything via normal API queries? |
This comment has been minimized.
This comment has been minimized.
|
I mean by 'sources' the prometheus clients, the products which compute metrics as NATS, ETCD, Haproxy, in our case, using or not exporter and I mean by 'parameters' the name of the metrics at prometheus disposal, their type (instant, range,...) and their parameters. All information i got using .../metrics url
I use it to know which metrics are requestable in prometheus and i can't execute such request from the UI because of CORS |
This comment has been minimized.
This comment has been minimized.
|
I see. You can just use the API under For example, to get all metric names in a Prometheus server: http://demo.robustperception.io:9090/api/v1/label/__name__/values Or to get all series that match a certain matcher in a Prometheus server (in this case, http://demo.robustperception.io:9090/api/v1/series?match[]={job=%22node%22} You can even constrain that by time range if you want (see https://prometheus.io/docs/querying/api/#finding-series-by-label-matchers). In conclusion, I don't think we want to add CORS headers to the |
juliusv
closed this
Jul 17, 2017
This comment has been minimized.
This comment has been minimized.
|
ok, thanks very much |
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 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. |
freignat91 commentedJun 11, 2017
•
edited
I use nginx to reverse proxy prometheus requests.
Using the url http://localhost:9090/api/v1/...no-matter
I got CORS headers in answer and don't have to handle them in nginx
Using the url http://localhost:9090/metrics
I don't get CORS headers in answer and have to handle them in nginx
It's not critical. It's oblige me to handle prometheus reverse proxy with two different nginx locations, it's a not consistent behavior from prometheus, i find very interesting and well done by the way :)