← Back to Pull requests

[infra-mode] resolve host tags and strip expected-tags leak #57905

Closed
unknown closed this pull request without merging on Oct 15, 2026 18:34 UTC
View on GitHub
unknown unknown commented on Oct 09, 2026 10:49 UTC
Author

What does this PR do?

Unknown or mistyped infrastructure_mode values no longer produce an infra_mode:<typo> host tag. They behave as full instead. Host tags still cover basic, none, cloud_cost_only, and end_user_device as they do today.

The end-user-device mode mark and the related hardware host tags are built separately, but host metadata still emits both.

During the expected-tags window, infra_mode is no longer copied from host tags onto metrics or logs. Host metadata itself still carries the mark.

hosttags.Get now takes an includeInfraMode flag so each caller chooses whether System includes infra_mode:. The cache still stores the full set. Callers that can put host tags on metrics or logs pass false.

Motivation

infra_mode:cloud_cost_only on a custom or DogStatsD series is renamed by intake into dd.cloud_cost, which would break customer dashboards and metering. Host expected tags were one way that mark could leak onto those series. Typos in infrastructure_mode could also show up as unexpected host tags.

Activated logs are paid customer product data. This PR does not stamp infra_mode on log events. It only prevents the mark from riding onto logs (or metrics) through the expected-tags clone.

Describe how you validated your changes

Unit tests cover the host-tag modes (including invalid values), the end-user-device tag split, Get(..., includeInfraMode), and the expected-tags strip for metrics and logs providers.

E2E: DogStatsD under cloud_cost_only with expected tags carries ordinary host tags without infra_mode.

Additional Notes

Does not mark logs or traces, and does not add marking on plain DogStatsD or custom_ metrics.

Diff: 214 lines (+160 / -54) across 2 files Reviewer: jinh-labs Review duration: 9105m
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.60) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.60 · 214 lines diff across 2 files
0.60
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
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.321
Shallow Review Depth shallow_review_depth
0.289
Sensitive Paths sensitive_paths
0.060
Real PR Conversation Timeline
1 comments
"Review active on #57905"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% 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: 60.5% · Lower = rushed or shallow review
60.5%
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%