fix: [processor/signingprocessor] sign the log body whatever its type - #50919
Merged
songy23 merged 1 commit intoSep 11, 2026
Merged
Conversation
Contributor
|
Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. Important reminders:
|
surpradhan
force-pushed
the
surabhi/sign-non-string-body
branch
from
September 11, 2026 11:55
7375412 to
7f03a0e
Compare
Member
|
/workflow-approve |
serializeLogRecord included the body only when it was a string, so every other type was dropped before signing and was not covered by the signature at all. A record with a structured body and a record with no body produced identical canonical bytes and each verified against the other's signature. The body now goes through the same valueToInterface conversion as attributes, which handles every pcommon.Value type, enforces the existing nesting depth cap, and preserves the UTF-8 validation that guarded the string-only path. An unset body is still omitted rather than encoded as null, so records without one are unaffected. verifyRecord independently re-derives the signed payload and still handled only string bodies, so it could not verify anything this change now signs; it gains a standalone converter rather than reusing valueToInterface, so it stays a genuine re-derivation. TestSignVerifyStructuredBody drives a map body through the full sign-then-verify path so the mirror cannot rot again. TestSerializeLogRecordNonStringBody already set an int body but only asserted the payload was non-empty, which is why this went unnoticed; it now checks the body is actually present. The nesting-depth and UTF-8 errors inside valueToInterface said "attribute", which read as a contradiction once a body could reach them. Fixes open-telemetry#50911 Assisted-by: Claude Opus 5
surpradhan
force-pushed
the
surabhi/sign-non-string-body
branch
from
September 11, 2026 12:22
7f03a0e to
325ddf2
Compare
Member
|
/workflow-approve |
Pull request dashboard statusWaiting on reviewers · refreshed 2026-09-11 13:00 UTC Review the latest changes. Status above doesn't look right?
|
hilmarf
approved these changes
Sep 11, 2026
Member
|
This PR got approved by the code-owner. Could someone from @open-telemetry/collector-contrib-approvers please take a look at it? |
paulojmdias
approved these changes
Sep 11, 2026
Member
|
/workflow-approve |
singhvibhanshu
approved these changes
Sep 11, 2026
Contributor
|
Thank you for your contribution @surpradhan! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. |
Contributor
Author
|
Thanks @hilmarf @paulojmdias @singhvibhanshu and @songy23. |
hilmarf
added a commit
to apeirora/opentelemetry-collector-contrib
that referenced
this pull request
Sep 14, 2026
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
hilmarf
added a commit
to apeirora/opentelemetry-collector-contrib
that referenced
this pull request
Sep 14, 2026
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
hilmarf
added a commit
to apeirora/opentelemetry-collector-contrib
that referenced
this pull request
Sep 14, 2026
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
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.
Description
Note: bodies now inherit the same scalar ambiguity/int64 precision issue as attributes; #50892 fixes that too.
Tracking issue
Fixes #50911
Testing
covered all body types, distinct structured bodies, no-body behavior, UTF-8/depth validation, and full sign/verify for a map body. The existing int-body test only checked for a non-empty payload, which is why this slipped through.
Documentation
mainalready lists body without a string-only restriction, so this fix aligns the implementation with the README. The (string only) wording comes from #50892.