Skip to content

feat(watch/discord): surface PVC, Pod, Container, Scope in embed#108

Open
pszymkowiak wants to merge 12 commits into
developfrom
feat/discord-embed-extra-identity
Open

feat(watch/discord): surface PVC, Pod, Container, Scope in embed#108
pszymkowiak wants to merge 12 commits into
developfrom
feat/discord-embed-extra-identity

Conversation

@pszymkowiak
Copy link
Copy Markdown
Contributor

Why

Rust probes (disk_usage, pod_resource, tls_certs, …) emit flat objects with sibling identity fields (pvc_name, pod, kind, fs_kind) that the current Discord embed silently dropped. Operators receiving an alert saw something like:

❗ rust-probe-disk-usage — Disk usage below 85%
Target: k8s-cluster
Object type: disk_usage
Severity: ERROR
Node: pool01-c-lsn6d-4n2vl
Conditions failed: • used_pct INF 85 but got 88.87

…with no indication of which volume or pod was full. The node had two filesystems and several PVCs — operators had to open the dashboard to find that the offender was kxn-metrics/data-kxn-pg-postgresql-0.

What

Extract the common identity fields when they exist on the violation object and render them as dedicated inline fields:

  • PVC — from pvc_name
  • Pod — from pod or pod_name
  • Container — from container or container_name
  • Scope — from kind (+ fs_kind if present), e.g. node/root, node/image, pvc

Each is deduped against Resource to avoid printing the same value twice when only one identity field is set.

After

❗ rust-probe-disk-usage — Disk usage below 85%
Target: k8s-cluster · Object type: disk_usage · Severity: ERROR
Resource: kxn-metrics/data-kxn-pg-postgresql-0
Node: pool01-c-lsn6d-4n2vl · Pod: kxn-pg-postgresql-0 · Scope: pvc
Conditions failed: • used_pct INF 85 but got 88.87

Backwards compatible — when none of those fields exist (CIS rules on Deployments etc.) the embed is unchanged.

Test

cargo check -p kxn-cli passes. Manual smoke planned by deploying the rebuilt binary into a cluster running disk_usage and watching a real alert (the cluster that prompted this PR is at 88.79% on a PVC).

pszymkowiak and others added 12 commits May 4, 2026 09:48
release: develop → main (k8s log streaming feature)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
release: develop → main (Docker build matrix native)
release: develop → main (prometheus_scrape provider)
release: develop -> main (richer Discord embed)
release: develop -> main (Pod unknown fix)
release: rich Discord embed
chore: sync develop into main (k8s monitoring stack — full Rust observability)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
chore: sync develop into main (raw resources persist)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Rust probes (disk_usage, pod_resource, tls_certs…) emit flat objects
with sibling identity fields (pvc_name, pod, kind, fs_kind) that the
previous embed silently dropped — operators then saw an alert with
just `Node: foo` and no idea which volume or pod was the offender.

Extract the common identity fields and render them as dedicated
inline fields, deduplicating against `Resource` to avoid printing
the same value twice. Adds a `Scope` field that combines `kind` and
`fs_kind` for disk_usage rows so `node/root` vs `pvc` is unambiguous.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pszymkowiak pszymkowiak changed the base branch from main to develop May 13, 2026 14:35
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.

1 participant