github DataDog/dd-trace-py v4.6.0rc1
4.6.0rc1

pre-release6 hours ago

Estimated end-of-life date, accurate to within three months: 05-2027
See the support level definitions for more information.

Upgrade Notes

  • LLM Observability
    • Experiments spans now contain config from the experiment initialization, allowing for searching of relevant spans using the experiment config.
    • Experiments spans now contain the tags from the dataset records, allowing for searching of relevant spans using the dataset record tags.

Deprecation Notes

  • tracing
    • The type annotation for Span.parent_id will change from Optional[int] to int in v5.0.0.

New Features

  • LLM Observability
    • This introduces LLMObs.get_prompt() to retrieve managed prompts from Datadog's Prompt Registry. The method returns a ManagedPrompt object with a format()
      method for variable substitution. Prompt updates propagate to running applications within the cache TTL (default: 60 seconds).
      Use with annotation_context or annotate to correlate prompts with LLM spans:

      prompt = LLMObs.get_prompt("greeting")
      variables = {"user": "Alice"}
      with LLMObs.annotation_context(prompt=prompt.to_annotation_dict(**variables)):
          openai.chat.completions.create(messages=prompt.format(**variables))
    • experiments propagate canonical_ids from dataset records to the corresponding experiments span when present. The canonical_ids are only guaranteed to be available after calling pull_dataset.

    • LLMObs.create_dataset supports a bulk_upload parameter to control data uploading behavior. Both LLMObs.create_dataset and LLMObs.create_dataset_from_csv supports users specifying the deduplicate parameter.

    • Subset of dataset records can now be pulled with tags by using the tags argument to LLMObs.pull_dataset, provided in a list of strings of key value pairs: LLMObs.pull_dataset(dataset_name="my-dataset", tags=["env:prod", "version:1.0"])

Bug Fixes

  • LLM Observability
    • Fix data duplication issue when uploading > 5MB datasets via LLMObs.create_dataset.
  • profiling
    • A bug which could prevent Profiling from being enabled when the library is installed through Single Step Instrumentation was fixed.
    • This fixes an issue where the profiler was patching the gevent module unnecessarily even when the profiler was not enabled.

Don't miss a new dd-trace-py release

NewReleases is sending notifications on new releases.