Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple scope management whenever a context is attached #3159

Merged
merged 3 commits into from
Jul 9, 2024

Commits on Jun 25, 2024

  1. Configuration menu
    Copy the full SHA
    1a35dae View commit details
    Browse the repository at this point in the history
  2. Add simple scope management whenever a context is attached

    * create a new otel context `_SCOPES_KEY` that will hold a tuple of
      `(curent_scope, isolation_scope)`
    * the `current_scope` will always be forked (like on every span creation/context update in practice)
      * note that this is on `attach`, so not on all copy-on-write context
        object creation but only on apis such as
        [`trace.use_span`](https://github.com/open-telemetry/opentelemetry-python/blob/ba22b165471bde2037620f2c850ab648a849fbc0/opentelemetry-api/src/opentelemetry/trace/__init__.py#L547)
        or [`tracer.start_as_current_span`](https://github.com/open-telemetry/opentelemetry-python/blob/ba22b165471bde2037620f2c850ab648a849fbc0/opentelemetry-api/src/opentelemetry/trace/__init__.py#L329)
      * basically every otel `context` fork corresponds to our `current_scope` fork
    * the `isolation_scope` currently will not be forked
      * these will later be updated, for instance when we update our top
        level scope apis that fork isolation scope, that will also have a
        corresponding change in this `attach` function
    sl0thentr0py committed Jun 25, 2024
    Configuration menu
    Copy the full SHA
    c523182 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2024

  1. Configuration menu
    Copy the full SHA
    436626b View commit details
    Browse the repository at this point in the history