Skip to content

Commit df91aa5

Browse files
authored
Merge branch 'main' into intrument-mysqlclient
2 parents 746fd31 + db90ce3 commit df91aa5

File tree

185 files changed

+2943
-1079
lines changed

Some content is hidden

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

185 files changed

+2943
-1079
lines changed

.github/CODEOWNERS

+7-21
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
1-
# Code owners file.
2-
# 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-
#
1+
# This file is only used as a way to assign any change to the approvers team
2+
# except for a change in any of the instrumentations. The actual codeowners
3+
# of the instrumentations are in .github/component_owners.yml.
164

17-
18-
# For anything not explicitly taken by someone else:
5+
# Assigns any change to the approvers team...
196
* @open-telemetry/opentelemetry-python-contrib-approvers
207

8+
# ...except for changes in any instrumentation.
9+
/instrumentation
10+
2111
# Learn about CODEOWNERS file format:
2212
# 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

+14
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,23 @@ components:
4343

4444
instrumentation/opentelemetry-instrumentation-urllib:
4545
- shalevr
46+
- ocelotl
4647

4748
instrumentation/opentelemetry-instrumentation-urllib3:
4849
- shalevr
50+
- ocelotl
4951

5052
instrumentation/opentelemetry-instrumentation-sqlalchemy:
5153
- shalevr
54+
55+
instrumentation/opentelemetry-instrumentation-flask:
56+
- ocelotl
57+
58+
instrumentation/opentelemetry-instrumentation-jinja2:
59+
- ocelotl
60+
61+
instrumentation/opentelemetry-instrumentation-logging:
62+
- ocelotl
63+
64+
instrumentation/opentelemetry-instrumentation-requests:
65+
- ocelotl

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'release/*'
77
pull_request:
88
env:
9-
CORE_REPO_SHA: 2387b4465d930b020df79692a8097e1d54b66ec1
9+
CORE_REPO_SHA: e9530c5c548d08a6aaa56268d103f9beb00cd002
1010

1111
jobs:
1212
build:
@@ -24,7 +24,7 @@ jobs:
2424
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
2525
matrix:
2626
python-version: [ py37, py38, py39, py310, py311, pypy3 ]
27-
package: ["instrumentation", "distro", "exporter", "sdkextension", "propagator"]
27+
package: ["instrumentation", "distro", "exporter", "sdkextension", "propagator", "resource"]
2828
os: [ ubuntu-20.04 ]
2929
steps:
3030
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}

CHANGELOG.md

+63-6
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,94 @@ 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
9+
- `opentelemetry-instrumentation-asgi` Add `http.server.request.size` metric
10+
([#1867](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1867))
911

10-
- `opentelemetry-instrumentation-system-metrics` Add `process.` prefix to `runtime.memory`, `runtime.cpu.time`, and `runtime.gc_count`. Change `runtime.memory` from count to UpDownCounter. ([#1735](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1735))
12+
### Fixed
13+
14+
- Fix elastic-search instrumentation sanitization to support bulk queries
15+
([#1870](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1870))
16+
- Update falcon instrumentation to follow semantic conventions
17+
([#1824](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1824))
18+
- Fix sqlalchemy instrumentation wrap methods to accept sqlcommenter options
19+
([#1873](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1873))
20+
21+
### Added
22+
23+
- Add instrumentor support for mysqlclient
24+
([#1744](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1744))
25+
- Fix async redis clients not being traced correctly
26+
([#1830](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1830))
27+
- Make Flask request span attributes available for `start_span`.
28+
([#1784](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1784))
29+
- Fix falcon instrumentation's usage of Span Status to only set the description if the status code is ERROR.
30+
([#1840](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1840))
31+
- Instrument all httpx versions >= 0.18.
32+
([#1748](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1748))
33+
- Fix `Invalid type NoneType for attribute X (opentelemetry-instrumentation-aws-lambda)` error when some attributes do not exist
34+
([#1780](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1780))
35+
- Add metric instrumentation for celery
36+
([#1679](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1679))
37+
- `opentelemetry-instrumentation-asgi` Add `http.server.response.size` metric
38+
([#1789](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1789))
39+
- `opentelemetry-instrumentation-grpc` Allow gRPC connections via Unix socket
40+
([#1833](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1833))
41+
- Fix elasticsearch `Transport.perform_request` instrument wrap for elasticsearch >= 8
42+
([#1810](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1810))
43+
- `opentelemetry-instrumentation-urllib3` Add support for urllib3 version 2
44+
([#1879](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1879))
45+
- Add optional distro and configurator selection for auto-instrumentation
46+
([#1823](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1823))
47+
48+
## Version 1.18.0/0.39b0 (2023-05-10)
49+
50+
- Update runtime metrics to follow semantic conventions
51+
([#1735](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1735))
1152
- Add request and response hooks for GRPC instrumentation (client only)
1253
([#1706](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1706))
54+
- Fix memory leak in SQLAlchemy instrumentation where disposed `Engine` does not get garbage collected
55+
([#1771](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1771))
1356
- `opentelemetry-instrumentation-pymemcache` Update instrumentation to support pymemcache >4
1457
([#1764](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1764))
58+
- `opentelemetry-instrumentation-confluent-kafka` Add support for higher versions of confluent_kafka
59+
([#1815](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1815))
1560

1661
### Added
1762

1863
- Expand sqlalchemy pool.name to follow the semantic conventions
1964
([#1778](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1778))
2065
- Add `excluded_urls` functionality to `urllib` and `urllib3` instrumentations
2166
([#1733](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1733))
22-
- Make Django request span attributes available for `start_span`.
67+
- Make Django request span attributes available for `start_span`.
2368
([#1730](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1730))
24-
- Make ASGI request span attributes available for `start_span`.
69+
- Make ASGI request span attributes available for `start_span`.
2570
([#1762](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1762))
2671
- `opentelemetry-instrumentation-celery` Add support for anonymous tasks.
2772
([#1407](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1407))
2873
- `opentelemetry-instrumentation-logging` Add `otelTraceSampled` to instrumetation-logging
2974
([#1773](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1773))
30-
([#1407](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1407)
31-
- `opentelemetry-instrumentation-mysqlclient` Add instrumentor support for mysqlclient
32-
([#1744](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1744))
75+
76+
### Changed
77+
78+
- `opentelemetry-instrumentation-botocore` now uses the AWS X-Ray propagator by default
79+
([#1741](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1741))
3380

3481
### Fixed
3582

83+
- Fix redis db.statements to be sanitized by default
84+
([#1778](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1778))
3685
- Fix elasticsearch db.statement attribute to be sanitized by default
3786
([#1758](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1758))
3887
- Fix `AttributeError` when AWS Lambda handler receives a list event
3988
([#1738](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1738))
4089
- Fix `None does not implement middleware` error when there are no middlewares registered
4190
([#1766](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1766))
91+
- Fix Flask instrumentation to only close the span if it was created by the same request context.
92+
([#1692](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1692))
93+
94+
### Changed
95+
- Update HTTP server/client instrumentation span names to comply with spec
96+
([#1759](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1759))
4297

4398
## Version 1.17.0/0.38b0 (2023-03-22)
4499

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

128183
### Added
129184

185+
- `opentelemetry-resource-detector-container` Add support resource detection of container properties.
186+
([#1584](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1584))
130187
- `opentelemetry-instrumentation-pymysql` Add tests for commit() and rollback().
131188
([#1424](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1424))
132189
- `opentelemetry-instrumentation-fastapi` Add support for regular expression matching and sanitization of HTTP headers.

CONTRIBUTING.md

+11
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,17 @@ Open a pull request against the main `opentelemetry-python-contrib` repo.
124124
as `work-in-progress`, or mark it as [`draft`](https://github.blog/2019-02-14-introducing-draft-pull-requests/).
125125
* Make sure CLA is signed and CI is clear.
126126

127+
### How to Get PRs Reviewed
128+
129+
The maintainers and approvers of this repo are not experts in every instrumentation there is here.
130+
In fact each one of us knows enough about them to only review a few. Unfortunately it can be hard
131+
to find enough experts in every instrumentation to quickly review every instrumentation PR. The
132+
instrumentation experts are listed in `.github/component_owners.yml` with their corresponding files
133+
or directories that they own. The owners listed there will be notified when PRs that modify their
134+
files are opened.
135+
136+
If you are not getting reviews, please contact the respective owners directly.
137+
127138
### How to Get PRs Merged
128139

129140
A PR is considered to be **ready to merge** when:

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ depend on `opentelemetry-sdk` or another package that implements the API.
4949
**Please note** that these libraries are currently in _beta_, and shouldn't
5050
generally be used in production environments.
5151

52+
Unless explicitly stated otherwise, any instrumentation here for a particular library is not developed or maintained by the authors of such library.
53+
5254
The
5355
[`instrumentation/`](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation)
5456
directory includes OpenTelemetry instrumentation packages, which can be installed
@@ -95,12 +97,12 @@ Meeting notes are available as a public [Google doc](https://docs.google.com/doc
9597
Approvers ([@open-telemetry/python-approvers](https://github.com/orgs/open-telemetry/teams/python-approvers)):
9698

9799
- [Aaron Abbott](https://github.com/aabmass), Google
100+
- [Jeremy Voss](https://github.com/jeremydvoss), Microsoft
98101
- [Sanket Mehta](https://github.com/sanketmehta28), Cisco
99-
- [Shalev Roda](https://github.com/shalevr), Cisco
100102

101103
Emeritus Approvers:
102104

103-
- [Hector Hernandez](https://github.com/hectorhdzg), Microsoft
105+
- [Héctor Hernández](https://github.com/hectorhdzg), Microsoft
104106
- [Yusuke Tsutsumi](https://github.com/toumorokoshi), Google
105107
- [Nathaniel Ruiz Nowell](https://github.com/NathanielRN), AWS
106108
- [Ashutosh Goel](https://github.com/ashu658), Cisco
@@ -111,12 +113,13 @@ Maintainers ([@open-telemetry/python-maintainers](https://github.com/orgs/open-t
111113

112114
- [Diego Hurtado](https://github.com/ocelotl), Lightstep
113115
- [Leighton Chen](https://github.com/lzchen), Microsoft
114-
- [Srikanth Chekuri](https://github.com/srikanthccv), signoz.io
116+
- [Shalev Roda](https://github.com/shalevr), Cisco
115117

116118
Emeritus Maintainers:
117119

118120
- [Alex Boten](https://github.com/codeboten), Lightstep
119121
- [Owais Lone](https://github.com/owais), Splunk
122+
- [Srikanth Chekuri](https://github.com/srikanthccv), signoz.io
120123

121124
*Find more about the maintainer role in [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer).*
122125

_template/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.39b0.dev"
15+
__version__ = "0.40b0.dev"

dev-requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ bleach==4.1.0 # transient dependency for readme-renderer
1414
grpcio-tools==1.29.0
1515
mypy-protobuf>=1.23
1616
protobuf~=3.13
17-
markupsafe==2.0.1
17+
markupsafe>=2.0.1
1818
codespell==2.1.0
19-
requests==2.28.1
19+
requests==2.31.0
2020
ruamel.yaml==0.17.21

docs-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ boto~=2.0
2626
botocore~=1.0
2727
boto3~=1.0
2828
celery>=4.0
29-
confluent-kafka>= 1.8.2,< 2.0.0
29+
confluent-kafka>= 1.8.2,<= 2.2.0
3030
elasticsearch>=2.0,<9.0
3131
flask~=2.0
3232
falcon~=2.0

docs/conf.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@
5454
if isdir(join(sdk_ext, f))
5555
]
5656

57-
sys.path[:0] = exp_dirs + instr_dirs + sdk_ext_dirs + prop_dirs
57+
resource = "../resource"
58+
resource_dirs = [
59+
os.path.abspath("/".join(["../resource", f, "src"]))
60+
for f in listdir(resource)
61+
if isdir(join(resource, f))
62+
]
63+
sys.path[:0] = exp_dirs + instr_dirs + sdk_ext_dirs + prop_dirs + resource_dirs
5864

5965
# -- Project information -----------------------------------------------------
6066

docs/index.rst

+10-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Extensions
3333

3434
Visit `OpenTelemetry Registry <https://opentelemetry.io/registry/?s=python>`_ to
3535
find a lot of related projects like exporters, instrumentation libraries, tracer
36-
implementations, etc.
36+
implementations, resource, etc.
3737

3838
Installing Cutting Edge Packages
3939
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -51,6 +51,7 @@ install <https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs>
5151
pip install -e ./instrumentation/opentelemetry-instrumentation-flask
5252
pip install -e ./instrumentation/opentelemetry-instrumentation-botocore
5353
pip install -e ./sdk-extension/opentelemetry-sdk-extension-aws
54+
pip install -e ./resource/opentelemetry-resource-detector-container
5455
5556
5657
.. toctree::
@@ -85,6 +86,14 @@ install <https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs>
8586

8687
sdk-extension/**
8788

89+
.. toctree::
90+
:maxdepth: 2
91+
:caption: OpenTelemetry Resource Detectors
92+
:name: Resource Detectors
93+
:glob:
94+
95+
resource/**
96+
8897
Indices and tables
8998
------------------
9099

docs/resource/container/container.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
OpenTelemetry Python - Resource Detector for Containers
2+
=======================================================
3+
4+
.. automodule:: opentelemetry.resource.detector.container
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

eachdist.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ sortfirst=
1616
ext/*
1717

1818
[stable]
19-
version=1.18.0.dev
19+
version=1.19.0.dev
2020

2121
packages=
2222
opentelemetry-sdk
@@ -34,7 +34,7 @@ packages=
3434
opentelemetry-api
3535

3636
[prerelease]
37-
version=0.39b0.dev
37+
version=0.40b0.dev
3838

3939
packages=
4040
all

exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.39b0.dev"
15+
__version__ = "0.40b0.dev"

exporter/opentelemetry-exporter-richconsole/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ classifiers = [
2727
dependencies = [
2828
"opentelemetry-api ~= 1.12",
2929
"opentelemetry-sdk ~= 1.12",
30-
"opentelemetry-semantic-conventions == 0.39b0.dev",
30+
"opentelemetry-semantic-conventions == 0.40b0.dev",
3131
"rich>=10.0.0",
3232
]
3333

exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.39b0.dev"
15+
__version__ = "0.40b0.dev"

instrumentation/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
| [opentelemetry-instrumentation-boto3sqs](./opentelemetry-instrumentation-boto3sqs) | boto3 ~= 1.0 | No
1212
| [opentelemetry-instrumentation-botocore](./opentelemetry-instrumentation-botocore) | botocore ~= 1.0 | No
1313
| [opentelemetry-instrumentation-celery](./opentelemetry-instrumentation-celery) | celery >= 4.0, < 6.0 | No
14-
| [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka >= 1.8.2, < 2.0.0 | No
14+
| [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka >= 1.8.2, <= 2.2.0 | No
1515
| [opentelemetry-instrumentation-dbapi](./opentelemetry-instrumentation-dbapi) | dbapi | No
1616
| [opentelemetry-instrumentation-django](./opentelemetry-instrumentation-django) | django >= 1.10 | Yes
1717
| [opentelemetry-instrumentation-elasticsearch](./opentelemetry-instrumentation-elasticsearch) | elasticsearch >= 2.0 | No
@@ -42,5 +42,5 @@
4242
| [opentelemetry-instrumentation-tornado](./opentelemetry-instrumentation-tornado) | tornado >= 5.1.1 | Yes
4343
| [opentelemetry-instrumentation-tortoiseorm](./opentelemetry-instrumentation-tortoiseorm) | tortoise-orm >= 0.17.0 | No
4444
| [opentelemetry-instrumentation-urllib](./opentelemetry-instrumentation-urllib) | urllib | Yes
45-
| [opentelemetry-instrumentation-urllib3](./opentelemetry-instrumentation-urllib3) | urllib3 >= 1.0.0, < 2.0.0 | Yes
45+
| [opentelemetry-instrumentation-urllib3](./opentelemetry-instrumentation-urllib3) | urllib3 >= 1.0.0, < 3.0.0 | Yes
4646
| [opentelemetry-instrumentation-wsgi](./opentelemetry-instrumentation-wsgi) | wsgi | Yes

instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ instruments = [
3535
]
3636
test = [
3737
"opentelemetry-instrumentation-aio-pika[instruments]",
38-
"opentelemetry-test-utils == 0.39b0.dev",
38+
"opentelemetry-test-utils == 0.40b0.dev",
3939
"pytest",
4040
"wrapt >= 1.0.0, < 2.0.0",
4141
]

instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.39b0.dev"
15+
__version__ = "0.40b0.dev"

0 commit comments

Comments
 (0)