Structured logging and audit logs - #106
Merged
Merged
Conversation
rlahfa-dinum
force-pushed
the
logs
branch
2 times, most recently
from
June 15, 2026 15:36
197c32b to
2e91720
Compare
rlahfa-dinum
force-pushed
the
logs
branch
2 times, most recently
from
June 15, 2026 16:43
d690479 to
9bd9358
Compare
rlahfa-dinum
marked this pull request as ready for review
June 15, 2026 16:43
RealHinome
reviewed
Jun 17, 2026
RealHinome
reviewed
Jun 17, 2026
RealHinome
reviewed
Jun 17, 2026
RealHinome
reviewed
Jun 17, 2026
|
These changes are really great. It's an excellent idea. My reviews are just comments, not formal reviews. |
agrimault-dinum
left a comment
Collaborator
There was a problem hiding this comment.
The subsystem routing is a great idea.
I assumed you used duration_ms for network call and duration_us otherwise where is makes sense
Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
This way, it is possible to print it to users and be able to reconcile a very specific request. Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
As it can be used in final contexts as well after an async move, making it non-initial. Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
With timings Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
With timings
Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
Known to be broken: spans for connection-passing function are dropped. I assume this is a macro problem with zlink. Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
This adds a bunch of structures to configure log subsystems according to targets and filter them adequately. The logging mechanism supports routing to multiple outputs and different formats such as JSON, compact, pretty or the normal one (called full). Instead of letting the user configure everything, we offer 3 presets: - development — everything on stdout & stderr in the pretty format - systemd — some files from LogsDirectory=portail and stderr for system & errors, ideally, via journald later on, with json in some places - container — stdout & stderr in the json format. Let's not offer any customization for now as this complicates (for no good reason) the user's job to configure the system. Log shippers loves structured JSON, this is our default format. Our traces are updated to be routed properly and enriched with more spans now. Logging has been made non-blocking using tracing_appender which uses a thread pool to dispatch logs to a queue and let the worker depop them, this should ensure that logging does not add any meaningful overhead during proxying. This needs to be benchmarked and measured wrt to latency (with runtime deactivation, compile-time deactivation, etc.). Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
This makes full use of the logging work. Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
agrimault-dinum
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This bring a comprehensive facility to trace:
on a client or a server.
Trace IDs are added to allow correlation to occur once we present rejection pages and so on.
The output facilities are thought for:
TODO:
don't usetargetfor the log routinglog RPC stuffaddlog-presetCLI paramupdate nixos moduleensure the policy for check ACL logging and the RPC command is clearFixes #65.
Signed-off-by: Ryan Lahfa ryan.lahfa.ext@numerique.gouv.fr