Skip to content

refactor(lading): annotate intentional-panic observer/target sites#1900

Draft
goxberry wants to merge 1 commit into
goxberry/expect-cleanup-lading-net-generatorsfrom
goxberry/expect-cleanup-lading-observer-target
Draft

refactor(lading): annotate intentional-panic observer/target sites#1900
goxberry wants to merge 1 commit into
goxberry/expect-cleanup-lading-net-generatorsfrom
goxberry/expect-cleanup-lading-observer-target

Conversation

@goxberry
Copy link
Copy Markdown
Contributor

@goxberry goxberry commented May 23, 2026

Summary

Annotate intentional-panic .expect() sites across the observer subsystem, target launcher, target metrics scrapers, inspector, neper threading, and the captool analyzer. Reasons document the invariant (telemetry channel, cgroup ABI, paired-map structure, etc.); FIXME markers track sites that should eventually surface as Error variants.

Sites annotated:

  • `observer.rs::run` — telemetry channel invariant
  • `observer/linux/procfs.rs::{handle_process, proc_exe}` — process_info map invariant; UTF-8 exe path
  • `observer/linux/cgroup/v2/cpu.rs::poll` — cgroup v2 kernel ABI
  • `observer/linux/procfs/memory/smaps.rs::into_region_strs` — const regex
  • `target.rs::{watch_container, execute_binary}` — PID i32 conversion
  • `target_metrics/expvar.rs::run` — reqwest TLS bootstrap
  • `target_metrics/prometheus.rs::{LABEL_REGEX, parse_prometheus_metrics}` — const regex + FIXME for parser panic
  • `inspector.rs::run` — PID i32 conversion
  • `neper/thread.rs::spawn_named` — OS thread alloc
  • `bin/captool/analyze/jsonl.rs::analyze_metric` — paired-map invariant

Stacked on #1899. Part of the broader push toward enforcing clippy::expect_used = "deny" workspace-wide.

Test plan

  • `./ci/validate` passes
  • CI green on this PR

Attach fn-level #[expect(clippy::expect_used, reason = "...")] to
remaining production .expect() sites in the observer, target, target
metrics scrapers, neper thread spawning, captool analysis, and the
inspector. Tests still rely on the crate-level allow quarantine and
will be retained when PR 6 drops it.

- observer.rs::run                              (PID handshake invariant)
- observer/linux/procfs.rs::{handle_process, proc_exe}
- observer/linux/cgroup/v2/cpu.rs::poll         (cgroup v2 kernel ABI)
- observer/linux/procfs/memory/smaps.rs::into_region_strs (const regex)
- target.rs::{watch_container, execute_binary}  (PID type conversion)
- target_metrics/expvar.rs::run                 (reqwest TLS bootstrap)
- target_metrics/prometheus.rs::parse_prometheus_metrics (FIXME)
- target_metrics/prometheus.rs::LABEL_REGEX     (const regex)
- inspector.rs::run                             (PID type conversion)
- neper/thread.rs::spawn_named                  (OS thread alloc)
- bin/captool/analyze/jsonl.rs::analyze_metric  (paired-map invariant)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor Author

goxberry commented May 23, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@datadog-official
Copy link
Copy Markdown

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

Changelog Check | changelog-check   View in Datadog   GitHub Actions

🛟 This job is unlikely to succeed on retry. Please review your pipeline configuration. No changes to CHANGELOG.md detected. Add 'no-changelog' label if this is intentional.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 622f36e | Docs | Datadog PR Page | Give us feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant