Skip to content

Commit f428bcb

Browse files
committed
add releasenote
change to False by default
1 parent 507c497 commit f428bcb

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

ddtrace/contrib/internal/asgi/middleware.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
service_name=config._get_service(default="asgi"),
3737
request_span_name="asgi.request",
3838
distributed_tracing=True,
39-
_trace_asgi_websocket=asbool(os.getenv("DD_ASGI_TRACE_WEBSOCKET", default=False)),
4039
# TODO: set as initially false until we gradually release feature
4140
_trace_asgi_websocket_messages=asbool(os.getenv("DD_TRACE_WEBSOCKET_MESSAGES_ENABLED", default=True)),
4241
_asgi_websockets_inherit_sampling=asbool(
@@ -139,7 +138,7 @@ async def __call__(self, scope, receive, send):
139138
if scope["type"] == "http":
140139
method = scope["method"]
141140
elif scope["type"] == "websocket":
142-
if not self.integration_config._trace_asgi_websocket:
141+
if not self.integration_config._trace_asgi_websocket_messages:
143142
return await self.app(scope, receive, send)
144143

145144
method = "websocket"

ddtrace/contrib/internal/django/patch.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@
8181
),
8282
use_handler_resource_format=asbool(os.getenv("DD_DJANGO_USE_HANDLER_RESOURCE_FORMAT", default=False)),
8383
use_legacy_resource_format=asbool(os.getenv("DD_DJANGO_USE_LEGACY_RESOURCE_FORMAT", default=False)),
84-
_trace_asgi_websocket=_get_config("DD_ASGI_TRACE_WEBSOCKET", False, asbool),
85-
_trace_asgi_websocket_messages=_get_config("DD_TRACE_WEBSOCKET_MESSAGES_ENABLED", True, asbool),
84+
_trace_asgi_websocket_messages=_get_config("DD_TRACE_WEBSOCKET_MESSAGES_ENABLED", False, asbool),
8685
_asgi_websockets_inherit_sampling=_get_config("DD_TRACE_WEBSOCKET_MESSAGES_INHERIT_SAMPLING", True, asbool),
8786
_websocket_messages_separate=_get_config("DD_TRACE_WEBSOCKET_MESSAGES_SEPARATE_TRACES", True, asbool),
8887
),

ddtrace/contrib/internal/fastapi/patch.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
request_span_name="fastapi.request",
2727
distributed_tracing=True,
2828
trace_query_string=None, # Default to global config
29-
_trace_asgi_websocket=_get_config("DD_ASGI_TRACE_WEBSOCKET", False, asbool),
30-
_trace_asgi_websocket_messages=_get_config("DD_TRACE_WEBSOCKET_MESSAGES_ENABLED", True, asbool),
29+
_trace_asgi_websocket_messages=_get_config("DD_TRACE_WEBSOCKET_MESSAGES_ENABLED", False, asbool),
3130
_asgi_websockets_inherit_sampling=_get_config("DD_TRACE_WEBSOCKET_MESSAGES_INHERIT_SAMPLING", True, asbool),
3231
_websocket_messages_separate=_get_config("DD_TRACE_WEBSOCKET_MESSAGES_SEPARATE_TRACES", True, asbool),
3332
),

ddtrace/contrib/internal/starlette/patch.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
_default_service=schematize_service_name("starlette"),
4141
request_span_name="starlette.request",
4242
distributed_tracing=True,
43-
_trace_asgi_websocket=_get_config("DD_ASGI_TRACE_WEBSOCKET", False, asbool),
4443
_trace_asgi_websocket_messages=_get_config("DD_TRACE_WEBSOCKET_MESSAGES_ENABLED", True, asbool),
4544
_asgi_websockets_inherit_sampling=_get_config("DD_TRACE_WEBSOCKET_MESSAGES_INHERIT_SAMPLING", True, asbool),
4645
_websocket_messages_separate=_get_config("DD_TRACE_WEBSOCKET_MESSAGES_SEPARATE_TRACES", True, asbool),
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
features:
3+
- |
4+
asgi: Adds tracing on websocket spans with `DD_TRACE_WEBSOCKET_MESSAGES_ENABLED`, which replaces `DD_TRACE_WEBSOCKET_MESSAGES`.

tests/contrib/fastapi/test_fastapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ def test_websocket_not_separate_traces(test_spans, snapshot_app):
616616
def test_long_running_websocket_session(test_spans, snapshot_app):
617617
client = TestClient(snapshot_app)
618618

619-
with override_config("fastapi", dict(_trace_asgi_websocket=True)):
619+
with override_config("fastapi", dict(_trace_asgi_websocket_messages=True)):
620620
with client.websocket_connect("/ws") as websocket:
621621
data = websocket.receive_json()
622622
assert data == {"test": "Hello WebSocket"}
@@ -637,7 +637,7 @@ def test_long_running_websocket_session(test_spans, snapshot_app):
637637
def test_websocket_sampling_inherited(test_spans, snapshot_app):
638638
client = TestClient(snapshot_app)
639639

640-
with override_config("fastapi", dict(_trace_asgi_websocket=True)):
640+
with override_config("fastapi", dict(_trace_asgi_websocket_messages=True)):
641641
with client.websocket_connect("/ws") as websocket:
642642
websocket.send_text("message")
643643
websocket.receive_text()

0 commit comments

Comments
 (0)