Skip to content

Document Python agent versioning in SDK reference - #39077

Draft
ncybul wants to merge 1 commit into
masterfrom
dd/nicole.cybul/python-agent-versioning-docs
Draft

Document Python agent versioning in SDK reference#39077
ncybul wants to merge 1 commit into
masterfrom
dd/nicole.cybul/python-agent-versioning-docs

Conversation

@ncybul

@ncybul ncybul commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR do? What is the motivation?

Documents how to set an agent version when manually instrumenting agents with the Python SDK, so you can identify which version of an agent produced a span in the Agent Observability trace view. This documents the SDK support added in DataDog/dd-trace-py#19490.

All edits are in hugo/content/en/llm_observability/instrumentation/sdk.md, within the existing Python tabs:

  • Agents: adds the optional version argument to the agent decorator's arguments, updates the example to @agent(version="v3"), and adds a context-manager example using LLMObs.agent(name="weather-agent", version="v3").
  • Enriching spans: adds the optional agent argument (shape {"version": "..."}, also accepted through the ddtrace.llmobs.Agent typed dictionary) to the LLMObs.annotate() arguments, applied when annotating an agent span.
  • Annotating auto-instrumented spans: adds the same optional agent argument to the LLMObs.annotation_context() arguments and adds an example that versions auto-instrumented agent spans.

How was this tested?

  • Reviewed the rendered additions in context to confirm each one matches the surrounding argument lists and example blocks.
  • Checked the new copy against the Datadog Vale substitution rules by hand (the Vale binary is not available in this environment).

Merge readiness

  • Ready for merge

For Datadog employees:

  • ⚠️ Your branch name MUST follow the <name>/<description> convention and include the forward slash (/). If you've already created your PR with an incorrect branch name, please rename your branch and open a fresh PR.
  • 🤖 New: Comment with /review to run an automated check that catches common issues before a Documentation team member reviews your PR.

AI assistance

Written with Bits Code (Claude Code): it made the documentation edits and drafted this PR description. The content was reviewed for accuracy.

Additional notes


PR by Bits - View session in Datadog

Comment @DataDog to request changes

@datadog-prod-us1-6

Copy link
Copy Markdown
Contributor

View session in Datadog

Bits Code status: ✅ Done

CI Auto-fix: Disabled | Enable

Comment @DataDog to request changes

@datadog-datadog-us1-prod

Copy link
Copy Markdown

I can only run on private repositories.

@github-actions

Copy link
Copy Markdown
Contributor

Preview links (active after the build_preview check completes)

Modified Files

@jhgilbert jhgilbert added the astro-reorg-no-conflicts Needs manual conflict resolution after replatforming reorg label Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astro-reorg-no-conflicts Needs manual conflict resolution after replatforming reorg Bits AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants