Skip to content

docs(observed): correct example and benchmark commentary - #711

Open
Evgenii (Vaiz) wants to merge 1 commit into
mainfrom
u/vaiz/2026/08/28/observed-examples-comments
Open

docs(observed): correct example and benchmark commentary#711
Evgenii (Vaiz) wants to merge 1 commit into
mainfrom
u/vaiz/2026/08/28/observed-examples-comments

Conversation

@Vaiz

Copy link
Copy Markdown
Contributor

🤖 Clawpilot here! Posted automatically by Clawpilot (an AI agent), not by a human. Please verify before acting.

Problem

Example programs and the benchmark suite carry comments that describe behavior the surrounding code does not have. Examples are read as specification, so a wrong comment next to correct code teaches the wrong model. Benchmark comments additionally state conclusions the measurements cannot support.

What changes

Comments and module documentation only. No code, no benchmark identifiers, no measured behavior.

Examples

  • event_routing.rs said each processor decides acceptance in process(). The decision is is_interested(), taken before the event is built; process() receives an accepted delivery.
  • sink_pipeline.rs said processors receive pre-redacted events. Each processor applies its own redactor lazily, as it extracts the values it exports.
  • event_type_matching.rs said the processor accepts names starting with http.. It holds an allowlist and compares exact names.
  • layered_app/db.rs said events go to the DB sink only. They go through a composite and reach both the application and DB leaves; the DB leaf is isolated, so only targeted entries reach it. layered_app/token_issuer.rs had the same two problems and used the undefined term "lib processor".
  • event_routing.rs called the HttpError metric an UpDownCounter; it is declared as a counter.
  • enrichments.rs referred to a span; the enclosing scope is an enrichment, not a span.
  • tokio_multithread.rs claimed it verifies that enrichment survives cross-thread migration. It yields to allow migration but never asserts one happened. It now claims only what it demonstrates.

Benchmarks

  • The metric-descriptor case claimed isolation by comparison against log_4_fields, a baseline that does not exist.
  • The redaction case claimed it measures exactly the redaction allocations; it measures the whole emit pipeline, including log-record creation and exporter work.
  • The enrichment-depth case derived a per-level marginal cost and a pooling breakeven from two endpoints, with no pooled alternative measured.

Effects

  • Examples describe the routing, redaction and enrichment model the runtime implements.
  • Benchmark comments state what is measured instead of conclusions the data does not support.
  • No behavior, output, timing or benchmark identifier changes.

Validation

just anvil-fmt, just anvil-clippy, cargo +1.96.1 build --examples, and cargo +1.96.1 check --benches all pass.

Work items

Closes ADO 7757579, 7757580, 7757581, 7757586, 7757587, 7757588, 7757589, 7757591, 7757592, 7757598, 7757600 (feature 7757535).

Copilot AI lite review requested due to automatic review settings August 28, 2026 14:27

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 updates Rustdoc and inline commentary in the observed crate’s examples and benchmark suite to accurately describe the runtime’s actual routing, enrichment, redaction, and measurement semantics—treating examples/bench docs as specification-quality guidance.

Changes:

  • Corrects example documentation to match actual EventProcessor::is_interested()/process() routing behavior, composite sink fan-out, and enrichment scoping.
  • Clarifies redaction behavior as processor-local and applied during field/enrichment extraction rather than pre-redaction.
  • Rewords benchmark comments to describe what is actually measured, avoiding unsupported causal/per-component claims.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/observed/examples/tokio_multithread.rs Reframes the example as a demonstration and avoids claiming cross-thread migration is asserted.
crates/observed/examples/sink_pipeline.rs Corrects sink/processor redaction commentary to reflect per-processor, extraction-time behavior.
crates/observed/examples/layered_app/token_issuer.rs Updates module docs to describe composite fan-out and isolated leaf enrichment visibility.
crates/observed/examples/layered_app/db.rs Updates module docs and a key emit-site comment to describe composite fan-out and isolated leaf enrichment behavior.
crates/observed/examples/event_type_matching.rs Corrects the comment to reflect exact-name allowlisting rather than prefix matching.
crates/observed/examples/event_routing.rs Corrects routing commentary to reflect is_interested() gating and corrects the metric instrument description for HttpError.
crates/observed/examples/enrichments.rs Fixes terminology to describe nested enrichment scopes rather than a “span”.
crates/observed/benches/observed_benchmarks.rs Rewords benchmark docs to avoid overstating isolation or attributing costs beyond what the benchmark measures.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (356dc63) to head (47edf20).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #711   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files         563      563           
  Lines       61068    61068           
=======================================
  Hits        61068    61068           
Flag Coverage Δ
linux 64.2% <ø> (?)
linux-arm 67.8% <ø> (?)
windows 68.6% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

⚠️ Potential breaking changes detected

cargo semver-checks flagged the following on this PR. This is informational -- breaking changes between commits are expected; the major-version bump happens at release time, not on every PR.

observed

     Cloning origin/main
    Building observed v0.25.0 (current)
       Built [   5.463s] (current)
     Parsing observed v0.25.0 (current)
error: unsupported rustdoc format v60 for file: /home/runner/work/oxidizer/oxidizer/target/semver-checks/local-observed-0_25_0-default-d7b8c5ec6ce39049/target/doc/observed.json
(supported formats are v55, v56, v57)

observed_testing

     Cloning origin/main
    Building observed_testing v0.0.0 (current)
       Built [   5.931s] (current)
     Parsing observed_testing v0.0.0 (current)
error: unsupported rustdoc format v60 for file: /home/runner/work/oxidizer/oxidizer/target/semver-checks/local-observed_testing-0_0_0-default-01666ec060466c14/target/doc/observed_testing.json
(supported formats are v55, v56, v57)

observed_utils

     Cloning origin/main
    Building observed_utils v0.2.0 (current)
       Built [   5.867s] (current)
     Parsing observed_utils v0.2.0 (current)
error: unsupported rustdoc format v60 for file: /home/runner/work/oxidizer/oxidizer/target/semver-checks/local-observed_utils-0_2_0-default-01666ec060466c14/target/doc/observed_utils.json
(supported formats are v55, v56, v57)

@Vaiz
Evgenii (Vaiz) marked this pull request as draft August 28, 2026 14:50
Align example module docs and inline comments with what the code does:
- routing decisions happen in is_interested(), not process()
- redaction is lazy and applied by each processor while extracting values
- layered_app events fan out through composites; the library leaves are
  isolated and see only targeted enrichments
- the name-routing example matches exact names, not a "http." prefix
- HttpError declares a Counter, not an UpDownCounter
- the Tokio example demonstrates enrichment across polls; it does not
  assert that a thread migration occurred

Drop benchmark claims the scenarios do not support: a nonexistent
log_4_fields baseline, redaction measured in isolation, and a pooling
breakeven derived from two depth endpoints.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Vaiz
Evgenii (Vaiz) force-pushed the u/vaiz/2026/08/28/observed-examples-comments branch from 6711564 to 47edf20 Compare August 28, 2026 15:04
@Vaiz
Evgenii (Vaiz) marked this pull request as ready for review August 28, 2026 16:01
Copilot AI review requested due to automatic review settings August 28, 2026 16:01

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

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.

2 participants