Repository navigation
Add String() method to telemetry Config to redact OTLP credentials - #3782
Merged
Merged
Conversation
ChrisJBurns
requested review from
JAORMX,
jerm-dro and
yrobla
as code owners
February 11, 2026 16:15
jerm-dro
previously approved these changes
Feb 11, 2026
JAORMX
previously approved these changes
Feb 11, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3782 +/- ##
==========================================
- Coverage 66.56% 66.51% -0.05%
==========================================
Files 434 434
Lines 42309 42321 +12
==========================================
- Hits 28161 28150 -11
- Misses 11998 12019 +21
- Partials 2150 2152 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ChrisJBurns
force-pushed
the
otel/redact-config-headers
branch
from
February 11, 2026 17:08
c21de48 to
1199bd0
Compare
The Config struct's Headers field stores authentication credentials (API keys, bearer tokens) for OTLP endpoints. Without a String() method, these values could be exposed if the struct is logged or printed in error paths. Add a fmt.Stringer implementation that redacts header values with [REDACTED] while preserving keys for debuggability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ChrisJBurns
force-pushed
the
otel/redact-config-headers
branch
from
February 11, 2026 17:16
1199bd0 to
e645130
Compare
jerm-dro
approved these changes
Feb 11, 2026
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fmt.Stringerimplementation totelemetry.Configthat redactsHeadersvalues with[REDACTED]while preserving keysfmt.GoStringerimplementation (GoString()) to prevent credential leakage via%#vformat verbfmt.Stringerandfmt.GoStringerParent issue: #3399
Test plan
TestConfigString_HeaderRedaction— table-driven test covering:[REDACTED])[REDACTED]in output)[REDACTED])GoString()delegates toString()in all cases%#vformat verb usesGoString()in all casesgo vet ./pkg/telemetry/...passestask lint-fix— 0 issues🤖 Generated with Claude Code