← Back to Pull requests

client/pkg: move the systemd journal log writer to server/embed #22502

Open
dims opened this pull request with 38 lines diff across 14 files
View on GitHub
dims dims commented on Sep 29, 2026 12:23 UTC
Author

logutil.NewJournalWriter was the only user of github.com/coreos/go-systemd/v22 in the client/pkg/v3 module, and its only caller is the server's --log-outputs=systemd/journal sink in server/embed. This moves it there as an unexported newJournalWriter, so etcd client consumers stop carrying go-systemd in their module graph: client/v3 imports logutil only for CreateDefaultZapLogger, and the linker drops the writer everywhere except the server.

  • client/pkg, client/v3, cache, etcdctl and pkg go.mod files drop github.com/coreos/go-systemd/v22; server, etcdutl, tests and the root module keep it (etcdmain uses daemon.SdNotify).

  • client/pkg/v3/systemd (DialJournal, stdlib-only) stays.

  • GitHub code search for logutil.NewJournalWriter outside this repo finds only forks of server/embed/config_logging_journal_unix.go.

  • Downstream example: Kubernetes lists go-systemd in the go.mod of every module that imports the client, for a package none of its binaries link.
  • Draft, to get feedback on removing the exported logutil.NewJournalWriter from client/pkg/v3 in v3.8. If that is not acceptable, the alternative is to keep the function and reimplement the journal datagram protocol in client/pkg without go-systemd.

    AI usage: yes, AI tooling helped map the import graph and draft this change and description; the author reviewed and verified all of it.

    Diff: 38 lines (+12 / -26) across 14 files Reviewer: ahrtr Review duration: 8031m
    All Vouch review confidence checks passed
    Residual risk 0.05 = Change Risk (0.44) × (1 − Review Confidence (0.90)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.44 · 38 lines diff across 14 files
    0.44
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.90 · 5 substantive comment(s)
    0.90
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    89%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.219
    Real PR Conversation Timeline
    9 items
    kubernetes-prow[bot] kubernetes-prow[bot] commented on Sep 29, 2026 12:23 UTC
    Bot

    Skipping CI for Draft Pull Request.
    If you want CI signal for your change, please convert it to an actual PR.
    You can still manually trigger a test run with /test all

    dims dims commented on Sep 29, 2026 12:27 UTC
    Author

    /assign @serathius @ahrtr

    codecov[bot] codecov[bot] commented on Sep 29, 2026 12:56 UTC
    Bot

    Codecov Report


    :x: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
    :white_check_mark: Project coverage is 73.03%. Comparing base (7583cc6) to head (e64fc88).

    | Files with missing lines | Patch % | Lines |
    |---|---|---|
    | server/embed/config\_logging\_journal\_unix.go | 0.00% | 1 Missing :warning: |

    <details><summary>Additional details and impacted files</summary>

    | Files with missing lines | Coverage Δ | |
    |---|---|---|
    | server/embed/config\_logging\_journal\_writer\_unix.go | 4.76% <ø> (ø) | |
    | server/embed/config\_logging\_journal\_unix.go | 0.00% <0.00%> (ø) | |

    ... and 16 files with indirect coverage changes

    @@            Coverage Diff             @@
    ##             main   #22502      +/-   ##
    ==========================================
    - Coverage   73.05%   73.03%   -0.02%     
    ==========================================
      Files         448      448              
      Lines       31792    31792              
    ==========================================
    - Hits        23226    23220       -6     
    - Misses       8563     8569       +6     
      Partials        3        3              
    

    ------

    Continue to review full report in Codecov by Harness.

    Legend - Click here to learn more

    Δ = absolute <relative> (impact), ø = not affected, ? = missing data

    Powered by Codecov. Last update 7583cc6...e64fc88. Read the comment docs.

    </details>
    <details><summary> :rocket: New features to boost your workflow: </summary>

  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

  • </details>

    serathius serathius commented on Sep 29, 2026 13:40 UTC
    Contributor

    /ok-to-test

    kubernetes-prow[bot] kubernetes-prow[bot] commented on Sep 29, 2026 14:12 UTC
    Bot

    [APPROVALNOTIFIER] This PR is NOT APPROVED

    This pull-request has been approved by: <a href="https://github.com/etcd-io/etcd/pull/22502#" title="Author self-approved">dims</a>
    Once this PR has been reviewed and has the lgtm label, please ask for approval from ahrtr. For more information see the Code Review Process.

    The full list of commands accepted by this bot can be found here.

    <details open>
    Needs approval from an approver in each of these files:

  • OWNERS
  • Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment
    </details>
    <!-- META={"approvers":["ahrtr"]} -->

    dims dims commented on Sep 29, 2026 14:37 UTC
    Author

    /retest

    dims dims commented on Sep 29, 2026 14:48 UTC
    Author

    /retest

    ahrtr ahrtr commented on code on Sep 29, 2026 15:02 UTC
    Code Review
    server/embed/config_logging_journal_writer_unix.go:1
    @@ -30,12 +30,12 @@ import (
     	"go.etcd.io/etcd/client/pkg/v3/systemd"
     )
     
    -// NewJournalWriter wraps "io.Writer" to redirect log output

    If we decide to remove this, then we need to send a PR to release-3.7 to deprecate this exported function first.

    Reviewers
    Assignees
    dims dims
    Labels
    risk: low confidence: 89.6% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 44.0% (MEDIUM) · Higher = larger blast radius
    44.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 89.6% · Lower = rushed or shallow review
    89.6%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 4.6% · Safe to merge
    4.6%
    Repository