docs(observed): correct example and benchmark commentary - #711
docs(observed): correct example and benchmark commentary#711Evgenii (Vaiz) wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #711 +/- ##
=======================================
Coverage 100.0% 100.0%
=======================================
Files 563 563
Lines 61068 61068
=======================================
Hits 61068 61068
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
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>
6711564 to
47edf20
Compare
🤖 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.rssaid each processor decides acceptance inprocess(). The decision isis_interested(), taken before the event is built;process()receives an accepted delivery.sink_pipeline.rssaid processors receive pre-redacted events. Each processor applies its own redactor lazily, as it extracts the values it exports.event_type_matching.rssaid the processor accepts names starting withhttp.. It holds an allowlist and compares exact names.layered_app/db.rssaid 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.rshad the same two problems and used the undefined term "lib processor".event_routing.rscalled theHttpErrormetric anUpDownCounter; it is declared as a counter.enrichments.rsreferred to a span; the enclosing scope is an enrichment, not a span.tokio_multithread.rsclaimed 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
log_4_fields, a baseline that does not exist.Effects
Validation
just anvil-fmt,just anvil-clippy,cargo +1.96.1 build --examples, andcargo +1.96.1 check --benchesall pass.Work items
Closes ADO 7757579, 7757580, 7757581, 7757586, 7757587, 7757588, 7757589, 7757591, 7757592, 7757598, 7757600 (feature 7757535).