-
Notifications
You must be signed in to change notification settings - Fork 107
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
main: journald support with external correlation #4047
Conversation
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.
For readability it would be really nice if this could get broken up into smaller patches :)
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.
I think this is a decent idea and will make log reading a lot less unpleasant.
I'd like to see the PR broken into more readable smaller commits though. Some of the inline comments could be in-code since they clarify things that are happening implicitly and aren't going to be very useful as PR comments in the long run.
Also, some of the inline comments are nice explanations for why a change happened, which is often very useful to have as a commit message for that standalone patch.
Moved all comments into the codebase, broken into three commits:
|
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 for tidying up. LGTM!
Tiny note about the documantation, but can be changed in a follow-up, or even ignored.
f00871d
to
14cfd17
Compare
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.
LGTM
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.
@lzap We don't do merge commits in these repos. Can you drop the merge commit and rebase instead?
Damn that was a misclick, amended a rebase. |
Yeah, it's a timout, very unlikely to be caused by this PR, but it means the tests on 8.4 didn't run on this PR :( |
There's a known issue with that test but I thought we fixed it already. |
7d2c53a
to
8f7c11c
Compare
Rebased. |
8f7c11c
to
02cc2b0
Compare
The main pipeline is green!! Woooot! |
Well bunch of tests failed, someone help me to understand if these are relevant. These logs are hard to read. |
Since all the edge tests are failing but the main gitlab CI pipeline succeeded, it might something with the edge tests themselves or something in the PR changed something the tests rely on. I'm seeing at least one instance of the issue described in #4094 |
Oh, we're hitting the old:
Commit 6f69cac updated the sources which introduces a version of rpm-ostree that causes an issue we're aware of. The issue has been fixed but we've been waiting for it to reach Fedora 39 and CS9 repos before updating sources. But since edge tests aren't required for merging and we needed newer sources for other reasons, I suppose all our edge tests are failing on F39 and CS9 now. |
This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days. |
6c7a747
to
d3d108e
Compare
This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days. |
@achilleas-k WDYT about this one? it'd be great to get it in :) |
Yes, we should get this merged. It seems it got caught in CI flakiness purgatory. Let's do a rebase and full run to get it in. |
d3d108e
to
c8b7aea
Compare
Just |
Thank you @achilleas-k and @lzap ! 🧡 |
This patch adds native journald support through logrus which enables to work with structured logs. It uses a dependency that is already in the project (
coreos/systemd-go
) which is a pure Go implementation. New log type is introduced named "journal" and it is now the default with fallback to "text" if journald is not present on the system.Structured logging enabled me to work with logrus fields that can help with correlating log records on standalone or hosted deployments. Already existing "operation_id" field (random string) is now fully propagated via echo context logger and new logrus hook extracts it from Go standard context.
A new field called "external_id" is extracted from HTTP header
X-External-Id
when present. The idea is to set this to X-Edge-Request-Id on hosted image builder so logs can be easily correlated across both services.Additionally, each cloud API request is now logged using the built-in echo logging middleware which creates entries like
Processed request GET /path
. Together with journald this can be tested end-to-end:This will create the following entries:
Users can easily dig logs per request or operation:
TODO