New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make all URLs relative to support proxies. #528
Conversation
@brian-brazil I tested both the node-exporter and haproxy templates, but I couldn't test every other example template out there. Would be good if you could double-check that everything looks sane and works for you. |
@@ -153,12 +153,12 @@ func TableLinkForExpression(expr string) string { | |||
// See also: | |||
// http://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20. | |||
urlData := url.QueryEscape(fmt.Sprintf(`[{"expr":%q,"tab":1}]`, expr)) | |||
return fmt.Sprintf("/graph#%s", strings.Replace(urlData, "+", "%20", -1)) | |||
return fmt.Sprintf("graph#%s", strings.Replace(urlData, "+", "%20", -1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will work, console templates could be any number of directories deep.
I don't think this is workable in the general case, and it will break future use cases I have planned that involve separate directories (it's a good way to separate out what's allowed external access for things like metamonitoring). May I suggest separate DNS names? |
It was requested by @yorik in #519, so I'm not sure how much flexibility there is in just using a different DNS name with root path (sounds reasonable to me personally). Ok, so this has to wait then unless I or someone else adds automatic detection for the correct relative paths. Shouldn't be hard, just adds a bit of extra code complexity, especially with injecting it into the static JS assets which call |
This makes all URLs relative instead of absolute to enable people to run Prometheus behind a Proxy with a different path (like http://myproxy/prometheus/). The caveat is that this now codifies assumptions for the relative path depths for all pages. For example, consoles templates are now always assumed to be one path level from the root (because the common header and console library adds '../' to all their URLs). Currently we don't have example consoles in subdirectories of "consoles", but this would disallow that for the future (or we could add later support for detecting somehow what the right depth is based on the console file we're loading). This fixes #519
That's superseeded by #614 now, right? |
Yep. Closing. |
instrumenting: add Rust client library link.
…rrect number of records. (prometheus#528) Test to corrupt segments mid-WAL, repair and check we can read the correct number of records. Make segmentBufReader pad short segments with zeros, and only advance curr segment index after fully reading segment.
…ues-from-series Check storage.ErrNotFound in labelValuesFromSeries
This makes all URLs relative instead of absolute to enable people to run
Prometheus behind a Proxy with a different path (like
http://myproxy/prometheus/).
The caveat is that this now codifies assumptions for the relative path
depths for all pages. For example, consoles templates are now always
assumed to be one path level from the root (because the common header
and console library adds '../' to all their URLs). Currently we don't
have example consoles in subdirectories of "consoles", but this would
disallow that for the future (or we could add later support for
detecting somehow what the right depth is based on the console file
we're loading).
This fixes #519