Skip to content

Commit f67d65e

Browse files
author
lievan
committed
set trace processors
1 parent 8d54664 commit f67d65e

File tree

1 file changed

+3
-2
lines changed
  • ddtrace/contrib/internal/openai_agents

1 file changed

+3
-2
lines changed

ddtrace/contrib/internal/openai_agents/patch.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import agents
2-
from agents.tracing import add_trace_processor
2+
from agents.tracing import set_trace_processors
33

44
from ddtrace import config
55
from ddtrace.contrib.internal.openai_agents.processor import LLMObsTraceProcessor
@@ -35,7 +35,7 @@ def patch():
3535
_span_processor = LLMObsTraceProcessor(
3636
integration=OpenAIAgentsIntegration(integration_config=config.openai_agents),
3737
)
38-
add_trace_processor(_span_processor)
38+
set_trace_processors([_span_processor])
3939

4040

4141
def unpatch():
@@ -52,5 +52,6 @@ def unpatch():
5252
_span_processor._integration.clear_state()
5353
_span_processor = None
5454
_span_processor = NoOpTraceProcessor()
55+
set_trace_processors([])
5556

5657
agents._datadog_patch = False

0 commit comments

Comments
 (0)