← Back to Pull requests

feat(collectors): opt-in HTTP endpoint probes with bundled alerts #72

Closed
unknown closed this pull request without merging on Nov 17, 2026 15:25 UTC
View on GitHub
unknown unknown commented on Nov 17, 2026 15:16 UTC
Author

Why

A gateway can refuse every connection while all of its pods stay Running, for example when its Envoy starts without listeners. No alert fires today. up only proves that each pod's /metrics answers when scraped directly by pod IP. Nothing checks the path a real caller takes: DNS → load-balancer VIP → proxy listener → route → backend.

What

The cluster collector can now probe a list of URLs, opt-in, using the http_check receiver, and the chart ships alert rules for it.

collectors:
  cluster:
    httpcheck:
      enabled: true            # default false
      collectionInterval: 30s
      timeout: 10s             # filled in on targets that set none
      targets:
        - endpoint: https://registry.example.com/api/ping
          method: GET

  • Receiver. It ships in otelcol-k8s at the pinned operator's collector version, 0.162.0 (checked in the distribution's manifest.yaml). At that version the component type is http_check; httpcheck is a deprecated alias. It is added to the cluster collector's metrics pipeline. That collector is a single replica, so each URL is checked once per interval. Targets are passed through verbatim (headers, tls, proxy_url, validations, …). The schema only requires endpoint or endpoints.

  • Gating. Nothing renders unless the feature is enabled and targets is non-empty. The receiver and the rule pack share one helper, lgtm.httpcheck.enabled.

  • Rule pack alerts/httpcheck.yaml. It is gated in alerting.yaml and can be dropped with lgtm.alerting.exclude: [httpcheck].

  • - HTTP endpoint unreachable (critical, for: 2m): no HTTP response at all, i.e. connection refused, timeout, TLS or DNS failure. Any status, 401/403 included, counts as reachable. The annotation names the URL and error.message.
    - HTTP endpoint returning server errors (warning, for: 5m): a 5xx. The annotation names the URL and the status code.
    - Both rules compare sample timestamps: is the newest error/5xx sample as new as the newest check? OTLP-ingested series carry no staleness markers, so a rule that read values would keep seeing the last error=1 for the whole 5m lookback after recovery. The timestamp comparison clears on the next good check. Both rules use gt 0, quote the dotted names, and set noDataState: OK.
  • Docs.

  • - A README section, "HTTP endpoint probes", covers what reachable means and the in-cluster vantage point. The probe cannot see failures only on the outside path, and kube-proxy/Cilium route in-cluster traffic for a LoadBalancer IP straight to its endpoints. It also covers egress: neither the chart's NetworkPolicy nor the operator's restricts collector egress, since both are ingress-only. Under default-deny, consumers need their own rule. Because policy is evaluated after the Service DNAT, it must allow the gateway pods, not an ipBlock of the VIP. The section includes an example policy.
    - ADR-0020, plus the values comments.
  • Example, validation and CI.

  • - New examples/values-httpcheck.yaml, which the existing example render loops pick up.
    - validate_alerts.py now renders with that overlay, so the opt-in pack gets the uid, refId and dotted-label checks.
    - A new CI step asserts the gating both ways, the per-target timeout merge, exclude, and that the schema rejects a target without an endpoint.
  • Chart 0.39.0 → 0.40.0.
  • Verification

  • Feature off, render unchanged. helm template output is identical to main's for the defaults, collectors.enabled=false, every existing example, and httpcheck.enabled=true with no targets. Only the randomly generated passwords and certs differ, as they do between any two renders.

  • Lint and template. ct lint (chart-testing v3.14.0) passes on the defaults and with --helm-lint-extra-args "-f examples/values-httpcheck.yaml". helm lint, make template, validate_alerts.py (27 rules), validate_dashboards.py, kubeconform (default, httpcheck, mtls) and make docs-validate all pass.

  • Collector config. The rendered http_check config passes validate on opentelemetry-collector-k8s:0.162.0.

  • End to end in Docker. The collector at 0.162.0 exported to Prometheus v3.16 with NoTranslation and type-and-unit-labels, probing nginx targets:

  • - metric and label names as documented (httpcheck.status, httpcheck.error, httpcheck.duration, http.url, http.status_class, http.status_code, error.message);
    - a 403 target fires nothing;
    - a 503 target fires only the server-errors rule;
    - a stopped host fires only the unreachable rule (… no such host), while its stale 2xx=1 series was still visible;
    - after the host came back, the unreachable rule went empty on the next check while the stale error series was still in the lookback.

    🤖 Generated with Claude Code

    Diff: 612 lines (+459 / -153) across 7 files Reviewer: claude[bot] Review duration: 8m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.50) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 612 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 56% · Reviewer familiarity: 35%
    45%
    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.384
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #72"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 45% 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: 50.2% (MEDIUM) · Higher = larger blast radius
    50.2%
    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: 45% · Lower = rushed or shallow review
    45%
    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: 27.6% · Safe to merge
    27.6%