Skip to content

docs: clarify baggage and current context semantics#5049

Open
iacker wants to merge 3 commits intoopen-telemetry:mainfrom
iacker:docs/baggage-current-context-2432
Open

docs: clarify baggage and current context semantics#5049
iacker wants to merge 3 commits intoopen-telemetry:mainfrom
iacker:docs/baggage-current-context-2432

Conversation

@iacker
Copy link
Copy Markdown

@iacker iacker commented Apr 7, 2026

Summary

  • explain that baggage helpers return new Context snapshots instead of mutating the current context
  • document the difference between explicit context=... parameters and the current execution context
  • show the correct context.attach/context.detach pattern for baggage

Test Plan

  • tox -e docs
    • the docs build is currently blocked in this environment by an external intersphinx fetch failure (pymongo.readthedocs.io inventory resolution), which Sphinx treats as an error here
    • the content change itself is limited to docs/api/baggage.rst and docs/api/context.rst

Fixes #2432

@iacker iacker requested a review from a team as a code owner April 7, 2026 00:41
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Apr 7, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: iacker / name: Billard (9de347c)
  • ✅ login: lzchen / name: Leighton Chen (7d4bb0e)
  • ✅ login: MikeGoldsmith / name: Mike Goldsmith (d72d7fd)

Copy link
Copy Markdown
Member

@MikeGoldsmith MikeGoldsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - thanks @iacker.

@github-project-automation github-project-automation Bot moved this to Approved PRs in Python PR digest Apr 13, 2026
@tammy-baylis-swi
Copy link
Copy Markdown
Contributor

Thank you for this long-awaited update!

Not all docs updates need Changelog entries but I'd suggest adding one for this PR since it's linked to a long-lived, upvoted issue.

@github-actions
Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment.
If you're still working on this, please add a comment or push new commits.

Comment thread docs/api/baggage.rst
opentelemetry.baggage package
========================================

The baggage API stores name/value pairs inside an OpenTelemetry
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why we don't have these in the actual api files as docstrings? .rst files are more for structure / rendering right?

@aabmass aabmass moved this from Approved PRs to Approved PRs that need fixes in Python PR digest May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved PRs that need fixes

Development

Successfully merging this pull request may close these issues.

Current context is empty with baggage.get_all

5 participants