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

Journalctl #26

Closed
wants to merge 2 commits into from
Closed

Journalctl #26

wants to merge 2 commits into from

Conversation

gouthamve
Copy link
Member

TODO:

  • [ ] Vendoring is broken, tom has custom version of cortex vendored that is not pushed anywhere, I cp -r'ed required deps.
  • [ ] Static linking is not possible, cannot make docker image work.

Signed-off-by: Goutham Veeramachaneni <[email protected]>
@multun
Copy link

multun commented Dec 13, 2018

@gouthamve @tomwilkie awesome work, thanks !
it merging this still planned? without any equivalent feature, loki won't be usable for journald-enabled infrastructures, which is a shame considering how big of an improvement it seems to be compared to existing log aggregation software

@hikhvar
Copy link

hikhvar commented Jan 6, 2019

@multun I have build a small PoC for shipping journald logs to loki. (https://github.com/hikhvar/journaldtail) However my current problem is, that I get Entry out of order Errors while pushing to loki :-(

@multun
Copy link

multun commented Jan 6, 2019

@hikhvar

if len(c.entries) > 0 && c.entries[len(c.entries)-1].Timestamp.After(entry.Timestamp) {

Then your logs must must somehow be out of order ;-) It may be that 1) the logs appears out of order inside journald in the first place 2) logs aren't fetched in order 3) some conversion is needed 4) ?

@hikhvar
Copy link

hikhvar commented Jan 7, 2019

I did a bit more debugging. I did not clean the loki instance between my test runs. Since I start at the top of the journal in each run, I tried to ingest duplicate logs.

@SvenDowideit
Copy link

SvenDowideit commented Jan 11, 2019

I've been playing with @hikhvar 's journaldtail - and I can get the out of order error basically at will by doing a docker run

sudo journalctl | grep dockerd results in:

Jan 11 16:17:57 TOWER-SL sudo[10986]:   dow184 : TTY=pts/7 ; PWD=/home/dow184/go/src/github.com/hikhvar/journaldtail ; USER=root ; COMMAND=/bin/journalctl dockerd
Jan 11 16:18:53 TOWER-SL dockerd[1881]: time="2019-01-11T16:18:53.863285304+10:00" level=info msg="No non-localhost DNS nameservers are left in resolv.conf. Using default external servers: [nameserver 8.8.8.8 nameserver 8.8.4.4]"
Jan 11 16:18:53 TOWER-SL dockerd[1881]: time="2019-01-11T16:18:53.863328047+10:00" level=info msg="IPv6 enabled; Adding default IPv6 external servers: [nameserver 2001:4860:4860::8888 nameserver 2001:4860:4860::8844]"
Jan 11 16:18:53 TOWER-SL dockerd[1881]: time="2019-01-11T16:18:53+10:00" level=info msg="shim docker-containerd-shim started" address="/containerd-shim/moby/b23a8c72c33d2921c8be98dd8f7ce16a9d17417617f5602c934f55b014aede15/shim.sock" debug=false pid=11371
Jan 11 16:18:54 TOWER-SL dockerd[1881]: time="2019-01-11T16:18:54+10:00" level=info msg="shim reaped" id=b23a8c72c33d2921c8be98dd8f7ce16a9d17417617f5602c934f55b014aede15
Jan 11 16:18:54 TOWER-SL dockerd[1881]: time="2019-01-11T16:18:54.791609894+10:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"

loki onthe other hand is missing the Jan 11 16:18:53 TOWER-SL dockerd[1881]: time="2019-01-11T16:18:53.863328047+10:00" level=info msg="IPv6 enabled; Adding default IPv6 external servers: [nameserver 2001:4860:4860::8888 nameserver 2001:4860:4860::8844]" line

I presume this is really a bug in dockerd's logging, given that some times have milliseconds, and some don't :(

upgrading from Docker 18.06 to 18.09 may also have stopped this - possibly because the containerd shim entries aren't logged - I'll circle back to this on Monday

@gouthamve gouthamve closed this Mar 14, 2019
@gouthamve gouthamve deleted the journalctl branch March 14, 2019 08:38
periklis added a commit to periklis/loki that referenced this pull request Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants