Skip to content
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

Add flag/config option to set root directory for UI #519

Closed
yorik opened this issue Feb 9, 2015 · 8 comments
Closed

Add flag/config option to set root directory for UI #519

yorik opened this issue Feb 9, 2015 · 8 comments

Comments

@yorik
Copy link

yorik commented Feb 9, 2015

Right now it's impossible to hide prometheus under nginx in some directory because all the links and JS are referenced to /... It would be very good if it would be possible to add some common directory via config or flag so it would be accessible via http://<host>/<dir>/

@beorn7
Copy link
Member

beorn7 commented Feb 11, 2015

@juliusv You are more familiar with the web part. Is that doable?

@juliusv
Copy link
Member

juliusv commented Feb 11, 2015

@yorik Would your suggestion simply require making paths relative in the frontend (in links, AJAX calls, etc.), or would you actually require the Prometheus server to respond on /mycustomroot/api/query_range, etc.?

@yorik
Copy link
Author

yorik commented Feb 11, 2015

Any way would work for me, but probably adding /mycustomroot will be easier
to implement.
Thank you!

On 11 February 2015 at 13:07, juliusv notifications@github.com wrote:

@yorik https://github.com/yorik Would your suggestion simply require
making paths relative in the frontend (in links, AJAX calls, etc.), or
would you actually require the Prometheus server to respond on
/mycustomroot/api/query_range, etc.?


Reply to this email directly or view it on GitHub
#519 (comment)
.

With best regards,
Yury Akudovich

juliusv added a commit that referenced this issue Feb 14, 2015
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
@juliusv
Copy link
Member

juliusv commented Feb 14, 2015

@yorik See #528 - this works for me behind an nginx with a custom root. The one caveat for you would be that the Prometheus itself would have no idea that it's behind a proxy, so when it sends alerts to alertmanager (if you're using that at all), it would send its normal local URL to alertmanager for any rule introspection backlinks. That means that in Alertmanager, the "Generated By" column would not contain the URL through your proxy, but the one that Prometheus thinks it has. This could be made configurable in the future too, I guess...

@yorik
Copy link
Author

yorik commented Feb 16, 2015

@juliusv, thank you so much! It works for me now. I haven't try
alertmanager yet but it's not the problem for now.

On 14 February 2015 at 18:00, juliusv notifications@github.com wrote:

@yorik https://github.com/yorik See #528
#528 - this works for me
behind an nginx with a custom root. The one caveat for you would be that
the Prometheus itself would have no idea that it's behind a proxy, so when
it sends alerts to alertmanager (if you're using that at all), it would
send its normal local URL to alertmanager for any rule introspection
backlinks. That means that in Alertmanager, the "Generated By" column would
not contain the URL through your proxy, but the one that Prometheus thinks
it has. This could be made configurable in the future too, I guess...


Reply to this email directly or view it on GitHub
#519 (comment)
.

With best regards,
Yury Akudovich

@juliusv
Copy link
Member

juliusv commented Feb 16, 2015

@yorik Cool! As you might have read in #528, this can't be immediately merged due to the console paths problem, so I'll let it sit here for a while (you could rebase it ontop of newer masters at times, if desired) until someone decides to fix the remaining problems.

juliusv added a commit that referenced this issue Mar 11, 2015
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
@brian-brazil
Copy link
Contributor

This is resolved with #614 and -web.path-prefix

simonpasquier pushed a commit to simonpasquier/prometheus that referenced this issue Oct 12, 2017
…ons-formatting

Revert "Added docs for toLower and toUpper formatting"
@lock
Copy link

lock bot commented Mar 24, 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.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants