Skip to content

Releases: DataDog/dd-trace-py

0.48.3

13 May 22:53
58a7bab

Choose a tag to compare

Bug Fixes

  • grpc: handle no package in fully qualified method.
  • grpc: handle IPv6 addresses and no port in target.
  • grpc: client spans are now marked as measured by default.
  • grpc: fix issue of unfinished spans when response is not a grpc.Future but has the same interface, as is the case with the base future class in google-api-core.

0.48.2

03 May 12:28
98d9807

Choose a tag to compare

Bug Fixes

  • The default agent timeout for profiling has been restored from 2 to 10 seconds to avoid too many profiles from being dropped.

0.48.1

26 Apr 17:48
340f8d4

Choose a tag to compare

Bug Fixes

  • Fix urllib3 patching not properly activating the integration.
  • In certain circumstances, the profiles generated in a uWSGI application could have been empty. This is now fixed and the profiler records correctly the generated events.

0.48.0

01 Apr 21:17
14595b7

Choose a tag to compare

New Features

  • dogpile.cache is now automatically instrumented by default.
  • The Pylons now supports all the standard http tagging including query string, custom error codes, and request/response headers.
  • The ddtrace pytest plugin can now call ddtrace.patch_all via the --ddtrace-patch-all option.
  • Span now accepts a on_finish argument used for specifying functions to call when a span finishes.
  • Adds support for the Datadog Lambda Extension. The tracer will send traces to the extension by default if it is present.
  • Add support for space-separated DD_TAGS.
  • Add urllib3 integration.

Upgrade Notes

  • The deprecated dogstatsd_host and dogstatsd_port arguments to tracer.configure() have been removed.
  • Support for gevent 1.0 has been removed and gevent >= 1.1 is required.
  • flask: deprecated configuration option extra_error_codes has been removed.
  • The deprecated pyddprofile wrapper has been removed. Use ddtrace-run with DD_PROFILING_ENABLED=1 set instead.
  • A ValueError will now be raised on tracer initialization if the Agent URL specified to the initializer or with the environment variable DD_TRACE_AGENT_URL is malformed.
  • uWSGI is no longer supported with ddtrace-run due to a limitation of how tracer initialization occurs. See the updated instructions for enabling tracing in the library uWSGI documentation<uwsgi>.
  • The unused ddtrace.api module has been removed.

Bug Fixes

  • The Records parameter to Firehose endpoint calls is being excluded from the tags to avoid generating traces with a large payload.
  • Tracer: fix configuring tracer with dogstatsd url.
  • elasticsearch: patch versioned elasticsearch modules (elasticsearch1, ..., elasticsearch7).
  • botocore: Do not assume that ResponseMeta exists in the results.
  • django: handle erroneous middleware gracefully.
  • The tracer now captures the task ID from the cgroups file for Fargate >= 1.4.0 and reports it to the agent as the Datadog-Container-ID tag.
  • Fix a bug when tracing a mako DefTemplate or any Template that does not have a filename property.
  • flask: fix a bug when the query string would contain non-Unicode characters.
  • Fix a formatting issue on error exporting profiles.
  • A workaround is provided for the problem with uWSGI worker processes failing to respawn. This can occur when using ddtrace-run for automatic instrumentation and configuration or manual instrumentation and configuration without the necessary uWSGI options. The problem is caused by how the tracer can end up starting threads in the master process before uWSGI forks to initialize the workers processes. To avoid this, we have provided updated instructions for enabling tracing in the library uWSGI documentation.

Other Notes

  • The logic behind the header extraction for distributed tracing has been improved.
  • The default connection timeout for the profiling agent has now been reduced from 10 to 2 seconds to match the tracer behavior.
  • The tracemalloc memory profiler, which was disabled by default, has been removed.
  • Query strings are stripped out from URLs by default when setting URL metadata on a span. This change affects all integrations that store HTTP metadata, like aiohttp, falcon, requests, urllib3.

0.47.0

03 Mar 18:51
9a170dd

Choose a tag to compare

v0.47.0

Upgrade Notes

  • The profiler now automatically sets up uWSGI compatibility in auto mode or with profile_children=True. Make sure that you don't have custom code instrumenting the profiler in those cases.
  • The Tracer class properties DEFAULT_HOSTNAME, DEFAULT_PORT, DEFAULT_DOGSTATSD_PORT, DEFAULT_DOGSTATSD_URL, DEFAULT_AGENT_URL have been removed.
  • elasticsearch: removed get_traced_transport method and ddtrace.contrib.elasticsearch.transport module.

New Features

  • cherrypy: introduce TraceMiddleware for the CherryPy web framework.
  • django: tag root spans as measured.
  • elasticsearch: add support for version 7.
  • fastapi: add integration.
  • Introduce support for the DD_SERVICE_MAPPING environment variable to allow remapping service names on emitted spans.
  • httplib: distributed tracing is now enabled by default.
  • The profiler now supports most operation mode from uWSGI without much configuration. It will automatically plug itself in post fork hooks when multiprocess mode is used.
  • wsgi: add tracing middleware.

Bug Fixes

  • Resolves an issue in Django tracing where, if query_string is not present in request.META, a KeyError is raised, causing the request to 500
  • Deprecate the DD_LOGGING_RATE_LIMIT variable in favor of the standard DD_TRACE_LOGGING_RATE for configuring the logging rate limit.
  • sampler: removed bug causing sample_rate of 0 to be reset to 1, and raise ValueError instead of logging.
  • starlette: unpatch calls correctly.
  • flask: fix memory leak of sampled out traces.
  • Fix CPU time and wall time profiling not ignoring the profiler tasks with gevent.

Other Notes

  • The default maximum CPU time used for the stack profiler (CPU time, wall time and exceptions profiling) has been decreased from 2% to 1%.

0.46.0

27 Jan 17:03
536f52d

Choose a tag to compare

v0.46.0

Upgrade Notes

  • elasticsearch: removed get_traced_transport method and ddtrace.contrib.elasticsearch.transport module.
  • The profiler will only load tags from the DD_TAGS environment variable once at start.
  • flask: Use HTTP Custom Error Codes instead of ddtrace.config.flask['extra_error_codes'].

New Features

  • aiohttp: store request and response headers.
  • bottle: store request and response headers.
  • elasticsearch: add support for version 7.
  • flask: store response headers.
  • molten: store request headers.
  • pyramid: store request and response headers.
  • flask: store request and response headers when auto-instrumented.
  • The ddtrace.profiling.auto module will warn users if gevent monkey patching is done after the profiler is auto-instrumented.
  • The Profiler object can now be passed tags with the tags keyword argument.

Bug Fixes

  • dbapi: avoid type error with potential non-compliance in db libraries when setting tag for row count.
  • django: add legacy resource format of {handler}.
  • grpc: fix wrapper for streaming response to support libraries that call an internal method directly.
  • sanic: use path parameter names instead of parameter values for the resource.
  • The profiler won't deadlock on fork when gevent monkey patch is enabled.
  • requests: fix TracedSession when patches are not applied.

0.45.0

15 Dec 22:26
93f8bbc

Choose a tag to compare

v0.45.0

Prelude

Python 3.9 wheels are now built and published to PyPI.

New Features

  • botocore: added distributed_tracing configuration setting which is enabled by default.

  • The ddtrace-run command now supports the following arguments:

    -h, --help
    -d, --debug      enable debug mode (disabled by default)
    -i, --info       print library info useful for debugging
    -p, --profiling  enable profiling (disabled by default)
    -v, --version    show program's version number and exit

It now also has friendlier error messages when used incorrectly.

  • Add functionality to call gevent.monkey.patch_all() with ddtrace-run by setting the environment variable DD_GEVENT_PATCH_ALL=true. This ensures that gevent patching is done as early as possible in the application.

  • botocore: inject distributed tracing data to ClientContext to trace lambda invocations.

  • botocore: inject tracing data to MessageAttributes.

  • The profiler now tracks the running gevent Greenlet and store it as part of the CPU and wall time profiling information.

  • The profiler is now able to upload profiles to the Datadog Agent by using a Unix Domain Socket.

  • It is now possible to pass a url parameter to the Profiler to specify the Datadog agent location.

  • The new memory profiler for Python is now enabled by default. This improves the profiler memory consumption and performance impact. It can still be disabled by setting DD_PROFILING_MEMALLOC=0 as an environment variable.

  • The profiler now uses the tracer configuration if no configuration is provided.

  • pytest integration. This enables the pytest <https://pytest.org>_ runner to trace test executions.

Upgrade Notes

  • Context.get() has been removed and the functionality has been rolled into Context.close_span().

  • Tracer.record() has similarly been removed as it is no longer useful with Context.get() removed.

  • The deprecated compatibility module ddtrace.profile has been removed.

  • The profiler now uses the tracer configuration if no configuration is provided.

Deprecation Notes

  • The pyddprofile wrapper is deprecated. Use DD_PROFILING_ENABLED=true ddtrace-run instead.

  • The profiler does not catch uncaught exception anymore.

Bug Fixes

  • core: always reset the current_span in the context.

  • django: Http404 exceptions will no longer be flagged as errors

  • django: add safe guards for building http.url span tag.

  • aiobotocore: set span error for 5xx status codes.

  • elasticsearch: set span error for 5xx status codes.

  • django, DRF, ASGI: fix span type for web request spans.

  • Fixes span id tagging in lock profiling.

  • Fix UDS upload for profiling not using the correct path.

  • Fixed an issue in profiling exporting profiles twice when forking.

  • core: fix race condition in TracerTagCollector.

Other Notes

  • Start-up logs are now disabled by default. To enable start-up logs use DD_TRACE_STARTUP_LOGS=true or DD_TRACE_DEBUG=true.

0.44.0

12 Nov 22:01
6b34a97

Choose a tag to compare

Upgrading to 0.44.0

This release adds support for Python 3.9 along with new integrations for pyodbc and Starlette. The profiler also adds lock profiling and better handling for forking process. A bug with encoding traces in the core library is fixed, as well as bug fixes for several integrations.

Release notes are now published as part of our library documentation at https://ddtrace.readthedocs.io/en/stable/release_notes.html.

Core

  • Fix encoding of loose primitive types (#1752)

Integrations

dbapi

  • Support Connection context management usage (#1762)

Django

  • Add check for instrument view MRO (#1744)

Dogpile

  • Safe-guard current_span (#1756)

Flask

  • Store request headers (#1735)

httplib

  • Close spans when exceptions raised (#1702)

pynamodb

  • Patch pynamodb on import (#1724)

pyodbc

Starlette

  • Add Starlette integration (#1676)
  • Add resource aggregation for Starlette (#1714)

Tornado

  • Handle current span being None (#1730)

Profiler

  • Add traces support for lock profiling (#1725)
  • Enable trace/span id tracking by default (#1697)
  • Compile pprof exporter with Cython (#1712)

Full changeset

Read the full changeset.

0.43.1

04 Nov 17:01
c963c6f

Choose a tag to compare

This patch release adds support for context manager usage of PEP 249 database connections in our integrations.

0.43.0

08 Oct 19:18
f46e443

Choose a tag to compare

Upgrading to 0.43.0

This release includes two new integrations and a memory profiling feature in the profiler along with several bug fixes.

Integrations

asgi

  • fix: tag 500-level responses as errors (#1699)
  • fix: set http status when exception raised (#1645)

asyncio

  • fix: enable patch by default (#1660)
  • fix: patch base event loop class (#1661)

django

  • fix: avoid mixing str and non-str args for uri helper (#1679)

sanic

  • Added a sanic integration (#1572)

pynamodb

  • Added a pynamodb integration (#1544)

rediscluster

  • fix: support rediscluster==2.1.0 (#1689)

Profiler

  • Added a memory profiling feature (#1673). This is enabled by default.
  • fix: Fix a potential deadlock on profiler restart after fork() (#1693)

Tracer

  • backport contextvars (#1651)
  • fix: Do not rate limit log lines when in debug (#1680)

Full changeset

Read the full changeset.