Skip to content

docs(observed): add event sampling example - #731

Merged
Evgeny Fedorov (evgenyfedorov2) merged 2 commits into
microsoft:mainfrom
evgenyfedorov2:u/efedorov/observed-sampling-checkpoint
Sep 4, 2026
Merged

docs(observed): add event sampling example#731
Evgeny Fedorov (evgenyfedorov2) merged 2 commits into
microsoft:mainfrom
evgenyfedorov2:u/efedorov/observed-sampling-checkpoint

Conversation

@evgenyfedorov2

@evgenyfedorov2 Evgeny Fedorov (evgenyfedorov2) commented Sep 4, 2026

Copy link
Copy Markdown
Member
  • move the example
  • add a changelog entry

Evgenii Fedorov added 2 commits September 4, 2026 13:28
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: aa28f79b-7be9-49b1-9b96-361080fad46c
Copilot AI lite review requested due to automatic review settings September 4, 2026 12:53

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.

🟡 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 new event_sampling example.
  • Added a new runnable example crates/observed/examples/event_sampling.rs demonstrating EventSampler usage.
  • 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.

Comment thread crates/observed/CHANGELOG.md
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (40c705c) to head (7c463c0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #731   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files         583      583           
  Lines       62891    62891           
=======================================
  Hits        62891    62891           
Flag Coverage Δ
linux 68.9% <ø> (?)
linux-arm 68.9% <ø> (?)
windows 63.8% <ø> (?)

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.

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.

🟢 Approval recommended

Changes are documentation/example-focused and appear consistent with existing repository patterns for linking to examples.

Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@evgenyfedorov2
Evgeny Fedorov (evgenyfedorov2) merged commit a312e8b into microsoft:main Sep 4, 2026
51 checks passed
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.

4 participants