← Back to Pull requests

Cap METRICS_INFO and TS_INFO time range to 1d by default #168214

Open
unknown opened this pull request with 216 lines diff across 2 files
View on GitHub
unknown unknown commented on Dec 01, 2026 16:53 UTC
Author

METRICS_INFO and TS_INFO read every time series in their time range, which is slow over a wide range or with no range at all. #164036 added esql.query.metrics_info_max_time_range to cap that range, off by default. This turns it on with a default of 1d.

Behavior

  • The requested time range is the one of a WHERE on @timestamp ahead of the command (#168371) and of the request filter, or what both allow if the request has both. A range [t1, t2] reads [max(t1, t2 - 1d), t2]. A range of a day or less is read in full, however far back it is.

  • Without one, the commands read [now - 1d, now]. A range with no end, or one that ends later than now, is capped from now.

  • When the range is narrowed, the response has the warning METRICS_INFO and TS_INFO are limited to the most recent [1d].

  • -1 removes the cap. The setting stays dynamic.
  • Prometheus endpoints

    The series, label names, label values and metadata endpoints build TS | WHERE @timestamp ... | TS_INFO/METRICS_INFO plans with the range from start and end. Since #168371 the cap reads that range from the WHERE, so these endpoints need no change here:

  • start and end up to a day apart, including the default of a day before end, are read in full, however far back they are.

  • A wider range reads its most recent day. This affects series, label names, and label values for __name__ (other label values don't use an info command). The narrowing is reported in the warnings array of the Prometheus response body and in a Warning HTTP header, for example series are limited to the most recent [1d] of the time range.

  • The metadata endpoint looks back 24 hours, so it only changes if the setting is lowered below that.
  • Diff: 216 lines (+162 / -54) across 2 files Reviewer: kosabogi Review duration: 2570m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 216 lines diff across 2 files
    0.37
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.322
    Real PR Conversation Timeline
    1 comments
    "Review active on #168214"
    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: 36.6% (MEDIUM) · Higher = larger blast radius
    36.6%
    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: 19.5% · Safe to merge
    19.5%