Skip to content

Releases: DataDog/dd-trace-py

0.60.0rc1

14 Mar 17:41
4d0e4c7

Choose a tag to compare

0.60.0rc1 Pre-release
Pre-release

Prelude

In preparation for the upcoming v1.0.0 release, we recommend users enable deprecation warnings after having installed ddtrace>=0.59.0,<1.0.0. See the Upgrading and deprecation warnings section for further details.

New Features

  • Add environment variable DD_TRACE_RAISE_DEPRECATIONWARNING to raise library deprecation warnings as errors for those unable to configure warning filters otherwise.

  • Add Span.get_tags and Span.get_metrics.

  • aiohttp: add client integration. This integration traces requests made using the aiohttp client and includes support for distributed tracing. See the documentation for more information.

  • aiohttp_jinja2: move into new integration. Formerly the aiohttp_jinja2 instrumentation was enabled using the aiohttp integration. Use patch(aiohttp_jinja2=True) instead of patch(aiohttp=True). To support legacy behavior patch(aiohttp=True) will still enable aiohttp_jinja2.

  • fastapi: add support for tracing fastapi.routing.serialize_response.

    This will give an insight into how much time is spent calling jsonable_encoder within a given request. This does not provide visibility into how long it takes for Response.render/json.dumps.

  • HTTP connections for trace payloads to the agent will be reused when possible.

Deprecation Notes

  • Span.to_dict is deprecated and will be removed in v1.0.0.
  • ddtrace.Tracer.log is deprecated. Use logging.getLogger("ddtrace.tracer") instead.
  • Tracer.write() is deprecated. Writing spans to the writer through the tracer is not supported.

Bug Fixes

  • tracing/internal: fix encoding of propagated internal tags.
  • Fix issue building ddtrace from source on macOS 12.
  • Fixes wrong numbers of memory allocation being reported in the memory profiler.
  • pymongo: fix write_command being patched with the wrong method signature.

Other Notes

  • tracing/internal: disable Datadog internal tag propagation

0.59.1

09 Mar 13:25
d0187b3

Choose a tag to compare

Bug Fixes

  • Fix issue building ddtrace from source on macOS 12.
  • Fixes wrong numbers of memory allocation being reported in the memory profiler.
  • pymongo: fix write_command being patched with the wrong method signature.

1.0.0rc1

01 Mar 16:48
19d4c27

Choose a tag to compare

1.0.0rc1 Pre-release
Pre-release

Prelude

The Datadog APM Python team is happy to announce the release of v1.0.0 of ddtrace.

The first commit to the library was made on June 20, 2016. Nearly sixty minor releases later, the library has grown immensely. The library now includes over 60 integrations for libraries. Moreover, the library has expanded out from tracing to support the Continuous Profiler and CI Visibility.

Our motivations for this major version release were:

  • Clarify and simplify the public API.
  • Introduce a versioning policy.
  • Provide users a painless upgrade path.

Upgrading and deprecation warnings

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.

As of v0.59.0, you can enable warning filters for ddtrace library deprecations.

For those using pytest, add a filter for the ddtrace.DDTraceDeprecationWarning warning category:

pytest -W "error::ddtrace.DDTraceDeprecationWarning" tests.py

Otherwise, you must set the environment variable DD_TRACE_RAISE_DEPRECATIONWARNING which will configure the warning filter:

DD_TRACE_RAISE_DEPRECATIONWARNING=1 python app.py

Before v0.59.0, you can still enable all deprecation warnings and filter the application or tests logs for deprecations specific the ddtrace library:

$ python -Wall app.py

# or

$ PYTHONWARNINGS=all python app.py  

Summary of 0.x deprecations

Note Affected
Removed DATADOG_*
Removed DATADOG_SERVICE_NAME
Disabled, Deprecated DD_CALL_BASIC_CONFIG
Removed DD_LOGGING_RATE_LIMIT
Removed DD_SERVICE_NAME
Removed DD_TRACER_PARTIAL_FLUSH_ENABLED
Removed DD_TRACER_PARTIAL_FLUSH_MIN_SPANS
Removed ddtrace.Tracer.debug_logging
Removed ddtrace.Tracer.get_call_context
Removed ddtrace.Tracer.tags
Removed ddtrace.Tracer.writer
Removed ddtrace.Tracer.__call__
Removed ddtrace.Tracer.global_excepthook
Removed ddtrace.Tracer.log
Removed ddtrace.Tracer.priority_sampler
Removed ddtrace.Tracer.sampler
Removed ddtrace.Tracer.set_service_info
Removed ddtrace.Span.tracer
Removed ddtrace.Span.__init__(tracer=)
Removed ddtrace.Span.meta
Removed ddtrace.Span.metrics
Removed ddtrace.Span.set_meta
Removed ddtrace.Span.set_metas
Removed ddtrace.Span.pprint
Removed ddtrace.Pin.app
Removed ddtrace.Pin.app_type
Removed ddtrace.context.Context.clone
Removed ddtrace.compat
Removed ddtrace.contrib.util
Removed ddtrace.encoding
Removed ddtrace.ext.SpanTypes
Removed ddtrace.ext.errors
Removed ddtrace.ext.priority
Removed ddtrace.ext.system
Removed ddtrace.helpers.get_correlation_ids
Removed ddtrace.http
Removed ddtrace.monkey
Removed ddtrace.propagation.utils
Removed ddtrace.Sampler.default_sampler
Removed ddtrace.settings.Config.HTTPServerConfig
Removed ddtrace.util
Removed ddtrace.utils
Removed ddtrace.contrib.cassandra.get_traced_cassandra
Removed ddtrace.contrib.celery.patch_task
Removed ddtrace.contrib.celery.unpatch_task
Removed ddtrace.contrib.mongoengine.trace_mongoengine
Removed ddtrace.contrib.mysql.get_traced_mysql_connection
Removed ddtrace.contrib.psycopg.connection_factory
Removed ddtrace.contrib.requests.legacy
Removed ddtrace.contrib.sqlite3.connection_factory

New Features

  • HTTP connections for trace payloads to the agent will be reused when possible.

Upgrade Notes

  • The deprecated attribute ddtrace.Sampler.default_sampler is removed.
  • Default value of DD_CALL_BASIC_CONFIG was updated from True to False. Call logging.basicConfig() to configure logging in your application.
  • ddtrace.settings.Config.HTTPServerConfig is removed.
  • cassandra: get_traced_cassandra is removed. Use ddtrace.patch(cassandra=True) or ddtrace.patch_all() instead.
  • celery: ddtrace.contrib.celery.patch_task is removed. Use ddtrace.patch(celery=True) or ddtrace.patch_all() instead.
  • celery: ddtrace.contrib.celery.unpatch_task is removed. Use ddtrace.contrib.celery.unpatch() instead.
  • ddrace.context.Context.clone is removed. This is no longer needed since the tracer now supports asynchronous frameworks out of the box.
  • The deprecated module ddtrace.contrib.util is removed.
  • The deprecated module ddtrace.compat is removed.
  • The deprecated module ddtrace.encoding is removed.
  • The deprecated modules ddtrace.http and ddtrace.http.headers are removed. Use ddtrace.contrib.trace_utils.set_http_meta to store request and response headers on a span.
  • Remove deprecated ddtrace.install_excepthook.
  • Remove deprecated ddtrace.uninstall_excepthook.
  • The deprecated module ddtrace.monkey is removed. Use ddtrace.patch or ddtrace.patch_all instead.
  • The deprecated module ddtrace.propagation.utils is removed.
  • The deprecated module ddtrace.utils and its submodules are removed:
    • ddtrace.utils.attr
    • ddtrace.utils.attrdict
    • ddtrace.utils.cache
    • ddtrace.utils.config
    • ddtrace.utils.deprecation
    • ddtrace.utils.formats
    • ddtrace.utils.http
    • ddtrace.utils.importlib
    • ddtrace.utils.time
    • ddtrace.utils.version
    • ddtrace.utils.wrappers
  • ddtrace.Tracer.sampler is removed.
  • ddtrace.Tracer.priority_sampler is removed.
  • ddtrace.Tracer.tags is removed. Use the environment variable DD_TAGS to set the global tags instead.
  • ddtrace.Tracer.log was removed.
  • The deprecated module ddtrace.ext.errors is removed. Use the ddtrace.constants module instead:
    from ddtrace.constants import ERROR_MSG
    from ddtrace.constants import ERROR_STACK
    from ddtrace.constants import ERROR_TYPE
    
  • The deprecated module ddtrace.ext.priority is removed. Use the ddtrace.constants module instead for setting sampling priority tags:
    from ddtrace.constants import USER_KEEP
    from ddtrace.constants import USER_REJECT
    
  • The deprecated module ddtrace.ext.system is removed. Use ddtrace.constants.PID instead.
  • The deprecated method ddtrace.helpers.get_correlation_ids is removed. Use ddtrace.Tracer.get_log_correlation_context() instead.
  • The legacy environment variables DD_SERVICE_NAME and DATADOG_SERVICE_NAME are removed. Use DD_SERVICE instead.
  • mongoengine: The deprecated method ddtrace.contrib.mongoengine.trace_mongoengine is removed. Use ddtrace.patch(mongoengine=True) or ddtrace.patch() instead.
  • mysql: The deprecated method ddtrace.contrib.mysql.get_traced_mysql_connection is removed. Use ddtrace.patch(mysql=True) or ddtrace.patch_all() instead.
  • Pin.app is removed.
  • Pin.app_type is removed.
  • psycopg: ddtrace.contrib.psycopg.connection_factory is removed. Use ddtrace.patch(psycopg=True) or ddtrace.patch_all() instead.
  • requests: The legacy distributed tracing configuration is removed. Use ddtrace.config.requests[‘distributed_tracing’] instead.
  • ddtrace.Span.meta is removed. Use ddtrace.Span.get_tag() and ddtrace.Span.set_tag() instead.
  • ddtrace.Span.metrics is removed. Use ddtrace.Span.get_metric() and ddtrace.Span.set_metric() instead.
  • ddtrace.Span.pprint is removed.
  • Span.tracer is removed.
  • The deprecated tracer argument is removed from ddtrace.Span.__init__().
  • sqlite3: ddtrace.contrib.sqlite3.connection_factory is removed. Use ddtrace.patch(sqlite3=True) or ddtrace.patch_all() instead.
  • Remove deprecated attribute ddtrace.Tracer.debug_logging. Set the logging level for the ddtrace.tracer logger instead:
    ...
Read more

0.59.0

02 Mar 15:48
1a6bad3

Choose a tag to compare

Release Notes

Prelude

In preparation for the upcoming v1.0.0 release, we recommend users enable deprecation warnings after having installed ddtrace>=0.59.0,<1.0.0. See the Upgrading and deprecation warnings section for further details.

New Features

  • Add environment variable DD_TRACE_RAISE_DEPRECATIONWARNING to raise library deprecation warnings as errors for those unable to configure warning filters otherwise.
  • The profiler now reports asyncio tasks as part as the task field in profiles. This is enabled by default by replacing the default asyncio loop policy. CPU time, wall time and threading lock times are supported.
  • Add tracing support for sanic>=21.9.0.

Deprecation Notes

  • Tracer.write() is deprecated. Writing spans to the writer through the tracer is not supported.
  • ddtrace.constants.FILTERS_KEY is deprecated. Use settings={"FILTERS": ...} instead when calling tracer.configure.
  • ddtrace.constants.NUMERIC_TAGS is deprecated.
  • ddtrace.constants.LOG_SPAN_KEY is deprecated.
  • Pin.app is deprecated.
  • ddtrace.Span.set_meta is deprecated. Use ddtrace.Span.set_tag instead.
  • ddtrace.Span.set_metas is deprecated. Use ddtrace.Span.set_tags instead.
  • ddtrace.Span.metrics is deprecated. Use ddtrace.Span.get_metric and ddtrace.Span.set_metric instead.
  • ddtrace.Span.tracer is deprecated.
  • ddtrace.Tracer.log is deprecated. Use ddtrace.tracer.log instead.
  • ddtrace.Tracer.sampler is deprecated.
  • ddtrace.Tracer.priority_sampler is deprecated.
  • ddtrace.Tracer.tags is deprecated. Use the environment variable DD_TAGS<dd-tags> to set the global tags instead.

Bug Fixes

  • tracing/internal: fix encoding of propagated internal tags.
  • Fix internal import of deprecated ddtrace.utils module.
  • Set correct service in logs correlation attributes when a span override the service.
  • Fixes import path to not reference __init__. This could otherwise be a problem for mypy.
  • flask: fix resource naming of request span when errors occur in middleware.
  • Fix issue when httpx service name is bytes.
  • Fixes build issues on older MacOS versions by updating libddwaf to 1.0.18
  • pytest: fix unsafe access to xfail reason.

Other Notes

  • tracing/internal: disable Datadog internal tag propagation

0.59.0rc3

01 Mar 16:41
1a6bad3

Choose a tag to compare

0.59.0rc3 Pre-release
Pre-release

Release Notes

Prelude

In preparation for the upcoming v1.0.0 release, we recommend users enable deprecation warnings after having installed ddtrace>=0.59.0,<1.0.0. See the Upgrading and deprecation warnings section for further details.

New Features

  • Add environment variable DD_TRACE_RAISE_DEPRECATIONWARNING to raise library deprecation warnings as errors for those unable to configure warning filters otherwise.

0.59.0rc2

25 Feb 00:31
8874774

Choose a tag to compare

0.59.0rc2 Pre-release
Pre-release

Deprecation Notes

  • Tracer.write() is deprecated. Writing spans to the writer through the tracer is not supported.

Bug Fixes

  • tracing/internal: fix encoding of propagated internal tags.

Other Notes

  • tracing/internal: disable Datadog internal tag propagation

0.58.5

24 Feb 22:36
63ca2f5

Choose a tag to compare

Bug Fixes

  • tracing/internal: fix encoding of propagated internal tags.

0.59.0rc1

18 Feb 19:07
7c18eca

Choose a tag to compare

0.59.0rc1 Pre-release
Pre-release

New Features

  • The profiler now reports asyncio tasks as part as the task field in profiles. This is enabled by default by replacing the default asyncio loop policy. CPU time, wall time and threading lock times are supported.
  • Add tracing support for sanic>=21.9.0.

Deprecation Notes

  • ddtrace.constants.FILTERS_KEY is deprecated. Use settings={"FILTERS": ...} instead when calling tracer.configure.
  • ddtrace.constants.NUMERIC_TAGS is deprecated.
  • ddtrace.constants.LOG_SPAN_KEY is deprecated.
  • Pin.app is deprecated.
  • ddtrace.Span.set_meta is deprecated. Use ddtrace.Span.set_tag instead.
  • ddtrace.Span.set_metas is deprecated. Use ddtrace.Span.set_tags instead.
  • ddtrace.Span.metrics is deprecated. Use ddtrace.Span.get_metric and ddtrace.Span.set_metric instead.
  • ddtrace.Span.tracer is deprecated.
  • ddtrace.Tracer.log is deprecated. Use ddtrace.tracer.log instead.
  • ddtrace.Tracer.sampler is deprecated.
  • ddtrace.Tracer.priority_sampler is deprecated.
  • ddtrace.Tracer.tags is deprecated. Use the environment variable DD_TAGS<dd-tags> to set the global tags instead.

Bug Fixes

  • Fix internal import of deprecated ddtrace.utils module.
  • Set correct service in logs correlation attributes when a span override the service.
  • Fixes import path to not reference __init__. This could otherwise be a problem for mypy.
  • flask: fix resource naming of request span when errors occur in middleware.
  • Fix issue when httpx service name is bytes.
  • Fixes build issues on older MacOS versions by updating libddwaf to 1.0.18
  • pytest: fix unsafe access to xfail reason.

0.58.4

18 Feb 20:54
fad0fcd

Choose a tag to compare

Bug Fixes

  • Set correct service in logs correlation attributes when a span override the service.

0.58.3

17 Feb 20:38
0fd25c4

Choose a tag to compare

Bug Fixes

  • Fixes build issues on older MacOS versions by updating libddwaf to 1.0.18