Skip to content

Convert tracing calls to structured fields - #93

Merged
imp merged 5 commits into
mainfrom
imp/structured-tracing
Jul 20, 2026
Merged

Convert tracing calls to structured fields#93
imp merged 5 commits into
mainfrom
imp/structured-tracing

Conversation

@imp

@imp imp commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace formatted string log messages (trace!("...", value)) with structured tracing fields (%value / ?value / key = value) across the workspace, making log output queryable and consistent with tracing's structured-logging model.
  • Drop redundant log messages that just repeated the field name (e.g. debug!(%seed, "seed") -> debug!(%seed)).

Test plan

  • cargo clippy --workspace --all-targets passes clean
  • cargo check --workspace passes

Replaces formatted string log messages with structured tracing fields
(e.g. `%value` / `?value`) across the workspace, making log output
queryable and consistent with tracing's structured-logging model.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR converts tracing calls across the workspace from formatted-string messages to structured fields (e.g. %value, ?value, key = value), making logs more queryable and consistent with structured-logging conventions.

Changes:

  • Replaced interpolated/format-string tracing calls with structured fields throughout server, client, catalog, data, and bench crates.
  • Simplified/normalized log messages by removing redundant text where the field name already conveys meaning.
  • Updated test/bench logging statements to use structured fields for easier filtering and correlation.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
server/tests/server.rs Updates test tracing calls to log structured header/status/body fields.
server/src/replication.rs Converts replication loop/config error logging to structured fields.
server/src/lib.rs Logs reconciliation config as a structured debug field.
server/src/http.rs Converts server “listening” and append logging to structured fields.
server/src/config.rs Logs config TOML lines and formatting errors with structured fields.
data/src/segment/parquet.rs Converts segment/parquet writer & recovery logs to structured fields.
data/src/segment/cache.rs Converts cache writer/read logs to structured fields (rows, chunks, paths, errors).
data/src/segment/arrow.rs Converts arrow segment recovery logs to structured fields.
data/src/segment.rs Converts segment lifecycle logs (remove/truncate/iter/format detection) to structured fields.
client/src/replicate.rs Converts replication job lifecycle and retry/error logging to structured fields.
client/src/lib.rs Converts client warnings/debug logs (batch sizing, responses) to structured fields.
client/src/batch.rs Converts batch sizing/queueing error logs to structured fields.
catalog/src/topic.rs Logs partition map via a structured debug field.
catalog/src/storage.rs Logs storage monitor startup with structured root/mount_point fields.
catalog/src/slog.rs Converts slog compaction/checkpoint/thread logs to structured fields.
catalog/src/reconcile.rs Converts reconcile loop/topic/partition/segment logging to structured fields.
catalog/src/partition.rs Converts partition commit/retention/rolling logs to structured fields.
catalog/src/manifest.rs Converts manifest migration/update/remove logging to structured fields.
catalog/src/catalog.rs Converts catalog migration/checkpoint/retention/open/close logging to structured fields.
bench/src/write.rs Converts bench writer traces to structured fields.
bench/src/load.rs Converts bench load test traces/debug to structured fields.
bench/src/lib.rs Converts bench runtime status/stats logging to structured fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread data/src/segment.rs Outdated
imp added 4 commits July 2, 2026 18:41
Address review comment on PR #93: the message referred to Arrow
segment parts as "parquet parts", which is incorrect since parquet
handling lives in a separate module.
String, &str, and numeric primitives implement tracing::field::Value
directly and don't need Display formatting via %. Keep % only for
types that require it (ByteSize, PartitionId, SegmentId, SocketAddr,
Path::Display, error types, etc).
Dropping % sigils shortened several tracing! call lines, requiring
rustfmt to reflow them.
These three error!() sites logged anyhow/thiserror errors with {:?}
(Debug) before the tracing conversion, which shows the full cause
chain and enum variant detail. The conversion had switched them to
%e (Display), silently dropping that detail from production logs.
@imp
imp merged commit 5c3d741 into main Jul 20, 2026
4 checks passed
imp added a commit that referenced this pull request Jul 20, 2026
Address review comment on PR #93: the message referred to Arrow
segment parts as "parquet parts", which is incorrect since parquet
handling lives in a separate module.
@imp
imp deleted the imp/structured-tracing branch July 20, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants