Skip to content

add partial metadata to journald logs#41407

Merged
thaJeztah merged 1 commit into
moby:masterfrom
Sixt-Archive:bug-41403
Sep 8, 2020
Merged

add partial metadata to journald logs#41407
thaJeztah merged 1 commit into
moby:masterfrom
Sixt-Archive:bug-41403

Conversation

@lobeck

@lobeck lobeck commented Sep 1, 2020

Copy link
Copy Markdown
Contributor

add all partial metadata available to journald logs to allow easier reassembly of partial messages in downstream logging systems

fixes #41403

Signed-off-by: Christian Becker [email protected]

- What I did

provide all details about partial messages to downstream services

- How I did it

forward all information from the relevant struct

- How to verify it

check that the fields are present in journald

import json
print(json.dumps({"message": "a"*18000, "tag": "foobar"}))

Results in the following log:

Tue 2020-09-01 11:24:18.143403 UTC [s=be59df70b0604f5582eb3f5a63ab14fa;i=1415;b=679b998a443941ec9022bc4de82c3a0a;m=595870a5;t=5ae3ec2834cd9;x=f3d1f555624d9c34]
    PRIORITY=6
    _TRANSPORT=journal
    _COMM=dockerd
    IMAGE_NAME=python:3
    CONTAINER_PARTIAL_MESSAGE=true
    CONTAINER_PARTIAL_ORDINAL=1
    CONTAINER_PARTIAL_LAST=false
    MESSAGE={"message": "aaaaaa[snip]aaa
    CONTAINER_ID=4cb6180740b3
    CONTAINER_NAME=heuristic_fermi
    CONTAINER_ID_FULL=4cb6180740b3540cbca6e5fec8fe85e24a9c30cf3a2f0da53e7624bd835e3439
    CONTAINER_TAG=4cb6180740b3
    CONTAINER_PARTIAL_ID=431065540a2bcb517e7b61c24255fd287701fd6e40616fe9ec0571abd8d955bf
Tue 2020-09-01 11:24:18.144032 UTC [s=be59df70b0604f5582eb3f5a63ab14fa;i=1416;b=679b998a443941ec9022bc4de82c3a0a;m=595872f3;t=5ae3ec2834f27;x=ceb38ba9b350b9e8]
    PRIORITY=6
    _TRANSPORT=journal
    _COMM=dockerd
    IMAGE_NAME=python:3
    CONTAINER_PARTIAL_ORDINAL=2
    CONTAINER_PARTIAL_LAST=true
    MESSAGE=aaa[snip]aaaa", "tag": "foobar"}
    CONTAINER_ID=4cb6180740b3
    CONTAINER_NAME=heuristic_fermi
    CONTAINER_ID_FULL=4cb6180740b3540cbca6e5fec8fe85e24a9c30cf3a2f0da53e7624bd835e3439
    CONTAINER_TAG=4cb6180740b3
    CONTAINER_PARTIAL_ID=431065540a2bcb517e7b61c24255fd287701fd6e40616fe9ec0571abd8d955bf

- Description for the changelog

improve partial log message support for journald

add all partial metadata available to journald logs to allow easier reassembly of partial messages in downstream logging systems

fixes moby#41403

Signed-off-by: Christian Becker <[email protected]>
@AkihiroSuda AkihiroSuda added area/logging kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. labels Sep 2, 2020
@boyand

boyand commented Sep 7, 2020

Copy link
Copy Markdown

Any ETA when could we merge this ?

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah
thaJeztah merged commit f50a40e into moby:master Sep 8, 2020
@thaJeztah thaJeztah added this to the 20.03.0 milestone Sep 8, 2020
@lobeck
lobeck deleted the bug-41403 branch September 8, 2020 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/logging impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add partial metadata to journald driver

4 participants