← Back to Pull requests

NETOBSERV-3063: add FlowCapture API and shared capture package #2993

Open
unknown opened this pull request with 355 lines diff across 4 files
View on GitHub
unknown unknown commented on Oct 23, 2026 14:44 UTC
Author

Summary

Add the operator-side FlowCapture v1alpha1 API and shared Go capture package used by the CLI.

  • Support flow, packet, and metrics captures with duration/byte limits, filters, features, node/interface selection, lifecycle status, and output retrieval.

  • Run uniquely named agent DaemonSets in the operator-managed privileged namespace, including parallel captures and cleanup.

  • Keep managed collector pods and output available for copying after completion.

  • Support TLS plaintext packet capture end to end: configure agent uprobes and pass enable_openssl to the collector so decoded records are persisted in output/plaintext/.jsonl.

  • Provide the public github.com/netobserv/netobserv-operator/pkg/capture package, including a streaming JSON-array writer for reusable flow serialization.

  • Add one shared NetObserv / FlowCaptures dashboard with FlowCapture-labelled metrics, ServiceMonitors, Prometheus discovery RBAC, namespace monitoring, and one-active-metrics-capture protection.

  • Add typed builders for agents, collectors, pipelines, TLS, subnets, monitoring resources, and dashboards.

  • Add API validation, CRDs, RBAC, SCCs, network policy, Helm resources, generated bundles, samples, documentation, and tests.
  • Related PRs

  • netobserv-cli#605 — Go CLI collector consuming the shared capture package and producing flow/packet output.

  • netobserv-web-console#1884 — FlowCapture UI and backend output download integration.
  • Dependency and output contract

    The CLI consumes the public shared package from this PR. Flow captures are written as streamed JSON arrays in output/flow/<timestamp>.json, with the existing SQLite .db output preserved. Packet captures remain .pcapng; decoded TLS plaintext is optional .jsonl output.

    Validation

  • go test ./...

  • OpenShift validation of flow, packet, and metrics captures, filters, features, parallel naming, TLS plaintext output, dashboard creation, Prometheus scraping, SCC authorization, and cleanup.

  • Verified a live flow capture produced a valid JSON array of flow objects and retained the SQLite output.

  • Verified a live packet capture produced decoded HTTPS records in output/plaintext/.jsonl.

  • Verified generated CRDs, API documentation, Helm manifests, samples, and both OLM bundles.
  • Checklist

  • Requires an OpenShift cluster with Prometheus Operator/cluster monitoring enabled, plus the CLI image from netobserv-cli#605.

  • Added unit and envtest coverage for the API, admission validation, resource builders, controller lifecycle, RBAC, and monitoring resources.

  • QE requirements:

  • - [x] Standard QE validation, with pre-merge tests unless stated otherwise.
    - [ ] Regression tests only.
    - [ ] No QE.

    Diff: 355 lines (+266 / -89) across 4 files Reviewer: jpinsonneau Review duration: 36031m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.43) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 355 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.351
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #2993"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.5% (MEDIUM) · Higher = larger blast radius
    42.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.7% · Safe to merge
    22.7%