loki
loki copied to clipboard
Why does loki not support configuring the specified time zone?
Describe the bug Didn't find anywhere to configure loki timezone。
To Reproduce config the time zone
Expected behavior Show consistent time
Environment: loki latest version
Screenshots, Promtail config, or terminal output
@oreak please describe how you are sending logs to Loki - are you pushing directly, using Promtail, something else?
@oreak please describe how you are sending logs to Loki - are you pushing directly, using Promtail, something else?
I should have figured it out, is loki a fixed UTC time zone? In this way, if my local time zone is not UTC, then I need to change the time to UTC when Http api pushes, and then send.
@oreak please describe how you are sending logs to Loki - are you pushing directly, using Promtail, something else?
It's bad, very bad, if loki is a fixed UTC timezone instead of a configurable timezone. It is still recommended that loki can customize the configuration time zone.
@oreak please describe how you are sending logs to Loki - are you pushing directly, using Promtail, something else?
I send log by https://grafana.com/docs/loki/latest/api/#post-lokiapiv1push
I have changed loki's code and recompiled, mainly modifying DefaultTimestampUTC to DefaultTimestamp , using the default time zone, which solved my problem.
Hi! This issue has been automatically marked as stale because it has not had any activity in the past 30 days.
We use a stalebot among other tools to help manage the state of issues in this project. A stalebot can be very useful in closing issues in a number of cases; the most common is closing issues or PRs where the original reporter has not responded.
Stalebots are also emotionless and cruel and can close issues which are still very relevant.
If this issue is important to you, please add a comment to keep it open. More importantly, please add a thumbs-up to the original issue entry.
We regularly sort for closed issues which have a stale
label sorted by thumbs up.
We may also:
- Mark issues as
revivable
if we think it's a valid issue but isn't something we are likely to prioritize in the future (the issue will still remain closed). - Add a
keepalive
label to silence the stalebot if the issue is very common/popular/important.
We are doing our best to respond, organize, and prioritize all issues but it can be a challenging task, our sincere apologies if you find yourself at the mercy of the stalebot.
This is also an issue for us.
I assume this to be my issue as well. I am pushing log files through promtail but the log files do not have a timezone attached to them. If I controlled upstream I could simply modify the log files and append a timezone.
I need a timezone on Loki so it can assume timestamps without a timezone are in the default timezone.
I tried setting the timezone as outlined here with no corrections to the logged times.
Can time zone configuration be supported
Also an issue for me. Any hints on this?
The problem has not been solved. It's really strange that you can't override this via the docker environment variables. This seems to indicate that it is hard-coded in the loki code that the time used must be UTC, perhaps there is a reason for this? If so, this reason should be mentioned in the documentation as it's quite disconcerting behaviour.
It's weird that you can't change container's timezone with docker environment "TZ"
I've ever seen Loki's code, it's a hard-coded fixed time zone.I've never seen a design like this, it's incredible. To change the time zone you can only change its code.
guluguru @.***> 于2024年4月30日周二 17:24写道:
It's weird that you can't change container's timezone with docker environment "TZ"
— Reply to this email directly, view it on GitHub https://github.com/grafana/loki/issues/6374#issuecomment-2084812492, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQGEICY5W2AQGHDTSDC273Y75PNLAVCNFSM5YTHESJ2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBYGQ4DCMRUHEZA . You are receiving this because you were mentioned.Message ID: @.***>
Still an issue, an variable to define the timezone would greatly be appreciated :)