Fix errors on serialization of values that are not AnyValue in LogRecord attributes#4808
Merged
xrmx merged 37 commits intoopen-telemetry:mainfrom Nov 27, 2025
Merged
Fix errors on serialization of values that are not AnyValue in LogRecord attributes#4808xrmx merged 37 commits intoopen-telemetry:mainfrom
xrmx merged 37 commits intoopen-telemetry:mainfrom
Conversation
11 tasks
rads-1996
commented
Nov 19, 2025
9fa5257 to
a4394dd
Compare
xrmx
reviewed
Nov 20, 2025
…t' value opentelemetry
0c78fc2 to
60a8266
Compare
xrmx
reviewed
Nov 25, 2025
Co-authored-by: Riccardo Magliocchetti <[email protected]>
Co-authored-by: Riccardo Magliocchetti <[email protected]>
xrmx
reviewed
Nov 26, 2025
xrmx
approved these changes
Nov 26, 2025
lmolkova
approved these changes
Nov 26, 2025
Member
There was a problem hiding this comment.
This perfectly aligns with the spec
Any other values not listed above SHOULD be converted to AnyValue's string_value field if the source data can be serialized to a string (can be stringified) using toString() or stringify functions available in programming languages.
JWinermaSplunk
pushed a commit
to JWinermaSplunk/opentelemetry-python
that referenced
this pull request
Feb 17, 2026
…ord attributes (open-telemetry#4808) * Fix for issue - #2808: Invalid type WSGIRequest for attribute 'request' value opentelemetry * Update CHANGELOG * Retrigger CI/CD pipeline * Move logic to api * Fix ruff * Fix lint * Fix ruff * Addressed comments * Fix lint * Fix lint * Retrigger CI/CD pipeline * Fix lint * Fix lint * Retrigger CI/CD pipeline * Fix links * Fix format * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Update CHANGELOG.md Co-authored-by: Riccardo Magliocchetti <[email protected]> * Update CHANGELOG.md Co-authored-by: Riccardo Magliocchetti <[email protected]> * Addressed feedback * Fix ruff * Add explaination for try-catch --------- Co-authored-by: Riccardo Magliocchetti <[email protected]>
JWinermaSplunk
pushed a commit
to JWinermaSplunk/opentelemetry-python
that referenced
this pull request
Feb 17, 2026
…ord attributes (open-telemetry#4808) * Fix for issue - #2808: Invalid type WSGIRequest for attribute 'request' value opentelemetry * Update CHANGELOG * Retrigger CI/CD pipeline * Move logic to api * Fix ruff * Fix lint * Fix ruff * Addressed comments * Fix lint * Fix lint * Retrigger CI/CD pipeline * Fix lint * Fix lint * Retrigger CI/CD pipeline * Fix links * Fix format * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Retrigger CI/CD pipeline * Update CHANGELOG.md Co-authored-by: Riccardo Magliocchetti <[email protected]> * Update CHANGELOG.md Co-authored-by: Riccardo Magliocchetti <[email protected]> * Addressed feedback * Fix ruff * Add explaination for try-catch --------- Co-authored-by: Riccardo Magliocchetti <[email protected]>
10 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.
Description
Some applications such as Django add values to log records whose types fall outside the primitive types and
_VALID_ANY_VALUE_TYPES, i.e., they are not of typeAnyValue.Rather than attempt to whitelist every possible instrumentation, we stringify those values here so they can still be represented as attributes, falling back to the original TypeError only if converting to string raises.
Fixes open-telemetry/opentelemetry-python-contrib#2808
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Contrib Repo Change?
Checklist: