-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Series API endpoint unreliable for sparse logs, breaks label_values in Grafana #8034
Comments
Have the same issue using loki-stack helm chart on Loki 2.6.1 as well as 2.7.13 in single binary mode with filesystem storage. Series api doesn't return all label values that match query, even though those definitely exist - Logs query with those label values return some logs. Personal observation - this happens for pods that doesn't write a lot of logs. For me period after which query returns series again from last log ingestion is about 2 and a half hours @DieterDP-ng Did you come up with some solution or workaround for this? |
@KovalDS We already spent some time on it, but didn't find the specific cause or a workaround yet unfortunately. |
@DieterDP-ng Well, that's unfortunate. Going to spend some time investigating as well. Thanks for your reply! |
Create a cronjob and create a pod every minute to reproduce the "series" interface. A large number of Pods cannot be queried, but log "queryRange" can search for the corresponding pod logs @DieterDP-ng |
@DieterDP-ng Thanks for the detailed report. Do you have a chance to reproduce it with the latest Loki version 2.8.2? Nevertheless, we will have a look at the issue. |
Tested on Loki 2.8.2. The pod from my opening post was no longer doing sparse output, but I reproduced on another pod. This pod executed a job that only logged a few lines, and nothing else once it was completed. It seems there is still a difference between both API endpoints.
|
I have a Grafana dashboard that displays logs for several pods in a kubernetes environment. We ingest logs from both console and log files, and apply a
source
label to differentiate these. In the dashboard we allow selecting the Kubernetes namespace, Kubernetes pod and source using dropdowns (Grafana variables) so the user can select which logs he wants to see.One of these pods only outputs a single log line every +- 15 minutes. For this pod, I noticed that the
source
dropdown will not get filled in, i.e. the Grafana label_values call fails for Loki data . This causes it to default toNone
, and applied to the LogQL query, results in no logs being found. In the end, it seems that there are no logs, while in fact there are.For reference, the
source
variable is a Grafana configured as:label_values({namespace="$namespace", pod="$pod"}, source)
I tracked this problem down to the Loki series API, as this is the one used by
label_values
.When using the
/api/v1/series
API, Loki returns no data.However, when using the
/api/v1/query_range
over the same time range, data is returned:The strange thing is, the behavior of the first query depends on when exactly you execute it:
I am using Loki v2.6.1.
The text was updated successfully, but these errors were encountered: