Skip to content

F-013: feat(observability): tracing spans on pipeline functions#17

Open
Sephyi wants to merge 1 commit intodevelopmentfrom
audit/f-013-instrument-pipeline-spans
Open

F-013: feat(observability): tracing spans on pipeline functions#17
Sephyi wants to merge 1 commit intodevelopmentfrom
audit/f-013-instrument-pipeline-spans

Conversation

@Sephyi
Copy link
Copy Markdown
Owner

@Sephyi Sephyi commented Apr 22, 2026

Summary

feat(observability): tracing spans on pipeline functions.

Audit context

Closes audit entry F-013 from #3.

Verification

  • cargo fmt --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-targets

Note: one pre-existing test porcelain_exits_within_timeout_with_no_staged_changes is a known macOS cold-start flake that reproduces on unmodified development — unrelated to this change.

Add `#[tracing::instrument]` to the three load-bearing stages of the
commit-generation pipeline so span-aware debug output (e.g.
`COMMITBEE_LOG=debug,commitbee::app=trace`) shows per-stage timing and
a handful of high-signal fields:

- `App::generate_commit` — provider, model
- `AnalyzerService::extract_symbols` — file_count
- `ContextBuilder::build` — symbols, diffs, files

All spans use `skip_all` plus explicit fields so `Self`, raw file
contents, and large collections are never recorded as span attributes.
No function signatures or return types change; this is purely
diagnostic.

Closes audit entry F-013 from #3.
Copilot AI review requested due to automatic review settings April 22, 2026 19:50
@Sephyi Sephyi added the audit Codebase audit cleanup (issue #3) label Apr 22, 2026
@Sephyi Sephyi self-assigned this Apr 22, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds tracing spans to key pipeline functions to improve observability and satisfy audit finding F-013.

Changes:

  • Instrument App::generate_commit() with span fields for provider/model.
  • Instrument AnalyzerService::extract_symbols() with a file-count field.
  • Instrument ContextBuilder::build() with fields describing symbol/diff/file counts.

Reviewed changes

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

File Description
src/app.rs Adds a tracing span around the main commit-generation pipeline entrypoint.
src/services/analyzer.rs Adds a tracing span for the symbol extraction step.
src/services/context.rs Adds a tracing span for prompt-context construction with basic cardinality fields.

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

Comment thread src/services/context.rs
Comment on lines +39 to +42
#[tracing::instrument(
skip_all,
fields(symbols = symbols.len(), diffs = diffs.len(), files = changes.files.len())
)]
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

#[tracing::instrument] requires the tracing crate to be compiled with the attributes feature (or an explicit tracing-attributes setup). In the current branch Cargo.toml has tracing = "0.1" without features, so these new attributes will fail to compile with "cannot find attribute instrument in crate tracing". Please enable tracing's attributes feature (preferred) or otherwise add the required proc-macro dependency/configuration.

Suggested change
#[tracing::instrument(
skip_all,
fields(symbols = symbols.len(), diffs = diffs.len(), files = changes.files.len())
)]

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit Codebase audit cleanup (issue #3)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants