Skip to content

patterndetectorprocessor: promote operator-facing scalar attrs onto verdict records #270

Description

@trilamsr

Problem

PR #264 (Grafana dashboard) review found that 4 of 7 dashboard panels render empty against current patterndetectorprocessor output. Verdict log records carry only:

  • pattern.id
  • pattern.headline
  • pattern.remediation
  • pattern.verdict_json (the full marshalled verdict)
  • pattern.confidence (pod_evicted only)

Operator-facing fields are buried INSIDE pattern.verdict_json (e.g. Regarding.Name, HangingRanks, EvictedPod). Dashboards can't table-aggregate by pod/node/collective without server-side JSON parsing — fragile.

Proposed fix

Promote operator-facing scalar fields to top-level OTLP log-record attributes in appendVerdict / appendNCCLHangVerdict / appendXidCorrelationVerdict:

Each detector already has these values in its verdict struct; just PutStr them onto the log record alongside the existing VerdictAttr* calls. Constant naming: VerdictAttrK8sPodName etc. — extend the existing taxonomy in patterndetector.go:25-44.

Acceptance

  • LogQL queries on {cluster=~"...", pattern_id="14"} | json reach the scalar attrs at top level (no | line_format JSON parse).
  • Dashboard PR feat(dashboards): grafana JSON for pattern verdicts #264 panels 2/3/4/5 render populated tables on fixture input.
  • pattern.verdict_json REMAINS — it's the canonical full payload for advanced operators.
  • New verdict-shape regression tests pin the attribute set.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions