Skip to content

[BUG]: LLMObs.annotate raises LLMObsExportSpanError when LLMObs deactivated #17001

@gruebel

Description

@gruebel

Tracer Version(s)

4.6.0

Python Version(s)

3.13.12

Pip Version(s)

24.2

Bug Report

Hi,

the LLMObs.annotate() function doesn't take into account LLMObs can be deactivated and just raises a LLMObsExportSpanError.

I would just do the same check as in the trace methods, like LLMObs.workflow()

if cls.enabled is False:
    log.warning(...)

If interested I can create a PR with the needed change 🙂

Reproduction Code

set DD_TRACE_ENABLED=false

async def run():
    LLMObs.annotate(tags={"key": "value"})

    ...

Error Logs

No response

Libraries in Use

No response

Operating System

No response

Metadata

Metadata

Assignees

Labels

LLMObsLLM Observability relatedbug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions