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

[Bug|Querier/Ingester]: Query parameter not working with /loki/api/v1/label/<name>/values endpoint. #10759

Open
Lucostus opened this issue Oct 2, 2023 · 1 comment
Labels
component/api component/querier type/bug Somehing is not working as expected

Comments

@Lucostus
Copy link
Contributor

Lucostus commented Oct 2, 2023

Describe the bug
Querying the /loki/api/v1/label//values endpoint with a query parameter returns all values regardless of the provided matcher/query. This issue only occurs when querying between now and 6 hours. After 6 hours, the endpoint functions correctly and returns only the requested labels. This leads me to believe that the underlying bug may be related to the Ingester-query.

To Reproduce
Steps to reproduce the behavior:

  1. Start a Loki "stack" (2.9.1) Here the main Docker-compose.yaml
  2. Call the /loki/api/v1/label//values endpoint with a given label and try to query only a result.

Expected behavior
For example

http://localhost:3100/loki/api/v1/label/filename/values?query={filename=%22/var/log/wifi.log%22}

Returns:

{"status":"success","data":["/var/log/fsck_apfs.log","/var/log/fsck_hfs.log","/var/log/install.log","/var/log/shutdown_monitor.log","/var/log/wifi.log"]}

But it should only return "/var/log/wifi.log" and not all the files.

Environment:

  • Infrastructure: OpenShift cluster 4.13
  • Deployment tool: Openshift-logging -> Loki operator

Screenshots, Promtail config, or terminal output
no screenshots

@JoaoBraveCoding
Copy link
Collaborator

I believe this has been fixed in #10375, however, it wasn't added to any release, I've created two PR to backport the fix to 2.8.x and 2.9.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/api component/querier type/bug Somehing is not working as expected
Projects
None yet
Development

No branches or pull requests

3 participants