[ISSUE #10901] Fix OTLP header parsing and avoid leaking header config - #10917
[ISSUE #10901] Fix OTLP header parsing and avoid leaking header config#10917123123213weqw wants to merge 4 commits into
Conversation
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
This PR fixes OTLP header parsing in ProxyMetricsManager:
split(":", 2)— correctly handles label values that contain colons (e.g., URLs). The originalsplit(":")would break on such values.- Log message fix — logs the specific invalid
iteminstead of the entirelabelsstring, making debugging easier.
Both changes are correct. LGTM.
Note: This PR also includes changes from #10914-#10916. See the series overlap comment on those PRs.
Automated review by github-manager-bot
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review Summary
This PR fixes OTLP header parsing in ProxyMetricsManager to handle values containing colons and improves error logging.
Findings
- [Critical] ProxyMetricsManager.java — The original
split(":")would break on header values containing colons (e.g.,Authorization: Bearer token:with:colons). The fix usessplit(":", 2)to split only on the first colon. - [Info] The improved error log now shows the actual invalid item instead of the full header string, making debugging easier.
Overall
Good fix for OTLP header parsing. The original code would fail on valid header values containing colons.
Automated review by RockteMQ-AI
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Two fixes in ProxyMetricsManager:
- split with limit 2 correctly handles header values containing colons (e.g., Authorization: Bearer xxx)
- Log messages now show the specific invalid item instead of the entire config string — this also prevents leaking other header values in logs
Both fixes are correct and the security improvement in logging is appreciated. LGTM.
Automated review by github-manager-bot
What is the purpose of the change
Fix #10901.
ProxyMetricsManager parsed metricsGrpcExporterHeader entries with item.split(":"), which drops any valid value containing a colon (e.g. a URI or a structured authorization value). On a parse failure the warning logged the complete header configuration, which may contain authorization tokens or API keys. The same split behavior was also applied to metricsLabel.
Brief changelog
How was this patch verified
git diff --checkclean