-
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
No labels after restarting loki 1.3.0 #1858
Comments
Seems like you’re not flushing data, I wonder why
Le ven. 27 mars 2020 à 17:22, Mario-Hofstaetter <notifications@github.com>
a écrit :
… *Describe the bug*
After restarting loki, previously existing labels are not shown anymore
using label_values / labels.
Old logmessage can still be retrieved though. Tested using v1.3.0 and
current docker image grafana/loki:latest 398b0bc8f72b
*To Reproduce*
The issues has something to do with my logdata, I was able to simplify it.
Via docker:
wget https://gist.githubusercontent.com/Mario-Hofstaetter/d47d1194e9b3eeb11874f880a69fedb9/raw/fdabae0861589fa3aa541dc105de45ba71fa1a18/docker-compose.yaml# this is modified from https://github.com/grafana/loki/blob/v1.3.0/production/docker-compose.yaml
wget https://gist.github.com/Mario-Hofstaetter/d47d1194e9b3eeb11874f880a69fedb9/raw/fdabae0861589fa3aa541dc105de45ba71fa1a18/docker-config.yaml
wget https://gist.github.com/Mario-Hofstaetter/d47d1194e9b3eeb11874f880a69fedb9/raw/fdabae0861589fa3aa541dc105de45ba71fa1a18/lorem.exe.log
# pull and start
docker-compose pull && docker-compose up -d loki promtail
loki is running and recevied logs. Using logcli 1.3.0: logcli labels:
http://localhost:3100/loki/api/v1/labels
__name__
filename
instance
job
level
logger
sitename
The labels are correctly shown.
# Now restart loki and query again
docker-compose restart -t 30 loki
After restart all labels but __name__ are missing, logcli labels:
http://localhost:3100/loki/api/v1/labels
__name__
This is also visible in grafana explorer:
[image: loki-no-labels]
<https://user-images.githubusercontent.com/33002073/77800952-2d807080-7078-11ea-9100-0b43c1459eae.png>
*Expected behavior*
Restarting loki should not have any effect on persisted data.
*Environment:*
- Loki v1.3.0 on Windows 10 1903
- Also described above on current docker images running on CentOS 7
Related issue?
#453 <#453> #521
<#521>
However is does not happen after a certain time, but immediately when
restarting loki
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1858>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIBF3MYA6SOHJMQAFSADO3RJUKLHANCNFSM4LVJRF6A>
.
|
Can you try with a bigger restart timeout something like 600 ? |
Actually the container is stopping within < 5 seconds, the 30 sec is already extra. |
I'm not able to reproduce:
|
If you have more informations let us know. This is weird. FYI You can't switch between 1.3 and latest (same for the other way around). This will cause issues, because they use different schemas. You should activate log debug and let us know if you see anything there on Loki. |
Did you use my example logfile? because your labels are different than mine. Otherwise i will provide an more complete example, including |
If I keep the job from the example:
It will look like this after restarting loki.
So just the labels from Also I just noticed my I have
Could that be an issue? Label |
If the labels is rejected you'll have an error in the logs. |
Can you share logs before and after restart please ? |
I do have a similar problem: logs are not available after a loki restart. My configuration:
full configuration here: https://gist.github.com/previ/63d8fd4f52925ab0a0c752e6df5554a6 |
I just noticed something. What timerange is used for getting lables? Does loki look at ALL logs stored, or just what the timerang currently requrested by grafana? |
Please see attached video. After refreshing grafana ( After repeatedly exactly 30 seconds, labels are shown again in grafana. |
@Mario-Hofstaetter Labels query use time range; start and end, by default last hour. So if you don't have log in the last hour, we don't show any labels. If you increase the time range and refresh the page it will do a larger label query. |
Ok but that does not explain the behavior of grafana explore in the video attached above? It does explain why |
In my case, the problem was related to azure blob. It seems like loki was not able to read the blobs back. |
Thanks for the follow up @previ Loki v1.4.0 should have vendored a new enough version of Cortex to include this fix. I'm going to close this issue, however, if you try Loki 1.4.0 against azure and still have issues please comment on this and we will reopen it! |
I can confirm that loki 1.4.0 works with azure blobs, thanks! |
I have the same issue with loki-docker-driver:1.6.0 labels (compose_project, compose_service, container_name and host). loki-docker-driver-labels-error-2020-08-20_12.34.15.mp4.zip Grafana 7.1.3 |
same problem with loki or loki-stack latest version as of today. |
I have the same issue as well. I am using minio and I see data in /fake folder that are older but it returns nothing when trying to get logs from before the restart. What could be the reason for it? My configuration:
|
@puppeteer701 Did you ever figure this out? I'm having a similar issue using loki with s3. |
Describe the bug
After restarting
loki
, previously existing labels are not shown anymore usinglabel_values
/labels
.Old logmessage can still be retrieved though. Tested using
v1.3.0
AND current docker imagegrafana/loki:latest 398b0bc8f72b
To Reproduce
[EDIT 2020-03-30: See below for second description and debug logs]
The issues has something to do with my logdata, I was able to simplify it.
Via docker:
loki
is running and recevied logs. Using logcli 1.3.0:logcli labels
:The labels are correctly shown.
# Now restart loki and query again docker-compose restart -t 30 loki
After restart all labels but
__name__
are missing,logcli labels
:This is also visible in grafana explorer:
Expected behavior
Restarting loki should not have any effect on persisted data.
Environment:
v1.3.0
on Windows 10 1903Related issue?
#453 #521
However is does not happen after a certain time, but immediately when restarting loki
EDIT 2020-03-30
Configuration, including the debug-logs:
asciinema
demo of the steps including UTC timestamps:Note: I have an alias
dc
fordocker-compose
This ran using the
latest
docker images, after pulling, that is:The text was updated successfully, but these errors were encountered: