sdk/resource: trim an OTEL_RESOURCE_ATTRIBUTES value that fails to decode #9442
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.36) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 208 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.320
Real PR Conversation Timeline
1 comments
"Review active on #9442"
general
weight: 0.35
dashpole
OTEL_RESOURCE_ATTRIBUTES="key= %invalid "setskeyto" %invalid ", thoughdoc.go:22says values are trimmed.constructOTResourcestrims before it decodes, but whenurl.PathUnescapefails it falls back to the rawv(sdk/resource/env.go:85). #2963 added that fallback so a bad value is never empty, and it tookfield[1], which the old code had trimmed.TestInvalidPercentDecodinghas no spaces in its input.The fix trims
vonce, before the decode, so the fallback still keeps the text and only drops the whitespace. Values that decode come out as before. No issue is open for this one.Before, with the new test and no fix:
After:
The spec says to discard the whole variable on a decode error (
resource/sdk.md). I left the #2963 retain-and-report behaviour alone, since dropping it changes whatDetectreturns andTestInvalidPercentDecodingpins that. @MrAlias, you co-authored #2963: is the trim enough here, with spec discard as its own change if you want it?