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

Adding Context API #395

Merged
merged 62 commits into from
Feb 13, 2020
Merged

Adding Context API #395

merged 62 commits into from
Feb 13, 2020

Commits on Feb 3, 2020

  1. Context API

    This change implements the Context API portion of OTEP open-telemetry#66. The CorrelationContext API and Propagation API changes will come in future PRs. We're leveraging entrypoints to support other implementations of the Context API if/when necessary. For backwards compatibility, this change uses aiocontextvars for Python versions older than 3.7.
    
    Signed-off-by: Alex Boten <aboten@lightstep.com>
    ocelotl authored and Alex Boten committed Feb 3, 2020
    Configuration menu
    Copy the full SHA
    1500bec View commit details
    Browse the repository at this point in the history

Commits on Feb 4, 2020

  1. Lint fixes

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    3bdf1c8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e144871 View commit details
    Browse the repository at this point in the history
  3. adding support for python 3.4 via thread-local

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    569878e View commit details
    Browse the repository at this point in the history
  4. Fix lint

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    55c817a View commit details
    Browse the repository at this point in the history
  5. review feedback

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    746e591 View commit details
    Browse the repository at this point in the history
  6. fix docs build

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    b53bdea View commit details
    Browse the repository at this point in the history
  7. adding named tracer support back

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    76a8c03 View commit details
    Browse the repository at this point in the history
  8. mypy fixes

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    3fe5a23 View commit details
    Browse the repository at this point in the history
  9. more mypy fixes

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    1f8d67f View commit details
    Browse the repository at this point in the history
  10. lint fixes

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    4bdd27c View commit details
    Browse the repository at this point in the history
  11. moving contextvars and threadlocal context to sdk

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    b28fb3f View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2020

  1. adding documentation

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    51af769 View commit details
    Browse the repository at this point in the history
  2. documentation

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    530c21a View commit details
    Browse the repository at this point in the history
  3. replace get_value w/ context.get_value

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    16eb703 View commit details
    Browse the repository at this point in the history
  4. log as error. more cleanup

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    ddd81a5 View commit details
    Browse the repository at this point in the history
  5. zipkin exporter needs the sdk

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    b935bf5 View commit details
    Browse the repository at this point in the history
  6. small cleanups

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    15805a4 View commit details
    Browse the repository at this point in the history
  7. don't bother constructing a map for entry_points

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    68b98e5 View commit details
    Browse the repository at this point in the history
  8. cleaning up more code, adding some context tests

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    3a2b0ef View commit details
    Browse the repository at this point in the history
  9. mypy fixes

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    62c76ec View commit details
    Browse the repository at this point in the history
  10. Fix ThreadlocalContext, use ContextVarsContext for tests with python …

    …> 3.4
    
    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    5dca7cc View commit details
    Browse the repository at this point in the history
  11. fix tests

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    7203e72 View commit details
    Browse the repository at this point in the history
  12. as per review feedback, removing use

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    e43f168 View commit details
    Browse the repository at this point in the history
  13. adding tests for sdk threadlocal and contextvar contexts

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    f81a673 View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2020

  1. removing create_key

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 6, 2020
    Configuration menu
    Copy the full SHA
    ba65845 View commit details
    Browse the repository at this point in the history
  2. add try/except

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 6, 2020
    Configuration menu
    Copy the full SHA
    ed187bf View commit details
    Browse the repository at this point in the history
  3. adding tests for threads and asyncio

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 6, 2020
    Configuration menu
    Copy the full SHA
    2b8c69f View commit details
    Browse the repository at this point in the history
  4. filling in asyncio test

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 6, 2020
    Configuration menu
    Copy the full SHA
    1a0217f View commit details
    Browse the repository at this point in the history
  5. Test

    ocelotl committed Feb 6, 2020
    Configuration menu
    Copy the full SHA
    212b14b View commit details
    Browse the repository at this point in the history
  6. Revert "Test"

    This reverts commit 212b14b.
    ocelotl committed Feb 6, 2020
    Configuration menu
    Copy the full SHA
    dbfeb98 View commit details
    Browse the repository at this point in the history
  7. fix threadlocal behaviour, more feedback changes

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 6, 2020
    Configuration menu
    Copy the full SHA
    2235bc3 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2020

  1. fix context restore bug

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 7, 2020
    Configuration menu
    Copy the full SHA
    5dc9fd5 View commit details
    Browse the repository at this point in the history
  2. simplifying code, removing unnecessary methods

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 7, 2020
    Configuration menu
    Copy the full SHA
    02c7c4c View commit details
    Browse the repository at this point in the history
  3. cleaning up docs

    Alex Boten committed Feb 7, 2020
    Configuration menu
    Copy the full SHA
    ae2cbc4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6f99621 View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2020

  1. Splitting the Context interface

    This interface was really attempting to do two things:
    - acting as an immutable Context object as per the otep
    - providing an interface on top of threadlocal/contextvars
    
    As part of this change:
    - RuntimeContext is the interface on top of threadlocal/contextvars
    - Context is now an immutable class
    
    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 8, 2020
    Configuration menu
    Copy the full SHA
    01e0054 View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2020

  1. update RuntimeContext when setting current

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 10, 2020
    Configuration menu
    Copy the full SHA
    ebcf0bd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ddf3c8d View commit details
    Browse the repository at this point in the history
  3. add set_current/get_current on RuntimeContext to store current Contex…

    …t in correct scope
    
    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 10, 2020
    Configuration menu
    Copy the full SHA
    6f9780b View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2020

  1. cleaning up mypy and fixing 3.4 tests

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    49b6abd View commit details
    Browse the repository at this point in the history
  2. cleaning up tests to use context api interface

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    4c5083a View commit details
    Browse the repository at this point in the history
  3. fix mypy

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    5a8a9fb View commit details
    Browse the repository at this point in the history
  4. fix 3.4 tests

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    d5da10c View commit details
    Browse the repository at this point in the history
  5. fixing docs

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    7995ac3 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    dbbdefb View commit details
    Browse the repository at this point in the history
  7. return the old context when calling set_current to allow for restore

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    37f1555 View commit details
    Browse the repository at this point in the history
  8. mypy fixes

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    81f06a9 View commit details
    Browse the repository at this point in the history
  9. removing snapshot from runtime context

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    f29111a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    057c22c View commit details
    Browse the repository at this point in the history
  11. cleaning up unused methods

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    5376e60 View commit details
    Browse the repository at this point in the history
  12. lint fixes

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    e7d0286 View commit details
    Browse the repository at this point in the history
  13. further sinmplifying RuntimeContext

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    0cee462 View commit details
    Browse the repository at this point in the history
  14. lint fix

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    f8032c1 View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2020

  1. Update opentelemetry-api/src/opentelemetry/context/__init__.py

    Co-Authored-By: Mauricio Vásquez <mauricio@kinvolk.io>
    codeboten and mauriciovasquezbernal committed Feb 12, 2020
    Configuration menu
    Copy the full SHA
    02b8f71 View commit details
    Browse the repository at this point in the history
  2. adding test, updating copyright on new files

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 12, 2020
    Configuration menu
    Copy the full SHA
    727ae50 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'adding-context-api' of github.com:codeboten/opentelemet…

    …ry-python into adding-context-api
    Alex Boten committed Feb 12, 2020
    Configuration menu
    Copy the full SHA
    c9c66f3 View commit details
    Browse the repository at this point in the history
  4. Removing unnecessary copy

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 12, 2020
    Configuration menu
    Copy the full SHA
    f25992f View commit details
    Browse the repository at this point in the history
  5. set default for contextvars

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 12, 2020
    Configuration menu
    Copy the full SHA
    91d2ebc View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2020

  1. feedback from review

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 13, 2020
    Configuration menu
    Copy the full SHA
    335678e View commit details
    Browse the repository at this point in the history
  2. minor fix

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 13, 2020
    Configuration menu
    Copy the full SHA
    619fc1b View commit details
    Browse the repository at this point in the history
  3. review feedback

    Signed-off-by: Alex Boten <aboten@lightstep.com>
    Alex Boten committed Feb 13, 2020
    Configuration menu
    Copy the full SHA
    1f9bd76 View commit details
    Browse the repository at this point in the history