Skip to content

Commit ddafd0c

Browse files
authored
Merge branch 'main' into exclude-opamp-dir-from-release
2 parents d0a37e5 + ba9267e commit ddafd0c

13 files changed

Lines changed: 50 additions & 24 deletions

File tree

.changelog/4601.added

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`opentelemetry-instrumentation-botocore`: loosen aiobotocore version constraints to allow for 3.x

.changelog/4666.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`opentelemetry-instrumentation-tornado`: reduce cardinality of `http.target` metrics attribute with old semantic conventions

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
-Add `gen_ai.usage.reasoning.output_tokens` attribute to capture thinking tokens on spans/events when the experimental sem conv flag is set. Add thinking tokens to output tokens. ([#4313](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4313))
1111
-Add `gen_ai.usage.cache_read.input_tokens` attribute to capture cached tokens on spans/events when the experimental sem conv flag is set. ([#4313](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4313))
1212

13+
## Version 0.7b1 (2026-05-19)
1314
## Version 0.7b0 (2026-02-20)
1415
- Fix bug in how tokens are counted when using the streaming `generateContent` method. ([#4152](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4152)).
1516
- Add `gen_ai.tool.definitions` attribute to `gen_ai.client.inference.operation.details` log event ([#4142](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4142)).

instrumentation-genai/opentelemetry-instrumentation-langchain/src/opentelemetry/instrumentation/langchain/callback_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def on_chat_model_start(
105105
for sub_messages in messages:
106106
for message in sub_messages:
107107
# Cast to Any to avoid type checking issues with LangChain's complex content type
108-
raw_content: Any = message.content # type: ignore[misc]
108+
raw_content: Any = message.content
109109
role = message.type
110110
parts: list[Text] = []
111111

instrumentation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
| [opentelemetry-instrumentation-asyncpg](./opentelemetry-instrumentation-asyncpg) | asyncpg >= 0.12.0 | No | development
1313
| [opentelemetry-instrumentation-aws-lambda](./opentelemetry-instrumentation-aws-lambda) | aws_lambda | No | development
1414
| [opentelemetry-instrumentation-boto3sqs](./opentelemetry-instrumentation-boto3sqs) | boto3 ~= 1.0 | No | development
15-
| [opentelemetry-instrumentation-botocore](./opentelemetry-instrumentation-botocore) | botocore~=1.0,aiobotocore~=2.0 | No | development
15+
| [opentelemetry-instrumentation-botocore](./opentelemetry-instrumentation-botocore) | botocore~=1.0,aiobotocore>=2.0,<4.0 | No | development
1616
| [opentelemetry-instrumentation-cassandra](./opentelemetry-instrumentation-cassandra) | cassandra-driver ~= 3.25,scylla-driver ~= 3.25 | No | development
1717
| [opentelemetry-instrumentation-celery](./opentelemetry-instrumentation-celery) | celery >= 4.0, < 6.0 | No | development
1818
| [opentelemetry-instrumentation-click](./opentelemetry-instrumentation-click) | click >= 8.1.3, < 9.0.0 | No | development

instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies = [
3636
instruments = []
3737
instruments-any = [
3838
"botocore ~= 1.0",
39-
"aiobotocore ~= 2.0",
39+
"aiobotocore >= 2.0, < 4.0"
4040
]
4141

4242
[project.entry-points.opentelemetry_instrumentor]

instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
_instruments_botocore = ("botocore~=1.0",)
5-
_instruments_aiobotocore = ("aiobotocore~=2.0",)
5+
_instruments_aiobotocore = ("aiobotocore>=2.0,<4.0",)
66

77
_instruments = ()
88
_instruments_any = (*_instruments_botocore, *_instruments_aiobotocore)

instrumentation/opentelemetry-instrumentation-botocore/test-requirements-3.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
asgiref==3.8.1
22
aws-xray-sdk==2.12.1
3-
boto3==1.35.16
4-
botocore==1.35.16
5-
aiobotocore==2.15.0
6-
aiohttp==3.9.3 #TODO: https://github.com/open-telemetry/opentelemetry-python-contrib/issues/4645 - fix issue with aiohttp in a better way.
3+
boto3==1.43.0
4+
botocore==1.43.0
5+
aiobotocore==3.7.0
76
certifi==2024.7.4
87
cffi==1.17.0
98
charset-normalizer==3.3.2
@@ -27,10 +26,10 @@ pytz==2024.1
2726
PyYAML==6.0.1
2827
requests==2.33.1
2928
responses==0.25.0
30-
s3transfer==0.10.0
29+
s3transfer==0.17.0
3130
six==1.16.0
3231
tomli==2.0.1
33-
typing_extensions==4.12.2
32+
typing_extensions==4.15.0
3433
urllib3==1.26.19
3534
Werkzeug==3.0.6
3635
wrapt==1.16.0

instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
from importlib.metadata import EntryPoint
66
from unittest.mock import ANY, Mock, call, patch
7+
from urllib.parse import urlparse
78

89
import botocore.session
910
from botocore.exceptions import ParamValidationError
@@ -342,7 +343,7 @@ def test_sts_client(self):
342343
span = self.assert_only_span()
343344
expected = self._default_span_attributes("STS", "GetCallerIdentity")
344345
expected["aws.request_id"] = ANY
345-
expected[SERVER_ADDRESS] = "sts.amazonaws.com"
346+
expected[SERVER_ADDRESS] = urlparse(sts.meta.endpoint_url).hostname
346347
# check for exact attribute set to make sure not to leak any sts secrets
347348
self.assertEqual(expected, dict(span.attributes))
348349

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ def _record_prepare_metrics(server_histograms, handler, sem_conv_opt_in_mode):
838838
request_size, attributes=metric_attributes_old
839839
)
840840
active_requests_attributes_old = (
841-
_create_active_requests_attributes_old(handler.request)
841+
_create_active_requests_attributes_old(handler)
842842
)
843843
server_histograms["active_requests"].add(
844844
1, attributes=active_requests_attributes_old
@@ -890,7 +890,7 @@ def _record_on_finish_metrics(
890890
)
891891

892892
active_requests_attributes_old = (
893-
_create_active_requests_attributes_old(handler.request)
893+
_create_active_requests_attributes_old(handler)
894894
)
895895
server_histograms["active_requests"].add(
896896
-1, attributes=active_requests_attributes_old
@@ -919,15 +919,21 @@ def _record_on_finish_metrics(
919919
)
920920

921921

922-
def _create_active_requests_attributes_old(request):
922+
def _create_active_requests_attributes_old(handler):
923923
"""Create metric attributes for active requests using old semconv."""
924+
request = handler.request
924925
metric_attributes = {
925926
HTTP_METHOD: request.method,
926927
HTTP_SCHEME: request.protocol,
927928
HTTP_FLAVOR: request.version,
928929
HTTP_HOST: request.host,
929930
}
930-
metric_attributes[HTTP_TARGET] = request.path
931+
932+
if rule := find_matched_rule(handler):
933+
route = route_from_rule(rule, handler)
934+
935+
if route is not None:
936+
metric_attributes[HTTP_TARGET] = route
931937
return metric_attributes
932938

933939

@@ -944,7 +950,7 @@ def _create_active_requests_attributes_new(request):
944950

945951
def _create_metric_attributes_old(handler):
946952
"""Create metric attributes using old semconv."""
947-
metric_attributes = _create_active_requests_attributes_old(handler.request)
953+
metric_attributes = _create_active_requests_attributes_old(handler)
948954
metric_attributes[HTTP_STATUS_CODE] = handler.get_status()
949955
return metric_attributes
950956

0 commit comments

Comments
 (0)