Repository navigation
feat: enrich file events with opt-in CRI image identity - #2112
Open
robbycochran wants to merge 2 commits into
Open
robbycochran wants to merge 2 commits into
robbycochran wants to merge 2 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2112 +/- ##
==========================================
+ Coverage 33.45% 33.54% +0.09%
==========================================
Files 22 22
Lines 3623 3634 +11
Branches 3623 3634 +11
==========================================
+ Hits 1212 1219 +7
- Misses 2402 2406 +4
Partials 9 9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Enrich Fact file events with an optional
process.container_imagein JSON and OTEL output. One CRI v1ContainerStatuscall suppliesimage_id, falling back toimage_refwhen the ID is empty. Values are preserved as returned by the runtime; an image ID need not be a pullable reference. No second RPC or verbose runtime-specific parsing is needed.Enable with the non-default
runtime-metadataCargo feature and an absoluteFACT_CRI_SOCKETpath visible to Fact. Debug logging is not required. Local standard/OTEL image builds enable the feature; Konflux release builds exclude it.The isolated feature module owns its Unix connection, background worker, and bounded image cache. The output pipeline makes one enrichment call before broadcasting each event. Cache misses schedule work and leave the image field absent; later events use the cached image. Event delivery never waits for a runtime RPC. Requests have a one-second deadline, a 128-ID queue, and a 1,024-entry cache. Pending, successful, and failed entries expire after 30 seconds; later events can request refreshes.
Replay preserves recorded image metadata without querying the runtime. Existing abbreviated container IDs and Sensor protobuf output are unchanged. The full ID is retained privately only to address and validate the CRI lookup.
Follow-up PRs
ContainerStatusresponse.This PR decodes only the response ID and image ID/reference. It does not collect container names, lifecycle state, timestamps, mounts, labels, or verbose info.
Checklist
Automated testing
Testing Performed
Passed locally in a Linux arm64 container:
cargo test --lib: 116 testscargo test --features runtime-metadata --lib: 124 testscargo test --features otel --lib: 116 testscargo test --features otel,runtime-metadata --lib: 124 testscargo check --no-default-featurescargo clippy --all-targets --all-features -- -D warningscargo fmt --all --checkandgit diff --checkLive CRI-O/containerd node validation has not been performed. Tests exercise the gRPC transport using a fake runtime.
Summary by CodeRabbit
runtime-metadatafeature.