feat(event-ledger): instance-summary API joining Pod + ICMS lanes - #1119
Open
shobham-nv wants to merge 2 commits into
Open
feat(event-ledger): instance-summary API joining Pod + ICMS lanes#1119shobham-nv wants to merge 2 commits into
shobham-nv wants to merge 2 commits into
Conversation
Form the canonical event context based on object kind so ICMSRequest rows stay distinct from Pod rows. Kind is inferred from the presence of icms_request_id (or an explicit k8s.object.kind), requiring no collector changes. Pod context is unchanged, and icms_request_id remains in details for Pod events. - Add config-driven kind->context-fields map with built-in defaults (Pod: cluster_id, deployment_id, gpu_specification_id, instance_id; ICMSRequest: cluster_id, icms_request_id, instance_id). - Make eventContextToCanonical field-list driven and kind-aware. - Extend GetEventsV3 to accept an icms_request_id query param. - Guard stats_v3 upserts so older, out-of-order events cannot overwrite a newer latest-per-context row (single LWT and bulk paths). - Unit tests for kind inference, kind-aware context, and config merge. Part of epic #809. Signed-off-by: shobham <shobham@nvidia.com>
Add a read-only GET /v3/ledger/namespace/{namespace}/instance-summary
endpoint that joins the ICMSRequest lane (outcome) and the Pod lane
(pod_events) on icms_request_id in a single call. Ingest is unchanged and
/stats and /events are untouched.
The join is performed on read within a namespace: stats_v3 lists every
context, the ICMSRequest lane carries icms_request_id in its context, and
Pod-lane events carry icms_request_id in details.attributes. This works for
container and helm (MiniService grain) functions.
- Add InstanceSummaryResponse/InstanceOutcome/InstanceSummaryEvent DTOs.
- Add parseCanonicalContext (inverse of eventContextToCanonical) and helpers.
- Register the route behind the existing read scopes and tenant auth.
- Unit tests: lane join + correlation filtering, required join key, no-data.
Part of epic #809.
Signed-off-by: shobham <shobham@nvidia.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
shobham-nv
changed the base branch from
shobham/815-fnds-kind-aware-context
to
main
August 24, 2026 17:08
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.
Summary
Implements #816 (part of epic #809). Adds a read-only endpoint that joins the ICMSRequest lane and the Pod lane on
icms_request_idin a single call, without changing ingest./statsand/eventsare unchanged.GET /v3/ledger/namespace/{namespace}/instance-summary?icms_request_id=<id>Returns
outcome(the ICMSRequest-lane summary: latest event + full history) andpod_events(Pod-lane events correlated onicms_request_id).How the join works
events_v3can only be queried by(namespace, context), and Pod events carryicms_request_idonly indetails.attributes. So the join is done on read within a namespace:GetStatsV3(namespace)lists every context (one partition read).icms_request_id=<id>are the ICMSRequest lane → folded intooutcome(latest event wins).details.attributes.icms_request_id == <id>→pod_events.Works for container and helm (MiniService grain), since both Pod lanes stamp
icms_request_idinto details.Notes
GetStatsV3/GetEventsV3, so theDBHandlerV2interface is unchanged./statsand/events.shobham/815-fnds-kind-aware-context) since it depends on the ICMSRequest context shape. Base this PR accordingly; retarget tomainonce feat(event-ledger): kind-aware context for Pod vs ICMSRequest #1117 merges.GetEventsV3per context in the namespace (bounded by namespace cardinality; kept sequential for clarity).Test plan
go build ./...go vet ./cmd/...gofmtcleango test ./cmd/api/service/...— new: lane join + correlation filtering (excludes unrelatedicms_request_id), required join key returns 400, empty namespace returns nil outcome / no pod eventsCloses #816