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

Cannot query label values if server.http_path_prefix is set #15585

Open
moorglade opened this issue Jan 3, 2025 · 1 comment
Open

Cannot query label values if server.http_path_prefix is set #15585

moorglade opened this issue Jan 3, 2025 · 1 comment

Comments

@moorglade
Copy link

Describe the bug
If I set server.http_path_prefix to any value, querying /<prefix>/loki/api/v1/label/<name>/values returns an error:

parse error : syntax error: unexpected $end

Other endpoints seem to work as expected.

To Reproduce

Steps to reproduce the behavior:

  1. Set server.http_path_prefix in Loki configuration.
  2. Started Loki 3.3.2.
  3. Query /<prefix>/loki/api/v1/label/<name>/values API endpoint.

Expected behavior
The endpoint should return label values.

Environment:

  • Infrastructure: bare-metal servers + Docker

Screenshots, Promtail config, or terminal output

curl --header "X-Scope-OrgID: test"  http://192.168.0.3:3100/my_prefix/loki/api/v1/label/filename/values?start=1735898264857000000
parse error : syntax error: unexpected $end

Possibly related to #2176

@rgroothuijsen
Copy link
Contributor

It does appear to be caused by the code only checking absolute paths, as changing this piece of code makes the query work. A fix would have to somehow pass information about the configured prefix, or loosen the conditions to only check if the URL includes these paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants