Skip to main content
The OpenAI Agents SDK has built-in tracing to log agent runs, and this can be extended to log to platforms like Splunk Agent Observability. The Splunk Agent Observability Python SDK can use a custom OpenAI tracing processor that logs all agent events, allowing you to evaluate your agentic apps using Splunk Agent Observability evaluators.

SplunkAOTracingProcessor

The SplunkAOTracingProcessor SDK reference.

Integrate Splunk Agent Observability into an OpenAI Agents SDK app

Get hands on integrating Splunk Agent Observability into an agentic app using the OpenAI Agents SDK.

Log an OpenAI Agent app

To log OpenAI Agent apps to Splunk Agent Observability, you need to create an instance of the SplunkAOTracingProcessor, and set this as the default tracing processor for your agent using the set_trace_processors function from the OpenAI Agents SDK.
Once this is set, all agent events, such as tool calls, handoffs, and generations, will be logged to Splunk Agent Observability. A graph of an agent call in Splunk Agent Observability showing guardrails and response generation A set of spans in Splunk Agent Observability showing an OpenAI Agent running guardrails, handoffs, and generating responses By default the tracing processor using the current logger at the time it is created. For example, if you create this processor in a function that is decorated with the @log wrapper, then the processor will log to the same logger. You can override this by passing a SplunkAOLogger into the SplunkAOTracingProcessor constructor.

Next steps

Splunk Agent Observability logger

Log with full control over sessions, traces, and spans using the Splunk Agent Observability logger.

Log decorator

Quickly add logging to your code with the log decorator and wrapper.

Splunk Agent Observability context

Manage logging using the Splunk Agent Observability context manager.