Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ddtrace/llmobs/_llmobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2573,7 +2573,7 @@ def _activate_llmobs_span(self, span: Span) -> None:
resolved_name = span.resource

initial_tags = {
**config.tags,
**self.tracer._tags,
"version": config.version or "",
"env": config.env or "",
"service": span.service or "",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
fixes:
- |
LLM Observability: Tags set with ``tracer.set_tags()`` are now applied to LLM Observability spans. Previously only tags from ``DD_TAGS`` were applied.
8 changes: 8 additions & 0 deletions tests/llmobs/test_llmobs_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,14 @@ def test_tags(ddtrace_global_config, llmobs, monkeypatch):
)


def test_tracer_set_tags_applied_to_llmobs_spans(llmobs, tracer, monkeypatch):
monkeypatch.setattr(tracer, "_tags", {})
tracer.set_tags({"airid": "air-123"})
with llmobs.workflow(name="test_workflow") as span:
pass
assert get_llmobs_tags(span)["airid"] == "air-123"


@pytest.mark.subprocess(
env={
"DD_API_KEY": "<not-a-real-key>",
Expand Down
Loading