Skip to content

feat(compat): add GCP inventory collection - #176

Open
nina9753 wants to merge 8 commits into
nina.rei/SVLS-9604/compat-inventory-azurefrom
nina.rei/SVLS-9604/compat-inventory-gcp
Open

nina9753 wants to merge 8 commits into
nina.rei/SVLS-9604/compat-inventory-azurefrom
nina.rei/SVLS-9604/compat-inventory-gcp

Conversation

@nina9753

Copy link
Copy Markdown
Contributor

Summary

  • add GCP Cloud Functions Gen1 identity and inventory metadata collection
  • fall back to the GCP metadata server when region or project is absent from the runtime environment
  • preserve support for newer Gen1 runtimes that expose K_SERVICE and FUNCTION_TARGET
  • detect the platform runtime and version while preserving the explicit compat-runtime handoff

Stack

  1. feat(compat): add Azure inventory payload core #175 — Azure identity and core payload
  2. GCP inventory collection (this PR)
  3. feat(compat): add serverless-compat inventory reporter (SVLS-9604) #161 — reporter, transport, and compat integration

This PR is based on #175. After this slice is approved, #161 will be rebuilt on this branch and remain the top, end-to-end-testable PR so its existing discussion and review history are preserved.

Testing

  • cargo test --package datadog-serverless-compat-inventory --locked --offline
  • cargo clippy --package datadog-serverless-compat-inventory --all-targets --locked --offline -- -D warnings
  • rustfmt --edition 2024 --check on modified Rust sources
  • git diff --check

@nina9753
nina9753 requested review from a team as code owners September 29, 2026 14:06
@nina9753
nina9753 requested review from duncanpharvey and lym953 and removed request for a team September 29, 2026 14:06
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T14:10:30.446337Z 827586b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@apiarian-datadog apiarian-datadog 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.

seems mostly reasonable, tho i'd defer to serverless-compat engineers for a final review.

Comment thread crates/datadog-serverless-compat-inventory/Cargo.toml Outdated
@nina9753
nina9753 added this pull request to stack #177 October 5, 2026 20:05
Copilot AI balanced review requested due to automatic review settings October 5, 2026 20:22
@nina9753
nina9753 force-pushed the nina.rei/SVLS-9604/compat-inventory-gcp branch from 419d66a to 577a685 Compare October 5, 2026 20:22

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.

Note

Copilot was unable to run its full agentic suite in this review.

Copilot review overview

Review effort: Lite
Findings: 2 High severity · 1 Medium severity · 1 Low severity

Open (4)
What changed in this PR

Adds GCP Cloud Functions platform detection so the serverless compat inventory reporter can emit platform metadata for EnvironmentType::CloudFunction.

Changes:

  • Route EnvironmentType::CloudFunction to a new GCP collector.
  • Introduce platform/gcp.rs to derive function identity from env vars and (optionally) the GCP metadata server.
  • Add new dependencies for HTTP metadata access and async tests.
File Description
crates/​datadog-serverless-compat-inventory/​src/​platform/​mod.rs Wires CloudFunction environment type to the new GCP collector.
crates/​datadog-serverless-compat-inventory/​src/​platform/​gcp.rs Implements GCP Cloud Functions identity + metadata server lookup with unit tests.
crates/​datadog-serverless-compat-inventory/​Cargo.toml Adds reqwest, tokio, tracing, and httpmock needed by the new collector/tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/inventory/Cargo.toml
Comment thread crates/datadog-serverless-compat-inventory/Cargo.toml Outdated
Comment thread crates/datadog-serverless-compat-inventory/src/platform/gcp.rs
Comment thread crates/datadog-serverless-compat-inventory/src/platform/gcp.rs Outdated
@nina9753
nina9753 force-pushed the nina.rei/SVLS-9604/compat-inventory-gcp branch from 50c2380 to ea6b41d Compare October 6, 2026 15:58
Comment thread crates/datadog-serverless-compat-inventory/src/lib.rs Outdated
Comment thread crates/datadog-serverless-compat-inventory/Cargo.toml Outdated
Comment thread crates/inventory/src/platform/gcp.rs
@nina9753
nina9753 force-pushed the nina.rei/SVLS-9604/compat-inventory-gcp branch from ea6b41d to ca31815 Compare October 6, 2026 23:29
@nina9753
nina9753 force-pushed the nina.rei/SVLS-9604/compat-inventory-gcp branch from ca31815 to 534e066 Compare October 8, 2026 02:40

This branch has not been deployed

No deployments
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.

5 participants