Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tracing): deprecate DD_TRACE_SPAN_AGGREGATOR_RLOCK #10725

Merged
merged 4 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ddtrace/settings/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,14 @@ def __init__(self):
self._ddtrace_bootstrapped = False
self._subscriptions = [] # type: List[Tuple[List[str], Callable[[Config, List[str]], None]]]
self._span_aggregator_rlock = asbool(os.getenv("DD_TRACE_SPAN_AGGREGATOR_RLOCK", True))
if self._span_aggregator_rlock is False:
deprecate(
"DD_TRACE_SPAN_AGGREGATOR_RLOCK is deprecated",
message="Soon the ddtrace library will only support using threading.Rlock to "
"aggregate and encode span data. If you need to disable the re-entrant lock and "
"revert to using threading.Lock, please contact Datadog support.",
removal_version="3.0.0",
)

self.trace_methods = os.getenv("DD_TRACE_METHODS")

Expand Down
8 changes: 0 additions & 8 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,6 @@ The following environment variables for the tracer are supported:
default: True
description: Send query strings in http.url tag in http server integrations.

DD_TRACE_SPAN_AGGREGATOR_RLOCK:
mabdinur marked this conversation as resolved.
Show resolved Hide resolved
type: Boolean
default: True
description: Whether the ``SpanAggregator`` should use an RLock or a Lock.
version_added:
v1.16.2: added with default of False
v1.19.0: default changed to True

DD_TRACE_METHODS:
type: String
default: ""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
deprecations:
- |
tracing: The ``DD_TRACE_SPAN_AGGREGATOR_RLOCK`` environment variable is deprecated and will be removed in a future version
mabdinur marked this conversation as resolved.
Show resolved Hide resolved
10 changes: 0 additions & 10 deletions tests/contrib/gunicorn/test_gunicorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def _gunicorn_settings_factory(
debug_mode=False, # type: bool
dd_service=None, # type: Optional[str]
schema_version=None, # type: Optional[str]
rlock=True, # type: bool
):
# type: (...) -> GunicornServerSettings
"""Factory for creating gunicorn settings with simple defaults if settings are not defined."""
Expand All @@ -75,8 +74,6 @@ def _gunicorn_settings_factory(
env["DD_SERVICE"] = dd_service
if schema_version is not None:
env["DD_TRACE_SPAN_ATTRIBUTE_SCHEMA"] = schema_version
if rlock is not None:
env["DD_TRACE_SPAN_AGGREGATOR_RLOCK"] = "true"
return GunicornServerSettings(
env=env,
directory=directory,
Expand Down Expand Up @@ -168,12 +165,6 @@ def gunicorn_server(gunicorn_server_settings, tmp_path):
debug_mode=True,
enable_module_cloning=True,
)
SETTINGS_GEVENT_SPANAGGREGATOR_NO_RLOCK = _gunicorn_settings_factory(
worker_class="gevent",
use_ddtracerun=False,
import_auto_in_app=True,
rlock=False,
)


@flaky(until=1706677200)
Expand All @@ -185,7 +176,6 @@ def test_no_known_errors_occur(tmp_path):
SETTINGS_GEVENT_DDTRACERUN,
SETTINGS_GEVENT_DDTRACERUN_MODULE_CLONE,
SETTINGS_GEVENT_DDTRACERUN_DEBUGMODE_MODULE_CLONE,
SETTINGS_GEVENT_SPANAGGREGATOR_NO_RLOCK,
mabdinur marked this conversation as resolved.
Show resolved Hide resolved
]:
with gunicorn_server(gunicorn_server_settings, tmp_path) as context:
_, client = context
Expand Down
Loading