Skip to content

Commit 6f25fac

Browse files
committed
Merge remote-tracking branch 'origin/feature/valkey' into feature/valkey
2 parents abbc9cb + 2670aca commit 6f25fac

File tree

143 files changed

+1336
-562
lines changed

Some content is hidden

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

143 files changed

+1336
-562
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
1212
## Unreleased
1313

14+
## Version 1.33.0/0.54b0 (2025-05-09)
15+
1416
### Added
1517

1618
- `opentelemetry-instrumentation-valkey` Instrumentation for Valkey
1719
([#3478](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3478))
20+
- `opentelemetry-instrumentation-requests` Support explicit_bucket_boundaries_advisory in duration metrics
21+
([#3464](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3464))
22+
- `opentelemetry-instrumentation-redis` Add support for redis client-specific instrumentation.
23+
([#3143](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3143))
1824

1925
### Fixed
2026

@@ -31,6 +37,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3137
([#3380](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3381))
3238
- `opentelemetry-instrumentation-[asynclick/click]` Add missing opentelemetry-instrumentation dep
3339
([#3447](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3447))
40+
- `opentelemetry-instrumentation-botocore` Capture server attributes for botocore API calls
41+
([#3448](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3448))
42+
3443

3544
## Version 1.32.0/0.53b0 (2025-04-10)
3645

_template/version.py

Lines changed: 1 addition & 1 deletion
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.54b0.dev"
15+
__version__ = "0.55b0.dev"

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
"https://opentelemetry-python.readthedocs.io/en/latest/",
123123
None,
124124
),
125+
"redis": ("https://redis-py.readthedocs.io/en/latest/", None),
125126
}
126127

127128
# http://www.sphinx-doc.org/en/master/config.html#confval-nitpicky

docs/instrumentation/redis/redis.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
OpenTelemetry Redis Instrumentation
2-
===================================
1+
.. include:: ../../../instrumentation/opentelemetry-instrumentation-redis/README.rst
2+
:end-before: References
3+
4+
Usage
5+
-----
36

47
.. automodule:: opentelemetry.instrumentation.redis
58
:members:
69
:undoc-members:
7-
:show-inheritance:
10+
:show-inheritance:

eachdist.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ sortfirst=
1616
ext/*
1717

1818
[stable]
19-
version=1.33.0.dev
19+
version=1.34.0.dev
2020

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

3636
[prerelease]
37-
version=0.54b0.dev
37+
version=0.55b0.dev
3838

3939
packages=
4040
all

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

Lines changed: 1 addition & 1 deletion
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.54b0.dev"
15+
__version__ = "0.55b0.dev"

exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ asgiref==3.8.1
22
certifi==2024.7.4
33
charset-normalizer==3.3.2
44
# We can drop this after bumping baseline to pypy-39
5-
cramjam==2.1.0; platform_python_implementation == "PyPy"
5+
cramjam==2.8.0; platform_python_implementation == "PyPy"
66
cramjam==2.8.4; platform_python_implementation != "PyPy"
77
Deprecated==1.2.14
88
idna==3.7

exporter/opentelemetry-exporter-prometheus-remote-write/tests/test_prometheus_remote_write_exporter.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
import unittest
16+
from platform import python_implementation
1617
from unittest.mock import patch
1718

1819
import pytest
@@ -282,6 +283,10 @@ def test_invalid_tls_config_key_only_param(self):
282283
)
283284

284285

286+
@pytest.mark.skipif(
287+
python_implementation() == "PyPy",
288+
reason="Fails with pypy 3.8, bump cramjam when 3.9 is baseline",
289+
)
285290
# Ensures export is successful with valid export_records and config
286291
@patch("requests.post")
287292
def test_valid_export(mock_post, prom_rw, metric):

exporter/opentelemetry-exporter-richconsole/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ classifiers = [
2828
dependencies = [
2929
"opentelemetry-api ~= 1.12",
3030
"opentelemetry-sdk ~= 1.12",
31-
"opentelemetry-semantic-conventions == 0.54b0.dev",
31+
"opentelemetry-semantic-conventions == 0.55b0.dev",
3232
"rich>=10.0.0",
3333
]
3434

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@
6868

6969

7070
def _ns_to_time(nanoseconds):
71-
ts = datetime.datetime.utcfromtimestamp(nanoseconds / 1e9)
71+
ts = datetime.datetime.fromtimestamp(
72+
nanoseconds / 1e9, datetime.timezone.utc
73+
)
7274
return ts.strftime("%H:%M:%S.%f")
7375

7476

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

Lines changed: 1 addition & 1 deletion
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.54b0.dev"
15+
__version__ = "0.55b0.dev"

instrumentation-genai/opentelemetry-instrumentation-google-genai/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10-
## Version 0.2b0 (2025-04-25)
10+
## Version 0.2b0 (2025-04-28)
1111

1212
- Add more request configuration options to the span attributes ([#3374](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3374))
1313
- Restructure tests to keep in line with repository conventions ([#3344](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3344))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ classifiers = [
2727
]
2828
dependencies = [
2929
"opentelemetry-api ~= 1.5",
30-
"opentelemetry-instrumentation == 0.54b0.dev",
30+
"opentelemetry-instrumentation == 0.55b0.dev",
3131
"wrapt >= 1.0.0, < 2.0.0",
3232
]
3333

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

Lines changed: 1 addition & 1 deletion
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.54b0.dev"
15+
__version__ = "0.55b0.dev"

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ classifiers = [
2727
]
2828
dependencies = [
2929
"opentelemetry-api ~= 1.12",
30-
"opentelemetry-instrumentation == 0.54b0.dev",
31-
"opentelemetry-semantic-conventions == 0.54b0.dev",
32-
"opentelemetry-util-http == 0.54b0.dev",
30+
"opentelemetry-instrumentation == 0.55b0.dev",
31+
"opentelemetry-semantic-conventions == 0.55b0.dev",
32+
"opentelemetry-util-http == 0.55b0.dev",
3333
"wrapt >= 1.0.0, < 2.0.0",
3434
]
3535

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

Lines changed: 1 addition & 1 deletion
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.54b0.dev"
15+
__version__ = "0.55b0.dev"

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ classifiers = [
2727
]
2828
dependencies = [
2929
"opentelemetry-api ~= 1.12",
30-
"opentelemetry-instrumentation == 0.54b0.dev",
31-
"opentelemetry-semantic-conventions == 0.54b0.dev",
32-
"opentelemetry-util-http == 0.54b0.dev",
30+
"opentelemetry-instrumentation == 0.55b0.dev",
31+
"opentelemetry-semantic-conventions == 0.55b0.dev",
32+
"opentelemetry-util-http == 0.55b0.dev",
3333
"wrapt >= 1.0.0, < 2.0.0",
3434
]
3535

instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py

Lines changed: 1 addition & 1 deletion
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.54b0.dev"
15+
__version__ = "0.55b0.dev"

instrumentation/opentelemetry-instrumentation-aiokafka/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ classifiers = [
2727
]
2828
dependencies = [
2929
"opentelemetry-api ~= 1.27",
30-
"opentelemetry-instrumentation == 0.54b0.dev",
31-
"opentelemetry-semantic-conventions == 0.54b0.dev",
30+
"opentelemetry-instrumentation == 0.55b0.dev",
31+
"opentelemetry-semantic-conventions == 0.55b0.dev",
3232
]
3333

3434
[project.optional-dependencies]

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

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,35 @@
2020
2121
.. code:: python
2222
23+
import asyncio
2324
from opentelemetry.instrumentation.aiokafka import AIOKafkaInstrumentor
2425
from aiokafka import AIOKafkaProducer, AIOKafkaConsumer
2526
2627
# Instrument kafka
2728
AIOKafkaInstrumentor().instrument()
2829
2930
# report a span of type producer with the default settings
30-
producer = AIOKafkaProducer(bootstrap_servers=['localhost:9092'])
31-
await producer.send('my-topic', b'raw_bytes')
31+
async def produce():
32+
producer = AIOKafkaProducer(bootstrap_servers=['localhost:9092'])
33+
await producer.start()
34+
try:
35+
await producer.send_and_wait('my-topic', b'raw_bytes')
36+
finally:
37+
await producer.stop()
3238
3339
# report a span of type consumer with the default settings
34-
consumer = AIOKafkaConsumer('my-topic', group_id='my-group', bootstrap_servers=['localhost:9092'])
35-
async for message in consumer:
36-
# process message
40+
async def consume():
41+
consumer = AIOKafkaConsumer('my-topic', group_id='my-group', bootstrap_servers=['localhost:9092'])
42+
await consumer.start()
43+
try:
44+
async for message in consumer:
45+
# process message
46+
print(message)
47+
finally:
48+
await consumer.stop()
49+
50+
asyncio.run(produce())
51+
asyncio.run(consume())
3752
3853
The _instrument() method accepts the following keyword args:
3954
tracer_provider (TracerProvider) - an optional tracer provider
@@ -47,12 +62,14 @@ def async_consume_hook(span: Span, record: kafka.record.ABCRecord, args, kwargs)
4762
4863
.. code:: python
4964
50-
from opentelemetry.instrumentation.kafka import AIOKafkaInstrumentor
65+
import asyncio
66+
from opentelemetry.instrumentation.aiokafka import AIOKafkaInstrumentor
5167
from aiokafka import AIOKafkaProducer, AIOKafkaConsumer
5268
5369
async def async_produce_hook(span, args, kwargs):
5470
if span and span.is_recording():
5571
span.set_attribute("custom_user_attribute_from_async_response_hook", "some-value")
72+
5673
async def async_consume_hook(span, record, args, kwargs):
5774
if span and span.is_recording():
5875
span.set_attribute("custom_user_attribute_from_consume_hook", "some-value")
@@ -62,8 +79,15 @@ async def async_consume_hook(span, record, args, kwargs):
6279
6380
# Using kafka as normal now will automatically generate spans,
6481
# including user custom attributes added from the hooks
65-
producer = AIOKafkaProducer(bootstrap_servers=['localhost:9092'])
66-
await producer.send('my-topic', b'raw_bytes')
82+
async def produce():
83+
producer = AIOKafkaProducer(bootstrap_servers=['localhost:9092'])
84+
await producer.start()
85+
try:
86+
await producer.send_and_wait('my-topic', b'raw_bytes')
87+
finally:
88+
await producer.stop()
89+
90+
asyncio.run(produce())
6791
6892
API
6993
___

instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/version.py

Lines changed: 1 addition & 1 deletion
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.54b0.dev"
15+
__version__ = "0.55b0.dev"

instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ classifiers = [
2727
]
2828
dependencies = [
2929
"opentelemetry-api ~= 1.12",
30-
"opentelemetry-instrumentation == 0.54b0.dev",
31-
"opentelemetry-instrumentation-dbapi == 0.54b0.dev",
30+
"opentelemetry-instrumentation == 0.55b0.dev",
31+
"opentelemetry-instrumentation-dbapi == 0.55b0.dev",
3232
"wrapt >= 1.0.0, < 2.0.0",
3333
]
3434

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

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,40 +23,53 @@
2323
2424
.. code-block:: python
2525
26+
import asyncio
2627
import aiopg
2728
from opentelemetry.instrumentation.aiopg import AiopgInstrumentor
2829
# Call instrument() to wrap all database connections
2930
AiopgInstrumentor().instrument()
3031
31-
cnx = await aiopg.connect(database='Database')
32-
cursor = await cnx.cursor()
33-
await cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
34-
await cursor.execute("INSERT INTO test (testField) VALUES (123)")
35-
cursor.close()
36-
cnx.close()
32+
dsn = 'user=user password=password host=127.0.0.1'
3733
38-
pool = await aiopg.create_pool(database='Database')
34+
async def connect():
35+
cnx = await aiopg.connect(dsn)
36+
cursor = await cnx.cursor()
37+
await cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
38+
await cursor.execute("INSERT INTO test (testField) VALUES (123)")
39+
cursor.close()
40+
cnx.close()
3941
40-
cnx = await pool.acquire()
41-
cursor = await cnx.cursor()
42-
await cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
43-
await cursor.execute("INSERT INTO test (testField) VALUES (123)")
44-
cursor.close()
45-
cnx.close()
42+
async def create_pool():
43+
pool = await aiopg.create_pool(dsn)
44+
cnx = await pool.acquire()
45+
cursor = await cnx.cursor()
46+
await cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
47+
await cursor.execute("INSERT INTO test (testField) VALUES (123)")
48+
cursor.close()
49+
cnx.close()
50+
51+
asyncio.run(connect())
52+
asyncio.run(create_pool())
4653
4754
.. code-block:: python
4855
56+
import asyncio
4957
import aiopg
5058
from opentelemetry.instrumentation.aiopg import AiopgInstrumentor
5159
60+
dsn = 'user=user password=password host=127.0.0.1'
61+
5262
# Alternatively, use instrument_connection for an individual connection
53-
cnx = await aiopg.connect(database='Database')
54-
instrumented_cnx = AiopgInstrumentor().instrument_connection(cnx)
55-
cursor = await instrumented_cnx.cursor()
56-
await cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
57-
await cursor.execute("INSERT INTO test (testField) VALUES (123)")
58-
cursor.close()
59-
instrumented_cnx.close()
63+
async def go():
64+
cnx = await aiopg.connect(dsn)
65+
instrumented_cnx = AiopgInstrumentor().instrument_connection(cnx)
66+
cursor = await instrumented_cnx.cursor()
67+
await cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
68+
await cursor.execute("INSERT INTO test (testField) VALUES (123)")
69+
cursor.close()
70+
instrumented_cnx.close()
71+
72+
asyncio.run(go())
6073
6174
API
6275
---

instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py

Lines changed: 1 addition & 1 deletion
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.54b0.dev"
15+
__version__ = "0.55b0.dev"

instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ classifiers = [
2828
dependencies = [
2929
"asgiref ~= 3.0",
3030
"opentelemetry-api ~= 1.12",
31-
"opentelemetry-instrumentation == 0.54b0.dev",
32-
"opentelemetry-semantic-conventions == 0.54b0.dev",
33-
"opentelemetry-util-http == 0.54b0.dev",
31+
"opentelemetry-instrumentation == 0.55b0.dev",
32+
"opentelemetry-semantic-conventions == 0.55b0.dev",
33+
"opentelemetry-util-http == 0.55b0.dev",
3434
]
3535

3636
[project.optional-dependencies]

instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py

Lines changed: 1 addition & 1 deletion
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.54b0.dev"
15+
__version__ = "0.55b0.dev"

0 commit comments

Comments
 (0)