From 24604c320406cae4de18b97130a6dfeb16c7dfd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Tue, 25 Jun 2019 08:52:03 +0200 Subject: [PATCH 001/145] Add a .pylintrc & fix warnings (#24) * Add .pylintrc based on OpenCensus (related #6). * Fix/disable pylint warnings. * pylint: Fix W0107: Unnecessary pass statement (unnecessary-pass) I'm not sure I like this warning. --- .pylintrc | 482 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 482 insertions(+) create mode 100644 .pylintrc diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 000000000..7d7a8f50c --- /dev/null +++ b/.pylintrc @@ -0,0 +1,482 @@ +[MASTER] + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. +extension-pkg-whitelist= + +# Add files or directories to the blacklist. They should be base names, not +# paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the blacklist. The +# regex matches against base names, not paths. +ignore-patterns= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the +# number of processors available to use. +jobs=0 + +# Control the amount of potential inferred values when inferring a single +# object. This can help the performance when dealing with large functions or +# complex, nested conditions. +limit-inference-results=100 + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# Specify a configuration file. +#rcfile= + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages. +suggestion-mode=yes + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED. +confidence= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once). You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use "--disable=all --enable=classes +# --disable=W". +disable=missing-docstring, + fixme, # Warns about FIXME, TODO, etc. comments. + too-few-public-methods, # Might be good to re-enable this later. + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +# enable=c-extension-no-member + + +[REPORTS] + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (RP0004). +#evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details. +#msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio). You can also give a reporter class, e.g. +# mypackage.mymodule.MyReporterClass. +#output-format=text + +# Tells whether to display a full report or only the messages. +#reports=no + +# Activate the evaluation score. +score=yes + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=sys.exit + + +[LOGGING] + +# Format style used to check logging format string. `old` means using % +# formatting, while `new` is for `{}` formatting. +logging-format-style=old + +# Logging modules to check that the string format arguments are in logging +# function parameter format. +logging-modules=logging + + +[SPELLING] + +# Limits count of emitted suggestions for spelling mistakes. +max-spelling-suggestions=4 + +# Spelling dictionary name. Available dictionaries: none. To make it working +# install python-enchant package.. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to indicated private dictionary in +# --spelling-private-dict-file option instead of raising a message. +spelling-store-unknown-words=no + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME, + XXX, + TODO + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +#ignore-mixin-members=yes + +# Tells whether to warn about missing members when the owner of the attribute +# is inferred to be None. +#ignore-none=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +#ignore-on-opaque-inference=yes + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis. It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules= + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid defining new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_, + _cb + +# A regular expression matching the name of dummy variables (i.e. expected to +# not be used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore. +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format=LF + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=100 + +# Maximum number of lines in a module. +max-module-lines=1000 + +# List of optional constructs for which whitespace checking is disabled. `dict- +# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. +# `trailing-comma` allows a space between comma and closing bracket: (a, ). +# `empty-line` allows space-only lines. +no-space-check=trailing-comma, + dict-separator + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[SIMILARITIES] + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + +[BASIC] + +# Naming style matching correct argument names. +argument-naming-style=snake_case + +# Regular expression matching correct argument names. Overrides argument- +# naming-style. +#argument-rgx= + +# Naming style matching correct attribute names. +attr-naming-style=snake_case + +# Regular expression matching correct attribute names. Overrides attr-naming- +# style. +#attr-rgx= + +# Bad variable names which should always be refused, separated by a comma. +bad-names=foo, + bar, + baz, + toto, + tutu, + tata + +# Naming style matching correct class attribute names. +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style. +#class-attribute-rgx= + +# Naming style matching correct class names. +class-naming-style=PascalCase + +# Regular expression matching correct class names. Overrides class-naming- +# style. +#class-rgx= + +# Naming style matching correct constant names. +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names. Overrides const-naming- +# style. +#const-rgx= + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming style matching correct function names. +function-naming-style=snake_case + +# Regular expression matching correct function names. Overrides function- +# naming-style. +#function-rgx= + +# Good variable names which should always be accepted, separated by a comma. +good-names=_, + log, + logger + +# Include a hint for the correct naming format with invalid-name. +include-naming-hint=yes + +# Naming style matching correct inline iteration names. +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style. +#inlinevar-rgx= + +# Naming style matching correct method names. +method-naming-style=snake_case + +# Regular expression matching correct method names. Overrides method-naming- +# style. +#method-rgx= + +# Naming style matching correct module names. +module-naming-style=snake_case + +# Regular expression matching correct module names. Overrides module-naming- +# style. +#module-rgx= + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +# These decorators are taken in consideration only for invalid-name. +property-classes=abc.abstractproperty + +# Naming style matching correct variable names. +variable-naming-style=snake_case + +# Regular expression matching correct variable names. Overrides variable- +# naming-style. +variable-rgx=(([a-z_][a-z0-9_]{1,})|(_[a-z0-9_]*)|(__[a-z][a-z0-9_]+__))$ + + +[IMPORTS] + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=yes + +# Deprecated modules which should not be used, separated by a comma. +deprecated-modules=optparse,tkinter.tix + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled). +ext-import-graph= + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled). +import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled). +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library=six + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict, + _fields, + _replace, + _source, + _make + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=cls + + +[DESIGN] + +# Maximum number of arguments for function / method. +max-args=5 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Maximum number of boolean expressions in an if statement. +max-bool-expr=5 + +# Maximum number of branch for function / method body. +max-branches=12 + +# Maximum number of locals for function / method body. +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of return / yield for function / method body. +max-returns=6 + +# Maximum number of statements in function / method body. +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception". +overgeneral-exceptions=Exception From cbf464cc99826e563f2d1a63178ab560303d125d Mon Sep 17 00:00:00 2001 From: Chris Kleinknecht Date: Wed, 26 Jun 2019 13:55:13 -0700 Subject: [PATCH 002/145] Add tox and travis, run pylint on builds (#30) --- tox.ini | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tox.ini diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..edfece597 --- /dev/null +++ b/tox.ini @@ -0,0 +1,10 @@ +[tox] +skipsdist = True +envlist = py37-lint + +[testenv] +deps = + py37-lint: pylint + +commands = + py37-lint: pylint opentelemetry-api/opentelemetry/trace/ From 6838c64c8a0ceccc3618b541c1020f4ea5d14361 Mon Sep 17 00:00:00 2001 From: Chris Kleinknecht Date: Thu, 27 Jun 2019 09:03:05 -0700 Subject: [PATCH 003/145] Set pylint's line length to 79 chars (#35) --- .pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 7d7a8f50c..0345f53ad 100644 --- a/.pylintrc +++ b/.pylintrc @@ -245,7 +245,7 @@ indent-after-paren=4 indent-string=' ' # Maximum number of characters on a single line. -max-line-length=100 +max-line-length=79 # Maximum number of lines in a module. max-module-lines=1000 From ef890d67ebfdd1458c8ff3a95a047aff45dbe8bf Mon Sep 17 00:00:00 2001 From: Chris Kleinknecht Date: Thu, 27 Jun 2019 09:38:05 -0700 Subject: [PATCH 004/145] Add type check to travis (#31) --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index edfece597..aa70cf3b3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,12 @@ [tox] skipsdist = True -envlist = py37-lint +envlist = py37-lint, py37-mypy [testenv] deps = py37-lint: pylint + py37-mypy: mypy commands = - py37-lint: pylint opentelemetry-api/opentelemetry/trace/ + py37-lint: pylint opentelemetry-api/opentelemetry/ + py37-mypy: mypy opentelemetry-api/opentelemetry/ From 6205cfc0b3b4b4274d6fd9a5d5a94a815896e49f Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Mon, 1 Jul 2019 13:40:06 -0700 Subject: [PATCH 005/145] Improve package layout (#37) --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index aa70cf3b3..7fdf9032a 100644 --- a/tox.ini +++ b/tox.ini @@ -8,5 +8,5 @@ deps = py37-mypy: mypy commands = - py37-lint: pylint opentelemetry-api/opentelemetry/ - py37-mypy: mypy opentelemetry-api/opentelemetry/ + py37-lint: pylint opentelemetry-api/src/opentelemetry/ + py37-mypy: mypy opentelemetry-api/src/opentelemetry/ From ab563ee34f9ab329d11e819f945040a24b849703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Mon, 8 Jul 2019 10:28:34 +0200 Subject: [PATCH 006/145] Misc build improvements (build docs & more) (#38) * Build docs. * Minor tox.ini improvements. * .gitignore mypy * Fix doc build. * Tell travis to build docs (with 3.7). --- tox.ini | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 7fdf9032a..4997e45f3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,27 @@ [tox] skipsdist = True -envlist = py37-lint, py37-mypy +envlist = py37-{lint,mypy}, docs + +[travis] +python = + 3.7: py37, docs [testenv] deps = - py37-lint: pylint - py37-mypy: mypy + lint: pylint~=2.3.1 + mypy: mypy~=0.711 + commands = py37-lint: pylint opentelemetry-api/src/opentelemetry/ py37-mypy: mypy opentelemetry-api/src/opentelemetry/ + +[testenv:docs] +deps = + sphinx~=2.1.2 + sphinx-rtd-theme~=0.4.3 + sphinx-autodoc-typehints~=1.6.0 + +commands = + sphinx-build -W --keep-going -b html -T . _build/html +changedir = docs From c1ee8c777744e30d53bb4fddd0a712e59c589fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Fri, 12 Jul 2019 14:28:47 +0200 Subject: [PATCH 007/145] Add unittest based unit-tests. (#42) --- tox.ini | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 4997e45f3..20eb43941 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] skipsdist = True -envlist = py37-{lint,mypy}, docs +envlist = py37-{lint,mypy,test}, docs [travis] python = @@ -11,10 +11,23 @@ deps = lint: pylint~=2.3.1 mypy: mypy~=0.711 +setenv = + PYTHONPATH={toxinidir}/opentelemetry-api/src/ + mypy: MYPYPATH={env:PYTHONPATH} + +changedir = + test: opentelemetry-api/tests + commands = - py37-lint: pylint opentelemetry-api/src/opentelemetry/ +; Prefer putting everything in one pylint command to profit from duplication +; warnings. + py37-lint: pylint opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ py37-mypy: mypy opentelemetry-api/src/opentelemetry/ +; For test code, we don't want to use the full mypy strictness, so we use its +; default flags instead. + py37-mypy: mypy opentelemetry-api/tests/ --config-file= + test: python -m unittest discover [testenv:docs] deps = From 981681a5dd74cfb8299b75f74b8b2c67acb0aa9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Tue, 16 Jul 2019 01:03:02 +0200 Subject: [PATCH 008/145] Lint more files, relax some type checks (#43) --- tox.ini | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 20eb43941..bd2dae1c5 100644 --- a/tox.ini +++ b/tox.ini @@ -22,11 +22,11 @@ changedir = commands = ; Prefer putting everything in one pylint command to profit from duplication ; warnings. - py37-lint: pylint opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ + py37-lint: pylint opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ opentelemetry-api/setup.py py37-mypy: mypy opentelemetry-api/src/opentelemetry/ -; For test code, we don't want to use the full mypy strictness, so we use its -; default flags instead. - py37-mypy: mypy opentelemetry-api/tests/ --config-file= +; For test code, we don't want to enforce the full mypy strictness + py37-mypy: mypy opentelemetry-api/src/opentelemetry/ + py37-mypy: mypy --config-file=mypy-relaxed.ini opentelemetry-api/tests/ opentelemetry-api/setup.py test: python -m unittest discover [testenv:docs] From e908d0eafa9ba8a5387660a0138e54273e9ea4e0 Mon Sep 17 00:00:00 2001 From: Chris Kleinknecht Date: Tue, 16 Jul 2019 10:34:40 -0700 Subject: [PATCH 009/145] Add flake8 and isort lint checks (#46) --- .isort.cfg | 2 ++ tox.ini | 34 +++++++++++++++++++++------------- 2 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 .isort.cfg diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 000000000..3d19a1c6e --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,2 @@ +[settings] +from_first=True diff --git a/tox.ini b/tox.ini index bd2dae1c5..085d260c2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,13 @@ [tox] skipsdist = True -envlist = py37-{lint,mypy,test}, docs +envlist = py{34,35,36,37}-test, lint, py37-mypy, docs [travis] python = - 3.7: py37, docs + 3.7: py37, lint, docs [testenv] deps = - lint: pylint~=2.3.1 mypy: mypy~=0.711 setenv = @@ -18,23 +17,32 @@ setenv = changedir = test: opentelemetry-api/tests +commands = + py37-mypy: mypy opentelemetry-api/src/opentelemetry/ +; For test code, we don't want to enforce the full mypy strictness + py37-mypy: mypy --config-file=mypy-relaxed.ini opentelemetry-api/tests/ opentelemetry-api/setup.py + test: python -m unittest discover + +[testenv:lint] +deps = + pylint~=2.3 + flake8~=3.7 + isort~=4.3 commands = ; Prefer putting everything in one pylint command to profit from duplication ; warnings. - py37-lint: pylint opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ opentelemetry-api/setup.py - py37-mypy: mypy opentelemetry-api/src/opentelemetry/ -; For test code, we don't want to enforce the full mypy strictness - py37-mypy: mypy opentelemetry-api/src/opentelemetry/ - py37-mypy: mypy --config-file=mypy-relaxed.ini opentelemetry-api/tests/ opentelemetry-api/setup.py - test: python -m unittest discover + pylint opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ + flake8 opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ + isort --check-only --recursive opentelemetry-api/src [testenv:docs] deps = - sphinx~=2.1.2 - sphinx-rtd-theme~=0.4.3 - sphinx-autodoc-typehints~=1.6.0 + sphinx~=2.1 + sphinx-rtd-theme~=0.4 + sphinx-autodoc-typehints~=1.6 + +changedir = docs commands = sphinx-build -W --keep-going -b html -T . _build/html -changedir = docs From c150fb8c17761654ccad9562dd39d6df26844c95 Mon Sep 17 00:00:00 2001 From: Chris Kleinknecht Date: Wed, 17 Jul 2019 16:05:59 -0700 Subject: [PATCH 010/145] Add stub tracer SDK (#55) --- tox.ini | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tox.ini b/tox.ini index 085d260c2..f9761bcc0 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] skipsdist = True -envlist = py{34,35,36,37}-test, lint, py37-mypy, docs +envlist = py{34,35,36,37}-test-{api,sdk}, lint, py37-mypy, docs [travis] python = @@ -11,17 +11,22 @@ deps = mypy: mypy~=0.711 setenv = - PYTHONPATH={toxinidir}/opentelemetry-api/src/ - mypy: MYPYPATH={env:PYTHONPATH} + mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/ changedir = - test: opentelemetry-api/tests + test-api: opentelemetry-api/tests + test-sdk: opentelemetry-sdk/tests + +commands_pre = + test-api: pip install -e {toxinidir}/opentelemetry-api + test-sdk: pip install -e {toxinidir}/opentelemetry-api + test-sdk: pip install -e {toxinidir}/opentelemetry-sdk commands = - py37-mypy: mypy opentelemetry-api/src/opentelemetry/ + mypy: mypy --namespace-packages opentelemetry-api/src/opentelemetry/ ; For test code, we don't want to enforce the full mypy strictness - py37-mypy: mypy --config-file=mypy-relaxed.ini opentelemetry-api/tests/ opentelemetry-api/setup.py - test: python -m unittest discover + mypy: mypy --namespace-packages --config-file=mypy-relaxed.ini opentelemetry-api/tests/ + test-{api,sdk}: python -m unittest discover [testenv:lint] deps = @@ -29,6 +34,9 @@ deps = flake8~=3.7 isort~=4.3 +commands_pre = + pip install -e {toxinidir}/opentelemetry-api + commands = ; Prefer putting everything in one pylint command to profit from duplication ; warnings. From b6b1bc9a71880cf9ad1a237b0184f8e7cca8ef36 Mon Sep 17 00:00:00 2001 From: Chris Kleinknecht Date: Fri, 26 Jul 2019 16:53:07 -0700 Subject: [PATCH 011/145] Lint SDK package (#65) --- .isort.cfg | 2 ++ .pylintrc | 2 ++ tox.ini | 7 ++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.isort.cfg b/.isort.cfg index 3d19a1c6e..20d62f8ec 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,2 +1,4 @@ [settings] +force_single_line=True +from_first=True from_first=True diff --git a/.pylintrc b/.pylintrc index 0345f53ad..23f9b090c 100644 --- a/.pylintrc +++ b/.pylintrc @@ -63,6 +63,8 @@ confidence= disable=missing-docstring, fixme, # Warns about FIXME, TODO, etc. comments. too-few-public-methods, # Might be good to re-enable this later. + too-many-instance-attributes, + too-many-arguments # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/tox.ini b/tox.ini index f9761bcc0..cd7112436 100644 --- a/tox.ini +++ b/tox.ini @@ -36,13 +36,14 @@ deps = commands_pre = pip install -e {toxinidir}/opentelemetry-api + pip install -e {toxinidir}/opentelemetry-sdk commands = ; Prefer putting everything in one pylint command to profit from duplication ; warnings. - pylint opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ - flake8 opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ - isort --check-only --recursive opentelemetry-api/src + pylint opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ opentelemetry-sdk/src/opentelemetry/ opentelemetry-sdk/tests/ + flake8 opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ opentelemetry-sdk/src/opentelemetry/ opentelemetry-sdk/tests/ + isort --check-only --recursive opentelemetry-api/src opentelemetry-sdk/src [testenv:docs] deps = From ead2e6b192887087a50da48ac93473c3e564237a Mon Sep 17 00:00:00 2001 From: Chris Kleinknecht Date: Tue, 6 Aug 2019 13:36:20 -0700 Subject: [PATCH 012/145] Span creation in tracer SDK (#69) --- .isort.cfg | 1 - .pylintrc | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.isort.cfg b/.isort.cfg index 20d62f8ec..d3e7dbf03 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,4 +1,3 @@ [settings] force_single_line=True from_first=True -from_first=True diff --git a/.pylintrc b/.pylintrc index 23f9b090c..f0ae6e1ad 100644 --- a/.pylintrc +++ b/.pylintrc @@ -64,7 +64,8 @@ disable=missing-docstring, fixme, # Warns about FIXME, TODO, etc. comments. too-few-public-methods, # Might be good to re-enable this later. too-many-instance-attributes, - too-many-arguments + too-many-arguments, + ungrouped-imports # Leave this up to isort # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option From db9fdb8a16ed4570192301c2fe6cd738a13dbbce Mon Sep 17 00:00:00 2001 From: Allan Feldman <6374032+a-feld@users.noreply.github.com> Date: Mon, 19 Aug 2019 11:10:15 -0700 Subject: [PATCH 013/145] Implement WSGI middleware integration. (#84) --- tox.ini | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tox.ini b/tox.ini index cd7112436..82178115c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,11 @@ [tox] skipsdist = True -envlist = py{34,35,36,37}-test-{api,sdk}, lint, py37-mypy, docs +envlist = + py{34,35,36,37}-test-{api,sdk} + py{34,35,36,37}-test-ext-wsgi + lint + py37-mypy + docs [travis] python = @@ -16,17 +21,19 @@ setenv = changedir = test-api: opentelemetry-api/tests test-sdk: opentelemetry-sdk/tests + test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests commands_pre = - test-api: pip install -e {toxinidir}/opentelemetry-api - test-sdk: pip install -e {toxinidir}/opentelemetry-api + test: pip install -e {toxinidir}/opentelemetry-api test-sdk: pip install -e {toxinidir}/opentelemetry-sdk + ext: pip install -e {toxinidir}/opentelemetry-api + wsgi: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi commands = mypy: mypy --namespace-packages opentelemetry-api/src/opentelemetry/ ; For test code, we don't want to enforce the full mypy strictness mypy: mypy --namespace-packages --config-file=mypy-relaxed.ini opentelemetry-api/tests/ - test-{api,sdk}: python -m unittest discover + test: python -m unittest discover [testenv:lint] deps = @@ -37,13 +44,14 @@ deps = commands_pre = pip install -e {toxinidir}/opentelemetry-api pip install -e {toxinidir}/opentelemetry-sdk + pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi commands = ; Prefer putting everything in one pylint command to profit from duplication ; warnings. - pylint opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ opentelemetry-sdk/src/opentelemetry/ opentelemetry-sdk/tests/ - flake8 opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ opentelemetry-sdk/src/opentelemetry/ opentelemetry-sdk/tests/ - isort --check-only --recursive opentelemetry-api/src opentelemetry-sdk/src + pylint opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ opentelemetry-sdk/src/opentelemetry/ opentelemetry-sdk/tests/ ext/opentelemetry-ext-wsgi/src/ ext/opentelemetry-ext-wsgi/tests/ + flake8 opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ opentelemetry-sdk/src/opentelemetry/ opentelemetry-sdk/tests/ ext/opentelemetry-ext-wsgi/src/ ext/opentelemetry-ext-wsgi/tests/ + isort --check-only --recursive opentelemetry-api/src opentelemetry-sdk/src ext/opentelemetry-ext-wsgi/src ext/opentelemetry-ext-wsgi/tests [testenv:docs] deps = From 94be2dcd0445acb8cb63497178f60c74354abaee Mon Sep 17 00:00:00 2001 From: Aliaksei Urbanski Date: Mon, 26 Aug 2019 13:48:04 +0300 Subject: [PATCH 014/145] Improve testing (#95) I believe it would be nice to have tests on CI not only for Python 3.7, but for all supported Python versions. These changes: - fix compatibility with Python 3.5 and 3.4 - add tests for various Python versions on CI - allow running tests for any branches --- tox.ini | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 82178115c..71bc408a3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,9 @@ [tox] skipsdist = True +skip_missing_interpreters = True envlist = - py{34,35,36,37}-test-{api,sdk} - py{34,35,36,37}-test-ext-wsgi + py3{4,5,6,7,8}-test-{api,sdk,ext-wsgi} + pypy35-test-{api,sdk,ext-wsgi} lint py37-mypy docs @@ -24,6 +25,7 @@ changedir = test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests commands_pre = + pip install -U pip setuptools wheel test: pip install -e {toxinidir}/opentelemetry-api test-sdk: pip install -e {toxinidir}/opentelemetry-sdk ext: pip install -e {toxinidir}/opentelemetry-api @@ -36,6 +38,7 @@ commands = test: python -m unittest discover [testenv:lint] +basepython: python3.7 deps = pylint~=2.3 flake8~=3.7 From 009de09c204947388e096296aceae631bfc8c320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Tue, 27 Aug 2019 16:01:23 +0200 Subject: [PATCH 015/145] Requests integration (#94) Adds requests integration. Two commits that might be of special interest (see #94): * c66af2faa100b0f41afafdb6e4de9f4de4cc62bc requests test: Use actual Response object. Co-Authored-By: Allan Feldman <6374032+a-feld@users.noreply.github.com> * 1b90a0ddc286c936f7256b14e14ef36fd3c6a24f More tests, rename to http-requests to work around pylint bug (?) See previous CI failure for pylint issue: ************* Module ext/opentelemetry-ext-requests/src/__init__.py ext/opentelemetry-ext-requests/src/__init__.py:1:0: F0001: No module named ext/opentelemetry-ext-requests/src/__init__.py (fatal) It seems that pylint gets confused when there is more than one "requests" module?? --- tox.ini | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index 71bc408a3..f7feff517 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,8 @@ skipsdist = True skip_missing_interpreters = True envlist = - py3{4,5,6,7,8}-test-{api,sdk,ext-wsgi} - pypy35-test-{api,sdk,ext-wsgi} + py3{4,5,6,7,8}-test-{api,sdk,ext-wsgi,ext-http-requests} + pypy35-test-{api,sdk,ext-wsgi,ext-http-requests} lint py37-mypy docs @@ -23,6 +23,7 @@ changedir = test-api: opentelemetry-api/tests test-sdk: opentelemetry-sdk/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests + test-ext-http-requests: ext/opentelemetry-ext-http-requests/tests commands_pre = pip install -U pip setuptools wheel @@ -30,6 +31,7 @@ commands_pre = test-sdk: pip install -e {toxinidir}/opentelemetry-sdk ext: pip install -e {toxinidir}/opentelemetry-api wsgi: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi + http-requests: pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests commands = mypy: mypy --namespace-packages opentelemetry-api/src/opentelemetry/ @@ -48,13 +50,14 @@ commands_pre = pip install -e {toxinidir}/opentelemetry-api pip install -e {toxinidir}/opentelemetry-sdk pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi + pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests commands = ; Prefer putting everything in one pylint command to profit from duplication ; warnings. - pylint opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ opentelemetry-sdk/src/opentelemetry/ opentelemetry-sdk/tests/ ext/opentelemetry-ext-wsgi/src/ ext/opentelemetry-ext-wsgi/tests/ - flake8 opentelemetry-api/src/opentelemetry/ opentelemetry-api/tests/ opentelemetry-sdk/src/opentelemetry/ opentelemetry-sdk/tests/ ext/opentelemetry-ext-wsgi/src/ ext/opentelemetry-ext-wsgi/tests/ - isort --check-only --recursive opentelemetry-api/src opentelemetry-sdk/src ext/opentelemetry-ext-wsgi/src ext/opentelemetry-ext-wsgi/tests + pylint opentelemetry-api/src/opentelemetry opentelemetry-api/tests/ opentelemetry-sdk/src/opentelemetry opentelemetry-sdk/tests/ ext/opentelemetry-ext-http-requests/src/ ext/opentelemetry-ext-http-requests/tests/ ext/opentelemetry-ext-wsgi/tests/ + flake8 opentelemetry-api/src/ opentelemetry-api/tests/ opentelemetry-sdk/src/ opentelemetry-sdk/tests/ ext/opentelemetry-ext-wsgi/src/ ext/opentelemetry-ext-wsgi/tests/ ext/opentelemetry-ext-http-requests/src/ + isort --check-only --recursive opentelemetry-api/src opentelemetry-sdk/src ext/opentelemetry-ext-wsgi/src ext/opentelemetry-ext-wsgi/tests ext/opentelemetry-ext-http-requests/src/ [testenv:docs] deps = From 6a8f3eeee72a0e9c93ff534083ff50458cf7c37e Mon Sep 17 00:00:00 2001 From: Aliaksei Urbanski Date: Tue, 27 Aug 2019 19:49:39 +0300 Subject: [PATCH 016/145] Relax the pylint rule for constants (#108) These changes follow up the "Fix and improve tests for Python != 3.7" PR. --- .pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index f0ae6e1ad..4b33f1142 100644 --- a/.pylintrc +++ b/.pylintrc @@ -323,7 +323,7 @@ class-naming-style=PascalCase #class-rgx= # Naming style matching correct constant names. -const-naming-style=UPPER_CASE +const-naming-style=any # Regular expression matching correct constant names. Overrides const-naming- # style. From 5480b0eee6c2a312a023450e8e182969c4c71719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Tue, 27 Aug 2019 18:51:21 +0200 Subject: [PATCH 017/145] Fix running tox on Windows. (#111) --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index f7feff517..0b2e30c31 100644 --- a/tox.ini +++ b/tox.ini @@ -26,7 +26,7 @@ changedir = test-ext-http-requests: ext/opentelemetry-ext-http-requests/tests commands_pre = - pip install -U pip setuptools wheel + python -m pip install -U pip setuptools wheel test: pip install -e {toxinidir}/opentelemetry-api test-sdk: pip install -e {toxinidir}/opentelemetry-sdk ext: pip install -e {toxinidir}/opentelemetry-api From 5b00ddcaed133df18f32ff4d7642c974208221ff Mon Sep 17 00:00:00 2001 From: Allan Feldman <6374032+a-feld@users.noreply.github.com> Date: Thu, 29 Aug 2019 10:20:42 -0700 Subject: [PATCH 018/145] Add initial black formatting (#104) Closes: #88 --- .flake8 | 2 ++ .isort.cfg | 7 +++++-- .pylintrc | 5 ++++- tox.ini | 2 ++ 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..5384053b3 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +ignore = E501,W503,E203 diff --git a/.isort.cfg b/.isort.cfg index d3e7dbf03..6bde062b5 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,3 +1,6 @@ [settings] -force_single_line=True -from_first=True +multi_line_output=3 +include_trailing_comma=True +force_grid_wrap=0 +use_parentheses=True +line_length=79 diff --git a/.pylintrc b/.pylintrc index 4b33f1142..8130305d7 100644 --- a/.pylintrc +++ b/.pylintrc @@ -65,7 +65,10 @@ disable=missing-docstring, too-few-public-methods, # Might be good to re-enable this later. too-many-instance-attributes, too-many-arguments, - ungrouped-imports # Leave this up to isort + ungrouped-imports, # Leave this up to isort + wrong-import-order, # Leave this up to isort + bad-continuation, # Leave this up to black + line-too-long # Leave this up to black # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/tox.ini b/tox.ini index 0b2e30c31..443a5761a 100644 --- a/tox.ini +++ b/tox.ini @@ -45,6 +45,7 @@ deps = pylint~=2.3 flake8~=3.7 isort~=4.3 + black>=19.3b0,==19.* commands_pre = pip install -e {toxinidir}/opentelemetry-api @@ -55,6 +56,7 @@ commands_pre = commands = ; Prefer putting everything in one pylint command to profit from duplication ; warnings. + black --check --diff opentelemetry-api/src/opentelemetry opentelemetry-api/tests/ opentelemetry-sdk/src/opentelemetry opentelemetry-sdk/tests/ ext/opentelemetry-ext-http-requests/src/ ext/opentelemetry-ext-http-requests/tests/ ext/opentelemetry-ext-wsgi/tests/ pylint opentelemetry-api/src/opentelemetry opentelemetry-api/tests/ opentelemetry-sdk/src/opentelemetry opentelemetry-sdk/tests/ ext/opentelemetry-ext-http-requests/src/ ext/opentelemetry-ext-http-requests/tests/ ext/opentelemetry-ext-wsgi/tests/ flake8 opentelemetry-api/src/ opentelemetry-api/tests/ opentelemetry-sdk/src/ opentelemetry-sdk/tests/ ext/opentelemetry-ext-wsgi/src/ ext/opentelemetry-ext-wsgi/tests/ ext/opentelemetry-ext-http-requests/src/ isort --check-only --recursive opentelemetry-api/src opentelemetry-sdk/src ext/opentelemetry-ext-wsgi/src ext/opentelemetry-ext-wsgi/tests ext/opentelemetry-ext-http-requests/src/ From cf13bbb94a7cedc7944c73572c288518019ad4f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Mon, 2 Sep 2019 06:23:40 -0500 Subject: [PATCH 019/145] tox: add --diff to isort (#118) Sometimes it complains and it is difficult to understand what exactly it wants. The --diff option allows to know what is the format it expects. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 443a5761a..5cbdfa2d5 100644 --- a/tox.ini +++ b/tox.ini @@ -59,7 +59,7 @@ commands = black --check --diff opentelemetry-api/src/opentelemetry opentelemetry-api/tests/ opentelemetry-sdk/src/opentelemetry opentelemetry-sdk/tests/ ext/opentelemetry-ext-http-requests/src/ ext/opentelemetry-ext-http-requests/tests/ ext/opentelemetry-ext-wsgi/tests/ pylint opentelemetry-api/src/opentelemetry opentelemetry-api/tests/ opentelemetry-sdk/src/opentelemetry opentelemetry-sdk/tests/ ext/opentelemetry-ext-http-requests/src/ ext/opentelemetry-ext-http-requests/tests/ ext/opentelemetry-ext-wsgi/tests/ flake8 opentelemetry-api/src/ opentelemetry-api/tests/ opentelemetry-sdk/src/ opentelemetry-sdk/tests/ ext/opentelemetry-ext-wsgi/src/ ext/opentelemetry-ext-wsgi/tests/ ext/opentelemetry-ext-http-requests/src/ - isort --check-only --recursive opentelemetry-api/src opentelemetry-sdk/src ext/opentelemetry-ext-wsgi/src ext/opentelemetry-ext-wsgi/tests ext/opentelemetry-ext-http-requests/src/ + isort --check-only --diff --recursive opentelemetry-api/src opentelemetry-sdk/src ext/opentelemetry-ext-wsgi/src ext/opentelemetry-ext-wsgi/tests ext/opentelemetry-ext-http-requests/src/ [testenv:docs] deps = From ef4d7840a60c6bd0b97cf0fde9c372576c7702ab Mon Sep 17 00:00:00 2001 From: Aliaksei Urbanski Date: Thu, 5 Sep 2019 09:57:30 +0300 Subject: [PATCH 020/145] Describe isort's multi_line_output setting (#109) These changes follow up the "Fix and improve tests for Python != 3.7" PR. The multi_line_output was already set to 3 in the "Add initial black formatting" PR, so after rebasing to master this commit contains only comment that describes a magic number from the isort configuration file. Corresponding PR: - https://github.com/open-telemetry/opentelemetry-python/pull/109 Related discussions: - https://github.com/open-telemetry/opentelemetry-python/pull/95#discussion_r315942697 - https://github.com/open-telemetry/opentelemetry-python/pull/95#issuecomment-523566519 --- .isort.cfg | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.isort.cfg b/.isort.cfg index 6bde062b5..43cafae19 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,6 +1,14 @@ [settings] -multi_line_output=3 include_trailing_comma=True force_grid_wrap=0 use_parentheses=True line_length=79 + +; 3 stands for Vertical Hanging Indent, e.g. +; from third_party import ( +; lib1, +; lib2, +; lib3, +; ) +; docs: https://github.com/timothycrosley/isort#multi-line-output-modes +multi_line_output=3 From 786430c16c93a33b6e5645a4b621dd67e1a35da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Fri, 6 Sep 2019 11:30:18 +0200 Subject: [PATCH 021/145] Fix setup for ext packages. (#122) * Fix setup for ext packages. Previously the wheels would contain the metadata but not the actual code. * Check that all packages install properly in test. * Document why we don't use -e. --- tox.ini | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index 5cbdfa2d5..acf1bcb36 100644 --- a/tox.ini +++ b/tox.ini @@ -26,12 +26,13 @@ changedir = test-ext-http-requests: ext/opentelemetry-ext-http-requests/tests commands_pre = +; Install without -e to test the actual installation python -m pip install -U pip setuptools wheel - test: pip install -e {toxinidir}/opentelemetry-api - test-sdk: pip install -e {toxinidir}/opentelemetry-sdk - ext: pip install -e {toxinidir}/opentelemetry-api - wsgi: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi - http-requests: pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests + test: pip install {toxinidir}/opentelemetry-api + test-sdk: pip install {toxinidir}/opentelemetry-sdk + ext: pip install {toxinidir}/opentelemetry-api + wsgi: pip install {toxinidir}/ext/opentelemetry-ext-wsgi + http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests commands = mypy: mypy --namespace-packages opentelemetry-api/src/opentelemetry/ From 1e8e5dd92368b002df6efb439cb6d3ee6eb3ca18 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Tue, 10 Sep 2019 22:14:26 -0700 Subject: [PATCH 022/145] Introducing an example app instrumented with opentelemetry (#129) Creating an example app that showcases how an application integrates with opentelemetry. --- tox.ini | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index acf1bcb36..8967adaff 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,8 @@ skipsdist = True skip_missing_interpreters = True envlist = - py3{4,5,6,7,8}-test-{api,sdk,ext-wsgi,ext-http-requests} - pypy35-test-{api,sdk,ext-wsgi,ext-http-requests} + py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-http-requests} + pypy35-test-{api,sdk,example-app,ext-wsgi,ext-http-requests} lint py37-mypy docs @@ -22,6 +22,7 @@ setenv = changedir = test-api: opentelemetry-api/tests test-sdk: opentelemetry-sdk/tests + test-example-app: opentelemetry-example-app/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests test-ext-http-requests: ext/opentelemetry-ext-http-requests/tests @@ -30,6 +31,10 @@ commands_pre = python -m pip install -U pip setuptools wheel test: pip install {toxinidir}/opentelemetry-api test-sdk: pip install {toxinidir}/opentelemetry-sdk + example-app: pip install {toxinidir}/opentelemetry-sdk + example-app: pip install {toxinidir}/ext/opentelemetry-ext-wsgi + example-app: pip install {toxinidir}/ext/opentelemetry-ext-http-requests + example-app: pip install {toxinidir}/opentelemetry-example-app ext: pip install {toxinidir}/opentelemetry-api wsgi: pip install {toxinidir}/ext/opentelemetry-ext-wsgi http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests @@ -53,14 +58,23 @@ commands_pre = pip install -e {toxinidir}/opentelemetry-sdk pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests + pip install -e {toxinidir}/opentelemetry-example-app commands = ; Prefer putting everything in one pylint command to profit from duplication ; warnings. - black --check --diff opentelemetry-api/src/opentelemetry opentelemetry-api/tests/ opentelemetry-sdk/src/opentelemetry opentelemetry-sdk/tests/ ext/opentelemetry-ext-http-requests/src/ ext/opentelemetry-ext-http-requests/tests/ ext/opentelemetry-ext-wsgi/tests/ - pylint opentelemetry-api/src/opentelemetry opentelemetry-api/tests/ opentelemetry-sdk/src/opentelemetry opentelemetry-sdk/tests/ ext/opentelemetry-ext-http-requests/src/ ext/opentelemetry-ext-http-requests/tests/ ext/opentelemetry-ext-wsgi/tests/ - flake8 opentelemetry-api/src/ opentelemetry-api/tests/ opentelemetry-sdk/src/ opentelemetry-sdk/tests/ ext/opentelemetry-ext-wsgi/src/ ext/opentelemetry-ext-wsgi/tests/ ext/opentelemetry-ext-http-requests/src/ - isort --check-only --diff --recursive opentelemetry-api/src opentelemetry-sdk/src ext/opentelemetry-ext-wsgi/src ext/opentelemetry-ext-wsgi/tests ext/opentelemetry-ext-http-requests/src/ + black --check --diff . + pylint opentelemetry-api/src/opentelemetry \ + opentelemetry-api/tests/ \ + opentelemetry-sdk/src/opentelemetry \ + opentelemetry-sdk/tests/ \ + ext/opentelemetry-ext-http-requests/src/ \ + ext/opentelemetry-ext-http-requests/tests/ \ + ext/opentelemetry-ext-wsgi/tests/ \ + opentelemetry-example-app/src/opentelemetry_example_app/ \ + opentelemetry-example-app/tests/ + flake8 . + isort --check-only --diff --recursive . [testenv:docs] deps = From 6765f82ab019bba2fe1058d874e4dbed9a21919f Mon Sep 17 00:00:00 2001 From: Aliaksei Urbanski Date: Wed, 11 Sep 2019 11:25:00 +0300 Subject: [PATCH 023/145] Fix skipping tests for PyPy (#133) --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 8967adaff..73507c3be 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ skipsdist = True skip_missing_interpreters = True envlist = py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-http-requests} - pypy35-test-{api,sdk,example-app,ext-wsgi,ext-http-requests} + pypy3-test-{api,sdk,example-app,ext-wsgi,ext-http-requests} lint py37-mypy docs From f6f8d5581639a17c69483ae14009d32a0de0f65c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Mon, 16 Sep 2019 11:19:34 +0200 Subject: [PATCH 024/145] Ensure that type info is picked up from installed package. (#124) * Ensure that type info is picked up from installed package. This required moving all top-level modules to a sub-package, to not create collisions with py.typed marker files. See https://www.python.org/dev/peps/pep-0561/#packaging-type-information * Add MANIFEST.in for SDK package. --- tox.ini | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 73507c3be..d0fb6cc2d 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,7 @@ envlist = py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-http-requests} pypy3-test-{api,sdk,example-app,ext-wsgi,ext-http-requests} lint - py37-mypy + py37-{mypy,mypyinstalled} docs [travis] @@ -14,7 +14,7 @@ python = [testenv] deps = - mypy: mypy~=0.711 + mypy,mypyinstalled: mypy~=0.711 setenv = mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/ @@ -39,11 +39,21 @@ commands_pre = wsgi: pip install {toxinidir}/ext/opentelemetry-ext-wsgi http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests +; Using file:// here because otherwise tox invokes just "pip install +; opentelemetry-api", leading to an error + mypyinstalled: pip install file://{toxinidir}/opentelemetry-api/ + commands = + test: python -m unittest discover + mypy: mypy --namespace-packages opentelemetry-api/src/opentelemetry/ ; For test code, we don't want to enforce the full mypy strictness mypy: mypy --namespace-packages --config-file=mypy-relaxed.ini opentelemetry-api/tests/ - test: python -m unittest discover + +; Test that mypy can pick up typeinfo from an installed package (otherwise, +; implicit Any due to unfollowed import would result). + mypyinstalled: mypy --namespace-packages opentelemetry-api/tests/mypysmoke.py --strict + [testenv:lint] basepython: python3.7 From 657c8fd39ea704437ef439254c72fca560506b90 Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Tue, 24 Sep 2019 20:12:56 -0700 Subject: [PATCH 025/145] Skeleton for azure monitor exporters (#151) --- tox.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tox.ini b/tox.ini index d0fb6cc2d..871931dc5 100644 --- a/tox.ini +++ b/tox.ini @@ -66,6 +66,7 @@ deps = commands_pre = pip install -e {toxinidir}/opentelemetry-api pip install -e {toxinidir}/opentelemetry-sdk + pip install -e {toxinidir}/ext/opentelemetry-ext-azure-monitor pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests pip install -e {toxinidir}/opentelemetry-example-app @@ -78,6 +79,9 @@ commands = opentelemetry-api/tests/ \ opentelemetry-sdk/src/opentelemetry \ opentelemetry-sdk/tests/ \ + ext/opentelemetry-ext-azure-monitor/examples/ \ + ext/opentelemetry-ext-azure-monitor/src/ \ + ext/opentelemetry-ext-azure-monitor/tests/ \ ext/opentelemetry-ext-http-requests/src/ \ ext/opentelemetry-ext-http-requests/tests/ \ ext/opentelemetry-ext-wsgi/tests/ \ From d0bee00e1ae183651c7544afc3eb32d765541cfd Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Wed, 25 Sep 2019 12:46:41 -0700 Subject: [PATCH 026/145] Move example app to the examples folder (#172) --- tox.ini | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tox.ini b/tox.ini index 871931dc5..f8d2f55d2 100644 --- a/tox.ini +++ b/tox.ini @@ -22,9 +22,9 @@ setenv = changedir = test-api: opentelemetry-api/tests test-sdk: opentelemetry-sdk/tests - test-example-app: opentelemetry-example-app/tests - test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests test-ext-http-requests: ext/opentelemetry-ext-http-requests/tests + test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests + test-example-app: examples/opentelemetry-example-app/tests commands_pre = ; Install without -e to test the actual installation @@ -32,9 +32,9 @@ commands_pre = test: pip install {toxinidir}/opentelemetry-api test-sdk: pip install {toxinidir}/opentelemetry-sdk example-app: pip install {toxinidir}/opentelemetry-sdk - example-app: pip install {toxinidir}/ext/opentelemetry-ext-wsgi example-app: pip install {toxinidir}/ext/opentelemetry-ext-http-requests - example-app: pip install {toxinidir}/opentelemetry-example-app + example-app: pip install {toxinidir}/ext/opentelemetry-ext-wsgi + example-app: pip install {toxinidir}/examples/opentelemetry-example-app ext: pip install {toxinidir}/opentelemetry-api wsgi: pip install {toxinidir}/ext/opentelemetry-ext-wsgi http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests @@ -67,9 +67,9 @@ commands_pre = pip install -e {toxinidir}/opentelemetry-api pip install -e {toxinidir}/opentelemetry-sdk pip install -e {toxinidir}/ext/opentelemetry-ext-azure-monitor - pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests - pip install -e {toxinidir}/opentelemetry-example-app + pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi + pip install -e {toxinidir}/examples/opentelemetry-example-app commands = ; Prefer putting everything in one pylint command to profit from duplication @@ -85,8 +85,8 @@ commands = ext/opentelemetry-ext-http-requests/src/ \ ext/opentelemetry-ext-http-requests/tests/ \ ext/opentelemetry-ext-wsgi/tests/ \ - opentelemetry-example-app/src/opentelemetry_example_app/ \ - opentelemetry-example-app/tests/ + examples/opentelemetry-example-app/src/opentelemetry_example_app/ \ + examples/opentelemetry-example-app/tests/ flake8 . isort --check-only --diff --recursive . From 050ede7173c393d5764a2034e21963d4087161ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Tue, 8 Oct 2019 05:24:23 -0500 Subject: [PATCH 027/145] Add Jaeger exporter (#174) This adds a Jeager exporter for OpenTelemetry. This exporter is based on https://github.com/census-instrumentation/opencensus-python/tree/master/contrib/opencensus-ext-jaeger. The exporter uses thrift and can be configured to send data to the agent and also to a remote collector. There is a long discussion going on about how to include generated files in the repo, so for now just put them here. --- .flake8 | 1 + .isort.cfg | 1 + .pylintrc | 2 +- tox.ini | 10 ++++++++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.flake8 b/.flake8 index 5384053b3..a3411a161 100644 --- a/.flake8 +++ b/.flake8 @@ -1,2 +1,3 @@ [flake8] ignore = E501,W503,E203 +exclude = .svn,CVS,.bzr,.hg,.git,__pycache__,.tox,ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen/,ext/opentelemetry-ext-jaeger/build/* diff --git a/.isort.cfg b/.isort.cfg index 43cafae19..4bf64a34f 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -12,3 +12,4 @@ line_length=79 ; ) ; docs: https://github.com/timothycrosley/isort#multi-line-output-modes multi_line_output=3 +skip_glob=ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen/* diff --git a/.pylintrc b/.pylintrc index 8130305d7..782fc5870 100644 --- a/.pylintrc +++ b/.pylintrc @@ -7,7 +7,7 @@ extension-pkg-whitelist= # Add files or directories to the blacklist. They should be base names, not # paths. -ignore=CVS +ignore=CVS,gen # Add files or directories matching the regex patterns to the blacklist. The # regex matches against base names, not paths. diff --git a/tox.ini b/tox.ini index f8d2f55d2..0db2364f1 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,8 @@ skipsdist = True skip_missing_interpreters = True envlist = - py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-http-requests} - pypy3-test-{api,sdk,example-app,ext-wsgi,ext-http-requests} + py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger} + pypy3-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger} lint py37-{mypy,mypyinstalled} docs @@ -23,6 +23,7 @@ changedir = test-api: opentelemetry-api/tests test-sdk: opentelemetry-sdk/tests test-ext-http-requests: ext/opentelemetry-ext-http-requests/tests + test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests test-example-app: examples/opentelemetry-example-app/tests @@ -38,6 +39,8 @@ commands_pre = ext: pip install {toxinidir}/opentelemetry-api wsgi: pip install {toxinidir}/ext/opentelemetry-ext-wsgi http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests + jaeger: pip install {toxinidir}/opentelemetry-sdk + jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger ; Using file:// here because otherwise tox invokes just "pip install ; opentelemetry-api", leading to an error @@ -68,6 +71,7 @@ commands_pre = pip install -e {toxinidir}/opentelemetry-sdk pip install -e {toxinidir}/ext/opentelemetry-ext-azure-monitor pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests + pip install -e {toxinidir}/ext/opentelemetry-ext-jaeger pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi pip install -e {toxinidir}/examples/opentelemetry-example-app @@ -84,6 +88,8 @@ commands = ext/opentelemetry-ext-azure-monitor/tests/ \ ext/opentelemetry-ext-http-requests/src/ \ ext/opentelemetry-ext-http-requests/tests/ \ + ext/opentelemetry-ext-jaeger/src/opentelemetry \ + ext/opentelemetry-ext-jaeger/tests/ \ ext/opentelemetry-ext-wsgi/tests/ \ examples/opentelemetry-example-app/src/opentelemetry_example_app/ \ examples/opentelemetry-example-app/tests/ From 49b63f95a1428ac2862ff02bd6bdc1785764d547 Mon Sep 17 00:00:00 2001 From: Johannes Liebermann Date: Mon, 21 Oct 2019 17:27:32 +0200 Subject: [PATCH 028/145] Fix mypy errors (#229) In particular, the following errors are fixed in this commit: * Don't return False in __exit__ Returning a literal causes a mypy error when combined with the `typing.Optional[bool]` type hint. Furthermore, exception handling is the same when returning `False` and when returning `None` (the exception is re-raised). Therefore, it's simpler to remove the return statement and change the type hint to `None`. * Correctly initialize nested tuple Tuples of length 1 should be initialized with a trailing comma to be properly interpreted. * Pass correct type to use_context() in test * Add type annotations for test helper functions Since we have `disallow_untyped_calls = True` in our mypy config for tests, we must add type annotations to any function that is called from a test. Addditionally, bump minimal mypy version to 0.740 to consistently reproduce these errors. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 0db2364f1..19816d3d9 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,7 @@ python = [testenv] deps = - mypy,mypyinstalled: mypy~=0.711 + mypy,mypyinstalled: mypy~=0.740 setenv = mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/ From 47bafab91b56dedbcae9259a834c2a7c354f36a8 Mon Sep 17 00:00:00 2001 From: Johannes Liebermann Date: Thu, 24 Oct 2019 16:46:23 +0200 Subject: [PATCH 029/145] OpenTracing Bridge - Initial implementation (#211) Initial implementation, without baggage support. --- tox.ini | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 19816d3d9..a6abe8e15 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,8 @@ skipsdist = True skip_missing_interpreters = True envlist = - py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger} - pypy3-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger} + py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger,opentracing-shim} + pypy3-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger,opentracing-shim} lint py37-{mypy,mypyinstalled} docs @@ -26,6 +26,7 @@ changedir = test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests test-example-app: examples/opentelemetry-example-app/tests + test-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests commands_pre = ; Install without -e to test the actual installation @@ -41,6 +42,7 @@ commands_pre = http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests jaeger: pip install {toxinidir}/opentelemetry-sdk jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger + opentracing-shim: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-opentracing-shim ; Using file:// here because otherwise tox invokes just "pip install ; opentelemetry-api", leading to an error @@ -74,6 +76,7 @@ commands_pre = pip install -e {toxinidir}/ext/opentelemetry-ext-jaeger pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi pip install -e {toxinidir}/examples/opentelemetry-example-app + pip install -e {toxinidir}/ext/opentelemetry-ext-opentracing-shim commands = ; Prefer putting everything in one pylint command to profit from duplication @@ -90,6 +93,8 @@ commands = ext/opentelemetry-ext-http-requests/tests/ \ ext/opentelemetry-ext-jaeger/src/opentelemetry \ ext/opentelemetry-ext-jaeger/tests/ \ + ext/opentelemetry-ext-opentracing-shim/src/ \ + ext/opentelemetry-ext-opentracing-shim/tests/ \ ext/opentelemetry-ext-wsgi/tests/ \ examples/opentelemetry-example-app/src/opentelemetry_example_app/ \ examples/opentelemetry-example-app/tests/ From c7f20df26428e76e78923e84e2696f98d4de5945 Mon Sep 17 00:00:00 2001 From: Chris Kleinknecht Date: Thu, 24 Oct 2019 07:57:52 -0700 Subject: [PATCH 030/145] Add sampler API, use in SDK tracer (#225) --- .flake8 | 16 ++++++++++++++-- .pylintrc | 3 ++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.flake8 b/.flake8 index a3411a161..5abd0630e 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,15 @@ [flake8] -ignore = E501,W503,E203 -exclude = .svn,CVS,.bzr,.hg,.git,__pycache__,.tox,ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen/,ext/opentelemetry-ext-jaeger/build/* +ignore = + E501 # line too long, defer to black + F401 # unused import, defer to pylint + W503 # allow line breaks after binary ops, not after +exclude = + .bzr + .git + .hg + .svn + .tox + CVS + __pycache__ + ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen/ + ext/opentelemetry-ext-jaeger/build/* diff --git a/.pylintrc b/.pylintrc index 782fc5870..1aa1e10d0 100644 --- a/.pylintrc +++ b/.pylintrc @@ -68,7 +68,8 @@ disable=missing-docstring, ungrouped-imports, # Leave this up to isort wrong-import-order, # Leave this up to isort bad-continuation, # Leave this up to black - line-too-long # Leave this up to black + line-too-long, # Leave this up to black + exec-used # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option From 38c8c0fbc763ed8a8fa746e286b99845b04f7718 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Tue, 29 Oct 2019 11:01:59 -0700 Subject: [PATCH 031/145] Adding w3c tracecontext integration test (#228) Verifying that our tracecontext is compliant with the w3c tracecontext reference is valuable. Adding a tox command to verify that the TraceContext propagator adheres to the w3c spec. The tracecontexthttptextformat is now completely compliant with the w3c tracecontext test suite. --- .flake8 | 1 + .isort.cfg | 1 + tox.ini | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/.flake8 b/.flake8 index 5abd0630e..a0924f947 100644 --- a/.flake8 +++ b/.flake8 @@ -10,6 +10,7 @@ exclude = .svn .tox CVS + target __pycache__ ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen/ ext/opentelemetry-ext-jaeger/build/* diff --git a/.isort.cfg b/.isort.cfg index 4bf64a34f..96011ae93 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -12,4 +12,5 @@ line_length=79 ; ) ; docs: https://github.com/timothycrosley/isort#multi-line-output-modes multi_line_output=3 +skip=target skip_glob=ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen/* diff --git a/tox.ini b/tox.ini index a6abe8e15..e30cb1a14 100644 --- a/tox.ini +++ b/tox.ini @@ -5,6 +5,7 @@ envlist = py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger,opentracing-shim} pypy3-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger,opentracing-shim} lint + py37-tracecontext py37-{mypy,mypyinstalled} docs @@ -111,3 +112,21 @@ changedir = docs commands = sphinx-build -W --keep-going -b html -T . _build/html + +[testenv:py37-tracecontext] +basepython: python3.7 +deps = + # needed for tracecontext + aiohttp~=3.6 + # needed for example trace integration + flask~=1.1 + requests~=2.7 + +commands_pre = + pip install -e {toxinidir}/opentelemetry-api + pip install -e {toxinidir}/opentelemetry-sdk + pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests + pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi + +commands = + {toxinidir}/scripts/tracecontext-integration-test.sh From 4e505248db4c87c55d292c26e0181477d14bd95f Mon Sep 17 00:00:00 2001 From: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> Date: Mon, 4 Nov 2019 14:57:02 -0800 Subject: [PATCH 033/145] Do not use latest sphinx-autodoc-typehints (#267) --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index e30cb1a14..9f114201a 100644 --- a/tox.ini +++ b/tox.ini @@ -106,7 +106,7 @@ commands = deps = sphinx~=2.1 sphinx-rtd-theme~=0.4 - sphinx-autodoc-typehints~=1.6 + sphinx-autodoc-typehints<=1.9 changedir = docs From ef96394c169c45ad6a4eba73cfe493a493a3cf00 Mon Sep 17 00:00:00 2001 From: Aliaksei Urbanski Date: Thu, 7 Nov 2019 03:11:45 +0300 Subject: [PATCH 034/145] Add test coverage collecting (#128) --- tox.ini | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 9f114201a..70afcb120 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,11 @@ skip_missing_interpreters = True envlist = py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger,opentracing-shim} pypy3-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger,opentracing-shim} + py3{4,5,6,7,8}-coverage + + ; Coverage is temporarily disabled for pypy3 due to the pytest bug. + ; pypy3-coverage + lint py37-tracecontext py37-{mypy,mypyinstalled} @@ -15,6 +20,8 @@ python = [testenv] deps = + test: pytest + coverage: pytest-cov mypy,mypyinstalled: mypy~=0.740 setenv = @@ -45,12 +52,24 @@ commands_pre = jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger opentracing-shim: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-opentracing-shim +; In order to get a healthy coverage report, +; we have to install packages in editable mode. + coverage: pip install -e {toxinidir}/opentelemetry-api + coverage: pip install -e {toxinidir}/opentelemetry-sdk + coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-azure-monitor + coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests + coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-jaeger + coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-opentracing-shim + coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi + coverage: pip install -e {toxinidir}/examples/opentelemetry-example-app + ; Using file:// here because otherwise tox invokes just "pip install ; opentelemetry-api", leading to an error mypyinstalled: pip install file://{toxinidir}/opentelemetry-api/ commands = - test: python -m unittest discover + test: pytest + coverage: {toxinidir}/scripts/coverage.sh mypy: mypy --namespace-packages opentelemetry-api/src/opentelemetry/ ; For test code, we don't want to enforce the full mypy strictness From c04bc874aee144a1fc76b263e55eefc399099f45 Mon Sep 17 00:00:00 2001 From: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> Date: Thu, 7 Nov 2019 15:13:18 -0800 Subject: [PATCH 035/145] Adding pymongo integration (#232) --- tox.ini | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 70afcb120..600d6b86c 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,8 @@ skipsdist = True skip_missing_interpreters = True envlist = - py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger,opentracing-shim} - pypy3-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger,opentracing-shim} + py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} + pypy3-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} py3{4,5,6,7,8}-coverage ; Coverage is temporarily disabled for pypy3 due to the pytest bug. @@ -32,6 +32,7 @@ changedir = test-sdk: opentelemetry-sdk/tests test-ext-http-requests: ext/opentelemetry-ext-http-requests/tests test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests + test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests test-example-app: examples/opentelemetry-example-app/tests test-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests @@ -47,6 +48,7 @@ commands_pre = example-app: pip install {toxinidir}/examples/opentelemetry-example-app ext: pip install {toxinidir}/opentelemetry-api wsgi: pip install {toxinidir}/ext/opentelemetry-ext-wsgi + pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests jaeger: pip install {toxinidir}/opentelemetry-sdk jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger @@ -94,6 +96,7 @@ commands_pre = pip install -e {toxinidir}/ext/opentelemetry-ext-azure-monitor pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests pip install -e {toxinidir}/ext/opentelemetry-ext-jaeger + pip install -e {toxinidir}/ext/opentelemetry-ext-pymongo pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi pip install -e {toxinidir}/examples/opentelemetry-example-app pip install -e {toxinidir}/ext/opentelemetry-ext-opentracing-shim @@ -115,6 +118,8 @@ commands = ext/opentelemetry-ext-jaeger/tests/ \ ext/opentelemetry-ext-opentracing-shim/src/ \ ext/opentelemetry-ext-opentracing-shim/tests/ \ + ext/opentelemetry-ext-pymongo/src/opentelemetry \ + ext/opentelemetry-ext-pymongo/tests/ \ ext/opentelemetry-ext-wsgi/tests/ \ examples/opentelemetry-example-app/src/opentelemetry_example_app/ \ examples/opentelemetry-example-app/tests/ From f4433d93326ee169a2fa93fb799059d5b9a4a549 Mon Sep 17 00:00:00 2001 From: Chris Kleinknecht Date: Tue, 12 Nov 2019 10:58:18 -0800 Subject: [PATCH 036/145] Bump sphinx-autodoc-typehints to 1.10.2 (#271) --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 600d6b86c..e0e076fe7 100644 --- a/tox.ini +++ b/tox.ini @@ -130,7 +130,7 @@ commands = deps = sphinx~=2.1 sphinx-rtd-theme~=0.4 - sphinx-autodoc-typehints<=1.9 + sphinx-autodoc-typehints~=1.10.2 changedir = docs From 5d00aeb550a28d0999ec544cf1f342eaad028f9c Mon Sep 17 00:00:00 2001 From: alrex Date: Fri, 15 Nov 2019 13:45:51 -0800 Subject: [PATCH 037/145] Skip pytest 5.2.3 (#293) --- tox.ini | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index e0e076fe7..30e1d3745 100644 --- a/tox.ini +++ b/tox.ini @@ -20,7 +20,10 @@ python = [testenv] deps = - test: pytest + ; skip 5.2.3 pytest due to bug + ; https://github.com/pytest-dev/pytest/issues/6194 + test: pytest!=5.2.3 + coverage: pytest!=5.2.3 coverage: pytest-cov mypy,mypyinstalled: mypy~=0.740 From 3b89d506d179ec68bd0239a01b14587b2eaf9368 Mon Sep 17 00:00:00 2001 From: alrex Date: Fri, 15 Nov 2019 18:10:21 -0800 Subject: [PATCH 038/145] Adding more documentation around examples (#277) --- tox.ini | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 30e1d3745..8f0d02d1c 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,8 @@ skipsdist = True skip_missing_interpreters = True envlist = - py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} - pypy3-test-{api,sdk,example-app,ext-wsgi,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} + py3{4,5,6,7,8}-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} + pypy3-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} py3{4,5,6,7,8}-coverage ; Coverage is temporarily disabled for pypy3 due to the pytest bug. @@ -38,6 +38,8 @@ changedir = test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests test-example-app: examples/opentelemetry-example-app/tests + test-example-basic-tracer: examples/basic_tracer/tests + test-example-http: examples/http/tests test-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests commands_pre = @@ -49,6 +51,14 @@ commands_pre = example-app: pip install {toxinidir}/ext/opentelemetry-ext-http-requests example-app: pip install {toxinidir}/ext/opentelemetry-ext-wsgi example-app: pip install {toxinidir}/examples/opentelemetry-example-app + example-basic-tracer: pip install -e {toxinidir}/opentelemetry-api + example-basic-tracer: pip install -e {toxinidir}/opentelemetry-sdk + example-http: pip install -e {toxinidir}/opentelemetry-api + example-http: pip install -e {toxinidir}/opentelemetry-sdk + example-http: pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests + example-http: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi + example-http: pip install -r {toxinidir}/examples/http/requirements.txt + ext: pip install {toxinidir}/opentelemetry-api wsgi: pip install {toxinidir}/ext/opentelemetry-ext-wsgi pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo @@ -125,7 +135,9 @@ commands = ext/opentelemetry-ext-pymongo/tests/ \ ext/opentelemetry-ext-wsgi/tests/ \ examples/opentelemetry-example-app/src/opentelemetry_example_app/ \ - examples/opentelemetry-example-app/tests/ + examples/opentelemetry-example-app/tests/ \ + examples/basic_tracer/ \ + examples/http/ flake8 . isort --check-only --diff --recursive . From 9fd4d2a84f6e2b03e4eab95a4e7f32130d2a04a5 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Thu, 21 Nov 2019 08:13:14 -0800 Subject: [PATCH 039/145] Remove Azure Exporters out of main repo (master) (#272) --- tox.ini | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tox.ini b/tox.ini index 8f0d02d1c..88f1a8589 100644 --- a/tox.ini +++ b/tox.ini @@ -71,7 +71,6 @@ commands_pre = ; we have to install packages in editable mode. coverage: pip install -e {toxinidir}/opentelemetry-api coverage: pip install -e {toxinidir}/opentelemetry-sdk - coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-azure-monitor coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-jaeger coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-opentracing-shim @@ -106,7 +105,6 @@ deps = commands_pre = pip install -e {toxinidir}/opentelemetry-api pip install -e {toxinidir}/opentelemetry-sdk - pip install -e {toxinidir}/ext/opentelemetry-ext-azure-monitor pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests pip install -e {toxinidir}/ext/opentelemetry-ext-jaeger pip install -e {toxinidir}/ext/opentelemetry-ext-pymongo @@ -122,9 +120,6 @@ commands = opentelemetry-api/tests/ \ opentelemetry-sdk/src/opentelemetry \ opentelemetry-sdk/tests/ \ - ext/opentelemetry-ext-azure-monitor/examples/ \ - ext/opentelemetry-ext-azure-monitor/src/ \ - ext/opentelemetry-ext-azure-monitor/tests/ \ ext/opentelemetry-ext-http-requests/src/ \ ext/opentelemetry-ext-http-requests/tests/ \ ext/opentelemetry-ext-jaeger/src/opentelemetry \ From aa0623b662aaee80a0a48fa4f400c92896bf7191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Sat, 23 Nov 2019 01:27:55 +0100 Subject: [PATCH 040/145] Add Flask integration based on WSGI ext (#206) The flask integration has (only) two advantages over the plain WSGI middleware approach: - It can use the endpoint as span name (which is lower cardinality than the route; cf #270) - It can set the http.route attribute. In addition, it also has an easier syntax to enable (you don't have to know about Flask.wsgi_app). --- tox.ini | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 88f1a8589..f5624503b 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,10 @@ skipsdist = True skip_missing_interpreters = True envlist = - py3{4,5,6,7,8}-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} - pypy3-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} + py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} + pypy3-test-{api,sdk,example-app,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} + py3{4,5,6,7,8}-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} + pypy3-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} py3{4,5,6,7,8}-coverage ; Coverage is temporarily disabled for pypy3 due to the pytest bug. @@ -37,6 +39,7 @@ changedir = test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests + test-ext-flask: ext/opentelemetry-ext-flask/tests test-example-app: examples/opentelemetry-example-app/tests test-example-basic-tracer: examples/basic_tracer/tests test-example-http: examples/http/tests @@ -50,6 +53,7 @@ commands_pre = example-app: pip install {toxinidir}/opentelemetry-sdk example-app: pip install {toxinidir}/ext/opentelemetry-ext-http-requests example-app: pip install {toxinidir}/ext/opentelemetry-ext-wsgi + example-app: pip install {toxinidir}/ext/opentelemetry-ext-flask example-app: pip install {toxinidir}/examples/opentelemetry-example-app example-basic-tracer: pip install -e {toxinidir}/opentelemetry-api example-basic-tracer: pip install -e {toxinidir}/opentelemetry-sdk @@ -60,7 +64,9 @@ commands_pre = example-http: pip install -r {toxinidir}/examples/http/requirements.txt ext: pip install {toxinidir}/opentelemetry-api - wsgi: pip install {toxinidir}/ext/opentelemetry-ext-wsgi + wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-testutil + wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-wsgi + flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test] pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests jaeger: pip install {toxinidir}/opentelemetry-sdk @@ -74,7 +80,9 @@ commands_pre = coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-jaeger coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-opentracing-shim + coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-testutil coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi + coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-flask[test] coverage: pip install -e {toxinidir}/examples/opentelemetry-example-app ; Using file:// here because otherwise tox invokes just "pip install @@ -108,7 +116,9 @@ commands_pre = pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests pip install -e {toxinidir}/ext/opentelemetry-ext-jaeger pip install -e {toxinidir}/ext/opentelemetry-ext-pymongo + pip install -e {toxinidir}/ext/opentelemetry-ext-testutil pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi + pip install -e {toxinidir}/ext/opentelemetry-ext-flask[test] pip install -e {toxinidir}/examples/opentelemetry-example-app pip install -e {toxinidir}/ext/opentelemetry-ext-opentracing-shim @@ -128,7 +138,11 @@ commands = ext/opentelemetry-ext-opentracing-shim/tests/ \ ext/opentelemetry-ext-pymongo/src/opentelemetry \ ext/opentelemetry-ext-pymongo/tests/ \ + ext/opentelemetry-ext-testutil/src/opentelemetry \ + ext/opentelemetry-ext-wsgi/src/ \ ext/opentelemetry-ext-wsgi/tests/ \ + ext/opentelemetry-ext-flask/src/ \ + ext/opentelemetry-ext-flask/tests/ \ examples/opentelemetry-example-app/src/opentelemetry_example_app/ \ examples/opentelemetry-example-app/tests/ \ examples/basic_tracer/ \ @@ -161,6 +175,7 @@ commands_pre = pip install -e {toxinidir}/opentelemetry-sdk pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi + pip install -e {toxinidir}/ext/opentelemetry-ext-flask commands = {toxinidir}/scripts/tracecontext-integration-test.sh From e985bec6ed8314f336451b525650914fb65417db Mon Sep 17 00:00:00 2001 From: Johannes Liebermann Date: Mon, 25 Nov 2019 22:09:44 +0100 Subject: [PATCH 041/145] Add documentation for the OpenTracing shim (#244) --- tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index f5624503b..9d8e679df 100644 --- a/tox.ini +++ b/tox.ini @@ -155,6 +155,8 @@ deps = sphinx~=2.1 sphinx-rtd-theme~=0.4 sphinx-autodoc-typehints~=1.10.2 + opentracing~=2.2.0 + Deprecated>=1.2.6 changedir = docs From 44b64150f18aeb81525c41fa03953441ab42a0ff Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 27 Nov 2019 13:40:10 -0600 Subject: [PATCH 042/145] Fix isort issues (#309) --- .isort.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/.isort.cfg b/.isort.cfg index 96011ae93..31620ab99 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -14,3 +14,4 @@ line_length=79 multi_line_output=3 skip=target skip_glob=ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen/* +known_first_party=opentelemetry From d79ca4c148194ac08c3e8ac66aace28939a1a83b Mon Sep 17 00:00:00 2001 From: alrex Date: Wed, 27 Nov 2019 14:19:17 -0800 Subject: [PATCH 043/145] Always recreate lint env (#310) --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 9d8e679df..7dc2eb6df 100644 --- a/tox.ini +++ b/tox.ini @@ -104,6 +104,7 @@ commands = [testenv:lint] basepython: python3.7 +recreate = True deps = pylint~=2.3 flake8~=3.7 From 17b58d131dc4151f976d2eb2e823024ce51fe549 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Mon, 2 Dec 2019 21:25:53 -0800 Subject: [PATCH 044/145] Implement LabelSet for metrics (#258) The primary purpose of LabelSets are to have an optimal way of re-using handles with the same label values. We achieve this by having the keys and values of the labels encoded and stored in each LabelSet instance, so we can have an easy lookup to the corresponding handle for each metric instrument. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 7dc2eb6df..9898094ca 100644 --- a/tox.ini +++ b/tox.ini @@ -27,7 +27,7 @@ deps = test: pytest!=5.2.3 coverage: pytest!=5.2.3 coverage: pytest-cov - mypy,mypyinstalled: mypy~=0.740 + mypy,mypyinstalled: mypy==0.740 setenv = mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/ From 95deb74b8bde36c6f932b5610e048eb5baab48e7 Mon Sep 17 00:00:00 2001 From: Chris Kleinknecht Date: Fri, 6 Dec 2019 10:49:16 -0800 Subject: [PATCH 045/145] Remove obsolete version requirement for pytest (#317) --- tox.ini | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 9898094ca..50e89d2f6 100644 --- a/tox.ini +++ b/tox.ini @@ -22,10 +22,8 @@ python = [testenv] deps = - ; skip 5.2.3 pytest due to bug - ; https://github.com/pytest-dev/pytest/issues/6194 - test: pytest!=5.2.3 - coverage: pytest!=5.2.3 + test: pytest + coverage: pytest coverage: pytest-cov mypy,mypyinstalled: mypy==0.740 From 75eb39327bec4302e90f755caae8368ccf10a867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Tue, 10 Dec 2019 00:26:00 +0100 Subject: [PATCH 046/145] Update WSGI & Flask integrations to follow new semantic conventions (#299) Updates flask & WSGI integrations to follow new semantic conventions for HTTP as of #263. --- .flake8 | 1 + 1 file changed, 1 insertion(+) diff --git a/.flake8 b/.flake8 index a0924f947..8fc8507d9 100644 --- a/.flake8 +++ b/.flake8 @@ -3,6 +3,7 @@ ignore = E501 # line too long, defer to black F401 # unused import, defer to pylint W503 # allow line breaks after binary ops, not after + E203 # allow whitespace before ':' (https://github.com/psf/black#slices) exclude = .bzr .git From 0f88a05b5e30d5520d254b55673c46623ebb3768 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 9 Dec 2019 17:26:42 -0600 Subject: [PATCH 047/145] Add posargs (#324) Fixes #323 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 50e89d2f6..782ef88ba 100644 --- a/tox.ini +++ b/tox.ini @@ -88,7 +88,7 @@ commands_pre = mypyinstalled: pip install file://{toxinidir}/opentelemetry-api/ commands = - test: pytest + test: pytest {posargs} coverage: {toxinidir}/scripts/coverage.sh mypy: mypy --namespace-packages opentelemetry-api/src/opentelemetry/ From f5ca0bffadec7e6e39598a5c97a56bab56419214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Tue, 10 Dec 2019 00:39:26 +0100 Subject: [PATCH 048/145] Do full Sphinx build every time to not hide errors (#322) --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 782ef88ba..0ccef88f2 100644 --- a/tox.ini +++ b/tox.ini @@ -160,7 +160,7 @@ deps = changedir = docs commands = - sphinx-build -W --keep-going -b html -T . _build/html + sphinx-build -E -a -W --keep-going -b html -T . _build/html [testenv:py37-tracecontext] basepython: python3.7 From f6d132f61da031ef164e27ef2aa2d8ad5865cf5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Tue, 10 Dec 2019 02:54:56 +0100 Subject: [PATCH 049/145] Add eachdist.py to simplify build (#291) --- .flake8 | 2 ++ .isort.cfg | 2 +- eachdist.ini | 16 +++++++++++ tox.ini | 77 +++++++++++++--------------------------------------- 4 files changed, 38 insertions(+), 59 deletions(-) create mode 100644 eachdist.ini diff --git a/.flake8 b/.flake8 index 8fc8507d9..6d1c2bc17 100644 --- a/.flake8 +++ b/.flake8 @@ -11,6 +11,8 @@ exclude = .svn .tox CVS + .venv*/ + venv*/ target __pycache__ ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen/ diff --git a/.isort.cfg b/.isort.cfg index 31620ab99..4e7bff8bb 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -13,5 +13,5 @@ line_length=79 ; docs: https://github.com/timothycrosley/isort#multi-line-output-modes multi_line_output=3 skip=target -skip_glob=ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen/* +skip_glob=ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen/*,.venv*/*,venv*/* known_first_party=opentelemetry diff --git a/eachdist.ini b/eachdist.ini new file mode 100644 index 000000000..8baab0c2e --- /dev/null +++ b/eachdist.ini @@ -0,0 +1,16 @@ +# These will be sorted first in that order. +# All packages that are depended upon by others should be listed here. +[DEFAULT] +sortfirst= + opentelemetry-api + opentelemetry-sdk + ext/opentelemetry-ext-wsgi + ext/* + +[lintroots] +extraroots=examples/*,scripts/ +subglob=*.py,tests/,test/,src/*,examples/* + +[testroots] +extraroots=examples/*,tests/ +subglob=tests/,test/ diff --git a/tox.ini b/tox.ini index 0ccef88f2..80123a5ea 100644 --- a/tox.ini +++ b/tox.ini @@ -22,10 +22,11 @@ python = [testenv] deps = + -c dev-requirements.txt test: pytest coverage: pytest coverage: pytest-cov - mypy,mypyinstalled: mypy==0.740 + mypy,mypyinstalled: mypy setenv = mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/ @@ -73,15 +74,7 @@ commands_pre = ; In order to get a healthy coverage report, ; we have to install packages in editable mode. - coverage: pip install -e {toxinidir}/opentelemetry-api - coverage: pip install -e {toxinidir}/opentelemetry-sdk - coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests - coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-jaeger - coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-opentracing-shim - coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-testutil - coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi - coverage: pip install -e {toxinidir}/ext/opentelemetry-ext-flask[test] - coverage: pip install -e {toxinidir}/examples/opentelemetry-example-app + coverage: python {toxinidir}/scripts/eachdist.py install --editable ; Using file:// here because otherwise tox invokes just "pip install ; opentelemetry-api", leading to an error @@ -104,56 +97,24 @@ commands = basepython: python3.7 recreate = True deps = - pylint~=2.3 - flake8~=3.7 - isort~=4.3 - black>=19.3b0,==19.* + -c dev-requirements.txt + pylint + flake8 + isort + black commands_pre = - pip install -e {toxinidir}/opentelemetry-api - pip install -e {toxinidir}/opentelemetry-sdk - pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests - pip install -e {toxinidir}/ext/opentelemetry-ext-jaeger - pip install -e {toxinidir}/ext/opentelemetry-ext-pymongo - pip install -e {toxinidir}/ext/opentelemetry-ext-testutil - pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi - pip install -e {toxinidir}/ext/opentelemetry-ext-flask[test] - pip install -e {toxinidir}/examples/opentelemetry-example-app - pip install -e {toxinidir}/ext/opentelemetry-ext-opentracing-shim + python scripts/eachdist.py install --editable commands = -; Prefer putting everything in one pylint command to profit from duplication -; warnings. - black --check --diff . - pylint opentelemetry-api/src/opentelemetry \ - opentelemetry-api/tests/ \ - opentelemetry-sdk/src/opentelemetry \ - opentelemetry-sdk/tests/ \ - ext/opentelemetry-ext-http-requests/src/ \ - ext/opentelemetry-ext-http-requests/tests/ \ - ext/opentelemetry-ext-jaeger/src/opentelemetry \ - ext/opentelemetry-ext-jaeger/tests/ \ - ext/opentelemetry-ext-opentracing-shim/src/ \ - ext/opentelemetry-ext-opentracing-shim/tests/ \ - ext/opentelemetry-ext-pymongo/src/opentelemetry \ - ext/opentelemetry-ext-pymongo/tests/ \ - ext/opentelemetry-ext-testutil/src/opentelemetry \ - ext/opentelemetry-ext-wsgi/src/ \ - ext/opentelemetry-ext-wsgi/tests/ \ - ext/opentelemetry-ext-flask/src/ \ - ext/opentelemetry-ext-flask/tests/ \ - examples/opentelemetry-example-app/src/opentelemetry_example_app/ \ - examples/opentelemetry-example-app/tests/ \ - examples/basic_tracer/ \ - examples/http/ - flake8 . - isort --check-only --diff --recursive . + python scripts/eachdist.py lint --check-only [testenv:docs] deps = - sphinx~=2.1 - sphinx-rtd-theme~=0.4 - sphinx-autodoc-typehints~=1.10.2 + -c dev-requirements.txt + sphinx + sphinx-rtd-theme + sphinx-autodoc-typehints opentracing~=2.2.0 Deprecated>=1.2.6 @@ -172,11 +133,11 @@ deps = requests~=2.7 commands_pre = - pip install -e {toxinidir}/opentelemetry-api - pip install -e {toxinidir}/opentelemetry-sdk - pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests - pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi - pip install -e {toxinidir}/ext/opentelemetry-ext-flask + pip install -e {toxinidir}/opentelemetry-api \ + -e {toxinidir}/opentelemetry-sdk \ + -e {toxinidir}/ext/opentelemetry-ext-http-requests \ + -e {toxinidir}/ext/opentelemetry-ext-wsgi \ + -e {toxinidir}/ext/opentelemetry-ext-flask commands = {toxinidir}/scripts/tracecontext-integration-test.sh From 748339ce5cd704b8ce9efa767dc289acc830dbe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Wed, 11 Dec 2019 18:55:54 +0100 Subject: [PATCH 050/145] Work around build failures (#330) --- tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index 80123a5ea..520d6ee39 100644 --- a/tox.ini +++ b/tox.ini @@ -131,6 +131,8 @@ deps = # needed for example trace integration flask~=1.1 requests~=2.7 + # Pinned due to https://github.com/open-telemetry/opentelemetry-python/issues/329 + multidict==4.6.1 commands_pre = pip install -e {toxinidir}/opentelemetry-api \ From ee50e5073e5dc7db5dbd8231dd697d187b67a5e5 Mon Sep 17 00:00:00 2001 From: alrex Date: Thu, 12 Dec 2019 10:18:15 -0800 Subject: [PATCH 051/145] Adding docs for sdk and integrations (#319) Adding documentation that was previously missing for multiple sdks and integrations. Signed-off-by: Alex Boten --- tox.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tox.ini b/tox.ini index 520d6ee39..2ded7d1b7 100644 --- a/tox.ini +++ b/tox.ini @@ -117,6 +117,9 @@ deps = sphinx-autodoc-typehints opentracing~=2.2.0 Deprecated>=1.2.6 + thrift>=0.10.0 + pymongo ~= 3.1 + flask~=1.0 changedir = docs From 8b0cb2fa2fb7dd806c347417c54cc37546906700 Mon Sep 17 00:00:00 2001 From: alrex Date: Sun, 29 Dec 2019 22:02:55 -0800 Subject: [PATCH 052/145] Adding Zipkin exporter (#320) Signed-off-by: Alex Boten --- tox.ini | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 2ded7d1b7..8a4321a95 100644 --- a/tox.ini +++ b/tox.ini @@ -2,10 +2,10 @@ skipsdist = True skip_missing_interpreters = True envlist = - py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} - pypy3-test-{api,sdk,example-app,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} - py3{4,5,6,7,8}-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} - pypy3-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,opentracing-shim} + py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,ext-zipkin,opentracing-shim} + pypy3-test-{api,sdk,example-app,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,ext-zipkin,opentracing-shim} + py3{4,5,6,7,8}-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,ext-zipkin,opentracing-shim} + pypy3-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,ext-zipkin,opentracing-shim} py3{4,5,6,7,8}-coverage ; Coverage is temporarily disabled for pypy3 due to the pytest bug. @@ -38,6 +38,7 @@ changedir = test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests + test-ext-zipkin: ext/opentelemetry-ext-zipkin/tests test-ext-flask: ext/opentelemetry-ext-flask/tests test-example-app: examples/opentelemetry-example-app/tests test-example-basic-tracer: examples/basic_tracer/tests @@ -71,6 +72,7 @@ commands_pre = jaeger: pip install {toxinidir}/opentelemetry-sdk jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger opentracing-shim: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-opentracing-shim + zipkin: pip install {toxinidir}/ext/opentelemetry-ext-zipkin ; In order to get a healthy coverage report, ; we have to install packages in editable mode. From f28e259eb5e4eebec43ecc14fd46e835d98c868a Mon Sep 17 00:00:00 2001 From: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> Date: Sun, 5 Jan 2020 09:41:15 -0800 Subject: [PATCH 053/145] Adding DB API integration + MySQL connector integration (#264) Adding the ext.dbapi and ext.mysql package. --- tox.ini | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 8a4321a95..9f2741db8 100644 --- a/tox.ini +++ b/tox.ini @@ -2,10 +2,10 @@ skipsdist = True skip_missing_interpreters = True envlist = - py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,ext-zipkin,opentracing-shim} - pypy3-test-{api,sdk,example-app,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,ext-zipkin,opentracing-shim} - py3{4,5,6,7,8}-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,ext-zipkin,opentracing-shim} - pypy3-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-pymongo,ext-zipkin,opentracing-shim} + py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-dbapi,ext-mysql,ext-pymongo,ext-zipkin,opentracing-shim} + pypy3-test-{api,sdk,example-app,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-dbapi,ext-mysql,ext-pymongo,ext-zipkin,opentracing-shim} + py3{4,5,6,7,8}-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-dbapi,ext-mysql,ext-pymongo,ext-zipkin,opentracing-shim} + pypy3-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-dbapi,ext-mysql,ext-pymongo,ext-zipkin,opentracing-shim} py3{4,5,6,7,8}-coverage ; Coverage is temporarily disabled for pypy3 due to the pytest bug. @@ -36,6 +36,8 @@ changedir = test-sdk: opentelemetry-sdk/tests test-ext-http-requests: ext/opentelemetry-ext-http-requests/tests test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests + test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests + test-ext-mysql: ext/opentelemetry-ext-mysql/tests test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests test-ext-zipkin: ext/opentelemetry-ext-zipkin/tests @@ -67,6 +69,9 @@ commands_pre = wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-testutil wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-wsgi flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test] + dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi + mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi + mysql: pip install {toxinidir}/ext/opentelemetry-ext-mysql pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests jaeger: pip install {toxinidir}/opentelemetry-sdk From e43ee892efd40263279b14cc5539960f6782cc78 Mon Sep 17 00:00:00 2001 From: alrex Date: Tue, 7 Jan 2020 09:58:27 -0800 Subject: [PATCH 054/145] Using InMemorySpanExporter for wsgi/flask tests (#306) The InMemorySpanExporter provides a friendly interface to retrieving span information, reducing the need for mocking in unit tests. Signed-off-by: Alex Boten --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 9f2741db8..1aca91e75 100644 --- a/tox.ini +++ b/tox.ini @@ -68,6 +68,7 @@ commands_pre = ext: pip install {toxinidir}/opentelemetry-api wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-testutil wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-wsgi + wsgi,flask: pip install {toxinidir}/opentelemetry-sdk flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test] dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi From 8b08ed0e60975e76ea4001030827626345bca92d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez?= Date: Mon, 13 Jan 2020 20:52:23 +0100 Subject: [PATCH 055/145] Remove pinned multidict (#364) --- tox.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/tox.ini b/tox.ini index 1aca91e75..642a8a556 100644 --- a/tox.ini +++ b/tox.ini @@ -142,8 +142,6 @@ deps = # needed for example trace integration flask~=1.1 requests~=2.7 - # Pinned due to https://github.com/open-telemetry/opentelemetry-python/issues/329 - multidict==4.6.1 commands_pre = pip install -e {toxinidir}/opentelemetry-api \ From ee2796a924b1a1f84cb911d7cfab39ccd218a57a Mon Sep 17 00:00:00 2001 From: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> Date: Tue, 21 Jan 2020 16:32:38 -0800 Subject: [PATCH 056/145] Adding psycopg2 integration (#298) --- tox.ini | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 642a8a556..d077d0789 100644 --- a/tox.ini +++ b/tox.ini @@ -2,9 +2,9 @@ skipsdist = True skip_missing_interpreters = True envlist = - py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-dbapi,ext-mysql,ext-pymongo,ext-zipkin,opentracing-shim} + py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-dbapi,ext-mysql,ext-psycopg2,ext-pymongo,ext-zipkin,opentracing-shim} pypy3-test-{api,sdk,example-app,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-dbapi,ext-mysql,ext-pymongo,ext-zipkin,opentracing-shim} - py3{4,5,6,7,8}-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-dbapi,ext-mysql,ext-pymongo,ext-zipkin,opentracing-shim} + py3{4,5,6,7,8}-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-dbapi,ext-mysql,ext-psycopg2,ext-pymongo,ext-zipkin,opentracing-shim} pypy3-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-dbapi,ext-mysql,ext-pymongo,ext-zipkin,opentracing-shim} py3{4,5,6,7,8}-coverage @@ -39,6 +39,7 @@ changedir = test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests test-ext-mysql: ext/opentelemetry-ext-mysql/tests test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests + test-ext-psycopg2: ext/opentelemetry-ext-psycopg2/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests test-ext-zipkin: ext/opentelemetry-ext-zipkin/tests test-ext-flask: ext/opentelemetry-ext-flask/tests @@ -74,6 +75,8 @@ commands_pre = mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi mysql: pip install {toxinidir}/ext/opentelemetry-ext-mysql pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo + psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-dbapi + psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-psycopg2 http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests jaeger: pip install {toxinidir}/opentelemetry-sdk jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger From 35001a0c697908c0727cf215d62958ee95468122 Mon Sep 17 00:00:00 2001 From: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> Date: Fri, 7 Feb 2020 13:55:09 -0800 Subject: [PATCH 057/145] Add pymongo functional tests (#340) --- tox.ini | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index d077d0789..4195e8629 100644 --- a/tox.ini +++ b/tox.ini @@ -15,10 +15,11 @@ envlist = py37-tracecontext py37-{mypy,mypyinstalled} docs + docker-tests [travis] python = - 3.7: py37, lint, docs + 3.7: py37, lint, docs, docker-tests [testenv] deps = @@ -155,3 +156,23 @@ commands_pre = commands = {toxinidir}/scripts/tracecontext-integration-test.sh + +[testenv:docker-tests] +deps = + pytest + docker-compose >= 1.25.2 + pymongo ~= 3.1 + +changedir = + ext/opentelemetry-ext-docker-tests/tests + +commands_pre = + pip install -e {toxinidir}/opentelemetry-api \ + -e {toxinidir}/opentelemetry-sdk \ + -e {toxinidir}/ext/opentelemetry-ext-pymongo + - docker-compose up -d +commands = + pytest {posargs} + +commands_post = + docker-compose down \ No newline at end of file From 2b2a5127245c286e1e83f52f4e3210d7a922280d Mon Sep 17 00:00:00 2001 From: alrex Date: Thu, 13 Feb 2020 15:18:39 -0800 Subject: [PATCH 058/145] Adding Context API (#395) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change implements the Context API portion of OTEP #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. Co-authored-by: Diego Hurtado Co-authored-by: Mauricio Vásquez --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 4195e8629..51eda59d7 100644 --- a/tox.ini +++ b/tox.ini @@ -82,6 +82,7 @@ commands_pre = jaeger: pip install {toxinidir}/opentelemetry-sdk jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger opentracing-shim: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-opentracing-shim + zipkin: pip install {toxinidir}/opentelemetry-sdk zipkin: pip install {toxinidir}/ext/opentelemetry-ext-zipkin ; In order to get a healthy coverage report, From 260ca2591152ca5cc24e10f0e5a93f3d113049d1 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Tue, 18 Feb 2020 10:33:30 -0800 Subject: [PATCH 059/145] Upgrading tox envs to python3.8 (#426) Python3.8 is now stable, and we should run the common tasks under 3.8 instead of 3.7 --- tox.ini | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index 51eda59d7..5a69ca62b 100644 --- a/tox.ini +++ b/tox.ini @@ -12,14 +12,14 @@ envlist = ; pypy3-coverage lint - py37-tracecontext - py37-{mypy,mypyinstalled} + py38-tracecontext + py38-{mypy,mypyinstalled} docs docker-tests [travis] python = - 3.7: py37, lint, docs, docker-tests + 3.8: py38, lint, docs, docker-tests [testenv] deps = @@ -107,7 +107,7 @@ commands = [testenv:lint] -basepython: python3.7 +basepython: python3.8 recreate = True deps = -c dev-requirements.txt @@ -139,8 +139,8 @@ changedir = docs commands = sphinx-build -E -a -W --keep-going -b html -T . _build/html -[testenv:py37-tracecontext] -basepython: python3.7 +[testenv:py38-tracecontext] +basepython: python3.8 deps = # needed for tracecontext aiohttp~=3.6 From b259e320a63914945e195210567f51c06e2b9c29 Mon Sep 17 00:00:00 2001 From: joshuahlang Date: Thu, 20 Feb 2020 09:25:04 -0800 Subject: [PATCH 060/145] Clean up tox.ini (#417) Remove redundant environments and separate environments into logical groupings for maintainability. --- tox.ini | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 5a69ca62b..8d5fe1d9f 100644 --- a/tox.ini +++ b/tox.ini @@ -2,10 +2,70 @@ skipsdist = True skip_missing_interpreters = True envlist = - py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-dbapi,ext-mysql,ext-psycopg2,ext-pymongo,ext-zipkin,opentracing-shim} - pypy3-test-{api,sdk,example-app,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-dbapi,ext-mysql,ext-pymongo,ext-zipkin,opentracing-shim} - py3{4,5,6,7,8}-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-dbapi,ext-mysql,ext-psycopg2,ext-pymongo,ext-zipkin,opentracing-shim} - pypy3-test-{api,sdk,example-app,example-basic-tracer,example-http,ext-wsgi,ext-flask,ext-http-requests,ext-jaeger,ext-dbapi,ext-mysql,ext-pymongo,ext-zipkin,opentracing-shim} + + ; Environments are organized by individual package, allowing + ; for specifying supported Python versions per package. + ; opentelemetry-api + py3{4,5,6,7,8}-test-api + pypy3-test-api + + ; opentelemetry-sdk + py3{4,5,6,7,8}-test-sdk + pypy3-test-sdk + + ; opentelemetry-example-app + py3{4,5,6,7,8}-test-example-app + pypy3-test-example-app + + ; examples/basic_tracer + py3{4,5,6,7,8}-test-example-basic-tracer + pypy3-test-example-basic-tracer + + ; examples/http + py3{4,5,6,7,8}-test-example-http + pypy3-test-example-http + + ; opentelemetry-ext-dbapi + py3{4,5,6,7,8}-test-ext-dbapi + pypy3-test-ext-dbapi + + ; opentelemetry-ext-flask + py3{4,5,6,7,8}-test-ext-flask + pypy3-test-ext-flask + + ; opentelemetry-ext-http-requests + py3{4,5,6,7,8}-test-ext-http-requests + pypy3-test-ext-http-requests + + ; opentelemetry-ext-jaeger + py3{4,5,6,7,8}-test-ext-jaeger + pypy3-test-ext-jaeger + + ; opentelemetry-ext-mysql + py3{4,5,6,7,8}-test-ext-mysql + pypy3-test-ext-mysql + + ; opentelemetry-ext-psycopg2 + py3{4,5,6,7,8}-test-ext-psycopg2 + ; ext-psycopg2 intentionally excluded from pypy3 + + ; opentelemetry-ext-pymongo + py3{4,5,6,7,8}-test-ext-pymongo + pypy3-test-ext-pymongo + + ; opentelemetry-ext-wsgi + py3{4,5,6,7,8}-test-ext-wsgi + pypy3-test-ext-wsgi + + ; opentelemetry-ext-zipkin + py3{4,5,6,7,8}-test-ext-zipkin + pypy3-test-ext-zipkin + + ; opentelemetry-opentracing-shim + py3{4,5,6,7,8}-test-opentracing-shim + pypy3-test-opentracing-shim + + py3{4,5,6,7,8}-coverage ; Coverage is temporarily disabled for pypy3 due to the pytest bug. From 2256f07e53ad078a07c18a2e4b89459b4abe6ac3 Mon Sep 17 00:00:00 2001 From: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> Date: Fri, 21 Feb 2020 11:31:04 -0800 Subject: [PATCH 061/145] Prometheus metric exporter (#378) prometheus-exporter: initial commit --- tox.ini | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tox.ini b/tox.ini index 8d5fe1d9f..be7f1db9f 100644 --- a/tox.ini +++ b/tox.ini @@ -44,6 +44,10 @@ envlist = ; opentelemetry-ext-mysql py3{4,5,6,7,8}-test-ext-mysql pypy3-test-ext-mysql + + ; opentelemetry-ext-prometheus + py3{4,5,6,7,8}-test-ext-prometheus + pypy3-test-ext-prometheus ; opentelemetry-ext-psycopg2 py3{4,5,6,7,8}-test-ext-psycopg2 @@ -99,6 +103,7 @@ changedir = test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests test-ext-mysql: ext/opentelemetry-ext-mysql/tests + test-ext-prometheus: ext/opentelemetry-ext-prometheus/tests test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests test-ext-psycopg2: ext/opentelemetry-ext-psycopg2/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests @@ -135,6 +140,8 @@ commands_pre = dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi mysql: pip install {toxinidir}/ext/opentelemetry-ext-mysql + prometheus: pip install {toxinidir}/opentelemetry-sdk + prometheus: pip install {toxinidir}/ext/opentelemetry-ext-prometheus pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-dbapi psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-psycopg2 From 21cbbb6990c0b3b79d5fbe28502975a90404750f Mon Sep 17 00:00:00 2001 From: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> Date: Thu, 27 Feb 2020 16:37:24 -0800 Subject: [PATCH 062/145] OT Collector trace exporter (#405) Based on the OpenCensus agent exporter. Fixes #343 Co-authored-by: Chris Kleinknecht --- tox.ini | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index be7f1db9f..23f8dbce0 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,6 @@ skipsdist = True skip_missing_interpreters = True envlist = - ; Environments are organized by individual package, allowing ; for specifying supported Python versions per package. ; opentelemetry-api @@ -44,7 +43,10 @@ envlist = ; opentelemetry-ext-mysql py3{4,5,6,7,8}-test-ext-mysql pypy3-test-ext-mysql - + ; opentelemetry-ext-otcollector + py3{4,5,6,7,8}-test-ext-otcollector + ; ext-otcollector intentionally excluded from pypy3 + ; opentelemetry-ext-prometheus py3{4,5,6,7,8}-test-ext-prometheus pypy3-test-ext-prometheus @@ -103,6 +105,7 @@ changedir = test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests test-ext-mysql: ext/opentelemetry-ext-mysql/tests + test-ext-otcollector: ext/opentelemetry-ext-otcollector/tests test-ext-prometheus: ext/opentelemetry-ext-prometheus/tests test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests test-ext-psycopg2: ext/opentelemetry-ext-psycopg2/tests @@ -140,6 +143,8 @@ commands_pre = dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi mysql: pip install {toxinidir}/ext/opentelemetry-ext-mysql + otcollector: pip install {toxinidir}/opentelemetry-sdk + otcollector: pip install {toxinidir}/ext/opentelemetry-ext-otcollector prometheus: pip install {toxinidir}/opentelemetry-sdk prometheus: pip install {toxinidir}/ext/opentelemetry-ext-prometheus pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo @@ -243,4 +248,4 @@ commands = pytest {posargs} commands_post = - docker-compose down \ No newline at end of file + docker-compose down From 79a2ca277c923a34f191f5926695d30f4ae84d38 Mon Sep 17 00:00:00 2001 From: Chris Kleinknecht Date: Mon, 2 Mar 2020 11:42:24 -0800 Subject: [PATCH 063/145] Prepare to host on readthedocs.org (#452) --- tox.ini | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index 23f8dbce0..3588ca694 100644 --- a/tox.ini +++ b/tox.ini @@ -197,14 +197,16 @@ commands = [testenv:docs] deps = -c dev-requirements.txt + -c docs-requirements.txt sphinx sphinx-rtd-theme sphinx-autodoc-typehints - opentracing~=2.2.0 - Deprecated>=1.2.6 - thrift>=0.10.0 - pymongo ~= 3.1 - flask~=1.0 + # Required by ext packages + opentracing + Deprecated + thrift + pymongo + flask changedir = docs From 56fda78b27c97e104905cb4b613ff6742e3ebe2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Mon, 2 Mar 2020 17:02:03 -0500 Subject: [PATCH 064/145] sdk: Implement observer instrument (#425) Observer instruments are used to capture a current set of values at a point in time [1]. This commit extends the Meter interface to allow to register an observer instrument by pasing a callback that will be executed at collection time. The logic inside collection is updated to consider these instruments and a new ObserverAggregator is implemented. [1] https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/api-metrics.md#observer-instruments --- tox.ini | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 3588ca694..0423a6cc7 100644 --- a/tox.ini +++ b/tox.ini @@ -187,6 +187,7 @@ deps = flake8 isort black + psutil commands_pre = python scripts/eachdist.py install --editable @@ -238,7 +239,7 @@ deps = docker-compose >= 1.25.2 pymongo ~= 3.1 -changedir = +changedir = ext/opentelemetry-ext-docker-tests/tests commands_pre = @@ -246,7 +247,7 @@ commands_pre = -e {toxinidir}/opentelemetry-sdk \ -e {toxinidir}/ext/opentelemetry-ext-pymongo - docker-compose up -d -commands = +commands = pytest {posargs} commands_post = From ef0536d34d587dbd356166c57a8713d9e0d49ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Tue, 10 Mar 2020 11:50:16 -0500 Subject: [PATCH 065/145] Improve docs structure (#467) - Creates a tree structure for documentation, it allows to organize it better from a developer point of view and also the rendered documentation should be easier to navigate. - Moves partially the main readme to be included in the online docs, the main readme will be updated to have a link to avoid duplicated content) - Moves the examples folder to the docs, so they can be accessed through the online documentation. Creates a new pair of "macros" to create links to specific versions, scm_web & scm_raw_web. Co-authored-by: Chris Kleinknecht --- tox.ini | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tox.ini b/tox.ini index 0423a6cc7..52c82eba0 100644 --- a/tox.ini +++ b/tox.ini @@ -16,11 +16,11 @@ envlist = py3{4,5,6,7,8}-test-example-app pypy3-test-example-app - ; examples/basic_tracer + ; docs/examples/basic_tracer py3{4,5,6,7,8}-test-example-basic-tracer pypy3-test-example-basic-tracer - ; examples/http + ; docs/examples/http py3{4,5,6,7,8}-test-example-http pypy3-test-example-http @@ -112,9 +112,9 @@ changedir = test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests test-ext-zipkin: ext/opentelemetry-ext-zipkin/tests test-ext-flask: ext/opentelemetry-ext-flask/tests - test-example-app: examples/opentelemetry-example-app/tests - test-example-basic-tracer: examples/basic_tracer/tests - test-example-http: examples/http/tests + test-example-app: docs/examples/opentelemetry-example-app/tests + test-example-basic-tracer: docs/examples/basic_tracer/tests + test-example-http: docs/examples/http/tests test-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests commands_pre = @@ -126,14 +126,14 @@ commands_pre = example-app: pip install {toxinidir}/ext/opentelemetry-ext-http-requests example-app: pip install {toxinidir}/ext/opentelemetry-ext-wsgi example-app: pip install {toxinidir}/ext/opentelemetry-ext-flask - example-app: pip install {toxinidir}/examples/opentelemetry-example-app + example-app: pip install {toxinidir}/docs/examples/opentelemetry-example-app example-basic-tracer: pip install -e {toxinidir}/opentelemetry-api example-basic-tracer: pip install -e {toxinidir}/opentelemetry-sdk example-http: pip install -e {toxinidir}/opentelemetry-api example-http: pip install -e {toxinidir}/opentelemetry-sdk example-http: pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests example-http: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi - example-http: pip install -r {toxinidir}/examples/http/requirements.txt + example-http: pip install -r {toxinidir}/docs/examples/http/requirements.txt ext: pip install {toxinidir}/opentelemetry-api wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-testutil @@ -208,11 +208,14 @@ deps = thrift pymongo flask + mysql-connector-python + wrapt + psycopg2-binary changedir = docs commands = - sphinx-build -E -a -W --keep-going -b html -T . _build/html + sphinx-build -E -a --keep-going -b html -T . _build/html [testenv:py38-tracecontext] basepython: python3.8 From c92e7e0444afb7de2304befc2d55446ce059fb1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Tue, 24 Mar 2020 16:45:54 -0500 Subject: [PATCH 066/145] docs: Reorganize examples and improve ext packages documentation (#483) This commit moves the text on the readmes of the external packages to their source code as a docstring. This improves the generated documentation and helps to consolidate the documentation in a single place. Also unify the readmes present on each package to include a 1 line description, installation instructions and a link to the online documentation. This small readme will be the one shown on Github and on PyPI. Also change the examples structure to have the following examples: - basic meter & tracer - http integration - jaeger, prometheus, otcollector{tracer, metrics} - opentracing shim Co-authored-by: alrex Co-authored-by: Diego Hurtado --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 52c82eba0..2eb35491d 100644 --- a/tox.ini +++ b/tox.ini @@ -211,6 +211,7 @@ deps = mysql-connector-python wrapt psycopg2-binary + prometheus_client changedir = docs From c108d15326b28e25ab81602a39b4b1c17ee02f0b Mon Sep 17 00:00:00 2001 From: Daniel <61800298+ffe4@users.noreply.github.com> Date: Sat, 28 Mar 2020 05:45:15 +0100 Subject: [PATCH 067/145] lint: Add test for package readme syntax errors (#492) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a test to ensure readmes render properly Also adds README.rst for testutil package to pass new test. Co-authored-by: Christian Neumüller --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 2eb35491d..3c0023bd4 100644 --- a/tox.ini +++ b/tox.ini @@ -188,6 +188,7 @@ deps = isort black psutil + readme_renderer commands_pre = python scripts/eachdist.py install --editable From d446cb5e225c9566275cae477d6a3e72ccef3ac6 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 30 Mar 2020 13:44:43 -0600 Subject: [PATCH 068/145] Add an autoinstrumentation mechanism and an instrumentor for Flask (#327) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding an autoinstrumentation mechanism and a Flask instrumentor (an instrumentor is a class that implements the _instrument and _uninstrument methods). It works like this: A console command is defined. This makes it possible to run a command named opentelemetry-auto-instrumentation that will execute this function. When the opentelemetry-auto-instrumentation command is executed, then the instrument method of the different instrumentors is called, which are made available via an entry-point. 2.In the case of the Flask instrumentor, the original flask.Flask gets replaced with _InstrumentedFlask (in this case, the Flask instrumentor uses monkey patching to perform the instrumentation, nevertheless, monkey patching is not always the method used to do this, so the name instrumentor is preferred over patcher). Once all instrumentation is enabled, the app is executed. Co-Authored-By: Mauricio Vásquez Co-authored-by: Chris Kleinknecht --- tox.ini | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tox.ini b/tox.ini index 3c0023bd4..6e64bdbd4 100644 --- a/tox.ini +++ b/tox.ini @@ -12,6 +12,10 @@ envlist = py3{4,5,6,7,8}-test-sdk pypy3-test-sdk + ; opentelemetry-auto-instrumentation + py3{4,5,6,7,8}-test-auto-instrumentation + pypy3-test-auto-instrumentation + ; opentelemetry-example-app py3{4,5,6,7,8}-test-example-app pypy3-test-example-app @@ -43,6 +47,7 @@ envlist = ; opentelemetry-ext-mysql py3{4,5,6,7,8}-test-ext-mysql pypy3-test-ext-mysql + ; opentelemetry-ext-otcollector py3{4,5,6,7,8}-test-ext-otcollector ; ext-otcollector intentionally excluded from pypy3 @@ -101,6 +106,7 @@ setenv = changedir = test-api: opentelemetry-api/tests test-sdk: opentelemetry-sdk/tests + test-auto-instrumentation: opentelemetry-auto-instrumentation/tests test-ext-http-requests: ext/opentelemetry-ext-http-requests/tests test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests @@ -122,7 +128,9 @@ commands_pre = python -m pip install -U pip setuptools wheel test: pip install {toxinidir}/opentelemetry-api test-sdk: pip install {toxinidir}/opentelemetry-sdk + test-auto-instrumentation: pip install {toxinidir}/opentelemetry-auto-instrumentation example-app: pip install {toxinidir}/opentelemetry-sdk + example-app: pip install {toxinidir}/opentelemetry-auto-instrumentation example-app: pip install {toxinidir}/ext/opentelemetry-ext-http-requests example-app: pip install {toxinidir}/ext/opentelemetry-ext-wsgi example-app: pip install {toxinidir}/ext/opentelemetry-ext-flask @@ -139,6 +147,7 @@ commands_pre = wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-testutil wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-wsgi wsgi,flask: pip install {toxinidir}/opentelemetry-sdk + flask: pip install {toxinidir}/opentelemetry-auto-instrumentation flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test] dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi From b6bb17503c8e1109a834c20a00c4fa8edab294a9 Mon Sep 17 00:00:00 2001 From: Chris Kleinknecht Date: Mon, 30 Mar 2020 16:00:19 -0700 Subject: [PATCH 069/145] Misc isort fixes (#535) --- .isort.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/.isort.cfg b/.isort.cfg index 4e7bff8bb..014a7c64e 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -15,3 +15,4 @@ multi_line_output=3 skip=target skip_glob=ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen/*,.venv*/*,venv*/* known_first_party=opentelemetry +known_third_party=psutil,pytest From 5c728bedaba3cdee78a5e1d6a87adb6154564f8d Mon Sep 17 00:00:00 2001 From: Chris Kleinknecht Date: Mon, 30 Mar 2020 18:04:24 -0700 Subject: [PATCH 070/145] gRPC integration (#476) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a port of grpcio-opentracing, and borrows from opencensus-ext-grpc. It adds client and server interceptors that wrap each request in a span and use the new context API to inject/extract the traceparent header to/from gRPC metadata. Co-authored-by: alrex Co-authored-by: Mauricio Vásquez Co-authored-by: Mario Jonke Co-authored-by: Daniel González Co-authored-by: Alex Boten Co-authored-by: Yusuke Tsutsumi --- .flake8 | 1 + .isort.cfg | 4 ++-- tox.ini | 9 ++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.flake8 b/.flake8 index 6d1c2bc17..0c2204782 100644 --- a/.flake8 +++ b/.flake8 @@ -17,3 +17,4 @@ exclude = __pycache__ ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen/ ext/opentelemetry-ext-jaeger/build/* + docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/grpc/gen/ diff --git a/.isort.cfg b/.isort.cfg index 014a7c64e..c5723b06a 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -13,6 +13,6 @@ line_length=79 ; docs: https://github.com/timothycrosley/isort#multi-line-output-modes multi_line_output=3 skip=target -skip_glob=ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen/*,.venv*/*,venv*/* -known_first_party=opentelemetry +skip_glob=**/gen/*,.venv*/*,venv*/* +known_first_party=opentelemetry,opentelemetry_example_app known_third_party=psutil,pytest diff --git a/tox.ini b/tox.ini index 6e64bdbd4..06a54bc83 100644 --- a/tox.ini +++ b/tox.ini @@ -76,8 +76,12 @@ envlist = py3{4,5,6,7,8}-test-opentracing-shim pypy3-test-opentracing-shim + ; opentelemetry-opentracing-shim + py3{4,5,6,7,8}-test-opentracing-shim + pypy3-test-opentracing-shim - py3{4,5,6,7,8}-coverage + ; opentelemetry-ext-grpc + py3{4,5,6,7,8}-test-ext-grpc ; Coverage is temporarily disabled for pypy3 due to the pytest bug. ; pypy3-coverage @@ -107,6 +111,7 @@ changedir = test-api: opentelemetry-api/tests test-sdk: opentelemetry-sdk/tests test-auto-instrumentation: opentelemetry-auto-instrumentation/tests + test-ext-grpc: ext/opentelemetry-ext-grpc/tests test-ext-http-requests: ext/opentelemetry-ext-http-requests/tests test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests @@ -144,6 +149,8 @@ commands_pre = example-http: pip install -r {toxinidir}/docs/examples/http/requirements.txt ext: pip install {toxinidir}/opentelemetry-api + grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc + grpc: pip install {toxinidir}/opentelemetry-sdk wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-testutil wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-wsgi wsgi,flask: pip install {toxinidir}/opentelemetry-sdk From 7eacd3eab1d330ae8625bb1020d5a5b600130876 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 7 Apr 2020 09:51:41 -0600 Subject: [PATCH 071/145] Fix Flask ext dependencies (#546) Some Flask ext dependencies are missing or misplaced in the configuration file. Fixes #545 --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 06a54bc83..bd7b762fe 100644 --- a/tox.ini +++ b/tox.ini @@ -154,7 +154,6 @@ commands_pre = wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-testutil wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-wsgi wsgi,flask: pip install {toxinidir}/opentelemetry-sdk - flask: pip install {toxinidir}/opentelemetry-auto-instrumentation flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test] dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi From 0d4c5ffeb83abea0435ee3db50ce177716e033dc Mon Sep 17 00:00:00 2001 From: Chris Kleinknecht Date: Wed, 8 Apr 2020 13:49:32 -0700 Subject: [PATCH 072/145] Require latest version of other packages in repo (#561) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change unversioned requirements for packages in the same repo to ==0.7.dev0. Co-authored-by: Mauricio Vásquez --- eachdist.ini | 1 + tox.ini | 2 ++ 2 files changed, 3 insertions(+) diff --git a/eachdist.ini b/eachdist.ini index 8baab0c2e..59f212f7c 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -4,6 +4,7 @@ sortfirst= opentelemetry-api opentelemetry-sdk + opentelemetry-auto-instrumentation ext/opentelemetry-ext-wsgi ext/* diff --git a/tox.ini b/tox.ini index bd7b762fe..7d7bed938 100644 --- a/tox.ini +++ b/tox.ini @@ -154,6 +154,7 @@ commands_pre = wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-testutil wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-wsgi wsgi,flask: pip install {toxinidir}/opentelemetry-sdk + flask: pip install {toxinidir}/opentelemetry-auto-instrumentation flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test] dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi @@ -248,6 +249,7 @@ commands_pre = -e {toxinidir}/opentelemetry-sdk \ -e {toxinidir}/ext/opentelemetry-ext-http-requests \ -e {toxinidir}/ext/opentelemetry-ext-wsgi \ + -e {toxinidir}/opentelemetry-auto-instrumentation \ -e {toxinidir}/ext/opentelemetry-ext-flask commands = From 9de5be3f82b4b9c2942affb567047f454c0b1c6d Mon Sep 17 00:00:00 2001 From: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> Date: Thu, 9 Apr 2020 16:21:20 -0700 Subject: [PATCH 073/145] Adding functional tests for psycopg2 integration (#528) End to end verification for span creation using psycopg2 and dbapi integrations --- tox.ini | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 7d7bed938..f3d1af4ed 100644 --- a/tox.ini +++ b/tox.ini @@ -260,6 +260,7 @@ deps = pytest docker-compose >= 1.25.2 pymongo ~= 3.1 + psycopg2 ~= 2.8.4 changedir = ext/opentelemetry-ext-docker-tests/tests @@ -267,8 +268,11 @@ changedir = commands_pre = pip install -e {toxinidir}/opentelemetry-api \ -e {toxinidir}/opentelemetry-sdk \ + -e {toxinidir}/ext/opentelemetry-ext-dbapi \ + -e {toxinidir}/ext/opentelemetry-ext-psycopg2 \ -e {toxinidir}/ext/opentelemetry-ext-pymongo - - docker-compose up -d + docker-compose up -d + python check_availability.py commands = pytest {posargs} From a800300cf89bf68ee6a459c3aa881d124f25404e Mon Sep 17 00:00:00 2001 From: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> Date: Mon, 13 Apr 2020 09:01:01 -0700 Subject: [PATCH 074/145] test: Adding functional tests for MySQL integration (#526) E2E verification for span creation using mysql and dbapi integrations --- tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index f3d1af4ed..ac308148d 100644 --- a/tox.ini +++ b/tox.ini @@ -259,6 +259,7 @@ commands = deps = pytest docker-compose >= 1.25.2 + mysql-connector-python ~= 8.0 pymongo ~= 3.1 psycopg2 ~= 2.8.4 @@ -269,6 +270,7 @@ commands_pre = pip install -e {toxinidir}/opentelemetry-api \ -e {toxinidir}/opentelemetry-sdk \ -e {toxinidir}/ext/opentelemetry-ext-dbapi \ + -e {toxinidir}/ext/opentelemetry-ext-mysql \ -e {toxinidir}/ext/opentelemetry-ext-psycopg2 \ -e {toxinidir}/ext/opentelemetry-ext-pymongo docker-compose up -d From 8f4c470159d666aaf3766b6b3646b3a370fbd9de Mon Sep 17 00:00:00 2001 From: Chris Kleinknecht Date: Tue, 14 Apr 2020 18:19:02 -0700 Subject: [PATCH 075/145] Move shared test code from ext/ to tests/ (#559) opentelemetry-ext-testutil is a package with shared test classes used by ext packages (right now only opentelemetry-ext-flask). We don't release this package, just import it in other tests. Right now, on each release, we build everything in ext/. This means whoever does the release has to remember to exclude this package when they push the others to PyPI. This moves the files and package: Move files ext/opentelemetry-ext-testutil -> tests/util Move package opentelemetry.ext.testutil -> opentelemetry.test This makes maintainers' lives easier, but it does mean that other packages that use testutils will have to install install the opentelemetry.test package from source. But this is already the case since we don't publish opentelemetry-ext-testutil. we move shared test code back into the main repo until we move a package that depends on it into a separate repo, at which point we'll have to put this code in its own top-level package. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index ac308148d..cc6a4e2c0 100644 --- a/tox.ini +++ b/tox.ini @@ -151,7 +151,7 @@ commands_pre = ext: pip install {toxinidir}/opentelemetry-api grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc grpc: pip install {toxinidir}/opentelemetry-sdk - wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-testutil + wsgi,flask: pip install {toxinidir}/tests/util wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-wsgi wsgi,flask: pip install {toxinidir}/opentelemetry-sdk flask: pip install {toxinidir}/opentelemetry-auto-instrumentation From 224301b1a5d687410209404a3186a76306681af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Tue, 14 Apr 2020 22:20:54 -0500 Subject: [PATCH 076/145] requests: Improvements for requests integration (#573) Adding a TestBase class which wraps a tracer provider that is configured with a memory span exporter. This class inherits from unitest.TestCase, hence other test classes can inherit from it to get access to the underlying memory span exporter and tracer provider. Adding a mock propagator that could be used for testing propagation in different packages. It was implemented in the opentracing-shim and this commit moves it to a generic place. Adding disable_session(), which can be used to disable the instrumentation on a single requests' session object. --- tox.ini | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tox.ini b/tox.ini index cc6a4e2c0..ad8e501a7 100644 --- a/tox.ini +++ b/tox.ini @@ -167,9 +167,13 @@ commands_pre = psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-dbapi psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-psycopg2 http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests + http-requests: pip install {toxinidir}/tests/util + http-requests: pip install {toxinidir}/opentelemetry-sdk + http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests[test] jaeger: pip install {toxinidir}/opentelemetry-sdk jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger opentracing-shim: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-opentracing-shim + opentracing-shim: pip install {toxinidir}/tests/util zipkin: pip install {toxinidir}/opentelemetry-sdk zipkin: pip install {toxinidir}/ext/opentelemetry-ext-zipkin @@ -205,6 +209,7 @@ deps = black psutil readme_renderer + httpretty commands_pre = python scripts/eachdist.py install --editable From e3827bb0f20eeeda32b0f8cefb95534068b47516 Mon Sep 17 00:00:00 2001 From: alrex Date: Thu, 16 Apr 2020 13:35:25 -0700 Subject: [PATCH 077/145] updating psycopg2 dependency (#588) Without using binary here, users will need the tools to compile psycopg2 on their systems. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index ad8e501a7..9d1d1a26c 100644 --- a/tox.ini +++ b/tox.ini @@ -266,7 +266,7 @@ deps = docker-compose >= 1.25.2 mysql-connector-python ~= 8.0 pymongo ~= 3.1 - psycopg2 ~= 2.8.4 + psycopg2-binary ~= 2.8.4 changedir = ext/opentelemetry-ext-docker-tests/tests From 437ff9af0d72824f387c8e520c9c8d787f361731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Mon, 20 Apr 2020 15:58:49 -0500 Subject: [PATCH 078/145] ext: Use TestBase (#586) Update tests to use TestBase as described on #303. Co-authored-by: Yusuke Tsutsumi Co-authored-by: Chris Kleinknecht --- tox.ini | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/tox.ini b/tox.ini index 9d1d1a26c..dc7f20aa8 100644 --- a/tox.ini +++ b/tox.ini @@ -131,50 +131,52 @@ changedir = commands_pre = ; Install without -e to test the actual installation python -m pip install -U pip setuptools wheel + +; Install common packages for all the tests. These are not needed in all the +; cases but it saves a lot of boilerplate in this file. test: pip install {toxinidir}/opentelemetry-api - test-sdk: pip install {toxinidir}/opentelemetry-sdk + test: pip install {toxinidir}/opentelemetry-sdk + test: pip install {toxinidir}/tests/util + test-auto-instrumentation: pip install {toxinidir}/opentelemetry-auto-instrumentation - example-app: pip install {toxinidir}/opentelemetry-sdk + example-app: pip install {toxinidir}/opentelemetry-auto-instrumentation example-app: pip install {toxinidir}/ext/opentelemetry-ext-http-requests example-app: pip install {toxinidir}/ext/opentelemetry-ext-wsgi example-app: pip install {toxinidir}/ext/opentelemetry-ext-flask example-app: pip install {toxinidir}/docs/examples/opentelemetry-example-app - example-basic-tracer: pip install -e {toxinidir}/opentelemetry-api - example-basic-tracer: pip install -e {toxinidir}/opentelemetry-sdk - example-http: pip install -e {toxinidir}/opentelemetry-api - example-http: pip install -e {toxinidir}/opentelemetry-sdk + example-http: pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests example-http: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi example-http: pip install -r {toxinidir}/docs/examples/http/requirements.txt - ext: pip install {toxinidir}/opentelemetry-api - grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc - grpc: pip install {toxinidir}/opentelemetry-sdk - wsgi,flask: pip install {toxinidir}/tests/util + grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test] + wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-wsgi - wsgi,flask: pip install {toxinidir}/opentelemetry-sdk + flask: pip install {toxinidir}/opentelemetry-auto-instrumentation flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test] - dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi + + dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi[test] + mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi - mysql: pip install {toxinidir}/ext/opentelemetry-ext-mysql - otcollector: pip install {toxinidir}/opentelemetry-sdk + mysql: pip install {toxinidir}/ext/opentelemetry-ext-mysql[test] + otcollector: pip install {toxinidir}/ext/opentelemetry-ext-otcollector - prometheus: pip install {toxinidir}/opentelemetry-sdk + prometheus: pip install {toxinidir}/ext/opentelemetry-ext-prometheus - pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo + + pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo[test] + psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-dbapi psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-psycopg2 - http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests - http-requests: pip install {toxinidir}/tests/util - http-requests: pip install {toxinidir}/opentelemetry-sdk + http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests[test] - jaeger: pip install {toxinidir}/opentelemetry-sdk + jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger - opentracing-shim: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-opentracing-shim - opentracing-shim: pip install {toxinidir}/tests/util - zipkin: pip install {toxinidir}/opentelemetry-sdk + + opentracing-shim: pip install {toxinidir}/ext/opentelemetry-ext-opentracing-shim + zipkin: pip install {toxinidir}/ext/opentelemetry-ext-zipkin ; In order to get a healthy coverage report, @@ -274,6 +276,7 @@ changedir = commands_pre = pip install -e {toxinidir}/opentelemetry-api \ -e {toxinidir}/opentelemetry-sdk \ + -e {toxinidir}/tests/util \ -e {toxinidir}/ext/opentelemetry-ext-dbapi \ -e {toxinidir}/ext/opentelemetry-ext-mysql \ -e {toxinidir}/ext/opentelemetry-ext-psycopg2 \ From c7b98ead837a3d91ba68573cacf09c0eb4daddbb Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Fri, 24 Apr 2020 13:18:02 -0700 Subject: [PATCH 079/145] PyMySQL Integration (#504) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Integration for PyMySQL. Fixes some documentation as well for other db integrations. Leverages dbapi. Co-authored-by: Mauricio Vásquez --- tox.ini | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index dc7f20aa8..e0c4314bc 100644 --- a/tox.ini +++ b/tox.ini @@ -64,6 +64,10 @@ envlist = py3{4,5,6,7,8}-test-ext-pymongo pypy3-test-ext-pymongo + ; opentelemetry-ext-pymysql + py3{4,5,6,7,8}-test-ext-pymysql + pypy3-test-ext-pymysql + ; opentelemetry-ext-wsgi py3{4,5,6,7,8}-test-ext-wsgi pypy3-test-ext-wsgi @@ -120,6 +124,7 @@ changedir = test-ext-prometheus: ext/opentelemetry-ext-prometheus/tests test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests test-ext-psycopg2: ext/opentelemetry-ext-psycopg2/tests + test-ext-pymysql: ext/opentelemetry-ext-pymysql/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests test-ext-zipkin: ext/opentelemetry-ext-zipkin/tests test-ext-flask: ext/opentelemetry-ext-flask/tests @@ -171,6 +176,9 @@ commands_pre = psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-dbapi psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-psycopg2 + pymysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi + pymysql: pip install {toxinidir}/ext/opentelemetry-ext-pymysql + http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests[test] jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger @@ -232,6 +240,7 @@ deps = thrift pymongo flask + pymysql mysql-connector-python wrapt psycopg2-binary @@ -268,6 +277,7 @@ deps = docker-compose >= 1.25.2 mysql-connector-python ~= 8.0 pymongo ~= 3.1 + pymysql ~= 0.9.3 psycopg2-binary ~= 2.8.4 changedir = @@ -280,7 +290,8 @@ commands_pre = -e {toxinidir}/ext/opentelemetry-ext-dbapi \ -e {toxinidir}/ext/opentelemetry-ext-mysql \ -e {toxinidir}/ext/opentelemetry-ext-psycopg2 \ - -e {toxinidir}/ext/opentelemetry-ext-pymongo + -e {toxinidir}/ext/opentelemetry-ext-pymongo \ + -e {toxinidir}/ext/opentelemetry-ext-pymysql docker-compose up -d python check_availability.py commands = From 2f6cac7d1a4ebdd2a02481612cebb77064bb885f Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 27 Apr 2020 09:29:34 -0600 Subject: [PATCH 080/145] test: Add missing dependency (#614) Fixes #613 some packages depend on the newest dev version of dbapi, which isn't published yet when a package in a virtualenv is installed, it will attempt to install those dependencies, which searches on pypi Installing the local package ensures that 0.7 is installed, so pip sees that and skips trying to resolve against pypi (when it won't find the version). --- eachdist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/eachdist.ini b/eachdist.ini index 59f212f7c..b573b838f 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -6,6 +6,7 @@ sortfirst= opentelemetry-sdk opentelemetry-auto-instrumentation ext/opentelemetry-ext-wsgi + ext/opentelemetry-ext-dbapi ext/* [lintroots] From 1c6b9c0431f335c0a56e7146cc9441b49161fe7e Mon Sep 17 00:00:00 2001 From: alrex Date: Mon, 27 Apr 2020 09:48:39 -0700 Subject: [PATCH 081/145] redis: Porting redis instrumentation from contrib repo (#595) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Porting the existing redis instrumentation from the contrib repo to using the OpenTelemetry API and the OpenTelemetry Auto-instrumentation Instrumentor interface. Similiar to the sqlalchemy PR, the main thing that will need updating is to remove the patch/unpatch methods once the instrumentor interface changes have been merged. This is replacing open-telemetry/opentelemetry-python-contrib#21 Co-authored-by: Mauricio Vásquez Co-authored-by: Leighton Chen Co-authored-by: Diego Hurtado Co-authored-by: Chris Kleinknecht --- .isort.cfg | 2 +- tox.ini | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.isort.cfg b/.isort.cfg index c5723b06a..ae2dfc325 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -15,4 +15,4 @@ multi_line_output=3 skip=target skip_glob=**/gen/*,.venv*/*,venv*/* known_first_party=opentelemetry,opentelemetry_example_app -known_third_party=psutil,pytest +known_third_party=psutil,pytest,redis,redis_opentracing diff --git a/tox.ini b/tox.ini index e0c4314bc..0e35428de 100644 --- a/tox.ini +++ b/tox.ini @@ -87,6 +87,10 @@ envlist = ; opentelemetry-ext-grpc py3{4,5,6,7,8}-test-ext-grpc + ; opentelemetry-ext-redis + py3{4,5,6,7,8}-test-ext-redis + pypy3-test-ext-redis + ; Coverage is temporarily disabled for pypy3 due to the pytest bug. ; pypy3-coverage @@ -132,6 +136,7 @@ changedir = test-example-basic-tracer: docs/examples/basic_tracer/tests test-example-http: docs/examples/http/tests test-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests + test-ext-redis: ext/opentelemetry-ext-redis/tests commands_pre = ; Install without -e to test the actual installation @@ -179,6 +184,9 @@ commands_pre = pymysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi pymysql: pip install {toxinidir}/ext/opentelemetry-ext-pymysql + redis: pip install {toxinidir}/opentelemetry-auto-instrumentation + redis: pip install {toxinidir}/ext/opentelemetry-ext-redis[test] + http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests[test] jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger @@ -239,6 +247,7 @@ deps = Deprecated thrift pymongo + redis flask pymysql mysql-connector-python @@ -262,10 +271,10 @@ deps = commands_pre = pip install -e {toxinidir}/opentelemetry-api \ + -e {toxinidir}/opentelemetry-auto-instrumentation \ -e {toxinidir}/opentelemetry-sdk \ -e {toxinidir}/ext/opentelemetry-ext-http-requests \ -e {toxinidir}/ext/opentelemetry-ext-wsgi \ - -e {toxinidir}/opentelemetry-auto-instrumentation \ -e {toxinidir}/ext/opentelemetry-ext-flask commands = @@ -279,6 +288,7 @@ deps = pymongo ~= 3.1 pymysql ~= 0.9.3 psycopg2-binary ~= 2.8.4 + redis ~= 3.3.11 changedir = ext/opentelemetry-ext-docker-tests/tests @@ -286,12 +296,14 @@ changedir = commands_pre = pip install -e {toxinidir}/opentelemetry-api \ -e {toxinidir}/opentelemetry-sdk \ + -e {toxinidir}/opentelemetry-auto-instrumentation \ -e {toxinidir}/tests/util \ -e {toxinidir}/ext/opentelemetry-ext-dbapi \ -e {toxinidir}/ext/opentelemetry-ext-mysql \ -e {toxinidir}/ext/opentelemetry-ext-psycopg2 \ -e {toxinidir}/ext/opentelemetry-ext-pymongo \ - -e {toxinidir}/ext/opentelemetry-ext-pymysql + -e {toxinidir}/ext/opentelemetry-ext-pymysql \ + -e {toxinidir}/ext/opentelemetry-ext-redis docker-compose up -d python check_availability.py commands = From b6fddf991b6a1ebea0b3df96a1551b8d753c6179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Mon, 27 Apr 2020 13:16:49 -0500 Subject: [PATCH 082/145] ext/requests: Add instrumentor (#597) Implement the BaseInstrumentor interface to make this library compatible with the opentelemetry-auto-instr command. There is an issue about getting the span when the global tracer provider hasn't been configured, this should be changed in the future once we extend the opentelemetry-auto-instr command to also configure the SDK. --- tox.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tox.ini b/tox.ini index 0e35428de..198ca773e 100644 --- a/tox.ini +++ b/tox.ini @@ -156,6 +156,7 @@ commands_pre = example-app: pip install {toxinidir}/ext/opentelemetry-ext-flask example-app: pip install {toxinidir}/docs/examples/opentelemetry-example-app + example-http: pip install -e {toxinidir}/opentelemetry-auto-instrumentation example-http: pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests example-http: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi example-http: pip install -r {toxinidir}/docs/examples/http/requirements.txt @@ -187,6 +188,7 @@ commands_pre = redis: pip install {toxinidir}/opentelemetry-auto-instrumentation redis: pip install {toxinidir}/ext/opentelemetry-ext-redis[test] + http-requests: pip install {toxinidir}/opentelemetry-auto-instrumentation http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests[test] jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger @@ -273,6 +275,7 @@ commands_pre = pip install -e {toxinidir}/opentelemetry-api \ -e {toxinidir}/opentelemetry-auto-instrumentation \ -e {toxinidir}/opentelemetry-sdk \ + -e {toxinidir}/opentelemetry-auto-instrumentation \ -e {toxinidir}/ext/opentelemetry-ext-http-requests \ -e {toxinidir}/ext/opentelemetry-ext-wsgi \ -e {toxinidir}/ext/opentelemetry-ext-flask From d3e3dbdcab32f0225232926cd0f2fb9f25b82b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Mon, 27 Apr 2020 15:11:07 -0500 Subject: [PATCH 083/145] ext/pymongo: Add instrumentor (#612) The current Pymongo integration uses the monitoring.register() [1] to hook the different internal calls of Pymongo. This integration doesn't allow to unregister a monitor. This commit workaround that limitation by adding an enable flag to the CommandTracer class and adds a logic to disable the integration. This solution is not perfect becasue there will be some overhead even when the instrumentation is disabled, but that's what we can do with the current approach. [1] https://api.mongodb.com/python/current/api/pymongo/monitoring.html#pymongo.monitoring.register Co-authored-by: Alex Boten --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 198ca773e..ef8b63340 100644 --- a/tox.ini +++ b/tox.ini @@ -177,6 +177,7 @@ commands_pre = prometheus: pip install {toxinidir}/ext/opentelemetry-ext-prometheus + pymongo: pip install {toxinidir}/opentelemetry-auto-instrumentation pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo[test] psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-dbapi From 0c36640dbc08390856a92972094d391c0846ee48 Mon Sep 17 00:00:00 2001 From: alrex Date: Wed, 29 Apr 2020 13:16:45 -0700 Subject: [PATCH 084/145] infra: reduce build time by running longest job early (#626) Currently builds take roughly 15 minutes, as the longest job (pypy3) isn't kicked off until one of the other jobs is finished running (max 5 concurrent jobs). Prioritizing the longer jobs first should reduce the build time by about 5 minutes. --- .flake8 | 1 + 1 file changed, 1 insertion(+) diff --git a/.flake8 b/.flake8 index 0c2204782..5922f31d8 100644 --- a/.flake8 +++ b/.flake8 @@ -18,3 +18,4 @@ exclude = ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen/ ext/opentelemetry-ext-jaeger/build/* docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/grpc/gen/ + docs/examples/opentelemetry-example-app/build/* From b199df399fa3d04edfa66f855af125035f4a5269 Mon Sep 17 00:00:00 2001 From: alrex Date: Wed, 29 Apr 2020 13:43:56 -0700 Subject: [PATCH 085/145] Porting sqlalchemy instrumentation from contrib repo (#591) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Porting the existing sqlalchemy instrumentation from https://github.com/open-telemetry/opentelemetry-python-contrib/tree/master/reference/ddtrace/contrib/sqlalchemy Co-authored-by: Mauricio Vásquez Co-authored-by: Diego Hurtado Co-authored-by: Chris Kleinknecht --- tox.ini | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tox.ini b/tox.ini index ef8b63340..118d0b096 100644 --- a/tox.ini +++ b/tox.ini @@ -87,6 +87,10 @@ envlist = ; opentelemetry-ext-grpc py3{4,5,6,7,8}-test-ext-grpc + ; opentelemetry-ext-sqlalchemy + py3{4,5,6,7,8}-test-ext-sqlalchemy + pypy3-test-ext-sqlalchemy + ; opentelemetry-ext-redis py3{4,5,6,7,8}-test-ext-redis pypy3-test-ext-redis @@ -136,6 +140,7 @@ changedir = test-example-basic-tracer: docs/examples/basic_tracer/tests test-example-http: docs/examples/http/tests test-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests + test-ext-sqlalchemy: ext/opentelemetry-ext-sqlalchemy/tests test-ext-redis: ext/opentelemetry-ext-redis/tests commands_pre = @@ -198,6 +203,9 @@ commands_pre = zipkin: pip install {toxinidir}/ext/opentelemetry-ext-zipkin + sqlalchemy: pip install {toxinidir}/opentelemetry-auto-instrumentation + sqlalchemy: pip install {toxinidir}/ext/opentelemetry-ext-sqlalchemy + ; In order to get a healthy coverage report, ; we have to install packages in editable mode. coverage: python {toxinidir}/scripts/eachdist.py install --editable @@ -292,6 +300,7 @@ deps = pymongo ~= 3.1 pymysql ~= 0.9.3 psycopg2-binary ~= 2.8.4 + sqlalchemy ~= 1.3.16 redis ~= 3.3.11 changedir = @@ -307,6 +316,7 @@ commands_pre = -e {toxinidir}/ext/opentelemetry-ext-psycopg2 \ -e {toxinidir}/ext/opentelemetry-ext-pymongo \ -e {toxinidir}/ext/opentelemetry-ext-pymysql \ + -e {toxinidir}/ext/opentelemetry-ext-sqlalchemy \ -e {toxinidir}/ext/opentelemetry-ext-redis docker-compose up -d python check_availability.py From 4d7e590fa977800a79343cbf712102c8f715b262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Wed, 29 Apr 2020 16:30:58 -0500 Subject: [PATCH 086/145] ext/pymysql: Add Instrumentor (#611) Co-authored-by: Diego Hurtado --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 118d0b096..c9b1df4bf 100644 --- a/tox.ini +++ b/tox.ini @@ -188,8 +188,9 @@ commands_pre = psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-dbapi psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-psycopg2 + pymysql: pip install {toxinidir}/opentelemetry-auto-instrumentation pymysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi - pymysql: pip install {toxinidir}/ext/opentelemetry-ext-pymysql + pymysql: pip install {toxinidir}/ext/opentelemetry-ext-pymysql[test] redis: pip install {toxinidir}/opentelemetry-auto-instrumentation redis: pip install {toxinidir}/ext/opentelemetry-ext-redis[test] From d9ad59bdbfdc93e3cfc8e2db17564f91b326cf35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Thu, 30 Apr 2020 18:35:15 -0500 Subject: [PATCH 087/145] Docs: fix docs dependencies (#625) --- tox.ini | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/tox.ini b/tox.ini index c9b1df4bf..1b0243c07 100644 --- a/tox.ini +++ b/tox.ini @@ -250,22 +250,7 @@ commands = [testenv:docs] deps = -c dev-requirements.txt - -c docs-requirements.txt - sphinx - sphinx-rtd-theme - sphinx-autodoc-typehints - # Required by ext packages - opentracing - Deprecated - thrift - pymongo - redis - flask - pymysql - mysql-connector-python - wrapt - psycopg2-binary - prometheus_client + -r docs-requirements.txt changedir = docs From ba030be66de6afaabce127cf3800756e5197c603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Sat, 2 May 2020 23:31:15 -0500 Subject: [PATCH 088/145] requests: Rename http_requests to requests (#619) The requests integration is named http-requests because at the time it was created there were some problems with pylint. other integrations are using opentelemetry.ext.integration without problems, tests are passing without issue, even renamed. --- tox.ini | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tox.ini b/tox.ini index 1b0243c07..1570df787 100644 --- a/tox.ini +++ b/tox.ini @@ -36,9 +36,9 @@ envlist = py3{4,5,6,7,8}-test-ext-flask pypy3-test-ext-flask - ; opentelemetry-ext-http-requests - py3{4,5,6,7,8}-test-ext-http-requests - pypy3-test-ext-http-requests + ; opentelemetry-ext-requests + py3{4,5,6,7,8}-test-ext-requests + pypy3-test-ext-requests ; opentelemetry-ext-jaeger py3{4,5,6,7,8}-test-ext-jaeger @@ -124,7 +124,7 @@ changedir = test-sdk: opentelemetry-sdk/tests test-auto-instrumentation: opentelemetry-auto-instrumentation/tests test-ext-grpc: ext/opentelemetry-ext-grpc/tests - test-ext-http-requests: ext/opentelemetry-ext-http-requests/tests + test-ext-requests: ext/opentelemetry-ext-requests/tests test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests test-ext-mysql: ext/opentelemetry-ext-mysql/tests @@ -156,13 +156,13 @@ commands_pre = test-auto-instrumentation: pip install {toxinidir}/opentelemetry-auto-instrumentation example-app: pip install {toxinidir}/opentelemetry-auto-instrumentation - example-app: pip install {toxinidir}/ext/opentelemetry-ext-http-requests + example-app: pip install {toxinidir}/ext/opentelemetry-ext-requests example-app: pip install {toxinidir}/ext/opentelemetry-ext-wsgi example-app: pip install {toxinidir}/ext/opentelemetry-ext-flask example-app: pip install {toxinidir}/docs/examples/opentelemetry-example-app example-http: pip install -e {toxinidir}/opentelemetry-auto-instrumentation - example-http: pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests + example-http: pip install -e {toxinidir}/ext/opentelemetry-ext-requests example-http: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi example-http: pip install -r {toxinidir}/docs/examples/http/requirements.txt @@ -195,8 +195,8 @@ commands_pre = redis: pip install {toxinidir}/opentelemetry-auto-instrumentation redis: pip install {toxinidir}/ext/opentelemetry-ext-redis[test] - http-requests: pip install {toxinidir}/opentelemetry-auto-instrumentation - http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests[test] + requests: pip install {toxinidir}/opentelemetry-auto-instrumentation + requests: pip install {toxinidir}/ext/opentelemetry-ext-requests[test] jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger @@ -271,7 +271,7 @@ commands_pre = -e {toxinidir}/opentelemetry-auto-instrumentation \ -e {toxinidir}/opentelemetry-sdk \ -e {toxinidir}/opentelemetry-auto-instrumentation \ - -e {toxinidir}/ext/opentelemetry-ext-http-requests \ + -e {toxinidir}/ext/opentelemetry-ext-requests \ -e {toxinidir}/ext/opentelemetry-ext-wsgi \ -e {toxinidir}/ext/opentelemetry-ext-flask From 988962d24e7b50399fe82e97055cc4f74da2d6e7 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 6 May 2020 16:27:01 -0600 Subject: [PATCH 089/145] Add Django instrumentation (#593) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Initial Instrumentation Co-authored-by: Mauricio Vásquez Co-authored-by: Mathieu Hinderyckx Co-authored-by: alrex Co-authored-by: Yusuke Tsutsumi --- .flake8 | 3 ++- tox.ini | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.flake8 b/.flake8 index 5922f31d8..f511c4c3e 100644 --- a/.flake8 +++ b/.flake8 @@ -2,7 +2,8 @@ ignore = E501 # line too long, defer to black F401 # unused import, defer to pylint - W503 # allow line breaks after binary ops, not after + W503 # allow line breaks before binary ops + W504 # allow line breaks after binary ops E203 # allow whitespace before ':' (https://github.com/psf/black#slices) exclude = .bzr diff --git a/tox.ini b/tox.ini index 1570df787..84dd157db 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,9 @@ envlist = py3{4,5,6,7,8}-test-example-http pypy3-test-example-http + py3{6,7,8}-test-ext-django + pypy3-test-ext-django + ; opentelemetry-ext-dbapi py3{4,5,6,7,8}-test-ext-dbapi pypy3-test-ext-dbapi @@ -127,6 +130,7 @@ changedir = test-ext-requests: ext/opentelemetry-ext-requests/tests test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests + test-ext-django: ext/opentelemetry-ext-django/tests test-ext-mysql: ext/opentelemetry-ext-mysql/tests test-ext-otcollector: ext/opentelemetry-ext-otcollector/tests test-ext-prometheus: ext/opentelemetry-ext-prometheus/tests @@ -168,13 +172,15 @@ commands_pre = grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test] - wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-wsgi - - flask: pip install {toxinidir}/opentelemetry-auto-instrumentation + wsgi,flask,django: pip install {toxinidir}/tests/util + wsgi,flask,django: pip install {toxinidir}/ext/opentelemetry-ext-wsgi + flask,django: pip install {toxinidir}/opentelemetry-auto-instrumentation flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test] dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi[test] + django: pip install {toxinidir}/ext/opentelemetry-ext-django[test] + mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi mysql: pip install {toxinidir}/ext/opentelemetry-ext-mysql[test] From d551cc354b97e400fcd07817d2ef904c50a7cc3d Mon Sep 17 00:00:00 2001 From: joshuahlang Date: Wed, 6 May 2020 20:40:47 -0700 Subject: [PATCH 090/145] aiohttp: aiohttp client (#421) Adding initial aiohttp client. This module is only supported on Python3.5, which is the oldest supported by aiohttp. Co-authored-by: Yusuke Tsutsumi --- tox.ini | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 84dd157db..bb8f78586 100644 --- a/tox.ini +++ b/tox.ini @@ -28,9 +28,14 @@ envlist = py3{4,5,6,7,8}-test-example-http pypy3-test-example-http + ; opentelemetry-ext-aiohttp-client + py3{5,6,7,8}-test-ext-aiohttp-client + pypy3-test-ext-aiohttp-client + + ; opentelemetry-ext-django py3{6,7,8}-test-ext-django pypy3-test-ext-django - + ; opentelemetry-ext-dbapi py3{4,5,6,7,8}-test-ext-dbapi pypy3-test-ext-dbapi @@ -127,6 +132,7 @@ changedir = test-sdk: opentelemetry-sdk/tests test-auto-instrumentation: opentelemetry-auto-instrumentation/tests test-ext-grpc: ext/opentelemetry-ext-grpc/tests + test-ext-aiohttp-client: ext/opentelemetry-ext-aiohttp-client/tests test-ext-requests: ext/opentelemetry-ext-requests/tests test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests @@ -204,6 +210,9 @@ commands_pre = requests: pip install {toxinidir}/opentelemetry-auto-instrumentation requests: pip install {toxinidir}/ext/opentelemetry-ext-requests[test] + aiohttp-client: pip install {toxinidir}/opentelemetry-sdk + aiohttp-client: pip install {toxinidir}/ext/opentelemetry-ext-aiohttp-client + jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger opentracing-shim: pip install {toxinidir}/ext/opentelemetry-ext-opentracing-shim From 5d79a27fe6d75882cbd5faa2e4d95045f0d529bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Fri, 8 May 2020 21:04:36 -0500 Subject: [PATCH 091/145] ext/mysql: Add instrumentor interface (#655) Implement to helper methods to allow users to enable / disable instrumentation in a single connection object. Co-authored-by: Diego Hurtado Co-authored-by: alrex --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index bb8f78586..0ca6fb376 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,7 @@ envlist = ; opentelemetry-ext-django py3{6,7,8}-test-ext-django pypy3-test-ext-django - + ; opentelemetry-ext-dbapi py3{4,5,6,7,8}-test-ext-dbapi pypy3-test-ext-dbapi @@ -187,6 +187,7 @@ commands_pre = django: pip install {toxinidir}/ext/opentelemetry-ext-django[test] + mysql: pip install {toxinidir}/opentelemetry-auto-instrumentation mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi mysql: pip install {toxinidir}/ext/opentelemetry-ext-mysql[test] From abb1fcfc0503e69153574697e5329688b1164fc8 Mon Sep 17 00:00:00 2001 From: "Tahir H. Butt" Date: Mon, 11 May 2020 12:33:06 -0400 Subject: [PATCH 093/145] jinja2: Add jinja2 instrumentation (#643) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migrating the jinja2 plugin forked from ddtracepy. Co-authored-by: Mauricio Vásquez --- tox.ini | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tox.ini b/tox.ini index 0ca6fb376..8d4971d32 100644 --- a/tox.ini +++ b/tox.ini @@ -48,6 +48,10 @@ envlist = py3{4,5,6,7,8}-test-ext-requests pypy3-test-ext-requests + ; opentelemetry-ext-jinja2 + py3{4,5,6,7,8}-test-ext-jinja2 + pypy3-test-ext-jinja2 + ; opentelemetry-ext-jaeger py3{4,5,6,7,8}-test-ext-jaeger pypy3-test-ext-jaeger @@ -134,6 +138,7 @@ changedir = test-ext-grpc: ext/opentelemetry-ext-grpc/tests test-ext-aiohttp-client: ext/opentelemetry-ext-aiohttp-client/tests test-ext-requests: ext/opentelemetry-ext-requests/tests + test-ext-jinja2: ext/opentelemetry-ext-jinja2/tests test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests test-ext-django: ext/opentelemetry-ext-django/tests @@ -211,6 +216,9 @@ commands_pre = requests: pip install {toxinidir}/opentelemetry-auto-instrumentation requests: pip install {toxinidir}/ext/opentelemetry-ext-requests[test] + jinja2: pip install {toxinidir}/opentelemetry-auto-instrumentation + jinja2: pip install {toxinidir}/ext/opentelemetry-ext-jinja2[test] + aiohttp-client: pip install {toxinidir}/opentelemetry-sdk aiohttp-client: pip install {toxinidir}/ext/opentelemetry-ext-aiohttp-client From 1767f5882cc29afd8455a846e0b1cfc5176b3917 Mon Sep 17 00:00:00 2001 From: "Tahir H. Butt" Date: Wed, 13 May 2020 17:51:28 -0400 Subject: [PATCH 094/145] Add exporter to Datadog (#572) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an exporter to Datadog. This implementation makes use of ddtrace to handle the creation of Datadog traces and writing them to the Datadog agent. Co-Authored-By: Mauricio Vásquez --- tox.ini | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tox.ini b/tox.ini index 8d4971d32..40a2c02d7 100644 --- a/tox.ini +++ b/tox.ini @@ -56,6 +56,9 @@ envlist = py3{4,5,6,7,8}-test-ext-jaeger pypy3-test-ext-jaeger + ; opentelemetry-ext-datadog + py3{5,6,7,8}-test-ext-datadog + ; opentelemetry-ext-mysql py3{4,5,6,7,8}-test-ext-mysql pypy3-test-ext-mysql @@ -140,6 +143,7 @@ changedir = test-ext-requests: ext/opentelemetry-ext-requests/tests test-ext-jinja2: ext/opentelemetry-ext-jinja2/tests test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests + test-ext-datadog: ext/opentelemetry-ext-datadog/tests test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests test-ext-django: ext/opentelemetry-ext-django/tests test-ext-mysql: ext/opentelemetry-ext-mysql/tests @@ -224,6 +228,9 @@ commands_pre = jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger + datadog: pip install {toxinidir}/opentelemetry-sdk + datadog: pip install {toxinidir}/ext/opentelemetry-ext-datadog + opentracing-shim: pip install {toxinidir}/ext/opentelemetry-ext-opentracing-shim zipkin: pip install {toxinidir}/ext/opentelemetry-ext-zipkin From 37c4016e4ec5ac34be7a9b4c5844f48d91114aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Thu, 14 May 2020 22:27:16 -0500 Subject: [PATCH 095/145] docs: Fix warning and treat them as errors (#666) The CI is not able to catch many documentation problems because we are ignoring warnings. This commit fixes most of the warnings, ignores the rest and enables a flag to treat them as errors. Co-authored-by: Diego Hurtado --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 40a2c02d7..04ea2b165 100644 --- a/tox.ini +++ b/tox.ini @@ -280,13 +280,13 @@ commands = [testenv:docs] deps = - -c dev-requirements.txt - -r docs-requirements.txt + -c {toxinidir}/dev-requirements.txt + -r {toxinidir}/docs-requirements.txt changedir = docs commands = - sphinx-build -E -a --keep-going -b html -T . _build/html + sphinx-build -E -a -W -b html -T . _build/html [testenv:py38-tracecontext] basepython: python3.8 From fd24b54e28498c52a4694b7a75046990025e5756 Mon Sep 17 00:00:00 2001 From: Connor Adams Date: Thu, 21 May 2020 00:50:17 -0400 Subject: [PATCH 096/145] ext/psycopg2: Implement BaseInstrumentor interface (#694) - Implemented BaseInstrumentor interface to enable auto-instrumentation - Added integration tests (same tests as other db integrations) --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 04ea2b165..449448740 100644 --- a/tox.ini +++ b/tox.ini @@ -207,8 +207,9 @@ commands_pre = pymongo: pip install {toxinidir}/opentelemetry-auto-instrumentation pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo[test] + psycopg2: pip install {toxinidir}/opentelemetry-auto-instrumentation psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-dbapi - psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-psycopg2 + psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-psycopg2[test] pymysql: pip install {toxinidir}/opentelemetry-auto-instrumentation pymysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi From a8dc31188b09a72b1e81f29353f96a5716d0bee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauricio=20V=C3=A1squez?= Date: Thu, 21 May 2020 14:11:59 -0500 Subject: [PATCH 097/145] docs: Consolidate getting started guide and remove duplicated examples (#658) There are some examples that are duplicated in the getting started guide and in the examples folder itself. This commit removes the duplicated examples and updates the getting started guide to include then from real source files that are passed through the linter and have tests. Co-authored-by: Diego Hurtado Co-authored-by: alrex --- tox.ini | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/tox.ini b/tox.ini index 449448740..3c9b1db95 100644 --- a/tox.ini +++ b/tox.ini @@ -20,13 +20,9 @@ envlist = py3{4,5,6,7,8}-test-example-app pypy3-test-example-app - ; docs/examples/basic_tracer - py3{4,5,6,7,8}-test-example-basic-tracer - pypy3-test-example-basic-tracer - - ; docs/examples/http - py3{4,5,6,7,8}-test-example-http - pypy3-test-example-http + ; docs/getting-started + py3{4,5,6,7,8}-test-getting-started + pypy3-test-getting-started ; opentelemetry-ext-aiohttp-client py3{5,6,7,8}-test-ext-aiohttp-client @@ -156,8 +152,7 @@ changedir = test-ext-zipkin: ext/opentelemetry-ext-zipkin/tests test-ext-flask: ext/opentelemetry-ext-flask/tests test-example-app: docs/examples/opentelemetry-example-app/tests - test-example-basic-tracer: docs/examples/basic_tracer/tests - test-example-http: docs/examples/http/tests + test-getting-started: docs/getting_started/tests test-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests test-ext-sqlalchemy: ext/opentelemetry-ext-sqlalchemy/tests test-ext-redis: ext/opentelemetry-ext-redis/tests @@ -180,10 +175,10 @@ commands_pre = example-app: pip install {toxinidir}/ext/opentelemetry-ext-flask example-app: pip install {toxinidir}/docs/examples/opentelemetry-example-app - example-http: pip install -e {toxinidir}/opentelemetry-auto-instrumentation - example-http: pip install -e {toxinidir}/ext/opentelemetry-ext-requests - example-http: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi - example-http: pip install -r {toxinidir}/docs/examples/http/requirements.txt + getting-started: pip install -e {toxinidir}/opentelemetry-auto-instrumentation + getting-started: pip install -e {toxinidir}/ext/opentelemetry-ext-requests + getting-started: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi + getting-started: pip install -e {toxinidir}/ext/opentelemetry-ext-flask grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test] From 4f4e27816291398e9a636c2aef1a8ae0a3b3751c Mon Sep 17 00:00:00 2001 From: alrex Date: Thu, 21 May 2020 13:15:12 -0700 Subject: [PATCH 098/145] infra: accelerate builds (#693) Some build time improvements: - split lint/docker-tests/docs into their own steps. Since lint is usually the thing that fails anyways, it's good to have it run first. We could make the build depend on this step to prevent slowing other builds waiting in the pipeline (since we only have 5 workers) - move all pip install commands into a single line per test environment. this reduces the overhead of calling the pip command separately multiple times per environment. - removed pip upgrade command for pypy3 and py38 --- tox.ini | 55 ++++++++++++++----------------------------------------- 1 file changed, 14 insertions(+), 41 deletions(-) diff --git a/tox.ini b/tox.ini index 3c9b1db95..2e92c1bdb 100644 --- a/tox.ini +++ b/tox.ini @@ -115,10 +115,6 @@ envlist = docs docker-tests -[travis] -python = - 3.8: py38, lint, docs, docker-tests - [testenv] deps = -c dev-requirements.txt @@ -159,26 +155,16 @@ changedir = commands_pre = ; Install without -e to test the actual installation - python -m pip install -U pip setuptools wheel - + py3{4,5,6,7}: python -m pip install -U pip setuptools wheel ; Install common packages for all the tests. These are not needed in all the ; cases but it saves a lot of boilerplate in this file. - test: pip install {toxinidir}/opentelemetry-api - test: pip install {toxinidir}/opentelemetry-sdk - test: pip install {toxinidir}/tests/util + test: pip install {toxinidir}/opentelemetry-api {toxinidir}/opentelemetry-sdk {toxinidir}/tests/util test-auto-instrumentation: pip install {toxinidir}/opentelemetry-auto-instrumentation - example-app: pip install {toxinidir}/opentelemetry-auto-instrumentation - example-app: pip install {toxinidir}/ext/opentelemetry-ext-requests - example-app: pip install {toxinidir}/ext/opentelemetry-ext-wsgi - example-app: pip install {toxinidir}/ext/opentelemetry-ext-flask - example-app: pip install {toxinidir}/docs/examples/opentelemetry-example-app + example-app: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-requests {toxinidir}/ext/opentelemetry-ext-wsgi {toxinidir}/ext/opentelemetry-ext-flask {toxinidir}/docs/examples/opentelemetry-example-app - getting-started: pip install -e {toxinidir}/opentelemetry-auto-instrumentation - getting-started: pip install -e {toxinidir}/ext/opentelemetry-ext-requests - getting-started: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi - getting-started: pip install -e {toxinidir}/ext/opentelemetry-ext-flask + getting-started: pip install -e {toxinidir}/opentelemetry-auto-instrumentation -e {toxinidir}/ext/opentelemetry-ext-requests -e {toxinidir}/ext/opentelemetry-ext-wsgi -e {toxinidir}/ext/opentelemetry-ext-flask grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test] @@ -191,48 +177,35 @@ commands_pre = django: pip install {toxinidir}/ext/opentelemetry-ext-django[test] - mysql: pip install {toxinidir}/opentelemetry-auto-instrumentation - mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi - mysql: pip install {toxinidir}/ext/opentelemetry-ext-mysql[test] + mysql: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-mysql[test] otcollector: pip install {toxinidir}/ext/opentelemetry-ext-otcollector prometheus: pip install {toxinidir}/ext/opentelemetry-ext-prometheus - pymongo: pip install {toxinidir}/opentelemetry-auto-instrumentation - pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo[test] + pymongo: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-pymongo[test] - psycopg2: pip install {toxinidir}/opentelemetry-auto-instrumentation - psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-dbapi - psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-psycopg2[test] + psycopg2: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-psycopg2 {toxinidir}/ext/opentelemetry-ext-psycopg2[test] - pymysql: pip install {toxinidir}/opentelemetry-auto-instrumentation - pymysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi - pymysql: pip install {toxinidir}/ext/opentelemetry-ext-pymysql[test] + pymysql: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-pymysql[test] - redis: pip install {toxinidir}/opentelemetry-auto-instrumentation - redis: pip install {toxinidir}/ext/opentelemetry-ext-redis[test] + redis: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-redis[test] - requests: pip install {toxinidir}/opentelemetry-auto-instrumentation - requests: pip install {toxinidir}/ext/opentelemetry-ext-requests[test] + requests: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-requests[test] - jinja2: pip install {toxinidir}/opentelemetry-auto-instrumentation - jinja2: pip install {toxinidir}/ext/opentelemetry-ext-jinja2[test] + jinja2: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-jinja2[test] - aiohttp-client: pip install {toxinidir}/opentelemetry-sdk - aiohttp-client: pip install {toxinidir}/ext/opentelemetry-ext-aiohttp-client + aiohttp-client: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-aiohttp-client jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger - datadog: pip install {toxinidir}/opentelemetry-sdk - datadog: pip install {toxinidir}/ext/opentelemetry-ext-datadog + datadog: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-datadog opentracing-shim: pip install {toxinidir}/ext/opentelemetry-ext-opentracing-shim zipkin: pip install {toxinidir}/ext/opentelemetry-ext-zipkin - sqlalchemy: pip install {toxinidir}/opentelemetry-auto-instrumentation - sqlalchemy: pip install {toxinidir}/ext/opentelemetry-ext-sqlalchemy + sqlalchemy: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-sqlalchemy ; In order to get a healthy coverage report, ; we have to install packages in editable mode. From 62f9e464b8891e6ad779fa875672ea9aadfa172a Mon Sep 17 00:00:00 2001 From: Connor Adams Date: Thu, 21 May 2020 19:14:25 -0400 Subject: [PATCH 099/145] SQLite3 Instrumentation (#719) Adds instrumentation for python sqlite3 library. --- tox.ini | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tox.ini b/tox.ini index 2e92c1bdb..5742e717d 100644 --- a/tox.ini +++ b/tox.ini @@ -79,6 +79,10 @@ envlist = py3{4,5,6,7,8}-test-ext-pymysql pypy3-test-ext-pymysql + ; opentelemetry-ext-sqlite3 + py3{4,5,6,7,8}-test-ext-sqlite3 + pypy3-test-ext-sqlite3 + ; opentelemetry-ext-wsgi py3{4,5,6,7,8}-test-ext-wsgi pypy3-test-ext-wsgi @@ -144,6 +148,7 @@ changedir = test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests test-ext-psycopg2: ext/opentelemetry-ext-psycopg2/tests test-ext-pymysql: ext/opentelemetry-ext-pymysql/tests + test-ext-sqlite3: ext/opentelemetry-ext-sqlite3/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests test-ext-zipkin: ext/opentelemetry-ext-zipkin/tests test-ext-flask: ext/opentelemetry-ext-flask/tests @@ -189,6 +194,8 @@ commands_pre = pymysql: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-pymysql[test] + sqlite3: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-sqlite3[test] + redis: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-redis[test] requests: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-requests[test] From 76e13624856177ca9b79d13f769319513e07fd7a Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Fri, 22 May 2020 22:01:05 -0600 Subject: [PATCH 100/145] opencensus: Rename otcollector to opencensus (#695) renaming otcollector to opencensus, as it's using opencensus under the hood. This was originally intended to be replaced by otlp, by a new package can be created for that instead. Co-authored-by: alrex --- tox.ini | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index 5742e717d..8f44a47ed 100644 --- a/tox.ini +++ b/tox.ini @@ -59,9 +59,9 @@ envlist = py3{4,5,6,7,8}-test-ext-mysql pypy3-test-ext-mysql - ; opentelemetry-ext-otcollector - py3{4,5,6,7,8}-test-ext-otcollector - ; ext-otcollector intentionally excluded from pypy3 + ; opentelemetry-ext-opencensusexporter + py3{4,5,6,7,8}-test-ext-opencensusexporter + ; ext-opencensusexporter intentionally excluded from pypy3 ; opentelemetry-ext-prometheus py3{4,5,6,7,8}-test-ext-prometheus @@ -143,7 +143,7 @@ changedir = test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests test-ext-django: ext/opentelemetry-ext-django/tests test-ext-mysql: ext/opentelemetry-ext-mysql/tests - test-ext-otcollector: ext/opentelemetry-ext-otcollector/tests + test-ext-opencensusexporter: ext/opentelemetry-ext-opencensusexporter/tests test-ext-prometheus: ext/opentelemetry-ext-prometheus/tests test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests test-ext-psycopg2: ext/opentelemetry-ext-psycopg2/tests @@ -184,7 +184,7 @@ commands_pre = mysql: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-mysql[test] - otcollector: pip install {toxinidir}/ext/opentelemetry-ext-otcollector + opencensusexporter: pip install {toxinidir}/ext/opentelemetry-ext-opencensusexporter prometheus: pip install {toxinidir}/ext/opentelemetry-ext-prometheus @@ -310,7 +310,8 @@ commands_pre = -e {toxinidir}/ext/opentelemetry-ext-pymongo \ -e {toxinidir}/ext/opentelemetry-ext-pymysql \ -e {toxinidir}/ext/opentelemetry-ext-sqlalchemy \ - -e {toxinidir}/ext/opentelemetry-ext-redis + -e {toxinidir}/ext/opentelemetry-ext-redis \ + -e {toxinidir}/ext/opentelemetry-ext-opencensusexporter docker-compose up -d python check_availability.py commands = From 626cf89620a338da87fef7bdc4aacc81c490a222 Mon Sep 17 00:00:00 2001 From: HiveTraum Date: Mon, 25 May 2020 20:29:51 +0500 Subject: [PATCH 101/145] ext/django: django downgrade to 1.10 (#717) Adding support for django 1.10+ --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 8f44a47ed..918e99f7c 100644 --- a/tox.ini +++ b/tox.ini @@ -29,7 +29,7 @@ envlist = pypy3-test-ext-aiohttp-client ; opentelemetry-ext-django - py3{6,7,8}-test-ext-django + py3{4,5,6,7,8}-test-ext-django pypy3-test-ext-django ; opentelemetry-ext-dbapi From 6c4541d4a77542d717f30ff8ae5d71a5ffabe232 Mon Sep 17 00:00:00 2001 From: "Tahir H. Butt" Date: Wed, 27 May 2020 12:17:35 -0400 Subject: [PATCH 102/145] asgi: Add ASGI middleware (#716) Adding an ASGI extension. Co-authored-by: Emil Madsen Co-authored-by: alrex Co-authored-by: Florimond Manca --- tox.ini | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 918e99f7c..abb1355be 100644 --- a/tox.ini +++ b/tox.ini @@ -79,6 +79,10 @@ envlist = py3{4,5,6,7,8}-test-ext-pymysql pypy3-test-ext-pymysql + ; opentelemetry-ext-asgi + py3{5,6,7,8}-test-ext-asgi + pypy3-test-ext-asgi + ; opentelemetry-ext-sqlite3 py3{4,5,6,7,8}-test-ext-sqlite3 pypy3-test-ext-sqlite3 @@ -148,6 +152,7 @@ changedir = test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests test-ext-psycopg2: ext/opentelemetry-ext-psycopg2/tests test-ext-pymysql: ext/opentelemetry-ext-pymysql/tests + test-ext-asgi: ext/opentelemetry-ext-asgi/tests test-ext-sqlite3: ext/opentelemetry-ext-sqlite3/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests test-ext-zipkin: ext/opentelemetry-ext-zipkin/tests @@ -173,9 +178,10 @@ commands_pre = grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test] - wsgi,flask,django: pip install {toxinidir}/tests/util + wsgi,flask,django,asgi: pip install {toxinidir}/tests/util wsgi,flask,django: pip install {toxinidir}/ext/opentelemetry-ext-wsgi flask,django: pip install {toxinidir}/opentelemetry-auto-instrumentation + asgi: pip install {toxinidir}/ext/opentelemetry-ext-asgi flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test] dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi[test] From d79be1814fe4ae7f45662042cae8860cbf6bfa37 Mon Sep 17 00:00:00 2001 From: alrex Date: Fri, 29 May 2020 14:02:37 -0700 Subject: [PATCH 103/145] ext/system-metrics: adding instrumentation to collect system metrics (#652) Adding an extension to provide users an easy mechanism to collect metrics for their system. --- tox.ini | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tox.ini b/tox.ini index abb1355be..3cec9fcfb 100644 --- a/tox.ini +++ b/tox.ini @@ -114,6 +114,11 @@ envlist = py3{4,5,6,7,8}-test-ext-redis pypy3-test-ext-redis + ; opentelemetry-ext-system-metrics + py3{4,5,6,7,8}-test-ext-system-metrics + ; ext-system-metrics intentionally excluded from pypy3 + ; known limitation: gc.get_count won't work under pypy + ; Coverage is temporarily disabled for pypy3 due to the pytest bug. ; pypy3-coverage @@ -162,6 +167,7 @@ changedir = test-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests test-ext-sqlalchemy: ext/opentelemetry-ext-sqlalchemy/tests test-ext-redis: ext/opentelemetry-ext-redis/tests + test-ext-system-metrics: ext/opentelemetry-ext-system-metrics/tests commands_pre = ; Install without -e to test the actual installation @@ -220,6 +226,9 @@ commands_pre = sqlalchemy: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-sqlalchemy + system-metrics: pip install {toxinidir}/opentelemetry-auto-instrumentation + system-metrics: pip install {toxinidir}/ext/opentelemetry-ext-system-metrics[test] + ; In order to get a healthy coverage report, ; we have to install packages in editable mode. coverage: python {toxinidir}/scripts/eachdist.py install --editable @@ -317,6 +326,7 @@ commands_pre = -e {toxinidir}/ext/opentelemetry-ext-pymysql \ -e {toxinidir}/ext/opentelemetry-ext-sqlalchemy \ -e {toxinidir}/ext/opentelemetry-ext-redis \ + -e {toxinidir}/ext/opentelemetry-ext-system-metrics \ -e {toxinidir}/ext/opentelemetry-ext-opencensusexporter docker-compose up -d python check_availability.py From 0a37a10713331f3e4ec15a559caca92c0f28e44c Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 2 Jun 2020 16:37:56 -0600 Subject: [PATCH 104/145] ext/boto: Add boto instrumentation (#665) --- tox.ini | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tox.ini b/tox.ini index 3cec9fcfb..978155616 100644 --- a/tox.ini +++ b/tox.ini @@ -36,6 +36,10 @@ envlist = py3{4,5,6,7,8}-test-ext-dbapi pypy3-test-ext-dbapi + ; opentelemetry-ext-boto + py3{5,6,7,8}-test-ext-boto + pypy3-test-ext-boto + ; opentelemetry-ext-flask py3{4,5,6,7,8}-test-ext-flask pypy3-test-ext-flask @@ -161,6 +165,7 @@ changedir = test-ext-sqlite3: ext/opentelemetry-ext-sqlite3/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests test-ext-zipkin: ext/opentelemetry-ext-zipkin/tests + test-ext-boto: ext/opentelemetry-ext-boto/tests test-ext-flask: ext/opentelemetry-ext-flask/tests test-example-app: docs/examples/opentelemetry-example-app/tests test-getting-started: docs/getting_started/tests @@ -188,6 +193,10 @@ commands_pre = wsgi,flask,django: pip install {toxinidir}/ext/opentelemetry-ext-wsgi flask,django: pip install {toxinidir}/opentelemetry-auto-instrumentation asgi: pip install {toxinidir}/ext/opentelemetry-ext-asgi + + boto: pip install {toxinidir}/opentelemetry-auto-instrumentation + boto: pip install {toxinidir}/ext/opentelemetry-ext-boto[test] + flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test] dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi[test] From 82116bcfe9687c39e928fab12352a19069fa6822 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Tue, 2 Jun 2020 20:37:36 -0700 Subject: [PATCH 105/145] opentracing-shim: add testbed for otshim (#727) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit ports the OpenTracing testbed[1] to check that the ot-shim is working as expected using different frameworks. Gevent doesn't support context vars yet[2], so those tests are not compatible with opentelemetry and were not ported. [1] https://github.com/opentracing/opentracing-python/tree/master/testbed [2] https://github.com/gevent/gevent/issues/1407 Co-authored-by: Mauricio Vásquez Co-authored-by: alrex --- tox.ini | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 978155616..381e8604e 100644 --- a/tox.ini +++ b/tox.ini @@ -227,10 +227,11 @@ commands_pre = jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger - datadog: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-datadog - + opentracing-shim: pip install {toxinidir}/opentelemetry-sdk opentracing-shim: pip install {toxinidir}/ext/opentelemetry-ext-opentracing-shim + datadog: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-datadog + zipkin: pip install {toxinidir}/ext/opentelemetry-ext-zipkin sqlalchemy: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-sqlalchemy @@ -258,6 +259,9 @@ commands = ; implicit Any due to unfollowed import would result). mypyinstalled: mypy --namespace-packages opentelemetry-api/tests/mypysmoke.py --strict +[testenv:py34-test-opentracing-shim] +commands = + pytest --ignore-glob='*[asyncio].py' [testenv:lint] basepython: python3.8 From 3ef7afd255e66fb7fdd0d5591fe7e0879c26ca57 Mon Sep 17 00:00:00 2001 From: Andrew Xue Date: Thu, 4 Jun 2020 00:33:36 -0400 Subject: [PATCH 106/145] cloud-trace: Cloud Trace exporter (#698) Co-authored-by: Cheng-Lung Sung --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 381e8604e..026d01cc0 100644 --- a/tox.ini +++ b/tox.ini @@ -159,6 +159,7 @@ changedir = test-ext-opencensusexporter: ext/opentelemetry-ext-opencensusexporter/tests test-ext-prometheus: ext/opentelemetry-ext-prometheus/tests test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests + test-exporter-cloud-trace: ext/opentelemetry-exporter-cloud-trace/tests test-ext-psycopg2: ext/opentelemetry-ext-psycopg2/tests test-ext-pymysql: ext/opentelemetry-ext-pymysql/tests test-ext-asgi: ext/opentelemetry-ext-asgi/tests From 8d39609e47bf378cb5903ebc3919e45db65510eb Mon Sep 17 00:00:00 2001 From: Connor Adams Date: Mon, 8 Jun 2020 18:52:38 -0400 Subject: [PATCH 107/145] refactor: Add common utils to opentelemetry-auto-instrumentation, rename opentelemetry-auto-instrumentation (#741) --- eachdist.ini | 2 +- tox.ini | 41 +++++++++++++++++++---------------------- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/eachdist.ini b/eachdist.ini index b573b838f..f88cb1b18 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -4,7 +4,7 @@ sortfirst= opentelemetry-api opentelemetry-sdk - opentelemetry-auto-instrumentation + opentelemetry-instrumentation ext/opentelemetry-ext-wsgi ext/opentelemetry-ext-dbapi ext/* diff --git a/tox.ini b/tox.ini index 026d01cc0..d73875d89 100644 --- a/tox.ini +++ b/tox.ini @@ -12,9 +12,9 @@ envlist = py3{4,5,6,7,8}-test-sdk pypy3-test-sdk - ; opentelemetry-auto-instrumentation - py3{4,5,6,7,8}-test-auto-instrumentation - pypy3-test-auto-instrumentation + ; opentelemetry-instrumentation + py3{5,6,7,8}-test-instrumentation + pypy3-test-instrumentation ; opentelemetry-example-app py3{4,5,6,7,8}-test-example-app @@ -146,7 +146,7 @@ setenv = changedir = test-api: opentelemetry-api/tests test-sdk: opentelemetry-sdk/tests - test-auto-instrumentation: opentelemetry-auto-instrumentation/tests + test-instrumentation: opentelemetry-instrumentation/tests test-ext-grpc: ext/opentelemetry-ext-grpc/tests test-ext-aiohttp-client: ext/opentelemetry-ext-aiohttp-client/tests test-ext-requests: ext/opentelemetry-ext-requests/tests @@ -182,20 +182,19 @@ commands_pre = ; cases but it saves a lot of boilerplate in this file. test: pip install {toxinidir}/opentelemetry-api {toxinidir}/opentelemetry-sdk {toxinidir}/tests/util - test-auto-instrumentation: pip install {toxinidir}/opentelemetry-auto-instrumentation + ext,instrumentation: pip install {toxinidir}/opentelemetry-instrumentation - example-app: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-requests {toxinidir}/ext/opentelemetry-ext-wsgi {toxinidir}/ext/opentelemetry-ext-flask {toxinidir}/docs/examples/opentelemetry-example-app + example-app: pip install {toxinidir}/opentelemetry-instrumentation {toxinidir}/ext/opentelemetry-ext-requests {toxinidir}/ext/opentelemetry-ext-wsgi {toxinidir}/ext/opentelemetry-ext-flask {toxinidir}/docs/examples/opentelemetry-example-app - getting-started: pip install -e {toxinidir}/opentelemetry-auto-instrumentation -e {toxinidir}/ext/opentelemetry-ext-requests -e {toxinidir}/ext/opentelemetry-ext-wsgi -e {toxinidir}/ext/opentelemetry-ext-flask + getting-started: pip install -e {toxinidir}/opentelemetry-instrumentation -e {toxinidir}/ext/opentelemetry-ext-requests -e {toxinidir}/ext/opentelemetry-ext-wsgi -e {toxinidir}/ext/opentelemetry-ext-flask grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test] wsgi,flask,django,asgi: pip install {toxinidir}/tests/util wsgi,flask,django: pip install {toxinidir}/ext/opentelemetry-ext-wsgi - flask,django: pip install {toxinidir}/opentelemetry-auto-instrumentation + asgi: pip install {toxinidir}/ext/opentelemetry-ext-asgi - boto: pip install {toxinidir}/opentelemetry-auto-instrumentation boto: pip install {toxinidir}/ext/opentelemetry-ext-boto[test] flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test] @@ -204,25 +203,25 @@ commands_pre = django: pip install {toxinidir}/ext/opentelemetry-ext-django[test] - mysql: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-mysql[test] + mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-mysql[test] opencensusexporter: pip install {toxinidir}/ext/opentelemetry-ext-opencensusexporter prometheus: pip install {toxinidir}/ext/opentelemetry-ext-prometheus - pymongo: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-pymongo[test] + pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo[test] - psycopg2: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-psycopg2 {toxinidir}/ext/opentelemetry-ext-psycopg2[test] + psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-psycopg2 {toxinidir}/ext/opentelemetry-ext-psycopg2[test] - pymysql: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-pymysql[test] + pymysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-pymysql[test] - sqlite3: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-sqlite3[test] + sqlite3: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-sqlite3[test] - redis: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-redis[test] + redis: pip install {toxinidir}/ext/opentelemetry-ext-redis[test] - requests: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-requests[test] + requests: pip install {toxinidir}/ext/opentelemetry-ext-requests[test] - jinja2: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-jinja2[test] + jinja2: pip install {toxinidir}/ext/opentelemetry-ext-jinja2[test] aiohttp-client: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-aiohttp-client @@ -235,9 +234,8 @@ commands_pre = zipkin: pip install {toxinidir}/ext/opentelemetry-ext-zipkin - sqlalchemy: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-sqlalchemy + sqlalchemy: pip install {toxinidir}/ext/opentelemetry-ext-sqlalchemy - system-metrics: pip install {toxinidir}/opentelemetry-auto-instrumentation system-metrics: pip install {toxinidir}/ext/opentelemetry-ext-system-metrics[test] ; In order to get a healthy coverage report, @@ -304,9 +302,8 @@ deps = commands_pre = pip install -e {toxinidir}/opentelemetry-api \ - -e {toxinidir}/opentelemetry-auto-instrumentation \ + -e {toxinidir}/opentelemetry-instrumentation \ -e {toxinidir}/opentelemetry-sdk \ - -e {toxinidir}/opentelemetry-auto-instrumentation \ -e {toxinidir}/ext/opentelemetry-ext-requests \ -e {toxinidir}/ext/opentelemetry-ext-wsgi \ -e {toxinidir}/ext/opentelemetry-ext-flask @@ -331,7 +328,7 @@ changedir = commands_pre = pip install -e {toxinidir}/opentelemetry-api \ -e {toxinidir}/opentelemetry-sdk \ - -e {toxinidir}/opentelemetry-auto-instrumentation \ + -e {toxinidir}/opentelemetry-instrumentation \ -e {toxinidir}/tests/util \ -e {toxinidir}/ext/opentelemetry-ext-dbapi \ -e {toxinidir}/ext/opentelemetry-ext-mysql \ From 9fa14e285ee826dc44966ea74dfc14354fa1e657 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 9 Jun 2020 11:05:21 -0600 Subject: [PATCH 108/145] proto: Add proto files (#728) Initial addition of opentelemetry-proto based protobufs. Co-authored-by: alrex Co-authored-by: Yusuke Tsutsumi --- .flake8 | 1 + .isort.cfg | 2 +- .pylintrc | 2 +- tox.ini | 6 ++++++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.flake8 b/.flake8 index f511c4c3e..39288e9b1 100644 --- a/.flake8 +++ b/.flake8 @@ -20,3 +20,4 @@ exclude = ext/opentelemetry-ext-jaeger/build/* docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/grpc/gen/ docs/examples/opentelemetry-example-app/build/* + opentelemetry-proto/src/opentelemetry/proto/ diff --git a/.isort.cfg b/.isort.cfg index ae2dfc325..fd2ecc786 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -13,6 +13,6 @@ line_length=79 ; docs: https://github.com/timothycrosley/isort#multi-line-output-modes multi_line_output=3 skip=target -skip_glob=**/gen/*,.venv*/*,venv*/* +skip_glob=**/gen/*,.venv*/*,venv*/*,**/proto/* known_first_party=opentelemetry,opentelemetry_example_app known_third_party=psutil,pytest,redis,redis_opentracing diff --git a/.pylintrc b/.pylintrc index 1aa1e10d0..01c96ea39 100644 --- a/.pylintrc +++ b/.pylintrc @@ -7,7 +7,7 @@ extension-pkg-whitelist= # Add files or directories to the blacklist. They should be base names, not # paths. -ignore=CVS,gen +ignore=CVS,gen,proto # Add files or directories matching the regex patterns to the blacklist. The # regex matches against base names, not paths. diff --git a/tox.ini b/tox.ini index d73875d89..332662a5c 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,10 @@ envlist = py3{4,5,6,7,8}-test-api pypy3-test-api + ; opentelemetry-proto + py3{4,5,6,7,8}-test-proto + pypy3-test-proto + ; opentelemetry-sdk py3{4,5,6,7,8}-test-sdk pypy3-test-sdk @@ -146,6 +150,7 @@ setenv = changedir = test-api: opentelemetry-api/tests test-sdk: opentelemetry-sdk/tests + test-proto: opentelemetry-proto/tests test-instrumentation: opentelemetry-instrumentation/tests test-ext-grpc: ext/opentelemetry-ext-grpc/tests test-ext-aiohttp-client: ext/opentelemetry-ext-aiohttp-client/tests @@ -182,6 +187,7 @@ commands_pre = ; cases but it saves a lot of boilerplate in this file. test: pip install {toxinidir}/opentelemetry-api {toxinidir}/opentelemetry-sdk {toxinidir}/tests/util + test-proto: pip install {toxinidir}/opentelemetry-proto ext,instrumentation: pip install {toxinidir}/opentelemetry-instrumentation example-app: pip install {toxinidir}/opentelemetry-instrumentation {toxinidir}/ext/opentelemetry-ext-requests {toxinidir}/ext/opentelemetry-ext-wsgi {toxinidir}/ext/opentelemetry-ext-flask {toxinidir}/docs/examples/opentelemetry-example-app From 3e42946803dede491feb3bbd8064924d58a96b08 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 9 Jun 2020 15:18:03 -0600 Subject: [PATCH 109/145] botocore: Add botocore instrumentation (#689) Adding initial boto core implementation. Co-authored-by: alrex --- tox.ini | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tox.ini b/tox.ini index 332662a5c..de7fe82ca 100644 --- a/tox.ini +++ b/tox.ini @@ -32,6 +32,10 @@ envlist = py3{5,6,7,8}-test-ext-aiohttp-client pypy3-test-ext-aiohttp-client + ; opentelemetry-ext-botocore + py3{6,7,8}-test-ext-botocore + pypy3-test-ext-botocore + ; opentelemetry-ext-django py3{4,5,6,7,8}-test-ext-django pypy3-test-ext-django @@ -172,6 +176,7 @@ changedir = test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests test-ext-zipkin: ext/opentelemetry-ext-zipkin/tests test-ext-boto: ext/opentelemetry-ext-boto/tests + test-ext-botocore: ext/opentelemetry-ext-botocore/tests test-ext-flask: ext/opentelemetry-ext-flask/tests test-example-app: docs/examples/opentelemetry-example-app/tests test-getting-started: docs/getting_started/tests @@ -205,6 +210,9 @@ commands_pre = flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test] + botocore: pip install {toxinidir}/opentelemetry-instrumentation + botocore: pip install {toxinidir}/ext/opentelemetry-ext-botocore[test] + dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi[test] django: pip install {toxinidir}/ext/opentelemetry-ext-django[test] From 64c2ff46be844089536d71b019d514e22c9ee94e Mon Sep 17 00:00:00 2001 From: Connor Adams Date: Wed, 10 Jun 2020 17:00:40 -0400 Subject: [PATCH 110/145] Instrumentation for Pyramid (#776) Co-authored-by: Yusuke Tsutsumi --- tox.ini | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index de7fe82ca..2d05a9828 100644 --- a/tox.ini +++ b/tox.ini @@ -91,6 +91,10 @@ envlist = py3{4,5,6,7,8}-test-ext-pymysql pypy3-test-ext-pymysql + ; opentelemetry-ext-pyramid + py3{4,5,6,7,8}-test-ext-pyramid + pypy3-test-ext-pyramid + ; opentelemetry-ext-asgi py3{5,6,7,8}-test-ext-asgi pypy3-test-ext-asgi @@ -171,6 +175,7 @@ changedir = test-exporter-cloud-trace: ext/opentelemetry-exporter-cloud-trace/tests test-ext-psycopg2: ext/opentelemetry-ext-psycopg2/tests test-ext-pymysql: ext/opentelemetry-ext-pymysql/tests + test-ext-pyramid: ext/opentelemetry-ext-pyramid/tests test-ext-asgi: ext/opentelemetry-ext-asgi/tests test-ext-sqlite3: ext/opentelemetry-ext-sqlite3/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests @@ -201,8 +206,8 @@ commands_pre = grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test] - wsgi,flask,django,asgi: pip install {toxinidir}/tests/util - wsgi,flask,django: pip install {toxinidir}/ext/opentelemetry-ext-wsgi + wsgi,flask,django,asgi,pyramid: pip install {toxinidir}/tests/util + wsgi,flask,django,pyramid: pip install {toxinidir}/ext/opentelemetry-ext-wsgi asgi: pip install {toxinidir}/ext/opentelemetry-ext-asgi @@ -229,6 +234,8 @@ commands_pre = pymysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-pymysql[test] + pyramid: pip install {toxinidir}/ext/opentelemetry-ext-pyramid[test] + sqlite3: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-sqlite3[test] redis: pip install {toxinidir}/ext/opentelemetry-ext-redis[test] From 9486b2d4d309971677ff7f11504420dedb97fc80 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 10 Jun 2020 17:44:29 -0600 Subject: [PATCH 111/145] ext/otlp: Add OTLP span exporter (#787) Co-authored-by: Leighton Chen Co-authored-by: alrex --- eachdist.ini | 1 + tox.ini | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/eachdist.ini b/eachdist.ini index f88cb1b18..e052f9cf8 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -5,6 +5,7 @@ sortfirst= opentelemetry-api opentelemetry-sdk opentelemetry-instrumentation + opentelemetry-proto ext/opentelemetry-ext-wsgi ext/opentelemetry-ext-dbapi ext/* diff --git a/tox.ini b/tox.ini index 2d05a9828..ac5b27821 100644 --- a/tox.ini +++ b/tox.ini @@ -75,6 +75,10 @@ envlist = py3{4,5,6,7,8}-test-ext-opencensusexporter ; ext-opencensusexporter intentionally excluded from pypy3 + ; opentelemetry-ext-otlp + py3{5,6,7,8}-test-ext-otlp + ; ext-otlp intentionally excluded from pypy3 + ; opentelemetry-ext-prometheus py3{4,5,6,7,8}-test-ext-prometheus pypy3-test-ext-prometheus @@ -170,6 +174,7 @@ changedir = test-ext-django: ext/opentelemetry-ext-django/tests test-ext-mysql: ext/opentelemetry-ext-mysql/tests test-ext-opencensusexporter: ext/opentelemetry-ext-opencensusexporter/tests + test-ext-otlp: ext/opentelemetry-ext-otlp/tests test-ext-prometheus: ext/opentelemetry-ext-prometheus/tests test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests test-exporter-cloud-trace: ext/opentelemetry-exporter-cloud-trace/tests @@ -226,6 +231,9 @@ commands_pre = opencensusexporter: pip install {toxinidir}/ext/opentelemetry-ext-opencensusexporter + otlp: pip install {toxinidir}/opentelemetry-proto + otlp: pip install {toxinidir}/ext/opentelemetry-ext-otlp + prometheus: pip install {toxinidir}/ext/opentelemetry-ext-prometheus pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo[test] From a74c16af9a16fade15760ec922578cae11c5d77c Mon Sep 17 00:00:00 2001 From: Andrew Xue Date: Wed, 10 Jun 2020 23:15:47 -0400 Subject: [PATCH 112/145] chore: add opentelemetry-test as a dependancy (#809) opentelemetry-test was not listed as a test dependency in the asgi instrumentation. --- eachdist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/eachdist.ini b/eachdist.ini index e052f9cf8..a2822d97b 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -6,6 +6,7 @@ sortfirst= opentelemetry-sdk opentelemetry-instrumentation opentelemetry-proto + tests/util ext/opentelemetry-ext-wsgi ext/opentelemetry-ext-dbapi ext/* From 9d3118ee7df151865b715498c0abf283d9a4cc6a Mon Sep 17 00:00:00 2001 From: Andrew Xue Date: Thu, 11 Jun 2020 17:41:22 -0400 Subject: [PATCH 113/145] chore: add test coverage for Cloud Monitoring exporter (#804) Previously cloud monitoring was missing coverage. --- tox.ini | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tox.ini b/tox.ini index ac5b27821..a46026a24 100644 --- a/tox.ini +++ b/tox.ini @@ -142,6 +142,12 @@ envlist = ; Coverage is temporarily disabled for pypy3 due to the pytest bug. ; pypy3-coverage + ; opentelemetry-exporter-cloud-monitoring + py3{4,5,6,7,8}-test-exporter-cloud-monitoring + + ; opentelemetry-exporter-cloud-trace + py3{4,5,6,7,8}-test-exporter-cloud-trace + lint py38-tracecontext py38-{mypy,mypyinstalled} @@ -178,6 +184,7 @@ changedir = test-ext-prometheus: ext/opentelemetry-ext-prometheus/tests test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests test-exporter-cloud-trace: ext/opentelemetry-exporter-cloud-trace/tests + test-exporter-cloud-monitoring: ext/opentelemetry-exporter-cloud-monitoring/tests test-ext-psycopg2: ext/opentelemetry-ext-psycopg2/tests test-ext-pymysql: ext/opentelemetry-ext-pymysql/tests test-ext-pyramid: ext/opentelemetry-ext-pyramid/tests @@ -267,6 +274,9 @@ commands_pre = system-metrics: pip install {toxinidir}/ext/opentelemetry-ext-system-metrics[test] + exporter-cloud-monitoring: pip install {toxinidir}/ext/opentelemetry-exporter-cloud-monitoring + exporter-cloud-trace: pip install {toxinidir}/ext/opentelemetry-exporter-cloud-trace + ; In order to get a healthy coverage report, ; we have to install packages in editable mode. coverage: python {toxinidir}/scripts/eachdist.py install --editable From 14289122c2602b0f80a1e6176483ee8974ca819c Mon Sep 17 00:00:00 2001 From: Eric Mustin Date: Fri, 12 Jun 2020 16:45:28 +0200 Subject: [PATCH 114/145] pymemcache: Add pymemcache instrumentation (#772) initial implementation --- tox.ini | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tox.ini b/tox.ini index a46026a24..cab2031aa 100644 --- a/tox.ini +++ b/tox.ini @@ -87,6 +87,10 @@ envlist = py3{4,5,6,7,8}-test-ext-psycopg2 ; ext-psycopg2 intentionally excluded from pypy3 + ; opentelemetry-ext-pymemcache + py3{4,5,6,7,8}-test-ext-pymemcache + pypy3-test-ext-pymemcache + ; opentelemetry-ext-pymongo py3{4,5,6,7,8}-test-ext-pymongo pypy3-test-ext-pymongo @@ -182,6 +186,7 @@ changedir = test-ext-opencensusexporter: ext/opentelemetry-ext-opencensusexporter/tests test-ext-otlp: ext/opentelemetry-ext-otlp/tests test-ext-prometheus: ext/opentelemetry-ext-prometheus/tests + test-ext-pymemcache: ext/opentelemetry-ext-pymemcache/tests test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests test-exporter-cloud-trace: ext/opentelemetry-exporter-cloud-trace/tests test-exporter-cloud-monitoring: ext/opentelemetry-exporter-cloud-monitoring/tests @@ -243,6 +248,8 @@ commands_pre = prometheus: pip install {toxinidir}/ext/opentelemetry-ext-prometheus + pymemcache: pip install {toxinidir}/ext/opentelemetry-ext-pymemcache[test] + pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo[test] psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-psycopg2 {toxinidir}/ext/opentelemetry-ext-psycopg2[test] From 244e709bf029740826055f00d5e96ef99c690f3c Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Mon, 15 Jun 2020 13:59:57 -0700 Subject: [PATCH 115/145] starlette instrumentation (#777) adding an initial starlette instrumentation. tox does exact match on fields delimited by a dash. Thus, any instrumentation that includes "instrumentation" in the name would collide with testing of the "opentelemetry-instrumentation" package. Renaming opentelemetry-instrumentation to opentelemetry-instrumentation-base to fix that. Co-authored-by: Leighton Chen Co-authored-by: alrex --- tox.ini | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/tox.ini b/tox.ini index cab2031aa..875f63fc3 100644 --- a/tox.ini +++ b/tox.ini @@ -17,8 +17,8 @@ envlist = pypy3-test-sdk ; opentelemetry-instrumentation - py3{5,6,7,8}-test-instrumentation - pypy3-test-instrumentation + py3{5,6,7,8}-test-instrumentation-base + pypy3-test-instrumentation-base ; opentelemetry-example-app py3{4,5,6,7,8}-test-example-app @@ -56,6 +56,11 @@ envlist = py3{4,5,6,7,8}-test-ext-requests pypy3-test-ext-requests + ; opentelemetry-instrumentation-starlette. + ; starlette only supports 3.6 and above. + py3{6,7,8}-test-instrumentation-starlette + pypy3-test-instrumentation-starlette + ; opentelemetry-ext-jinja2 py3{4,5,6,7,8}-test-ext-jinja2 pypy3-test-ext-jinja2 @@ -102,7 +107,7 @@ envlist = ; opentelemetry-ext-pyramid py3{4,5,6,7,8}-test-ext-pyramid pypy3-test-ext-pyramid - + ; opentelemetry-ext-asgi py3{5,6,7,8}-test-ext-asgi pypy3-test-ext-asgi @@ -172,8 +177,9 @@ setenv = changedir = test-api: opentelemetry-api/tests test-sdk: opentelemetry-sdk/tests + instrumentation-base: opentelemetry-instrumentation/tests + test-instrumentation-starlette: ext/opentelemetry-instrumentation-starlette/tests test-proto: opentelemetry-proto/tests - test-instrumentation: opentelemetry-instrumentation/tests test-ext-grpc: ext/opentelemetry-ext-grpc/tests test-ext-aiohttp-client: ext/opentelemetry-ext-aiohttp-client/tests test-ext-requests: ext/opentelemetry-ext-requests/tests @@ -223,10 +229,9 @@ commands_pre = grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test] - wsgi,flask,django,asgi,pyramid: pip install {toxinidir}/tests/util + wsgi,flask,django,asgi,pyramid,starlette: pip install {toxinidir}/tests/util wsgi,flask,django,pyramid: pip install {toxinidir}/ext/opentelemetry-ext-wsgi - - asgi: pip install {toxinidir}/ext/opentelemetry-ext-asgi + asgi,starlette: pip install {toxinidir}/ext/opentelemetry-ext-asgi boto: pip install {toxinidir}/ext/opentelemetry-ext-boto[test] @@ -264,6 +269,8 @@ commands_pre = requests: pip install {toxinidir}/ext/opentelemetry-ext-requests[test] + starlette: pip install {toxinidir}/ext/opentelemetry-instrumentation-starlette[test] + jinja2: pip install {toxinidir}/ext/opentelemetry-ext-jinja2[test] aiohttp-client: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-aiohttp-client @@ -274,7 +281,7 @@ commands_pre = opentracing-shim: pip install {toxinidir}/ext/opentelemetry-ext-opentracing-shim datadog: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-datadog - + zipkin: pip install {toxinidir}/ext/opentelemetry-ext-zipkin sqlalchemy: pip install {toxinidir}/ext/opentelemetry-ext-sqlalchemy @@ -322,7 +329,7 @@ deps = httpretty commands_pre = - python scripts/eachdist.py install --editable + python scripts/eachdist.py install --editable --with-test-deps commands = python scripts/eachdist.py lint --check-only From bf5006e1e2712a66d32289ea57ab0703bc1643a0 Mon Sep 17 00:00:00 2001 From: "Tahir H. Butt" Date: Tue, 16 Jun 2020 13:37:10 -0400 Subject: [PATCH 116/145] fix(tests): install asgi early (#831) The lint job raising an error at installation: ERROR: Could not find a version that satisfies the requirement opentelemetry-ext-asgi==0.10.dev0 (from opentelemetry-instrumentation-starlette==0.10.dev0) (from versions: 0.8b0, 0.9b0) ERROR: No matching distribution found for opentelemetry-ext-asgi==0.10.dev0 (from opentelemetry-instrumentation-starlette==0.10.dev0) The opentelemetry-ext-asgi should be installed before depending modules. --- eachdist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/eachdist.ini b/eachdist.ini index a2822d97b..c77d82f34 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -9,6 +9,7 @@ sortfirst= tests/util ext/opentelemetry-ext-wsgi ext/opentelemetry-ext-dbapi + ext/opentelemetry-ext-asgi ext/* [lintroots] From 4e1cb880c1f9e8196655c2e34a72021e509d5c85 Mon Sep 17 00:00:00 2001 From: Owais Lone Date: Wed, 17 Jun 2020 10:39:43 +0530 Subject: [PATCH 117/145] Initial elasticsearch instrumentation (#747) This commit adds auto-instrumentation for elasticsearch. The instrumentation has been mostly ported over from OpenTracing elasticsearch instrumentation. Co-authored-by: Yusuke Tsutsumi Co-authored-by: alrex --- tox.ini | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tox.ini b/tox.ini index 875f63fc3..c8327d6f2 100644 --- a/tox.ini +++ b/tox.ini @@ -48,6 +48,10 @@ envlist = py3{5,6,7,8}-test-ext-boto pypy3-test-ext-boto + ; opentelemetry-ext-elasticsearch + py3{4,5,6,7,8}-test-ext-elasticsearch{2,5,6,7} + pypy3-test-ext-elasticsearch{2,5,6,7} + ; opentelemetry-ext-flask py3{4,5,6,7,8}-test-ext-flask pypy3-test-ext-flask @@ -170,6 +174,14 @@ deps = coverage: pytest coverage: pytest-cov mypy,mypyinstalled: mypy + elasticsearch2: elasticsearch-dsl>=2.0,<3.0 + elasticsearch2: elasticsearch>=2.0,<3.0 + elasticsearch5: elasticsearch-dsl>=5.0,<6.0 + elasticsearch5: elasticsearch>=5.0,<6.0 + elasticsearch6: elasticsearch-dsl>=6.0,<7.0 + elasticsearch6: elasticsearch>=6.0,<7.0 + elasticsearch7: elasticsearch-dsl>=7.0,<8.0 + elasticsearch7: elasticsearch>=7.0,<8.0 setenv = mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/ @@ -187,6 +199,7 @@ changedir = test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests test-ext-datadog: ext/opentelemetry-ext-datadog/tests test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests + test-ext-elasticsearch{2,5,6,7}: ext/opentelemetry-ext-elasticsearch/tests test-ext-django: ext/opentelemetry-ext-django/tests test-ext-mysql: ext/opentelemetry-ext-mysql/tests test-ext-opencensusexporter: ext/opentelemetry-ext-opencensusexporter/tests @@ -290,6 +303,7 @@ commands_pre = exporter-cloud-monitoring: pip install {toxinidir}/ext/opentelemetry-exporter-cloud-monitoring exporter-cloud-trace: pip install {toxinidir}/ext/opentelemetry-exporter-cloud-trace + elasticsearch{2,5,6,7}: pip install {toxinidir}/opentelemetry-instrumentation {toxinidir}/ext/opentelemetry-ext-elasticsearch[test] ; In order to get a healthy coverage report, ; we have to install packages in editable mode. From 83d8accf66dab67f7aa18a9df3d8c3de85b3de8f Mon Sep 17 00:00:00 2001 From: "Tahir H. Butt" Date: Wed, 17 Jun 2020 01:13:23 -0400 Subject: [PATCH 118/145] Add instrumentation for Celery (#780) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ported from the DataDog instrumentation. Co-authored-by: Diego Hurtado Co-authored-by: Mauricio Vásquez Co-authored-by: alrex --- .pylintrc | 2 +- tox.ini | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 01c96ea39..5f9463df7 100644 --- a/.pylintrc +++ b/.pylintrc @@ -226,7 +226,7 @@ dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ # Argument names that match this expression will be ignored. Default to name # with leading underscore. -ignored-argument-names=_.*|^ignored_|^unused_ +ignored-argument-names=_.*|^ignored_|^unused_|^kwargs|^args # Tells whether we should check for unused import in __init__ files. init-import=no diff --git a/tox.ini b/tox.ini index c8327d6f2..771305f2c 100644 --- a/tox.ini +++ b/tox.ini @@ -147,6 +147,10 @@ envlist = py3{4,5,6,7,8}-test-ext-redis pypy3-test-ext-redis + ; opentelemetry-ext-celery + py3{5,6,7,8}-test-ext-celery + pypy3-test-ext-celery + ; opentelemetry-ext-system-metrics py3{4,5,6,7,8}-test-ext-system-metrics ; ext-system-metrics intentionally excluded from pypy3 @@ -224,6 +228,7 @@ changedir = test-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests test-ext-sqlalchemy: ext/opentelemetry-ext-sqlalchemy/tests test-ext-redis: ext/opentelemetry-ext-redis/tests + test-ext-celery: ext/opentelemetry-ext-celery/tests test-ext-system-metrics: ext/opentelemetry-ext-system-metrics/tests commands_pre = @@ -240,6 +245,8 @@ commands_pre = getting-started: pip install -e {toxinidir}/opentelemetry-instrumentation -e {toxinidir}/ext/opentelemetry-ext-requests -e {toxinidir}/ext/opentelemetry-ext-wsgi -e {toxinidir}/ext/opentelemetry-ext-flask + celery: pip install {toxinidir}/ext/opentelemetry-ext-celery[test] + grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test] wsgi,flask,django,asgi,pyramid,starlette: pip install {toxinidir}/tests/util @@ -388,6 +395,7 @@ deps = psycopg2-binary ~= 2.8.4 sqlalchemy ~= 1.3.16 redis ~= 3.3.11 + celery ~= 4.0, != 4.4.4 changedir = ext/opentelemetry-ext-docker-tests/tests @@ -397,6 +405,7 @@ commands_pre = -e {toxinidir}/opentelemetry-sdk \ -e {toxinidir}/opentelemetry-instrumentation \ -e {toxinidir}/tests/util \ + -e {toxinidir}/ext/opentelemetry-ext-celery \ -e {toxinidir}/ext/opentelemetry-ext-dbapi \ -e {toxinidir}/ext/opentelemetry-ext-mysql \ -e {toxinidir}/ext/opentelemetry-ext-psycopg2 \ From 6cc1e5a6a27fd20086870a025d95aa380a4fac71 Mon Sep 17 00:00:00 2001 From: HiveTraum Date: Thu, 18 Jun 2020 03:27:13 +0500 Subject: [PATCH 119/145] Instrumentation for asyncpg (#814) Co-authored-by: Yusuke Tsutsumi --- tox.ini | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tox.ini b/tox.ini index 771305f2c..e4ad8e170 100644 --- a/tox.ini +++ b/tox.ini @@ -116,6 +116,10 @@ envlist = py3{5,6,7,8}-test-ext-asgi pypy3-test-ext-asgi + ; opentelemetry-ext-asyncpg + py3{5,6,7,8}-test-ext-asyncpg + ; ext-asyncpg intentionally excluded from pypy3 + ; opentelemetry-ext-sqlite3 py3{4,5,6,7,8}-test-ext-sqlite3 pypy3-test-ext-sqlite3 @@ -217,6 +221,7 @@ changedir = test-ext-pymysql: ext/opentelemetry-ext-pymysql/tests test-ext-pyramid: ext/opentelemetry-ext-pyramid/tests test-ext-asgi: ext/opentelemetry-ext-asgi/tests + test-ext-asyncpg: ext/opentelemetry-ext-asyncpg/tests test-ext-sqlite3: ext/opentelemetry-ext-sqlite3/tests test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests test-ext-zipkin: ext/opentelemetry-ext-zipkin/tests @@ -253,6 +258,8 @@ commands_pre = wsgi,flask,django,pyramid: pip install {toxinidir}/ext/opentelemetry-ext-wsgi asgi,starlette: pip install {toxinidir}/ext/opentelemetry-ext-asgi + asyncpg: pip install {toxinidir}/ext/opentelemetry-ext-asyncpg + boto: pip install {toxinidir}/ext/opentelemetry-ext-boto[test] flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test] @@ -388,6 +395,7 @@ commands = [testenv:docker-tests] deps = pytest + asyncpg==0.20.1 docker-compose >= 1.25.2 mysql-connector-python ~= 8.0 pymongo ~= 3.1 @@ -405,6 +413,7 @@ commands_pre = -e {toxinidir}/opentelemetry-sdk \ -e {toxinidir}/opentelemetry-instrumentation \ -e {toxinidir}/tests/util \ + -e {toxinidir}/ext/opentelemetry-ext-asyncpg \ -e {toxinidir}/ext/opentelemetry-ext-celery \ -e {toxinidir}/ext/opentelemetry-ext-dbapi \ -e {toxinidir}/ext/opentelemetry-ext-mysql \ From 4438ae703ce13a03470f0ef55cf948f25d932016 Mon Sep 17 00:00:00 2001 From: Aaron Abbott Date: Mon, 22 Jun 2020 17:47:07 +0000 Subject: [PATCH 120/145] Script to regenerate proto code + pyi stubs (#823) --- .flake8 | 1 + 1 file changed, 1 insertion(+) diff --git a/.flake8 b/.flake8 index 39288e9b1..8555d626c 100644 --- a/.flake8 +++ b/.flake8 @@ -20,4 +20,5 @@ exclude = ext/opentelemetry-ext-jaeger/build/* docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/grpc/gen/ docs/examples/opentelemetry-example-app/build/* + opentelemetry-proto/build/* opentelemetry-proto/src/opentelemetry/proto/ From 5c59ea0831783209cec2fa8ab21ec5d0d8d2b720 Mon Sep 17 00:00:00 2001 From: alrex Date: Mon, 13 Jul 2020 16:03:34 -0700 Subject: [PATCH 121/145] chore: migrate to circleci (#828) --- tox.ini | 226 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 112 insertions(+), 114 deletions(-) diff --git a/tox.ini b/tox.ini index e4ad8e170..ed4122a3c 100644 --- a/tox.ini +++ b/tox.ini @@ -5,60 +5,60 @@ envlist = ; Environments are organized by individual package, allowing ; for specifying supported Python versions per package. ; opentelemetry-api - py3{4,5,6,7,8}-test-api - pypy3-test-api + py3{4,5,6,7,8}-test-core-api + pypy3-test-core-api ; opentelemetry-proto - py3{4,5,6,7,8}-test-proto - pypy3-test-proto + py3{4,5,6,7,8}-test-core-proto + pypy3-test-core-proto ; opentelemetry-sdk - py3{4,5,6,7,8}-test-sdk - pypy3-test-sdk + py3{4,5,6,7,8}-test-core-sdk + pypy3-test-core-sdk ; opentelemetry-instrumentation - py3{5,6,7,8}-test-instrumentation-base - pypy3-test-instrumentation-base - - ; opentelemetry-example-app - py3{4,5,6,7,8}-test-example-app - pypy3-test-example-app + py3{5,6,7,8}-test-core-instrumentation + pypy3-test-core-instrumentation ; docs/getting-started - py3{4,5,6,7,8}-test-getting-started - pypy3-test-getting-started + py3{4,5,6,7,8}-test-core-getting-started + pypy3-test-core-getting-started + + ; opentelemetry-example-app + py3{4,5,6,7,8}-test-instrumentation-example-app + pypy3-test-instrumentation-example-app ; opentelemetry-ext-aiohttp-client - py3{5,6,7,8}-test-ext-aiohttp-client - pypy3-test-ext-aiohttp-client + py3{5,6,7,8}-test-instrumentation-aiohttp-client + pypy3-test-instrumentation-aiohttp-client ; opentelemetry-ext-botocore - py3{6,7,8}-test-ext-botocore - pypy3-test-ext-botocore + py3{6,7,8}-test-instrumentation-botocore + pypy3-test-instrumentation-botocore ; opentelemetry-ext-django - py3{4,5,6,7,8}-test-ext-django - pypy3-test-ext-django + py3{4,5,6,7,8}-test-instrumentation-django + pypy3-test-instrumentation-django ; opentelemetry-ext-dbapi - py3{4,5,6,7,8}-test-ext-dbapi - pypy3-test-ext-dbapi + py3{4,5,6,7,8}-test-instrumentation-dbapi + pypy3-test-instrumentation-dbapi ; opentelemetry-ext-boto - py3{5,6,7,8}-test-ext-boto - pypy3-test-ext-boto + py3{5,6,7,8}-test-instrumentation-boto + pypy3-test-instrumentation-boto - ; opentelemetry-ext-elasticsearch - py3{4,5,6,7,8}-test-ext-elasticsearch{2,5,6,7} - pypy3-test-ext-elasticsearch{2,5,6,7} + ; opentelemetry-instrumentation-elasticsearch + py3{4,5,6,7,8}-test-instrumentation-elasticsearch{2,5,6,7} + pypy3-test-instrumentation-elasticsearch{2,5,6,7} ; opentelemetry-ext-flask - py3{4,5,6,7,8}-test-ext-flask - pypy3-test-ext-flask + py3{4,5,6,7,8}-test-instrumentation-flask + pypy3-test-instrumentation-flask ; opentelemetry-ext-requests - py3{4,5,6,7,8}-test-ext-requests - pypy3-test-ext-requests + py3{4,5,6,7,8}-test-instrumentation-requests + pypy3-test-instrumentation-requests ; opentelemetry-instrumentation-starlette. ; starlette only supports 3.6 and above. @@ -66,97 +66,93 @@ envlist = pypy3-test-instrumentation-starlette ; opentelemetry-ext-jinja2 - py3{4,5,6,7,8}-test-ext-jinja2 - pypy3-test-ext-jinja2 + py3{4,5,6,7,8}-test-instrumentation-jinja2 + pypy3-test-instrumentation-jinja2 ; opentelemetry-ext-jaeger - py3{4,5,6,7,8}-test-ext-jaeger - pypy3-test-ext-jaeger + py3{4,5,6,7,8}-test-exporter-jaeger + pypy3-test-exporter-jaeger ; opentelemetry-ext-datadog - py3{5,6,7,8}-test-ext-datadog + py3{5,6,7,8}-test-exporter-datadog ; opentelemetry-ext-mysql - py3{4,5,6,7,8}-test-ext-mysql - pypy3-test-ext-mysql + py3{4,5,6,7,8}-test-instrumentation-mysql + pypy3-test-instrumentation-mysql ; opentelemetry-ext-opencensusexporter - py3{4,5,6,7,8}-test-ext-opencensusexporter + py3{4,5,6,7,8}-test-exporter-opencensusexporter ; ext-opencensusexporter intentionally excluded from pypy3 ; opentelemetry-ext-otlp - py3{5,6,7,8}-test-ext-otlp + py3{5,6,7,8}-test-exporter-otlp ; ext-otlp intentionally excluded from pypy3 ; opentelemetry-ext-prometheus - py3{4,5,6,7,8}-test-ext-prometheus - pypy3-test-ext-prometheus + py3{4,5,6,7,8}-test-exporter-prometheus + pypy3-test-exporter-prometheus ; opentelemetry-ext-psycopg2 - py3{4,5,6,7,8}-test-ext-psycopg2 + py3{4,5,6,7,8}-test-instrumentation-psycopg2 ; ext-psycopg2 intentionally excluded from pypy3 ; opentelemetry-ext-pymemcache - py3{4,5,6,7,8}-test-ext-pymemcache - pypy3-test-ext-pymemcache + py3{4,5,6,7,8}-test-instrumentation-pymemcache + pypy3-test-instrumentation-pymemcache ; opentelemetry-ext-pymongo - py3{4,5,6,7,8}-test-ext-pymongo - pypy3-test-ext-pymongo + py3{4,5,6,7,8}-test-instrumentation-pymongo + pypy3-test-instrumentation-pymongo ; opentelemetry-ext-pymysql - py3{4,5,6,7,8}-test-ext-pymysql - pypy3-test-ext-pymysql + py3{4,5,6,7,8}-test-instrumentation-pymysql + pypy3-test-instrumentation-pymysql ; opentelemetry-ext-pyramid - py3{4,5,6,7,8}-test-ext-pyramid - pypy3-test-ext-pyramid - + py3{4,5,6,7,8}-test-instrumentation-pyramid + pypy3-test-instrumentation-pyramid + ; opentelemetry-ext-asgi - py3{5,6,7,8}-test-ext-asgi - pypy3-test-ext-asgi + py3{5,6,7,8}-test-instrumentation-asgi + pypy3-test-instrumentation-asgi ; opentelemetry-ext-asyncpg - py3{5,6,7,8}-test-ext-asyncpg + py3{5,6,7,8}-test-instrumentation-asyncpg ; ext-asyncpg intentionally excluded from pypy3 ; opentelemetry-ext-sqlite3 - py3{4,5,6,7,8}-test-ext-sqlite3 - pypy3-test-ext-sqlite3 + py3{4,5,6,7,8}-test-instrumentation-sqlite3 + pypy3-test-instrumentation-sqlite3 ; opentelemetry-ext-wsgi - py3{4,5,6,7,8}-test-ext-wsgi - pypy3-test-ext-wsgi + py3{4,5,6,7,8}-test-instrumentation-wsgi + pypy3-test-instrumentation-wsgi ; opentelemetry-ext-zipkin - py3{4,5,6,7,8}-test-ext-zipkin - pypy3-test-ext-zipkin + py3{4,5,6,7,8}-test-exporter-zipkin + pypy3-test-exporter-zipkin ; opentelemetry-opentracing-shim - py3{4,5,6,7,8}-test-opentracing-shim - pypy3-test-opentracing-shim - - ; opentelemetry-opentracing-shim - py3{4,5,6,7,8}-test-opentracing-shim - pypy3-test-opentracing-shim + py3{4,5,6,7,8}-test-core-opentracing-shim + pypy3-test-core-opentracing-shim ; opentelemetry-ext-grpc - py3{4,5,6,7,8}-test-ext-grpc + py3{4,5,6,7,8}-test-instrumentation-grpc ; opentelemetry-ext-sqlalchemy - py3{4,5,6,7,8}-test-ext-sqlalchemy - pypy3-test-ext-sqlalchemy + py3{4,5,6,7,8}-test-instrumentation-sqlalchemy + pypy3-test-instrumentation-sqlalchemy ; opentelemetry-ext-redis - py3{4,5,6,7,8}-test-ext-redis - pypy3-test-ext-redis + py3{4,5,6,7,8}-test-instrumentation-redis + pypy3-test-instrumentation-redis ; opentelemetry-ext-celery - py3{5,6,7,8}-test-ext-celery - pypy3-test-ext-celery + py3{5,6,7,8}-test-instrumentation-celery + pypy3-test-instrumentation-celery ; opentelemetry-ext-system-metrics - py3{4,5,6,7,8}-test-ext-system-metrics + py3{4,5,6,7,8}-test-instrumentation-system-metrics ; ext-system-metrics intentionally excluded from pypy3 ; known limitation: gc.get_count won't work under pypy @@ -195,46 +191,48 @@ setenv = mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/ changedir = - test-api: opentelemetry-api/tests - test-sdk: opentelemetry-sdk/tests - instrumentation-base: opentelemetry-instrumentation/tests + test-core-api: opentelemetry-api/tests + test-core-sdk: opentelemetry-sdk/tests + test-core-proto: opentelemetry-proto/tests + test-core-instrumentation: opentelemetry-instrumentation/tests + test-core-getting-started: docs/getting_started/tests + test-core-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests + + test-instrumentation-grpc: ext/opentelemetry-ext-grpc/tests + test-instrumentation-aiohttp-client: ext/opentelemetry-ext-aiohttp-client/tests + test-instrumentation-requests: ext/opentelemetry-ext-requests/tests + test-instrumentation-jinja2: ext/opentelemetry-ext-jinja2/tests + test-instrumentation-dbapi: ext/opentelemetry-ext-dbapi/tests + test-instrumentation-django: ext/opentelemetry-ext-django/tests + test-instrumentation-mysql: ext/opentelemetry-ext-mysql/tests + test-instrumentation-pymemcache: ext/opentelemetry-ext-pymemcache/tests + test-instrumentation-pymongo: ext/opentelemetry-ext-pymongo/tests + test-instrumentation-psycopg2: ext/opentelemetry-ext-psycopg2/tests + test-instrumentation-pymysql: ext/opentelemetry-ext-pymysql/tests + test-instrumentation-pyramid: ext/opentelemetry-ext-pyramid/tests + test-instrumentation-asgi: ext/opentelemetry-ext-asgi/tests + test-instrumentation-sqlite3: ext/opentelemetry-ext-sqlite3/tests + test-instrumentation-wsgi: ext/opentelemetry-ext-wsgi/tests + test-instrumentation-boto: ext/opentelemetry-ext-boto/tests + test-instrumentation-botocore: ext/opentelemetry-ext-botocore/tests + test-instrumentation-flask: ext/opentelemetry-ext-flask/tests + test-instrumentation-example-app: docs/examples/opentelemetry-example-app/tests + test-instrumentation-sqlalchemy: ext/opentelemetry-ext-sqlalchemy/tests + test-instrumentation-redis: ext/opentelemetry-ext-redis/tests test-instrumentation-starlette: ext/opentelemetry-instrumentation-starlette/tests - test-proto: opentelemetry-proto/tests - test-ext-grpc: ext/opentelemetry-ext-grpc/tests - test-ext-aiohttp-client: ext/opentelemetry-ext-aiohttp-client/tests - test-ext-requests: ext/opentelemetry-ext-requests/tests - test-ext-jinja2: ext/opentelemetry-ext-jinja2/tests - test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests - test-ext-datadog: ext/opentelemetry-ext-datadog/tests - test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests - test-ext-elasticsearch{2,5,6,7}: ext/opentelemetry-ext-elasticsearch/tests - test-ext-django: ext/opentelemetry-ext-django/tests - test-ext-mysql: ext/opentelemetry-ext-mysql/tests - test-ext-opencensusexporter: ext/opentelemetry-ext-opencensusexporter/tests - test-ext-otlp: ext/opentelemetry-ext-otlp/tests - test-ext-prometheus: ext/opentelemetry-ext-prometheus/tests - test-ext-pymemcache: ext/opentelemetry-ext-pymemcache/tests - test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests + test-instrumentation-system-metrics: ext/opentelemetry-ext-system-metrics/tests + test-instrumentation-celery: ext/opentelemetry-ext-celery/tests + test-instrumentation-elasticsearch{2,5,6,7}: ext/opentelemetry-ext-elasticsearch/tests + test-instrumentation-asyncpg: ext/opentelemetry-ext-asyncpg/tests + + test-exporter-jaeger: ext/opentelemetry-ext-jaeger/tests + test-exporter-datadog: ext/opentelemetry-ext-datadog/tests + test-exporter-opencensusexporter: ext/opentelemetry-ext-opencensusexporter/tests + test-exporter-otlp: ext/opentelemetry-ext-otlp/tests + test-exporter-prometheus: ext/opentelemetry-ext-prometheus/tests test-exporter-cloud-trace: ext/opentelemetry-exporter-cloud-trace/tests test-exporter-cloud-monitoring: ext/opentelemetry-exporter-cloud-monitoring/tests - test-ext-psycopg2: ext/opentelemetry-ext-psycopg2/tests - test-ext-pymysql: ext/opentelemetry-ext-pymysql/tests - test-ext-pyramid: ext/opentelemetry-ext-pyramid/tests - test-ext-asgi: ext/opentelemetry-ext-asgi/tests - test-ext-asyncpg: ext/opentelemetry-ext-asyncpg/tests - test-ext-sqlite3: ext/opentelemetry-ext-sqlite3/tests - test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests - test-ext-zipkin: ext/opentelemetry-ext-zipkin/tests - test-ext-boto: ext/opentelemetry-ext-boto/tests - test-ext-botocore: ext/opentelemetry-ext-botocore/tests - test-ext-flask: ext/opentelemetry-ext-flask/tests - test-example-app: docs/examples/opentelemetry-example-app/tests - test-getting-started: docs/getting_started/tests - test-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests - test-ext-sqlalchemy: ext/opentelemetry-ext-sqlalchemy/tests - test-ext-redis: ext/opentelemetry-ext-redis/tests - test-ext-celery: ext/opentelemetry-ext-celery/tests - test-ext-system-metrics: ext/opentelemetry-ext-system-metrics/tests + test-exporter-zipkin: ext/opentelemetry-ext-zipkin/tests commands_pre = ; Install without -e to test the actual installation @@ -243,7 +241,7 @@ commands_pre = ; cases but it saves a lot of boilerplate in this file. test: pip install {toxinidir}/opentelemetry-api {toxinidir}/opentelemetry-sdk {toxinidir}/tests/util - test-proto: pip install {toxinidir}/opentelemetry-proto + test-core-proto: pip install {toxinidir}/opentelemetry-proto ext,instrumentation: pip install {toxinidir}/opentelemetry-instrumentation example-app: pip install {toxinidir}/opentelemetry-instrumentation {toxinidir}/ext/opentelemetry-ext-requests {toxinidir}/ext/opentelemetry-ext-wsgi {toxinidir}/ext/opentelemetry-ext-flask {toxinidir}/docs/examples/opentelemetry-example-app @@ -339,7 +337,7 @@ commands = ; implicit Any due to unfollowed import would result). mypyinstalled: mypy --namespace-packages opentelemetry-api/tests/mypysmoke.py --strict -[testenv:py34-test-opentracing-shim] +[testenv:py34-test-core-opentracing-shim] commands = pytest --ignore-glob='*[asyncio].py' From 757f88f0af799e814b8f8ec9cf992807c4f81afa Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Wed, 15 Jul 2020 06:49:12 +0000 Subject: [PATCH 122/145] fastapi instrumentation (#890) Co-authored-by: Leighton Chen --- tox.ini | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index ed4122a3c..4b9ed9047 100644 --- a/tox.ini +++ b/tox.ini @@ -52,6 +52,11 @@ envlist = py3{4,5,6,7,8}-test-instrumentation-elasticsearch{2,5,6,7} pypy3-test-instrumentation-elasticsearch{2,5,6,7} + ; opentelemetry-instrumentation-fastapi + ; fastapi only supports 3.6 and above. + py3{6,7,8}-test-instrumentation-fastapi + pypy3-test-instrumentation-fastapi + ; opentelemetry-ext-flask py3{4,5,6,7,8}-test-instrumentation-flask pypy3-test-instrumentation-flask @@ -187,8 +192,7 @@ deps = elasticsearch7: elasticsearch-dsl>=7.0,<8.0 elasticsearch7: elasticsearch>=7.0,<8.0 -setenv = - mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/ +setenv = mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/ changedir = test-core-api: opentelemetry-api/tests @@ -215,6 +219,7 @@ changedir = test-instrumentation-wsgi: ext/opentelemetry-ext-wsgi/tests test-instrumentation-boto: ext/opentelemetry-ext-boto/tests test-instrumentation-botocore: ext/opentelemetry-ext-botocore/tests + test-instrumentation-fastapi: ext/opentelemetry-instrumentation-fastapi/tests test-instrumentation-flask: ext/opentelemetry-ext-flask/tests test-instrumentation-example-app: docs/examples/opentelemetry-example-app/tests test-instrumentation-sqlalchemy: ext/opentelemetry-ext-sqlalchemy/tests @@ -236,7 +241,7 @@ changedir = commands_pre = ; Install without -e to test the actual installation - py3{4,5,6,7}: python -m pip install -U pip setuptools wheel + py3{4,5,6,7,8}: python -m pip install -U pip setuptools wheel ; Install common packages for all the tests. These are not needed in all the ; cases but it saves a lot of boilerplate in this file. test: pip install {toxinidir}/opentelemetry-api {toxinidir}/opentelemetry-sdk {toxinidir}/tests/util @@ -252,9 +257,8 @@ commands_pre = grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test] - wsgi,flask,django,asgi,pyramid,starlette: pip install {toxinidir}/tests/util wsgi,flask,django,pyramid: pip install {toxinidir}/ext/opentelemetry-ext-wsgi - asgi,starlette: pip install {toxinidir}/ext/opentelemetry-ext-asgi + asgi,starlette,fastapi: pip install {toxinidir}/ext/opentelemetry-ext-asgi asyncpg: pip install {toxinidir}/ext/opentelemetry-ext-asyncpg @@ -269,6 +273,8 @@ commands_pre = django: pip install {toxinidir}/ext/opentelemetry-ext-django[test] + fastapi: pip install {toxinidir}/ext/opentelemetry-instrumentation-fastapi[test] + mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-mysql[test] opencensusexporter: pip install {toxinidir}/ext/opentelemetry-ext-opencensusexporter From 7d80d468e2cfb5db4042669a23fb41a842dfcf3c Mon Sep 17 00:00:00 2001 From: alrex Date: Wed, 15 Jul 2020 10:18:33 -0700 Subject: [PATCH 123/145] chore: update bootstrap with new instrumentations (#913) --- tox.ini | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tox.ini b/tox.ini index 4b9ed9047..ea3a5c291 100644 --- a/tox.ini +++ b/tox.ini @@ -202,33 +202,33 @@ changedir = test-core-getting-started: docs/getting_started/tests test-core-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests - test-instrumentation-grpc: ext/opentelemetry-ext-grpc/tests test-instrumentation-aiohttp-client: ext/opentelemetry-ext-aiohttp-client/tests - test-instrumentation-requests: ext/opentelemetry-ext-requests/tests - test-instrumentation-jinja2: ext/opentelemetry-ext-jinja2/tests - test-instrumentation-dbapi: ext/opentelemetry-ext-dbapi/tests - test-instrumentation-django: ext/opentelemetry-ext-django/tests - test-instrumentation-mysql: ext/opentelemetry-ext-mysql/tests - test-instrumentation-pymemcache: ext/opentelemetry-ext-pymemcache/tests - test-instrumentation-pymongo: ext/opentelemetry-ext-pymongo/tests - test-instrumentation-psycopg2: ext/opentelemetry-ext-psycopg2/tests - test-instrumentation-pymysql: ext/opentelemetry-ext-pymysql/tests - test-instrumentation-pyramid: ext/opentelemetry-ext-pyramid/tests test-instrumentation-asgi: ext/opentelemetry-ext-asgi/tests - test-instrumentation-sqlite3: ext/opentelemetry-ext-sqlite3/tests - test-instrumentation-wsgi: ext/opentelemetry-ext-wsgi/tests + test-instrumentation-asyncpg: ext/opentelemetry-ext-asyncpg/tests test-instrumentation-boto: ext/opentelemetry-ext-boto/tests test-instrumentation-botocore: ext/opentelemetry-ext-botocore/tests + test-instrumentation-celery: ext/opentelemetry-ext-celery/tests + test-instrumentation-dbapi: ext/opentelemetry-ext-dbapi/tests + test-instrumentation-django: ext/opentelemetry-ext-django/tests + test-instrumentation-example-app: docs/examples/opentelemetry-example-app/tests + test-instrumentation-elasticsearch{2,5,6,7}: ext/opentelemetry-ext-elasticsearch/tests test-instrumentation-fastapi: ext/opentelemetry-instrumentation-fastapi/tests test-instrumentation-flask: ext/opentelemetry-ext-flask/tests - test-instrumentation-example-app: docs/examples/opentelemetry-example-app/tests - test-instrumentation-sqlalchemy: ext/opentelemetry-ext-sqlalchemy/tests + test-instrumentation-grpc: ext/opentelemetry-ext-grpc/tests + test-instrumentation-jinja2: ext/opentelemetry-ext-jinja2/tests + test-instrumentation-mysql: ext/opentelemetry-ext-mysql/tests + test-instrumentation-psycopg2: ext/opentelemetry-ext-psycopg2/tests + test-instrumentation-pymemcache: ext/opentelemetry-ext-pymemcache/tests + test-instrumentation-pymongo: ext/opentelemetry-ext-pymongo/tests + test-instrumentation-pymysql: ext/opentelemetry-ext-pymysql/tests + test-instrumentation-pyramid: ext/opentelemetry-ext-pyramid/tests test-instrumentation-redis: ext/opentelemetry-ext-redis/tests + test-instrumentation-requests: ext/opentelemetry-ext-requests/tests + test-instrumentation-sqlalchemy: ext/opentelemetry-ext-sqlalchemy/tests + test-instrumentation-sqlite3: ext/opentelemetry-ext-sqlite3/tests test-instrumentation-starlette: ext/opentelemetry-instrumentation-starlette/tests test-instrumentation-system-metrics: ext/opentelemetry-ext-system-metrics/tests - test-instrumentation-celery: ext/opentelemetry-ext-celery/tests - test-instrumentation-elasticsearch{2,5,6,7}: ext/opentelemetry-ext-elasticsearch/tests - test-instrumentation-asyncpg: ext/opentelemetry-ext-asyncpg/tests + test-instrumentation-wsgi: ext/opentelemetry-ext-wsgi/tests test-exporter-jaeger: ext/opentelemetry-ext-jaeger/tests test-exporter-datadog: ext/opentelemetry-ext-datadog/tests From 8a5df4997c3f9585c0a9b7c4b64b50543c0d92f6 Mon Sep 17 00:00:00 2001 From: Connor Adams Date: Thu, 16 Jul 2020 11:43:04 -0400 Subject: [PATCH 124/145] instrumentation/grpc: Testing for gRPC Client Interceptor (#896) --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index ea3a5c291..2c87f6924 100644 --- a/tox.ini +++ b/tox.ini @@ -142,7 +142,7 @@ envlist = pypy3-test-core-opentracing-shim ; opentelemetry-ext-grpc - py3{4,5,6,7,8}-test-instrumentation-grpc + py3{5,6,7,8}-test-instrumentation-grpc ; opentelemetry-ext-sqlalchemy py3{4,5,6,7,8}-test-instrumentation-sqlalchemy From 77455cebcd60a2598be760ede51f99115b397cdb Mon Sep 17 00:00:00 2001 From: Andrew Xue Date: Thu, 16 Jul 2020 16:12:44 -0400 Subject: [PATCH 125/145] remove google exporter files (#918) --- tox.ini | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/tox.ini b/tox.ini index 2c87f6924..ad7b8ad3e 100644 --- a/tox.ini +++ b/tox.ini @@ -161,15 +161,6 @@ envlist = ; ext-system-metrics intentionally excluded from pypy3 ; known limitation: gc.get_count won't work under pypy - ; Coverage is temporarily disabled for pypy3 due to the pytest bug. - ; pypy3-coverage - - ; opentelemetry-exporter-cloud-monitoring - py3{4,5,6,7,8}-test-exporter-cloud-monitoring - - ; opentelemetry-exporter-cloud-trace - py3{4,5,6,7,8}-test-exporter-cloud-trace - lint py38-tracecontext py38-{mypy,mypyinstalled} @@ -235,8 +226,6 @@ changedir = test-exporter-opencensusexporter: ext/opentelemetry-ext-opencensusexporter/tests test-exporter-otlp: ext/opentelemetry-ext-otlp/tests test-exporter-prometheus: ext/opentelemetry-ext-prometheus/tests - test-exporter-cloud-trace: ext/opentelemetry-exporter-cloud-trace/tests - test-exporter-cloud-monitoring: ext/opentelemetry-exporter-cloud-monitoring/tests test-exporter-zipkin: ext/opentelemetry-ext-zipkin/tests commands_pre = @@ -319,8 +308,6 @@ commands_pre = system-metrics: pip install {toxinidir}/ext/opentelemetry-ext-system-metrics[test] - exporter-cloud-monitoring: pip install {toxinidir}/ext/opentelemetry-exporter-cloud-monitoring - exporter-cloud-trace: pip install {toxinidir}/ext/opentelemetry-exporter-cloud-trace elasticsearch{2,5,6,7}: pip install {toxinidir}/opentelemetry-instrumentation {toxinidir}/ext/opentelemetry-ext-elasticsearch[test] ; In order to get a healthy coverage report, From ae9172599c8bc89a72a3b03f9103832f4958ea7c Mon Sep 17 00:00:00 2001 From: sartx Date: Fri, 24 Jul 2020 20:35:38 +0500 Subject: [PATCH 126/145] ext/aiopg: Add instrumentation for aiopg (#801) Co-authored-by: Leighton Chen Co-authored-by: Alex Boten --- tox.ini | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index ad7b8ad3e..f956733d5 100644 --- a/tox.ini +++ b/tox.ini @@ -32,6 +32,10 @@ envlist = py3{5,6,7,8}-test-instrumentation-aiohttp-client pypy3-test-instrumentation-aiohttp-client + ; opentelemetry-instrumentation-aiopg + py3{5,6,7,8}-test-instrumentation-aiopg + ; instrumentation-aiopg intentionally excluded from pypy3 + ; opentelemetry-ext-botocore py3{6,7,8}-test-instrumentation-botocore pypy3-test-instrumentation-botocore @@ -116,7 +120,7 @@ envlist = ; opentelemetry-ext-pyramid py3{4,5,6,7,8}-test-instrumentation-pyramid pypy3-test-instrumentation-pyramid - + ; opentelemetry-ext-asgi py3{5,6,7,8}-test-instrumentation-asgi pypy3-test-instrumentation-asgi @@ -194,6 +198,7 @@ changedir = test-core-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests test-instrumentation-aiohttp-client: ext/opentelemetry-ext-aiohttp-client/tests + test-instrumentation-aiopg: ext/opentelemetry-instrumentation-aiopg/tests test-instrumentation-asgi: ext/opentelemetry-ext-asgi/tests test-instrumentation-asyncpg: ext/opentelemetry-ext-asyncpg/tests test-instrumentation-boto: ext/opentelemetry-ext-boto/tests @@ -295,6 +300,8 @@ commands_pre = aiohttp-client: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-aiohttp-client + aiopg: pip install {toxinidir}/ext/opentelemetry-ext-dbapi pip install {toxinidir}/ext/opentelemetry-instrumentation-aiopg[test] + jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger opentracing-shim: pip install {toxinidir}/opentelemetry-sdk @@ -392,6 +399,7 @@ deps = pymongo ~= 3.1 pymysql ~= 0.9.3 psycopg2-binary ~= 2.8.4 + aiopg >= 0.13.0 sqlalchemy ~= 1.3.16 redis ~= 3.3.11 celery ~= 4.0, != 4.4.4 @@ -412,6 +420,7 @@ commands_pre = -e {toxinidir}/ext/opentelemetry-ext-pymongo \ -e {toxinidir}/ext/opentelemetry-ext-pymysql \ -e {toxinidir}/ext/opentelemetry-ext-sqlalchemy \ + -e {toxinidir}/ext/opentelemetry-instrumentation-aiopg \ -e {toxinidir}/ext/opentelemetry-ext-redis \ -e {toxinidir}/ext/opentelemetry-ext-system-metrics \ -e {toxinidir}/ext/opentelemetry-ext-opencensusexporter From cf1d993468b68ab861765320adbaa02114dcf5e1 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 28 Jul 2020 16:04:31 -0600 Subject: [PATCH 127/145] Move duplicated code to a dependency (#942) --- eachdist.ini | 1 + tox.ini | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/eachdist.ini b/eachdist.ini index c77d82f34..4a197ad29 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -10,6 +10,7 @@ sortfirst= ext/opentelemetry-ext-wsgi ext/opentelemetry-ext-dbapi ext/opentelemetry-ext-asgi + ext/opentelemetry-ext-botocore ext/* [lintroots] diff --git a/tox.ini b/tox.ini index f956733d5..07a0bf42b 100644 --- a/tox.ini +++ b/tox.ini @@ -256,11 +256,11 @@ commands_pre = asyncpg: pip install {toxinidir}/ext/opentelemetry-ext-asyncpg + boto: pip install {toxinidir}/ext/opentelemetry-ext-botocore[test] boto: pip install {toxinidir}/ext/opentelemetry-ext-boto[test] flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test] - botocore: pip install {toxinidir}/opentelemetry-instrumentation botocore: pip install {toxinidir}/ext/opentelemetry-ext-botocore[test] dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi[test] From 83f5bf2a4979eefd4ae8205586d95441a8cec8e8 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Wed, 29 Jul 2020 10:03:46 -0700 Subject: [PATCH 128/145] Rename exporter packages from "ext" to "exporter" (#953) --- .flake8 | 4 ++-- eachdist.ini | 1 + tox.ini | 44 ++++++++++++++++++++++---------------------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.flake8 b/.flake8 index 8555d626c..2780677a6 100644 --- a/.flake8 +++ b/.flake8 @@ -16,8 +16,8 @@ exclude = venv*/ target __pycache__ - ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen/ - ext/opentelemetry-ext-jaeger/build/* + exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/ + exporter/opentelemetry-exporter-jaeger/build/* docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/grpc/gen/ docs/examples/opentelemetry-example-app/build/* opentelemetry-proto/build/* diff --git a/eachdist.ini b/eachdist.ini index 4a197ad29..82fc0271e 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -7,6 +7,7 @@ sortfirst= opentelemetry-instrumentation opentelemetry-proto tests/util + exporter/* ext/opentelemetry-ext-wsgi ext/opentelemetry-ext-dbapi ext/opentelemetry-ext-asgi diff --git a/tox.ini b/tox.ini index 07a0bf42b..a018ec7a8 100644 --- a/tox.ini +++ b/tox.ini @@ -78,26 +78,26 @@ envlist = py3{4,5,6,7,8}-test-instrumentation-jinja2 pypy3-test-instrumentation-jinja2 - ; opentelemetry-ext-jaeger + ; opentelemetry-exporter-jaeger py3{4,5,6,7,8}-test-exporter-jaeger pypy3-test-exporter-jaeger - ; opentelemetry-ext-datadog + ; opentelemetry-exporter-datadog py3{5,6,7,8}-test-exporter-datadog ; opentelemetry-ext-mysql py3{4,5,6,7,8}-test-instrumentation-mysql pypy3-test-instrumentation-mysql - ; opentelemetry-ext-opencensusexporter - py3{4,5,6,7,8}-test-exporter-opencensusexporter - ; ext-opencensusexporter intentionally excluded from pypy3 + ; opentelemetry-exporter-opencensus + py3{4,5,6,7,8}-test-exporter-opencensus + ; exporter-opencensus intentionally excluded from pypy3 - ; opentelemetry-ext-otlp + ; opentelemetry-exporter-otlp py3{5,6,7,8}-test-exporter-otlp - ; ext-otlp intentionally excluded from pypy3 + ; exporter-otlp intentionally excluded from pypy3 - ; opentelemetry-ext-prometheus + ; opentelemetry-exporter-prometheus py3{4,5,6,7,8}-test-exporter-prometheus pypy3-test-exporter-prometheus @@ -137,7 +137,7 @@ envlist = py3{4,5,6,7,8}-test-instrumentation-wsgi pypy3-test-instrumentation-wsgi - ; opentelemetry-ext-zipkin + ; opentelemetry-exporter-zipkin py3{4,5,6,7,8}-test-exporter-zipkin pypy3-test-exporter-zipkin @@ -226,12 +226,12 @@ changedir = test-instrumentation-system-metrics: ext/opentelemetry-ext-system-metrics/tests test-instrumentation-wsgi: ext/opentelemetry-ext-wsgi/tests - test-exporter-jaeger: ext/opentelemetry-ext-jaeger/tests - test-exporter-datadog: ext/opentelemetry-ext-datadog/tests - test-exporter-opencensusexporter: ext/opentelemetry-ext-opencensusexporter/tests - test-exporter-otlp: ext/opentelemetry-ext-otlp/tests - test-exporter-prometheus: ext/opentelemetry-ext-prometheus/tests - test-exporter-zipkin: ext/opentelemetry-ext-zipkin/tests + test-exporter-jaeger: exporter/opentelemetry-exporter-jaeger/tests + test-exporter-datadog: exporter/opentelemetry-exporter-datadog/tests + test-exporter-opencensus: exporter/opentelemetry-exporter-opencensus/tests + test-exporter-otlp: exporter/opentelemetry-exporter-otlp/tests + test-exporter-prometheus: exporter/opentelemetry-exporter-prometheus/tests + test-exporter-zipkin: exporter/opentelemetry-exporter-zipkin/tests commands_pre = ; Install without -e to test the actual installation @@ -271,12 +271,12 @@ commands_pre = mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-mysql[test] - opencensusexporter: pip install {toxinidir}/ext/opentelemetry-ext-opencensusexporter + opencensus: pip install {toxinidir}/exporter/opentelemetry-exporter-opencensus otlp: pip install {toxinidir}/opentelemetry-proto - otlp: pip install {toxinidir}/ext/opentelemetry-ext-otlp + otlp: pip install {toxinidir}/exporter/opentelemetry-exporter-otlp - prometheus: pip install {toxinidir}/ext/opentelemetry-ext-prometheus + prometheus: pip install {toxinidir}/exporter/opentelemetry-exporter-prometheus pymemcache: pip install {toxinidir}/ext/opentelemetry-ext-pymemcache[test] @@ -302,14 +302,14 @@ commands_pre = aiopg: pip install {toxinidir}/ext/opentelemetry-ext-dbapi pip install {toxinidir}/ext/opentelemetry-instrumentation-aiopg[test] - jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger + jaeger: pip install {toxinidir}/exporter/opentelemetry-exporter-jaeger opentracing-shim: pip install {toxinidir}/opentelemetry-sdk opentracing-shim: pip install {toxinidir}/ext/opentelemetry-ext-opentracing-shim - datadog: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-datadog + datadog: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/exporter/opentelemetry-exporter-datadog - zipkin: pip install {toxinidir}/ext/opentelemetry-ext-zipkin + zipkin: pip install {toxinidir}/exporter/opentelemetry-exporter-zipkin sqlalchemy: pip install {toxinidir}/ext/opentelemetry-ext-sqlalchemy @@ -423,7 +423,7 @@ commands_pre = -e {toxinidir}/ext/opentelemetry-instrumentation-aiopg \ -e {toxinidir}/ext/opentelemetry-ext-redis \ -e {toxinidir}/ext/opentelemetry-ext-system-metrics \ - -e {toxinidir}/ext/opentelemetry-ext-opencensusexporter + -e {toxinidir}/exporter/opentelemetry-exporter-opencensus docker-compose up -d python check_availability.py commands = From 53de79b0aae841aa0e0da7ac105297c9bbf22777 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Mon, 3 Aug 2020 10:10:45 -0700 Subject: [PATCH 129/145] Rename web framework packages from "ext" to "instrumentation" (#961) --- eachdist.ini | 7 +++--- tox.ini | 66 ++++++++++++++++++++++++++-------------------------- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/eachdist.ini b/eachdist.ini index 82fc0271e..06d940378 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -7,11 +7,12 @@ sortfirst= opentelemetry-instrumentation opentelemetry-proto tests/util - exporter/* - ext/opentelemetry-ext-wsgi + instrumentation/opentelemetry-instrumentation-wsgi ext/opentelemetry-ext-dbapi - ext/opentelemetry-ext-asgi + instrumentation/opentelemetry-instrumentation-asgi ext/opentelemetry-ext-botocore + instrumentation/* + exporter/* ext/* [lintroots] diff --git a/tox.ini b/tox.ini index a018ec7a8..6dab08f70 100644 --- a/tox.ini +++ b/tox.ini @@ -28,7 +28,7 @@ envlist = py3{4,5,6,7,8}-test-instrumentation-example-app pypy3-test-instrumentation-example-app - ; opentelemetry-ext-aiohttp-client + ; opentelemetry-instrumentation-aiohttp-client py3{5,6,7,8}-test-instrumentation-aiohttp-client pypy3-test-instrumentation-aiohttp-client @@ -40,7 +40,7 @@ envlist = py3{6,7,8}-test-instrumentation-botocore pypy3-test-instrumentation-botocore - ; opentelemetry-ext-django + ; opentelemetry-instrumentation-django py3{4,5,6,7,8}-test-instrumentation-django pypy3-test-instrumentation-django @@ -61,11 +61,11 @@ envlist = py3{6,7,8}-test-instrumentation-fastapi pypy3-test-instrumentation-fastapi - ; opentelemetry-ext-flask + ; opentelemetry-instrumentation-flask py3{4,5,6,7,8}-test-instrumentation-flask pypy3-test-instrumentation-flask - ; opentelemetry-ext-requests + ; opentelemetry-instrumentation-requests py3{4,5,6,7,8}-test-instrumentation-requests pypy3-test-instrumentation-requests @@ -117,11 +117,11 @@ envlist = py3{4,5,6,7,8}-test-instrumentation-pymysql pypy3-test-instrumentation-pymysql - ; opentelemetry-ext-pyramid + ; opentelemetry-instrumentation-pyramid py3{4,5,6,7,8}-test-instrumentation-pyramid pypy3-test-instrumentation-pyramid - ; opentelemetry-ext-asgi + ; opentelemetry-instrumentation-asgi py3{5,6,7,8}-test-instrumentation-asgi pypy3-test-instrumentation-asgi @@ -133,7 +133,7 @@ envlist = py3{4,5,6,7,8}-test-instrumentation-sqlite3 pypy3-test-instrumentation-sqlite3 - ; opentelemetry-ext-wsgi + ; opentelemetry-instrumentation-wsgi py3{4,5,6,7,8}-test-instrumentation-wsgi pypy3-test-instrumentation-wsgi @@ -197,19 +197,19 @@ changedir = test-core-getting-started: docs/getting_started/tests test-core-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests - test-instrumentation-aiohttp-client: ext/opentelemetry-ext-aiohttp-client/tests - test-instrumentation-aiopg: ext/opentelemetry-instrumentation-aiopg/tests - test-instrumentation-asgi: ext/opentelemetry-ext-asgi/tests + test-instrumentation-aiohttp-client: instrumentation/opentelemetry-instrumentation-aiohttp-client/tests + test-instrumentation-aiopg: instrumentation/opentelemetry-instrumentation-aiopg/tests + test-instrumentation-asgi: instrumentation/opentelemetry-instrumentation-asgi/tests test-instrumentation-asyncpg: ext/opentelemetry-ext-asyncpg/tests test-instrumentation-boto: ext/opentelemetry-ext-boto/tests test-instrumentation-botocore: ext/opentelemetry-ext-botocore/tests test-instrumentation-celery: ext/opentelemetry-ext-celery/tests test-instrumentation-dbapi: ext/opentelemetry-ext-dbapi/tests - test-instrumentation-django: ext/opentelemetry-ext-django/tests + test-instrumentation-django: instrumentation/opentelemetry-instrumentation-django/tests test-instrumentation-example-app: docs/examples/opentelemetry-example-app/tests test-instrumentation-elasticsearch{2,5,6,7}: ext/opentelemetry-ext-elasticsearch/tests - test-instrumentation-fastapi: ext/opentelemetry-instrumentation-fastapi/tests - test-instrumentation-flask: ext/opentelemetry-ext-flask/tests + test-instrumentation-fastapi: instrumentation/opentelemetry-instrumentation-fastapi/tests + test-instrumentation-flask: instrumentation/opentelemetry-instrumentation-flask/tests test-instrumentation-grpc: ext/opentelemetry-ext-grpc/tests test-instrumentation-jinja2: ext/opentelemetry-ext-jinja2/tests test-instrumentation-mysql: ext/opentelemetry-ext-mysql/tests @@ -217,14 +217,14 @@ changedir = test-instrumentation-pymemcache: ext/opentelemetry-ext-pymemcache/tests test-instrumentation-pymongo: ext/opentelemetry-ext-pymongo/tests test-instrumentation-pymysql: ext/opentelemetry-ext-pymysql/tests - test-instrumentation-pyramid: ext/opentelemetry-ext-pyramid/tests + test-instrumentation-pyramid: instrumentation/opentelemetry-instrumentation-pyramid/tests test-instrumentation-redis: ext/opentelemetry-ext-redis/tests - test-instrumentation-requests: ext/opentelemetry-ext-requests/tests + test-instrumentation-requests: instrumentation/opentelemetry-instrumentation-requests/tests test-instrumentation-sqlalchemy: ext/opentelemetry-ext-sqlalchemy/tests test-instrumentation-sqlite3: ext/opentelemetry-ext-sqlite3/tests - test-instrumentation-starlette: ext/opentelemetry-instrumentation-starlette/tests + test-instrumentation-starlette: instrumentation/opentelemetry-instrumentation-starlette/tests test-instrumentation-system-metrics: ext/opentelemetry-ext-system-metrics/tests - test-instrumentation-wsgi: ext/opentelemetry-ext-wsgi/tests + test-instrumentation-wsgi: instrumentation/opentelemetry-instrumentation-wsgi/tests test-exporter-jaeger: exporter/opentelemetry-exporter-jaeger/tests test-exporter-datadog: exporter/opentelemetry-exporter-datadog/tests @@ -243,31 +243,31 @@ commands_pre = test-core-proto: pip install {toxinidir}/opentelemetry-proto ext,instrumentation: pip install {toxinidir}/opentelemetry-instrumentation - example-app: pip install {toxinidir}/opentelemetry-instrumentation {toxinidir}/ext/opentelemetry-ext-requests {toxinidir}/ext/opentelemetry-ext-wsgi {toxinidir}/ext/opentelemetry-ext-flask {toxinidir}/docs/examples/opentelemetry-example-app + example-app: pip install {toxinidir}/opentelemetry-instrumentation {toxinidir}/instrumentation/opentelemetry-instrumentation-requests {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi {toxinidir}/instrumentation/opentelemetry-instrumentation-flask {toxinidir}/docs/examples/opentelemetry-example-app - getting-started: pip install -e {toxinidir}/opentelemetry-instrumentation -e {toxinidir}/ext/opentelemetry-ext-requests -e {toxinidir}/ext/opentelemetry-ext-wsgi -e {toxinidir}/ext/opentelemetry-ext-flask + getting-started: pip install -e {toxinidir}/opentelemetry-instrumentation -e {toxinidir}/instrumentation/opentelemetry-instrumentation-requests -e {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi -e {toxinidir}/instrumentation/opentelemetry-instrumentation-flask celery: pip install {toxinidir}/ext/opentelemetry-ext-celery[test] grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test] - wsgi,flask,django,pyramid: pip install {toxinidir}/ext/opentelemetry-ext-wsgi - asgi,starlette,fastapi: pip install {toxinidir}/ext/opentelemetry-ext-asgi + wsgi,flask,django,pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi + asgi,starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi asyncpg: pip install {toxinidir}/ext/opentelemetry-ext-asyncpg boto: pip install {toxinidir}/ext/opentelemetry-ext-botocore[test] boto: pip install {toxinidir}/ext/opentelemetry-ext-boto[test] - flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test] + flask: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test] botocore: pip install {toxinidir}/ext/opentelemetry-ext-botocore[test] dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi[test] - django: pip install {toxinidir}/ext/opentelemetry-ext-django[test] + django: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-django[test] - fastapi: pip install {toxinidir}/ext/opentelemetry-instrumentation-fastapi[test] + fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi[test] mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-mysql[test] @@ -286,21 +286,21 @@ commands_pre = pymysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-pymysql[test] - pyramid: pip install {toxinidir}/ext/opentelemetry-ext-pyramid[test] + pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid[test] sqlite3: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-sqlite3[test] redis: pip install {toxinidir}/ext/opentelemetry-ext-redis[test] - requests: pip install {toxinidir}/ext/opentelemetry-ext-requests[test] + requests: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-requests[test] - starlette: pip install {toxinidir}/ext/opentelemetry-instrumentation-starlette[test] + starlette: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette[test] jinja2: pip install {toxinidir}/ext/opentelemetry-ext-jinja2[test] - aiohttp-client: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-aiohttp-client + aiohttp-client: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client - aiopg: pip install {toxinidir}/ext/opentelemetry-ext-dbapi pip install {toxinidir}/ext/opentelemetry-instrumentation-aiopg[test] + aiopg: pip install {toxinidir}/ext/opentelemetry-ext-dbapi pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg[test] jaeger: pip install {toxinidir}/exporter/opentelemetry-exporter-jaeger @@ -383,9 +383,9 @@ commands_pre = pip install -e {toxinidir}/opentelemetry-api \ -e {toxinidir}/opentelemetry-instrumentation \ -e {toxinidir}/opentelemetry-sdk \ - -e {toxinidir}/ext/opentelemetry-ext-requests \ - -e {toxinidir}/ext/opentelemetry-ext-wsgi \ - -e {toxinidir}/ext/opentelemetry-ext-flask + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-requests \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-flask commands = {toxinidir}/scripts/tracecontext-integration-test.sh @@ -420,7 +420,7 @@ commands_pre = -e {toxinidir}/ext/opentelemetry-ext-pymongo \ -e {toxinidir}/ext/opentelemetry-ext-pymysql \ -e {toxinidir}/ext/opentelemetry-ext-sqlalchemy \ - -e {toxinidir}/ext/opentelemetry-instrumentation-aiopg \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg \ -e {toxinidir}/ext/opentelemetry-ext-redis \ -e {toxinidir}/ext/opentelemetry-ext-system-metrics \ -e {toxinidir}/exporter/opentelemetry-exporter-opencensus From 81595475af6f1906d22cffb808936cc6c2e0a65a Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Mon, 3 Aug 2020 17:48:44 -0700 Subject: [PATCH 130/145] Rename db framework packages from "ext" to "instrumentation" (#966) --- eachdist.ini | 2 +- tox.ini | 78 ++++++++++++++++++++++++++-------------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/eachdist.ini b/eachdist.ini index 06d940378..abf9e620a 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -8,7 +8,7 @@ sortfirst= opentelemetry-proto tests/util instrumentation/opentelemetry-instrumentation-wsgi - ext/opentelemetry-ext-dbapi + instrumentation/opentelemetry-instrumentation-dbapi instrumentation/opentelemetry-instrumentation-asgi ext/opentelemetry-ext-botocore instrumentation/* diff --git a/tox.ini b/tox.ini index 6dab08f70..8528b63f6 100644 --- a/tox.ini +++ b/tox.ini @@ -44,7 +44,7 @@ envlist = py3{4,5,6,7,8}-test-instrumentation-django pypy3-test-instrumentation-django - ; opentelemetry-ext-dbapi + ; opentelemetry-instrumentation-dbapi py3{4,5,6,7,8}-test-instrumentation-dbapi pypy3-test-instrumentation-dbapi @@ -85,7 +85,7 @@ envlist = ; opentelemetry-exporter-datadog py3{5,6,7,8}-test-exporter-datadog - ; opentelemetry-ext-mysql + ; opentelemetry-instrumentation-mysql py3{4,5,6,7,8}-test-instrumentation-mysql pypy3-test-instrumentation-mysql @@ -101,19 +101,19 @@ envlist = py3{4,5,6,7,8}-test-exporter-prometheus pypy3-test-exporter-prometheus - ; opentelemetry-ext-psycopg2 + ; opentelemetry-instrumentation-psycopg2 py3{4,5,6,7,8}-test-instrumentation-psycopg2 ; ext-psycopg2 intentionally excluded from pypy3 - ; opentelemetry-ext-pymemcache + ; opentelemetry-instrumentation-pymemcache py3{4,5,6,7,8}-test-instrumentation-pymemcache pypy3-test-instrumentation-pymemcache - ; opentelemetry-ext-pymongo + ; opentelemetry-instrumentation-pymongo py3{4,5,6,7,8}-test-instrumentation-pymongo pypy3-test-instrumentation-pymongo - ; opentelemetry-ext-pymysql + ; opentelemetry-instrumentation-pymysql py3{4,5,6,7,8}-test-instrumentation-pymysql pypy3-test-instrumentation-pymysql @@ -125,11 +125,11 @@ envlist = py3{5,6,7,8}-test-instrumentation-asgi pypy3-test-instrumentation-asgi - ; opentelemetry-ext-asyncpg + ; opentelemetry-instrumentation-asyncpg py3{5,6,7,8}-test-instrumentation-asyncpg ; ext-asyncpg intentionally excluded from pypy3 - ; opentelemetry-ext-sqlite3 + ; opentelemetry-instrumentation-sqlite3 py3{4,5,6,7,8}-test-instrumentation-sqlite3 pypy3-test-instrumentation-sqlite3 @@ -148,11 +148,11 @@ envlist = ; opentelemetry-ext-grpc py3{5,6,7,8}-test-instrumentation-grpc - ; opentelemetry-ext-sqlalchemy + ; opentelemetry-instrumentation-sqlalchemy py3{4,5,6,7,8}-test-instrumentation-sqlalchemy pypy3-test-instrumentation-sqlalchemy - ; opentelemetry-ext-redis + ; opentelemetry-instrumentation-redis py3{4,5,6,7,8}-test-instrumentation-redis pypy3-test-instrumentation-redis @@ -200,11 +200,11 @@ changedir = test-instrumentation-aiohttp-client: instrumentation/opentelemetry-instrumentation-aiohttp-client/tests test-instrumentation-aiopg: instrumentation/opentelemetry-instrumentation-aiopg/tests test-instrumentation-asgi: instrumentation/opentelemetry-instrumentation-asgi/tests - test-instrumentation-asyncpg: ext/opentelemetry-ext-asyncpg/tests + test-instrumentation-asyncpg: instrumentation/opentelemetry-instrumentation-asyncpg/tests test-instrumentation-boto: ext/opentelemetry-ext-boto/tests test-instrumentation-botocore: ext/opentelemetry-ext-botocore/tests test-instrumentation-celery: ext/opentelemetry-ext-celery/tests - test-instrumentation-dbapi: ext/opentelemetry-ext-dbapi/tests + test-instrumentation-dbapi: instrumentation/opentelemetry-instrumentation-dbapi/tests test-instrumentation-django: instrumentation/opentelemetry-instrumentation-django/tests test-instrumentation-example-app: docs/examples/opentelemetry-example-app/tests test-instrumentation-elasticsearch{2,5,6,7}: ext/opentelemetry-ext-elasticsearch/tests @@ -212,16 +212,16 @@ changedir = test-instrumentation-flask: instrumentation/opentelemetry-instrumentation-flask/tests test-instrumentation-grpc: ext/opentelemetry-ext-grpc/tests test-instrumentation-jinja2: ext/opentelemetry-ext-jinja2/tests - test-instrumentation-mysql: ext/opentelemetry-ext-mysql/tests - test-instrumentation-psycopg2: ext/opentelemetry-ext-psycopg2/tests - test-instrumentation-pymemcache: ext/opentelemetry-ext-pymemcache/tests - test-instrumentation-pymongo: ext/opentelemetry-ext-pymongo/tests - test-instrumentation-pymysql: ext/opentelemetry-ext-pymysql/tests + test-instrumentation-mysql: instrumentation/opentelemetry-instrumentation-mysql/tests + test-instrumentation-psycopg2: instrumentation/opentelemetry-instrumentation-psycopg2/tests + test-instrumentation-pymemcache: instrumentation/opentelemetry-instrumentation-pymemcache/tests + test-instrumentation-pymongo: instrumentation/opentelemetry-instrumentation-pymongo/tests + test-instrumentation-pymysql: instrumentation/opentelemetry-instrumentation-pymysql/tests test-instrumentation-pyramid: instrumentation/opentelemetry-instrumentation-pyramid/tests - test-instrumentation-redis: ext/opentelemetry-ext-redis/tests + test-instrumentation-redis: instrumentation/opentelemetry-instrumentation-redis/tests test-instrumentation-requests: instrumentation/opentelemetry-instrumentation-requests/tests - test-instrumentation-sqlalchemy: ext/opentelemetry-ext-sqlalchemy/tests - test-instrumentation-sqlite3: ext/opentelemetry-ext-sqlite3/tests + test-instrumentation-sqlalchemy: instrumentation/opentelemetry-instrumentation-sqlalchemy/tests + test-instrumentation-sqlite3: instrumentation/opentelemetry-instrumentation-sqlite3/tests test-instrumentation-starlette: instrumentation/opentelemetry-instrumentation-starlette/tests test-instrumentation-system-metrics: ext/opentelemetry-ext-system-metrics/tests test-instrumentation-wsgi: instrumentation/opentelemetry-instrumentation-wsgi/tests @@ -254,7 +254,7 @@ commands_pre = wsgi,flask,django,pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi asgi,starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi - asyncpg: pip install {toxinidir}/ext/opentelemetry-ext-asyncpg + asyncpg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg boto: pip install {toxinidir}/ext/opentelemetry-ext-botocore[test] boto: pip install {toxinidir}/ext/opentelemetry-ext-boto[test] @@ -263,13 +263,13 @@ commands_pre = botocore: pip install {toxinidir}/ext/opentelemetry-ext-botocore[test] - dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi[test] + dbapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi[test] django: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-django[test] fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi[test] - mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-mysql[test] + mysql: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql[test] opencensus: pip install {toxinidir}/exporter/opentelemetry-exporter-opencensus @@ -278,19 +278,19 @@ commands_pre = prometheus: pip install {toxinidir}/exporter/opentelemetry-exporter-prometheus - pymemcache: pip install {toxinidir}/ext/opentelemetry-ext-pymemcache[test] + pymemcache: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache[test] - pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo[test] + pymongo: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test] - psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-psycopg2 {toxinidir}/ext/opentelemetry-ext-psycopg2[test] + psycopg2: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2[test] - pymysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-pymysql[test] + pymysql: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql[test] pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid[test] - sqlite3: pip install {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-sqlite3[test] + sqlite3: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3[test] - redis: pip install {toxinidir}/ext/opentelemetry-ext-redis[test] + redis: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-redis[test] requests: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-requests[test] @@ -300,7 +300,7 @@ commands_pre = aiohttp-client: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client - aiopg: pip install {toxinidir}/ext/opentelemetry-ext-dbapi pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg[test] + aiopg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg[test] jaeger: pip install {toxinidir}/exporter/opentelemetry-exporter-jaeger @@ -311,7 +311,7 @@ commands_pre = zipkin: pip install {toxinidir}/exporter/opentelemetry-exporter-zipkin - sqlalchemy: pip install {toxinidir}/ext/opentelemetry-ext-sqlalchemy + sqlalchemy: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy system-metrics: pip install {toxinidir}/ext/opentelemetry-ext-system-metrics[test] @@ -412,16 +412,16 @@ commands_pre = -e {toxinidir}/opentelemetry-sdk \ -e {toxinidir}/opentelemetry-instrumentation \ -e {toxinidir}/tests/util \ - -e {toxinidir}/ext/opentelemetry-ext-asyncpg \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg \ -e {toxinidir}/ext/opentelemetry-ext-celery \ - -e {toxinidir}/ext/opentelemetry-ext-dbapi \ - -e {toxinidir}/ext/opentelemetry-ext-mysql \ - -e {toxinidir}/ext/opentelemetry-ext-psycopg2 \ - -e {toxinidir}/ext/opentelemetry-ext-pymongo \ - -e {toxinidir}/ext/opentelemetry-ext-pymysql \ - -e {toxinidir}/ext/opentelemetry-ext-sqlalchemy \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2 \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg \ - -e {toxinidir}/ext/opentelemetry-ext-redis \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-redis \ -e {toxinidir}/ext/opentelemetry-ext-system-metrics \ -e {toxinidir}/exporter/opentelemetry-exporter-opencensus docker-compose up -d From 8ca32f0ba5b372d8d0887003f47dcb8cfb9f35f0 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Tue, 4 Aug 2020 19:10:51 -0700 Subject: [PATCH 131/145] Rename remaining framework packages from "ext" to "instrumentation" (#969) --- eachdist.ini | 2 +- tox.ini | 56 ++++++++++++++++++++++++++-------------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/eachdist.ini b/eachdist.ini index abf9e620a..076c8a4a4 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -10,7 +10,7 @@ sortfirst= instrumentation/opentelemetry-instrumentation-wsgi instrumentation/opentelemetry-instrumentation-dbapi instrumentation/opentelemetry-instrumentation-asgi - ext/opentelemetry-ext-botocore + instrumentation/opentelemetry-instrumentation-botocore instrumentation/* exporter/* ext/* diff --git a/tox.ini b/tox.ini index 8528b63f6..91024f7f3 100644 --- a/tox.ini +++ b/tox.ini @@ -36,7 +36,7 @@ envlist = py3{5,6,7,8}-test-instrumentation-aiopg ; instrumentation-aiopg intentionally excluded from pypy3 - ; opentelemetry-ext-botocore + ; opentelemetry-instrumentation-botocore py3{6,7,8}-test-instrumentation-botocore pypy3-test-instrumentation-botocore @@ -48,7 +48,7 @@ envlist = py3{4,5,6,7,8}-test-instrumentation-dbapi pypy3-test-instrumentation-dbapi - ; opentelemetry-ext-boto + ; opentelemetry-instrumentation-boto py3{5,6,7,8}-test-instrumentation-boto pypy3-test-instrumentation-boto @@ -74,7 +74,7 @@ envlist = py3{6,7,8}-test-instrumentation-starlette pypy3-test-instrumentation-starlette - ; opentelemetry-ext-jinja2 + ; opentelemetry-instrumentation-jinja2 py3{4,5,6,7,8}-test-instrumentation-jinja2 pypy3-test-instrumentation-jinja2 @@ -145,7 +145,7 @@ envlist = py3{4,5,6,7,8}-test-core-opentracing-shim pypy3-test-core-opentracing-shim - ; opentelemetry-ext-grpc + ; opentelemetry-instrumentation-grpc py3{5,6,7,8}-test-instrumentation-grpc ; opentelemetry-instrumentation-sqlalchemy @@ -156,13 +156,13 @@ envlist = py3{4,5,6,7,8}-test-instrumentation-redis pypy3-test-instrumentation-redis - ; opentelemetry-ext-celery + ; opentelemetry-instrumentation-celery py3{5,6,7,8}-test-instrumentation-celery pypy3-test-instrumentation-celery - ; opentelemetry-ext-system-metrics + ; opentelemetry-instrumentation-system-metrics py3{4,5,6,7,8}-test-instrumentation-system-metrics - ; ext-system-metrics intentionally excluded from pypy3 + ; instrumentation-system-metrics intentionally excluded from pypy3 ; known limitation: gc.get_count won't work under pypy lint @@ -195,23 +195,23 @@ changedir = test-core-proto: opentelemetry-proto/tests test-core-instrumentation: opentelemetry-instrumentation/tests test-core-getting-started: docs/getting_started/tests - test-core-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests + test-core-opentracing-shim: instrumentation/opentelemetry-instrumentation-opentracing-shim/tests test-instrumentation-aiohttp-client: instrumentation/opentelemetry-instrumentation-aiohttp-client/tests test-instrumentation-aiopg: instrumentation/opentelemetry-instrumentation-aiopg/tests test-instrumentation-asgi: instrumentation/opentelemetry-instrumentation-asgi/tests test-instrumentation-asyncpg: instrumentation/opentelemetry-instrumentation-asyncpg/tests - test-instrumentation-boto: ext/opentelemetry-ext-boto/tests - test-instrumentation-botocore: ext/opentelemetry-ext-botocore/tests - test-instrumentation-celery: ext/opentelemetry-ext-celery/tests + test-instrumentation-boto: instrumentation/opentelemetry-instrumentation-boto/tests + test-instrumentation-botocore: instrumentation/opentelemetry-instrumentation-botocore/tests + test-instrumentation-celery: instrumentation/opentelemetry-instrumentation-celery/tests test-instrumentation-dbapi: instrumentation/opentelemetry-instrumentation-dbapi/tests test-instrumentation-django: instrumentation/opentelemetry-instrumentation-django/tests test-instrumentation-example-app: docs/examples/opentelemetry-example-app/tests - test-instrumentation-elasticsearch{2,5,6,7}: ext/opentelemetry-ext-elasticsearch/tests + test-instrumentation-elasticsearch{2,5,6,7}: instrumentation/opentelemetry-instrumentation-elasticsearch/tests test-instrumentation-fastapi: instrumentation/opentelemetry-instrumentation-fastapi/tests test-instrumentation-flask: instrumentation/opentelemetry-instrumentation-flask/tests - test-instrumentation-grpc: ext/opentelemetry-ext-grpc/tests - test-instrumentation-jinja2: ext/opentelemetry-ext-jinja2/tests + test-instrumentation-grpc: instrumentation/opentelemetry-instrumentation-grpc/tests + test-instrumentation-jinja2: instrumentation/opentelemetry-instrumentation-jinja2/tests test-instrumentation-mysql: instrumentation/opentelemetry-instrumentation-mysql/tests test-instrumentation-psycopg2: instrumentation/opentelemetry-instrumentation-psycopg2/tests test-instrumentation-pymemcache: instrumentation/opentelemetry-instrumentation-pymemcache/tests @@ -223,7 +223,7 @@ changedir = test-instrumentation-sqlalchemy: instrumentation/opentelemetry-instrumentation-sqlalchemy/tests test-instrumentation-sqlite3: instrumentation/opentelemetry-instrumentation-sqlite3/tests test-instrumentation-starlette: instrumentation/opentelemetry-instrumentation-starlette/tests - test-instrumentation-system-metrics: ext/opentelemetry-ext-system-metrics/tests + test-instrumentation-system-metrics: instrumentation/opentelemetry-instrumentation-system-metrics/tests test-instrumentation-wsgi: instrumentation/opentelemetry-instrumentation-wsgi/tests test-exporter-jaeger: exporter/opentelemetry-exporter-jaeger/tests @@ -241,27 +241,27 @@ commands_pre = test: pip install {toxinidir}/opentelemetry-api {toxinidir}/opentelemetry-sdk {toxinidir}/tests/util test-core-proto: pip install {toxinidir}/opentelemetry-proto - ext,instrumentation: pip install {toxinidir}/opentelemetry-instrumentation + instrumentation: pip install {toxinidir}/opentelemetry-instrumentation example-app: pip install {toxinidir}/opentelemetry-instrumentation {toxinidir}/instrumentation/opentelemetry-instrumentation-requests {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi {toxinidir}/instrumentation/opentelemetry-instrumentation-flask {toxinidir}/docs/examples/opentelemetry-example-app getting-started: pip install -e {toxinidir}/opentelemetry-instrumentation -e {toxinidir}/instrumentation/opentelemetry-instrumentation-requests -e {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi -e {toxinidir}/instrumentation/opentelemetry-instrumentation-flask - celery: pip install {toxinidir}/ext/opentelemetry-ext-celery[test] + celery: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-celery[test] - grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test] + grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] wsgi,flask,django,pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi asgi,starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi asyncpg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg - boto: pip install {toxinidir}/ext/opentelemetry-ext-botocore[test] - boto: pip install {toxinidir}/ext/opentelemetry-ext-boto[test] + boto: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] + boto: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] flask: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test] - botocore: pip install {toxinidir}/ext/opentelemetry-ext-botocore[test] + botocore: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] dbapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi[test] @@ -296,7 +296,7 @@ commands_pre = starlette: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette[test] - jinja2: pip install {toxinidir}/ext/opentelemetry-ext-jinja2[test] + jinja2: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2[test] aiohttp-client: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client @@ -305,7 +305,7 @@ commands_pre = jaeger: pip install {toxinidir}/exporter/opentelemetry-exporter-jaeger opentracing-shim: pip install {toxinidir}/opentelemetry-sdk - opentracing-shim: pip install {toxinidir}/ext/opentelemetry-ext-opentracing-shim + opentracing-shim: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-opentracing-shim datadog: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/exporter/opentelemetry-exporter-datadog @@ -313,9 +313,9 @@ commands_pre = sqlalchemy: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy - system-metrics: pip install {toxinidir}/ext/opentelemetry-ext-system-metrics[test] + system-metrics: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics[test] - elasticsearch{2,5,6,7}: pip install {toxinidir}/opentelemetry-instrumentation {toxinidir}/ext/opentelemetry-ext-elasticsearch[test] + elasticsearch{2,5,6,7}: pip install {toxinidir}/opentelemetry-instrumentation {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test] ; In order to get a healthy coverage report, ; we have to install packages in editable mode. @@ -405,7 +405,7 @@ deps = celery ~= 4.0, != 4.4.4 changedir = - ext/opentelemetry-ext-docker-tests/tests + tests/opentelemetry-docker-tests/tests commands_pre = pip install -e {toxinidir}/opentelemetry-api \ @@ -413,7 +413,7 @@ commands_pre = -e {toxinidir}/opentelemetry-instrumentation \ -e {toxinidir}/tests/util \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg \ - -e {toxinidir}/ext/opentelemetry-ext-celery \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2 \ @@ -422,7 +422,7 @@ commands_pre = -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-redis \ - -e {toxinidir}/ext/opentelemetry-ext-system-metrics \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics \ -e {toxinidir}/exporter/opentelemetry-exporter-opencensus docker-compose up -d python check_availability.py From e103fbb0deecc7faef24e002dd024ef6bfebb0e1 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 17 Aug 2020 22:06:05 -0600 Subject: [PATCH 132/145] exporter/otlp: Add OTLP metric exporter (#835) --- .pylintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.pylintrc b/.pylintrc index 5f9463df7..8f29b634f 100644 --- a/.pylintrc +++ b/.pylintrc @@ -65,6 +65,7 @@ disable=missing-docstring, too-few-public-methods, # Might be good to re-enable this later. too-many-instance-attributes, too-many-arguments, + duplicate-code, ungrouped-imports, # Leave this up to isort wrong-import-order, # Leave this up to isort bad-continuation, # Leave this up to black From a5bb6de81187b2d2b351c7bb45fe785b1898ce57 Mon Sep 17 00:00:00 2001 From: Daniel <61800298+ffe4@users.noreply.github.com> Date: Wed, 2 Sep 2020 20:26:16 +0200 Subject: [PATCH 133/145] Add support for db cursors and connections in context managers (#1028) Here is an example snippet that will not report tracing without this patch: with psycopg2.connect(...) as conn, conn.cursor() as cursor: cursor.execute("select 1;") Co-authored-by: Carl Bordum Hansen --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 91024f7f3..424b1d694 100644 --- a/tox.ini +++ b/tox.ini @@ -430,4 +430,4 @@ commands = pytest {posargs} commands_post = - docker-compose down + docker-compose down -v From 7d9ea1bd1e066178ec2e3e82bf6a6aa4bf1c502f Mon Sep 17 00:00:00 2001 From: alrex Date: Thu, 3 Sep 2020 16:02:02 -0700 Subject: [PATCH 134/145] Populate resource attributes as per semantic conventions (#1053) As per semantic conventions, set the `telemetry.sdk` parameters. --- tox.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tox.ini b/tox.ini index 424b1d694..0fbaabce8 100644 --- a/tox.ini +++ b/tox.ini @@ -365,6 +365,10 @@ deps = -c {toxinidir}/dev-requirements.txt -r {toxinidir}/docs-requirements.txt +commands_pre = + pip install -e {toxinidir}/opentelemetry-api \ + -e {toxinidir}/opentelemetry-sdk + changedir = docs commands = From ff69908250964cc9390fa551fc3dfd5de1ff6556 Mon Sep 17 00:00:00 2001 From: Steve Flanders Date: Tue, 8 Sep 2020 11:05:34 -0400 Subject: [PATCH 135/145] Remove non-inclusive language from comments in pylint (#1077) * Remove non-inclusive language from comments in pylint Co-authored-by: Daniel <61800298+ffe4@users.noreply.github.com> --- .pylintrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index 8f29b634f..b23bef8e6 100644 --- a/.pylintrc +++ b/.pylintrc @@ -5,11 +5,11 @@ # run arbitrary code. extension-pkg-whitelist= -# Add files or directories to the blacklist. They should be base names, not +# Add list of files or directories to be excluded. They should be base names, not # paths. ignore=CVS,gen,proto -# Add files or directories matching the regex patterns to the blacklist. The +# Add files or directories matching the regex patterns to be excluded. The # regex matches against base names, not paths. ignore-patterns= From a5415970d6ed85fcd8bbca9a5c08e7d41714c741 Mon Sep 17 00:00:00 2001 From: Daniel <61800298+ffe4@users.noreply.github.com> Date: Mon, 14 Sep 2020 17:27:06 +0200 Subject: [PATCH 136/145] build/infra: Add GitHub Action for tox runs (#984) The Python 3.5 intrumentation test segfaults when importing the mysql connector. Running this test on Ubuntu-20.04 fixes this issue. --- .github/workflows/test.yml | 78 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..84cbecace --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,78 @@ +name: Test + +on: [push, pull_request] + +jobs: + build: + env: + # We use these variables to convert between tox and GHA version literals + py34: 3.4 + py35: 3.5 + py36: 3.6 + py37: 3.7 + py38: 3.8 + pypy3: pypy3 + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false # ensures the entire test matrix is run, even if one permutation fails + matrix: + python-version: [ py34, py35, py36, py37, py38, pypy3 ] + package: ["instrumentation", "core", "exporter"] + os: [ ubuntu-latest ] + include: + - python-version: py38 + package: "tracecontext" + os: ubuntu-latest + - python-version: py38 + package: "mypy" + os: ubuntu-latest + - python-version: py38 + package: "mypyinstalled" + os: ubuntu-latest + # py35-instrumentation segfaults on 18.04 so we instead run on 20.04 + - python-version: py35 + package: instrumentation + os: ubuntu-20.04 + exclude: + - os: ubuntu-latest + python-version: py35 + package: instrumentation + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ env[matrix.python-version] }} + uses: actions/setup-python@v2 + with: + python-version: ${{ env[matrix.python-version] }} + - name: Install tox + run: pip install -U tox-factor + - name: Cache tox environment + # Preserves .tox directory between runs for faster installs + uses: actions/cache@v2 + with: + path: .tox + key: tox-cache-${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }} + - name: run tox + run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} + misc: + strategy: + fail-fast: false + matrix: + tox-environment: [ "docker-tests", "lint", "docs" ] + name: ${{ matrix.tox-environment }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install tox + run: pip install -U tox + - name: Cache tox environment + # Preserves .tox directory between runs for faster installs + uses: actions/cache@v2 + with: + path: .tox + key: tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }} + - name: run tox + run: tox -e ${{ matrix.tox-environment }} From 7ab5cb4416c5dc63d28ce1e2c0346863d0f6e7fc Mon Sep 17 00:00:00 2001 From: alrex Date: Mon, 14 Sep 2020 15:11:56 -0700 Subject: [PATCH 137/145] dropping support for python 3.4 (#1099) * dropping support for python 3.4 --- .github/workflows/test.yml | 3 +- tox.ini | 60 ++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 34 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84cbecace..515fdf433 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,6 @@ jobs: build: env: # We use these variables to convert between tox and GHA version literals - py34: 3.4 py35: 3.5 py36: 3.6 py37: 3.7 @@ -16,7 +15,7 @@ jobs: strategy: fail-fast: false # ensures the entire test matrix is run, even if one permutation fails matrix: - python-version: [ py34, py35, py36, py37, py38, pypy3 ] + python-version: [ py35, py36, py37, py38, pypy3 ] package: ["instrumentation", "core", "exporter"] os: [ ubuntu-latest ] include: diff --git a/tox.ini b/tox.ini index 0fbaabce8..057562907 100644 --- a/tox.ini +++ b/tox.ini @@ -5,15 +5,15 @@ envlist = ; Environments are organized by individual package, allowing ; for specifying supported Python versions per package. ; opentelemetry-api - py3{4,5,6,7,8}-test-core-api + py3{5,6,7,8}-test-core-api pypy3-test-core-api ; opentelemetry-proto - py3{4,5,6,7,8}-test-core-proto + py3{5,6,7,8}-test-core-proto pypy3-test-core-proto ; opentelemetry-sdk - py3{4,5,6,7,8}-test-core-sdk + py3{5,6,7,8}-test-core-sdk pypy3-test-core-sdk ; opentelemetry-instrumentation @@ -21,11 +21,11 @@ envlist = pypy3-test-core-instrumentation ; docs/getting-started - py3{4,5,6,7,8}-test-core-getting-started + py3{5,6,7,8}-test-core-getting-started pypy3-test-core-getting-started ; opentelemetry-example-app - py3{4,5,6,7,8}-test-instrumentation-example-app + py3{5,6,7,8}-test-instrumentation-example-app pypy3-test-instrumentation-example-app ; opentelemetry-instrumentation-aiohttp-client @@ -41,11 +41,11 @@ envlist = pypy3-test-instrumentation-botocore ; opentelemetry-instrumentation-django - py3{4,5,6,7,8}-test-instrumentation-django + py3{5,6,7,8}-test-instrumentation-django pypy3-test-instrumentation-django ; opentelemetry-instrumentation-dbapi - py3{4,5,6,7,8}-test-instrumentation-dbapi + py3{5,6,7,8}-test-instrumentation-dbapi pypy3-test-instrumentation-dbapi ; opentelemetry-instrumentation-boto @@ -53,7 +53,7 @@ envlist = pypy3-test-instrumentation-boto ; opentelemetry-instrumentation-elasticsearch - py3{4,5,6,7,8}-test-instrumentation-elasticsearch{2,5,6,7} + py3{5,6,7,8}-test-instrumentation-elasticsearch{2,5,6,7} pypy3-test-instrumentation-elasticsearch{2,5,6,7} ; opentelemetry-instrumentation-fastapi @@ -62,11 +62,11 @@ envlist = pypy3-test-instrumentation-fastapi ; opentelemetry-instrumentation-flask - py3{4,5,6,7,8}-test-instrumentation-flask + py3{5,6,7,8}-test-instrumentation-flask pypy3-test-instrumentation-flask ; opentelemetry-instrumentation-requests - py3{4,5,6,7,8}-test-instrumentation-requests + py3{5,6,7,8}-test-instrumentation-requests pypy3-test-instrumentation-requests ; opentelemetry-instrumentation-starlette. @@ -75,22 +75,22 @@ envlist = pypy3-test-instrumentation-starlette ; opentelemetry-instrumentation-jinja2 - py3{4,5,6,7,8}-test-instrumentation-jinja2 + py3{5,6,7,8}-test-instrumentation-jinja2 pypy3-test-instrumentation-jinja2 ; opentelemetry-exporter-jaeger - py3{4,5,6,7,8}-test-exporter-jaeger + py3{5,6,7,8}-test-exporter-jaeger pypy3-test-exporter-jaeger ; opentelemetry-exporter-datadog py3{5,6,7,8}-test-exporter-datadog ; opentelemetry-instrumentation-mysql - py3{4,5,6,7,8}-test-instrumentation-mysql + py3{5,6,7,8}-test-instrumentation-mysql pypy3-test-instrumentation-mysql ; opentelemetry-exporter-opencensus - py3{4,5,6,7,8}-test-exporter-opencensus + py3{5,6,7,8}-test-exporter-opencensus ; exporter-opencensus intentionally excluded from pypy3 ; opentelemetry-exporter-otlp @@ -98,27 +98,27 @@ envlist = ; exporter-otlp intentionally excluded from pypy3 ; opentelemetry-exporter-prometheus - py3{4,5,6,7,8}-test-exporter-prometheus + py3{5,6,7,8}-test-exporter-prometheus pypy3-test-exporter-prometheus ; opentelemetry-instrumentation-psycopg2 - py3{4,5,6,7,8}-test-instrumentation-psycopg2 + py3{5,6,7,8}-test-instrumentation-psycopg2 ; ext-psycopg2 intentionally excluded from pypy3 ; opentelemetry-instrumentation-pymemcache - py3{4,5,6,7,8}-test-instrumentation-pymemcache + py3{5,6,7,8}-test-instrumentation-pymemcache pypy3-test-instrumentation-pymemcache ; opentelemetry-instrumentation-pymongo - py3{4,5,6,7,8}-test-instrumentation-pymongo + py3{5,6,7,8}-test-instrumentation-pymongo pypy3-test-instrumentation-pymongo ; opentelemetry-instrumentation-pymysql - py3{4,5,6,7,8}-test-instrumentation-pymysql + py3{5,6,7,8}-test-instrumentation-pymysql pypy3-test-instrumentation-pymysql ; opentelemetry-instrumentation-pyramid - py3{4,5,6,7,8}-test-instrumentation-pyramid + py3{5,6,7,8}-test-instrumentation-pyramid pypy3-test-instrumentation-pyramid ; opentelemetry-instrumentation-asgi @@ -130,30 +130,30 @@ envlist = ; ext-asyncpg intentionally excluded from pypy3 ; opentelemetry-instrumentation-sqlite3 - py3{4,5,6,7,8}-test-instrumentation-sqlite3 + py3{5,6,7,8}-test-instrumentation-sqlite3 pypy3-test-instrumentation-sqlite3 ; opentelemetry-instrumentation-wsgi - py3{4,5,6,7,8}-test-instrumentation-wsgi + py3{5,6,7,8}-test-instrumentation-wsgi pypy3-test-instrumentation-wsgi ; opentelemetry-exporter-zipkin - py3{4,5,6,7,8}-test-exporter-zipkin + py3{5,6,7,8}-test-exporter-zipkin pypy3-test-exporter-zipkin ; opentelemetry-opentracing-shim - py3{4,5,6,7,8}-test-core-opentracing-shim + py3{5,6,7,8}-test-core-opentracing-shim pypy3-test-core-opentracing-shim ; opentelemetry-instrumentation-grpc py3{5,6,7,8}-test-instrumentation-grpc ; opentelemetry-instrumentation-sqlalchemy - py3{4,5,6,7,8}-test-instrumentation-sqlalchemy + py3{5,6,7,8}-test-instrumentation-sqlalchemy pypy3-test-instrumentation-sqlalchemy ; opentelemetry-instrumentation-redis - py3{4,5,6,7,8}-test-instrumentation-redis + py3{5,6,7,8}-test-instrumentation-redis pypy3-test-instrumentation-redis ; opentelemetry-instrumentation-celery @@ -161,7 +161,7 @@ envlist = pypy3-test-instrumentation-celery ; opentelemetry-instrumentation-system-metrics - py3{4,5,6,7,8}-test-instrumentation-system-metrics + py3{5,6,7,8}-test-instrumentation-system-metrics ; instrumentation-system-metrics intentionally excluded from pypy3 ; known limitation: gc.get_count won't work under pypy @@ -235,7 +235,7 @@ changedir = commands_pre = ; Install without -e to test the actual installation - py3{4,5,6,7,8}: python -m pip install -U pip setuptools wheel + py3{5,6,7,8}: python -m pip install -U pip setuptools wheel ; Install common packages for all the tests. These are not needed in all the ; cases but it saves a lot of boilerplate in this file. test: pip install {toxinidir}/opentelemetry-api {toxinidir}/opentelemetry-sdk {toxinidir}/tests/util @@ -337,10 +337,6 @@ commands = ; implicit Any due to unfollowed import would result). mypyinstalled: mypy --namespace-packages opentelemetry-api/tests/mypysmoke.py --strict -[testenv:py34-test-core-opentracing-shim] -commands = - pytest --ignore-glob='*[asyncio].py' - [testenv:lint] basepython: python3.8 recreate = True From 96c91e16f4c6f657b452be33ac9e571485d83f4f Mon Sep 17 00:00:00 2001 From: Owais Lone Date: Wed, 16 Sep 2020 21:34:02 +0530 Subject: [PATCH 138/145] instrumentation/falcon: Added Falcon 2.0+ instrumentation (#1039) --- tox.ini | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 057562907..384c43725 100644 --- a/tox.ini +++ b/tox.ini @@ -56,6 +56,10 @@ envlist = py3{5,6,7,8}-test-instrumentation-elasticsearch{2,5,6,7} pypy3-test-instrumentation-elasticsearch{2,5,6,7} + ; opentelemetry-instrumentation-falcon + py3{4,5,6,7,8}-test-instrumentation-falcon + pypy3-test-instrumentation-falcon + ; opentelemetry-instrumentation-fastapi ; fastapi only supports 3.6 and above. py3{6,7,8}-test-instrumentation-fastapi @@ -208,6 +212,7 @@ changedir = test-instrumentation-django: instrumentation/opentelemetry-instrumentation-django/tests test-instrumentation-example-app: docs/examples/opentelemetry-example-app/tests test-instrumentation-elasticsearch{2,5,6,7}: instrumentation/opentelemetry-instrumentation-elasticsearch/tests + test-instrumentation-falcon: instrumentation/opentelemetry-instrumentation-falcon/tests test-instrumentation-fastapi: instrumentation/opentelemetry-instrumentation-fastapi/tests test-instrumentation-flask: instrumentation/opentelemetry-instrumentation-flask/tests test-instrumentation-grpc: instrumentation/opentelemetry-instrumentation-grpc/tests @@ -251,7 +256,7 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - wsgi,flask,django,pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi + wsgi,falcon,flask,django,pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi asgi,starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi asyncpg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg @@ -259,6 +264,8 @@ commands_pre = boto: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] boto: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] + falcon: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test] + flask: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test] botocore: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] From 997900a003e045524c5b52e2e01d53b020121d34 Mon Sep 17 00:00:00 2001 From: Owais Lone Date: Thu, 17 Sep 2020 19:49:27 +0530 Subject: [PATCH 139/145] Added instrumentation for Tornado 6 and above (#1018) This commit adds auto-instrumentation for Tornado 6 and above on Python versions 3.5 and above. --- tox.ini | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tox.ini b/tox.ini index 384c43725..b477d5ba7 100644 --- a/tox.ini +++ b/tox.ini @@ -169,6 +169,11 @@ envlist = ; instrumentation-system-metrics intentionally excluded from pypy3 ; known limitation: gc.get_count won't work under pypy + ; opentelemetry-instrumentation-tornado + ; instrumentation supports >=6 on Py 3.5 and above. + py3{5,6,7,8}-test-instrumentation-tornado + pypy3-test-instrumentation-tornado + lint py38-tracecontext py38-{mypy,mypyinstalled} @@ -229,6 +234,7 @@ changedir = test-instrumentation-sqlite3: instrumentation/opentelemetry-instrumentation-sqlite3/tests test-instrumentation-starlette: instrumentation/opentelemetry-instrumentation-starlette/tests test-instrumentation-system-metrics: instrumentation/opentelemetry-instrumentation-system-metrics/tests + test-instrumentation-tornado: instrumentation/opentelemetry-instrumentation-tornado/tests test-instrumentation-wsgi: instrumentation/opentelemetry-instrumentation-wsgi/tests test-exporter-jaeger: exporter/opentelemetry-exporter-jaeger/tests @@ -303,6 +309,8 @@ commands_pre = starlette: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette[test] + tornado: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado + jinja2: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2[test] aiohttp-client: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client From 9cb375414639404d448438ded1ef60a73044fb0f Mon Sep 17 00:00:00 2001 From: alrex Date: Mon, 21 Sep 2020 09:56:59 -0700 Subject: [PATCH 140/145] chore: only trigger tests on push to master (#1126) --- .github/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 515fdf433..7df9dff5d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,10 @@ name: Test -on: [push, pull_request] +on: + push: + branches-ignore: + - 'release/*' + pull_request: jobs: build: From 677b849cec7f30b7322cfa15457f1d3656b36ca2 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Fri, 25 Sep 2020 07:31:35 -0700 Subject: [PATCH 141/145] Adding metric collection as part of instrumentations - Requests (#1116) --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index b477d5ba7..806656ced 100644 --- a/tox.ini +++ b/tox.ini @@ -396,8 +396,8 @@ deps = commands_pre = pip install -e {toxinidir}/opentelemetry-api \ - -e {toxinidir}/opentelemetry-instrumentation \ -e {toxinidir}/opentelemetry-sdk \ + -e {toxinidir}/opentelemetry-instrumentation \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-requests \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-flask From 82581272cf43e79202e594d1106def47ce7f723d Mon Sep 17 00:00:00 2001 From: Amos Law Date: Tue, 6 Oct 2020 17:44:41 -0400 Subject: [PATCH 142/145] Protect access to Span implementation (#1188) --- .pylintrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index b23bef8e6..ea5427386 100644 --- a/.pylintrc +++ b/.pylintrc @@ -441,7 +441,8 @@ exclude-protected=_asdict, _fields, _replace, _source, - _make + _make, + _Span # List of valid names for the first argument in a class method. valid-classmethod-first-arg=cls From 82e44f165ec4f7f74e707ccff07245e5e83a6b67 Mon Sep 17 00:00:00 2001 From: Nathaniel Ruiz Nowell Date: Tue, 3 Nov 2020 10:33:19 -0800 Subject: [PATCH 143/145] Modify existing workflow for CI tests --- .coveragerc | 1 + .flake8 | 1 + .github/workflows/test.yml | 35 ++++---- .gitignore | 1 + .isort.cfg | 2 +- .pylintrc | 2 +- eachdist.ini | 6 +- pyproject.toml | 3 +- tox.ini | 163 +++++-------------------------------- 9 files changed, 49 insertions(+), 165 deletions(-) diff --git a/.coveragerc b/.coveragerc index 8c1787b3b..a7e0d6a78 100644 --- a/.coveragerc +++ b/.coveragerc @@ -4,3 +4,4 @@ omit = */setup.py */gen/* reference/* + opentelemetry-python-core/* diff --git a/.flake8 b/.flake8 index ffea2a590..4f8ad34d6 100644 --- a/.flake8 +++ b/.flake8 @@ -21,5 +21,6 @@ exclude = exporter/opentelemetry-exporter-jaeger/build/* docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/grpc/gen/ docs/examples/opentelemetry-example-app/build/* + opentelemetry-python-core/ opentelemetry-proto/build/* opentelemetry-proto/src/opentelemetry/proto/ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7df9dff5d..390be30d0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test +name: Contrib Repo Tests on: push: @@ -20,18 +20,9 @@ jobs: fail-fast: false # ensures the entire test matrix is run, even if one permutation fails matrix: python-version: [ py35, py36, py37, py38, pypy3 ] - package: ["instrumentation", "core", "exporter"] + package: ["instrumentation", "exporter"] os: [ ubuntu-latest ] include: - - python-version: py38 - package: "tracecontext" - os: ubuntu-latest - - python-version: py38 - package: "mypy" - os: ubuntu-latest - - python-version: py38 - package: "mypyinstalled" - os: ubuntu-latest # py35-instrumentation segfaults on 18.04 so we instead run on 20.04 - python-version: py35 package: instrumentation @@ -41,7 +32,14 @@ jobs: python-version: py35 package: instrumentation steps: - - uses: actions/checkout@v2 + - name: Checkout Contrib Repo at SHA - ${{ github.sha }} + uses: actions/checkout@v2 + - name: Checkout Core Repo @ tag v0.15b0 + uses: actions/checkout@v2 + with: + repository: open-telemetry/opentelemetry-python + ref: v0.15b0 + path: opentelemetry-python-core - name: Set up Python ${{ env[matrix.python-version] }} uses: actions/setup-python@v2 with: @@ -60,11 +58,18 @@ jobs: strategy: fail-fast: false matrix: - tox-environment: [ "docker-tests", "lint", "docs" ] + tox-environment: [ "docker-tests", "lint" ] name: ${{ matrix.tox-environment }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout Contrib Repo at SHA - ${{ github.sha }} + uses: actions/checkout@v2 + - name: Checkout Core Repo @ tag v0.15b0 + uses: actions/checkout@v2 + with: + repository: open-telemetry/opentelemetry-python + ref: v0.15b0 + path: opentelemetry-python-core - name: Set up Python 3.8 uses: actions/setup-python@v2 with: @@ -78,4 +83,4 @@ jobs: path: .tox key: tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }} - name: run tox - run: tox -e ${{ matrix.tox-environment }} + run: tox -e ${{ matrix.tox-environment }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 42e6d0bf0..fa3e412d8 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ lib64 __pycache__ venv*/ .venv*/ +opentelemetry-python-core*/ # Installer logs pip-log.txt diff --git a/.isort.cfg b/.isort.cfg index cf5af7f04..732a341ca 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -13,6 +13,6 @@ line_length=79 ; docs: https://github.com/timothycrosley/isort#multi-line-output-modes multi_line_output=3 skip=target -skip_glob=**/gen/*,.venv*/*,venv*/*,reference*/* +skip_glob=**/gen/*,.venv*/*,venv*/*,reference*/*,opentelemetry-python-core*/* known_first_party=opentelemetry known_third_party=psutil,pytest,redis,redis_opentracing diff --git a/.pylintrc b/.pylintrc index 923e74eeb..c5e1f35db 100644 --- a/.pylintrc +++ b/.pylintrc @@ -7,7 +7,7 @@ extension-pkg-whitelist= # Add list of files or directories to be excluded. They should be base names, not # paths. -ignore=CVS,gen +ignore=CVS,gen,opentelemetry-python-core # Add files or directories matching the regex patterns to be excluded. The # regex matches against base names, not paths. diff --git a/eachdist.ini b/eachdist.ini index 8b512aba0..a157d7c0c 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -4,13 +4,9 @@ ignore= _template reference + opentelemetry-python-core sortfirst= - opentelemetry-api - opentelemetry-sdk - opentelemetry-instrumentation - opentelemetry-proto - tests/util instrumentation/opentelemetry-instrumentation-wsgi instrumentation/opentelemetry-instrumentation-dbapi instrumentation/opentelemetry-instrumentation-asgi diff --git a/pyproject.toml b/pyproject.toml index 35bd19509..bf26e291b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,8 @@ line-length = 79 exclude = ''' ( /( - reference # original files from DataDog + reference| + opentelemetry-python-core )/ ) ''' diff --git a/tox.ini b/tox.ini index bd083f0fd..2fa8a0485 100644 --- a/tox.ini +++ b/tox.ini @@ -4,29 +4,6 @@ skip_missing_interpreters = True envlist = ; Environments are organized by individual package, allowing ; for specifying supported Python versions per package. - ; opentelemetry-api - py3{5,6,7,8}-test-core-api - pypy3-test-core-api - - ; opentelemetry-proto - py3{5,6,7,8}-test-core-proto - pypy3-test-core-proto - - ; opentelemetry-sdk - py3{5,6,7,8}-test-core-sdk - pypy3-test-core-sdk - - ; opentelemetry-instrumentation - py3{5,6,7,8}-test-core-instrumentation - pypy3-test-core-instrumentation - - ; docs/getting-started - py3{5,6,7,8}-test-core-getting-started - pypy3-test-core-getting-started - - ; opentelemetry-example-app - py3{5,6,7,8}-test-instrumentation-example-app - pypy3-test-instrumentation-example-app ; opentelemetry-instrumentation-aiohttp-client py3{5,6,7,8}-test-instrumentation-aiohttp-client @@ -82,10 +59,6 @@ envlist = py3{5,6,7,8}-test-instrumentation-jinja2 pypy3-test-instrumentation-jinja2 - ; opentelemetry-exporter-jaeger - py3{5,6,7,8}-test-exporter-jaeger - pypy3-test-exporter-jaeger - ; opentelemetry-exporter-datadog py3{5,6,7,8}-test-exporter-datadog @@ -93,18 +66,6 @@ envlist = py3{5,6,7,8}-test-instrumentation-mysql pypy3-test-instrumentation-mysql - ; opentelemetry-exporter-opencensus - py3{5,6,7,8}-test-exporter-opencensus - ; exporter-opencensus intentionally excluded from pypy3 - - ; opentelemetry-exporter-otlp - py3{5,6,7,8}-test-exporter-otlp - ; exporter-otlp intentionally excluded from pypy3 - - ; opentelemetry-exporter-prometheus - py3{5,6,7,8}-test-exporter-prometheus - pypy3-test-exporter-prometheus - ; opentelemetry-instrumentation-psycopg2 py3{5,6,7,8}-test-instrumentation-psycopg2 ; ext-psycopg2 intentionally excluded from pypy3 @@ -141,14 +102,6 @@ envlist = py3{5,6,7,8}-test-instrumentation-wsgi pypy3-test-instrumentation-wsgi - ; opentelemetry-exporter-zipkin - py3{5,6,7,8}-test-exporter-zipkin - pypy3-test-exporter-zipkin - - ; opentelemetry-opentracing-shim - py3{5,6,7,8}-test-core-opentracing-shim - pypy3-test-core-opentracing-shim - ; opentelemetry-instrumentation-grpc py3{5,6,7,8}-test-instrumentation-grpc @@ -175,9 +128,6 @@ envlist = pypy3-test-instrumentation-tornado lint - py38-tracecontext - py38-{mypy,mypyinstalled} - docs docker-tests [testenv] @@ -186,7 +136,6 @@ deps = test: pytest coverage: pytest coverage: pytest-cov - mypy,mypyinstalled: mypy elasticsearch2: elasticsearch-dsl>=2.0,<3.0 elasticsearch2: elasticsearch>=2.0,<3.0 elasticsearch5: elasticsearch-dsl>=5.0,<6.0 @@ -199,16 +148,7 @@ deps = ; FIXME: add coverage testing ; FIXME: add mypy testing -setenv = mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/ - changedir = - test-core-api: opentelemetry-api/tests - test-core-sdk: opentelemetry-sdk/tests - test-core-proto: opentelemetry-proto/tests - test-core-instrumentation: opentelemetry-instrumentation/tests - test-core-getting-started: docs/getting_started/tests - test-core-opentracing-shim: instrumentation/opentelemetry-instrumentation-opentracing-shim/tests - test-instrumentation-aiohttp-client: instrumentation/opentelemetry-instrumentation-aiohttp-client/tests test-instrumentation-aiopg: instrumentation/opentelemetry-instrumentation-aiopg/tests test-instrumentation-asgi: instrumentation/opentelemetry-instrumentation-asgi/tests @@ -218,7 +158,6 @@ changedir = test-instrumentation-celery: instrumentation/opentelemetry-instrumentation-celery/tests test-instrumentation-dbapi: instrumentation/opentelemetry-instrumentation-dbapi/tests test-instrumentation-django: instrumentation/opentelemetry-instrumentation-django/tests - test-instrumentation-example-app: docs/examples/opentelemetry-example-app/tests test-instrumentation-elasticsearch{2,5,6,7}: instrumentation/opentelemetry-instrumentation-elasticsearch/tests test-instrumentation-falcon: instrumentation/opentelemetry-instrumentation-falcon/tests test-instrumentation-fastapi: instrumentation/opentelemetry-instrumentation-fastapi/tests @@ -240,27 +179,17 @@ changedir = test-instrumentation-tornado: instrumentation/opentelemetry-instrumentation-tornado/tests test-instrumentation-wsgi: instrumentation/opentelemetry-instrumentation-wsgi/tests - test-exporter-jaeger: exporter/opentelemetry-exporter-jaeger/tests test-exporter-datadog: exporter/opentelemetry-exporter-datadog/tests - test-exporter-opencensus: exporter/opentelemetry-exporter-opencensus/tests - test-exporter-otlp: exporter/opentelemetry-exporter-otlp/tests - test-exporter-prometheus: exporter/opentelemetry-exporter-prometheus/tests - test-exporter-zipkin: exporter/opentelemetry-exporter-zipkin/tests commands_pre = ; Install without -e to test the actual installation py3{5,6,7,8}: python -m pip install -U pip setuptools wheel ; Install common packages for all the tests. These are not needed in all the ; cases but it saves a lot of boilerplate in this file. - test: pip install {toxinidir}/opentelemetry-api {toxinidir}/opentelemetry-sdk {toxinidir}/tests/util - - test-core-proto: pip install {toxinidir}/opentelemetry-proto - instrumentation: pip install {toxinidir}/opentelemetry-instrumentation - - example-app: pip install {toxinidir}/opentelemetry-instrumentation {toxinidir}/instrumentation/opentelemetry-instrumentation-requests {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi {toxinidir}/instrumentation/opentelemetry-instrumentation-flask {toxinidir}/docs/examples/opentelemetry-example-app - - getting-started: pip install -e {toxinidir}/opentelemetry-instrumentation -e {toxinidir}/instrumentation/opentelemetry-instrumentation-requests -e {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi -e {toxinidir}/instrumentation/opentelemetry-instrumentation-flask + test: pip install {toxinidir}/opentelemetry-python-core/opentelemetry-api {toxinidir}/opentelemetry-python-core/opentelemetry-sdk {toxinidir}/opentelemetry-python-core/tests/util + test: pip install {toxinidir}/opentelemetry-python-core/opentelemetry-instrumentation + celery: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-celery[test] grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] @@ -287,13 +216,6 @@ commands_pre = mysql: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql[test] - opencensus: pip install {toxinidir}/exporter/opentelemetry-exporter-opencensus - - otlp: pip install {toxinidir}/opentelemetry-proto - otlp: pip install {toxinidir}/exporter/opentelemetry-exporter-otlp - - prometheus: pip install {toxinidir}/exporter/opentelemetry-exporter-prometheus - pymemcache: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache[test] pymongo: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test] @@ -316,49 +238,40 @@ commands_pre = jinja2: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2[test] - aiohttp-client: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client + aiohttp-client: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client aiopg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg[test] - jaeger: pip install {toxinidir}/exporter/opentelemetry-exporter-jaeger - - opentracing-shim: pip install {toxinidir}/opentelemetry-sdk - opentracing-shim: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-opentracing-shim - - datadog: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/exporter/opentelemetry-exporter-datadog - - zipkin: pip install {toxinidir}/exporter/opentelemetry-exporter-zipkin + datadog: pip install {toxinidir}/exporter/opentelemetry-exporter-datadog sqlalchemy: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy system-metrics: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics[test] - elasticsearch{2,5,6,7}: pip install {toxinidir}/opentelemetry-instrumentation {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test] + elasticsearch{2,5,6,7}: pip install {toxinidir}/opentelemetry-python-core/opentelemetry-instrumentation {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test] ; In order to get a healthy coverage report, ; we have to install packages in editable mode. coverage: python {toxinidir}/scripts/eachdist.py install --editable -; Using file:// here because otherwise tox invokes just "pip install -; opentelemetry-api", leading to an error - mypyinstalled: pip install file://{toxinidir}/opentelemetry-api/ - commands = test: pytest {posargs} coverage: {toxinidir}/scripts/coverage.sh - mypy: mypy --namespace-packages opentelemetry-api/src/opentelemetry/ -; For test code, we don't want to enforce the full mypy strictness - mypy: mypy --namespace-packages --config-file=mypy-relaxed.ini opentelemetry-api/tests/ - -; Test that mypy can pick up typeinfo from an installed package (otherwise, -; implicit Any due to unfollowed import would result). - mypyinstalled: mypy --namespace-packages opentelemetry-api/tests/mypysmoke.py --strict - [testenv:lint] basepython: python3.8 recreate = True deps = + -e {toxinidir}/opentelemetry-python-core/opentelemetry-proto + -e {toxinidir}/opentelemetry-python-core/opentelemetry-api + -e {toxinidir}/opentelemetry-python-core/opentelemetry-sdk + -e {toxinidir}/opentelemetry-python-core/opentelemetry-instrumentation + -e {toxinidir}/opentelemetry-python-core/opentelemetry-proto + -e {toxinidir}/opentelemetry-python-core/tests/util + -e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-jaeger + -e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-zipkin + -e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-prometheus + -e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-otlp -c dev-requirements.txt pylint flake8 @@ -374,40 +287,6 @@ commands_pre = commands = python scripts/eachdist.py lint --check-only -[testenv:docs] -deps = - -c {toxinidir}/dev-requirements.txt - -r {toxinidir}/docs-requirements.txt - -commands_pre = - pip install -e {toxinidir}/opentelemetry-api \ - -e {toxinidir}/opentelemetry-sdk - -changedir = docs - -commands = - sphinx-build -E -a -W -b html -T . _build/html - -[testenv:py38-tracecontext] -basepython: python3.8 -deps = - # needed for tracecontext - aiohttp~=3.6 - # needed for example trace integration - flask~=1.1 - requests~=2.7 - -commands_pre = - pip install -e {toxinidir}/opentelemetry-api \ - -e {toxinidir}/opentelemetry-sdk \ - -e {toxinidir}/opentelemetry-instrumentation \ - -e {toxinidir}/instrumentation/opentelemetry-instrumentation-requests \ - -e {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi \ - -e {toxinidir}/instrumentation/opentelemetry-instrumentation-flask - -commands = - {toxinidir}/scripts/tracecontext-integration-test.sh - [testenv:docker-tests] deps = pytest @@ -426,10 +305,10 @@ changedir = tests/opentelemetry-docker-tests/tests commands_pre = - pip install -e {toxinidir}/opentelemetry-api \ - -e {toxinidir}/opentelemetry-sdk \ - -e {toxinidir}/opentelemetry-instrumentation \ - -e {toxinidir}/tests/util \ + pip install -e {toxinidir}/opentelemetry-python-core/opentelemetry-api \ + -e {toxinidir}/opentelemetry-python-core/opentelemetry-sdk \ + -e {toxinidir}/opentelemetry-python-core/opentelemetry-instrumentation \ + -e {toxinidir}/opentelemetry-python-core/tests/util \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi \ @@ -441,7 +320,7 @@ commands_pre = -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-redis \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics \ - -e {toxinidir}/exporter/opentelemetry-exporter-opencensus + -e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-opencensus docker-compose up -d python check_availability.py commands = From 31945100803347ea5774a1a629b63c3bde768941 Mon Sep 17 00:00:00 2001 From: Nathaniel Ruiz Nowell Date: Tue, 3 Nov 2020 10:33:53 -0800 Subject: [PATCH 144/145] Add section on how to run tests --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 196865730..720c5e70e 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,18 @@ Maintainers ([@open-telemetry/python-maintainers](https://github.com/orgs/open-t *Find more about the maintainer role in [community repository](https://github.com/open-telemetry/community/blob/master/community-membership.md#maintainer).* +## Running Tests Locally + +1. Go to your Contrib repo directory. `cd ~/git/opentelemetry-python-contrib`. +2. Create a virtual env in your Contrib repo directory. `python3 -m venv my_test_venv`. +3. Activate your virtual env. `source my_test_venv/bin/activate`. +4. Clone the [OpenTelemetry Python](https://github.com/open-telemetry/opentelemetry-python) Python Core repo to a folder named `opentelemetry-python-core`. `git clone git@github.com:open-telemetry/opentelemetry-python.git opentelemetry-python-core`. +5. Change directory to the repo that was just cloned. `cd opentelemetry-python-core`. +6. Move the head of this repo to the hash you want your tests to use. This is currently the tag `v0.15b0` as seen in `.github/workflows/test.yml`. Use `git fetch --tags && git checkout v0.15b0`. +7. Go back to the root directory. `cd ../`. +8. Make sure you have `tox` installed. `pip install tox`. +9. Run tests for a package. (e.g. `tox -e test-instrumentation-flask`.) + ### Thanks to all the people who already contributed! From 5135b80c13e7cdd1e2fbcdc10059645f2104961e Mon Sep 17 00:00:00 2001 From: Nathaniel Ruiz Nowell Date: Tue, 3 Nov 2020 13:31:39 -0800 Subject: [PATCH 145/145] Working on lint tests --- .github/workflows/test.yml | 2 +- .isort.cfg | 2 +- .pylintrc | 2 +- eachdist.ini | 2 +- pyproject.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 390be30d0..382b9da34 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -83,4 +83,4 @@ jobs: path: .tox key: tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }} - name: run tox - run: tox -e ${{ matrix.tox-environment }} \ No newline at end of file + run: tox -e ${{ matrix.tox-environment }} diff --git a/.isort.cfg b/.isort.cfg index 732a341ca..47fc6468c 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -13,6 +13,6 @@ line_length=79 ; docs: https://github.com/timothycrosley/isort#multi-line-output-modes multi_line_output=3 skip=target -skip_glob=**/gen/*,.venv*/*,venv*/*,reference*/*,opentelemetry-python-core*/* +skip_glob=**/gen/*,.venv*/*,venv*/*,reference*/*,opentelemetry-python-core/* known_first_party=opentelemetry known_third_party=psutil,pytest,redis,redis_opentracing diff --git a/.pylintrc b/.pylintrc index c5e1f35db..6635fabbd 100644 --- a/.pylintrc +++ b/.pylintrc @@ -488,4 +488,4 @@ min-public-methods=2 # Exceptions that will emit a warning when being caught. Defaults to # "Exception". -overgeneral-exceptions=Exception \ No newline at end of file +overgeneral-exceptions=Exception diff --git a/eachdist.ini b/eachdist.ini index a157d7c0c..49671d8e2 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -21,4 +21,4 @@ subglob=*.py,tests/,test/,src/*,examples/* [testroots] extraroots=examples/*,tests/ -subglob=tests/,test/ \ No newline at end of file +subglob=tests/,test/ diff --git a/pyproject.toml b/pyproject.toml index bf26e291b..c222549a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ line-length = 79 exclude = ''' ( /( - reference| + reference| # original files from DataDog opentelemetry-python-core )/ )