Skip to content

dev-infrastructure: put resource snapshots in their own table#6028

Open
stevekuznetsov wants to merge 1 commit into
Azure:mainfrom
stevekuznetsov:skuznets/mgmt-agent-resource-table
Open

dev-infrastructure: put resource snapshots in their own table#6028
stevekuznetsov wants to merge 1 commit into
Azure:mainfrom
stevekuznetsov:skuznets/mgmt-agent-resource-table

Conversation

@stevekuznetsov

Copy link
Copy Markdown
Contributor

We would like to treat the snapshots coming out of the mgmt-agent as a separate data source, with easy-to-understand schema and performant queries. These are not pod logs, but point-in-time snapshots of the resources on our mgmt cluster.

Copilot AI review requested due to automatic review settings July 11, 2026 02:43
@openshift-ci openshift-ci Bot requested review from geoberle and mmazur July 11, 2026 02:43
@openshift-ci

openshift-ci Bot commented Jul 11, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: stevekuznetsov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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.

Pull request overview

This PR separates mgmt-agent “resource/pod snapshot” structured logs into a dedicated Kusto table (resourceSnapshots) to enable a clearer schema and more performant queries than treating them as generic container logs.

Changes:

  • Update Fluent Bit routing to tag mgmt-agent logs and split records containing an object payload into a new resource-snapshots.logs stream.
  • Add a new Kusto table definition + ingestion mapping for resourceSnapshots, and include it in the hosted control plane logs DB provisioning.
  • Ensure mgmt-agent pod snapshot objects include apiVersion/kind by explicitly setting GVK before serialization.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
observability/arobit/deploy/templates/forwarder-configmap.yaml Adds mgmt-agent log routing and a dedicated output to the new resourceSnapshots table.
mgmt-agent/pkg/controller/podwatcher.go Sets Pod TypeMeta (GVK) so serialized snapshot objects include apiVersion/kind.
dev-infrastructure/modules/logs/kusto/tables/resourceSnapshots.kql Introduces the resourceSnapshots table schema and ingestion mapping.
dev-infrastructure/modules/logs/kusto/main.bicep Wires the new table script into hosted control plane logs DB provisioning.

Comment thread observability/arobit/deploy/templates/forwarder-configmap.yaml Outdated
Name rewrite_tag
Alias filter.resource_snapshot_router
Match mgmt-agent.logs
Rule $object .+ resource-snapshots.logs true
Comment thread dev-infrastructure/modules/logs/kusto/tables/resourceSnapshots.kql Outdated
Comment thread dev-infrastructure/modules/logs/kusto/tables/resourceSnapshots.kql
Comment thread mgmt-agent/pkg/controller/podwatcher.go
@stevekuznetsov stevekuznetsov force-pushed the skuznets/mgmt-agent-resource-table branch from 717b3e6 to 1000e11 Compare July 11, 2026 03:19
Copilot AI review requested due to automatic review settings July 11, 2026 03:19

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Name rewrite_tag
Alias filter.resource_snapshot_router
Match mgmt-agent.logs
Rule $object .+ resource-snapshots.logs true
Comment on lines +22 to +28
{"column":"event","Properties":{"path":"$.log.log.event"}},
{"column":"apiVersion","Properties":{"path":"$.log.log.object.apiVersion"}},
{"column":"kind","Properties":{"path":"$.log.log.object.kind"}},
{"column":"namespace","Properties":{"path":"$.log.log.namespace"}},
{"column":"name","Properties":{"path":"$.log.log.name"}},
{"column":"uid","Properties":{"path":"$.log.log.object.metadata.uid"}},
{"column":"object","Properties":{"path":"$.log.log.object"}}
Comment on lines 159 to 163
func logPodEvent(eventType string, pod *corev1.Pod) {
pod.SetGroupVersionKind(corev1.SchemeGroupVersion.WithKind("Pod"))
klog.InfoS("pod event",
"event", eventType,
"namespace", pod.Namespace,
We would like to treat the snapshots coming out of the mgmt-agent as a
separate data source, with easy-to-understand schema and performant
queries. These are not pod logs, but point-in-time snapshots of the
resources on our mgmt cluster.

Signed-off-by: Steve Kuznetsov <stekuznetsov@microsoft.com>
Copilot AI review requested due to automatic review settings July 11, 2026 13:51
@stevekuznetsov stevekuznetsov force-pushed the skuznets/mgmt-agent-resource-table branch from 1000e11 to a981ae6 Compare July 11, 2026 13:51

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread mgmt-agent/pkg/controller/podwatcher.go
Comment thread dev-infrastructure/modules/logs/kusto/tables/resourceSnapshots.kql
@openshift-ci

openshift-ci Bot commented Jul 11, 2026

Copy link
Copy Markdown

@stevekuznetsov: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/periodic-healthcheck-images 1000e11 link true /test periodic-healthcheck-images
ci/prow/test-unit a981ae6 link true /test test-unit
ci/prow/integration a981ae6 link true /test integration
ci/prow/observability-prometheus a981ae6 link true /test observability-prometheus
ci/prow/config-change-detection a981ae6 link true /test config-change-detection
ci/prow/lint a981ae6 link true /test lint
ci/prow/verify a981ae6 link true /test verify
ci/prow/e2e-parallel a981ae6 link true /test e2e-parallel
ci/prow/image-updater-images a981ae6 link true /test image-updater-images

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants