-
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
Label endpoint returns empty despite labels being present #1308
Comments
Possible duplicate of #453 though I thought this was fixed a long time ago. |
This is interesting, the problem seems to be the slow volume of logs in relation to how Grafana does a healthcheck on Loki. I'm guessing others haven't seen this as they have some volume of logs continue to trickle in. Ultimately we should probably find a better way for Grafana to do a health check on Loki rather than running a label query. For now I think you might need something that logs at least every few minutes to keep Grafana happy. |
Thank you for your explanation. This should definitely changed in either Loki or Grafana as it causes a vanilla setup to fail if there are not enough (recent) logs. I will close this as a duplicate of #453. |
@davkal what are your thoughts on changing how Grafana does a healthcheck on Loki? Should Loki add a specific endpoint for this? |
I think the problem is related to this. But version 1.0.0 solves the problem because the API always responds with the |
Fixed via grafana/grafana#20971 |
The health check should be cheap, but confer if things are operating nominally. For prometheus we use |
Describe the bug
I have loki + promtail + grafana deployed as a stack on a docker swarm with one node (latest images). Promtail scans logs on a volume mounted inside the container and
positions.yaml
as well as lokis storage is persisted on a mount. When I deploy the stack, for a couple of minutes everything works fine and I can query the logs via grafana and loki. After some time the following error message occurs:Error connecting to datasource: Data source connected, but no labels received. Verify that Loki and Promtail is configured properly.
Trying to query lokis api for a specific label
curl -G -s "http://<host>:3100/loki/api/v1/label/log_name/values" | jq .
returns the labels as it should.
However the call that grafana most likely does to show the available labels and their values
curl -G -s "http://<host>:3100/loki/api/v1/label" | jq .
returns
{}
I have done everything in the troubleshooting section relating to this error. Promtail works perfectly until Loki stops serving labels for some reason. Most likely because there are no new logs.
Expected behavior
When I delete positions.yaml and redeploy the stack it works for some time and returns the labels
curl -G -s "http://<host>:3100/loki/api/v1/label" | jq .
returns
Maybe I am getting this wrong but since loki persists logs, it should be able to supply them even if there are no logs coming in from promtail at any time.
Environment:
Single node docker swarm on a Ubuntu Server.
Screenshots, Promtail config, or terminal output
promtail-config.yaml
excluding pipeline because it works obviouslyloki-config.yaml
docker-stack.yml
(hostnames removed for privacy)The text was updated successfully, but these errors were encountered: