Releases: DataDog/dd-trace-py
2.14.6
Bug Fixes
-
Profiling
- Fixes an issue where enabling native exporter via
DD_PROFILING_EXPORT_LIBDD_ENABLED
,DD_PROFILING_TIMELINE_ENABLED
orDD_PROFILING_STACK_V2_ENABLED
turned off live heap profiling. - Fixes an issue where the profiler was allocating too much memory from
ensure_binary_or_empty()
function, on Python versions before 3.12, withDD_PROFILING_EXPORT_LIBDD_ENABLED
orDD_PROFILING_TIMELINE_ENABLED
. - When a Python thread finishes, this change frees memory used for mapping its thread id to
Span
. The mapping is populated and used whenDD_PROFILING_ENDPOINT_COLLECTION_ENABLED
andDD_PROFILING_STACK_V2_ENABLED
were set to enable grouping of profiles for endpoints. - Resolves an issue where asyncio task names are not captured by stack v2, when
DD_PROFILING_STACK_V2_ENABLED
is set.
- Fixes an issue where enabling native exporter via
-
Tracing
- pymongo: Adds type checking to solve an issue where
NoneType
instead of expectedPin
object would throw an error inTracedTopology
method.
- pymongo: Adds type checking to solve an issue where
2.16.0
New Features
-
LLM Observability
- When starting LLM and embedding spans, the
model_name
argument is now optional and will default tocustom
. This applies to both inline methods (e.g.LLMObs.llm()
) and function decorators (e.g.@llm
). - Introduces the ability to add metadata for evaluation metrics via the
submit_evaluation
method. For more information, see submitting evaluations with the SDK.
- When starting LLM and embedding spans, the
-
Tracing
- Introduces support for Baggage as defined by the OpenTelemetry specification.
- botocore: Adds span pointers for successful DynamoDB
BatchWriteItem
spans. Table Primary Keys will need to be provided with theddtrace.config.botocore.dynamodb_primary_key_names_for_tables
option or theDD_BOTOCORE_DYNAMODB_TABLE_PRIMARY_KEYS
environment variable to correctly handle thePutRequest
items. - botocore: Adds span pointers for successful DynamoDB
TransactWriteItems
spans. Table Primary Keys will need to be provided with theddtrace.config.botocore.dynamodb_primary_key_names_for_tables
option or theDD_BOTOCORE_DYNAMODB_TABLE_PRIMARY_KEYS
environment variable to correctly handle thePut
items. - botocore: Adds
ddtrace.config.botocore.add_span_pointers
option or theDD_BOTOCORE_ADD_SPAN_POINTERS
environment variable to control adding span pointers to some successful AWS API requests. This option is enabled by default.
Bug Fixes
-
CI Visibility
- Fixes a bug where
CODEOWNERS
would incorrectly fail to discard line-level trailing comments (eg:@code/owner # my comment
would result in codeowners being parsed as@code/owner
,#
,my
, andcomment
) - Fixes unnecessary logging of an exception that would appear when trying to upload git metadata in an environment without functioning git (eg: missing
git
binary or.git
directory)
- Fixes a bug where
-
Code Security
- Resolves an issue where importing the
google.cloud.storage.batch
module would fail raising an ImportError
- Resolves an issue where importing the
-
Dynamic Instrumentation
- Fixes an issue that prevented dynamic span tags probes from adding the requested tags to the requested span.
-
LLM Observability
- Resolves two issues with annotation contexts:
- annotations registered via annotation contexts were being applied globally. Annotations are now only applied to the current trace context and do not pollute to other threads & processes.
- annotations from nested annotation contexts were applied in a non-deterministic order. Annotations are now applied in the order they were registered.
- Resolves an issue where input and output values equal to zero were not being annotated on workflow, task, agent and tool spans when using
LLMObs.annotate
. - Resolves errors where the disabled setting was being ignored when forking.
- Resolves two issues with annotation contexts:
-
Profiling
- Fixes a data race where span information associated with a thread was read and updated concurrently, leading to segfaults.
- Fixes an issue where enabling native exporter via
DD_PROFILING_EXPORT_LIBDD_ENABLED
,DD_PROFILING_TIMELINE_ENABLED
orDD_PROFILING_STACK_V2_ENABLED
turned off live heap profiling. - When a Python thread finishes, this change frees memory used for mapping its thread id to
Span
. The mapping is populated and used whenDD_PROFILING_ENDPOINT_COLLECTION_ENABLED
andDD_PROFILING_STACK_V2_ENABLED
were set to enable grouping of profiles for endpoints. - Resolves an issue where asyncio task names are not captured by stack v2, when
DD_PROFILING_STACK_V2_ENABLED
is set. - Resolves an issue where endpoint profiling for stack v2 throws
TypeError
exception when it is given aSpan
withNone
span_type.
-
Tracing
- Resolves the issue where tracer flares would not be generated if unexpected types were received in the
AGENT_CONFIG
remote configuration product. - elasticsearch: Resolves an issue where span tags were not fully populated on "sampled" spans, causing metric dimensions to be incorrect when spans were prematurely marked as sampled, including resource_name.
- Resolves the issue where tracer flares would not be generated if unexpected types were received in the
Other Changes
- LLM Observability
- Updates the merging behavior for tags when
LLMObs.annotate
is called multiple times on the same span so that the latest value for a tag key overrides the previous value.
- Updates the merging behavior for tags when
2.16.0rc2
Bug Fixes
- Code Security
- Resolves an issue where importing the
google.cloud.storage.batch
module would fail raising an ImportError
- Resolves an issue where importing the
- Profiling
- Fixes a data race where span information associated with a thread was read and updated concurrently, leading to segfaults
- Fixes an issue where enabling native exporter via
DD_PROFILING_EXPORT_LIBDD_ENABLED
,DD_PROFILING_TIMELINE_ENABLED
orDD_PROFILING_STACK_V2_ENABLED
turned off live heap profiling. - When a Python thread finishes, this change frees memory used for mapping its thread id to
Span
. The mapping is populated and used whenDD_PROFILING_ENDPOINT_COLLECTION_ENABLED
andDD_PROFILING_STACK_V2_ENABLED
were set to enable grouping of profiles for endpoints.
2.13.3
Bug Fixes
-
CI Visibility
- Fixes a bug where
CODEOWNERS
would incorrectly fail to discard line-level trailing comments (eg:@code/owner # my comment
would result in codeowners being parsed as@code/owner
,#
,my
, andcomment
) - Fixes unnecessary logging of an exception that would appear when trying to upload git metadata in an environment without functioning git (eg: missing
git
binary or.git
directory)
- Fixes a bug where
-
Code security
- Resolves an issue where partial matches on function names we aimed to patch were being patched instead of full matches on them.
- Resolves an issue where importing the
google.cloud.storage.batch
module would fail raising an ImportError
-
LLM Observability
- Resolves an issue where LLM Observability evaluation metrics were not being submitted in forked processes. The evaluation metric writer thread now automatically restarts when a forked process is detected.
- Resolves an issue where input and output values equal to zero were not being annotated on workflow, task, agent and tool spans when using
LLMObs.annotate
.
-
Profiling
- Improves the error message when the native exporter fails to load and stops profiling from starting if ddtrace is also being injected.
- Fixes a data race where span information associated with a thread was read and updated concurrently, leading to segfaults
- Resolves an issue where endpoint profiling for stack v2 throws
TypeError
exception when it is given aSpan
withNone
span_type.
-
Tracing
elasticsearch
: Resolves an issue where span tags were not fully populated on "sampled" spans, causing metric dimensions to be incorrect when spans were prematurely marked as sampled, including resource_name.
2.15.1
Bug Fixes
-
LLM Observability: This fix resolves two issues with annotation contexts:
- annotations registered via annotation contexts were being applied globally. Annotations are now only applied to the current trace context and do not pollute to other threads & processes.
- annotations from nested annotation contexts were applied in a non-deterministic order. Annotations are now applied in the order they were registered. -
CI Visibility: fixes a bug where
CODEOWNERS
would incorrectly fail to discard line-level trailing comments (eg:@code/owner # my comment
would result in codeowners being parsed as@code/owner
,#
,my
, andcomment
) -
CI Visibility: fixes unnecessary logging of an exception that would appear when trying to upload git metadata in an environment without functioning git (eg: missing
git
binary or.git
directory) -
dynamic instrumentation: Fixes an issue that prevented dynamic span tags probes from adding the requested tags to the requested span.
-
Code Security: This fix resolves an issue where importing the
google.cloud.storage.batch
module would fail raising an ImportError -
profiling: fix a data race where span information associated with a thread was read and updated concurrently, leading to segfaults
-
profiling: resolves an issue where endpoint profiling for stack v2 throws
TypeError
exception when it is given aSpan
withNone
span_type.
Other Changes
- LLM Observability: Updates the merging behavior for tags when LLMObs.annotate is called multiple times on the same span so that the latest value for a tag key overrides the previous value.
2.14.5
Bug Fixes
- LLM Observability: This fix resolves an issue where LLMObs.enable() did not patch google_generativeai library.
- CI Visibility: fixes a bug where
CODEOWNERS
would incorrectly fail to discard line-level trailing comments (eg:@code/owner # my comment
would result in codeowners being parsed as@code/owner
,#
,my
, andcomment
) - CI Visibility: fixes unnecessary logging of an exception that would appear when trying to upload git metadata in an environment without functioning git (eg: missing
git
binary or.git
directory) - elasticsearch: this fix resolves an issue where span tags were not fully populated on "sampled" spans, causing metric dimensions to be incorrect when spans were prematurely marked as sampled, including resource_name.
- Code security: This fix resolves an issue where partial matches on function names we aimed to patch were being patched instead of full matches on them.
- Code Security: This fix resolves an issue where importing the
google.cloud.storage.batch
module would fail raising an ImportError - profiling: Improves the error message when the native exporter fails to load and stops profiling from starting if ddtrace is also being injected.
- profiling: fix a data race where span information associated with a thread was read and updated concurrently, leading to segfaults
- profiling: resolves an issue where endpoint profiling for stack v2 throws
TypeError
exception when it is given aSpan
withNone
span_type.
2.16.0rc1
New Features
-
LLM Observability
- When starting LLM and embedding spans, the
model_name
argument is now optional and will default tocustom
. This applies to both inline methods (e.g.LLMObs.llm()
) and function decorators (e.g.@llm
). - Introduces the ability to add metadata for evaluation metrics via the
submit_evaluation
method. For more information, see submitting evaluations with the SDK.
- When starting LLM and embedding spans, the
-
Tracing
- Introduces support for Baggage as defined by the OpenTelemetry specification.
botocore
: Adds span pointers for successful DynamoDBBatchWriteItem
spans. Table Primary Keys will need to be provided with theddtrace.config.botocore.dynamodb_primary_key_names_for_tables
option or theDD_BOTOCORE_DYNAMODB_TABLE_PRIMARY_KEYS
environment variable to correctly handle thePutRequest
items.botocore
: Adds span pointers for successful DynamoDBTransactWriteItems
spans. Table Primary Keys will need to be provided with theddtrace.config.botocore.dynamodb_primary_key_names_for_tables
option or theDD_BOTOCORE_DYNAMODB_TABLE_PRIMARY_KEYS
environment variable to correctly handle thePut
items.botocore
: Addsddtrace.config.botocore.add_span_pointers
option or theDD_BOTOCORE_ADD_SPAN_POINTERS
environment variable to control adding span pointers to some successful AWS API requests. This option is enabled by default.elasticsearch
: Resolves an issue where span tags were not fully populated on "sampled" spans, causing metric dimensions to be incorrect when spans were prematurely marked as sampled, includingresource_name
.
Bug Fixes
-
CI Visibility
- Fixes a bug where
CODEOWNERS
would incorrectly fail to discard line-level trailing comments (eg:@code/owner # my comment
would result in codeowners being parsed as@code/owner
,#
,my
, andcomment
) - Fixes unnecessary logging of an exception that would appear when trying to upload git metadata in an environment without functioning git (eg: missing
git
binary or.git
directory)
- Fixes a bug where
-
Dynamic Instrumentation
- Fixes an issue that prevented dynamic span tags probes from adding the requested tags to the requested span.
-
LLM Observability
- Resolves two issues with annotation contexts:
- annotations registered via annotation contexts were being applied globally. Annotations are now only applied to the current trace context and do not pollute to other threads & processes.
- annotations from nested annotation contexts were applied in a non-deterministic order. Annotations are now applied in the order they were registered.
- Resolves an issue where input and output values equal to zero were not being annotated on workflow, task, agent and tool spans when using
LLMObs.annotate
. - Resolves errors where the disabled setting was being ignored when forking.
- Resolves two issues with annotation contexts:
-
Profiling
- Resolves an issue where asyncio task names are not captured by stack v2, when
DD_PROFILING_STACK_V2_ENABLED
is set. - Resolves an issue where endpoint profiling for stack v2 throws
TypeError
exception when it is given aSpan
withNone
span_type.
- Resolves an issue where asyncio task names are not captured by stack v2, when
-
Tracing
- Resolves the issue where tracer flares would not be generated if unexpected types were received in the AGENT_CONFIG remote configuration product.
Other Changes
- LLM Observability
- Updates the merging behavior for tags when
LLMObs.annotate
is called multiple times on the same span so that the latest value for a tag key overrides the previous value.
- Updates the merging behavior for tags when
2.15.0
New Features
-
LLM Observability
- Introduces
prompt
andname
arguments toLLMObs.annotation_context
to support setting an integration generated span's name andprompt
field. For more information on annotation contexts, see the docs here. - langchain: Adds support for tracing
stream
calls on LCEL chains, chat completion models, or completion models. Note that due to an upstream issue with thelangchain
library itself, streamed responses will not be tagged correctly based on the choice index when the underlying model is configured to returnn>1
choices. Please refer to this GitHub issue for more details. - LangChain streamed calls (
llm.stream
,chat_model.stream
, andchain.stream
) submit to LLM Observability.
- Introduces
-
CI Visibility
- Adds the
test_session.name
tag to test events. The test session name can be set via theDD_TEST_SESSION_NAME
environment variable. IfDD_TEST_SESSION_NAME
is not specified, the test session name is set from the CI job id and the test command.
- Adds the
-
Tracing
- Introduces Code Origin for Span, a new feature that allows collecting information about where entry and exit spans have been created in the user code . This feature is disabled by default and can be enabled by setting the
DD_CODE_ORIGIN_FOR_SPANS_ENABLED
environment variable totrue
. - botocore: Adds span pointers for successful DynamoDB
DeleteItem
spans. - botocore: Adds span pointers for successful DynamoDB
PutItem
spans. Table Primary Keys need to be provided with theddtrace.config.botocore.dynamodb_primary_key_names_for_tables
option or theDD_BOTOCORE_DYNAMODB_TABLE_PRIMARY_KEYS
environment variable. - botocore: Adds span pointers for successful DynamoDB
UpdateItem
spans. - botocore: Adds span pointers for successful S3
CompleteMultipartUpload
spans. - botocore: Adds span pointers for successful S3 CopyObject spans.
- Adds
DD_TRACE_HTTP_CLIENT_ERROR_STATUSES
environment variable to configure the list of HTTP status codes that should be considered errors when instrumenting HTTP servers.
- Introduces Code Origin for Span, a new feature that allows collecting information about where entry and exit spans have been created in the user code . This feature is disabled by default and can be enabled by setting the
Deprecation Notes
- Tracing
- The following attributes are now private and should not be accessed directly. The corresponding environment variables should be used instead.
- Use
DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING
instead ofddtrace.config.http_tag_query_string
- Use
DD_TRACE_HEADER_TAGS
instead ofddtrace.config.trace_http_header_tags
- Use
DD_TRACE_REPORT_HOSTNAME
instead ofddtrace.config.report_hostname
- Use
DD_TRACE_HEALTH_METRICS_ENABLED
instead ofddtrace.config.health_metrics_enabled
- Use
DD_TRACE_ANALYTICS_ENABLED
instead ofddtrace.config.analytics_enabled
- Use
DD_TRACE_CLIENT_IP_HEADER
instead ofddtrace.config.client_ip_header
- Use
DD_TRACE_CLIENT_IP_ENABLED
instead ofddtrace.config.retrieve_client_ip
- Use
DD_TRACE_PROPAGATION_HTTP_BAGGAGE_ENABLED
instead ofddtrace.config.propagation_http_baggage_enabled
- Set
DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP
to an empty string instead of settingddtrace.config.global_query_string_obfuscation_disabled
to True (default value is False) - Use
DD_TRACE_METHODS
instead ofddtrace.config.trace_methods
- Use
DD_CIVISIBILITY_LOG_LEVEL
instead ofddtrace.config.ci_visibility_log_level
- Use
- Deprecates the
DD_TRACE_SAMPLE_RATE
environment variable. It will be removed in 3.0.0. UseDD_TRACE_SAMPLING_RULES
to configure sampling rates instead. DD_TRACE_API_VERSION=v0.3
is deprecated. Usev0.4
orv0.5
instead.
- The following attributes are now private and should not be accessed directly. The corresponding environment variables should be used instead.
Bug Fixes
-
Code security
- Resolves an issue where partial matches on function names we aimed to patch were being patched instead of full matches on them.
- Always report a telemetry log error when an IAST propagation error raises, regardless of whether the
_DD_IAST_DEBUG
environment variable is enabled or not. - Ensures that only the IAST propagation context is cleared instead of all contexts, which could otherwise cause propagation loss in multithreaded applications. Additionally, it improves validations in both the Processor and Vulnerability Reporter, depending on whether IAST is active or not.
- Ensures IAST propagation does not raise side effects related to
re.finditer
.
-
LLM Observability
- Resolves an issue where
LLMObs.enable()
did not patch google_generativeai library. - botocore: Fixes the bedrock model and model provider interpretation from
modelId
when using cross-region inference. - Resolves an issue where LLM Observability evaluation metrics were not being submitted in forked processes. The evaluation metric writer thread now automatically restarts when a forked process is detected.
- The OpenAI, LangChain, Anthropic, Bedrock, and Gemini integrations now will handle and log errors during LLM Observability span processing to avoid disrupting user applications.
- Resolves an issue where
-
Profiling
- Improves the error message when the native exporter fails to load and stops profiling from starting if ddtrace is also being injected.
- All files with platform-dependent code have had their filenames updated to reflect the platform they are for. This fixes issues where the wrong file would be used on a given platform.
- Fixes endpoint profiling for stack v2, when
DD_PROFILING_STACK_V2_ENABLED
is set. - Fixes endpoint profiling when using libdatadog exporter, either with
DD_PROFILING_EXPORT_LIBDD_ENABLED
orDD_PROFILING_TIMELINE_ENABLED
. - Enables code provenance when using libdatadog exporter with
DD_PROFILING_EXPORT_LIBDD_ENABLED
,DD_PROFILING_STACK_V2_ENABLED
, orDD_PROFILING_TIMELINE_ENABLED
. - Fixes an issue where stack v2 couldn't be enabled as pthread was not properly linked on some debian based images for aarch64 architecture.
- Fixes an issue where the flame graph was upside down for stack v2 with
DD_PROFILING_STACK_V2_ENABLED
.
-
Tracing
- elasticsearch: Resolves an issue where span tags were not fully populated on "sampled" spans, causing metric dimensions to be incorrect when spans were prematurely marked as sampled, including
resource_name
. - Resolves the issue where tracer flares would not be generated if unexpected types were received in the
AGENT_CONFIG
remote configuration product. - celery: Fixes an issue where
celery.apply
spans didn't close if theafter_task_publish
ortask_postrun
signals didn't get sent when usingapply_async
, which can happen if there is an internal exception during the handling of the task. This update also marks the span as an error if an exception occurs. - celery: Fixes an issue where
celery.apply
spans using task_protocol 1 didn't close by improving the check for the task id in the body. - Removes a reference cycle that caused unnecessary garbage collection for top-level spans.
- Ensures that
http.url
span tag contains the full query string whenDD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP
is set to an empty string. - Ensures
DD_TRACE_RATE_LIMIT
environment variable is only applied to spans for which tracer sampling is configured. For spans not matching sampling rules default rate limits should be applied by the Datadog Agent.
- elasticsearch: Resolves an issue where span tags were not fully populated on "sampled" spans, causing metric dimensions to be incorrect when spans were prematurely marked as sampled, including
-
Other
- Updates import path in FastAPI module to use the new ASGI module location.
Other Changes
- Code Security
- Update default security rules to 1.13.1. This enable Exploit Prevention powered by RASP for LFI and Command Injection by default when ASM is enabled.
2.15.0rc3
Bug Fixes
- Tracing
- elasticsearch: Resolves an issue where span tags were not fully populated on "sampled" spans, causing metric dimensions to be incorrect when spans were prematurely marked as sampled, including
resource_name
.
- elasticsearch: Resolves an issue where span tags were not fully populated on "sampled" spans, causing metric dimensions to be incorrect when spans were prematurely marked as sampled, including
2.15.0rc2
Bug Fixes
- Tracing
- Resolves the issue where tracer flares would not be generated if unexpected types were received in the AGENT_CONFIG remote configuration product.