Skip to content

Conversation

@scottopell
Copy link
Contributor

PR by Bits
View Dev Agent Session

You can ask for changes by mentioning @DataDog in a comment.

Feedback (especially what can be better) welcome in #code-gen-feedback!


What does this PR do?

  • add a dedicated lading_observer workspace crate containing the observer logic
  • update the lading crate to depend on and re-export lading_observer, removing the old in-crate observer modules
  • adjust workspace dependencies and paths for the observer components and associated test artifacts

Motivation

Align observer functionality with other shared crates and isolate the logic for reuse and maintenance.

Related issues

None.

Additional Notes

cargo fmt could not run here because the toolchain download requires network access in this environment.

@datadog-datadog-prod-us1
Copy link

Bits AI Dev Agent Status: ✅ Done [Fix CI Errors] [View Dev Agent Session]

You can ask for changes by mentioning @DataDog in a comment.

- Move num_cpus to workspace dependencies (used by lading and lading_observer)
- Add proptest dev dependency for tests
- Add missing readme metadata to satisfy clippy::cargo lints
- Add README.md with usage documentation

All lading_observer tests now pass (27/28, 1 permission-related skip).

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Copy link
Contributor Author

scottopell commented Jan 14, 2026

…ption

Make linux, cgroup, procfs modules and key functions public to allow
external crates like fgm-observer to use the polling APIs directly
without going through the Server interface.

Public API changes:
- linux module (lib.rs)
- cgroup, procfs modules (linux.rs)
- v2 module (cgroup.rs)
- memory module (procfs.rs)
- smaps_rollup module (procfs/memory.rs)
- poll function (cgroup/v2.rs)
Make Aggregator struct, poll function, and Error enum public in smaps_rollup
module to allow external crates to use memory sampling functionality.
…dencies

Convert workspace dependencies to explicit version specifications to improve
compatibility with cargo-bazel which has limitations resolving workspace members
from git dependencies. This allows the crates to be used via git dependency
without requiring workspace resolution.
Exclude these crates from workspace to enable standalone consumption via
git dependencies. This fixes cargo-bazel compatibility issues where workspace
member resolution from git dependencies fails.
…gnal)

cargo-bazel may expect directory names to match package names exactly.
Testing if this naming convention helps with package resolution.
Restores workspace membership and workspace dependencies. This should help
cargo-bazel locate the packages within the git repository structure.
Update lading and lading-capture to reference lading-observer and
lading-signal with hyphens instead of underscores, matching the
actual directory names after rename.
Move workspace Cargo.toml to Cargo.toml.workspace and create a root-level
Cargo.toml that defines lading-observer as a standalone package. This allows
cargo-bazel to find the package immediately when cloning the repository,
without needing to search through workspace members.

Changes:
- Root Cargo.toml now defines lading-observer package with explicit paths
- lading-signal converted to explicit dependency versions (no workspace)
- Workspace configuration preserved in Cargo.toml.workspace
- Package sources remain in lading-observer/ subdirectory
Bazel's cargo (1.83.0) doesn't support edition2024 yet, which is still
unstable. Downgrade all crates to edition2021 to ensure compatibility
with cargo-bazel.
All Cargo.toml files now use edition = "2024" to match the upgraded
Rust 1.92.0 toolchain in the datadog-agent repository.

This checkpoint represents the working state:
- Root-level lading-observer package structure (cargo-bazel compatible)
- Edition 2024 throughout
- Stable Rust features (no nightly required)
- Successfully builds with Bazel + Rust 1.92.0

Status: Ready for git dependency testing
@scottopell scottopell closed this Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants