Skip to content

Use shared datadog-mock-intake crate and add standalone fake-intake binary - #1392

Draft
lucaspimentel wants to merge 2 commits into
mainfrom
lpimentel/mock-intake-consume
Draft

lucaspimentel wants to merge 2 commits into
mainfrom
lpimentel/mock-intake-consume

Conversation

@lucaspimentel

@lucaspimentel lucaspimentel commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Overview

Consumes the new datadog-mock-intake crate from DataDog/serverless-components (#174, pinned to rev 37f5b32a853f82a00523051827af074662f3e8fa):

  • The APM and DSM integration tests now use the shared crate as an ungated dev-dependency; the 317-line test-local intake fixture (tests/common/fake_intake.rs) is deleted.
  • Adds a standalone mock-intake binary behind a new mock-intake feature for local APM debugging: it runs the shared crate with request summaries, stats failure injection (MOCK_INTAKE_FAIL_STATS_FIRST_N), and JSON dumps (MOCK_INTAKE_DUMP_DIR). See bottlecap/README.md for the workflow.
  • CI clippy now compiles the mock-intake feature so the binary stays checked. Test runs are unchanged: the integration tests run in every feature set.

Stacked on serverless-components#174: this PR's dependency pins rev 37f5b32a853f82a00523051827af074662f3e8fa, the head of that PR's branch (re-pinned to its current head after the mock-intake rename commit). Merge #174 first (or re-pin if its head moves).

Supersedes #1385, which introduced the intake as a bottlecap library module; that implementation now lives in the shared crate.

Testing

  • cargo test -p bottlecap (default): 693 tests passed, 0 failed, including apm_integration_test (19) and dsm_integration_test (1), which previously ran only behind a feature flag and now run by default.
  • cargo build -p bottlecap --features mock-intake: clean. cargo clippy --workspace --all-targets across default / fips / mock-intake feature sets: no lint warnings.
  • dd-rust-license-tool check: passes (no new third-party dependencies; the crate is first-party).
  • Manual smoke: ran the mock-intake binary with failure injection and a dump directory, POSTed a gzip msgpack StatsPayload to /api/v0.2/stats: 202 Accepted, mock-intake: summary line with grouped hits and normalized aggregation key, and a JSON dump containing the decoded payload; SIGINT shutdown clean.

…inary

Replace the test-local APM intake fixture with the datadog-mock-intake
crate from serverless-components (pinned to its first published
revision). The APM and DSM integration tests use it as an ungated
dev-dependency and run in every test build; the previous fixture is
deleted.

Add a standalone fake-intake binary behind a new fake-intake feature for
local APM debugging: it runs the shared crate with request summaries,
stats failure injection (FAKE_INTAKE_FAIL_STATS_FIRST_N), and JSON dumps
(FAKE_INTAKE_DUMP_DIR). CI clippy now compiles the feature so the binary
stays checked.
@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Pipelines

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 6826b1f | Docs | View more details | Give us feedback!

The standalone binary is now mock-intake, gated by the mock-intake
feature, configured with MOCK_INTAKE_PORT, MOCK_INTAKE_FAIL_STATS_FIRST_N,
and MOCK_INTAKE_DUMP_DIR. This aligns the binary with the
datadog-mock-intake crate it wraps, whose summaries already used the
mock-intake prefix. The mock-intake crate is now a git dependency, so
LICENSE-3rdparty.csv gains its first-party record.
@lucaspimentel lucaspimentel changed the title Use shared datadog-mock-intake crate and add standalone fake-intake binary Use shared datadog-mock-intake crate and add standalone fake-intake binary Sep 25, 2026
@lucaspimentel

Copy link
Copy Markdown
Member Author

Note to self: rename fake-intake to mock-intake

@lucaspimentel

Copy link
Copy Markdown
Member Author

@DataDog review

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

The shared intake preserves the migrated integration-test contract, and the standalone binary remains gated from production builds.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 6826b1f · @DataDog review to ask questions

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.

1 participant