fix(parametric): normalize OTel boolean attribute assertions - #7404
Open
AlexeyKuznetsov-DD wants to merge 2 commits into
Open
fix(parametric): normalize OTel boolean attribute assertions#7404AlexeyKuznetsov-DD wants to merge 2 commits into
AlexeyKuznetsov-DD wants to merge 2 commits into
Conversation
AlexeyKuznetsov-DD
requested review from
khanayan123
and removed request for
a team
July 29, 2026 00:01
Contributor
|
|
|
ajgajg1134
approved these changes
Jul 29, 2026
nccatoni
approved these changes
Jul 29, 2026
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.
Motivation
The same OTel boolean attribute can have different representations depending on the tracer and trace protocol:
system-testspreviously required"true"and"false"specifically fromspan["meta"]. That assertion describes the legacy representation rather than the semantic OTel value, so it fails when a valid boolean arrives throughspan["metrics"]as1or0.dd-trace-javakeeps OTel booleans as JavaBooleantags. With trace protocol v0.4, those values are serialized as"true"/"false"metadata. With v1.0,TraceMapperV1writes them as typed boolean attributes, including flattened boolean-array elements.dd-trace-pyfurther demonstrates why the assertion should not depend on one storage map. Scalar OTel booleans can follow the numeric attribute path and become1/0metrics, while flattened boolean-array values can follow the tag path and remain string metadata.dd-apm-test-agentexposes all received traces through the legacy v0.4-shapedmeta/metricsmodel. When decoding a v1.0 typed boolean, it performs the conversion to numeric1or0; because those are numbers, they are placed inmetrics. The Java tracer itself does not convert its v1.0 boolean attributes into numeric metrics.As a result,
"true",True, and1represent the same boolean value for this cross-library behavioral test, as do"false",False, and0.Changes
Updates the parametric OTel attribute test to compare boolean values semantically instead of requiring them to be lowercase strings in
span["meta"].The test now:
span["meta"]andspan["metrics"]for boolean assertions.is_same_boolean(...)for scalar and flattened-array boolean attributes.is_same_boolean(...)to recognize numeric1and0in addition to native and string booleans.metaormetricsmaps.Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present