Skip to content

Migrate the dhcp crate from the log facade to structured tracing #3475

Description

@chet

What

The dhcp crate is the codebase's lone log:: facade island: 47 of the workspace's 50 log:: macro calls live in crates/dhcp (the other 3 are in crates/rpc), while everything else uses tracing:: -- ~3,380 calls. So dhcp's logs don't carry structured fields into the fleet's logfmt pipeline the way tracing:: logs do, and they may not even reach it.

Investigate first

  • WHY dhcp uses log:: -- most likely because it's built around dhcproto (its DHCP protocol dependency), which emits through the log facade, so dhcp matched it. Confirm.
  • Whether dhcp-server (the binary consuming carbide-dhcp) installs a log->tracing bridge (LogTracer / tracing-log). If it does, dhcp's log:: records reach the fleet subscriber but as unstructured messages; if not, they may be dropped entirely -- a real observability gap.

Then migrate

  • Convert dhcp's ~47 log::{warn,info,error,debug,trace}! sites (and rpc's 3) to tracing::, passing values as structured fields (error = %e, %address, ...) instead of interpolating them.
  • Decide how to handle dhcproto's own log:: output (keep a bridge for the dependency's logs, or leave it).

Surfaced during #3469 review (CodeRabbit flagged dhcp's log::warn! at crates/dhcp/src/lib.rs); deferred so it can be done crate-wide rather than piecemeal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Task.

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions