← Back to Pull requests

fix(apm): require tracer clients on /v0.7/config #56800

Open
unknown opened this pull request with 215 lines diff across 2 files
View on GitHub
unknown unknown commented on Sep 23, 2026 10:07 UTC
Author

What does this PR do?

Reject Trace Agent /v0.7/config requests with HTTP 400 unless client.is_tracer is true. The check runs before tracer normalization, container-tag lookup, and forwarding to the core Agent. Missing or null clients are rejected safely, and rejected requests are counted with status_code:400.

Motivation

Prevent non-tracer clients, including Agent and updater clients, from using the tracer remote configuration endpoint.

Describe how you validated your changes

  • Added HTTP regression tests for missing/null clients, a missing or false tracer flag, tracer metadata without the flag, Agent clients, updater clients, and combined Agent/updater clients. These assert HTTP 400 and no upstream config-fetch call.

  • Retained coverage for successful tracer requests, normalization, container tags, and upstream error handling.

  • Added service-validation tests for all eight combinations of is_tracer, is_agent, and is_updater.

  • Passed both package suites with the race detector: dda inv test --targets=./cmd/trace-agent/config/remote,./pkg/config/remote/service --build-exclude=python --race --no-cache.

  • Passed targeted Go lint with zero issues: dda inv linter.go --targets=./cmd/trace-agent/config/remote,./pkg/config/remote/service --build-exclude=python.

  • git diff --check passed.
  • Additional Notes

    The core remote-config service already requires exactly one of is_tracer, is_agent, and is_updater. Verified that /v0.7/config forwards through serverSecure.ClientGetConfigs to CoreAgentService.ClientGetConfigs, which invokes validateRequest before registering clients or fetching configurations. The existing service validation remains unchanged.

    Diff: 215 lines (+161 / -54) across 2 files Reviewer: ichinaski Review duration: 33731m
    All Vouch review confidence checks passed
    Residual risk 0.32 = Change Risk (0.60) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.60 · 215 lines diff across 2 files
    0.60
    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
    Sensitive Paths sensitive_paths
    0.060
    Real PR Conversation Timeline
    1 comments
    "Review active on #56800"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed sensitive_module
    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: 59.8% (MEDIUM) · Higher = larger blast radius
    59.8%
    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: 31.9% · Safe to merge
    31.9%