docs(observed): add event sampling example - #731
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aa28f79b-7be9-49b1-9b96-361080fad46c
There was a problem hiding this comment.
🟡 Changes recommended
The Unreleased changelog entry is misleading relative to the PR (it describes an API “initial release” rather than the added/moved documentation/example).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR improves observed’s documentation around per-Sink event sampling by moving the inline sampler example out of API docs into a dedicated runnable example, and updating crate-level docs/README to mention the feature.
Changes:
- Removed the long inline
with_event_sampler/sampling module doctest examples and replaced them with a link to a newevent_samplingexample. - Added a new runnable example
crates/observed/examples/event_sampling.rsdemonstratingEventSamplerusage. - Added an Unreleased changelog entry (currently worded as an API “initial release”).
File summaries
| File | Description |
|---|---|
| crates/observed/src/sink/core.rs | Replaces the inline sampler example with a shorter “Sharing” explanation for sampler configuration across clones. |
| crates/observed/src/sampling/mod.rs | Removes module-level doctest example and links to the new event_sampling example from EventSampler docs. |
| crates/observed/src/lib.rs | Mentions per-Sink event sampling in the crate feature list. |
| crates/observed/README.md | Regenerated README to include the new sampling bullet and updated reference links. |
| crates/observed/examples/event_sampling.rs | Adds a dedicated runnable example showing event sampling while preserving borrowed event data. |
| crates/observed/CHANGELOG.md | Adds an Unreleased entry related to event sampling (needs rewording to match PR scope). |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
💡 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 #731 +/- ##
=======================================
Coverage 100.0% 100.0%
=======================================
Files 583 583
Lines 62891 62891
=======================================
Hits 62891 62891
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:
|
a312e8b
into
microsoft:main
Uh oh!
There was an error while loading. Please reload this page.