Skip to content

Commit 19d4c27

Browse files
docs: fix deprecation guide in release notes (#3347) (#3353)
(cherry picked from commit 48ed395) Co-authored-by: Tahir H. Butt <[email protected]>
1 parent c94cd51 commit 19d4c27

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

docs/advanced_usage.rst

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,29 @@ propagate a `rpc_metadata` dictionary over the wire::
296296
span.set_tag('my_rpc_method', method)
297297

298298

299-
Resolving deprecation warnings
300-
------------------------------
301-
Before upgrading, it’s a good idea to resolve any deprecation warnings raised by your project.
302-
These warnings must be fixed before upgrading, otherwise the ``ddtrace`` library
303-
will not work as expected. Our deprecation messages include the version where
304-
the behavior is altered or removed.
305-
306-
In Python, deprecation warnings are silenced by default. To enable them you may
307-
add the following flag or environment variable::
299+
Upgrading and deprecation warnings
300+
----------------------------------
301+
302+
Before upgrading, we recommend resolving any deprecation warnings raised in your application. The messages for the deprecation warnings include the version when the API will be changed or removed.
303+
304+
.. _upgrade-0.x:
305+
306+
0.x Release Line
307+
^^^^^^^^^^^^^^^^
308+
309+
As of v0.59.0, you can enable warning filters for ddtrace library deprecations.
310+
311+
For those using ``pytest``, add a filter for the ``ddtrace.DDTraceDeprecationWarning`` warning category::
312+
313+
pytest -W "error::ddtrace.DDTraceDeprecationWarning" tests.py
314+
315+
316+
Otherwise, you must set the environment variable ``DD_TRACE_RAISE_DEPRECATIONWARNING`` which will configure the warning filter::
317+
318+
DD_TRACE_RAISE_DEPRECATIONWARNING=1 python app.py
319+
320+
321+
Before v0.59.0, you can still enable all deprecation warnings and filter the application or tests logs for deprecations specific the ``ddtrace`` library::
308322

309323
$ python -Wall app.py
310324

releasenotes/notes/release-1.0-758fc917e40d7eb3.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@ prelude: >
1818
1919
2020
.. note::
21-
Before upgrading to v1.0.0, we recommend installing ``ddtrace>=0.59.0,<1.0.0`` and running tests with `warning filters <https://docs.python.org/3.8/library/warnings.html#warning-filter>`_ set to raise ``ddtrace.warnings.DDTraceV1DeprecationWarning`` as errors or set the environment variable ``DD_TRACE_RAISE_DEPRECATIONWARNING``. For example::
22-
23-
$ DD_TRACE_RAISE_DEPRECATIONWARNING=1 python tests.py
24-
$ pytest -W "error::ddtrace.warnings.DDTraceDeprecationWarning" tests.py
25-
26-
Once all deprecation warnings are addressed you can safely upgrade to v1.0.0.
21+
Before upgrading to v1.0.0, we recommend users enable deprecation warnings after having installed ``ddtrace>=0.59.0,<1.0.0``. See the upgrading and deprecation warnings section on the the :ref:`0.x Release Line <upgrade-0.x>` for further details.
2722
2823
2924
.. csv-table:: Upgrade from 0.x

0 commit comments

Comments
 (0)