Skip to content

Commit 8c91fa5

Browse files
authored
Merge branch 'main' into feature/asyncio-instrumentation
2 parents e596456 + 47caeab commit 8c91fa5

File tree

67 files changed

+145
-211
lines changed

Some content is hidden

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

67 files changed

+145
-211
lines changed

.github/workflows/instrumentations_0.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@ jobs:
1212
instrumentations-0:
1313
env:
1414
# We use these variables to convert between tox and GHA version literals
15-
py37: 3.7
1615
py38: 3.8
1716
py39: 3.9
1817
py310: "3.10"
1918
py311: "3.11"
20-
pypy3: pypy-3.7
19+
pypy3: pypy-3.8
2120
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}
2221
runs-on: ${{ matrix.os }}
2322
strategy:
2423
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
2524
matrix:
26-
python-version: [py37, py38, py39, py310, py311, pypy3]
25+
python-version: [py38, py39, py310, py311, pypy3]
2726
package:
2827
# Do not add more instrumentations here, add them in instrumentations_1.yml.
2928
# The reason for this separation of instrumentations into more than one YAML file is

.github/workflows/instrumentations_1.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@ jobs:
1212
instrumentations-1:
1313
env:
1414
# We use these variables to convert between tox and GHA version literals
15-
py37: 3.7
1615
py38: 3.8
1716
py39: 3.9
1817
py310: "3.10"
1918
py311: "3.11"
20-
pypy3: pypy-3.7
19+
pypy3: pypy-3.8
2120
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}
2221
runs-on: ${{ matrix.os }}
2322
strategy:
2423
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
2524
matrix:
26-
python-version: [py37, py38, py39, py310, py311, pypy3]
25+
python-version: [py38, py39, py310, py311, pypy3]
2726
package:
2827
- "urllib"
2928
- "urllib3v"

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
# next few steps publish to pypi
6767
- uses: actions/setup-python@v1
6868
with:
69-
python-version: '3.7'
69+
python-version: '3.8'
7070

7171
- name: Build wheels
7272
run: ./scripts/build.sh
@@ -202,4 +202,4 @@ jobs:
202202
gh pr create --title "$message" \
203203
--body "$body" \
204204
--head $branch \
205-
--base main
205+
--base main

CHANGELOG.md

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

88
## Unreleased
99

10+
- Drop uspport for 3.7
11+
([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2151))
1012
- `opentelemetry-resource-detector-azure` Added 10s timeout to VM Resource Detector
1113
([#2119](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2119))
14+
- `opentelemetry-instrumentation-asyncpg` Allow AsyncPGInstrumentor to be instantiated multiple times
15+
([#1791](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1791))
1216
- `opentelemetry-instrumentation-confluent-kafka` Add support for higher versions until 2.3.0 of confluent_kafka
1317
([#2132](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2132))
1418
- `opentelemetry-resource-detector-azure` Changed timeout to 4 seconds due to [timeout bug](https://github.com/open-telemetry/opentelemetry-python/issues/3644)

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ You can run `tox` with the following arguments:
4040
- `tox` to run all existing tox commands, including unit tests for all packages
4141
under multiple Python versions
4242
- `tox -e docs` to regenerate the API docs
43-
- `tox -e py37-test-instrumentation-aiopg` to e.g. run the aiopg instrumentation unit tests under a specific
43+
- `tox -e py311-test-instrumentation-aiopg` to e.g. run the aiopg instrumentation unit tests under a specific
4444
Python version
4545
- `tox -e spellcheck` to run a spellcheck on all the code
4646
- `tox -e lint` to run lint checks on all code

_template/pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dynamic = ["version"]
1212
description = "<REPLACE ME>"
1313
readme = "README.rst"
1414
license = "Apache-2.0"
15-
requires-python = ">=3.7"
15+
requires-python = ">=3.8"
1616
authors = [
1717
{ name = "OpenTelemetry Authors", email = "[email protected]" },
1818
]
@@ -22,7 +22,6 @@ classifiers = [
2222
"License :: OSI Approved :: Apache Software License",
2323
"Programming Language :: Python",
2424
"Programming Language :: Python :: 3",
25-
"Programming Language :: Python :: 3.7",
2625
"Programming Language :: Python :: 3.8",
2726
"Programming Language :: Python :: 3.9",
2827
"Programming Language :: Python :: 3.10",

exporter/opentelemetry-exporter-prometheus-remote-write/pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dynamic = ["version"]
99
description = "Prometheus Remote Write Metrics Exporter for OpenTelemetry"
1010
readme = "README.rst"
1111
license = "Apache-2.0"
12-
requires-python = ">=3.7"
12+
requires-python = ">=3.8"
1313
authors = [
1414
{ name = "OpenTelemetry Authors", email = "[email protected]" },
1515
]
@@ -19,7 +19,6 @@ classifiers = [
1919
"License :: OSI Approved :: Apache Software License",
2020
"Programming Language :: Python",
2121
"Programming Language :: Python :: 3",
22-
"Programming Language :: Python :: 3.7",
2322
"Programming Language :: Python :: 3.8",
2423
"Programming Language :: Python :: 3.9",
2524
"Programming Language :: Python :: 3.10",

exporter/opentelemetry-exporter-richconsole/pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "Rich Console Exporter for OpenTelemetry"
99
readme = "README.rst"
1010
license = "Apache-2.0"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
authors = [
1313
{ name = "OpenTelemetry Authors", email = "[email protected]" },
1414
]
@@ -18,7 +18,6 @@ classifiers = [
1818
"License :: OSI Approved :: Apache Software License",
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "OpenTelemetry Aio-pika instrumentation"
99
readme = "README.rst"
1010
license = "Apache-2.0"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
authors = [
1313
{ name = "OpenTelemetry Authors", email = "[email protected]" },
1414
]
@@ -18,7 +18,6 @@ classifiers = [
1818
"License :: OSI Approved :: Apache Software License",
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "OpenTelemetry aiohttp client instrumentation"
99
readme = "README.rst"
1010
license = "Apache-2.0"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
authors = [
1313
{ name = "OpenTelemetry Authors", email = "[email protected]" },
1414
]
@@ -18,7 +18,6 @@ classifiers = [
1818
"License :: OSI Approved :: Apache Software License",
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "Aiohttp server instrumentation for OpenTelemetry"
99
readme = "README.rst"
1010
license = "Apache-2.0"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
authors = [
1313
{ name = "OpenTelemetry Authors", email = "[email protected]"}
1414
]
@@ -18,7 +18,6 @@ classifiers = [
1818
"License :: OSI Approved :: Apache Software License",
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",

instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "OpenTelemetry aiopg instrumentation"
99
readme = "README.rst"
1010
license = "Apache-2.0"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
authors = [
1313
{ name = "OpenTelemetry Authors", email = "[email protected]" },
1414
]
@@ -18,7 +18,6 @@ classifiers = [
1818
"License :: OSI Approved :: Apache Software License",
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",

instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "ASGI instrumentation for OpenTelemetry"
99
readme = "README.rst"
1010
license = "Apache-2.0"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
authors = [
1313
{ name = "OpenTelemetry Authors", email = "[email protected]" },
1414
]
@@ -18,7 +18,6 @@ classifiers = [
1818
"License :: OSI Approved :: Apache Software License",
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",

instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "OpenTelemetry instrumentation for AsyncPG"
99
readme = "README.rst"
1010
license = "Apache-2.0"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
authors = [
1313
{ name = "OpenTelemetry Authors", email = "[email protected]" },
1414
]
@@ -18,7 +18,6 @@ classifiers = [
1818
"License :: OSI Approved :: Apache Software License",
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,13 @@ def _hydrate_span_from_args(connection, query, parameters) -> dict:
9696

9797

9898
class AsyncPGInstrumentor(BaseInstrumentor):
99+
100+
_leading_comment_remover = re.compile(r"^/\*.*?\*/")
101+
_tracer = None
102+
99103
def __init__(self, capture_parameters=False):
100104
super().__init__()
101105
self.capture_parameters = capture_parameters
102-
self._tracer = None
103-
self._leading_comment_remover = re.compile(r"^/\*.*?\*/")
104106

105107
def instrumentation_dependencies(self) -> Collection[str]:
106108
return _instruments

instrumentation/opentelemetry-instrumentation-asyncpg/tests/test_asyncpg_wrapper.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class TestAsyncPGInstrumentation(TestBase):
8-
def test_duplicated_instrumentation(self):
8+
def test_duplicated_instrumentation_can_be_uninstrumented(self):
99
AsyncPGInstrumentor().instrument()
1010
AsyncPGInstrumentor().instrument()
1111
AsyncPGInstrumentor().instrument()
@@ -16,6 +16,14 @@ def test_duplicated_instrumentation(self):
1616
hasattr(method, "_opentelemetry_ext_asyncpg_applied")
1717
)
1818

19+
def test_duplicated_instrumentation_works(self):
20+
first = AsyncPGInstrumentor()
21+
first.instrument()
22+
second = AsyncPGInstrumentor()
23+
second.instrument()
24+
self.assertIsNotNone(first._tracer)
25+
self.assertIsNotNone(second._tracer)
26+
1927
def test_duplicated_uninstrumentation(self):
2028
AsyncPGInstrumentor().instrument()
2129
AsyncPGInstrumentor().uninstrument()

instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "OpenTelemetry AWS Lambda instrumentation"
99
readme = "README.rst"
1010
license = "Apache-2.0"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
authors = [
1313
{ name = "OpenTelemetry Authors", email = "[email protected]" },
1414
]
@@ -18,7 +18,6 @@ classifiers = [
1818
"License :: OSI Approved :: Apache Software License",
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
]
2423
dependencies = [

instrumentation/opentelemetry-instrumentation-boto/pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "OpenTelemetry Boto instrumentation"
99
readme = "README.rst"
1010
license = "Apache-2.0"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
authors = [
1313
{ name = "OpenTelemetry Authors", email = "[email protected]" },
1414
]
@@ -18,7 +18,6 @@ classifiers = [
1818
"License :: OSI Approved :: Apache Software License",
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",

instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "Boto3 SQS service tracing for OpenTelemetry"
99
readme = "README.rst"
1010
license = "Apache-2.0"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
authors = [
1313
{ name = "OpenTelemetry Authors", email = "[email protected]" },
1414
]
@@ -18,7 +18,6 @@ classifiers = [
1818
"License :: OSI Approved :: Apache Software License",
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",

instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "OpenTelemetry Botocore instrumentation"
99
readme = "README.rst"
1010
license = "Apache-2.0"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
authors = [
1313
{ name = "OpenTelemetry Authors", email = "[email protected]" },
1414
]
@@ -18,7 +18,6 @@ classifiers = [
1818
"License :: OSI Approved :: Apache Software License",
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",

instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "OpenTelemetry Cassandra instrumentation"
99
readme = "README.rst"
1010
license = "Apache-2.0"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
authors = [
1313
{ name = "OpenTelemetry Authors", email = "[email protected]" },
1414
]
@@ -18,7 +18,6 @@ classifiers = [
1818
"License :: OSI Approved :: Apache Software License",
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",

instrumentation/opentelemetry-instrumentation-celery/pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "OpenTelemetry Celery Instrumentation"
99
readme = "README.rst"
1010
license = "Apache-2.0"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
authors = [
1313
{ name = "OpenTelemetry Authors", email = "[email protected]" },
1414
]
@@ -18,7 +18,6 @@ classifiers = [
1818
"License :: OSI Approved :: Apache Software License",
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",

instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "OpenTelemetry Confluent Kafka instrumentation"
99
readme = "README.rst"
1010
license = "Apache-2.0"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
authors = [
1313
{ name = "OpenTelemetry Authors", email = "[email protected]" },
1414
]
@@ -18,7 +18,6 @@ classifiers = [
1818
"License :: OSI Approved :: Apache Software License",
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",

0 commit comments

Comments
 (0)