Skip to content

Commit 9b37b88

Browse files
committed
Merge branch 'main' into issue_2555
2 parents 5a841a7 + 4108d57 commit 9b37b88

File tree

8 files changed

+35
-18
lines changed

8 files changed

+35
-18
lines changed

Diff for: .github/workflows/generate_workflows_lib/src/generate_workflows_lib/misc.yml.j2

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ jobs:
2525
!contains(github.event.pull_request.labels.*.name, 'Skip generate-workflows')
2626
&& github.actor != 'opentelemetrybot'
2727
{%- endif %}
28+
{%- if job_data == "public-symbols-check" %}
29+
if: |
30+
!contains(github.event.pull_request.labels.*.name, 'Approve Public API check')
31+
&& github.actor != 'opentelemetrybot'
32+
{%- endif %}
2833
steps:
2934
- name: Checkout repo @ SHA - ${% raw %}{{ github.sha }}{% endraw %}
3035
uses: actions/checkout@v4

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
([#2750](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2750))
2727
- `opentelemetry-instrumentation-django` Fix regression - `http.target` re-added back to old semconv duration metrics
2828
([#2746](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2746))
29+
- `opentelemetry-instrumentation-asgi` do not set `url.full` attribute for server spans
30+
([#2735](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2735))
2931
- `opentelemetry-instrumentation-grpc` Fixes the issue with the gRPC instrumentation not working with the 1.63.0 and higher version of gRPC
3032
([#2483](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2484))
3133
- `opentelemetry-instrumentation-aws-lambda` Fixing w3c baggage support

Diff for: instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
aiohttp==3.9.4
1+
aiohttp==3.10.2
22
aiosignal==1.3.1
33
asgiref==3.7.2
44
async-timeout==4.0.3

Diff for: instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ async def request_handler(request):
468468
[
469469
(
470470
"GET",
471-
(StatusCode.ERROR, "ServerTimeoutError"),
471+
(StatusCode.ERROR, "SocketTimeoutError"),
472472
{
473473
SpanAttributes.HTTP_METHOD: "GET",
474474
SpanAttributes.HTTP_URL: f"http://{host}:{port}/test_timeout",

Diff for: instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
aiohttp==3.9.4
1+
aiohttp==3.10.2
22
aiosignal==1.3.1
33
asgiref==3.7.2
44
async-timeout==4.0.3

Diff for: instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,12 @@ def collect_request_attributes(
354354
result, path, path, query_string, sem_conv_opt_in_mode
355355
)
356356
if http_url:
357-
_set_http_url(
358-
result, remove_url_credentials(http_url), sem_conv_opt_in_mode
359-
)
360-
357+
if _report_old(sem_conv_opt_in_mode):
358+
_set_http_url(
359+
result,
360+
remove_url_credentials(http_url),
361+
_HTTPStabilityMode.DEFAULT,
362+
)
361363
http_method = scope.get("method", "")
362364
if http_method:
363365
_set_http_method(

Diff for: instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py

+8-11
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
SERVER_PORT,
5959
)
6060
from opentelemetry.semconv.attributes.url_attributes import (
61-
URL_FULL,
6261
URL_PATH,
6362
URL_QUERY,
6463
URL_SCHEME,
@@ -410,7 +409,6 @@ def validate_outputs(
410409
SERVER_ADDRESS: "127.0.0.1",
411410
NETWORK_PROTOCOL_VERSION: "1.0",
412411
URL_PATH: "/",
413-
URL_FULL: "http://127.0.0.1/",
414412
CLIENT_ADDRESS: "127.0.0.1",
415413
CLIENT_PORT: 32767,
416414
HTTP_RESPONSE_STATUS_CODE: 200,
@@ -447,7 +445,6 @@ def validate_outputs(
447445
SERVER_ADDRESS: "127.0.0.1",
448446
NETWORK_PROTOCOL_VERSION: "1.0",
449447
URL_PATH: "/",
450-
URL_FULL: "http://127.0.0.1/",
451448
CLIENT_ADDRESS: "127.0.0.1",
452449
CLIENT_PORT: 32767,
453450
HTTP_RESPONSE_STATUS_CODE: 200,
@@ -693,7 +690,6 @@ def update_expected_server(expected):
693690
{
694691
SERVER_ADDRESS: "0.0.0.0",
695692
SERVER_PORT: 80,
696-
URL_FULL: "http://0.0.0.0/",
697693
}
698694
)
699695
return expected
@@ -721,7 +717,6 @@ def update_expected_server(expected):
721717
SpanAttributes.HTTP_URL: "http://0.0.0.0/",
722718
SERVER_ADDRESS: "0.0.0.0",
723719
SERVER_PORT: 80,
724-
URL_FULL: "http://0.0.0.0/",
725720
}
726721
)
727722
return expected
@@ -1009,7 +1004,6 @@ def test_websocket_new_semconv(self):
10091004
SERVER_ADDRESS: self.scope["server"][0],
10101005
NETWORK_PROTOCOL_VERSION: self.scope["http_version"],
10111006
URL_PATH: self.scope["path"],
1012-
URL_FULL: f'{self.scope["scheme"]}://{self.scope["server"][0]}{self.scope["path"]}',
10131007
CLIENT_ADDRESS: self.scope["client"][0],
10141008
CLIENT_PORT: self.scope["client"][1],
10151009
HTTP_RESPONSE_STATUS_CODE: 200,
@@ -1095,7 +1089,6 @@ def test_websocket_both_semconv(self):
10951089
SERVER_ADDRESS: self.scope["server"][0],
10961090
NETWORK_PROTOCOL_VERSION: self.scope["http_version"],
10971091
URL_PATH: self.scope["path"],
1098-
URL_FULL: f'{self.scope["scheme"]}://{self.scope["server"][0]}{self.scope["path"]}',
10991092
CLIENT_ADDRESS: self.scope["client"][0],
11001093
CLIENT_PORT: self.scope["client"][1],
11011094
HTTP_RESPONSE_STATUS_CODE: 200,
@@ -1639,7 +1632,6 @@ def test_request_attributes_new_semconv(self):
16391632
SERVER_ADDRESS: "127.0.0.1",
16401633
URL_PATH: "/",
16411634
URL_QUERY: "foo=bar",
1642-
URL_FULL: "http://127.0.0.1/?foo=bar",
16431635
SERVER_PORT: 80,
16441636
URL_SCHEME: "http",
16451637
NETWORK_PROTOCOL_VERSION: "1.0",
@@ -1676,7 +1668,6 @@ def test_request_attributes_both_semconv(self):
16761668
SERVER_ADDRESS: "127.0.0.1",
16771669
URL_PATH: "/",
16781670
URL_QUERY: "foo=bar",
1679-
URL_FULL: "http://127.0.0.1/?foo=bar",
16801671
SERVER_PORT: 80,
16811672
URL_SCHEME: "http",
16821673
NETWORK_PROTOCOL_VERSION: "1.0",
@@ -1698,18 +1689,24 @@ def test_query_string_new_semconv(self):
16981689
self.scope,
16991690
_HTTPStabilityMode.HTTP,
17001691
)
1701-
self.assertEqual(attrs[URL_FULL], "http://127.0.0.1/?foo=bar")
1692+
self.assertEqual(attrs[URL_SCHEME], "http")
1693+
self.assertEqual(attrs[SERVER_ADDRESS], "127.0.0.1")
1694+
self.assertEqual(attrs[URL_PATH], "/")
1695+
self.assertEqual(attrs[URL_QUERY], "foo=bar")
17021696

17031697
def test_query_string_both_semconv(self):
17041698
self.scope["query_string"] = b"foo=bar"
17051699
attrs = otel_asgi.collect_request_attributes(
17061700
self.scope,
17071701
_HTTPStabilityMode.HTTP_DUP,
17081702
)
1709-
self.assertEqual(attrs[URL_FULL], "http://127.0.0.1/?foo=bar")
17101703
self.assertEqual(
17111704
attrs[SpanAttributes.HTTP_URL], "http://127.0.0.1/?foo=bar"
17121705
)
1706+
self.assertEqual(attrs[URL_SCHEME], "http")
1707+
self.assertEqual(attrs[SERVER_ADDRESS], "127.0.0.1")
1708+
self.assertEqual(attrs[URL_PATH], "/")
1709+
self.assertEqual(attrs[URL_QUERY], "foo=bar")
17131710

17141711
def test_query_string_percent_bytes(self):
17151712
self.scope["query_string"] = b"foo%3Dbar"

Diff for: instrumentation/opentelemetry-instrumentation-jinja2/tests/test_jinja2.py

+11
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,14 @@ def test_uninstrumented(self):
219219
self.assertEqual(len(spans), 0)
220220

221221
Jinja2Instrumentor().instrument()
222+
223+
def test_no_op_tracer_provider(self):
224+
self.memory_exporter.clear()
225+
Jinja2Instrumentor().uninstrument()
226+
Jinja2Instrumentor().instrument(
227+
tracer_provider=trace_api.NoOpTracerProvider()
228+
)
229+
template = jinja2.environment.Template("Hello {{name}}!")
230+
self.assertEqual(template.render(name="Jinja"), "Hello Jinja!")
231+
spans = self.memory_exporter.get_finished_spans()
232+
self.assertEqual(len(spans), 0)

0 commit comments

Comments
 (0)