Skip to main content

Create a Splunk Agent Observability Account

First, navigate to your Splunk Agent Observability homepage and create an account.

Add your first trace

This guide works with Python, using OpenAI, Azure OpenAI service, Anthropic, or Gemini LLMs.
1

Install dependencies

Install the Splunk Agent Observability SDK with OpenAI support and the dotenv package using the following command in your terminal:
2

Set up your environment variables

Create an .env file in your project folder, and set:
Having trouble setting up your .env file? Visit this guide
3

Create your application code

Create a file called app.py (Python) and add the following code:
This code will create a new project in Splunk Agent Observability called MyFirstEvaluation, with an Agent Stream called MyFirstAgentStream. It will then log a trace using the call to the LLM.
This code uses a default LLM model. If you want to use a different model, update the model_name.
4

Run your application

Run your application using the following command in your terminal:
5

View the results in your terminal

You can see the model’s output in your terminal:
The model asks for the information it needs to plan the trip. The exact response might differ depending on the model and when you run the application.The output will also contain links to your project and Agent Stream in Splunk Agent Observability.
6

See the trace in Splunk Agent Observability

Open the Agent Stream for your project in the Splunk Agent Observability UI using the URL output to your terminal. You will see the logged trace.The first trace in Splunk Agent ObservabilitySelect the trace, then navigate to the Messages tab to see details of the trace.The Messages tab for the first trace in Splunk Agent Observability
πŸŽ‰ Congratulations, you have logged your first trace! Your next step is to evaluate this trace using Splunk Agent Observability evaluators, and use this evaluation to improve the LLM prompts to get a better response.

Troubleshooting

  • I need a Splunk Agent Observability API key: Visit this guide
  • What’s my project name and Agent Stream name?: These names were set when you created a new project. If you haven’t created a new project, head to Splunk Agent Observability and select the New Project button.

Next steps

Evaluate your first trace

Learn how to create evaluators for your trace with Splunk Agent Observability and improve your application.

Sample projects

Learn how to get started with the Splunk Agent Observability sample projects that are included in every new account.

Integrate with third-party frameworks

Learn about the Splunk Agent Observability integrations with third-party SDKs to automatically log your applications.

Cookbooks

Cookbooks

Learn how to perform common tasks with Splunk Agent Observability, work with third-party integrations, and use evaluations to solve AI problems.

SDK reference

Python SDK Reference

The Splunk Agent Observability Python SDK reference.