Skip to content

Commit 04d5450

Browse files
committed
Merge branch 'main' into aiohttp-server-instrumentation
2 parents be9ccfc + ffc9334 commit 04d5450

File tree

168 files changed

+1739
-783
lines changed

Some content is hidden

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

168 files changed

+1739
-783
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

+40-2
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,72 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
### Fixed
11+
12+
- Update falcon instrumentation to follow semantic conventions
13+
([#1824](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1824))
14+
15+
### Added
16+
17+
- Make Flask request span attributes available for `start_span`.
18+
([#1784](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1784))
19+
- Fix falcon instrumentation's usage of Span Status to only set the description if the status code is ERROR.
20+
([#1840](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1840))
21+
- Instrument all httpx versions >= 0.18. ([#1748](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1748))
22+
- Fix `Invalid type NoneType for attribute X (opentelemetry-instrumentation-aws-lambda)` error when some attributes do not exist
23+
([#1780](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1780))
24+
- Add metric instrumentation for celery
25+
([#1679](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1679))
26+
- `opentelemetry-instrumentation-asgi` Add `http.server.response.size` metric
27+
([#1789](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1789))
28+
29+
## Version 1.18.0/0.39b0 (2023-05-10)
30+
1031
- `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))
1132
- Add request and response hooks for GRPC instrumentation (client only)
1233
([#1706](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1706))
1334
- `opentelemetry-instrumentation-pymemcache` Update instrumentation to support pymemcache >4
1435
([#1764](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1764))
36+
- `opentelemetry-instrumentation-confluent-kafka` Add support for higher versions of confluent_kafka
37+
([#1815](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1815))
1538

1639
### Added
1740

1841
- Expand sqlalchemy pool.name to follow the semantic conventions
1942
([#1778](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1778))
2043
- Add `excluded_urls` functionality to `urllib` and `urllib3` instrumentations
2144
([#1733](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1733))
22-
- Make Django request span attributes available for `start_span`.
45+
- Make Django request span attributes available for `start_span`.
2346
([#1730](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1730))
24-
- Make ASGI request span attributes available for `start_span`.
47+
- Make ASGI request span attributes available for `start_span`.
2548
([#1762](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1762))
2649
- `opentelemetry-instrumentation-celery` Add support for anonymous tasks.
2750
([#1407](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1407))
2851
- `opentelemetry-instrumentation-logging` Add `otelTraceSampled` to instrumetation-logging
2952
([#1773](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1773))
3053

54+
### Changed
55+
56+
- `opentelemetry-instrumentation-botocore` now uses the AWS X-Ray propagator by
57+
default
58+
([#1741](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1741))
3159

3260
### Fixed
3361

62+
- Fix redis db.statements to be sanitized by default
63+
([#1778](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1778))
3464
- Fix elasticsearch db.statement attribute to be sanitized by default
3565
([#1758](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1758))
3666
- Fix `AttributeError` when AWS Lambda handler receives a list event
3767
([#1738](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1738))
3868
- Fix `None does not implement middleware` error when there are no middlewares registered
3969
([#1766](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1766))
70+
- Fix Flask instrumentation to only close the span if it was created by the same request context.
71+
([#1692](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1692))
72+
73+
### Changed
74+
- Update HTTP server/client instrumentation span names to comply with spec
75+
([#1759](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1759)
4076

4177
## Version 1.17.0/0.38b0 (2023-03-22)
4278

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

126162
### Added
127163

164+
- `opentelemetry-resource-detector-container` Add support resource detection of container properties.
165+
([#1584](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1584))
128166
- `opentelemetry-instrumentation-pymysql` Add tests for commit() and rollback().
129167
([#1424](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1424))
130168
- `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

+3-2
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,13 @@ Meeting notes are available as a public [Google doc](https://docs.google.com/doc
9595
Approvers ([@open-telemetry/python-approvers](https://github.com/orgs/open-telemetry/teams/python-approvers)):
9696

9797
- [Aaron Abbott](https://github.com/aabmass), Google
98+
- [Jeremy Voss](https://github.com/jeremydvoss), Microsoft
9899
- [Sanket Mehta](https://github.com/sanketmehta28), Cisco
99100
- [Shalev Roda](https://github.com/shalevr), Cisco
100101

101102
Emeritus Approvers:
102103

103-
- [Hector Hernandez](https://github.com/hectorhdzg), Microsoft
104+
- [Héctor Hernández](https://github.com/hectorhdzg), Microsoft
104105
- [Yusuke Tsutsumi](https://github.com/toumorokoshi), Google
105106
- [Nathaniel Ruiz Nowell](https://github.com/NathanielRN), AWS
106107
- [Ashutosh Goel](https://github.com/ashu658), Cisco
@@ -111,12 +112,12 @@ Maintainers ([@open-telemetry/python-maintainers](https://github.com/orgs/open-t
111112

112113
- [Diego Hurtado](https://github.com/ocelotl), Lightstep
113114
- [Leighton Chen](https://github.com/lzchen), Microsoft
114-
- [Srikanth Chekuri](https://github.com/srikanthccv), signoz.io
115115

116116
Emeritus Maintainers:
117117

118118
- [Alex Boten](https://github.com/codeboten), Lightstep
119119
- [Owais Lone](https://github.com/owais), Splunk
120+
- [Srikanth Chekuri](https://github.com/srikanthccv), signoz.io
120121

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

_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

+1-1
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

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"

instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ classifiers = [
2626
]
2727
dependencies = [
2828
"opentelemetry-api ~= 1.12",
29-
"opentelemetry-instrumentation == 0.39b0.dev",
30-
"opentelemetry-semantic-conventions == 0.39b0.dev",
31-
"opentelemetry-util-http == 0.39b0.dev",
29+
"opentelemetry-instrumentation == 0.40b0.dev",
30+
"opentelemetry-semantic-conventions == 0.40b0.dev",
31+
"opentelemetry-util-http == 0.40b0.dev",
3232
"wrapt >= 1.0.0, < 2.0.0",
3333
]
3434

@@ -38,6 +38,7 @@ instruments = [
3838
]
3939
test = [
4040
"opentelemetry-instrumentation-aiohttp-client[instruments]",
41+
"http-server-mock"
4142
]
4243

4344
[project.entry-points.opentelemetry_instrumentor]

instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ async def on_request_start(
179179
return
180180

181181
http_method = params.method.upper()
182-
request_span_name = f"HTTP {http_method}"
182+
request_span_name = f"{http_method}"
183183
request_url = (
184184
remove_url_credentials(trace_config_ctx.url_filter(params.url))
185185
if callable(trace_config_ctx.url_filter)

instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/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)