Releases: DataDog/dd-trace-py
0.60.0rc1
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_DEPRECATIONWARNINGto raise library deprecation warnings as errors for those unable to configure warning filters otherwise. -
Add
Span.get_tagsandSpan.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 ofpatch(aiohttp=True). To support legacy behaviorpatch(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_encoderwithin a given request. This does not provide visibility into how long it takes forResponse.render/json.dumps. -
HTTP connections for trace payloads to the agent will be reused when possible.
Deprecation Notes
Span.to_dictis deprecated and will be removed in v1.0.0.ddtrace.Tracer.logis deprecated. Uselogging.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
ddtracefrom source on macOS 12. - Fixes wrong numbers of memory allocation being reported in the memory profiler.
- pymongo: fix
write_commandbeing patched with the wrong method signature.
Other Notes
- tracing/internal: disable Datadog internal tag propagation
0.59.1
Bug Fixes
- Fix issue building
ddtracefrom source on macOS 12. - Fixes wrong numbers of memory allocation being reported in the memory profiler.
- pymongo: fix
write_commandbeing patched with the wrong method signature.
1.0.0rc1
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_sampleris removed. - Default value of
DD_CALL_BASIC_CONFIGwas updated fromTruetoFalse. Calllogging.basicConfig()to configure logging in your application. ddtrace.settings.Config.HTTPServerConfigis removed.- cassandra:
get_traced_cassandrais removed. Useddtrace.patch(cassandra=True)orddtrace.patch_all()instead. - celery:
ddtrace.contrib.celery.patch_taskis removed. Useddtrace.patch(celery=True)orddtrace.patch_all()instead. - celery:
ddtrace.contrib.celery.unpatch_taskis removed. Useddtrace.contrib.celery.unpatch()instead. ddrace.context.Context.cloneis removed. This is no longer needed since the tracer now supports asynchronous frameworks out of the box.- The deprecated module
ddtrace.contrib.utilis removed. - The deprecated module
ddtrace.compatis removed. - The deprecated module
ddtrace.encodingis removed. - The deprecated modules
ddtrace.httpandddtrace.http.headersare removed. Useddtrace.contrib.trace_utils.set_http_metato store request and response headers on a span. - Remove deprecated
ddtrace.install_excepthook. - Remove deprecated
ddtrace.uninstall_excepthook. - The deprecated module
ddtrace.monkeyis removed. Useddtrace.patchorddtrace.patch_allinstead. - The deprecated module
ddtrace.propagation.utilsis removed. - The deprecated module
ddtrace.utilsand its submodules are removed:ddtrace.utils.attrddtrace.utils.attrdictddtrace.utils.cacheddtrace.utils.configddtrace.utils.deprecationddtrace.utils.formatsddtrace.utils.httpddtrace.utils.importlibddtrace.utils.timeddtrace.utils.versionddtrace.utils.wrappers
ddtrace.Tracer.sampleris removed.ddtrace.Tracer.priority_sampleris removed.ddtrace.Tracer.tagsis removed. Use the environment variableDD_TAGSto set the global tags instead.ddtrace.Tracer.logwas removed.- The deprecated module
ddtrace.ext.errorsis removed. Use theddtrace.constantsmodule instead:from ddtrace.constants import ERROR_MSG from ddtrace.constants import ERROR_STACK from ddtrace.constants import ERROR_TYPE - The deprecated module
ddtrace.ext.priorityis removed. Use theddtrace.constantsmodule instead for setting sampling priority tags:from ddtrace.constants import USER_KEEP from ddtrace.constants import USER_REJECT - The deprecated module
ddtrace.ext.systemis removed. Useddtrace.constants.PIDinstead. - The deprecated method
ddtrace.helpers.get_correlation_idsis removed. Useddtrace.Tracer.get_log_correlation_context()instead. - The legacy environment variables
DD_SERVICE_NAMEandDATADOG_SERVICE_NAMEare removed. UseDD_SERVICEinstead. - mongoengine: The deprecated method
ddtrace.contrib.mongoengine.trace_mongoengineis removed. Useddtrace.patch(mongoengine=True)orddtrace.patch()instead. - mysql: The deprecated method
ddtrace.contrib.mysql.get_traced_mysql_connectionis removed. Useddtrace.patch(mysql=True)orddtrace.patch_all()instead. Pin.appis removed.Pin.app_typeis removed.- psycopg:
ddtrace.contrib.psycopg.connection_factoryis removed. Useddtrace.patch(psycopg=True)orddtrace.patch_all()instead. - requests: The legacy distributed tracing configuration is removed. Use
ddtrace.config.requests[‘distributed_tracing’]instead. ddtrace.Span.metais removed. Useddtrace.Span.get_tag()andddtrace.Span.set_tag()instead.ddtrace.Span.metricsis removed. Useddtrace.Span.get_metric()andddtrace.Span.set_metric()instead.ddtrace.Span.pprintis removed.Span.traceris removed.- The deprecated tracer argument is removed from
ddtrace.Span.__init__(). - sqlite3:
ddtrace.contrib.sqlite3.connection_factoryis removed. Useddtrace.patch(sqlite3=True)orddtrace.patch_all()instead. - Remove deprecated attribute
ddtrace.Tracer.debug_logging. Set the logging level for theddtrace.tracerlogger instead:
...
0.59.0
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_DEPRECATIONWARNINGto 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_KEYis deprecated. Usesettings={"FILTERS": ...}instead when callingtracer.configure.ddtrace.constants.NUMERIC_TAGSis deprecated.ddtrace.constants.LOG_SPAN_KEYis deprecated.Pin.appis deprecated.ddtrace.Span.set_metais deprecated. Useddtrace.Span.set_taginstead.ddtrace.Span.set_metasis deprecated. Useddtrace.Span.set_tagsinstead.ddtrace.Span.metricsis deprecated. Useddtrace.Span.get_metricandddtrace.Span.set_metricinstead.ddtrace.Span.traceris deprecated.ddtrace.Tracer.logis deprecated. Useddtrace.tracer.loginstead.ddtrace.Tracer.sampleris deprecated.ddtrace.Tracer.priority_sampleris deprecated.ddtrace.Tracer.tagsis deprecated. Use the environment variableDD_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.utilsmodule. - 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 formypy. - flask: fix resource naming of request span when errors occur in middleware.
- Fix issue when
httpxservice name isbytes. - Fixes build issues on older MacOS versions by updating
libddwafto 1.0.18 - pytest: fix unsafe access to xfail reason.
Other Notes
- tracing/internal: disable Datadog internal tag propagation
0.59.0rc3
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_DEPRECATIONWARNINGto raise library deprecation warnings as errors for those unable to configure warning filters otherwise.
0.59.0rc2
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
Bug Fixes
- tracing/internal: fix encoding of propagated internal tags.
0.59.0rc1
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_KEYis deprecated. Usesettings={"FILTERS": ...}instead when callingtracer.configure.ddtrace.constants.NUMERIC_TAGSis deprecated.ddtrace.constants.LOG_SPAN_KEYis deprecated.Pin.appis deprecated.ddtrace.Span.set_metais deprecated. Useddtrace.Span.set_taginstead.ddtrace.Span.set_metasis deprecated. Useddtrace.Span.set_tagsinstead.ddtrace.Span.metricsis deprecated. Useddtrace.Span.get_metricandddtrace.Span.set_metricinstead.ddtrace.Span.traceris deprecated.ddtrace.Tracer.logis deprecated. Useddtrace.tracer.loginstead.ddtrace.Tracer.sampleris deprecated.ddtrace.Tracer.priority_sampleris deprecated.ddtrace.Tracer.tagsis deprecated. Use the environment variableDD_TAGS<dd-tags>to set the global tags instead.
Bug Fixes
- Fix internal import of deprecated
ddtrace.utilsmodule. - 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 formypy. - flask: fix resource naming of request span when errors occur in middleware.
- Fix issue when
httpxservice name isbytes. - Fixes build issues on older MacOS versions by updating
libddwafto 1.0.18 - pytest: fix unsafe access to xfail reason.
0.58.4
0.58.3
Bug Fixes
- Fixes build issues on older MacOS versions by updating
libddwafto 1.0.18