Skip to content

Update json and proto encoder to always accept None type, cleanup code / tests a little bit#5305

Merged
xrmx merged 11 commits into
open-telemetry:mainfrom
DylanRussell:extended_attributes_encoding_only
Jun 18, 2026
Merged

Update json and proto encoder to always accept None type, cleanup code / tests a little bit#5305
xrmx merged 11 commits into
open-telemetry:mainfrom
DylanRussell:extended_attributes_encoding_only

Conversation

@DylanRussell

@DylanRussell DylanRussell commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Description

This PR is a precursor to updating the SDK to use ExtendedAttributes everywhere: #5266.. I'm trying to make that PR a bit smaller / easier to review..

Update the encoder to always accept null as that is a valid value according to the spec, and encode it as an empty AnyValue.. this is in-line with the spec: open-telemetry/opentelemetry-specification#4392 - previously we would do this for Arrays but not Maps and not when None is encoded as a primitive..

Update _encode_attributes to accept _ExtendedAttribues value type instead of the old AttributeValue.

Cleanup the code and tests a little bit.

Type of change

  • [ x] New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Unit tests

Does This PR Require a Contrib Repo Change?

  • [x ] No.

Checklist:

  • [x ] Followed the style guidelines of this project
  • [ x] Changelogs have been updated
  • [ x] Unit tests have been added
  • [ x] Documentation has been updated

@DylanRussell DylanRussell requested a review from a team as a code owner June 15, 2026 19:45
@DylanRussell DylanRussell changed the title Update json and proto encoder to accept and parse ExtendedAttributes Update json and proto encoder to always accept None type, cleanup code / tests a little bit Jun 15, 2026
@github-project-automation github-project-automation Bot moved this to Approved PRs in Python PR digest Jun 16, 2026
@herin049

Copy link
Copy Markdown
Contributor

LGTM!

@xrmx xrmx moved this from Approved PRs to Ready for merge in Python PR digest Jun 18, 2026
@xrmx xrmx enabled auto-merge June 18, 2026 15:51
@xrmx xrmx added this pull request to the merge queue Jun 18, 2026
Merged via the queue into open-telemetry:main with commit 43f079f Jun 18, 2026
519 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for merge to Done in Python PR digest Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants