Skip to content

Commit 7222f7d

Browse files
fix(llmobs): properly parse DD_TAGS onto span events' tags [backport 3.12] (#14322)
Backport 8ac5581 from #14320 to 3.12. Properly parse `DD_TAGS` onto the llmobs span events' tags field. ### Manual testing Running `DD_TAGS="foo:bar,buz:bax" python test.py` against ```python from ddtrace.llmobs import LLMObs LLMObs.enable(ml_app="sam-test") with LLMObs.workflow(name="test"): pass ``` gives the following tags on the span event <img width="1386" height="106" alt="Screenshot 2025-08-15 at 2 48 57 PM" src="https://github.com/user-attachments/assets/32ac31e0-ab79-46c2-9ad5-5a99b4fa8bd5" /> ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) Co-authored-by: Sam Brenner <[email protected]>
1 parent d89952e commit 7222f7d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

ddtrace/llmobs/_llmobs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,9 @@ def _llmobs_span_event(self, span: Span) -> Optional[LLMObsSpanEvent]:
409409

410410
@staticmethod
411411
def _llmobs_tags(span: Span, ml_app: str, session_id: Optional[str] = None) -> List[str]:
412+
dd_tags = config.tags
412413
tags = {
414+
**dd_tags,
413415
"version": config.version or "",
414416
"env": config.env or "",
415417
"service": span.service or "",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
fixes:
3+
- |
4+
LLM Observability: Properly parse ``DD_TAGS`` onto LLM Observability span events' tags.

0 commit comments

Comments
 (0)