-
Notifications
You must be signed in to change notification settings - Fork 136
logging: Add container labels to log entries on journald #562
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
Conversation
Podman PR: containers/podman#26203 |
fc7c6a6
to
10a3e75
Compare
I think this PR fixes #336 after all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, otherwise LGTM
Ephemeral COPR build failed. @containers/packit-build please check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks,
LGTM
At present it's not possible to ship properly labeled logs when using podman and tools like podman-compose. Container labels are lost which makes it much harder to understand where a particular log line originated from. Log processing and analysis is significantly more inconvenient as well, because it's hard to group related logs, e.g. coming from the same compose project. This commit implements the parts necessary to annotate log messages with container labels. Each label and value pair is specified via --log-label LABEL=VALUE arguments. Co-authored-by: OZoneGuy <[email protected]> Signed-off-by: Povilas Kanapickas <[email protected]>
LGTM |
@haircommander Would it be possible to release new version of conmon with this PR? I think containers/podman#26203 depends on new version of conmon. If new release is too early, I'm sorry for the noise and will wait for whenever a release will be made. |
if (!use_journald_logging) { | ||
if (!tag) { | ||
nexit("k8s-file doesn't support --log-tag"); | ||
} | ||
if (!log_labels) { | ||
nexit("k8s-file doesn't support --log-label"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks wrong to me...
It should be if (tag) {
maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes that seems wrong, could you please open a PR so we can get it merged quickly?
cri-o is facing CI failure and seeing conmon failure. |
At present it's not possible to ship properly labeled logs when using podman and tools like podman-compose. Container labels are lost which makes it much harder to understand where a particular log line originated from. Log processing and analysis is significantly more inconvenient as well, because it's hard to group related logs, e.g. coming from the same compose project.
This commit implements the parts necessary to annotate log messages with container labels. Each label and value pair is specified via --log-label LABEL=VALUE arguments.
This PR was initially based on #553 and ultimately was reworked enough that there's little semblance to the original PR anymore. Attribution is still preserved in commit message. The following is the changes from the 553 PR:
--log-label
being used with k8s-filepodman
and currently runs in production. Podman PR: libpod: Implement --log-opt label=LABEL=Value podman#26203.Fixes #336.