AgentOps
Integrate Agno with AgentOps to send traces and logs to a centralized observability platform.
Integrating Agno with AgentOps
AgentOps provides automatic instrumentation for your Agno agents to track all operations including agent interactions, team coordination, tool usage, and workflow execution.
Set OpenAI Key
Set your OPENAI_API_KEY as an environment variable. You can get one from OpenAI.
export OPENAI_API_KEY=sk-***Prerequisites
-
Install Dependencies
Ensure you have the necessary packages installed:
uv pip install agentops agno openai -
Authentication Go to AgentOps and copy your API key
export AGENTOPS_API_KEY="your-api-key"
Logging Model Calls with AgentOps
Use AgentOps to log your Agno agent's model calls.
import agentops
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
# Initialize AgentOps
agentops.init()
# Create and run an agent
agent = Agent(model=OpenAIResponses(id="gpt-5.2"))
response = agent.run("Share a 2 sentence horror story")
# Print the response
print(response.content)Notes
- Environment Variables: Ensure your environment variable is correctly set for the AgentOps API key.
- Initialization: Call
agentops.init()to initialize AgentOps. - AgentOps Docs: AgentOps Docs