← Back to Pull requests

perfdash: implement Phase 2 Thanos TSDB block writer and query backend #4388

Open
unknown opened this pull request with 184 lines diff across 2 files
View on GitHub
unknown unknown commented on Sep 23, 2026 21:33 UTC
Author

Replaces PerfDash's in-memory metric store with local Thanos TSDB blocks and serves the existing PerfDash HTTP APIs from Thanos Query, cutting steady-state memory usage from ~40 GiB to ~2 GiB while preparing the backend for Grafana dashboards.

Main design decisions:

  • Keep Prow discovery and GCS parsing in PerfDash: PerfDash continues discovering jobs from Prow configs and parsing GCS build artifacts on its sync loop, but writes each build to disk as a TSDB block instead of holding all build maps in memory.

  • Incremental ingestion, per-job compaction, and N-build retention: Already-ingested builds are tracked in block metadata (thanos.builds) so each sync only downloads new builds from GCS. After syncing a job, its blocks are compacted into a single TSDB block per job and any builds older than the configured build count (default 100) are pruned.

  • Lossless API compatibility: Metrics are stored under perfdash_metric at each build's started.json timestamp with labels for job, prow_job, category, metric, build, percentile, and unit (encoding empty label values and non-PromQL label keys), allowing /jobnames, /metriccategorynames, /metricnames, and /buildsdata to return identical JSON responses for the existing UI.

  • Sidecar deployment: Runs thanos-store and thanos-query as sidecar containers in the PerfDash pod sharing an emptyDir volume at /prometheus when --thanos-mode=true is enabled.
  • Part of #4489

    Diff: 184 lines (+138 / -46) across 2 files Reviewer: Jefftree Review duration: 46775m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.43) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 184 lines diff across 2 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%
    44%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.312
    Real PR Conversation Timeline
    1 comments
    "Review active on #4388"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.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.7% (MEDIUM) · Higher = larger blast radius
    42.7%
    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: 44.7% · Lower = rushed or shallow review
    44.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: 23.6% · Safe to merge
    23.6%