Skip to content

Commit ede7f2a

Browse files
authored
Merge branch 'open-telemetry:main' into main
2 parents f3d06fc + 6c2aa7f commit ede7f2a

File tree

52 files changed

+2017
-555
lines changed

Some content is hidden

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

52 files changed

+2017
-555
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,11 @@ body:
6464
options:
6565
- "No"
6666
- "Yes"
67+
68+
- type: dropdown
69+
attributes:
70+
label: Tip
71+
description: This element is static, used to render a helpful sub-heading for end-users and community members to help prioritize issues. Please leave as is.
72+
options:
73+
- <sub>[React](https://github.blog/news-insights/product-news/add-reactions-to-pull-requests-issues-and-comments/) with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it. Learn more [here](https://opentelemetry.io/community/end-user/issue-participation/).</sub>
74+
default: 0

.github/ISSUE_TEMPLATE/feature_request.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,11 @@ body:
4848
options:
4949
- "No"
5050
- "Yes"
51+
52+
- type: dropdown
53+
attributes:
54+
label: Tip
55+
description: This element is static, used to render a helpful sub-heading for end-users and community members to help prioritize issues. Please leave as is.
56+
options:
57+
- <sub>[React](https://github.blog/news-insights/product-news/add-reactions-to-pull-requests-issues-and-comments/) with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it. Learn more [here](https://opentelemetry.io/community/end-user/issue-participation/).</sub>
58+
default: 0

CHANGELOG.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,47 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Fixed
1515

16+
- `opentelemetry-instrumentation-fastapi`: Fix middleware ordering to cover all exception handling use cases.
17+
([#3664](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3664))
18+
- `opentelemetry-instrumentation-asgi`: Make all user hooks failsafe and record exceptions in hooks.
19+
([#3664](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3664))
1620
- `opentelemetry-instrumentation-fastapi`: Fix memory leak in `uninstrument_app()` by properly removing apps from the tracking set
17-
([#3688](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3688)
21+
([#3688](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3688))
1822
- `opentelemetry-instrumentation-tornado` Fix server (request) duration metric calculation
1923
([#3679](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3679))
24+
- `opentelemetry-instrumentation-tornado`: Fix to properly skip all server telemetry when URL excluded.
25+
([#3680](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3680))
2026
- `opentelemetry-instrumentation`: Avoid calls to `context.detach` with `None` token.
2127
([#3673](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3673))
28+
- `opentelemetry-instrumentation-starlette`/`opentelemetry-instrumentation-fastapi`: Fixes a crash when host-based routing is used
29+
([#3507](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3507))
30+
- Fix documentation order of sections and headers for Django, Flask, MySQL, mysqlclient, psycopg, psycopg2, pymysql, sqlalchemy instrumentations.
31+
([#3719](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3719))
32+
- `opentelemetry-instrumentation-asgi` Fixed an issue where FastAPI reports IP instead of URL.
33+
([#3670](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3670))
34+
- `opentelemetry-instrumentation-httpx`: fix missing metric response attributes when tracing is disabled
35+
([#3615](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3615))
36+
- `opentelemetry-instrumentation-fastapi`: Don't pass bounded server_request_hook when using `FastAPIInstrumentor.instrument()`
37+
([#3701](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3701))
2238

2339
### Added
2440

41+
- `opentelemetry-util-genai` Add a utility to parse the `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` environment variable.
42+
Add `gen_ai_latest_experimental` as a new value to the Sem Conv stability flag ([#3716](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3716)).
2543
- `opentelemetry-instrumentation-confluent-kafka` Add support for confluent-kafka <=2.11.0
2644
([#3685](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3685))
2745
- `opentelemetry-instrumentation-system-metrics`: Add `cpython.gc.collected_objects` and `cpython.gc.uncollectable_objects` metrics
2846
([#3666](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3666))
2947
- `opentelemetry-sdk-extension-aws` Add AWS X-Ray Remote Sampler with initial Rules Poller implementation
3048
([#3366](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3366))
49+
- `opentelemetry-instrumentation`: add support for `OTEL_PYTHON_AUTO_INSTRUMENTATION_EXPERIMENTAL_GEVENT_PATCH` to inform opentelemetry-instrument about gevent monkeypatching
50+
([#3699](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3699))
51+
- `opentelemetry-instrumentation`: botocore: Add support for AWS Step Functions semantic convention attributes
52+
([#3737](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3737))
53+
- `opentelemetry-instrumentation-botocore`: Add support for SNS semantic convention attribute aws.sns.topic.arn
54+
([#3734](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3734))
55+
- `opentelemetry-instrumentation`: botocore: upgrade moto package from 5.0.9 to 5.1.11
56+
([#3736](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3736))
3157

3258
## Version 1.36.0/0.57b0 (2025-07-29)
3359

instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/manual/main.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,22 @@
44
from openai import OpenAI
55

66
# NOTE: OpenTelemetry Python Logs and Events APIs are in beta
7-
from opentelemetry import _events, _logs, trace
7+
from opentelemetry import _events, _logs, metrics, trace
88
from opentelemetry.exporter.otlp.proto.grpc._log_exporter import (
99
OTLPLogExporter,
1010
)
11+
from opentelemetry.exporter.otlp.proto.grpc.metric_exporter import (
12+
OTLPMetricExporter,
13+
)
1114
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import (
1215
OTLPSpanExporter,
1316
)
1417
from opentelemetry.instrumentation.openai_v2 import OpenAIInstrumentor
1518
from opentelemetry.sdk._events import EventLoggerProvider
1619
from opentelemetry.sdk._logs import LoggerProvider
1720
from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
21+
from opentelemetry.sdk.metrics import MeterProvider
22+
from opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader
1823
from opentelemetry.sdk.trace import TracerProvider
1924
from opentelemetry.sdk.trace.export import BatchSpanProcessor
2025

@@ -31,6 +36,17 @@
3136
)
3237
_events.set_event_logger_provider(EventLoggerProvider())
3338

39+
# configure metrics
40+
metrics.set_meter_provider(
41+
MeterProvider(
42+
metric_readers=[
43+
PeriodicExportingMetricReader(
44+
OTLPMetricExporter(),
45+
),
46+
]
47+
)
48+
)
49+
3450
# instrument OpenAI
3551
OpenAIInstrumentor().instrument()
3652

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
openai~=1.57.3
22

3-
opentelemetry-sdk~=1.30.0
4-
opentelemetry-exporter-otlp-proto-grpc~=1.30.0
3+
opentelemetry-sdk~=1.36.0
4+
opentelemetry-exporter-otlp-proto-grpc~=1.36.0
55
opentelemetry-instrumentation-openai-v2~=2.1b0
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
openai~=1.57.3
22

3-
opentelemetry-sdk~=1.30.0
4-
opentelemetry-exporter-otlp-proto-grpc~=1.30.0
5-
opentelemetry-distro~=0.51b0
3+
opentelemetry-sdk~=1.36.0
4+
opentelemetry-exporter-otlp-proto-grpc~=1.36.0
5+
opentelemetry-distro~=0.57b0
66
opentelemetry-instrumentation-openai-v2~=2.1b0

instrumentation-genai/opentelemetry-instrumentation-vertexai/src/opentelemetry/instrumentation/vertexai/events.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# type: ignore[reportUnknownDeprecated]
16+
1517
"""
1618
Factories for event types described in
1719
https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-events.md#system-event.

instrumentation-genai/opentelemetry-instrumentation-vertexai/src/opentelemetry/instrumentation/vertexai/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# type: ignore[reportUnknownDeprecated]
16+
1517
from __future__ import annotations
1618

1719
import re

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

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,22 @@
1616
from aio_pika.abc import AbstractChannel, AbstractMessage
1717

1818
from opentelemetry.instrumentation.utils import is_instrumentation_enabled
19+
from opentelemetry.semconv._incubating.attributes.messaging_attributes import (
20+
MESSAGING_MESSAGE_ID,
21+
MESSAGING_OPERATION,
22+
MESSAGING_SYSTEM,
23+
)
24+
from opentelemetry.semconv._incubating.attributes.net_attributes import (
25+
NET_PEER_NAME,
26+
NET_PEER_PORT,
27+
)
1928
from opentelemetry.semconv.trace import (
2029
MessagingOperationValues,
2130
SpanAttributes,
2231
)
2332
from opentelemetry.trace import Span, SpanKind, Tracer
2433

25-
_DEFAULT_ATTRIBUTES = {SpanAttributes.MESSAGING_SYSTEM: "rabbitmq"}
34+
_DEFAULT_ATTRIBUTES = {MESSAGING_SYSTEM: "rabbitmq"}
2635

2736

2837
class SpanBuilder:
@@ -44,6 +53,8 @@ def set_operation(self, operation: MessagingOperationValues):
4453

4554
def set_destination(self, destination: str):
4655
self._destination = destination
56+
# TODO: Update this implementation once the semantic conventions for messaging stabilize
57+
# See: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/registry/attributes/messaging.md
4758
self._attributes[SpanAttributes.MESSAGING_DESTINATION] = destination
4859

4960
def set_channel(self, channel: AbstractChannel):
@@ -61,17 +72,15 @@ def set_channel(self, channel: AbstractChannel):
6172
url = connection.url
6273
self._attributes.update(
6374
{
64-
SpanAttributes.NET_PEER_NAME: url.host,
65-
SpanAttributes.NET_PEER_PORT: url.port or 5672,
75+
NET_PEER_NAME: url.host,
76+
NET_PEER_PORT: url.port or 5672,
6677
}
6778
)
6879

6980
def set_message(self, message: AbstractMessage):
7081
properties = message.properties
7182
if properties.message_id:
72-
self._attributes[SpanAttributes.MESSAGING_MESSAGE_ID] = (
73-
properties.message_id
74-
)
83+
self._attributes[MESSAGING_MESSAGE_ID] = properties.message_id
7584
if properties.correlation_id:
7685
self._attributes[SpanAttributes.MESSAGING_CONVERSATION_ID] = (
7786
properties.correlation_id
@@ -81,10 +90,10 @@ def build(self) -> Optional[Span]:
8190
if not is_instrumentation_enabled():
8291
return None
8392
if self._operation:
84-
self._attributes[SpanAttributes.MESSAGING_OPERATION] = (
85-
self._operation.value
86-
)
93+
self._attributes[MESSAGING_OPERATION] = self._operation.value
8794
else:
95+
# TODO: Update this implementation once the semantic conventions for messaging stabilize
96+
# See: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/registry/attributes/messaging.md
8897
self._attributes[SpanAttributes.MESSAGING_TEMP_DESTINATION] = True
8998
span = self._tracer.start_span(
9099
self._generate_span_name(),

instrumentation/opentelemetry-instrumentation-aio-pika/tests/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
AIOPIKA_VERSION_INFO = tuple(int(v) for v in aiopika_version.split("."))
77
MESSAGE_ID = "meesage_id"
88
CORRELATION_ID = "correlation_id"
9-
MESSAGING_SYSTEM = "rabbitmq"
9+
MESSAGING_SYSTEM_VALUE = "rabbitmq"
1010
EXCHANGE_NAME = "exchange_name"
1111
QUEUE_NAME = "queue_name"
1212
ROUTING_KEY = "routing_key"

0 commit comments

Comments
 (0)