dev-infrastructure: put resource snapshots in their own table#6028
dev-infrastructure: put resource snapshots in their own table#6028stevekuznetsov wants to merge 1 commit into
Conversation
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
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
objectpayload into a newresource-snapshots.logsstream. - 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/kindby 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. |
| Name rewrite_tag | ||
| Alias filter.resource_snapshot_router | ||
| Match mgmt-agent.logs | ||
| Rule $object .+ resource-snapshots.logs true |
717b3e6 to
1000e11
Compare
| Name rewrite_tag | ||
| Alias filter.resource_snapshot_router | ||
| Match mgmt-agent.logs | ||
| Rule $object .+ resource-snapshots.logs true |
| {"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"}} |
| 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>
1000e11 to
a981ae6
Compare
|
@stevekuznetsov: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
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.