Skip to content

Commit c062b0f

Browse files
authored
Merge branch 'main' into feature/add_pika_instrumentation
2 parents 7339ecb + 354bdc4 commit c062b0f

File tree

99 files changed

+816
-356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+816
-356
lines changed

.flake8

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[flake8]
22
ignore =
33
E501 # line too long, defer to black
4-
F401 # unused import, defer to pylint
54
W503 # allow line breaks before binary ops
65
W504 # allow line breaks after binary ops
76
E203 # allow whitespace before ':' (https://github.com/psf/black#slices)

.github/CODEOWNERS

+21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Code owners file.
22
# This file controls who is tagged for review for any given pull request.
3+
#
4+
# What is a "CODEOWNER"?
5+
#
6+
# A CODEOWNER lends their expertise to a specific package hosted by an OpenTelemetry repository.
7+
#
8+
# A CODEOWNER MUST:
9+
# - introduce themselves on the CNCF OTel Python channel: https://cloud-native.slack.com/archives/C01PD4HUVBL
10+
# - have enough knowledge of the corresponding instrumented library
11+
# - respond to issues
12+
# - fix failing unit tests or any other blockers to the CI/CD workflow
13+
# - update usage of `opentelemetry-python-core` APIs upon the introduction of breaking changes
14+
# - be a member of the OpenTelemetry community so that the `component-owners.yml` action to automatically assign CODEOWNERS to PRs works correctly.
15+
#
16+
317

418
# For anything not explicitly taken by someone else:
519
* @open-telemetry/opentelemetry-python-contrib-approvers
20+
21+
# Learn about CODEOWNERS file format:
22+
# https://help.github.com/en/articles/about-code-owners
23+
#
24+
# Learn about membership in OpenTelemetry community:
25+
# https://github.com/open-telemetry/community/blob/main/community-membership.md
26+
#

.github/component_owners.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
components:
2+
3+
sdk-extension/opentelemetry-sdk-extension-aws:
4+
- NathanielRN

.github/workflows/close-stale-issues.yml

-18
This file was deleted.
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This action assigns and requires approval from owners of components for
2+
# PRs that are open against those components. Components are defined as
3+
# individual paths within this repository.
4+
name: 'Component Owners'
5+
6+
on:
7+
pull_request_target:
8+
9+
jobs:
10+
run_self:
11+
runs-on: ubuntu-latest
12+
name: Auto Assign Owners
13+
# Don't fail tests if this workflow fails. Some pending issues:
14+
# - https://github.com/dyladan/component-owners/issues/8
15+
continue-on-error: true
16+
steps:
17+
- uses: dyladan/component-owners@main

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'release/*'
77
pull_request:
88
env:
9-
CORE_REPO_SHA: 9dc17e33bc083e38c1fd55b8ed6787caba8f54fe
9+
CORE_REPO_SHA: c49ad57bfe35cfc69bfa863d74058ca9bec55fc3
1010

1111
jobs:
1212
build:

CHANGELOG.md

+21-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.5.0-0.24b0...HEAD)
9+
- `opentelemetry-sdk-extension-aws` Release AWS Python SDK Extension as 1.0.0
10+
([#667](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/667))
11+
12+
### Added
13+
- `opentelemetry-instrumentation-elasticsearch` Added `response_hook` and `request_hook` callbacks
14+
([#670](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/670))
15+
16+
### Added
17+
- `opentelemetry-instrumentation-redis` added request_hook and response_hook callbacks passed as arguments to the instrument method.
18+
([#669](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/669))
19+
20+
### Changed
21+
- `opentelemetry-instrumentation-botocore` Unpatch botocore Endpoint.prepare_request on uninstrument
22+
([#664](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/664))
23+
- `opentelemetry-instrumentation-botocore` Fix span injection for lambda invoke
24+
([#663](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/663))
25+
26+
### Changed
27+
28+
- `opentelemetry-instrumentation-urllib3` Updated `_RequestHookT` with two additional fields - the request body and the request headers
29+
([#660](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/660))
930

1031
## [1.5.0-0.24b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.5.0-0.24b0) - 2021-08-26
1132

@@ -20,8 +41,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2041

2142
- `opentelemetry-instrumentation-fastapi` Allow instrumentation of newer FastAPI versions.
2243
([#602](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/602))
23-
24-
### Changed
2544
- Enable explicit `excluded_urls` argument in `opentelemetry-instrumentation-flask`
2645
([#604](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/604))
2746

CODEOWNERS

-13
This file was deleted.

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,24 @@ install](https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs)
6666
pip install -e ./instrumentation/opentelemetry-instrumentation-{integration}
6767
```
6868

69+
## Releasing
70+
71+
Maintainers aim to periodically release new versions of the packages in `opentelemetry-python-contrib`.
72+
73+
Contributions that enhance OTel for Python are welcome to be hosted upstream for the benefit of group collaboration. Maintainers will look for things like good documentation, good unit tests, and in general their own confidence when deciding to release a package with the stability guarantees that are implied with a `1.0` release.
74+
75+
To resolve this, members of the community are encouraged to commit to becoming a CODEOWNER for packages in `-contrib` that they feel experienced enough to maintain. CODEOWNERS can then follow the checklist below to release `-contrib` packages as 1.0 stable:
76+
77+
### Releasing a package as `1.0` stable
78+
79+
To release a package as `1.0` stable, the package:
80+
- SHOULD have a CODEOWNER. To become one, submit an issue and explain why you meet the responsibilities found in [CODEOWNERS](.github/CODEOWNERS).
81+
- MUST have unit tests that cover all supported versions of the instrumented library.
82+
- e.g. Instrumentation packages might use different techniques to instrument different major versions of python packages
83+
- MUST have clear documentation for non-obvious usages of the package
84+
- e.g. If an instrumentation package uses flags, a token as context, or parameters that are not typical of the `BaseInstrumentor` class, these are documented
85+
- After the release of `1.0`, a CODEOWNER may no longer feel like they have the bandwidth to meet the responsibilities of maintaining the package. That's not a problem at all, life happens! However, if that is the case, we ask that the CODEOWNER please raise an issue indicating that they would like to be removed as a CODEOWNER so that they don't get pinged on future PRs. Ultimately, we hope to use that issue to find a new CODEOWNER.
86+
6987
## Contributing
7088

7189
See [CONTRIBUTING.md](CONTRIBUTING.md)

_template/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"version.py",
2828
)
2929
PACKAGE_INFO = {}
30-
with open(VERSION_FILENAME) as f:
30+
with open(VERSION_FILENAME, encoding="utf-8") as f:
3131
exec(f.read(), PACKAGE_INFO)
3232

3333
setuptools.setup(

exporter/opentelemetry-exporter-datadog/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
BASE_DIR, "src", "opentelemetry", "exporter", "datadog", "version.py"
2222
)
2323
PACKAGE_INFO = {}
24-
with open(VERSION_FILENAME) as f:
24+
with open(VERSION_FILENAME, encoding="utf-8") as f:
2525
exec(f.read(), PACKAGE_INFO)
2626

2727
setuptools.setup(version=PACKAGE_INFO["__version__"])

exporter/opentelemetry-exporter-datadog/tests/test_datadog_exporter.py

+5
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414

1515
import itertools
1616
import logging
17+
import sys
1718
import time
1819
import unittest
1920
from unittest import mock
2021

2122
from ddtrace.internal.writer import AgentWriter
2223
from flaky import flaky
24+
from pytest import mark
2325

2426
from opentelemetry import trace as trace_api
2527
from opentelemetry.context import Context
@@ -469,6 +471,9 @@ def test_span_processor_dropped_spans(self):
469471
self.assertEqual(len(datadog_spans), 128)
470472
tracer_provider.shutdown()
471473

474+
@mark.skipif(
475+
sys.platform == "win32", reason="unreliable test on windows",
476+
)
472477
def test_span_processor_scheduled_delay(self):
473478
"""Test that spans are exported each schedule_delay_millis"""
474479
delay = 300

instrumentation/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
| Instrumentation | Supported Packages |
3+
| --------------- | ------------------ |
4+
| [opentelemetry-instrumentation-aiohttp-client](./opentelemetry-instrumentation-aiohttp-client) | aiohttp ~= 3.0 |
5+
| [opentelemetry-instrumentation-aiopg](./opentelemetry-instrumentation-aiopg) | aiopg >= 0.13.0, < 1.3.0 |
6+
| [opentelemetry-instrumentation-asgi](./opentelemetry-instrumentation-asgi) | asgiref ~= 3.0 |
7+
| [opentelemetry-instrumentation-asyncpg](./opentelemetry-instrumentation-asyncpg) | asyncpg >= 0.12.0 |
8+
| [opentelemetry-instrumentation-boto](./opentelemetry-instrumentation-boto) | boto~=2.0 |
9+
| [opentelemetry-instrumentation-botocore](./opentelemetry-instrumentation-botocore) | botocore ~= 1.0 |
10+
| [opentelemetry-instrumentation-celery](./opentelemetry-instrumentation-celery) | celery >= 4.0, < 6.0 |
11+
| [opentelemetry-instrumentation-dbapi](./opentelemetry-instrumentation-dbapi) | dbapi |
12+
| [opentelemetry-instrumentation-django](./opentelemetry-instrumentation-django) | django >= 1.10 |
13+
| [opentelemetry-instrumentation-elasticsearch](./opentelemetry-instrumentation-elasticsearch) | elasticsearch >= 2.0 |
14+
| [opentelemetry-instrumentation-falcon](./opentelemetry-instrumentation-falcon) | falcon ~= 2.0 |
15+
| [opentelemetry-instrumentation-fastapi](./opentelemetry-instrumentation-fastapi) | fastapi ~= 0.58 |
16+
| [opentelemetry-instrumentation-flask](./opentelemetry-instrumentation-flask) | flask >= 1.0, < 3.0 |
17+
| [opentelemetry-instrumentation-grpc](./opentelemetry-instrumentation-grpc) | grpcio ~= 1.27 |
18+
| [opentelemetry-instrumentation-httpx](./opentelemetry-instrumentation-httpx) | httpx >= 0.18.0, < 0.19.0 |
19+
| [opentelemetry-instrumentation-jinja2](./opentelemetry-instrumentation-jinja2) | jinja2~=2.7 |
20+
| [opentelemetry-instrumentation-logging](./opentelemetry-instrumentation-logging) | logging |
21+
| [opentelemetry-instrumentation-mysql](./opentelemetry-instrumentation-mysql) | mysql-connector-python ~= 8.0 |
22+
| [opentelemetry-instrumentation-psycopg2](./opentelemetry-instrumentation-psycopg2) | psycopg2 >= 2.7.3.1 |
23+
| [opentelemetry-instrumentation-pymemcache](./opentelemetry-instrumentation-pymemcache) | pymemcache ~= 1.3 |
24+
| [opentelemetry-instrumentation-pymongo](./opentelemetry-instrumentation-pymongo) | pymongo ~= 3.1 |
25+
| [opentelemetry-instrumentation-pymysql](./opentelemetry-instrumentation-pymysql) | PyMySQL ~= 0.10.1 |
26+
| [opentelemetry-instrumentation-pyramid](./opentelemetry-instrumentation-pyramid) | pyramid >= 1.7 |
27+
| [opentelemetry-instrumentation-redis](./opentelemetry-instrumentation-redis) | redis >= 2.6 |
28+
| [opentelemetry-instrumentation-requests](./opentelemetry-instrumentation-requests) | requests ~= 2.0 |
29+
| [opentelemetry-instrumentation-sklearn](./opentelemetry-instrumentation-sklearn) | scikit-learn ~= 0.24.0 |
30+
| [opentelemetry-instrumentation-sqlalchemy](./opentelemetry-instrumentation-sqlalchemy) | sqlalchemy |
31+
| [opentelemetry-instrumentation-sqlite3](./opentelemetry-instrumentation-sqlite3) | sqlite3 |
32+
| [opentelemetry-instrumentation-starlette](./opentelemetry-instrumentation-starlette) | starlette ~= 0.13.0 |
33+
| [opentelemetry-instrumentation-tornado](./opentelemetry-instrumentation-tornado) | tornado >= 6.0 |
34+
| [opentelemetry-instrumentation-urllib](./opentelemetry-instrumentation-urllib) | urllib |
35+
| [opentelemetry-instrumentation-urllib3](./opentelemetry-instrumentation-urllib3) | urllib3 >= 1.0.0, < 2.0.0 |
36+
| [opentelemetry-instrumentation-wsgi](./opentelemetry-instrumentation-wsgi) | wsgi |

instrumentation/opentelemetry-instrumentation-aiohttp-client/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"aiohttp_client",
4747
"version.py",
4848
)
49-
with open(VERSION_FILENAME) as f:
49+
with open(VERSION_FILENAME, encoding="utf-8") as f:
5050
exec(f.read(), PACKAGE_INFO)
5151

5252
PACKAGE_FILENAME = os.path.join(
@@ -57,7 +57,7 @@
5757
"aiohttp_client",
5858
"package.py",
5959
)
60-
with open(PACKAGE_FILENAME) as f:
60+
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
6161
exec(f.read(), PACKAGE_INFO)
6262

6363
# Mark any instruments/runtime dependencies as test dependencies as well.

instrumentation/opentelemetry-instrumentation-aiopg/setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ package_dir=
3939
packages=find_namespace:
4040
install_requires =
4141
opentelemetry-api ~= 1.3
42-
opentelemetry-semantic-conventions == 0.24b0
4342
opentelemetry-instrumentation-dbapi == 0.24b0
4443
opentelemetry-instrumentation == 0.24b0
4544
wrapt >= 1.0.0, < 2.0.0
4645

4746
[options.extras_require]
4847
test =
4948
opentelemetry-test == 0.24b0
49+
opentelemetry-semantic-conventions == 0.24b0
5050

5151
[options.packages.find]
5252
where = src

instrumentation/opentelemetry-instrumentation-aiopg/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
VERSION_FILENAME = os.path.join(
4242
BASE_DIR, "src", "opentelemetry", "instrumentation", "aiopg", "version.py"
4343
)
44-
with open(VERSION_FILENAME) as f:
44+
with open(VERSION_FILENAME, encoding="utf-8") as f:
4545
exec(f.read(), PACKAGE_INFO)
4646

4747
PACKAGE_FILENAME = os.path.join(
4848
BASE_DIR, "src", "opentelemetry", "instrumentation", "aiopg", "package.py"
4949
)
50-
with open(PACKAGE_FILENAME) as f:
50+
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
5151
exec(f.read(), PACKAGE_INFO)
5252

5353
# Mark any instruments/runtime dependencies as test dependencies as well.

instrumentation/opentelemetry-instrumentation-asgi/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
VERSION_FILENAME = os.path.join(
4242
BASE_DIR, "src", "opentelemetry", "instrumentation", "asgi", "version.py"
4343
)
44-
with open(VERSION_FILENAME) as f:
44+
with open(VERSION_FILENAME, encoding="utf-8") as f:
4545
exec(f.read(), PACKAGE_INFO)
4646

4747
PACKAGE_FILENAME = os.path.join(
4848
BASE_DIR, "src", "opentelemetry", "instrumentation", "asgi", "package.py"
4949
)
50-
with open(PACKAGE_FILENAME) as f:
50+
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
5151
exec(f.read(), PACKAGE_INFO)
5252

5353
# Mark any instruments/runtime dependencies as test dependencies as well.

instrumentation/opentelemetry-instrumentation-asyncpg/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"asyncpg",
4747
"version.py",
4848
)
49-
with open(VERSION_FILENAME) as f:
49+
with open(VERSION_FILENAME, encoding="utf-8") as f:
5050
exec(f.read(), PACKAGE_INFO)
5151

5252
PACKAGE_FILENAME = os.path.join(
@@ -57,7 +57,7 @@
5757
"asyncpg",
5858
"package.py",
5959
)
60-
with open(PACKAGE_FILENAME) as f:
60+
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
6161
exec(f.read(), PACKAGE_INFO)
6262

6363
# Mark any instruments/runtime dependencies as test dependencies as well.

instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838

3939
import asyncpg
4040
import wrapt
41-
from asyncpg import exceptions
4241

4342
from opentelemetry import trace
4443
from opentelemetry.instrumentation.asyncpg.package import _instruments

instrumentation/opentelemetry-instrumentation-boto/setup.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ install_requires =
4141
opentelemetry-api ~= 1.3
4242
opentelemetry-semantic-conventions == 0.24b0
4343
opentelemetry-instrumentation == 0.24b0
44-
opentelemetry-instrumentation-botocore == 0.24b0
4544

4645
[options.extras_require]
4746
test =

instrumentation/opentelemetry-instrumentation-boto/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
VERSION_FILENAME = os.path.join(
4242
BASE_DIR, "src", "opentelemetry", "instrumentation", "boto", "version.py"
4343
)
44-
with open(VERSION_FILENAME) as f:
44+
with open(VERSION_FILENAME, encoding="utf-8") as f:
4545
exec(f.read(), PACKAGE_INFO)
4646

4747
PACKAGE_FILENAME = os.path.join(
4848
BASE_DIR, "src", "opentelemetry", "instrumentation", "boto", "package.py"
4949
)
50-
with open(PACKAGE_FILENAME) as f:
50+
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
5151
exec(f.read(), PACKAGE_INFO)
5252

5353
# Mark any instruments/runtime dependencies as test dependencies as well.

instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
from opentelemetry.instrumentation.boto.version import __version__
5353
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
5454
from opentelemetry.instrumentation.utils import unwrap
55-
from opentelemetry.sdk.trace import Resource
5655
from opentelemetry.semconv.trace import SpanAttributes
5756
from opentelemetry.trace import SpanKind, get_tracer
5857

instrumentation/opentelemetry-instrumentation-botocore/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"botocore",
4747
"version.py",
4848
)
49-
with open(VERSION_FILENAME) as f:
49+
with open(VERSION_FILENAME, encoding="utf-8") as f:
5050
exec(f.read(), PACKAGE_INFO)
5151

5252
PACKAGE_FILENAME = os.path.join(
@@ -57,7 +57,7 @@
5757
"botocore",
5858
"package.py",
5959
)
60-
with open(PACKAGE_FILENAME) as f:
60+
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
6161
exec(f.read(), PACKAGE_INFO)
6262

6363
# Mark any instruments/runtime dependencies as test dependencies as well.

0 commit comments

Comments
 (0)