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

Promtail does not fully use http_path_prefix #1709

Closed
amiga23 opened this issue Feb 17, 2020 · 8 comments
Closed

Promtail does not fully use http_path_prefix #1709

amiga23 opened this issue Feb 17, 2020 · 8 comments
Labels
stale A stale issue or PR that will automatically be closed.

Comments

@amiga23
Copy link

amiga23 commented Feb 17, 2020

Describe the bug
when setting http_path_prefix e.g. "/promtail/"

$ curl http://promtail:3101/promtail/
<a href="/targets">See Other</a>.

To Reproduce
Steps to reproduce the behavior:

  1. Start promtail docker image with http_path_prefix configured as "/promtail/"
  2. curl promtail endpoint with /promtail/

Expected behavior
Promtail should answer with redirect to:
/promtail/targets
but it does redirect to /targets
so http_path_prefix seems to be implemented only half-way

Environment:

  • Infrastructure: kubernetes (k3s with containerd instead of docker)
  • Deployment tool: kustomize

Screenshots, Promtail config, or terminal output
n/a

@cyriltovena
Copy link
Contributor

/cc @sandeepsukhani Can you take a look please ?

@stale
Copy link

stale bot commented Apr 8, 2020

This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale A stale issue or PR that will automatically be closed. label Apr 8, 2020
@stale stale bot closed this as completed Apr 15, 2020
@kelceydamage
Copy link

Hi, I'm experiencing the same exact issue. http_path_prefix is not being respected by promtail internal forwarding.

@firmero
Copy link

firmero commented Dec 31, 2020

Still same behavior, redirecting to /targets, also hrefs contain fixed paths not reflecting http_path_prefix.

@Rom888
Copy link

Rom888 commented Feb 18, 2021

The same issue, can't expose using ingress.

@Apollo3zehn
Copy link

Apollo3zehn commented Aug 16, 2021

Same problem here. Exposing via NGINX on path http://server/promtail/targets is not working.

Edit: As a workaround, I let NGINX rewrite the urls:

    location /promtail/ {
        proxy_pass http://localhost:3200/;

        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;

        sub_filter_once off;
        sub_filter 'href="/' 'href="';
        sub_filter 'src="/' 'src="';
    }

@bsinou
Copy link

bsinou commented Sep 8, 2021

The issue is still there in grafana/promtail:2.3.0 docker image.
Should we open a new issue?

@amiga23
Copy link
Author

amiga23 commented Sep 24, 2021

@bsinou if you want to get it fixed, either create a pull request ;-) or open a new ticket. This ticket was closed automatically, so I guess no developer is reading this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale A stale issue or PR that will automatically be closed.
Projects
None yet
Development

No branches or pull requests

7 participants